Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit c13d3f6

Browse files
chore: Update gapic-generator-python to v1.6.1 (#150)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * set manifest to true in .github/release-please.yml * add release-please-config.json * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: googleapis/googleapis@5be5981 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: googleapis/googleapis@08f275f Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 1ed4a1e commit c13d3f6

File tree

22 files changed

+290
-118
lines changed

22 files changed

+290
-118
lines changed

.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true
34
# NOTE: this section is generated by synthtool.languages.python
45
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
56
branches:

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.4.3"
3+
}

docs/service_usage_v1/types.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Service Usage v1 API
33

44
.. automodule:: google.cloud.service_usage_v1.types
55
:members:
6-
:undoc-members:
76
:show-inheritance:

google/cloud/service_usage/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.service_usage import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.service_usage_v1.services.service_usage.async_client import (
1822
ServiceUsageAsyncClient,
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.4.3" # {x-release-please-version}

google/cloud/service_usage_v1/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.service_usage import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.service_usage import ServiceUsageAsyncClient, ServiceUsageClient
1822
from .types.resources import OperationMetadata, Service, ServiceConfig, State

google/cloud/service_usage_v1/services/service_usage/async_client.py

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,17 @@
1616
from collections import OrderedDict
1717
import functools
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
)
2030

2131
from google.api_core import exceptions as core_exceptions
2232
from google.api_core import gapic_v1
@@ -162,9 +172,9 @@ def transport(self) -> ServiceUsageTransport:
162172
def __init__(
163173
self,
164174
*,
165-
credentials: ga_credentials.Credentials = None,
175+
credentials: Optional[ga_credentials.Credentials] = None,
166176
transport: Union[str, ServiceUsageTransport] = "grpc_asyncio",
167-
client_options: ClientOptions = None,
177+
client_options: Optional[ClientOptions] = None,
168178
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
169179
) -> None:
170180
"""Instantiates the service usage client.
@@ -208,10 +218,10 @@ def __init__(
208218

209219
async def enable_service(
210220
self,
211-
request: Union[serviceusage.EnableServiceRequest, dict] = None,
221+
request: Optional[Union[serviceusage.EnableServiceRequest, dict]] = None,
212222
*,
213223
retry: OptionalRetry = gapic_v1.method.DEFAULT,
214-
timeout: float = None,
224+
timeout: Optional[float] = None,
215225
metadata: Sequence[Tuple[str, str]] = (),
216226
) -> operation_async.AsyncOperation:
217227
r"""Enable a service so that it can be used with a
@@ -247,7 +257,7 @@ async def sample_enable_service():
247257
print(response)
248258
249259
Args:
250-
request (Union[google.cloud.service_usage_v1.types.EnableServiceRequest, dict]):
260+
request (Optional[Union[google.cloud.service_usage_v1.types.EnableServiceRequest, dict]]):
251261
The request object. Request message for the
252262
`EnableService` method.
253263
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -304,10 +314,10 @@ async def sample_enable_service():
304314

305315
async def disable_service(
306316
self,
307-
request: Union[serviceusage.DisableServiceRequest, dict] = None,
317+
request: Optional[Union[serviceusage.DisableServiceRequest, dict]] = None,
308318
*,
309319
retry: OptionalRetry = gapic_v1.method.DEFAULT,
310-
timeout: float = None,
320+
timeout: Optional[float] = None,
311321
metadata: Sequence[Tuple[str, str]] = (),
312322
) -> operation_async.AsyncOperation:
313323
r"""Disable a service so that it can no longer be used with a
@@ -349,7 +359,7 @@ async def sample_disable_service():
349359
print(response)
350360
351361
Args:
352-
request (Union[google.cloud.service_usage_v1.types.DisableServiceRequest, dict]):
362+
request (Optional[Union[google.cloud.service_usage_v1.types.DisableServiceRequest, dict]]):
353363
The request object. Request message for the
354364
`DisableService` method.
355365
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -406,10 +416,10 @@ async def sample_disable_service():
406416

407417
async def get_service(
408418
self,
409-
request: Union[serviceusage.GetServiceRequest, dict] = None,
419+
request: Optional[Union[serviceusage.GetServiceRequest, dict]] = None,
410420
*,
411421
retry: OptionalRetry = gapic_v1.method.DEFAULT,
412-
timeout: float = None,
422+
timeout: Optional[float] = None,
413423
metadata: Sequence[Tuple[str, str]] = (),
414424
) -> resources.Service:
415425
r"""Returns the service configuration and enabled state
@@ -441,7 +451,7 @@ async def sample_get_service():
441451
print(response)
442452
443453
Args:
444-
request (Union[google.cloud.service_usage_v1.types.GetServiceRequest, dict]):
454+
request (Optional[Union[google.cloud.service_usage_v1.types.GetServiceRequest, dict]]):
445455
The request object. Request message for the `GetService`
446456
method.
447457
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -486,10 +496,10 @@ async def sample_get_service():
486496

487497
async def list_services(
488498
self,
489-
request: Union[serviceusage.ListServicesRequest, dict] = None,
499+
request: Optional[Union[serviceusage.ListServicesRequest, dict]] = None,
490500
*,
491501
retry: OptionalRetry = gapic_v1.method.DEFAULT,
492-
timeout: float = None,
502+
timeout: Optional[float] = None,
493503
metadata: Sequence[Tuple[str, str]] = (),
494504
) -> pagers.ListServicesAsyncPager:
495505
r"""List all services available to the specified project, and the
@@ -534,7 +544,7 @@ async def sample_list_services():
534544
print(response)
535545
536546
Args:
537-
request (Union[google.cloud.service_usage_v1.types.ListServicesRequest, dict]):
547+
request (Optional[Union[google.cloud.service_usage_v1.types.ListServicesRequest, dict]]):
538548
The request object. Request message for the
539549
`ListServices` method.
540550
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -590,10 +600,10 @@ async def sample_list_services():
590600

591601
async def batch_enable_services(
592602
self,
593-
request: Union[serviceusage.BatchEnableServicesRequest, dict] = None,
603+
request: Optional[Union[serviceusage.BatchEnableServicesRequest, dict]] = None,
594604
*,
595605
retry: OptionalRetry = gapic_v1.method.DEFAULT,
596-
timeout: float = None,
606+
timeout: Optional[float] = None,
597607
metadata: Sequence[Tuple[str, str]] = (),
598608
) -> operation_async.AsyncOperation:
599609
r"""Enable multiple services on a project. The operation is atomic:
@@ -631,7 +641,7 @@ async def sample_batch_enable_services():
631641
print(response)
632642
633643
Args:
634-
request (Union[google.cloud.service_usage_v1.types.BatchEnableServicesRequest, dict]):
644+
request (Optional[Union[google.cloud.service_usage_v1.types.BatchEnableServicesRequest, dict]]):
635645
The request object. Request message for the
636646
`BatchEnableServices` method.
637647
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -688,10 +698,10 @@ async def sample_batch_enable_services():
688698

689699
async def batch_get_services(
690700
self,
691-
request: Union[serviceusage.BatchGetServicesRequest, dict] = None,
701+
request: Optional[Union[serviceusage.BatchGetServicesRequest, dict]] = None,
692702
*,
693703
retry: OptionalRetry = gapic_v1.method.DEFAULT,
694-
timeout: float = None,
704+
timeout: Optional[float] = None,
695705
metadata: Sequence[Tuple[str, str]] = (),
696706
) -> serviceusage.BatchGetServicesResponse:
697707
r"""Returns the service configurations and enabled states
@@ -723,7 +733,7 @@ async def sample_batch_get_services():
723733
print(response)
724734
725735
Args:
726-
request (Union[google.cloud.service_usage_v1.types.BatchGetServicesRequest, dict]):
736+
request (Optional[Union[google.cloud.service_usage_v1.types.BatchGetServicesRequest, dict]]):
727737
The request object. Request message for the
728738
`BatchGetServices` method.
729739
retry (google.api_core.retry.Retry): Designation of what errors, if any,

google/cloud/service_usage_v1/services/service_usage/client.py

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,18 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
19+
from typing import (
20+
Dict,
21+
Mapping,
22+
MutableMapping,
23+
MutableSequence,
24+
Optional,
25+
Sequence,
26+
Tuple,
27+
Type,
28+
Union,
29+
cast,
30+
)
2031

2132
from google.api_core import client_options as client_options_lib
2233
from google.api_core import exceptions as core_exceptions
@@ -59,7 +70,7 @@ class ServiceUsageClientMeta(type):
5970

6071
def get_transport_class(
6172
cls,
62-
label: str = None,
73+
label: Optional[str] = None,
6374
) -> Type[ServiceUsageTransport]:
6475
"""Returns an appropriate transport class.
6576
@@ -318,8 +329,8 @@ def __init__(
318329
self,
319330
*,
320331
credentials: Optional[ga_credentials.Credentials] = None,
321-
transport: Union[str, ServiceUsageTransport, None] = None,
322-
client_options: Optional[client_options_lib.ClientOptions] = None,
332+
transport: Optional[Union[str, ServiceUsageTransport]] = None,
333+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
323334
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
324335
) -> None:
325336
"""Instantiates the service usage client.
@@ -333,7 +344,7 @@ def __init__(
333344
transport (Union[str, ServiceUsageTransport]): The
334345
transport to use. If set to None, a transport is chosen
335346
automatically.
336-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
347+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
337348
client. It won't take effect if a ``transport`` instance is provided.
338349
(1) The ``api_endpoint`` property can be used to override the
339350
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -363,6 +374,7 @@ def __init__(
363374
client_options = client_options_lib.from_dict(client_options)
364375
if client_options is None:
365376
client_options = client_options_lib.ClientOptions()
377+
client_options = cast(client_options_lib.ClientOptions, client_options)
366378

367379
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
368380
client_options
@@ -415,10 +427,10 @@ def __init__(
415427

416428
def enable_service(
417429
self,
418-
request: Union[serviceusage.EnableServiceRequest, dict] = None,
430+
request: Optional[Union[serviceusage.EnableServiceRequest, dict]] = None,
419431
*,
420432
retry: OptionalRetry = gapic_v1.method.DEFAULT,
421-
timeout: float = None,
433+
timeout: Optional[float] = None,
422434
metadata: Sequence[Tuple[str, str]] = (),
423435
) -> operation.Operation:
424436
r"""Enable a service so that it can be used with a
@@ -512,10 +524,10 @@ def sample_enable_service():
512524

513525
def disable_service(
514526
self,
515-
request: Union[serviceusage.DisableServiceRequest, dict] = None,
527+
request: Optional[Union[serviceusage.DisableServiceRequest, dict]] = None,
516528
*,
517529
retry: OptionalRetry = gapic_v1.method.DEFAULT,
518-
timeout: float = None,
530+
timeout: Optional[float] = None,
519531
metadata: Sequence[Tuple[str, str]] = (),
520532
) -> operation.Operation:
521533
r"""Disable a service so that it can no longer be used with a
@@ -615,10 +627,10 @@ def sample_disable_service():
615627

616628
def get_service(
617629
self,
618-
request: Union[serviceusage.GetServiceRequest, dict] = None,
630+
request: Optional[Union[serviceusage.GetServiceRequest, dict]] = None,
619631
*,
620632
retry: OptionalRetry = gapic_v1.method.DEFAULT,
621-
timeout: float = None,
633+
timeout: Optional[float] = None,
622634
metadata: Sequence[Tuple[str, str]] = (),
623635
) -> resources.Service:
624636
r"""Returns the service configuration and enabled state
@@ -696,10 +708,10 @@ def sample_get_service():
696708

697709
def list_services(
698710
self,
699-
request: Union[serviceusage.ListServicesRequest, dict] = None,
711+
request: Optional[Union[serviceusage.ListServicesRequest, dict]] = None,
700712
*,
701713
retry: OptionalRetry = gapic_v1.method.DEFAULT,
702-
timeout: float = None,
714+
timeout: Optional[float] = None,
703715
metadata: Sequence[Tuple[str, str]] = (),
704716
) -> pagers.ListServicesPager:
705717
r"""List all services available to the specified project, and the
@@ -801,10 +813,10 @@ def sample_list_services():
801813

802814
def batch_enable_services(
803815
self,
804-
request: Union[serviceusage.BatchEnableServicesRequest, dict] = None,
816+
request: Optional[Union[serviceusage.BatchEnableServicesRequest, dict]] = None,
805817
*,
806818
retry: OptionalRetry = gapic_v1.method.DEFAULT,
807-
timeout: float = None,
819+
timeout: Optional[float] = None,
808820
metadata: Sequence[Tuple[str, str]] = (),
809821
) -> operation.Operation:
810822
r"""Enable multiple services on a project. The operation is atomic:
@@ -900,10 +912,10 @@ def sample_batch_enable_services():
900912

901913
def batch_get_services(
902914
self,
903-
request: Union[serviceusage.BatchGetServicesRequest, dict] = None,
915+
request: Optional[Union[serviceusage.BatchGetServicesRequest, dict]] = None,
904916
*,
905917
retry: OptionalRetry = gapic_v1.method.DEFAULT,
906-
timeout: float = None,
918+
timeout: Optional[float] = None,
907919
metadata: Sequence[Tuple[str, str]] = (),
908920
) -> serviceusage.BatchGetServicesResponse:
909921
r"""Returns the service configurations and enabled states

google/cloud/service_usage_v1/services/service_usage/transports/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def __init__(
5353
self,
5454
*,
5555
host: str = DEFAULT_HOST,
56-
credentials: ga_credentials.Credentials = None,
56+
credentials: Optional[ga_credentials.Credentials] = None,
5757
credentials_file: Optional[str] = None,
5858
scopes: Optional[Sequence[str]] = None,
5959
quota_project_id: Optional[str] = None,

google/cloud/service_usage_v1/services/service_usage/transports/grpc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ def __init__(
5252
self,
5353
*,
5454
host: str = "serviceusage.googleapis.com",
55-
credentials: ga_credentials.Credentials = None,
56-
credentials_file: str = None,
57-
scopes: Sequence[str] = None,
58-
channel: grpc.Channel = None,
59-
api_mtls_endpoint: str = None,
60-
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
61-
ssl_channel_credentials: grpc.ChannelCredentials = None,
62-
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
55+
credentials: Optional[ga_credentials.Credentials] = None,
56+
credentials_file: Optional[str] = None,
57+
scopes: Optional[Sequence[str]] = None,
58+
channel: Optional[grpc.Channel] = None,
59+
api_mtls_endpoint: Optional[str] = None,
60+
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
61+
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
62+
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
6363
quota_project_id: Optional[str] = None,
6464
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6565
always_use_jwt_access: Optional[bool] = False,
@@ -187,8 +187,8 @@ def __init__(
187187
def create_channel(
188188
cls,
189189
host: str = "serviceusage.googleapis.com",
190-
credentials: ga_credentials.Credentials = None,
191-
credentials_file: str = None,
190+
credentials: Optional[ga_credentials.Credentials] = None,
191+
credentials_file: Optional[str] = None,
192192
scopes: Optional[Sequence[str]] = None,
193193
quota_project_id: Optional[str] = None,
194194
**kwargs,

0 commit comments

Comments
 (0)