From e7fba11e53b85ff25620ba92e8859206fd7884d8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 26 Jun 2021 12:20:21 +0000 Subject: [PATCH] feat: Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields. (#88) PiperOrigin-RevId: 381234166 Source-Link: https://github.com/googleapis/googleapis/commit/d69baf2e2d3c0071a117e64689c154f8dd46fb09 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4111164f519b47bee7a907c06cec7277e5becbea --- .../cloud/servicedirectory_v1beta1/py.typed | 2 +- .../services/lookup_service/async_client.py | 2 + .../services/lookup_service/client.py | 16 ++ .../registration_service/async_client.py | 23 +- .../services/registration_service/client.py | 37 ++- .../registration_service/transports/grpc.py | 12 +- .../transports/grpc_asyncio.py | 12 +- .../types/endpoint.py | 73 ++++-- .../types/lookup_service.py | 47 +++- .../types/namespace.py | 16 +- .../types/registration_service.py | 215 +++++++++++------- .../servicedirectory_v1beta1/types/service.py | 54 ++++- .../test_lookup_service.py | 62 +++-- .../test_registration_service.py | 105 ++++++--- 14 files changed, 483 insertions(+), 193 deletions(-) diff --git a/google/cloud/servicedirectory_v1beta1/py.typed b/google/cloud/servicedirectory_v1beta1/py.typed index 6790e24b..8a62d150 100644 --- a/google/cloud/servicedirectory_v1beta1/py.typed +++ b/google/cloud/servicedirectory_v1beta1/py.typed @@ -1,2 +1,2 @@ # Marker file for PEP 561. -# The google-cloud-servicedirectory package uses inline types. +# The google-cloud-service-directory package uses inline types. diff --git a/google/cloud/servicedirectory_v1beta1/services/lookup_service/async_client.py b/google/cloud/servicedirectory_v1beta1/services/lookup_service/async_client.py index d181ef5a..1a198208 100644 --- a/google/cloud/servicedirectory_v1beta1/services/lookup_service/async_client.py +++ b/google/cloud/servicedirectory_v1beta1/services/lookup_service/async_client.py @@ -43,6 +43,8 @@ class LookupServiceAsyncClient: endpoint_path = staticmethod(LookupServiceClient.endpoint_path) parse_endpoint_path = staticmethod(LookupServiceClient.parse_endpoint_path) + network_path = staticmethod(LookupServiceClient.network_path) + parse_network_path = staticmethod(LookupServiceClient.parse_network_path) service_path = staticmethod(LookupServiceClient.service_path) parse_service_path = staticmethod(LookupServiceClient.parse_service_path) common_billing_account_path = staticmethod( diff --git a/google/cloud/servicedirectory_v1beta1/services/lookup_service/client.py b/google/cloud/servicedirectory_v1beta1/services/lookup_service/client.py index d6e7d54a..1568bd85 100644 --- a/google/cloud/servicedirectory_v1beta1/services/lookup_service/client.py +++ b/google/cloud/servicedirectory_v1beta1/services/lookup_service/client.py @@ -175,6 +175,22 @@ def parse_endpoint_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def network_path(project: str, network: str,) -> str: + """Returns a fully-qualified network string.""" + return "projects/{project}/locations/global/networks/{network}".format( + project=project, network=network, + ) + + @staticmethod + def parse_network_path(path: str) -> Dict[str, str]: + """Parses a network path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/global/networks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def service_path(project: str, location: str, namespace: str, service: str,) -> str: """Returns a fully-qualified service string.""" diff --git a/google/cloud/servicedirectory_v1beta1/services/registration_service/async_client.py b/google/cloud/servicedirectory_v1beta1/services/registration_service/async_client.py index f918de8a..2f281b85 100644 --- a/google/cloud/servicedirectory_v1beta1/services/registration_service/async_client.py +++ b/google/cloud/servicedirectory_v1beta1/services/registration_service/async_client.py @@ -37,6 +37,7 @@ from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore from .transports.base import RegistrationServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import RegistrationServiceGrpcAsyncIOTransport from .client import RegistrationServiceClient @@ -70,6 +71,8 @@ class RegistrationServiceAsyncClient: parse_endpoint_path = staticmethod(RegistrationServiceClient.parse_endpoint_path) namespace_path = staticmethod(RegistrationServiceClient.namespace_path) parse_namespace_path = staticmethod(RegistrationServiceClient.parse_namespace_path) + network_path = staticmethod(RegistrationServiceClient.network_path) + parse_network_path = staticmethod(RegistrationServiceClient.parse_network_path) service_path = staticmethod(RegistrationServiceClient.service_path) parse_service_path = staticmethod(RegistrationServiceClient.parse_service_path) common_billing_account_path = staticmethod( @@ -202,7 +205,7 @@ async def create_namespace( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_namespace.Namespace: - r"""Creates a namespace, and returns the new Namespace. + r"""Creates a namespace, and returns the new namespace. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateNamespaceRequest`): @@ -309,7 +312,7 @@ async def list_namespaces( parent (:class:`str`): Required. The resource name of the project and location whose namespaces - we'd like to list. + you'd like to list. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -604,7 +607,7 @@ async def create_service( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_service.Service: - r"""Creates a service, and returns the new Service. + r"""Creates a service, and returns the new service. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateServiceRequest`): @@ -709,7 +712,7 @@ async def list_services( [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. parent (:class:`str`): Required. The resource name of the - namespace whose services we'd like to + namespace whose services you'd like to list. This corresponds to the ``parent`` field @@ -789,7 +792,7 @@ async def get_service( The request object. The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. This should not be used for looking up a service. - Insead, use the `resolve` method as it will contain all + Insead, use the `resolve` method as it contains all endpoints and associated metadata. name (:class:`str`): Required. The name of the service to @@ -1008,7 +1011,7 @@ async def create_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_endpoint.Endpoint: - r"""Creates a endpoint, and returns the new Endpoint. + r"""Creates an endpoint, and returns the new endpoint. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.CreateEndpointRequest`): @@ -1112,7 +1115,7 @@ async def list_endpoints( [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. parent (:class:`str`): Required. The resource name of the - service whose endpoints we'd like to + service whose endpoints you'd like to list. This corresponds to the ``parent`` field @@ -1185,7 +1188,7 @@ async def get_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> endpoint.Endpoint: - r"""Gets a endpoint. + r"""Gets an endpoint. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.GetEndpointRequest`): @@ -1260,7 +1263,7 @@ async def update_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_endpoint.Endpoint: - r"""Updates a endpoint. + r"""Updates an endpoint. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.UpdateEndpointRequest`): @@ -1341,7 +1344,7 @@ async def delete_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Deletes a endpoint. + r"""Deletes an endpoint. Args: request (:class:`google.cloud.servicedirectory_v1beta1.types.DeleteEndpointRequest`): diff --git a/google/cloud/servicedirectory_v1beta1/services/registration_service/client.py b/google/cloud/servicedirectory_v1beta1/services/registration_service/client.py index ce6f0b60..7b8a5dd5 100644 --- a/google/cloud/servicedirectory_v1beta1/services/registration_service/client.py +++ b/google/cloud/servicedirectory_v1beta1/services/registration_service/client.py @@ -41,6 +41,7 @@ from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore from .transports.base import RegistrationServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import RegistrationServiceGrpcTransport from .transports.grpc_asyncio import RegistrationServiceGrpcAsyncIOTransport @@ -220,6 +221,22 @@ def parse_namespace_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def network_path(project: str, network: str,) -> str: + """Returns a fully-qualified network string.""" + return "projects/{project}/locations/global/networks/{network}".format( + project=project, network=network, + ) + + @staticmethod + def parse_network_path(path: str) -> Dict[str, str]: + """Parses a network path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/global/networks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def service_path(project: str, location: str, namespace: str, service: str,) -> str: """Returns a fully-qualified service string.""" @@ -422,7 +439,7 @@ def create_namespace( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_namespace.Namespace: - r"""Creates a namespace, and returns the new Namespace. + r"""Creates a namespace, and returns the new namespace. Args: request (google.cloud.servicedirectory_v1beta1.types.CreateNamespaceRequest): @@ -529,7 +546,7 @@ def list_namespaces( parent (str): Required. The resource name of the project and location whose namespaces - we'd like to list. + you'd like to list. This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this @@ -824,7 +841,7 @@ def create_service( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_service.Service: - r"""Creates a service, and returns the new Service. + r"""Creates a service, and returns the new service. Args: request (google.cloud.servicedirectory_v1beta1.types.CreateServiceRequest): @@ -929,7 +946,7 @@ def list_services( [RegistrationService.ListServices][google.cloud.servicedirectory.v1beta1.RegistrationService.ListServices]. parent (str): Required. The resource name of the - namespace whose services we'd like to + namespace whose services you'd like to list. This corresponds to the ``parent`` field @@ -1009,7 +1026,7 @@ def get_service( The request object. The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. This should not be used for looking up a service. - Insead, use the `resolve` method as it will contain all + Insead, use the `resolve` method as it contains all endpoints and associated metadata. name (str): Required. The name of the service to @@ -1228,7 +1245,7 @@ def create_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_endpoint.Endpoint: - r"""Creates a endpoint, and returns the new Endpoint. + r"""Creates an endpoint, and returns the new endpoint. Args: request (google.cloud.servicedirectory_v1beta1.types.CreateEndpointRequest): @@ -1332,7 +1349,7 @@ def list_endpoints( [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. parent (str): Required. The resource name of the - service whose endpoints we'd like to + service whose endpoints you'd like to list. This corresponds to the ``parent`` field @@ -1405,7 +1422,7 @@ def get_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> endpoint.Endpoint: - r"""Gets a endpoint. + r"""Gets an endpoint. Args: request (google.cloud.servicedirectory_v1beta1.types.GetEndpointRequest): @@ -1480,7 +1497,7 @@ def update_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> gcs_endpoint.Endpoint: - r"""Updates a endpoint. + r"""Updates an endpoint. Args: request (google.cloud.servicedirectory_v1beta1.types.UpdateEndpointRequest): @@ -1561,7 +1578,7 @@ def delete_endpoint( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: - r"""Deletes a endpoint. + r"""Deletes an endpoint. Args: request (google.cloud.servicedirectory_v1beta1.types.DeleteEndpointRequest): diff --git a/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc.py b/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc.py index efcebb73..58d856c4 100644 --- a/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc.py +++ b/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc.py @@ -254,7 +254,7 @@ def create_namespace( ]: r"""Return a callable for the create namespace method over gRPC. - Creates a namespace, and returns the new Namespace. + Creates a namespace, and returns the new namespace. Returns: Callable[[~.CreateNamespaceRequest], @@ -390,7 +390,7 @@ def create_service( ) -> Callable[[registration_service.CreateServiceRequest], gcs_service.Service]: r"""Return a callable for the create service method over gRPC. - Creates a service, and returns the new Service. + Creates a service, and returns the new service. Returns: Callable[[~.CreateServiceRequest], @@ -524,7 +524,7 @@ def create_endpoint( ) -> Callable[[registration_service.CreateEndpointRequest], gcs_endpoint.Endpoint]: r"""Return a callable for the create endpoint method over gRPC. - Creates a endpoint, and returns the new Endpoint. + Creates an endpoint, and returns the new endpoint. Returns: Callable[[~.CreateEndpointRequest], @@ -579,7 +579,7 @@ def get_endpoint( ) -> Callable[[registration_service.GetEndpointRequest], endpoint.Endpoint]: r"""Return a callable for the get endpoint method over gRPC. - Gets a endpoint. + Gets an endpoint. Returns: Callable[[~.GetEndpointRequest], @@ -605,7 +605,7 @@ def update_endpoint( ) -> Callable[[registration_service.UpdateEndpointRequest], gcs_endpoint.Endpoint]: r"""Return a callable for the update endpoint method over gRPC. - Updates a endpoint. + Updates an endpoint. Returns: Callable[[~.UpdateEndpointRequest], @@ -631,7 +631,7 @@ def delete_endpoint( ) -> Callable[[registration_service.DeleteEndpointRequest], empty_pb2.Empty]: r"""Return a callable for the delete endpoint method over gRPC. - Deletes a endpoint. + Deletes an endpoint. Returns: Callable[[~.DeleteEndpointRequest], diff --git a/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py b/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py index 935abf39..1b489d41 100644 --- a/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py +++ b/google/cloud/servicedirectory_v1beta1/services/registration_service/transports/grpc_asyncio.py @@ -258,7 +258,7 @@ def create_namespace( ]: r"""Return a callable for the create namespace method over gRPC. - Creates a namespace, and returns the new Namespace. + Creates a namespace, and returns the new namespace. Returns: Callable[[~.CreateNamespaceRequest], @@ -401,7 +401,7 @@ def create_service( ]: r"""Return a callable for the create service method over gRPC. - Creates a service, and returns the new Service. + Creates a service, and returns the new service. Returns: Callable[[~.CreateServiceRequest], @@ -541,7 +541,7 @@ def create_endpoint( ]: r"""Return a callable for the create endpoint method over gRPC. - Creates a endpoint, and returns the new Endpoint. + Creates an endpoint, and returns the new endpoint. Returns: Callable[[~.CreateEndpointRequest], @@ -598,7 +598,7 @@ def get_endpoint( ]: r"""Return a callable for the get endpoint method over gRPC. - Gets a endpoint. + Gets an endpoint. Returns: Callable[[~.GetEndpointRequest], @@ -626,7 +626,7 @@ def update_endpoint( ]: r"""Return a callable for the update endpoint method over gRPC. - Updates a endpoint. + Updates an endpoint. Returns: Callable[[~.UpdateEndpointRequest], @@ -654,7 +654,7 @@ def delete_endpoint( ]: r"""Return a callable for the delete endpoint method over gRPC. - Deletes a endpoint. + Deletes an endpoint. Returns: Callable[[~.DeleteEndpointRequest], diff --git a/google/cloud/servicedirectory_v1beta1/types/endpoint.py b/google/cloud/servicedirectory_v1beta1/types/endpoint.py index 8600dc41..2d9307bf 100644 --- a/google/cloud/servicedirectory_v1beta1/types/endpoint.py +++ b/google/cloud/servicedirectory_v1beta1/types/endpoint.py @@ -15,6 +15,8 @@ # import proto # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + __protobuf__ = proto.module( package="google.cloud.servicedirectory.v1beta1", manifest={"Endpoint",}, @@ -29,28 +31,73 @@ class Endpoint(proto.Message): Attributes: name (str): Immutable. The resource name for the endpoint in the format - ``projects/*/locations/*/namespaces/*/services/*/endpoints/*`` + ``projects/*/locations/*/namespaces/*/services/*/endpoints/*``. address (str): - Optional. An IPv4 or IPv6 address. Service Directory will - reject bad addresses like: "8.8.8" "8.8.8.8:53" - "test:bad:address" "[::1]" "[::1]:8080" Limited to 45 - characters. + Optional. An IPv4 or IPv6 address. Service Directory rejects + bad addresses like: + + - ``8.8.8`` + - ``8.8.8.8:53`` + - ``test:bad:address`` + - ``[::1]`` + - ``[::1]:8080`` + + Limited to 45 characters. port (int): - Optional. Service Directory will reject values outside of - [0, 65535]. + Optional. Service Directory rejects values outside of + ``[0, 65535]``. metadata (Sequence[google.cloud.servicedirectory_v1beta1.types.Endpoint.MetadataEntry]): - Optional. Metadata for the endpoint. This - data can be consumed by service clients. The - entire metadata dictionary may contain up to 512 - characters, spread accoss all key-value pairs. - Metadata that goes beyond any these limits will - be rejected. + Optional. Metadata for the endpoint. This data can be + consumed by service clients. + + Restrictions: + + - The entire metadata dictionary may contain up to 512 + characters, spread accoss all key-value pairs. Metadata + that goes beyond this limit are rejected + - Valid metadata keys have two segments: an optional prefix + and name, separated by a slash (/). The name segment is + required and must be 63 characters or less, beginning and + ending with an alphanumeric character ([a-z0-9A-Z]) with + dashes (-), underscores (_), dots (.), and alphanumerics + between. The prefix is optional. If specified, the prefix + must be a DNS subdomain: a series of DNS labels separated + by dots (.), not longer than 253 characters in total, + followed by a slash (/). Metadata that fails to meet + these requirements are rejected + - The ``(*.)google.com/`` and ``(*.)googleapis.com/`` + prefixes are reserved for system metadata managed by + Service Directory. If the user tries to write to these + keyspaces, those entries are silently ignored by the + system + + Note: This field is equivalent to the ``annotations`` field + in the v1 API. They have the same syntax and read/write to + the same location in Service Directory. + network (str): + Immutable. The Google Compute Engine network (VPC) of the + endpoint in the format + ``projects//locations/global/networks/*``. + + The project must be specified by project number (project id + is rejected). Incorrectly formatted networks are rejected, + but no other validation is performed on this field (ex. + network or project existence, reachability, or permissions). + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the endpoint + was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the endpoint + was last updated. """ name = proto.Field(proto.STRING, number=1,) address = proto.Field(proto.STRING, number=2,) port = proto.Field(proto.INT32, number=3,) metadata = proto.MapField(proto.STRING, proto.STRING, number=4,) + network = proto.Field(proto.STRING, number=5,) + create_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/servicedirectory_v1beta1/types/lookup_service.py b/google/cloud/servicedirectory_v1beta1/types/lookup_service.py index 831f5481..f0e91ba9 100644 --- a/google/cloud/servicedirectory_v1beta1/types/lookup_service.py +++ b/google/cloud/servicedirectory_v1beta1/types/lookup_service.py @@ -43,20 +43,45 @@ class ResolveServiceRequest(proto.Message): Optional. The filter applied to the endpoints of the resolved service. - General filter string syntax: () can be "name" or - "metadata." for map field. can be "<, >, <=, >=, !=, =, :". - Of which ":" means HAS and is roughly the same as "=". must - be the same data type as the field. can be "AND, OR, NOT". + General ``filter`` string syntax: + `` ()`` + + - ```` can be ``name``, ``address``, ``port``, or + ``metadata.`` for map field + - ```` can be ``<``, ``>``, ``<=``, ``>=``, + ``!=``, ``=``, ``:``. Of which ``:`` means ``HAS``, and + is roughly the same as ``=`` + - ```` must be the same data type as field + - ```` can be ``AND``, ``OR``, ``NOT`` Examples of valid filters: - - "metadata.owner" returns Endpoints that have a label with - the key "owner", this is the same as "metadata:owner" - - "metadata.protocol=gRPC" returns Endpoints that have - key/value "protocol=gRPC" - - "metadata.owner!=sd AND metadata.foo=bar" returns - Endpoints that have "owner" field in metadata with a - value that is not "sd" AND have the key/value foo=bar. + - ``metadata.owner`` returns endpoints that have a + annotation with the key ``owner``, this is the same as + ``metadata:owner`` + - ``metadata.protocol=gRPC`` returns endpoints that have + key/value ``protocol=gRPC`` + - ``address=192.108.1.105`` returns endpoints that have + this address + - ``port>8080`` returns endpoints that have port number + larger than 8080 + - + + ``name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`` + returns endpoints that have name that is alphabetically + later than the string, so "endpoint-e" is returned but + "endpoint-a" is not + + - ``metadata.owner!=sd AND metadata.foo=bar`` returns + endpoints that have ``owner`` in annotation key but value + is not ``sd`` AND have key/value ``foo=bar`` + - ``doesnotexist.foo=bar`` returns an empty list. Note that + endpoint doesn't have a field called "doesnotexist". + Since the filter does not match any endpoint, it returns + no results + + For more information about filtering, see `API + Filtering `__. """ name = proto.Field(proto.STRING, number=1,) diff --git a/google/cloud/servicedirectory_v1beta1/types/namespace.py b/google/cloud/servicedirectory_v1beta1/types/namespace.py index cbf44eeb..4787938c 100644 --- a/google/cloud/servicedirectory_v1beta1/types/namespace.py +++ b/google/cloud/servicedirectory_v1beta1/types/namespace.py @@ -15,6 +15,8 @@ # import proto # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + __protobuf__ = proto.module( package="google.cloud.servicedirectory.v1beta1", manifest={"Namespace",}, @@ -30,16 +32,24 @@ class Namespace(proto.Message): Attributes: name (str): Immutable. The resource name for the namespace in the format - ``projects/*/locations/*/namespaces/*`` + ``projects/*/locations/*/namespaces/*``. labels (Sequence[google.cloud.servicedirectory_v1beta1.types.Namespace.LabelsEntry]): Optional. Resource labels associated with - this Namespace. No more than 64 user labels can - be associated with a given resource. Label keys + this namespace. No more than 64 user labels can + be associated with a given resource. Label keys and values can be no longer than 63 characters. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the namespace + was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the namespace + was last updated. """ name = proto.Field(proto.STRING, number=1,) labels = proto.MapField(proto.STRING, proto.STRING, number=2,) + create_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/servicedirectory_v1beta1/types/registration_service.py b/google/cloud/servicedirectory_v1beta1/types/registration_service.py index e0f2986d..127250ae 100644 --- a/google/cloud/servicedirectory_v1beta1/types/registration_service.py +++ b/google/cloud/servicedirectory_v1beta1/types/registration_service.py @@ -79,7 +79,8 @@ class ListNamespacesRequest(proto.Message): Attributes: parent (str): Required. The resource name of the project - and location whose namespaces we'd like to list. + and location whose namespaces you'd like to + list. page_size (int): Optional. The maximum number of items to return. @@ -87,38 +88,52 @@ class ListNamespacesRequest(proto.Message): Optional. The next_page_token value returned from a previous List request, if any. filter (str): - Optional. The filter to list result by. + Optional. The filter to list results by. + + General ``filter`` string syntax: + `` ()`` - General filter string syntax: () can be "name", or "labels." - for map field. can be "<, >, <=, >=, !=, =, :". Of which ":" - means HAS, and is roughly the same as "=". must be the same - data type as field. can be "AND, OR, NOT". + - ```` can be ``name`` or ``labels.`` for map + field + - ```` can be ``<``, ``>``, ``<=``, ``>=``, + ``!=``, ``=``, ``:``. Of which ``:`` means ``HAS``, and + is roughly the same as ``=`` + - ```` must be the same data type as field + - ```` can be ``AND``, ``OR``, ``NOT`` Examples of valid filters: - - "labels.owner" returns Namespaces that have a label with - the key "owner" this is the same as "labels:owner". - - "labels.protocol=gRPC" returns Namespaces that have - key/value "protocol=gRPC". - - "name>projects/my-project/locations/us-east/namespaces/namespace-c" - returns Namespaces that have name that is alphabetically - later than the string, so "namespace-e" will be returned - but "namespace-a" will not be. - - "labels.owner!=sd AND labels.foo=bar" returns Namespaces - that have "owner" in label key but value is not "sd" AND - have key/value foo=bar. - - "doesnotexist.foo=bar" returns an empty list. Note that - Namespace doesn't have a field called "doesnotexist". - Since the filter does not match any Namespaces, it - returns no results. + - ``labels.owner`` returns namespaces that have a label + with the key ``owner``, this is the same as + ``labels:owner`` + - ``labels.owner=sd`` returns namespaces that have + key/value ``owner=sd`` + - ``name>projects/my-project/locations/us-east1/namespaces/namespace-c`` + returns namespaces that have name that is alphabetically + later than the string, so "namespace-e" is returned but + "namespace-a" is not + - ``labels.owner!=sd AND labels.foo=bar`` returns + namespaces that have ``owner`` in label key but value is + not ``sd`` AND have key/value ``foo=bar`` + - ``doesnotexist.foo=bar`` returns an empty list. Note that + namespace doesn't have a field called "doesnotexist". + Since the filter does not match any namespaces, it + returns no results + + For more information about filtering, see `API + Filtering `__. order_by (str): - Optional. The order to list result by. + Optional. The order to list results by. + + General ``order_by`` string syntax: + `` () (,)`` - General order by string syntax: () (,) allows - values {"name"} ascending or descending order by - . If this is left blank, "asc" is used. Note that an empty - order_by string result in default order, which is order by - name in ascending order. + - ```` allows value: ``name`` + - ```` ascending or descending order by + ````. If this is left blank, ``asc`` is used + + Note that an empty ``order_by`` string results in default + order, which is order by ``name`` in ascending order. """ parent = proto.Field(proto.STRING, number=1,) @@ -227,7 +242,7 @@ class ListServicesRequest(proto.Message): Attributes: parent (str): Required. The resource name of the namespace - whose services we'd like to list. + whose services you'd like to list. page_size (int): Optional. The maximum number of items to return. @@ -235,32 +250,55 @@ class ListServicesRequest(proto.Message): Optional. The next_page_token value returned from a previous List request, if any. filter (str): - Optional. The filter to list result by. + Optional. The filter to list results by. + + General ``filter`` string syntax: + `` ()`` - General filter string syntax: () can be "name", or - "metadata." for map field. can be "<, >, <=, >=, !=, =, :". - Of which ":" means HAS, and is roughly the same as "=". must - be the same data type as field. can be "AND, OR, NOT". + - ```` can be ``name`` or ``metadata.`` for map + field + - ```` can be ``<``, ``>``, ``<=``, ``>=``, + ``!=``, ``=``, ``:``. Of which ``:`` means ``HAS``, and + is roughly the same as ``=`` + - ```` must be the same data type as field + - ```` can be ``AND``, ``OR``, ``NOT`` Examples of valid filters: - - "metadata.owner" returns Services that have a label with - the key "owner" this is the same as "metadata:owner". - - "metadata.protocol=gRPC" returns Services that have - key/value "protocol=gRPC". - - "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" - returns Services that have name that is alphabetically - later than the string, so "service-e" will be returned - but "service-a" will not be. - - "metadata.owner!=sd AND metadata.foo=bar" returns - Services that have "owner" in label key but value is not - "sd" AND have key/value foo=bar. - - "doesnotexist.foo=bar" returns an empty list. Note that - Service doesn't have a field called "doesnotexist". Since - the filter does not match any Services, it returns no - results. + - ``metadata.owner`` returns services that have a metadata + with the key ``owner``, this is the same as + ``metadata:owner`` + - ``metadata.protocol=gRPC`` returns services that have + key/value ``protocol=gRPC`` + - + + ``name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/service-c`` + returns services that have name that is alphabetically later + than the string, so "service-e" is returned but "service-a" + is not + + - ``metadata.owner!=sd AND metadata.foo=bar`` returns + services that have ``owner`` in metadata key but value is + not ``sd`` AND have key/value ``foo=bar`` + - ``doesnotexist.foo=bar`` returns an empty list. Note that + service doesn't have a field called "doesnotexist". Since + the filter does not match any services, it returns no + results + + For more information about filtering, see `API + Filtering `__. order_by (str): - Optional. The order to list result by. + Optional. The order to list results by. + + General ``order_by`` string syntax: + `` () (,)`` + + - ```` allows value: ``name`` + - ```` ascending or descending order by + ````. If this is left blank, ``asc`` is used + + Note that an empty ``order_by`` string results in default + order, which is order by ``name`` in ascending order. """ parent = proto.Field(proto.STRING, number=1,) @@ -297,7 +335,7 @@ class GetServiceRequest(proto.Message): r"""The request message for [RegistrationService.GetService][google.cloud.servicedirectory.v1beta1.RegistrationService.GetService]. This should not be used for looking up a service. Insead, use the - ``resolve`` method as it will contain all endpoints and associated + ``resolve`` method as it contains all endpoints and associated metadata. Attributes: @@ -370,7 +408,7 @@ class ListEndpointsRequest(proto.Message): Attributes: parent (str): Required. The resource name of the service - whose endpoints we'd like to list. + whose endpoints you'd like to list. page_size (int): Optional. The maximum number of items to return. @@ -378,37 +416,60 @@ class ListEndpointsRequest(proto.Message): Optional. The next_page_token value returned from a previous List request, if any. filter (str): - Optional. The filter to list result by. + Optional. The filter to list results by. + + General ``filter`` string syntax: + `` ()`` - General filter string syntax: () can be "name", "address", - "port" or "metadata." for map field. can be "<, >, <=, >=, - !=, =, :". Of which ":" means HAS, and is roughly the same - as "=". must be the same data type as field. can be "AND, - OR, NOT". + - ```` can be ``name``, ``address``, ``port``, or + ``metadata.`` for map field + - ```` can be ``<``, ``>``, ``<=``, ``>=``, + ``!=``, ``=``, ``:``. Of which ``:`` means ``HAS``, and + is roughly the same as ``=`` + - ```` must be the same data type as field + - ```` can be ``AND``, ``OR``, ``NOT`` Examples of valid filters: - - "metadata.owner" returns Endpoints that have a label with - the key "owner" this is the same as "metadata:owner". - - "metadata.protocol=gRPC" returns Endpoints that have - key/value "protocol=gRPC". - - "address=192.108.1.105" returns Endpoints that have this - address. - - "port>8080" returns Endpoints that have port number - larger than 8080. - - "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" - returns Endpoints that have name that is alphabetically - later than the string, so "endpoint-e" will be returned - but "endpoint-a" will not be. - - "metadata.owner!=sd AND metadata.foo=bar" returns - Endpoints that have "owner" in label key but value is not - "sd" AND have key/value foo=bar. - - "doesnotexist.foo=bar" returns an empty list. Note that - Endpoint doesn't have a field called "doesnotexist". - Since the filter does not match any Endpoints, it returns - no results. + - ``metadata.owner`` returns endpoints that have a metadata + with the key ``owner``, this is the same as + ``metadata:owner`` + - ``metadata.protocol=gRPC`` returns endpoints that have + key/value ``protocol=gRPC`` + - ``address=192.108.1.105`` returns endpoints that have + this address + - ``port>8080`` returns endpoints that have port number + larger than 8080 + - + + ``name>projects/my-project/locations/us-east1/namespaces/my-namespace/services/my-service/endpoints/endpoint-c`` + returns endpoints that have name that is alphabetically + later than the string, so "endpoint-e" is returned but + "endpoint-a" is not + + - ``metadata.owner!=sd AND metadata.foo=bar`` returns + endpoints that have ``owner`` in metadata key but value + is not ``sd`` AND have key/value ``foo=bar`` + - ``doesnotexist.foo=bar`` returns an empty list. Note that + endpoint doesn't have a field called "doesnotexist". + Since the filter does not match any endpoints, it returns + no results + + For more information about filtering, see `API + Filtering `__. order_by (str): - Optional. The order to list result by. + Optional. The order to list results by. + + General ``order_by`` string syntax: + `` () (,)`` + + - ```` allows values: ``name``, ``address``, + ``port`` + - ```` ascending or descending order by + ````. If this is left blank, ``asc`` is used + + Note that an empty ``order_by`` string results in default + order, which is order by ``name`` in ascending order. """ parent = proto.Field(proto.STRING, number=1,) diff --git a/google/cloud/servicedirectory_v1beta1/types/service.py b/google/cloud/servicedirectory_v1beta1/types/service.py index 9012e57c..d2431a20 100644 --- a/google/cloud/servicedirectory_v1beta1/types/service.py +++ b/google/cloud/servicedirectory_v1beta1/types/service.py @@ -16,6 +16,7 @@ import proto # type: ignore from google.cloud.servicedirectory_v1beta1.types import endpoint +from google.protobuf import timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -32,24 +33,57 @@ class Service(proto.Message): Attributes: name (str): Immutable. The resource name for the service in the format - ``projects/*/locations/*/namespaces/*/services/*`` + ``projects/*/locations/*/namespaces/*/services/*``. metadata (Sequence[google.cloud.servicedirectory_v1beta1.types.Service.MetadataEntry]): - Optional. Metadata for the service. This data - can be consumed by service clients. The entire - metadata dictionary may contain up to 2000 - characters, spread across all key-value pairs. - Metadata that goes beyond any these limits will - be rejected. + Optional. Metadata for the service. This data can be + consumed by service clients. + + Restrictions: + + - The entire metadata dictionary may contain up to 2000 + characters, spread accoss all key-value pairs. Metadata + that goes beyond this limit are rejected + - Valid metadata keys have two segments: an optional prefix + and name, separated by a slash (/). The name segment is + required and must be 63 characters or less, beginning and + ending with an alphanumeric character ([a-z0-9A-Z]) with + dashes (-), underscores (_), dots (.), and alphanumerics + between. The prefix is optional. If specified, the prefix + must be a DNS subdomain: a series of DNS labels separated + by dots (.), not longer than 253 characters in total, + followed by a slash (/). Metadata that fails to meet + these requirements are rejected + - The ``(*.)google.com/`` and ``(*.)googleapis.com/`` + prefixes are reserved for system metadata managed by + Service Directory. If the user tries to write to these + keyspaces, those entries are silently ignored by the + system + + Note: This field is equivalent to the ``annotations`` field + in the v1 API. They have the same syntax and read/write to + the same location in Service Directory. endpoints (Sequence[google.cloud.servicedirectory_v1beta1.types.Endpoint]): - Output only. Endpoints associated with this - service. Returned on LookupService.Resolve. + Output only. Endpoints associated with this service. + Returned on + [LookupService.ResolveService][google.cloud.servicedirectory.v1beta1.LookupService.ResolveService]. Control plane clients should use - RegistrationService.ListEndpoints. + [RegistrationService.ListEndpoints][google.cloud.servicedirectory.v1beta1.RegistrationService.ListEndpoints]. + create_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the service + was created. + update_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The timestamp when the service + was last updated. Note: endpoints being + created/deleted/updated within the service are + not considered service updates for the purpose + of this timestamp. """ name = proto.Field(proto.STRING, number=1,) metadata = proto.MapField(proto.STRING, proto.STRING, number=2,) endpoints = proto.RepeatedField(proto.MESSAGE, number=3, message=endpoint.Endpoint,) + create_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/tests/unit/gapic/servicedirectory_v1beta1/test_lookup_service.py b/tests/unit/gapic/servicedirectory_v1beta1/test_lookup_service.py index 6abf801b..106a36ad 100644 --- a/tests/unit/gapic/servicedirectory_v1beta1/test_lookup_service.py +++ b/tests/unit/gapic/servicedirectory_v1beta1/test_lookup_service.py @@ -1083,11 +1083,33 @@ def test_parse_endpoint_path(): assert expected == actual -def test_service_path(): +def test_network_path(): project = "scallop" - location = "abalone" - namespace = "squid" - service = "clam" + network = "abalone" + expected = "projects/{project}/locations/global/networks/{network}".format( + project=project, network=network, + ) + actual = LookupServiceClient.network_path(project, network) + assert expected == actual + + +def test_parse_network_path(): + expected = { + "project": "squid", + "network": "clam", + } + path = LookupServiceClient.network_path(**expected) + + # Check that the path construction is reversible. + actual = LookupServiceClient.parse_network_path(path) + assert expected == actual + + +def test_service_path(): + project = "whelk" + location = "octopus" + namespace = "oyster" + service = "nudibranch" expected = "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}".format( project=project, location=location, namespace=namespace, service=service, ) @@ -1097,10 +1119,10 @@ def test_service_path(): def test_parse_service_path(): expected = { - "project": "whelk", - "location": "octopus", - "namespace": "oyster", - "service": "nudibranch", + "project": "cuttlefish", + "location": "mussel", + "namespace": "winkle", + "service": "nautilus", } path = LookupServiceClient.service_path(**expected) @@ -1110,7 +1132,7 @@ def test_parse_service_path(): def test_common_billing_account_path(): - billing_account = "cuttlefish" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -1120,7 +1142,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "mussel", + "billing_account": "abalone", } path = LookupServiceClient.common_billing_account_path(**expected) @@ -1130,7 +1152,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "winkle" + folder = "squid" expected = "folders/{folder}".format(folder=folder,) actual = LookupServiceClient.common_folder_path(folder) assert expected == actual @@ -1138,7 +1160,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nautilus", + "folder": "clam", } path = LookupServiceClient.common_folder_path(**expected) @@ -1148,7 +1170,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "scallop" + organization = "whelk" expected = "organizations/{organization}".format(organization=organization,) actual = LookupServiceClient.common_organization_path(organization) assert expected == actual @@ -1156,7 +1178,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "abalone", + "organization": "octopus", } path = LookupServiceClient.common_organization_path(**expected) @@ -1166,7 +1188,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "squid" + project = "oyster" expected = "projects/{project}".format(project=project,) actual = LookupServiceClient.common_project_path(project) assert expected == actual @@ -1174,7 +1196,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "clam", + "project": "nudibranch", } path = LookupServiceClient.common_project_path(**expected) @@ -1184,8 +1206,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "whelk" - location = "octopus" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -1195,8 +1217,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "oyster", - "location": "nudibranch", + "project": "winkle", + "location": "nautilus", } path = LookupServiceClient.common_location_path(**expected) diff --git a/tests/unit/gapic/servicedirectory_v1beta1/test_registration_service.py b/tests/unit/gapic/servicedirectory_v1beta1/test_registration_service.py index d0a6569a..8281e7d2 100644 --- a/tests/unit/gapic/servicedirectory_v1beta1/test_registration_service.py +++ b/tests/unit/gapic/servicedirectory_v1beta1/test_registration_service.py @@ -56,6 +56,7 @@ from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore from google.type import expr_pb2 # type: ignore import google.auth @@ -2943,7 +2944,10 @@ def test_create_endpoint( with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gcs_endpoint.Endpoint( - name="name_value", address="address_value", port=453, + name="name_value", + address="address_value", + port=453, + network="network_value", ) response = client.create_endpoint(request) @@ -2957,6 +2961,7 @@ def test_create_endpoint( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" def test_create_endpoint_from_dict(): @@ -2995,7 +3000,12 @@ async def test_create_endpoint_async( with mock.patch.object(type(client.transport.create_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gcs_endpoint.Endpoint(name="name_value", address="address_value", port=453,) + gcs_endpoint.Endpoint( + name="name_value", + address="address_value", + port=453, + network="network_value", + ) ) response = await client.create_endpoint(request) @@ -3009,6 +3019,7 @@ async def test_create_endpoint_async( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" @pytest.mark.asyncio @@ -3539,7 +3550,10 @@ def test_get_endpoint( with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = endpoint.Endpoint( - name="name_value", address="address_value", port=453, + name="name_value", + address="address_value", + port=453, + network="network_value", ) response = client.get_endpoint(request) @@ -3553,6 +3567,7 @@ def test_get_endpoint( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" def test_get_endpoint_from_dict(): @@ -3591,7 +3606,12 @@ async def test_get_endpoint_async( with mock.patch.object(type(client.transport.get_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - endpoint.Endpoint(name="name_value", address="address_value", port=453,) + endpoint.Endpoint( + name="name_value", + address="address_value", + port=453, + network="network_value", + ) ) response = await client.get_endpoint(request) @@ -3605,6 +3625,7 @@ async def test_get_endpoint_async( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" @pytest.mark.asyncio @@ -3750,7 +3771,10 @@ def test_update_endpoint( with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gcs_endpoint.Endpoint( - name="name_value", address="address_value", port=453, + name="name_value", + address="address_value", + port=453, + network="network_value", ) response = client.update_endpoint(request) @@ -3764,6 +3788,7 @@ def test_update_endpoint( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" def test_update_endpoint_from_dict(): @@ -3802,7 +3827,12 @@ async def test_update_endpoint_async( with mock.patch.object(type(client.transport.update_endpoint), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gcs_endpoint.Endpoint(name="name_value", address="address_value", port=453,) + gcs_endpoint.Endpoint( + name="name_value", + address="address_value", + port=453, + network="network_value", + ) ) response = await client.update_endpoint(request) @@ -3816,6 +3846,7 @@ async def test_update_endpoint_async( assert response.name == "name_value" assert response.address == "address_value" assert response.port == 453 + assert response.network == "network_value" @pytest.mark.asyncio @@ -5168,11 +5199,33 @@ def test_parse_namespace_path(): assert expected == actual -def test_service_path(): +def test_network_path(): project = "oyster" - location = "nudibranch" - namespace = "cuttlefish" - service = "mussel" + network = "nudibranch" + expected = "projects/{project}/locations/global/networks/{network}".format( + project=project, network=network, + ) + actual = RegistrationServiceClient.network_path(project, network) + assert expected == actual + + +def test_parse_network_path(): + expected = { + "project": "cuttlefish", + "network": "mussel", + } + path = RegistrationServiceClient.network_path(**expected) + + # Check that the path construction is reversible. + actual = RegistrationServiceClient.parse_network_path(path) + assert expected == actual + + +def test_service_path(): + project = "winkle" + location = "nautilus" + namespace = "scallop" + service = "abalone" expected = "projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}".format( project=project, location=location, namespace=namespace, service=service, ) @@ -5184,10 +5237,10 @@ def test_service_path(): def test_parse_service_path(): expected = { - "project": "winkle", - "location": "nautilus", - "namespace": "scallop", - "service": "abalone", + "project": "squid", + "location": "clam", + "namespace": "whelk", + "service": "octopus", } path = RegistrationServiceClient.service_path(**expected) @@ -5197,7 +5250,7 @@ def test_parse_service_path(): def test_common_billing_account_path(): - billing_account = "squid" + billing_account = "oyster" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -5207,7 +5260,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "clam", + "billing_account": "nudibranch", } path = RegistrationServiceClient.common_billing_account_path(**expected) @@ -5217,7 +5270,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "whelk" + folder = "cuttlefish" expected = "folders/{folder}".format(folder=folder,) actual = RegistrationServiceClient.common_folder_path(folder) assert expected == actual @@ -5225,7 +5278,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "octopus", + "folder": "mussel", } path = RegistrationServiceClient.common_folder_path(**expected) @@ -5235,7 +5288,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "oyster" + organization = "winkle" expected = "organizations/{organization}".format(organization=organization,) actual = RegistrationServiceClient.common_organization_path(organization) assert expected == actual @@ -5243,7 +5296,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nudibranch", + "organization": "nautilus", } path = RegistrationServiceClient.common_organization_path(**expected) @@ -5253,7 +5306,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "cuttlefish" + project = "scallop" expected = "projects/{project}".format(project=project,) actual = RegistrationServiceClient.common_project_path(project) assert expected == actual @@ -5261,7 +5314,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "mussel", + "project": "abalone", } path = RegistrationServiceClient.common_project_path(**expected) @@ -5271,8 +5324,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "winkle" - location = "nautilus" + project = "squid" + location = "clam" expected = "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -5282,8 +5335,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "scallop", - "location": "abalone", + "project": "whelk", + "location": "octopus", } path = RegistrationServiceClient.common_location_path(**expected)