Skip to content
Permalink
Browse files
feat: Added the gRPC service config for the Service Controller v1 API (
…#38)

PiperOrigin-RevId: 381355331

Source-Link: googleapis/googleapis@da5f842

Source-Link: googleapis/googleapis-gen@71481c8
  • Loading branch information
gcf-owl-bot committed Jun 26, 2021
1 parent 6d1d504 commit b95a7673dd59b2b84cd8d203ea3c05fc08d8b59e
@@ -34,8 +34,7 @@


class QuotaControllerAsyncClient:
"""`Google Quota Control
API <https://cloud.google.com/service-control/overview>`__
"""`Google Quota Control API </service-control/overview>`__
Allows clients to allocate and release quota against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -71,8 +71,7 @@ def get_transport_class(cls, label: str = None,) -> Type[QuotaControllerTranspor


class QuotaControllerClient(metaclass=QuotaControllerClientMeta):
"""`Google Quota Control
API <https://cloud.google.com/service-control/overview>`__
"""`Google Quota Control API </service-control/overview>`__
Allows clients to allocate and release quota against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -31,8 +31,7 @@
class QuotaControllerGrpcTransport(QuotaControllerTransport):
"""gRPC backend transport for QuotaController.
`Google Quota Control
API <https://cloud.google.com/service-control/overview>`__
`Google Quota Control API </service-control/overview>`__
Allows clients to allocate and release quota against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -33,8 +33,7 @@
class QuotaControllerGrpcAsyncIOTransport(QuotaControllerTransport):
"""gRPC AsyncIO backend transport for QuotaController.
`Google Quota Control
API <https://cloud.google.com/service-control/overview>`__
`Google Quota Control API </service-control/overview>`__
Allows clients to allocate and release quota against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -34,8 +34,7 @@


class ServiceControllerAsyncClient:
"""`Google Service Control
API <https://cloud.google.com/service-control/overview>`__
"""`Google Service Control API </service-control/overview>`__
Lets clients check and report operations against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -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,
)

@@ -73,8 +73,7 @@ def get_transport_class(


class ServiceControllerClient(metaclass=ServiceControllerClientMeta):
"""`Google Service Control
API <https://cloud.google.com/service-control/overview>`__
"""`Google Service Control API </service-control/overview>`__
Lets clients check and report operations against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -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
@@ -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,
),
}

@@ -31,8 +31,7 @@
class ServiceControllerGrpcTransport(ServiceControllerTransport):
"""gRPC backend transport for ServiceController.
`Google Service Control
API <https://cloud.google.com/service-control/overview>`__
`Google Service Control API </service-control/overview>`__
Lets clients check and report operations against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -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
@@ -33,8 +33,7 @@
class ServiceControllerGrpcAsyncIOTransport(ServiceControllerTransport):
"""gRPC AsyncIO backend transport for ServiceController.
`Google Service Control
API <https://cloud.google.com/service-control/overview>`__
`Google Service Control API </service-control/overview>`__
Lets clients check and report operations against a `managed
service <https://cloud.google.com/service-management/reference/rpc/google.api/servicemanagement.v1#google.api.servicemanagement.v1.ManagedService>`__.
@@ -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
@@ -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))
@@ -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,
)


@@ -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))
@@ -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

@@ -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

0 comments on commit b95a767

Please sign in to comment.