|
41 | 41 | from google.iam.v1 import iam_policy_pb2 # type: ignore |
42 | 42 | from google.iam.v1 import policy_pb2 # type: ignore |
43 | 43 | from google.protobuf import field_mask_pb2 # type: ignore |
| 44 | +from google.protobuf import timestamp_pb2 # type: ignore |
44 | 45 | from .transports.base import RegistrationServiceTransport, DEFAULT_CLIENT_INFO |
45 | 46 | from .transports.grpc import RegistrationServiceGrpcTransport |
46 | 47 | from .transports.grpc_asyncio import RegistrationServiceGrpcAsyncIOTransport |
@@ -220,6 +221,22 @@ def parse_namespace_path(path: str) -> Dict[str, str]: |
220 | 221 | ) |
221 | 222 | return m.groupdict() if m else {} |
222 | 223 |
|
| 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 | + |
223 | 240 | @staticmethod |
224 | 241 | def service_path(project: str, location: str, namespace: str, service: str,) -> str: |
225 | 242 | """Returns a fully-qualified service string.""" |
@@ -422,7 +439,7 @@ def create_namespace( |
422 | 439 | timeout: float = None, |
423 | 440 | metadata: Sequence[Tuple[str, str]] = (), |
424 | 441 | ) -> gcs_namespace.Namespace: |
425 | | - r"""Creates a namespace, and returns the new Namespace. |
| 442 | + r"""Creates a namespace, and returns the new namespace. |
426 | 443 |
|
427 | 444 | Args: |
428 | 445 | request (google.cloud.servicedirectory_v1beta1.types.CreateNamespaceRequest): |
@@ -529,7 +546,7 @@ def list_namespaces( |
529 | 546 | parent (str): |
530 | 547 | Required. The resource name of the |
531 | 548 | project and location whose namespaces |
532 | | - we'd like to list. |
| 549 | + you'd like to list. |
533 | 550 |
|
534 | 551 | This corresponds to the ``parent`` field |
535 | 552 | on the ``request`` instance; if ``request`` is provided, this |
@@ -824,7 +841,7 @@ def create_service( |
824 | 841 | timeout: float = None, |
825 | 842 | metadata: Sequence[Tuple[str, str]] = (), |
826 | 843 | ) -> gcs_service.Service: |
827 | | - r"""Creates a service, and returns the new Service. |
| 844 | + r"""Creates a service, and returns the new service. |
828 | 845 |
|
829 | 846 | Args: |
830 | 847 | request (google.cloud.servicedirectory_v1beta1.types.CreateServiceRequest): |
@@ -929,7 +946,7 @@ def list_services( |
929 | 946 | [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. |
930 | 947 | parent (str): |
931 | 948 | Required. The resource name of the |
932 | | - namespace whose services we'd like to |
| 949 | + namespace whose services you'd like to |
933 | 950 | list. |
934 | 951 |
|
935 | 952 | This corresponds to the ``parent`` field |
@@ -1009,7 +1026,7 @@ def get_service( |
1009 | 1026 | The request object. The request message for |
1010 | 1027 | [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. |
1011 | 1028 | 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 |
1013 | 1030 | endpoints and associated metadata. |
1014 | 1031 | name (str): |
1015 | 1032 | Required. The name of the service to |
@@ -1228,7 +1245,7 @@ def create_endpoint( |
1228 | 1245 | timeout: float = None, |
1229 | 1246 | metadata: Sequence[Tuple[str, str]] = (), |
1230 | 1247 | ) -> gcs_endpoint.Endpoint: |
1231 | | - r"""Creates a endpoint, and returns the new Endpoint. |
| 1248 | + r"""Creates an endpoint, and returns the new endpoint. |
1232 | 1249 |
|
1233 | 1250 | Args: |
1234 | 1251 | request (google.cloud.servicedirectory_v1beta1.types.CreateEndpointRequest): |
@@ -1332,7 +1349,7 @@ def list_endpoints( |
1332 | 1349 | [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. |
1333 | 1350 | parent (str): |
1334 | 1351 | Required. The resource name of the |
1335 | | - service whose endpoints we'd like to |
| 1352 | + service whose endpoints you'd like to |
1336 | 1353 | list. |
1337 | 1354 |
|
1338 | 1355 | This corresponds to the ``parent`` field |
@@ -1405,7 +1422,7 @@ def get_endpoint( |
1405 | 1422 | timeout: float = None, |
1406 | 1423 | metadata: Sequence[Tuple[str, str]] = (), |
1407 | 1424 | ) -> endpoint.Endpoint: |
1408 | | - r"""Gets a endpoint. |
| 1425 | + r"""Gets an endpoint. |
1409 | 1426 |
|
1410 | 1427 | Args: |
1411 | 1428 | request (google.cloud.servicedirectory_v1beta1.types.GetEndpointRequest): |
@@ -1480,7 +1497,7 @@ def update_endpoint( |
1480 | 1497 | timeout: float = None, |
1481 | 1498 | metadata: Sequence[Tuple[str, str]] = (), |
1482 | 1499 | ) -> gcs_endpoint.Endpoint: |
1483 | | - r"""Updates a endpoint. |
| 1500 | + r"""Updates an endpoint. |
1484 | 1501 |
|
1485 | 1502 | Args: |
1486 | 1503 | request (google.cloud.servicedirectory_v1beta1.types.UpdateEndpointRequest): |
@@ -1561,7 +1578,7 @@ def delete_endpoint( |
1561 | 1578 | timeout: float = None, |
1562 | 1579 | metadata: Sequence[Tuple[str, str]] = (), |
1563 | 1580 | ) -> None: |
1564 | | - r"""Deletes a endpoint. |
| 1581 | + r"""Deletes an endpoint. |
1565 | 1582 |
|
1566 | 1583 | Args: |
1567 | 1584 | request (google.cloud.servicedirectory_v1beta1.types.DeleteEndpointRequest): |
|
0 commit comments