@Generated(value="by gapic-generator-java") public class RegistrationServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
- The API has a collection of [Namespace][google.cloud.servicedirectory.v1.Namespace] resources, named `projects/*/locations/*/namespaces/*`.
- Each Namespace has a collection of [Service][google.cloud.servicedirectory.v1.Service] resources, named `projects/*/locations/*/namespaces/*/services/*`.
- Each Service has a collection of [Endpoint][google.cloud.servicedirectory.v1.Endpoint] resources, named `projects/*/locations/*/namespaces/*/services/*/endpoints/*`.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Namespace namespace = Namespace.newBuilder().build();
String namespaceId = "namespaceId790852566";
Namespace response =
registrationServiceClient.createNamespace(parent, namespace, namespaceId);
}
Note: close() needs to be called on the RegistrationServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateNamespace |
Creates a namespace, and returns the new namespace. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListNamespaces |
Lists all namespaces. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetNamespace |
Gets a namespace. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateNamespace |
Updates a namespace. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteNamespace |
Deletes a namespace. This also deletes all services and endpoints in the namespace. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateService |
Creates a service, and returns the new service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListServices |
Lists all services belonging to a namespace. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetService |
Gets a service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateService |
Updates a service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteService |
Deletes a service. This also deletes all endpoints associated with the service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateEndpoint |
Creates an endpoint, and returns the new endpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListEndpoints |
Lists all endpoints. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetEndpoint |
Gets an endpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateEndpoint |
Updates an endpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteEndpoint |
Deletes an endpoint. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the IAM Policy for a resource (namespace or service only). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the IAM Policy for a resource (namespace or service only). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Tests IAM permissions for a resource (namespace or service only). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of RegistrationServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RegistrationServiceSettings registrationServiceSettings =
RegistrationServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RegistrationServiceClient registrationServiceClient =
RegistrationServiceClient.create(registrationServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RegistrationServiceSettings registrationServiceSettings =
RegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RegistrationServiceClient registrationServiceClient =
RegistrationServiceClient.create(registrationServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RegistrationServiceSettings registrationServiceSettings =
RegistrationServiceSettings.newHttpJsonBuilder().build();
RegistrationServiceClient registrationServiceClient =
RegistrationServiceClient.create(registrationServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
RegistrationServiceClient.ListEndpointsFixedSizeCollection |
static class |
RegistrationServiceClient.ListEndpointsPage |
static class |
RegistrationServiceClient.ListEndpointsPagedResponse |
static class |
RegistrationServiceClient.ListLocationsFixedSizeCollection |
static class |
RegistrationServiceClient.ListLocationsPage |
static class |
RegistrationServiceClient.ListLocationsPagedResponse |
static class |
RegistrationServiceClient.ListNamespacesFixedSizeCollection |
static class |
RegistrationServiceClient.ListNamespacesPage |
static class |
RegistrationServiceClient.ListNamespacesPagedResponse |
static class |
RegistrationServiceClient.ListServicesFixedSizeCollection |
static class |
RegistrationServiceClient.ListServicesPage |
static class |
RegistrationServiceClient.ListServicesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
RegistrationServiceClient(RegistrationServiceSettings settings)
Constructs an instance of RegistrationServiceClient, using the given settings.
|
protected |
RegistrationServiceClient(RegistrationServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RegistrationServiceClient |
create()
Constructs an instance of RegistrationServiceClient with default settings.
|
static RegistrationServiceClient |
create(RegistrationServiceSettings settings)
Constructs an instance of RegistrationServiceClient, using the given settings.
|
static RegistrationServiceClient |
create(RegistrationServiceStub stub)
Constructs an instance of RegistrationServiceClient, using the given stub for making calls.
|
Endpoint |
createEndpoint(CreateEndpointRequest request)
Creates an endpoint, and returns the new endpoint.
|
Endpoint |
createEndpoint(ServiceName parent,
Endpoint endpoint,
String endpointId)
Creates an endpoint, and returns the new endpoint.
|
Endpoint |
createEndpoint(String parent,
Endpoint endpoint,
String endpointId)
Creates an endpoint, and returns the new endpoint.
|
com.google.api.gax.rpc.UnaryCallable<CreateEndpointRequest,Endpoint> |
createEndpointCallable()
Creates an endpoint, and returns the new endpoint.
|
Namespace |
createNamespace(CreateNamespaceRequest request)
Creates a namespace, and returns the new namespace.
|
Namespace |
createNamespace(LocationName parent,
Namespace namespace,
String namespaceId)
Creates a namespace, and returns the new namespace.
|
Namespace |
createNamespace(String parent,
Namespace namespace,
String namespaceId)
Creates a namespace, and returns the new namespace.
|
com.google.api.gax.rpc.UnaryCallable<CreateNamespaceRequest,Namespace> |
createNamespaceCallable()
Creates a namespace, and returns the new namespace.
|
Service |
createService(CreateServiceRequest request)
Creates a service, and returns the new service.
|
Service |
createService(NamespaceName parent,
Service service,
String serviceId)
Creates a service, and returns the new service.
|
Service |
createService(String parent,
Service service,
String serviceId)
Creates a service, and returns the new service.
|
com.google.api.gax.rpc.UnaryCallable<CreateServiceRequest,Service> |
createServiceCallable()
Creates a service, and returns the new service.
|
void |
deleteEndpoint(DeleteEndpointRequest request)
Deletes an endpoint.
|
void |
deleteEndpoint(EndpointName name)
Deletes an endpoint.
|
void |
deleteEndpoint(String name)
Deletes an endpoint.
|
com.google.api.gax.rpc.UnaryCallable<DeleteEndpointRequest,com.google.protobuf.Empty> |
deleteEndpointCallable()
Deletes an endpoint.
|
void |
deleteNamespace(DeleteNamespaceRequest request)
Deletes a namespace.
|
void |
deleteNamespace(NamespaceName name)
Deletes a namespace.
|
void |
deleteNamespace(String name)
Deletes a namespace.
|
com.google.api.gax.rpc.UnaryCallable<DeleteNamespaceRequest,com.google.protobuf.Empty> |
deleteNamespaceCallable()
Deletes a namespace.
|
void |
deleteService(DeleteServiceRequest request)
Deletes a service.
|
void |
deleteService(ServiceName name)
Deletes a service.
|
void |
deleteService(String name)
Deletes a service.
|
com.google.api.gax.rpc.UnaryCallable<DeleteServiceRequest,com.google.protobuf.Empty> |
deleteServiceCallable()
Deletes a service.
|
Endpoint |
getEndpoint(EndpointName name)
Gets an endpoint.
|
Endpoint |
getEndpoint(GetEndpointRequest request)
Gets an endpoint.
|
Endpoint |
getEndpoint(String name)
Gets an endpoint.
|
com.google.api.gax.rpc.UnaryCallable<GetEndpointRequest,Endpoint> |
getEndpointCallable()
Gets an endpoint.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the IAM Policy for a resource (namespace or service only).
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the IAM Policy for a resource (namespace or service only).
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
Namespace |
getNamespace(GetNamespaceRequest request)
Gets a namespace.
|
Namespace |
getNamespace(NamespaceName name)
Gets a namespace.
|
Namespace |
getNamespace(String name)
Gets a namespace.
|
com.google.api.gax.rpc.UnaryCallable<GetNamespaceRequest,Namespace> |
getNamespaceCallable()
Gets a namespace.
|
Service |
getService(GetServiceRequest request)
Gets a service.
|
Service |
getService(ServiceName name)
Gets a service.
|
Service |
getService(String name)
Gets a service.
|
com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> |
getServiceCallable()
Gets a service.
|
RegistrationServiceSettings |
getSettings() |
RegistrationServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
RegistrationServiceClient.ListEndpointsPagedResponse |
listEndpoints(ListEndpointsRequest request)
Lists all endpoints.
|
RegistrationServiceClient.ListEndpointsPagedResponse |
listEndpoints(ServiceName parent)
Lists all endpoints.
|
RegistrationServiceClient.ListEndpointsPagedResponse |
listEndpoints(String parent)
Lists all endpoints.
|
com.google.api.gax.rpc.UnaryCallable<ListEndpointsRequest,ListEndpointsResponse> |
listEndpointsCallable()
Lists all endpoints.
|
com.google.api.gax.rpc.UnaryCallable<ListEndpointsRequest,RegistrationServiceClient.ListEndpointsPagedResponse> |
listEndpointsPagedCallable()
Lists all endpoints.
|
RegistrationServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,RegistrationServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
RegistrationServiceClient.ListNamespacesPagedResponse |
listNamespaces(ListNamespacesRequest request)
Lists all namespaces.
|
RegistrationServiceClient.ListNamespacesPagedResponse |
listNamespaces(LocationName parent)
Lists all namespaces.
|
RegistrationServiceClient.ListNamespacesPagedResponse |
listNamespaces(String parent)
Lists all namespaces.
|
com.google.api.gax.rpc.UnaryCallable<ListNamespacesRequest,ListNamespacesResponse> |
listNamespacesCallable()
Lists all namespaces.
|
com.google.api.gax.rpc.UnaryCallable<ListNamespacesRequest,RegistrationServiceClient.ListNamespacesPagedResponse> |
listNamespacesPagedCallable()
Lists all namespaces.
|
RegistrationServiceClient.ListServicesPagedResponse |
listServices(ListServicesRequest request)
Lists all services belonging to a namespace.
|
RegistrationServiceClient.ListServicesPagedResponse |
listServices(NamespaceName parent)
Lists all services belonging to a namespace.
|
RegistrationServiceClient.ListServicesPagedResponse |
listServices(String parent)
Lists all services belonging to a namespace.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> |
listServicesCallable()
Lists all services belonging to a namespace.
|
com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,RegistrationServiceClient.ListServicesPagedResponse> |
listServicesPagedCallable()
Lists all services belonging to a namespace.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the IAM Policy for a resource (namespace or service only).
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the IAM Policy for a resource (namespace or service only).
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Tests IAM permissions for a resource (namespace or service only).
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Tests IAM permissions for a resource (namespace or service only).
|
Endpoint |
updateEndpoint(Endpoint endpoint,
com.google.protobuf.FieldMask updateMask)
Updates an endpoint.
|
Endpoint |
updateEndpoint(UpdateEndpointRequest request)
Updates an endpoint.
|
com.google.api.gax.rpc.UnaryCallable<UpdateEndpointRequest,Endpoint> |
updateEndpointCallable()
Updates an endpoint.
|
Namespace |
updateNamespace(Namespace namespace,
com.google.protobuf.FieldMask updateMask)
Updates a namespace.
|
Namespace |
updateNamespace(UpdateNamespaceRequest request)
Updates a namespace.
|
com.google.api.gax.rpc.UnaryCallable<UpdateNamespaceRequest,Namespace> |
updateNamespaceCallable()
Updates a namespace.
|
Service |
updateService(Service service,
com.google.protobuf.FieldMask updateMask)
Updates a service.
|
Service |
updateService(UpdateServiceRequest request)
Updates a service.
|
com.google.api.gax.rpc.UnaryCallable<UpdateServiceRequest,Service> |
updateServiceCallable()
Updates a service.
|
protected RegistrationServiceClient(RegistrationServiceSettings settings) throws IOException
IOExceptionprotected RegistrationServiceClient(RegistrationServiceStub stub)
public static final RegistrationServiceClient create() throws IOException
IOExceptionpublic static final RegistrationServiceClient create(RegistrationServiceSettings settings) throws IOException
IOExceptionpublic static final RegistrationServiceClient create(RegistrationServiceStub stub)
public final RegistrationServiceSettings getSettings()
public RegistrationServiceStub getStub()
public final Namespace createNamespace(LocationName parent, Namespace namespace, String namespaceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Namespace namespace = Namespace.newBuilder().build();
String namespaceId = "namespaceId790852566";
Namespace response =
registrationServiceClient.createNamespace(parent, namespace, namespaceId);
}
parent - Required. The resource name of the project and location the namespace will be
created in.namespace - Required. A namespace with initial fields set.namespaceId - Required. The Resource ID must be 1-63 characters long, and comply with
<a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Namespace createNamespace(String parent, Namespace namespace, String namespaceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Namespace namespace = Namespace.newBuilder().build();
String namespaceId = "namespaceId790852566";
Namespace response =
registrationServiceClient.createNamespace(parent, namespace, namespaceId);
}
parent - Required. The resource name of the project and location the namespace will be
created in.namespace - Required. A namespace with initial fields set.namespaceId - Required. The Resource ID must be 1-63 characters long, and comply with
<a href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Namespace createNamespace(CreateNamespaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateNamespaceRequest request =
CreateNamespaceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setNamespaceId("namespaceId790852566")
.setNamespace(Namespace.newBuilder().build())
.build();
Namespace response = registrationServiceClient.createNamespace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateNamespaceRequest,Namespace> createNamespaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateNamespaceRequest request =
CreateNamespaceRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setNamespaceId("namespaceId790852566")
.setNamespace(Namespace.newBuilder().build())
.build();
ApiFuture<Namespace> future =
registrationServiceClient.createNamespaceCallable().futureCall(request);
// Do something.
Namespace response = future.get();
}
public final RegistrationServiceClient.ListNamespacesPagedResponse listNamespaces(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Namespace element : registrationServiceClient.listNamespaces(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the project and location whose namespaces you'd
like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListNamespacesPagedResponse listNamespaces(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Namespace element : registrationServiceClient.listNamespaces(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the project and location whose namespaces you'd
like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListNamespacesPagedResponse listNamespaces(ListNamespacesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListNamespacesRequest request =
ListNamespacesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Namespace element : registrationServiceClient.listNamespaces(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListNamespacesRequest,RegistrationServiceClient.ListNamespacesPagedResponse> listNamespacesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListNamespacesRequest request =
ListNamespacesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Namespace> future =
registrationServiceClient.listNamespacesPagedCallable().futureCall(request);
// Do something.
for (Namespace element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListNamespacesRequest,ListNamespacesResponse> listNamespacesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListNamespacesRequest request =
ListNamespacesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListNamespacesResponse response =
registrationServiceClient.listNamespacesCallable().call(request);
for (Namespace element : response.getNamespacesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Namespace getNamespace(NamespaceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
Namespace response = registrationServiceClient.getNamespace(name);
}
name - Required. The name of the namespace to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Namespace getNamespace(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
Namespace response = registrationServiceClient.getNamespace(name);
}
name - Required. The name of the namespace to retrieve.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Namespace getNamespace(GetNamespaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetNamespaceRequest request =
GetNamespaceRequest.newBuilder()
.setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.build();
Namespace response = registrationServiceClient.getNamespace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetNamespaceRequest,Namespace> getNamespaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetNamespaceRequest request =
GetNamespaceRequest.newBuilder()
.setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.build();
ApiFuture<Namespace> future =
registrationServiceClient.getNamespaceCallable().futureCall(request);
// Do something.
Namespace response = future.get();
}
public final Namespace updateNamespace(Namespace namespace, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
Namespace namespace = Namespace.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Namespace response = registrationServiceClient.updateNamespace(namespace, updateMask);
}
namespace - Required. The updated namespace.updateMask - Required. List of fields to be updated in this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Namespace updateNamespace(UpdateNamespaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateNamespaceRequest request =
UpdateNamespaceRequest.newBuilder()
.setNamespace(Namespace.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Namespace response = registrationServiceClient.updateNamespace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateNamespaceRequest,Namespace> updateNamespaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateNamespaceRequest request =
UpdateNamespaceRequest.newBuilder()
.setNamespace(Namespace.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Namespace> future =
registrationServiceClient.updateNamespaceCallable().futureCall(request);
// Do something.
Namespace response = future.get();
}
public final void deleteNamespace(NamespaceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
NamespaceName name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
registrationServiceClient.deleteNamespace(name);
}
name - Required. The name of the namespace to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteNamespace(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
registrationServiceClient.deleteNamespace(name);
}
name - Required. The name of the namespace to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteNamespace(DeleteNamespaceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteNamespaceRequest request =
DeleteNamespaceRequest.newBuilder()
.setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.build();
registrationServiceClient.deleteNamespace(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteNamespaceRequest,com.google.protobuf.Empty> deleteNamespaceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteNamespaceRequest request =
DeleteNamespaceRequest.newBuilder()
.setName(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.build();
ApiFuture<Empty> future =
registrationServiceClient.deleteNamespaceCallable().futureCall(request);
// Do something.
future.get();
}
public final Service createService(NamespaceName parent, Service service, String serviceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
Service service = Service.newBuilder().build();
String serviceId = "serviceId-194185552";
Service response = registrationServiceClient.createService(parent, service, serviceId);
}
parent - Required. The resource name of the namespace this service will belong to.service - Required. A service with initial fields set.serviceId - Required. The Resource ID must be 1-63 characters long, and comply with <a
href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service createService(String parent, Service service, String serviceId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
Service service = Service.newBuilder().build();
String serviceId = "serviceId-194185552";
Service response = registrationServiceClient.createService(parent, service, serviceId);
}
parent - Required. The resource name of the namespace this service will belong to.service - Required. A service with initial fields set.serviceId - Required. The Resource ID must be 1-63 characters long, and comply with <a
href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service createService(CreateServiceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setServiceId("serviceId-194185552")
.setService(Service.newBuilder().build())
.build();
Service response = registrationServiceClient.createService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateServiceRequest,Service> createServiceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateServiceRequest request =
CreateServiceRequest.newBuilder()
.setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setServiceId("serviceId-194185552")
.setService(Service.newBuilder().build())
.build();
ApiFuture<Service> future =
registrationServiceClient.createServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final RegistrationServiceClient.ListServicesPagedResponse listServices(NamespaceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
NamespaceName parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]");
for (Service element : registrationServiceClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the namespace whose services you'd like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListServicesPagedResponse listServices(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent = NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString();
for (Service element : registrationServiceClient.listServices(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the namespace whose services you'd like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListServicesPagedResponse listServices(ListServicesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Service element : registrationServiceClient.listServices(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,RegistrationServiceClient.ListServicesPagedResponse> listServicesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Service> future =
registrationServiceClient.listServicesPagedCallable().futureCall(request);
// Do something.
for (Service element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListServicesRequest,ListServicesResponse> listServicesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListServicesRequest request =
ListServicesRequest.newBuilder()
.setParent(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListServicesResponse response =
registrationServiceClient.listServicesCallable().call(request);
for (Service element : response.getServicesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Service getService(ServiceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
Service response = registrationServiceClient.getService(name);
}
name - Required. The name of the service to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service getService(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name =
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
Service response = registrationServiceClient.getService(name);
}
name - Required. The name of the service to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service getService(GetServiceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.build();
Service response = registrationServiceClient.getService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetServiceRequest,Service> getServiceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetServiceRequest request =
GetServiceRequest.newBuilder()
.setName(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.build();
ApiFuture<Service> future =
registrationServiceClient.getServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final Service updateService(Service service, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
Service service = Service.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Service response = registrationServiceClient.updateService(service, updateMask);
}
service - Required. The updated service.updateMask - Required. List of fields to be updated in this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Service updateService(UpdateServiceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateServiceRequest request =
UpdateServiceRequest.newBuilder()
.setService(Service.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Service response = registrationServiceClient.updateService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateServiceRequest,Service> updateServiceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateServiceRequest request =
UpdateServiceRequest.newBuilder()
.setService(Service.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Service> future =
registrationServiceClient.updateServiceCallable().futureCall(request);
// Do something.
Service response = future.get();
}
public final void deleteService(ServiceName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
registrationServiceClient.deleteService(name);
}
name - Required. The name of the service to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteService(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name =
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
registrationServiceClient.deleteService(name);
}
name - Required. The name of the service to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteService(DeleteServiceRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteServiceRequest request =
DeleteServiceRequest.newBuilder()
.setName(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.build();
registrationServiceClient.deleteService(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteServiceRequest,com.google.protobuf.Empty> deleteServiceCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteServiceRequest request =
DeleteServiceRequest.newBuilder()
.setName(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.build();
ApiFuture<Empty> future =
registrationServiceClient.deleteServiceCallable().futureCall(request);
// Do something.
future.get();
}
public final Endpoint createEndpoint(ServiceName parent, Endpoint endpoint, String endpointId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
Endpoint endpoint = Endpoint.newBuilder().build();
String endpointId = "endpointId-1837754992";
Endpoint response = registrationServiceClient.createEndpoint(parent, endpoint, endpointId);
}
parent - Required. The resource name of the service that this endpoint provides.endpoint - Required. A endpoint with initial fields set.endpointId - Required. The Resource ID must be 1-63 characters long, and comply with <a
href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Endpoint createEndpoint(String parent, Endpoint endpoint, String endpointId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent =
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
Endpoint endpoint = Endpoint.newBuilder().build();
String endpointId = "endpointId-1837754992";
Endpoint response = registrationServiceClient.createEndpoint(parent, endpoint, endpointId);
}
parent - Required. The resource name of the service that this endpoint provides.endpoint - Required. A endpoint with initial fields set.endpointId - Required. The Resource ID must be 1-63 characters long, and comply with <a
href="https://www.ietf.org/rfc/rfc1035.txt" target="_blank">RFC1035</a>.
Specifically, the name must be 1-63 characters long and match the regular expression
`[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?` which means the first character must be a lowercase
letter, and all following characters must be a dash, lowercase letter, or digit, except the
last character, which cannot be a dash.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Endpoint createEndpoint(CreateEndpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateEndpointRequest request =
CreateEndpointRequest.newBuilder()
.setParent(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.setEndpointId("endpointId-1837754992")
.setEndpoint(Endpoint.newBuilder().build())
.build();
Endpoint response = registrationServiceClient.createEndpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEndpointRequest,Endpoint> createEndpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
CreateEndpointRequest request =
CreateEndpointRequest.newBuilder()
.setParent(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.setEndpointId("endpointId-1837754992")
.setEndpoint(Endpoint.newBuilder().build())
.build();
ApiFuture<Endpoint> future =
registrationServiceClient.createEndpointCallable().futureCall(request);
// Do something.
Endpoint response = future.get();
}
public final RegistrationServiceClient.ListEndpointsPagedResponse listEndpoints(ServiceName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ServiceName parent = ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]");
for (Endpoint element : registrationServiceClient.listEndpoints(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the service whose endpoints you'd like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListEndpointsPagedResponse listEndpoints(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String parent =
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString();
for (Endpoint element : registrationServiceClient.listEndpoints(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the service whose endpoints you'd like to list.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RegistrationServiceClient.ListEndpointsPagedResponse listEndpoints(ListEndpointsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListEndpointsRequest request =
ListEndpointsRequest.newBuilder()
.setParent(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for (Endpoint element : registrationServiceClient.listEndpoints(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListEndpointsRequest,RegistrationServiceClient.ListEndpointsPagedResponse> listEndpointsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListEndpointsRequest request =
ListEndpointsRequest.newBuilder()
.setParent(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Endpoint> future =
registrationServiceClient.listEndpointsPagedCallable().futureCall(request);
// Do something.
for (Endpoint element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListEndpointsRequest,ListEndpointsResponse> listEndpointsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListEndpointsRequest request =
ListEndpointsRequest.newBuilder()
.setParent(
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListEndpointsResponse response =
registrationServiceClient.listEndpointsCallable().call(request);
for (Endpoint element : response.getEndpointsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Endpoint getEndpoint(EndpointName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
EndpointName name =
EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
Endpoint response = registrationServiceClient.getEndpoint(name);
}
name - Required. The name of the endpoint to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Endpoint getEndpoint(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name =
EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString();
Endpoint response = registrationServiceClient.getEndpoint(name);
}
name - Required. The name of the endpoint to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Endpoint getEndpoint(GetEndpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetEndpointRequest request =
GetEndpointRequest.newBuilder()
.setName(
EndpointName.of(
"[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString())
.build();
Endpoint response = registrationServiceClient.getEndpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEndpointRequest,Endpoint> getEndpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetEndpointRequest request =
GetEndpointRequest.newBuilder()
.setName(
EndpointName.of(
"[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString())
.build();
ApiFuture<Endpoint> future =
registrationServiceClient.getEndpointCallable().futureCall(request);
// Do something.
Endpoint response = future.get();
}
public final Endpoint updateEndpoint(Endpoint endpoint, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
Endpoint endpoint = Endpoint.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Endpoint response = registrationServiceClient.updateEndpoint(endpoint, updateMask);
}
endpoint - Required. The updated endpoint.updateMask - Required. List of fields to be updated in this request.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Endpoint updateEndpoint(UpdateEndpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateEndpointRequest request =
UpdateEndpointRequest.newBuilder()
.setEndpoint(Endpoint.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Endpoint response = registrationServiceClient.updateEndpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateEndpointRequest,Endpoint> updateEndpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
UpdateEndpointRequest request =
UpdateEndpointRequest.newBuilder()
.setEndpoint(Endpoint.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Endpoint> future =
registrationServiceClient.updateEndpointCallable().futureCall(request);
// Do something.
Endpoint response = future.get();
}
public final void deleteEndpoint(EndpointName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
EndpointName name =
EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]");
registrationServiceClient.deleteEndpoint(name);
}
name - Required. The name of the endpoint to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteEndpoint(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
String name =
EndpointName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString();
registrationServiceClient.deleteEndpoint(name);
}
name - Required. The name of the endpoint to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteEndpoint(DeleteEndpointRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteEndpointRequest request =
DeleteEndpointRequest.newBuilder()
.setName(
EndpointName.of(
"[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString())
.build();
registrationServiceClient.deleteEndpoint(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteEndpointRequest,com.google.protobuf.Empty> deleteEndpointCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
DeleteEndpointRequest request =
DeleteEndpointRequest.newBuilder()
.setName(
EndpointName.of(
"[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]", "[ENDPOINT]")
.toString())
.build();
ApiFuture<Empty> future =
registrationServiceClient.deleteEndpointCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = registrationServiceClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future =
registrationServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = registrationServiceClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future =
registrationServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = registrationServiceClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(NamespaceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
registrationServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final RegistrationServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : registrationServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,RegistrationServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
registrationServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
registrationServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = registrationServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RegistrationServiceClient registrationServiceClient = RegistrationServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
registrationServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.