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

Commit 17b9d5f

Browse files
fix: Mark API fields as required which were already required on the backend (#107)
* fix!: Mark a couple networkconnectivity API fields as required, to match implemented behavior PiperOrigin-RevId: 408969147 Source-Link: googleapis/googleapis@cc003a4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/72d5b22e2124c7a5f6cd31864f7f8c93a5df3592 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>
1 parent 61518ce commit 17b9d5f

File tree

4 files changed

+38
-38
lines changed

4 files changed

+38
-38
lines changed

google/cloud/networkconnectivity_v1/services/hub_service/async_client.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ async def get_hub(
296296
297297
Returns:
298298
google.cloud.networkconnectivity_v1.types.Hub:
299-
A hub is essentially a collection of
300-
spokes. A single hub can contain spokes
301-
from multiple regions. However, all of a
299+
A hub is a collection of spokes. A
300+
single hub can contain spokes from
301+
multiple regions. However, all of a
302302
hub's spokes must be associated with
303303
resources that reside in the same VPC
304304
network.
@@ -372,7 +372,7 @@ async def create_hub(
372372
on the ``request`` instance; if ``request`` is provided, this
373373
should not be set.
374374
hub_id (:class:`str`):
375-
Optional. A unique identifier for the
375+
Required. A unique identifier for the
376376
hub.
377377
378378
This corresponds to the ``hub_id`` field
@@ -388,10 +388,10 @@ async def create_hub(
388388
google.api_core.operation_async.AsyncOperation:
389389
An object representing a long-running operation.
390390
391-
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
392-
from multiple regions. However, all of a hub's spokes
393-
must be associated with resources that reside in the
394-
same VPC network.
391+
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
392+
multiple regions. However, all of a hub's spokes must
393+
be associated with resources that reside in the same
394+
VPC network.
395395
396396
"""
397397
# Create or coerce a protobuf request object.
@@ -489,10 +489,10 @@ async def update_hub(
489489
google.api_core.operation_async.AsyncOperation:
490490
An object representing a long-running operation.
491491
492-
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
493-
from multiple regions. However, all of a hub's spokes
494-
must be associated with resources that reside in the
495-
same VPC network.
492+
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
493+
multiple regions. However, all of a hub's spokes must
494+
be associated with resources that reside in the same
495+
VPC network.
496496
497497
"""
498498
# Create or coerce a protobuf request object.
@@ -823,7 +823,7 @@ async def create_spoke(
823823
on the ``request`` instance; if ``request`` is provided, this
824824
should not be set.
825825
spoke_id (:class:`str`):
826-
Optional. Unique id for the spoke to
826+
Required. Unique id for the spoke to
827827
create.
828828
829829
This corresponds to the ``spoke_id`` field

google/cloud/networkconnectivity_v1/services/hub_service/client.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -558,9 +558,9 @@ def get_hub(
558558
559559
Returns:
560560
google.cloud.networkconnectivity_v1.types.Hub:
561-
A hub is essentially a collection of
562-
spokes. A single hub can contain spokes
563-
from multiple regions. However, all of a
561+
A hub is a collection of spokes. A
562+
single hub can contain spokes from
563+
multiple regions. However, all of a
564564
hub's spokes must be associated with
565565
resources that reside in the same VPC
566566
network.
@@ -634,7 +634,7 @@ def create_hub(
634634
on the ``request`` instance; if ``request`` is provided, this
635635
should not be set.
636636
hub_id (str):
637-
Optional. A unique identifier for the
637+
Required. A unique identifier for the
638638
hub.
639639
640640
This corresponds to the ``hub_id`` field
@@ -650,10 +650,10 @@ def create_hub(
650650
google.api_core.operation.Operation:
651651
An object representing a long-running operation.
652652
653-
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
654-
from multiple regions. However, all of a hub's spokes
655-
must be associated with resources that reside in the
656-
same VPC network.
653+
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
654+
multiple regions. However, all of a hub's spokes must
655+
be associated with resources that reside in the same
656+
VPC network.
657657
658658
"""
659659
# Create or coerce a protobuf request object.
@@ -751,10 +751,10 @@ def update_hub(
751751
google.api_core.operation.Operation:
752752
An object representing a long-running operation.
753753
754-
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
755-
from multiple regions. However, all of a hub's spokes
756-
must be associated with resources that reside in the
757-
same VPC network.
754+
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
755+
multiple regions. However, all of a hub's spokes must
756+
be associated with resources that reside in the same
757+
VPC network.
758758
759759
"""
760760
# Create or coerce a protobuf request object.
@@ -1085,7 +1085,7 @@ def create_spoke(
10851085
on the ``request`` instance; if ``request`` is provided, this
10861086
should not be set.
10871087
spoke_id (str):
1088-
Optional. Unique id for the spoke to
1088+
Required. Unique id for the spoke to
10891089
create.
10901090
10911091
This corresponds to the ``spoke_id`` field

google/cloud/networkconnectivity_v1/types/hub.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ class State(proto.Enum):
5757

5858

5959
class Hub(proto.Message):
60-
r"""A hub is essentially a collection of spokes. A single hub can
61-
contain spokes from multiple regions. However, all of a hub's
62-
spokes must be associated with resources that reside in the same
63-
VPC network.
60+
r"""A hub is a collection of spokes. A single hub can contain
61+
spokes from multiple regions. However, all of a hub's spokes
62+
must be associated with resources that reside in the same VPC
63+
network.
6464
6565
Attributes:
6666
name (str):
@@ -109,12 +109,12 @@ class Hub(proto.Message):
109109

110110

111111
class RoutingVPC(proto.Message):
112-
r"""RoutingsVPC contains information about a VPC network that is
112+
r"""RoutingVPC contains information about the VPC network that is
113113
associated with a hub's spokes.
114114
115115
Attributes:
116116
uri (str):
117-
The URI of a VPC network.
117+
The URI of the VPC network.
118118
"""
119119

120120
uri = proto.Field(proto.STRING, number=1,)
@@ -148,8 +148,8 @@ class Spoke(proto.Message):
148148
description (str):
149149
An optional description of the spoke.
150150
hub (str):
151-
Immutable. The URI of the hub that this spoke
152-
is attached to.
151+
Immutable. The name of the hub that this
152+
spoke is attached to.
153153
linked_vpn_tunnels (google.cloud.networkconnectivity_v1.types.LinkedVpnTunnels):
154154
VPN tunnels that are associated with the
155155
spoke.
@@ -263,7 +263,7 @@ class CreateHubRequest(proto.Message):
263263
parent (str):
264264
Required. The parent resource.
265265
hub_id (str):
266-
Optional. A unique identifier for the hub.
266+
Required. A unique identifier for the hub.
267267
hub (google.cloud.networkconnectivity_v1.types.Hub):
268268
Required. The initial values for a new hub.
269269
request_id (str):
@@ -442,7 +442,7 @@ class CreateSpokeRequest(proto.Message):
442442
parent (str):
443443
Required. The parent resource.
444444
spoke_id (str):
445-
Optional. Unique id for the spoke to create.
445+
Required. Unique id for the spoke to create.
446446
spoke (google.cloud.networkconnectivity_v1.types.Spoke):
447447
Required. The initial values for a new spoke.
448448
request_id (str):

scripts/fixup_networkconnectivity_v1_keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def partition(
3939
class networkconnectivityCallTransformer(cst.CSTTransformer):
4040
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
4141
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
42-
'create_hub': ('parent', 'hub', 'hub_id', 'request_id', ),
43-
'create_spoke': ('parent', 'spoke', 'spoke_id', 'request_id', ),
42+
'create_hub': ('parent', 'hub_id', 'hub', 'request_id', ),
43+
'create_spoke': ('parent', 'spoke_id', 'spoke', 'request_id', ),
4444
'delete_hub': ('name', 'request_id', ),
4545
'delete_spoke': ('name', 'request_id', ),
4646
'get_hub': ('name', ),

0 commit comments

Comments
 (0)