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

Commit c47f1ab

Browse files
feat: add support for google.cloud.bare_metal_solution.__version__ (#64)
* 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 * add .release-please-manifest.json with correct version * use templated owlbot.py and autogenerated setup.py * run nox format session * add release please config Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 12db6ce commit c47f1ab

File tree

52 files changed

+365
-1063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+365
-1063
lines changed

.github/release-please.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true

.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.1.3"
3+
}

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
# All configuration values have a default; values that are commented out
2525
# serve to show the default.
2626

27-
import sys
2827
import os
2928
import shlex
29+
import sys
3030

3131
# If extensions (or modules to document with autodoc) are in another directory,
3232
# add these directories to sys.path here. If the directory is relative to the
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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+
from google.cloud.bare_metal_solution import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
19+
20+
21+
from google.cloud.bare_metal_solution_v2.services.bare_metal_solution.async_client import (
22+
BareMetalSolutionAsyncClient,
23+
)
24+
from google.cloud.bare_metal_solution_v2.services.bare_metal_solution.client import (
25+
BareMetalSolutionClient,
26+
)
27+
from google.cloud.bare_metal_solution_v2.types.baremetalsolution import (
28+
OperationMetadata,
29+
ResetInstanceResponse,
30+
)
31+
from google.cloud.bare_metal_solution_v2.types.instance import (
32+
DetachLunRequest,
33+
GetInstanceRequest,
34+
Instance,
35+
ListInstancesRequest,
36+
ListInstancesResponse,
37+
ResetInstanceRequest,
38+
ServerNetworkTemplate,
39+
StartInstanceRequest,
40+
StartInstanceResponse,
41+
StopInstanceRequest,
42+
StopInstanceResponse,
43+
UpdateInstanceRequest,
44+
)
45+
from google.cloud.bare_metal_solution_v2.types.lun import (
46+
GetLunRequest,
47+
ListLunsRequest,
48+
ListLunsResponse,
49+
Lun,
50+
)
51+
from google.cloud.bare_metal_solution_v2.types.network import (
52+
VRF,
53+
GetNetworkRequest,
54+
ListNetworksRequest,
55+
ListNetworksResponse,
56+
ListNetworkUsageRequest,
57+
ListNetworkUsageResponse,
58+
LogicalInterface,
59+
Network,
60+
NetworkAddressReservation,
61+
NetworkUsage,
62+
UpdateNetworkRequest,
63+
)
64+
from google.cloud.bare_metal_solution_v2.types.nfs_share import (
65+
GetNfsShareRequest,
66+
ListNfsSharesRequest,
67+
ListNfsSharesResponse,
68+
NfsShare,
69+
UpdateNfsShareRequest,
70+
)
71+
from google.cloud.bare_metal_solution_v2.types.volume import (
72+
GetVolumeRequest,
73+
ListVolumesRequest,
74+
ListVolumesResponse,
75+
ResizeVolumeRequest,
76+
UpdateVolumeRequest,
77+
Volume,
78+
)
79+
80+
__all__ = (
81+
"BareMetalSolutionClient",
82+
"BareMetalSolutionAsyncClient",
83+
"OperationMetadata",
84+
"ResetInstanceResponse",
85+
"DetachLunRequest",
86+
"GetInstanceRequest",
87+
"Instance",
88+
"ListInstancesRequest",
89+
"ListInstancesResponse",
90+
"ResetInstanceRequest",
91+
"ServerNetworkTemplate",
92+
"StartInstanceRequest",
93+
"StartInstanceResponse",
94+
"StopInstanceRequest",
95+
"StopInstanceResponse",
96+
"UpdateInstanceRequest",
97+
"GetLunRequest",
98+
"ListLunsRequest",
99+
"ListLunsResponse",
100+
"Lun",
101+
"GetNetworkRequest",
102+
"ListNetworksRequest",
103+
"ListNetworksResponse",
104+
"ListNetworkUsageRequest",
105+
"ListNetworkUsageResponse",
106+
"LogicalInterface",
107+
"Network",
108+
"NetworkAddressReservation",
109+
"NetworkUsage",
110+
"UpdateNetworkRequest",
111+
"VRF",
112+
"GetNfsShareRequest",
113+
"ListNfsSharesRequest",
114+
"ListNfsSharesResponse",
115+
"NfsShare",
116+
"UpdateNfsShareRequest",
117+
"GetVolumeRequest",
118+
"ListVolumesRequest",
119+
"ListVolumesResponse",
120+
"ResizeVolumeRequest",
121+
"UpdateVolumeRequest",
122+
"Volume",
123+
)
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.1.3" # {x-release-please-version}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Marker file for PEP 561.
2+
# The google-cloud-bare-metal-solution package uses inline types.

google/cloud/bare_metal_solution_v2/__init__.py

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,50 +13,59 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.bare_metal_solution import gapic_version as package_version
1617

17-
from .services.bare_metal_solution import BareMetalSolutionClient
18-
from .services.bare_metal_solution import BareMetalSolutionAsyncClient
18+
__version__ = package_version.__version__
1919

20-
from .types.baremetalsolution import OperationMetadata
21-
from .types.baremetalsolution import ResetInstanceResponse
22-
from .types.instance import DetachLunRequest
23-
from .types.instance import GetInstanceRequest
24-
from .types.instance import Instance
25-
from .types.instance import ListInstancesRequest
26-
from .types.instance import ListInstancesResponse
27-
from .types.instance import ResetInstanceRequest
28-
from .types.instance import ServerNetworkTemplate
29-
from .types.instance import StartInstanceRequest
30-
from .types.instance import StartInstanceResponse
31-
from .types.instance import StopInstanceRequest
32-
from .types.instance import StopInstanceResponse
33-
from .types.instance import UpdateInstanceRequest
34-
from .types.lun import GetLunRequest
35-
from .types.lun import ListLunsRequest
36-
from .types.lun import ListLunsResponse
37-
from .types.lun import Lun
38-
from .types.network import GetNetworkRequest
39-
from .types.network import ListNetworksRequest
40-
from .types.network import ListNetworksResponse
41-
from .types.network import ListNetworkUsageRequest
42-
from .types.network import ListNetworkUsageResponse
43-
from .types.network import LogicalInterface
44-
from .types.network import Network
45-
from .types.network import NetworkAddressReservation
46-
from .types.network import NetworkUsage
47-
from .types.network import UpdateNetworkRequest
48-
from .types.network import VRF
49-
from .types.nfs_share import GetNfsShareRequest
50-
from .types.nfs_share import ListNfsSharesRequest
51-
from .types.nfs_share import ListNfsSharesResponse
52-
from .types.nfs_share import NfsShare
53-
from .types.nfs_share import UpdateNfsShareRequest
54-
from .types.volume import GetVolumeRequest
55-
from .types.volume import ListVolumesRequest
56-
from .types.volume import ListVolumesResponse
57-
from .types.volume import ResizeVolumeRequest
58-
from .types.volume import UpdateVolumeRequest
59-
from .types.volume import Volume
20+
21+
from .services.bare_metal_solution import (
22+
BareMetalSolutionAsyncClient,
23+
BareMetalSolutionClient,
24+
)
25+
from .types.baremetalsolution import OperationMetadata, ResetInstanceResponse
26+
from .types.instance import (
27+
DetachLunRequest,
28+
GetInstanceRequest,
29+
Instance,
30+
ListInstancesRequest,
31+
ListInstancesResponse,
32+
ResetInstanceRequest,
33+
ServerNetworkTemplate,
34+
StartInstanceRequest,
35+
StartInstanceResponse,
36+
StopInstanceRequest,
37+
StopInstanceResponse,
38+
UpdateInstanceRequest,
39+
)
40+
from .types.lun import GetLunRequest, ListLunsRequest, ListLunsResponse, Lun
41+
from .types.network import (
42+
VRF,
43+
GetNetworkRequest,
44+
ListNetworksRequest,
45+
ListNetworksResponse,
46+
ListNetworkUsageRequest,
47+
ListNetworkUsageResponse,
48+
LogicalInterface,
49+
Network,
50+
NetworkAddressReservation,
51+
NetworkUsage,
52+
UpdateNetworkRequest,
53+
)
54+
from .types.nfs_share import (
55+
GetNfsShareRequest,
56+
ListNfsSharesRequest,
57+
ListNfsSharesResponse,
58+
NfsShare,
59+
UpdateNfsShareRequest,
60+
)
61+
from .types.volume import (
62+
GetVolumeRequest,
63+
ListVolumesRequest,
64+
ListVolumesResponse,
65+
ResizeVolumeRequest,
66+
UpdateVolumeRequest,
67+
Volume,
68+
)
6069

6170
__all__ = (
6271
"BareMetalSolutionAsyncClient",

google/cloud/bare_metal_solution_v2/services/bare_metal_solution/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
from .client import BareMetalSolutionClient
1716
from .async_client import BareMetalSolutionAsyncClient
17+
from .client import BareMetalSolutionClient
1818

1919
__all__ = (
2020
"BareMetalSolutionClient",

google/cloud/bare_metal_solution_v2/services/bare_metal_solution/async_client.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
import functools
1818
import re
1919
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
20-
import pkg_resources
2120

22-
from google.api_core.client_options import ClientOptions
2321
from google.api_core import exceptions as core_exceptions
2422
from google.api_core import gapic_v1
2523
from google.api_core import retry as retries
24+
from google.api_core.client_options import ClientOptions
2625
from google.auth import credentials as ga_credentials # type: ignore
2726
from google.oauth2 import service_account # type: ignore
27+
import pkg_resources
2828

2929
try:
3030
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -33,22 +33,24 @@
3333

3434
from google.api_core import operation # type: ignore
3535
from google.api_core import operation_async # type: ignore
36+
from google.protobuf import field_mask_pb2 # type: ignore
37+
from google.protobuf import timestamp_pb2 # type: ignore
38+
3639
from google.cloud.bare_metal_solution_v2.services.bare_metal_solution import pagers
40+
from google.cloud.bare_metal_solution_v2.types import nfs_share as gcb_nfs_share
3741
from google.cloud.bare_metal_solution_v2.types import baremetalsolution
3842
from google.cloud.bare_metal_solution_v2.types import instance
3943
from google.cloud.bare_metal_solution_v2.types import instance as gcb_instance
4044
from google.cloud.bare_metal_solution_v2.types import lun
4145
from google.cloud.bare_metal_solution_v2.types import network
4246
from google.cloud.bare_metal_solution_v2.types import network as gcb_network
4347
from google.cloud.bare_metal_solution_v2.types import nfs_share
44-
from google.cloud.bare_metal_solution_v2.types import nfs_share as gcb_nfs_share
4548
from google.cloud.bare_metal_solution_v2.types import volume
4649
from google.cloud.bare_metal_solution_v2.types import volume as gcb_volume
47-
from google.protobuf import field_mask_pb2 # type: ignore
48-
from google.protobuf import timestamp_pb2 # type: ignore
49-
from .transports.base import BareMetalSolutionTransport, DEFAULT_CLIENT_INFO
50-
from .transports.grpc_asyncio import BareMetalSolutionGrpcAsyncIOTransport
50+
5151
from .client import BareMetalSolutionClient
52+
from .transports.base import DEFAULT_CLIENT_INFO, BareMetalSolutionTransport
53+
from .transports.grpc_asyncio import BareMetalSolutionGrpcAsyncIOTransport
5254

5355

5456
class BareMetalSolutionAsyncClient:

google/cloud/bare_metal_solution_v2/services/bare_metal_solution/client.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
from collections import OrderedDict
1717
import os
1818
import re
19-
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
20-
import pkg_resources
19+
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union, cast
2120

2221
from google.api_core import client_options as client_options_lib
2322
from google.api_core import exceptions as core_exceptions
2423
from google.api_core import gapic_v1
2524
from google.api_core import retry as retries
2625
from google.auth import credentials as ga_credentials # type: ignore
26+
from google.auth.exceptions import MutualTLSChannelError # type: ignore
2727
from google.auth.transport import mtls # type: ignore
2828
from google.auth.transport.grpc import SslCredentials # type: ignore
29-
from google.auth.exceptions import MutualTLSChannelError # type: ignore
3029
from google.oauth2 import service_account # type: ignore
30+
import pkg_resources
3131

3232
try:
3333
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
@@ -36,20 +36,22 @@
3636

3737
from google.api_core import operation # type: ignore
3838
from google.api_core import operation_async # type: ignore
39+
from google.protobuf import field_mask_pb2 # type: ignore
40+
from google.protobuf import timestamp_pb2 # type: ignore
41+
3942
from google.cloud.bare_metal_solution_v2.services.bare_metal_solution import pagers
43+
from google.cloud.bare_metal_solution_v2.types import nfs_share as gcb_nfs_share
4044
from google.cloud.bare_metal_solution_v2.types import baremetalsolution
4145
from google.cloud.bare_metal_solution_v2.types import instance
4246
from google.cloud.bare_metal_solution_v2.types import instance as gcb_instance
4347
from google.cloud.bare_metal_solution_v2.types import lun
4448
from google.cloud.bare_metal_solution_v2.types import network
4549
from google.cloud.bare_metal_solution_v2.types import network as gcb_network
4650
from google.cloud.bare_metal_solution_v2.types import nfs_share
47-
from google.cloud.bare_metal_solution_v2.types import nfs_share as gcb_nfs_share
4851
from google.cloud.bare_metal_solution_v2.types import volume
4952
from google.cloud.bare_metal_solution_v2.types import volume as gcb_volume
50-
from google.protobuf import field_mask_pb2 # type: ignore
51-
from google.protobuf import timestamp_pb2 # type: ignore
52-
from .transports.base import BareMetalSolutionTransport, DEFAULT_CLIENT_INFO
53+
54+
from .transports.base import DEFAULT_CLIENT_INFO, BareMetalSolutionTransport
5355
from .transports.grpc import BareMetalSolutionGrpcTransport
5456
from .transports.grpc_asyncio import BareMetalSolutionGrpcAsyncIOTransport
5557

@@ -467,7 +469,7 @@ def __init__(
467469
*,
468470
credentials: Optional[ga_credentials.Credentials] = None,
469471
transport: Union[str, BareMetalSolutionTransport, None] = None,
470-
client_options: Optional[client_options_lib.ClientOptions] = None,
472+
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
471473
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
472474
) -> None:
473475
"""Instantiates the bare metal solution client.
@@ -481,7 +483,7 @@ def __init__(
481483
transport (Union[str, BareMetalSolutionTransport]): The
482484
transport to use. If set to None, a transport is chosen
483485
automatically.
484-
client_options (google.api_core.client_options.ClientOptions): Custom options for the
486+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
485487
client. It won't take effect if a ``transport`` instance is provided.
486488
(1) The ``api_endpoint`` property can be used to override the
487489
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
@@ -511,6 +513,7 @@ def __init__(
511513
client_options = client_options_lib.from_dict(client_options)
512514
if client_options is None:
513515
client_options = client_options_lib.ClientOptions()
516+
client_options = cast(client_options_lib.ClientOptions, client_options)
514517

515518
api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
516519
client_options

0 commit comments

Comments
 (0)