diff --git a/google/cloud/servicecontrol_v1/services/quota_controller/async_client.py b/google/cloud/servicecontrol_v1/services/quota_controller/async_client.py index 924d723..72f7bba 100644 --- a/google/cloud/servicecontrol_v1/services/quota_controller/async_client.py +++ b/google/cloud/servicecontrol_v1/services/quota_controller/async_client.py @@ -34,8 +34,7 @@ class QuotaControllerAsyncClient: - """`Google Quota Control - API `__ + """`Google Quota Control API `__ Allows clients to allocate and release quota against a `managed service `__. diff --git a/google/cloud/servicecontrol_v1/services/quota_controller/client.py b/google/cloud/servicecontrol_v1/services/quota_controller/client.py index 5733c03..aa2f324 100644 --- a/google/cloud/servicecontrol_v1/services/quota_controller/client.py +++ b/google/cloud/servicecontrol_v1/services/quota_controller/client.py @@ -71,8 +71,7 @@ def get_transport_class(cls, label: str = None,) -> Type[QuotaControllerTranspor class QuotaControllerClient(metaclass=QuotaControllerClientMeta): - """`Google Quota Control - API `__ + """`Google Quota Control API `__ Allows clients to allocate and release quota against a `managed service `__. diff --git a/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc.py b/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc.py index 8e51c74..f15ca5c 100644 --- a/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc.py +++ b/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc.py @@ -31,8 +31,7 @@ class QuotaControllerGrpcTransport(QuotaControllerTransport): """gRPC backend transport for QuotaController. - `Google Quota Control - API `__ + `Google Quota Control API `__ Allows clients to allocate and release quota against a `managed service `__. diff --git a/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc_asyncio.py b/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc_asyncio.py index 1702fd2..513eeba 100644 --- a/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc_asyncio.py +++ b/google/cloud/servicecontrol_v1/services/quota_controller/transports/grpc_asyncio.py @@ -33,8 +33,7 @@ class QuotaControllerGrpcAsyncIOTransport(QuotaControllerTransport): """gRPC AsyncIO backend transport for QuotaController. - `Google Quota Control - API `__ + `Google Quota Control API `__ Allows clients to allocate and release quota against a `managed service `__. diff --git a/google/cloud/servicecontrol_v1/services/service_controller/async_client.py b/google/cloud/servicecontrol_v1/services/service_controller/async_client.py index a03b7d3..90935a7 100644 --- a/google/cloud/servicecontrol_v1/services/service_controller/async_client.py +++ b/google/cloud/servicecontrol_v1/services/service_controller/async_client.py @@ -34,8 +34,7 @@ class ServiceControllerAsyncClient: - """`Google Service Control - API `__ + """`Google Service Control API `__ Lets clients check and report operations against a `managed service `__. @@ -186,7 +185,7 @@ async def check( NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has - the size limit of 64KB. + the size limit (wire-format byte size) of 1MB. This method requires the ``servicemanagement.services.check`` permission on the specified service. For more information, see @@ -215,7 +214,16 @@ async def check( # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.check, - default_timeout=None, + default_retry=retries.Retry( + initial=1.0, + maximum=10.0, + multiplier=1.3, + predicate=retries.if_exception_type( + core_exceptions.ServiceUnavailable, + ), + deadline=5.0, + ), + default_timeout=5.0, client_info=DEFAULT_CLIENT_INFO, ) @@ -275,7 +283,7 @@ async def report( # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( self._client._transport.report, - default_timeout=None, + default_timeout=16.0, client_info=DEFAULT_CLIENT_INFO, ) diff --git a/google/cloud/servicecontrol_v1/services/service_controller/client.py b/google/cloud/servicecontrol_v1/services/service_controller/client.py index b1a6c4a..04eb198 100644 --- a/google/cloud/servicecontrol_v1/services/service_controller/client.py +++ b/google/cloud/servicecontrol_v1/services/service_controller/client.py @@ -73,8 +73,7 @@ def get_transport_class( class ServiceControllerClient(metaclass=ServiceControllerClientMeta): - """`Google Service Control - API `__ + """`Google Service Control API `__ Lets clients check and report operations against a `managed service `__. @@ -359,7 +358,7 @@ def check( NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has - the size limit of 64KB. + the size limit (wire-format byte size) of 1MB. This method requires the ``servicemanagement.services.check`` permission on the specified service. For more information, see diff --git a/google/cloud/servicecontrol_v1/services/service_controller/transports/base.py b/google/cloud/servicecontrol_v1/services/service_controller/transports/base.py index 6bc2054..b2bbce7 100644 --- a/google/cloud/servicecontrol_v1/services/service_controller/transports/base.py +++ b/google/cloud/servicecontrol_v1/services/service_controller/transports/base.py @@ -158,10 +158,21 @@ def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { self.check: gapic_v1.method.wrap_method( - self.check, default_timeout=None, client_info=client_info, + self.check, + default_retry=retries.Retry( + initial=1.0, + maximum=10.0, + multiplier=1.3, + predicate=retries.if_exception_type( + core_exceptions.ServiceUnavailable, + ), + deadline=5.0, + ), + default_timeout=5.0, + client_info=client_info, ), self.report: gapic_v1.method.wrap_method( - self.report, default_timeout=None, client_info=client_info, + self.report, default_timeout=16.0, client_info=client_info, ), } diff --git a/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc.py b/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc.py index 34443e1..f9e67bd 100644 --- a/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc.py +++ b/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc.py @@ -31,8 +31,7 @@ class ServiceControllerGrpcTransport(ServiceControllerTransport): """gRPC backend transport for ServiceController. - `Google Service Control - API `__ + `Google Service Control API `__ Lets clients check and report operations against a `managed service `__. @@ -246,7 +245,7 @@ def check( NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has - the size limit of 64KB. + the size limit (wire-format byte size) of 1MB. This method requires the ``servicemanagement.services.check`` permission on the specified service. For more information, see diff --git a/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc_asyncio.py b/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc_asyncio.py index bf717a5..67595d8 100644 --- a/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc_asyncio.py +++ b/google/cloud/servicecontrol_v1/services/service_controller/transports/grpc_asyncio.py @@ -33,8 +33,7 @@ class ServiceControllerGrpcAsyncIOTransport(ServiceControllerTransport): """gRPC AsyncIO backend transport for ServiceController. - `Google Service Control - API `__ + `Google Service Control API `__ Lets clients check and report operations against a `managed service `__. @@ -251,7 +250,7 @@ def check( NOTE: the [CheckRequest][google.api.servicecontrol.v1.CheckRequest] has - the size limit of 64KB. + the size limit (wire-format byte size) of 1MB. This method requires the ``servicemanagement.services.check`` permission on the specified service. For more information, see diff --git a/google/cloud/servicecontrol_v1/types/distribution.py b/google/cloud/servicecontrol_v1/types/distribution.py index c3791df..5c5ffa0 100644 --- a/google/cloud/servicecontrol_v1/types/distribution.py +++ b/google/cloud/servicecontrol_v1/types/distribution.py @@ -15,6 +15,8 @@ # import proto # type: ignore +from google.api import distribution_pb2 # type: ignore + __protobuf__ = proto.module( package="google.api.servicecontrol.v1", manifest={"Distribution",}, @@ -70,6 +72,9 @@ class Distribution(proto.Message): Buckets with exponentially growing width. explicit_buckets (google.cloud.servicecontrol_v1.types.Distribution.ExplicitBuckets): Buckets with arbitrary user-provided width. + exemplars (Sequence[google.api.distribution_pb2.Exemplar]): + Example points. Must be in increasing order of ``value`` + field. """ class LinearBuckets(proto.Message): @@ -155,6 +160,9 @@ class ExplicitBuckets(proto.Message): explicit_buckets = proto.Field( proto.MESSAGE, number=9, oneof="bucket_option", message=ExplicitBuckets, ) + exemplars = proto.RepeatedField( + proto.MESSAGE, number=10, message=distribution_pb2.Distribution.Exemplar, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/servicecontrol_v1/types/metric_value.py b/google/cloud/servicecontrol_v1/types/metric_value.py index c679029..fa81d37 100644 --- a/google/cloud/servicecontrol_v1/types/metric_value.py +++ b/google/cloud/servicecontrol_v1/types/metric_value.py @@ -15,7 +15,7 @@ # import proto # type: ignore -from google.cloud.servicecontrol_v1.types import distribution +from google.cloud.servicecontrol_v1.types import distribution as gas_distribution from google.protobuf import timestamp_pb2 # type: ignore @@ -33,15 +33,18 @@ class MetricValue(proto.Message): for the overriding relationship. Note that this map must not contain monitored resource labels. start_time (google.protobuf.timestamp_pb2.Timestamp): - The start of the time period over which this - metric value's measurement applies. The time - period has different semantics for different - metric types (cumulative, delta, and gauge). See - the metric definition documentation in the - service configuration for details. + The start of the time period over which this metric value's + measurement applies. The time period has different semantics + for different metric types (cumulative, delta, and gauge). + See the metric definition documentation in the service + configuration for details. If not specified, + [google.api.servicecontrol.v1.Operation.start_time][google.api.servicecontrol.v1.Operation.start_time] + will be used. end_time (google.protobuf.timestamp_pb2.Timestamp): - The end of the time period over which this - metric value's measurement applies. + The end of the time period over which this metric value's + measurement applies. If not specified, + [google.api.servicecontrol.v1.Operation.end_time][google.api.servicecontrol.v1.Operation.end_time] + will be used. bool_value (bool): A boolean value. int64_value (int): @@ -62,7 +65,7 @@ class MetricValue(proto.Message): double_value = proto.Field(proto.DOUBLE, number=6, oneof="value",) string_value = proto.Field(proto.STRING, number=7, oneof="value",) distribution_value = proto.Field( - proto.MESSAGE, number=8, oneof="value", message=distribution.Distribution, + proto.MESSAGE, number=8, oneof="value", message=gas_distribution.Distribution, ) diff --git a/google/cloud/servicecontrol_v1/types/quota_controller.py b/google/cloud/servicecontrol_v1/types/quota_controller.py index db2c7b1..0b74958 100644 --- a/google/cloud/servicecontrol_v1/types/quota_controller.py +++ b/google/cloud/servicecontrol_v1/types/quota_controller.py @@ -16,6 +16,7 @@ import proto # type: ignore from google.cloud.servicecontrol_v1.types import metric_value +from google.rpc import status_pb2 # type: ignore __protobuf__ = proto.module( @@ -176,6 +177,9 @@ class QuotaError(proto.Message): description (str): Free-form text that provides details on the cause of the error. + status (google.rpc.status_pb2.Status): + Contains additional information about the quota error. If + available, ``status.code`` will be non zero. """ class Code(proto.Enum): @@ -196,6 +200,7 @@ class Code(proto.Enum): code = proto.Field(proto.ENUM, number=1, enum=Code,) subject = proto.Field(proto.STRING, number=2,) description = proto.Field(proto.STRING, number=3,) + status = proto.Field(proto.MESSAGE, number=4, message=status_pb2.Status,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/tests/unit/gapic/servicecontrol_v1/test_quota_controller.py b/tests/unit/gapic/servicecontrol_v1/test_quota_controller.py index f913e86..7ddba9f 100644 --- a/tests/unit/gapic/servicecontrol_v1/test_quota_controller.py +++ b/tests/unit/gapic/servicecontrol_v1/test_quota_controller.py @@ -24,6 +24,7 @@ from proto.marshal.rules.dates import DurationRule, TimestampRule +from google.api import distribution_pb2 # type: ignore from google.api_core import client_options from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -41,10 +42,11 @@ from google.cloud.servicecontrol_v1.services.quota_controller.transports.base import ( _GOOGLE_AUTH_VERSION, ) -from google.cloud.servicecontrol_v1.types import distribution +from google.cloud.servicecontrol_v1.types import distribution as gas_distribution from google.cloud.servicecontrol_v1.types import metric_value from google.cloud.servicecontrol_v1.types import quota_controller from google.oauth2 import service_account +from google.protobuf import any_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore import google.auth diff --git a/tests/unit/gapic/servicecontrol_v1/test_service_controller.py b/tests/unit/gapic/servicecontrol_v1/test_service_controller.py index 94b51bf..526d1fd 100644 --- a/tests/unit/gapic/servicecontrol_v1/test_service_controller.py +++ b/tests/unit/gapic/servicecontrol_v1/test_service_controller.py @@ -24,6 +24,7 @@ from proto.marshal.rules.dates import DurationRule, TimestampRule +from google.api import distribution_pb2 # type: ignore from google.api_core import client_options from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -42,7 +43,7 @@ _GOOGLE_AUTH_VERSION, ) from google.cloud.servicecontrol_v1.types import check_error -from google.cloud.servicecontrol_v1.types import distribution +from google.cloud.servicecontrol_v1.types import distribution as gas_distribution from google.cloud.servicecontrol_v1.types import http_request from google.cloud.servicecontrol_v1.types import log_entry from google.cloud.servicecontrol_v1.types import metric_value