Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions google/cloud/servicecontrol/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,18 +14,19 @@
# limitations under the License.
#

from google.cloud.servicecontrol_v1.services.quota_controller.async_client import (
QuotaControllerAsyncClient,
)
from google.cloud.servicecontrol_v1.services.quota_controller.client import (
QuotaControllerClient,
)
from google.cloud.servicecontrol_v1.services.service_controller.async_client import (
ServiceControllerAsyncClient,
from google.cloud.servicecontrol_v1.services.quota_controller.async_client import (
QuotaControllerAsyncClient,
)
from google.cloud.servicecontrol_v1.services.service_controller.client import (
ServiceControllerClient,
)
from google.cloud.servicecontrol_v1.services.service_controller.async_client import (
ServiceControllerAsyncClient,
)

from google.cloud.servicecontrol_v1.types.check_error import CheckError
from google.cloud.servicecontrol_v1.types.distribution import Distribution
from google.cloud.servicecontrol_v1.types.http_request import HttpRequest
Expand All @@ -46,11 +46,11 @@
from google.cloud.servicecontrol_v1.types.service_controller import ReportResponse

__all__ = (
"AllocateQuotaRequest",
"AllocateQuotaResponse",
"QuotaControllerClient",
"QuotaControllerAsyncClient",
"ServiceControllerClient",
"ServiceControllerAsyncClient",
"CheckError",
"CheckRequest",
"CheckResponse",
"Distribution",
"HttpRequest",
"LogEntry",
Expand All @@ -59,12 +59,12 @@
"MetricValue",
"MetricValueSet",
"Operation",
"QuotaControllerAsyncClient",
"QuotaControllerClient",
"AllocateQuotaRequest",
"AllocateQuotaResponse",
"QuotaError",
"QuotaOperation",
"CheckRequest",
"CheckResponse",
"ReportRequest",
"ReportResponse",
"ServiceControllerAsyncClient",
"ServiceControllerClient",
)
7 changes: 5 additions & 2 deletions google/cloud/servicecontrol_v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,7 +15,10 @@
#

from .services.quota_controller import QuotaControllerClient
from .services.quota_controller import QuotaControllerAsyncClient
from .services.service_controller import ServiceControllerClient
from .services.service_controller import ServiceControllerAsyncClient

from .types.check_error import CheckError
from .types.distribution import Distribution
from .types.http_request import HttpRequest
Expand All @@ -35,8 +37,9 @@
from .types.service_controller import ReportRequest
from .types.service_controller import ReportResponse


__all__ = (
"QuotaControllerAsyncClient",
"ServiceControllerAsyncClient",
"AllocateQuotaRequest",
"AllocateQuotaResponse",
"CheckError",
Expand Down
67 changes: 67 additions & 0 deletions google/cloud/servicecontrol_v1/gapic_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
"language": "python",
"libraryPackage": "google.cloud.servicecontrol_v1",
"protoPackage": "google.api.servicecontrol.v1",
"schema": "1.0",
"services": {
"QuotaController": {
"clients": {
"grpc": {
"libraryClient": "QuotaControllerClient",
"rpcs": {
"AllocateQuota": {
"methods": [
"allocate_quota"
]
}
}
},
"grpc-async": {
"libraryClient": "QuotaControllerAsyncClient",
"rpcs": {
"AllocateQuota": {
"methods": [
"allocate_quota"
]
}
}
}
}
},
"ServiceController": {
"clients": {
"grpc": {
"libraryClient": "ServiceControllerClient",
"rpcs": {
"Check": {
"methods": [
"check"
]
},
"Report": {
"methods": [
"report"
]
}
}
},
"grpc-async": {
"libraryClient": "ServiceControllerAsyncClient",
"rpcs": {
"Check": {
"methods": [
"check"
]
},
"Report": {
"methods": [
"report"
]
}
}
}
}
}
}
}
1 change: 0 additions & 1 deletion google/cloud/servicecontrol_v1/services/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from .client import QuotaControllerClient
from .async_client import QuotaControllerAsyncClient

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,23 +13,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
import functools
import re
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

import google.api_core.client_options as ClientOptions # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.servicecontrol_v1.types import metric_value
from google.cloud.servicecontrol_v1.types import quota_controller

from .transports.base import QuotaControllerTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import QuotaControllerGrpcAsyncIOTransport
from .client import QuotaControllerClient
Expand All @@ -55,24 +52,20 @@ class QuotaControllerAsyncClient:
parse_common_billing_account_path = staticmethod(
QuotaControllerClient.parse_common_billing_account_path
)

common_folder_path = staticmethod(QuotaControllerClient.common_folder_path)
parse_common_folder_path = staticmethod(
QuotaControllerClient.parse_common_folder_path
)

common_organization_path = staticmethod(
QuotaControllerClient.common_organization_path
)
parse_common_organization_path = staticmethod(
QuotaControllerClient.parse_common_organization_path
)

common_project_path = staticmethod(QuotaControllerClient.common_project_path)
parse_common_project_path = staticmethod(
QuotaControllerClient.parse_common_project_path
)

common_location_path = staticmethod(QuotaControllerClient.common_location_path)
parse_common_location_path = staticmethod(
QuotaControllerClient.parse_common_location_path
Expand Down Expand Up @@ -126,7 +119,7 @@ def transport(self) -> QuotaControllerTransport:
def __init__(
self,
*,
credentials: credentials.Credentials = None,
credentials: ga_credentials.Credentials = None,
transport: Union[str, QuotaControllerTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -163,7 +156,6 @@ def __init__(
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
creation failed for any reason.
"""

self._client = QuotaControllerClient(
credentials=credentials,
transport=transport,
Expand Down Expand Up @@ -196,7 +188,6 @@ async def allocate_quota(
request (:class:`google.cloud.servicecontrol_v1.types.AllocateQuotaRequest`):
The request object. Request message for the
AllocateQuota method.

retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -210,7 +201,6 @@ async def allocate_quota(

"""
# Create or coerce a protobuf request object.

request = quota_controller.AllocateQuotaRequest(request)

# Wrap the RPC method; this adds retry and timeout information,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
from distutils import util
import os
Expand All @@ -23,18 +21,17 @@
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.servicecontrol_v1.types import metric_value
from google.cloud.servicecontrol_v1.types import quota_controller

from .transports.base import QuotaControllerTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import QuotaControllerGrpcTransport
from .transports.grpc_asyncio import QuotaControllerGrpcAsyncIOTransport
Expand Down Expand Up @@ -222,7 +219,7 @@ def parse_common_location_path(path: str) -> Dict[str, str]:
def __init__(
self,
*,
credentials: Optional[credentials.Credentials] = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, QuotaControllerTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
Expand Down Expand Up @@ -357,7 +354,6 @@ def allocate_quota(
request (google.cloud.servicecontrol_v1.types.AllocateQuotaRequest):
The request object. Request message for the
AllocateQuota method.

retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
Expand All @@ -371,7 +367,6 @@ def allocate_quota(

"""
# Create or coerce a protobuf request object.

# Minor optimization to avoid making a copy if the user passes
# in a quota_controller.AllocateQuotaRequest.
# There's no risk of modifying the input as we've already verified
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -14,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from collections import OrderedDict
from typing import Dict, Type

Expand Down
Loading