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

Commit b6e3dac

Browse files
chore(python): fix warehouse-package-name for google/monitoring/metricsscope/v1 (#105)
* 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 * 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 * chore(python): fix warehouse-package-name for google/monitoring/metricsscope/v1 PiperOrigin-RevId: 490896705 Source-Link: googleapis/googleapis@a0b7558 Source-Link: https://github.com/googleapis/googleapis-gen/commit/970f5b59f4769cc1a76492b6babb4908cc1d7822 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTcwZjViNTlmNDc2OWNjMWE3NjQ5MmI2YmFiYjQ5MDhjYzFkNzgyMiJ9 * 🦉 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 e09585a commit b6e3dac

33 files changed

+309
-112
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.2.4"
3+
}

docs/monitoring_metrics_scope_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 Monitoring Metrics Scope v1 API
33

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

google/cloud/monitoring_metrics_scope/__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.monitoring_metrics_scope import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from google.cloud.monitoring_metrics_scope_v1.services.metrics_scopes.async_client import (
1822
MetricsScopesAsyncClient,
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.2.4" # {x-release-please-version}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-cloud-monitoring-metrics-scope package uses inline types.
2+
# The google-cloud-monitoring-metrics-scopes package uses inline types.

google/cloud/monitoring_metrics_scope_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.monitoring_metrics_scope import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
1620

1721
from .services.metrics_scopes import MetricsScopesAsyncClient, MetricsScopesClient
1822
from .types.metrics_scope import MetricsScope, MonitoredProject
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-cloud-monitoring-metrics-scope package uses inline types.
2+
# The google-cloud-monitoring-metrics-scopes package uses inline types.

google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/async_client.py

Lines changed: 35 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
@@ -171,9 +181,9 @@ def transport(self) -> MetricsScopesTransport:
171181
def __init__(
172182
self,
173183
*,
174-
credentials: ga_credentials.Credentials = None,
184+
credentials: Optional[ga_credentials.Credentials] = None,
175185
transport: Union[str, MetricsScopesTransport] = "grpc_asyncio",
176-
client_options: ClientOptions = None,
186+
client_options: Optional[ClientOptions] = None,
177187
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
178188
) -> None:
179189
"""Instantiates the metrics scopes client.
@@ -217,11 +227,11 @@ def __init__(
217227

218228
async def get_metrics_scope(
219229
self,
220-
request: Union[metrics_scopes.GetMetricsScopeRequest, dict] = None,
230+
request: Optional[Union[metrics_scopes.GetMetricsScopeRequest, dict]] = None,
221231
*,
222-
name: str = None,
232+
name: Optional[str] = None,
223233
retry: OptionalRetry = gapic_v1.method.DEFAULT,
224-
timeout: float = None,
234+
timeout: Optional[float] = None,
225235
metadata: Sequence[Tuple[str, str]] = (),
226236
) -> metrics_scope.MetricsScope:
227237
r"""Returns a specific ``Metrics Scope``.
@@ -253,7 +263,7 @@ async def sample_get_metrics_scope():
253263
print(response)
254264
255265
Args:
256-
request (Union[google.cloud.monitoring_metrics_scope_v1.types.GetMetricsScopeRequest, dict]):
266+
request (Optional[Union[google.cloud.monitoring_metrics_scope_v1.types.GetMetricsScopeRequest, dict]]):
257267
The request object. Request for the `GetMetricsScope`
258268
method.
259269
name (:class:`str`):
@@ -323,12 +333,12 @@ async def sample_get_metrics_scope():
323333

324334
async def list_metrics_scopes_by_monitored_project(
325335
self,
326-
request: Union[
327-
metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict
336+
request: Optional[
337+
Union[metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict]
328338
] = None,
329339
*,
330340
retry: OptionalRetry = gapic_v1.method.DEFAULT,
331-
timeout: float = None,
341+
timeout: Optional[float] = None,
332342
metadata: Sequence[Tuple[str, str]] = (),
333343
) -> metrics_scopes.ListMetricsScopesByMonitoredProjectResponse:
334344
r"""Returns a list of every ``Metrics Scope`` that a specific
@@ -363,7 +373,7 @@ async def sample_list_metrics_scopes_by_monitored_project():
363373
print(response)
364374
365375
Args:
366-
request (Union[google.cloud.monitoring_metrics_scope_v1.types.ListMetricsScopesByMonitoredProjectRequest, dict]):
376+
request (Optional[Union[google.cloud.monitoring_metrics_scope_v1.types.ListMetricsScopesByMonitoredProjectRequest, dict]]):
367377
The request object. Request for the
368378
`ListMetricsScopesByMonitoredProject` method.
369379
retry (google.api_core.retry.Retry): Designation of what errors, if any,
@@ -402,12 +412,14 @@ async def sample_list_metrics_scopes_by_monitored_project():
402412

403413
async def create_monitored_project(
404414
self,
405-
request: Union[metrics_scopes.CreateMonitoredProjectRequest, dict] = None,
415+
request: Optional[
416+
Union[metrics_scopes.CreateMonitoredProjectRequest, dict]
417+
] = None,
406418
*,
407-
parent: str = None,
408-
monitored_project: metrics_scope.MonitoredProject = None,
419+
parent: Optional[str] = None,
420+
monitored_project: Optional[metrics_scope.MonitoredProject] = None,
409421
retry: OptionalRetry = gapic_v1.method.DEFAULT,
410-
timeout: float = None,
422+
timeout: Optional[float] = None,
411423
metadata: Sequence[Tuple[str, str]] = (),
412424
) -> operation_async.AsyncOperation:
413425
r"""Adds a ``MonitoredProject`` with the given project ID to the
@@ -444,7 +456,7 @@ async def sample_create_monitored_project():
444456
print(response)
445457
446458
Args:
447-
request (Union[google.cloud.monitoring_metrics_scope_v1.types.CreateMonitoredProjectRequest, dict]):
459+
request (Optional[Union[google.cloud.monitoring_metrics_scope_v1.types.CreateMonitoredProjectRequest, dict]]):
448460
The request object. Request for the
449461
`CreateMonitoredProject` method.
450462
parent (:class:`str`):
@@ -536,11 +548,13 @@ async def sample_create_monitored_project():
536548

537549
async def delete_monitored_project(
538550
self,
539-
request: Union[metrics_scopes.DeleteMonitoredProjectRequest, dict] = None,
551+
request: Optional[
552+
Union[metrics_scopes.DeleteMonitoredProjectRequest, dict]
553+
] = None,
540554
*,
541-
name: str = None,
555+
name: Optional[str] = None,
542556
retry: OptionalRetry = gapic_v1.method.DEFAULT,
543-
timeout: float = None,
557+
timeout: Optional[float] = None,
544558
metadata: Sequence[Tuple[str, str]] = (),
545559
) -> operation_async.AsyncOperation:
546560
r"""Deletes a ``MonitoredProject`` from the specified
@@ -577,7 +591,7 @@ async def sample_delete_monitored_project():
577591
print(response)
578592
579593
Args:
580-
request (Union[google.cloud.monitoring_metrics_scope_v1.types.DeleteMonitoredProjectRequest, dict]):
594+
request (Optional[Union[google.cloud.monitoring_metrics_scope_v1.types.DeleteMonitoredProjectRequest, dict]]):
581595
The request object. Request for the
582596
`DeleteMonitoredProject` method.
583597
name (:class:`str`):
@@ -675,7 +689,7 @@ async def __aexit__(self, exc_type, exc, tb):
675689
try:
676690
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
677691
gapic_version=pkg_resources.get_distribution(
678-
"google-cloud-monitoring-metrics-scope",
692+
"google-cloud-monitoring-metrics-scopes",
679693
).version,
680694
)
681695
except pkg_resources.DistributionNotFound:

google/cloud/monitoring_metrics_scope_v1/services/metrics_scopes/client.py

Lines changed: 35 additions & 19 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
@@ -60,7 +71,7 @@ class MetricsScopesClientMeta(type):
6071

6172
def get_transport_class(
6273
cls,
63-
label: str = None,
74+
label: Optional[str] = None,
6475
) -> Type[MetricsScopesTransport]:
6576
"""Returns an appropriate transport class.
6677
@@ -352,8 +363,8 @@ def __init__(
352363
self,
353364
*,
354365
credentials: Optional[ga_credentials.Credentials] = None,
355-
transport: Union[str, MetricsScopesTransport, None] = None,
356-
client_options: Optional[client_options_lib.ClientOptions] = None,
366+
transport: Optional[Union[str, MetricsScopesTransport]] = None,
367+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
357368
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
358369
) -> None:
359370
"""Instantiates the metrics scopes client.
@@ -367,7 +378,7 @@ def __init__(
367378
transport (Union[str, MetricsScopesTransport]): The
368379
transport to use. If set to None, a transport is chosen
369380
automatically.
370-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
381+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
371382
client. It won't take effect if a ``transport`` instance is provided.
372383
(1) The ``api_endpoint`` property can be used to override the
373384
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -397,6 +408,7 @@ def __init__(
397408
client_options = client_options_lib.from_dict(client_options)
398409
if client_options is None:
399410
client_options = client_options_lib.ClientOptions()
411+
client_options = cast(client_options_lib.ClientOptions, client_options)
400412

401413
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
402414
client_options
@@ -449,11 +461,11 @@ def __init__(
449461

450462
def get_metrics_scope(
451463
self,
452-
request: Union[metrics_scopes.GetMetricsScopeRequest, dict] = None,
464+
request: Optional[Union[metrics_scopes.GetMetricsScopeRequest, dict]] = None,
453465
*,
454-
name: str = None,
466+
name: Optional[str] = None,
455467
retry: OptionalRetry = gapic_v1.method.DEFAULT,
456-
timeout: float = None,
468+
timeout: Optional[float] = None,
457469
metadata: Sequence[Tuple[str, str]] = (),
458470
) -> metrics_scope.MetricsScope:
459471
r"""Returns a specific ``Metrics Scope``.
@@ -555,12 +567,12 @@ def sample_get_metrics_scope():
555567

556568
def list_metrics_scopes_by_monitored_project(
557569
self,
558-
request: Union[
559-
metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict
570+
request: Optional[
571+
Union[metrics_scopes.ListMetricsScopesByMonitoredProjectRequest, dict]
560572
] = None,
561573
*,
562574
retry: OptionalRetry = gapic_v1.method.DEFAULT,
563-
timeout: float = None,
575+
timeout: Optional[float] = None,
564576
metadata: Sequence[Tuple[str, str]] = (),
565577
) -> metrics_scopes.ListMetricsScopesByMonitoredProjectResponse:
566578
r"""Returns a list of every ``Metrics Scope`` that a specific
@@ -639,12 +651,14 @@ def sample_list_metrics_scopes_by_monitored_project():
639651

640652
def create_monitored_project(
641653
self,
642-
request: Union[metrics_scopes.CreateMonitoredProjectRequest, dict] = None,
654+
request: Optional[
655+
Union[metrics_scopes.CreateMonitoredProjectRequest, dict]
656+
] = None,
643657
*,
644-
parent: str = None,
645-
monitored_project: metrics_scope.MonitoredProject = None,
658+
parent: Optional[str] = None,
659+
monitored_project: Optional[metrics_scope.MonitoredProject] = None,
646660
retry: OptionalRetry = gapic_v1.method.DEFAULT,
647-
timeout: float = None,
661+
timeout: Optional[float] = None,
648662
metadata: Sequence[Tuple[str, str]] = (),
649663
) -> operation.Operation:
650664
r"""Adds a ``MonitoredProject`` with the given project ID to the
@@ -773,11 +787,13 @@ def sample_create_monitored_project():
773787

774788
def delete_monitored_project(
775789
self,
776-
request: Union[metrics_scopes.DeleteMonitoredProjectRequest, dict] = None,
790+
request: Optional[
791+
Union[metrics_scopes.DeleteMonitoredProjectRequest, dict]
792+
] = None,
777793
*,
778-
name: str = None,
794+
name: Optional[str] = None,
779795
retry: OptionalRetry = gapic_v1.method.DEFAULT,
780-
timeout: float = None,
796+
timeout: Optional[float] = None,
781797
metadata: Sequence[Tuple[str, str]] = (),
782798
) -> operation.Operation:
783799
r"""Deletes a ``MonitoredProject`` from the specified
@@ -919,7 +935,7 @@ def __exit__(self, type, value, traceback):
919935
try:
920936
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
921937
gapic_version=pkg_resources.get_distribution(
922-
"google-cloud-monitoring-metrics-scope",
938+
"google-cloud-monitoring-metrics-scopes",
923939
).version,
924940
)
925941
except pkg_resources.DistributionNotFound:

0 commit comments

Comments
 (0)