Skip to content

Commit

Permalink
chore: migrate pubsub to the PHP microgenerator
Browse files Browse the repository at this point in the history
Committer: @miraleung
PiperOrigin-RevId: 377315573
  • Loading branch information
Google APIs authored and Copybara-Service committed Jun 3, 2021
1 parent b52a804 commit 76a52a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 277 deletions.
11 changes: 6 additions & 5 deletions google/pubsub/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,14 @@ go_gapic_assembly_pkg(

##############################################################################
# PHP
# DO NOT OVERRIDE this PHP microgenerator section with autogenerated rules.
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
php_gapic_assembly_pkg = "php_gapic_assembly_pkg2",
php_gapic_library = "php_gapic_library2",
php_grpc_library = "php_grpc_library2",
php_proto_library = "php_proto_library2",
)

php_proto_library(
Expand All @@ -191,7 +192,7 @@ php_grpc_library(

php_gapic_library(
name = "pubsub_php_gapic",
src = ":pubsub_proto_with_info",
srcs = [":pubsub_proto_with_info"],
gapic_yaml = "pubsub_gapic.yaml",
grpc_service_config = "pubsub_grpc_service_config.json",
service_yaml = ":pubsub_v1.yaml",
Expand Down
272 changes: 0 additions & 272 deletions google/pubsub/v1/pubsub_gapic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,234 +6,10 @@ language_settings:
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
Expand All @@ -246,51 +22,3 @@ interfaces:
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

0 comments on commit 76a52a5

Please sign in to comment.