Skip to content

Commit 1a94350

Browse files
feat: Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields. (#88)
PiperOrigin-RevId: 381234166 Source-Link: googleapis/googleapis@d69baf2 Source-Link: googleapis/googleapis-gen@4111164
1 parent 2ccdaf1 commit 1a94350

14 files changed

Lines changed: 483 additions & 193 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Marker file for PEP 561.
2-
# The google-cloud-servicedirectory package uses inline types.
2+
# The google-cloud-service-directory package uses inline types.

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/lookup_service/async_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class LookupServiceAsyncClient:
4343

4444
endpoint_path = staticmethod(LookupServiceClient.endpoint_path)
4545
parse_endpoint_path = staticmethod(LookupServiceClient.parse_endpoint_path)
46+
network_path = staticmethod(LookupServiceClient.network_path)
47+
parse_network_path = staticmethod(LookupServiceClient.parse_network_path)
4648
service_path = staticmethod(LookupServiceClient.service_path)
4749
parse_service_path = staticmethod(LookupServiceClient.parse_service_path)
4850
common_billing_account_path = staticmethod(

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/lookup_service/client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,22 @@ def parse_endpoint_path(path: str) -> Dict[str, str]:
175175
)
176176
return m.groupdict() if m else {}
177177

178+
@staticmethod
179+
def network_path(project: str, network: str,) -> str:
180+
"""Returns a fully-qualified network string."""
181+
return "projects/{project}/locations/global/networks/{network}".format(
182+
project=project, network=network,
183+
)
184+
185+
@staticmethod
186+
def parse_network_path(path: str) -> Dict[str, str]:
187+
"""Parses a network path into its component segments."""
188+
m = re.match(
189+
r"^projects/(?P<project>.+?)/locations/global/networks/(?P<network>.+?)$",
190+
path,
191+
)
192+
return m.groupdict() if m else {}
193+
178194
@staticmethod
179195
def service_path(project: str, location: str, namespace: str, service: str,) -> str:
180196
"""Returns a fully-qualified service string."""

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/registration_service/async_client.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from google.iam.v1 import iam_policy_pb2 # type: ignore
3838
from google.iam.v1 import policy_pb2 # type: ignore
3939
from google.protobuf import field_mask_pb2 # type: ignore
40+
from google.protobuf import timestamp_pb2 # type: ignore
4041
from .transports.base import RegistrationServiceTransport, DEFAULT_CLIENT_INFO
4142
from .transports.grpc_asyncio import RegistrationServiceGrpcAsyncIOTransport
4243
from .client import RegistrationServiceClient
@@ -70,6 +71,8 @@ class RegistrationServiceAsyncClient:
7071
parse_endpoint_path = staticmethod(RegistrationServiceClient.parse_endpoint_path)
7172
namespace_path = staticmethod(RegistrationServiceClient.namespace_path)
7273
parse_namespace_path = staticmethod(RegistrationServiceClient.parse_namespace_path)
74+
network_path = staticmethod(RegistrationServiceClient.network_path)
75+
parse_network_path = staticmethod(RegistrationServiceClient.parse_network_path)
7376
service_path = staticmethod(RegistrationServiceClient.service_path)
7477
parse_service_path = staticmethod(RegistrationServiceClient.parse_service_path)
7578
common_billing_account_path = staticmethod(
@@ -202,7 +205,7 @@ async def create_namespace(
202205
timeout: float = None,
203206
metadata: Sequence[Tuple[str, str]] = (),
204207
) -> gcs_namespace.Namespace:
205-
r"""Creates a namespace, and returns the new Namespace.
208+
r"""Creates a namespace, and returns the new namespace.
206209
207210
Args:
208211
request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateNamespaceRequest`):
@@ -309,7 +312,7 @@ async def list_namespaces(
309312
parent (:class:`str`):
310313
Required. The resource name of the
311314
project and location whose namespaces
312-
we'd like to list.
315+
you'd like to list.
313316
314317
This corresponds to the ``parent`` field
315318
on the ``request`` instance; if ``request`` is provided, this
@@ -604,7 +607,7 @@ async def create_service(
604607
timeout: float = None,
605608
metadata: Sequence[Tuple[str, str]] = (),
606609
) -> gcs_service.Service:
607-
r"""Creates a service, and returns the new Service.
610+
r"""Creates a service, and returns the new service.
608611
609612
Args:
610613
request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateServiceRequest`):
@@ -709,7 +712,7 @@ async def list_services(
709712
[RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
710713
parent (:class:`str`):
711714
Required. The resource name of the
712-
namespace whose services we'd like to
715+
namespace whose services you'd like to
713716
list.
714717
715718
This corresponds to the ``parent`` field
@@ -789,7 +792,7 @@ async def get_service(
789792
The request object. The request message for
790793
[RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
791794
This should not be used for looking up a service.
792-
Insead, use the `resolve` method as it will contain all
795+
Insead, use the `resolve` method as it contains all
793796
endpoints and associated metadata.
794797
name (:class:`str`):
795798
Required. The name of the service to
@@ -1008,7 +1011,7 @@ async def create_endpoint(
10081011
timeout: float = None,
10091012
metadata: Sequence[Tuple[str, str]] = (),
10101013
) -> gcs_endpoint.Endpoint:
1011-
r"""Creates a endpoint, and returns the new Endpoint.
1014+
r"""Creates an endpoint, and returns the new endpoint.
10121015
10131016
Args:
10141017
request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateEndpointRequest`):
@@ -1112,7 +1115,7 @@ async def list_endpoints(
11121115
[RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
11131116
parent (:class:`str`):
11141117
Required. The resource name of the
1115-
service whose endpoints we'd like to
1118+
service whose endpoints you'd like to
11161119
list.
11171120
11181121
This corresponds to the ``parent`` field
@@ -1185,7 +1188,7 @@ async def get_endpoint(
11851188
timeout: float = None,
11861189
metadata: Sequence[Tuple[str, str]] = (),
11871190
) -> endpoint.Endpoint:
1188-
r"""Gets a endpoint.
1191+
r"""Gets an endpoint.
11891192
11901193
Args:
11911194
request (:class:`google.cloud.servicedirectory_v1beta1.types.GetEndpointRequest`):
@@ -1260,7 +1263,7 @@ async def update_endpoint(
12601263
timeout: float = None,
12611264
metadata: Sequence[Tuple[str, str]] = (),
12621265
) -> gcs_endpoint.Endpoint:
1263-
r"""Updates a endpoint.
1266+
r"""Updates an endpoint.
12641267
12651268
Args:
12661269
request (:class:`google.cloud.servicedirectory_v1beta1.types.UpdateEndpointRequest`):
@@ -1341,7 +1344,7 @@ async def delete_endpoint(
13411344
timeout: float = None,
13421345
metadata: Sequence[Tuple[str, str]] = (),
13431346
) -> None:
1344-
r"""Deletes a endpoint.
1347+
r"""Deletes an endpoint.
13451348
13461349
Args:
13471350
request (:class:`google.cloud.servicedirectory_v1beta1.types.DeleteEndpointRequest`):

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/registration_service/client.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from google.iam.v1 import iam_policy_pb2 # type: ignore
4242
from google.iam.v1 import policy_pb2 # type: ignore
4343
from google.protobuf import field_mask_pb2 # type: ignore
44+
from google.protobuf import timestamp_pb2 # type: ignore
4445
from .transports.base import RegistrationServiceTransport, DEFAULT_CLIENT_INFO
4546
from .transports.grpc import RegistrationServiceGrpcTransport
4647
from .transports.grpc_asyncio import RegistrationServiceGrpcAsyncIOTransport
@@ -220,6 +221,22 @@ def parse_namespace_path(path: str) -> Dict[str, str]:
220221
)
221222
return m.groupdict() if m else {}
222223

224+
@staticmethod
225+
def network_path(project: str, network: str,) -> str:
226+
"""Returns a fully-qualified network string."""
227+
return "projects/{project}/locations/global/networks/{network}".format(
228+
project=project, network=network,
229+
)
230+
231+
@staticmethod
232+
def parse_network_path(path: str) -> Dict[str, str]:
233+
"""Parses a network path into its component segments."""
234+
m = re.match(
235+
r"^projects/(?P<project>.+?)/locations/global/networks/(?P<network>.+?)$",
236+
path,
237+
)
238+
return m.groupdict() if m else {}
239+
223240
@staticmethod
224241
def service_path(project: str, location: str, namespace: str, service: str,) -> str:
225242
"""Returns a fully-qualified service string."""
@@ -422,7 +439,7 @@ def create_namespace(
422439
timeout: float = None,
423440
metadata: Sequence[Tuple[str, str]] = (),
424441
) -> gcs_namespace.Namespace:
425-
r"""Creates a namespace, and returns the new Namespace.
442+
r"""Creates a namespace, and returns the new namespace.
426443
427444
Args:
428445
request (google.cloud.servicedirectory_v1beta1.types.CreateNamespaceRequest):
@@ -529,7 +546,7 @@ def list_namespaces(
529546
parent (str):
530547
Required. The resource name of the
531548
project and location whose namespaces
532-
we'd like to list.
549+
you'd like to list.
533550
534551
This corresponds to the ``parent`` field
535552
on the ``request`` instance; if ``request`` is provided, this
@@ -824,7 +841,7 @@ def create_service(
824841
timeout: float = None,
825842
metadata: Sequence[Tuple[str, str]] = (),
826843
) -> gcs_service.Service:
827-
r"""Creates a service, and returns the new Service.
844+
r"""Creates a service, and returns the new service.
828845
829846
Args:
830847
request (google.cloud.servicedirectory_v1beta1.types.CreateServiceRequest):
@@ -929,7 +946,7 @@ def list_services(
929946
[RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices].
930947
parent (str):
931948
Required. The resource name of the
932-
namespace whose services we'd like to
949+
namespace whose services you'd like to
933950
list.
934951
935952
This corresponds to the ``parent`` field
@@ -1009,7 +1026,7 @@ def get_service(
10091026
The request object. The request message for
10101027
[RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService].
10111028
This should not be used for looking up a service.
1012-
Insead, use the `resolve` method as it will contain all
1029+
Insead, use the `resolve` method as it contains all
10131030
endpoints and associated metadata.
10141031
name (str):
10151032
Required. The name of the service to
@@ -1228,7 +1245,7 @@ def create_endpoint(
12281245
timeout: float = None,
12291246
metadata: Sequence[Tuple[str, str]] = (),
12301247
) -> gcs_endpoint.Endpoint:
1231-
r"""Creates a endpoint, and returns the new Endpoint.
1248+
r"""Creates an endpoint, and returns the new endpoint.
12321249
12331250
Args:
12341251
request (google.cloud.servicedirectory_v1beta1.types.CreateEndpointRequest):
@@ -1332,7 +1349,7 @@ def list_endpoints(
13321349
[RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints].
13331350
parent (str):
13341351
Required. The resource name of the
1335-
service whose endpoints we'd like to
1352+
service whose endpoints you'd like to
13361353
list.
13371354
13381355
This corresponds to the ``parent`` field
@@ -1405,7 +1422,7 @@ def get_endpoint(
14051422
timeout: float = None,
14061423
metadata: Sequence[Tuple[str, str]] = (),
14071424
) -> endpoint.Endpoint:
1408-
r"""Gets a endpoint.
1425+
r"""Gets an endpoint.
14091426
14101427
Args:
14111428
request (google.cloud.servicedirectory_v1beta1.types.GetEndpointRequest):
@@ -1480,7 +1497,7 @@ def update_endpoint(
14801497
timeout: float = None,
14811498
metadata: Sequence[Tuple[str, str]] = (),
14821499
) -> gcs_endpoint.Endpoint:
1483-
r"""Updates a endpoint.
1500+
r"""Updates an endpoint.
14841501
14851502
Args:
14861503
request (google.cloud.servicedirectory_v1beta1.types.UpdateEndpointRequest):
@@ -1561,7 +1578,7 @@ def delete_endpoint(
15611578
timeout: float = None,
15621579
metadata: Sequence[Tuple[str, str]] = (),
15631580
) -> None:
1564-
r"""Deletes a endpoint.
1581+
r"""Deletes an endpoint.
15651582
15661583
Args:
15671584
request (google.cloud.servicedirectory_v1beta1.types.DeleteEndpointRequest):

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def create_namespace(
254254
]:
255255
r"""Return a callable for the create namespace method over gRPC.
256256
257-
Creates a namespace, and returns the new Namespace.
257+
Creates a namespace, and returns the new namespace.
258258
259259
Returns:
260260
Callable[[~.CreateNamespaceRequest],
@@ -390,7 +390,7 @@ def create_service(
390390
) -> Callable[[registration_service.CreateServiceRequest], gcs_service.Service]:
391391
r"""Return a callable for the create service method over gRPC.
392392
393-
Creates a service, and returns the new Service.
393+
Creates a service, and returns the new service.
394394
395395
Returns:
396396
Callable[[~.CreateServiceRequest],
@@ -524,7 +524,7 @@ def create_endpoint(
524524
) -> Callable[[registration_service.CreateEndpointRequest], gcs_endpoint.Endpoint]:
525525
r"""Return a callable for the create endpoint method over gRPC.
526526
527-
Creates a endpoint, and returns the new Endpoint.
527+
Creates an endpoint, and returns the new endpoint.
528528
529529
Returns:
530530
Callable[[~.CreateEndpointRequest],
@@ -579,7 +579,7 @@ def get_endpoint(
579579
) -> Callable[[registration_service.GetEndpointRequest], endpoint.Endpoint]:
580580
r"""Return a callable for the get endpoint method over gRPC.
581581
582-
Gets a endpoint.
582+
Gets an endpoint.
583583
584584
Returns:
585585
Callable[[~.GetEndpointRequest],
@@ -605,7 +605,7 @@ def update_endpoint(
605605
) -> Callable[[registration_service.UpdateEndpointRequest], gcs_endpoint.Endpoint]:
606606
r"""Return a callable for the update endpoint method over gRPC.
607607
608-
Updates a endpoint.
608+
Updates an endpoint.
609609
610610
Returns:
611611
Callable[[~.UpdateEndpointRequest],
@@ -631,7 +631,7 @@ def delete_endpoint(
631631
) -> Callable[[registration_service.DeleteEndpointRequest], empty_pb2.Empty]:
632632
r"""Return a callable for the delete endpoint method over gRPC.
633633
634-
Deletes a endpoint.
634+
Deletes an endpoint.
635635
636636
Returns:
637637
Callable[[~.DeleteEndpointRequest],

packages/google-cloud-service-directory/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def create_namespace(
258258
]:
259259
r"""Return a callable for the create namespace method over gRPC.
260260
261-
Creates a namespace, and returns the new Namespace.
261+
Creates a namespace, and returns the new namespace.
262262
263263
Returns:
264264
Callable[[~.CreateNamespaceRequest],
@@ -401,7 +401,7 @@ def create_service(
401401
]:
402402
r"""Return a callable for the create service method over gRPC.
403403
404-
Creates a service, and returns the new Service.
404+
Creates a service, and returns the new service.
405405
406406
Returns:
407407
Callable[[~.CreateServiceRequest],
@@ -541,7 +541,7 @@ def create_endpoint(
541541
]:
542542
r"""Return a callable for the create endpoint method over gRPC.
543543
544-
Creates a endpoint, and returns the new Endpoint.
544+
Creates an endpoint, and returns the new endpoint.
545545
546546
Returns:
547547
Callable[[~.CreateEndpointRequest],
@@ -598,7 +598,7 @@ def get_endpoint(
598598
]:
599599
r"""Return a callable for the get endpoint method over gRPC.
600600
601-
Gets a endpoint.
601+
Gets an endpoint.
602602
603603
Returns:
604604
Callable[[~.GetEndpointRequest],
@@ -626,7 +626,7 @@ def update_endpoint(
626626
]:
627627
r"""Return a callable for the update endpoint method over gRPC.
628628
629-
Updates a endpoint.
629+
Updates an endpoint.
630630
631631
Returns:
632632
Callable[[~.UpdateEndpointRequest],
@@ -654,7 +654,7 @@ def delete_endpoint(
654654
]:
655655
r"""Return a callable for the delete endpoint method over gRPC.
656656
657-
Deletes a endpoint.
657+
Deletes an endpoint.
658658
659659
Returns:
660660
Callable[[~.DeleteEndpointRequest],

0 commit comments

Comments
 (0)