Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.
Merged
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
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
16 changes: 16 additions & 0 deletions google/cloud/edgecontainer_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.2.1" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from google.api_core.client_options import ClientOptions
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
import pkg_resources

from google.cloud.edgecontainer_v1 import gapic_version as package_version

try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
Expand Down Expand Up @@ -241,7 +242,7 @@ async def list_clusters(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListClustersAsyncPager:
r"""Lists Clusters in a given project and location.
Expand Down Expand Up @@ -363,7 +364,7 @@ async def get_cluster(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Cluster:
r"""Gets details of a single Cluster.
Expand Down Expand Up @@ -475,7 +476,7 @@ async def create_cluster(
cluster: Optional[resources.Cluster] = None,
cluster_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Creates a new Cluster in a given project and
Expand Down Expand Up @@ -514,7 +515,7 @@ async def sample_create_cluster():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -617,7 +618,7 @@ async def update_cluster(
cluster: Optional[resources.Cluster] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates the parameters of a single Cluster.
Expand Down Expand Up @@ -646,7 +647,7 @@ async def sample_update_cluster():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -745,7 +746,7 @@ async def delete_cluster(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Deletes a single Cluster.
Expand Down Expand Up @@ -775,7 +776,7 @@ async def sample_delete_cluster():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -868,7 +869,7 @@ async def generate_access_token(
*,
cluster: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> service.GenerateAccessTokenResponse:
r"""Generates an access token for a Cluster.
Expand Down Expand Up @@ -968,7 +969,7 @@ async def list_node_pools(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListNodePoolsAsyncPager:
r"""Lists NodePools in a given project and location.
Expand Down Expand Up @@ -1090,7 +1091,7 @@ async def get_node_pool(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.NodePool:
r"""Gets details of a single NodePool.
Expand Down Expand Up @@ -1203,7 +1204,7 @@ async def create_node_pool(
node_pool: Optional[resources.NodePool] = None,
node_pool_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Creates a new NodePool in a given project and
Expand Down Expand Up @@ -1240,7 +1241,7 @@ async def sample_create_node_pool():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1342,7 +1343,7 @@ async def update_node_pool(
node_pool: Optional[resources.NodePool] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Updates the parameters of a single NodePool.
Expand Down Expand Up @@ -1371,7 +1372,7 @@ async def sample_update_node_pool():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1469,7 +1470,7 @@ async def delete_node_pool(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Deletes a single NodePool.
Expand Down Expand Up @@ -1499,7 +1500,7 @@ async def sample_delete_node_pool():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -1592,7 +1593,7 @@ async def list_machines(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListMachinesAsyncPager:
r"""Lists Machines in a given project and location.
Expand Down Expand Up @@ -1714,7 +1715,7 @@ async def get_machine(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.Machine:
r"""Gets details of a single Machine.
Expand Down Expand Up @@ -1825,7 +1826,7 @@ async def list_vpn_connections(
*,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListVpnConnectionsAsyncPager:
r"""Lists VPN connections in a given project and
Expand Down Expand Up @@ -1949,7 +1950,7 @@ async def get_vpn_connection(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> resources.VpnConnection:
r"""Gets details of a single VPN connection.
Expand Down Expand Up @@ -2059,7 +2060,7 @@ async def create_vpn_connection(
vpn_connection: Optional[resources.VpnConnection] = None,
vpn_connection_id: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Creates a new VPN connection in a given project and
Expand Down Expand Up @@ -2095,7 +2096,7 @@ async def sample_create_vpn_connection():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -2199,7 +2200,7 @@ async def delete_vpn_connection(
*,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Optional[float] = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Deletes a single VPN connection.
Expand Down Expand Up @@ -2229,7 +2230,7 @@ async def sample_delete_vpn_connection():

print("Waiting for operation to complete...")

response = await operation.result()
response = (await operation).result()

# Handle the response
print(response)
Expand Down Expand Up @@ -2323,14 +2324,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-edgecontainer",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("EdgeContainerAsyncClient",)
Loading