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

Commit

Permalink
fix: Mark API fields as required which were already required on the b…
Browse files Browse the repository at this point in the history
…ackend (#107)

* fix!: Mark a couple networkconnectivity API fields as required, to match implemented behavior

PiperOrigin-RevId: 408969147

Source-Link: googleapis/googleapis@cc003a4

Source-Link: googleapis/googleapis-gen@72d5b22
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzJkNWIyMmUyMTI0YzdhNWY2Y2QzMTg2NGY3ZjhjOTNhNWRmMzU5MiJ9

* 🦉 Updates from OwlBot

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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Nov 11, 2021
1 parent 61518ce commit 17b9d5f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
Expand Up @@ -296,9 +296,9 @@ async def get_hub(
Returns:
google.cloud.networkconnectivity_v1.types.Hub:
A hub is essentially a collection of
spokes. A single hub can contain spokes
from multiple regions. However, all of a
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.
Expand Down Expand Up @@ -372,7 +372,7 @@ async def create_hub(
on the ``request`` instance; if ``request`` is provided, this
should not be set.
hub_id (:class:`str`):
Optional. A unique identifier for the
Required. A unique identifier for the
hub.
This corresponds to the ``hub_id`` field
Expand All @@ -388,10 +388,10 @@ async def create_hub(
google.api_core.operation_async.AsyncOperation:
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 essentially 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.
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.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -489,10 +489,10 @@ async def update_hub(
google.api_core.operation_async.AsyncOperation:
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 essentially 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.
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.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -823,7 +823,7 @@ async def create_spoke(
on the ``request`` instance; if ``request`` is provided, this
should not be set.
spoke_id (:class:`str`):
Optional. Unique id for the spoke to
Required. Unique id for the spoke to
create.
This corresponds to the ``spoke_id`` field
Expand Down
26 changes: 13 additions & 13 deletions google/cloud/networkconnectivity_v1/services/hub_service/client.py
Expand Up @@ -558,9 +558,9 @@ def get_hub(
Returns:
google.cloud.networkconnectivity_v1.types.Hub:
A hub is essentially a collection of
spokes. A single hub can contain spokes
from multiple regions. However, all of a
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.
Expand Down Expand Up @@ -634,7 +634,7 @@ def create_hub(
on the ``request`` instance; if ``request`` is provided, this
should not be set.
hub_id (str):
Optional. A unique identifier for the
Required. A unique identifier for the
hub.
This corresponds to the ``hub_id`` field
Expand All @@ -650,10 +650,10 @@ def create_hub(
google.api_core.operation.Operation:
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 essentially 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.
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.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -751,10 +751,10 @@ def update_hub(
google.api_core.operation.Operation:
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 essentially 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.
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.
"""
# Create or coerce a protobuf request object.
Expand Down Expand Up @@ -1085,7 +1085,7 @@ def create_spoke(
on the ``request`` instance; if ``request`` is provided, this
should not be set.
spoke_id (str):
Optional. Unique id for the spoke to
Required. Unique id for the spoke to
create.
This corresponds to the ``spoke_id`` field
Expand Down
20 changes: 10 additions & 10 deletions google/cloud/networkconnectivity_v1/types/hub.py
Expand Up @@ -57,10 +57,10 @@ class State(proto.Enum):


class Hub(proto.Message):
r"""A hub is essentially 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.
r"""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.
Attributes:
name (str):
Expand Down Expand Up @@ -109,12 +109,12 @@ class Hub(proto.Message):


class RoutingVPC(proto.Message):
r"""RoutingsVPC contains information about a VPC network that is
r"""RoutingVPC contains information about the VPC network that is
associated with a hub's spokes.
Attributes:
uri (str):
The URI of a VPC network.
The URI of the VPC network.
"""

uri = proto.Field(proto.STRING, number=1,)
Expand Down Expand Up @@ -148,8 +148,8 @@ class Spoke(proto.Message):
description (str):
An optional description of the spoke.
hub (str):
Immutable. The URI of the hub that this spoke
is attached to.
Immutable. The name of the hub that this
spoke is attached to.
linked_vpn_tunnels (google.cloud.networkconnectivity_v1.types.LinkedVpnTunnels):
VPN tunnels that are associated with the
spoke.
Expand Down Expand Up @@ -263,7 +263,7 @@ class CreateHubRequest(proto.Message):
parent (str):
Required. The parent resource.
hub_id (str):
Optional. A unique identifier for the hub.
Required. A unique identifier for the hub.
hub (google.cloud.networkconnectivity_v1.types.Hub):
Required. The initial values for a new hub.
request_id (str):
Expand Down Expand Up @@ -442,7 +442,7 @@ class CreateSpokeRequest(proto.Message):
parent (str):
Required. The parent resource.
spoke_id (str):
Optional. Unique id for the spoke to create.
Required. Unique id for the spoke to create.
spoke (google.cloud.networkconnectivity_v1.types.Spoke):
Required. The initial values for a new spoke.
request_id (str):
Expand Down
4 changes: 2 additions & 2 deletions scripts/fixup_networkconnectivity_v1_keywords.py
Expand Up @@ -39,8 +39,8 @@ def partition(
class networkconnectivityCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'create_hub': ('parent', 'hub', 'hub_id', 'request_id', ),
'create_spoke': ('parent', 'spoke', 'spoke_id', 'request_id', ),
'create_hub': ('parent', 'hub_id', 'hub', 'request_id', ),
'create_spoke': ('parent', 'spoke_id', 'spoke', 'request_id', ),
'delete_hub': ('name', 'request_id', ),
'delete_spoke': ('name', 'request_id', ),
'get_hub': ('name', ),
Expand Down

0 comments on commit 17b9d5f

Please sign in to comment.