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

feat: Add LocationMetadata message #124

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/cloud/networkconnectivity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@
from google.cloud.networkconnectivity_v1.types.hub import ListHubsResponse
from google.cloud.networkconnectivity_v1.types.hub import ListSpokesRequest
from google.cloud.networkconnectivity_v1.types.hub import ListSpokesResponse
from google.cloud.networkconnectivity_v1.types.hub import LocationMetadata
from google.cloud.networkconnectivity_v1.types.hub import RouterApplianceInstance
from google.cloud.networkconnectivity_v1.types.hub import RoutingVPC
from google.cloud.networkconnectivity_v1.types.hub import Spoke
from google.cloud.networkconnectivity_v1.types.hub import UpdateHubRequest
from google.cloud.networkconnectivity_v1.types.hub import UpdateSpokeRequest
from google.cloud.networkconnectivity_v1.types.hub import LocationFeature
from google.cloud.networkconnectivity_v1.types.hub import State

__all__ = (
Expand All @@ -61,10 +63,12 @@
"ListHubsResponse",
"ListSpokesRequest",
"ListSpokesResponse",
"LocationMetadata",
"RouterApplianceInstance",
"RoutingVPC",
"Spoke",
"UpdateHubRequest",
"UpdateSpokeRequest",
"LocationFeature",
"State",
)
4 changes: 4 additions & 0 deletions google/cloud/networkconnectivity_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
from .types.hub import ListHubsResponse
from .types.hub import ListSpokesRequest
from .types.hub import ListSpokesResponse
from .types.hub import LocationMetadata
from .types.hub import RouterApplianceInstance
from .types.hub import RoutingVPC
from .types.hub import Spoke
from .types.hub import UpdateHubRequest
from .types.hub import UpdateSpokeRequest
from .types.hub import LocationFeature
from .types.hub import State

__all__ = (
Expand All @@ -56,6 +58,8 @@
"ListHubsResponse",
"ListSpokesRequest",
"ListSpokesResponse",
"LocationFeature",
"LocationMetadata",
"OperationMetadata",
"RouterApplianceInstance",
"RoutingVPC",
Expand Down
232 changes: 222 additions & 10 deletions google/cloud/networkconnectivity_v1/services/hub_service/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,24 @@ async def list_hubs(
) -> pagers.ListHubsAsyncPager:
r"""Lists hubs in a given project.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_list_hubs():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.ListHubsRequest(
parent="parent_value",
)

# Make the request
page_result = client.list_hubs(request=request)
for response in page_result:
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.ListHubsRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -312,6 +330,25 @@ async def get_hub(
) -> hub.Hub:
r"""Gets details about the specified hub.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_get_hub():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.GetHubRequest(
name="name_value",
)

# Make the request
response = client.get_hub(request=request)

# Handle response
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.GetHubRequest, dict]):
The request object. Request for
Expand All @@ -334,10 +371,13 @@ async def get_hub(
google.cloud.networkconnectivity_v1.types.Hub:
A hub is a collection of spokes. A
single hub can contain spokes from
multiple regions. However, all of a
hub's spokes must be associated with
resources that reside in the same VPC
network.
multiple regions. However, if any of a
hub's spokes use the data transfer
feature, the resources associated with
those spokes must all reside in the same
VPC network. Spokes that do not use data
transfer can be associated with any VPC
network in your project.

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -390,6 +430,28 @@ async def create_hub(
) -> operation_async.AsyncOperation:
r"""Creates a new hub in the specified project.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_create_hub():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.CreateHubRequest(
parent="parent_value",
hub_id="hub_id_value",
)

# Make the request
operation = client.create_hub(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.CreateHubRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -425,9 +487,12 @@ async def create_hub(
An object representing a long-running operation.

The result type for the operation will be :class:`google.cloud.networkconnectivity_v1.types.Hub` A hub is a collection of spokes. A single hub can contain spokes from
multiple regions. However, all of a hub's spokes must
be associated with resources that reside in the same
VPC network.
multiple regions. However, if any of a hub's spokes
use the data transfer feature, the resources
associated with those spokes must all reside in the
same VPC network. Spokes that do not use data
transfer can be associated with any VPC network in
your project.

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -492,6 +557,27 @@ async def update_hub(
r"""Updates the description and/or labels of the
specified hub.


.. code-block::

from google.cloud import networkconnectivity_v1

def sample_update_hub():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.UpdateHubRequest(
)

# Make the request
operation = client.update_hub(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.UpdateHubRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -526,9 +612,12 @@ async def update_hub(
An object representing a long-running operation.

The result type for the operation will be :class:`google.cloud.networkconnectivity_v1.types.Hub` A hub is a collection of spokes. A single hub can contain spokes from
multiple regions. However, all of a hub's spokes must
be associated with resources that reside in the same
VPC network.
multiple regions. However, if any of a hub's spokes
use the data transfer feature, the resources
associated with those spokes must all reside in the
same VPC network. Spokes that do not use data
transfer can be associated with any VPC network in
your project.

"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -589,6 +678,27 @@ async def delete_hub(
) -> operation_async.AsyncOperation:
r"""Deletes the specified hub.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_delete_hub():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.DeleteHubRequest(
name="name_value",
)

# Make the request
operation = client.delete_hub(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.DeleteHubRequest, dict]):
The request object. The request for
Expand Down Expand Up @@ -682,6 +792,25 @@ async def list_spokes(
r"""Lists the spokes in the specified project and
location.


.. code-block::

from google.cloud import networkconnectivity_v1

def sample_list_spokes():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.ListSpokesRequest(
parent="parent_value",
)

# Make the request
page_result = client.list_spokes(request=request)
for response in page_result:
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.ListSpokesRequest, dict]):
The request object. The request for
Expand Down Expand Up @@ -760,6 +889,25 @@ async def get_spoke(
) -> hub.Spoke:
r"""Gets details about the specified spoke.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_get_spoke():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.GetSpokeRequest(
name="name_value",
)

# Make the request
response = client.get_spoke(request=request)

# Handle response
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.GetSpokeRequest, dict]):
The request object. The request for
Expand Down Expand Up @@ -842,6 +990,29 @@ async def create_spoke(
r"""Creates a spoke in the specified project and
location.


.. code-block::

from google.cloud import networkconnectivity_v1

def sample_create_spoke():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.CreateSpokeRequest(
parent="parent_value",
spoke_id="spoke_id_value",
)

# Make the request
operation = client.create_spoke(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.CreateSpokeRequest, dict]):
The request object. The request for
Expand Down Expand Up @@ -948,6 +1119,26 @@ async def update_spoke(
) -> operation_async.AsyncOperation:
r"""Updates the parameters of the specified spoke.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_update_spoke():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.UpdateSpokeRequest(
)

# Make the request
operation = client.update_spoke(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.UpdateSpokeRequest, dict]):
The request object. Request for
Expand Down Expand Up @@ -1053,6 +1244,27 @@ async def delete_spoke(
) -> operation_async.AsyncOperation:
r"""Deletes the specified spoke.

.. code-block::

from google.cloud import networkconnectivity_v1

def sample_delete_spoke():
# Create a client
client = networkconnectivity_v1.HubServiceClient()

# Initialize request argument(s)
request = networkconnectivity_v1.DeleteSpokeRequest(
name="name_value",
)

# Make the request
operation = client.delete_spoke(request=request)

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

response = operation.result()
print(response)

Args:
request (Union[google.cloud.networkconnectivity_v1.types.DeleteSpokeRequest, dict]):
The request object. The request for
Expand Down