Skip to content
Permalink
Browse files
fix: Modify synth.py to update grpc transport options (#266)
* fix: Modify synth.py to update grpc transport options.

* fix: tweak regex replace

* chore: regen other docs

* chore: make replace required

* chore: remove unused import

Co-authored-by: Bu Sun Kim <busunkim@google.com>
  • Loading branch information
dpcollins-google and busunkim96 committed Dec 28, 2020
1 parent fd2840c commit 41dcd30636168f3dd1248f1d99170d531fc9bcb8
Showing with 6,763 additions and 264 deletions.
  1. +1 −0 .flake8
  2. +1 −1 .pre-commit-config.yaml
  3. +5 −6 CONTRIBUTING.rst
  4. +29 −4 google/cloud/pubsub_v1/proto/pubsub.proto
  5. +289 −0 google/cloud/pubsub_v1/proto/schema.proto
  6. +4 −43 google/cloud/pubsub_v1/publisher/client.py
  7. +5 −49 google/cloud/pubsub_v1/subscriber/client.py
  8. +32 −0 google/pubsub/__init__.py
  9. +28 −0 google/pubsub_v1/__init__.py
  10. +5 −3 google/pubsub_v1/services/publisher/async_client.py
  11. +16 −3 google/pubsub_v1/services/publisher/client.py
  12. +5 −3 google/pubsub_v1/services/publisher/transports/grpc.py
  13. +5 −3 google/pubsub_v1/services/publisher/transports/grpc_asyncio.py
  14. +24 −0 google/pubsub_v1/services/schema_service/__init__.py
  15. +858 −0 google/pubsub_v1/services/schema_service/async_client.py
  16. +1,050 −0 google/pubsub_v1/services/schema_service/client.py
  17. +148 −0 google/pubsub_v1/services/schema_service/pagers.py
  18. +35 −0 google/pubsub_v1/services/schema_service/transports/__init__.py
  19. +227 −0 google/pubsub_v1/services/schema_service/transports/base.py
  20. +480 −0 google/pubsub_v1/services/schema_service/transports/grpc.py
  21. +493 −0 google/pubsub_v1/services/schema_service/transports/grpc_asyncio.py
  22. +2 −2 google/pubsub_v1/services/subscriber/async_client.py
  23. +2 −2 google/pubsub_v1/services/subscriber/client.py
  24. +4 −2 google/pubsub_v1/services/subscriber/transports/grpc.py
  25. +4 −2 google/pubsub_v1/services/subscriber/transports/grpc_asyncio.py
  26. +28 −0 google/pubsub_v1/types/__init__.py
  27. +34 −0 google/pubsub_v1/types/pubsub.py
  28. +249 −0 google/pubsub_v1/types/schema.py
  29. +7 −1 scripts/fixup_pubsub_v1_keywords.py
  30. +7 −105 synth.metadata
  31. +17 −5 synth.py
  32. +76 −26 tests/unit/gapic/pubsub_v1/test_publisher.py
  33. +2,587 −0 tests/unit/gapic/pubsub_v1/test_schema_service.py
  34. +2 −0 tests/unit/gapic/pubsub_v1/test_subscriber.py
  35. +2 −2 tests/unit/pubsub_v1/publisher/test_publisher_client.py
  36. +2 −2 tests/unit/pubsub_v1/subscriber/test_subscriber_client.py
@@ -26,6 +26,7 @@ exclude =
*_pb2.py

# Standard linting exemptions.
**/.nox/**
__pycache__,
.git,
*.pyc,
@@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
@@ -21,8 +21,8 @@ In order to add a feature:
- The feature must be documented in both the API and narrative
documentation.

- The feature must work fully on the following CPython versions: 2.7,
3.5, 3.6, 3.7 and 3.8 on both UNIX and Windows.
- The feature must work fully on the following CPython versions:
3.6, 3.7, 3.8 and 3.9 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
@@ -202,25 +202,24 @@ Supported Python Versions

We support:

- `Python 3.5`_
- `Python 3.6`_
- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_

.. _Python 3.5: https://docs.python.org/3.5/
.. _Python 3.6: https://docs.python.org/3.6/
.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/


Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/python-pubsub/blob/master/noxfile.py

Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.

We also explicitly decided to support Python 3 beginning with version
3.5. Reasons for this include:
3.6. Reasons for this include:

- Encouraging use of newest versions of Python 3
- Taking the lead of `prominent`_ open-source `projects`_
@@ -24,6 +24,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/pubsub/v1/schema.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Cloud.PubSub.V1";
@@ -42,8 +43,8 @@ service Publisher {
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/pubsub";

// Creates the given topic with the given name. See the [resource name rules](
// https://cloud.google.com/pubsub/docs/admin#resource_names).
// Creates the given topic with the given name. See the [resource name rules]
// (https://cloud.google.com/pubsub/docs/admin#resource_names).
rpc CreateTopic(Topic) returns (Topic) {
option (google.api.http) = {
put: "/v1/{name=projects/*/topics/*}"
@@ -143,6 +144,21 @@ message MessageStoragePolicy {
repeated string allowed_persistence_regions = 1;
}

// Settings for validating messages published against a schema.
message SchemaSettings {
// Required. The name of the schema that messages published should be
// validated against. Format is `projects/{project}/schemas/{schema}`. The
// value of this field will be `_deleted-schema_` if the schema has been
// deleted.
string schema = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "pubsub.googleapis.com/Schema" }
];

// The encoding of messages validated against `schema`.
Encoding encoding = 2;
}

// A topic resource.
message Topic {
option (google.api.resource) = {
@@ -173,6 +189,15 @@ message Topic {
//
// The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
string kms_key_name = 5;

// Settings for validating messages published against a schema.
//
// EXPERIMENTAL: Schema support is in development and may not work yet.
SchemaSettings schema_settings = 6;

// Reserved for future use. This field is set only in responses from the
// server; it is ignored if it is set in any requests.
bool satisfies_pzs = 7;
}

// A message that is published by publishers and consumed by subscribers. The
@@ -587,8 +612,8 @@ service Subscriber {
}

// Seeks an existing subscription to a point in time or to a given snapshot,
// whichever is provided in the request. Snapshots are used in [Seek](
// https://cloud.google.com/pubsub/docs/replay-overview) operations, which
// whichever is provided in the request. Snapshots are used in [Seek]
// (https://cloud.google.com/pubsub/docs/replay-overview) operations, which
// allow you to manage message acknowledgments in bulk. That is, you can set
// the acknowledgment state of messages in an existing subscription to the
// state captured by a snapshot. Note that both the subscription and the
Loading

0 comments on commit 41dcd30

Please sign in to comment.