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

feat: Update Service Directory v1beta1 protos to include VPC Network field, and create/modify timestamp fields. #88

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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.
Expand Up @@ -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(
Expand Down
Expand Up @@ -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<project>.+?)/locations/global/networks/(?P<network>.+?)$",
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."""
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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`):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`):
Expand Down Expand Up @@ -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`):
Expand Down Expand Up @@ -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`):
Expand Down
Expand Up @@ -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
Expand Down Expand Up @@ -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<project>.+?)/locations/global/networks/(?P<network>.+?)$",
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."""
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand All @@ -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],
Expand All @@ -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],
Expand Down
Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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],
Expand Down