type: com.google.api.codegen.ConfigProto
config_schema_version: 2.0.0
language_settings:
  java:
    package_name: com.google.cloud.pubsub.v1
    interface_names:
      google.pubsub.v1.Publisher: TopicAdmin
      google.pubsub.v1.Subscriber: SubscriptionAdmin
    release_level: GA
  python:
    package_name: google.cloud.pubsub_v1.gapic
    release_level: GA
  go:
    package_name: cloud.google.com/go/pubsub/apiv1
    domain_layer_location: cloud.google.com/go/pubsub
    release_level: GA
  csharp:
    package_name: Google.Cloud.PubSub.V1
    interface_names:
      google.pubsub.v1.Publisher: PublisherServiceApi
      google.pubsub.v1.Subscriber: SubscriberServiceApi
    release_level: GA
  ruby:
    package_name: Google::Cloud::PubSub::V1
    release_level: BETA
  php:
    package_name: Google\Cloud\PubSub\V1
    release_level: GA
  nodejs:
    package_name: pubsub.v1
    domain_layer_location: google-cloud
    release_level: GA
collections:
# Language overrides are for backward-compatibility in Java.
- entity_name: snapshot
  language_overrides:
  - language: java
    entity_name: project_snapshot
# Language overrides are for backward-compatibility in Java.
- entity_name: subscription
  language_overrides:
  - language: java
    entity_name: project_subscription
interfaces:
- name: google.pubsub.v1.Subscriber
  # Deprecated collections are for backward-compatibility in Ruby, PHP and Python
  deprecated_collections:
  - name_pattern: "projects/{project}/topics/{topic}"
    entity_name: topic
  lang_doc:
    java: To retrieve messages from a subscription, see the Subscriber class.
  retry_codes_def:
  - name: idempotent
    retry_codes:
    - UNKNOWN
    - ABORTED
    - UNAVAILABLE
  - name: non_idempotent
    retry_codes:
    - UNAVAILABLE
  - name: streaming_pull
    retry_codes:
    - DEADLINE_EXCEEDED
    - RESOURCE_EXHAUSTED
    - ABORTED
    - INTERNAL
    - UNAVAILABLE
  retry_params_def:
  - name: default
    initial_retry_delay_millis: 100
    retry_delay_multiplier: 1.3
    max_retry_delay_millis: 60000  # 60 seconds
    initial_rpc_timeout_millis: 60000  # 60 seconds
    rpc_timeout_multiplier: 1
    max_rpc_timeout_millis: 60000  # 60 seconds
    total_timeout_millis: 600000  # 10 minutes
  - name: messaging
    initial_retry_delay_millis: 100
    retry_delay_multiplier: 1.3
    max_retry_delay_millis: 60000  # 60 seconds
    initial_rpc_timeout_millis: 25000  # 25 seconds
    rpc_timeout_multiplier: 1
    max_rpc_timeout_millis: 25000  # 25 seconds
    total_timeout_millis: 600000  # 10 minutes
  - name: streaming_messaging
    initial_retry_delay_millis: 100
    retry_delay_multiplier: 1.3
    max_retry_delay_millis: 60000  # 60 seconds
    initial_rpc_timeout_millis: 600000  # 10 minutes
    rpc_timeout_multiplier: 1
    max_rpc_timeout_millis: 600000  # 10 minutes
    total_timeout_millis: 600000  # 10 minutes
  methods:
  # TODO: remove the per method retry_codes_name field once
  # https://github.com/googleapis/gapic-generator/issues/3137
  # is fixed
  - name: CreateSubscription
    retry_codes_name: idempotent
  - name: GetSubscription
    retry_codes_name: idempotent
  - name: UpdateSubscription
    retry_codes_name: non_idempotent
    sample_code_init_fields:
    - update_mask.paths[0]="ack_deadline_seconds"
    - subscription.ack_deadline_seconds=42
  - name: ListSubscriptions
    retry_codes_name: idempotent
  - name: DeleteSubscription
    retry_codes_name: non_idempotent
  - name: GetSnapshot
    surface_treatments:
    - include_languages:
      - go
      - java
      - csharp
      - ruby
      - nodejs
      - python
      - php
      visibility: PACKAGE
  - name: ModifyAckDeadline
    retry_codes_name: non_idempotent
    surface_treatments:
    - include_languages:
      - java
      visibility: PACKAGE
  - name: Acknowledge
    retry_codes_name: non_idempotent
    retry_params_name: messaging
    surface_treatments:
    - include_languages:
      - java
      visibility: PACKAGE
  - name: Pull
    retry_codes_name: idempotent
    retry_params_name: messaging
    surface_treatments:
    - include_languages:
      - java
      visibility: PACKAGE
  - name: StreamingPull
    retry_codes_name: streaming_pull
    retry_params_name: streaming_messaging
    timeout_millis: 900000
    surface_treatments:
    - include_languages:
      - java
      visibility: PACKAGE
  - name: ModifyPushConfig
    retry_codes_name: non_idempotent
  - name: ListSnapshots
    retry_codes_name: idempotent
  - name: CreateSnapshot
    retry_codes_name: non_idempotent
  - name: UpdateSnapshot
    retry_codes_name: non_idempotent
    sample_code_init_fields:
    - update_mask.paths[0]="expire_time"
    - snapshot.expire_time.seconds=123456
  - name: DeleteSnapshot
    retry_codes_name: non_idempotent
  - name: Seek
    retry_codes_name: idempotent
  - name: SetIamPolicy
    retry_codes_name: non_idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
  - name: GetIamPolicy
    retry_codes_name: idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
  - name: TestIamPermissions
    retry_codes_name: non_idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
- name: google.pubsub.v1.Publisher
  lang_doc:
    java: To publish messages to a topic, see the Publisher class.
  smoke_test:
    method: ListTopics
    init_fields:
    - project%project=$PROJECT_ID
  retry_codes_def:
  - name: idempotent
    retry_codes:
    - UNKNOWN
    - ABORTED
    - UNAVAILABLE
  - name: non_idempotent
    retry_codes:
    - UNAVAILABLE
  - name: none
    retry_codes: []
  - name: publish
    retry_codes:
    - ABORTED
    - CANCELLED
    - INTERNAL
    - RESOURCE_EXHAUSTED
    - UNKNOWN
    - UNAVAILABLE
    - DEADLINE_EXCEEDED
  retry_params_def:
  - name: default
    initial_retry_delay_millis: 100
    retry_delay_multiplier: 1.3
    max_retry_delay_millis: 60000  # 60 seconds
    initial_rpc_timeout_millis: 60000  # 60 seconds
    rpc_timeout_multiplier: 1
    max_rpc_timeout_millis: 60000  # 60 seconds
    total_timeout_millis: 600000  # 10 minutes
  - name: messaging
    initial_retry_delay_millis: 100
    retry_delay_multiplier: 1.3
    max_retry_delay_millis: 60000  # 60 seconds
    initial_rpc_timeout_millis: 5000  # 5 seconds
    rpc_timeout_multiplier: 1.3
    max_rpc_timeout_millis: 60000  # 60 seconds
    total_timeout_millis: 60000  # 60 seconds
  methods:
  - name: CreateTopic
    retry_codes_name: non_idempotent
  - name: UpdateTopic
    retry_codes_name: non_idempotent
  - name: Publish
    retry_codes_name: publish
    retry_params_name: messaging
    batching:
      thresholds:
        element_count_threshold: 100
        element_count_limit: 1000     # TO BE REMOVED LATER
        request_byte_threshold: 1048576  # 1 MiB
        request_byte_limit: 10485760  # TO BE REMOVED LATER
        delay_threshold_millis: 10
      batch_descriptor:
        batched_field: messages
        discriminator_fields:
        - topic
        subresponse_field: message_ids
    sample_code_init_fields:
    - messages[0].data
    surface_treatments:
    - include_languages:
      - java
      visibility: PACKAGE
  - name: GetTopic
    retry_codes_name: idempotent
  - name: ListTopics
    retry_codes_name: idempotent
  - name: ListTopicSubscriptions
    retry_codes_name: idempotent
  - name: ListTopicSnapshots
    surface_treatments:
    - include_languages:
      - go
      - java
      - csharp
      - ruby
      - nodejs
      - python
      - php
      visibility: PACKAGE
  - name: DeleteTopic
    retry_codes_name: non_idempotent
  - name: SetIamPolicy
    retry_codes_name: non_idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    # TODO: surface_treatments are here only to make bazel presubmit pass
    # they can be removed once presubmit starts using gapic-generator-go
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
  - name: GetIamPolicy
    retry_codes_name: idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
  - name: TestIamPermissions
    retry_codes_name: non_idempotent
    reroute_to_grpc_interface: google.iam.v1.IAMPolicy
    surface_treatments:
    - include_languages:
      - go
      visibility: DISABLED
