Class AppHubClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (AppHubClient appHubClient = AppHubClient.create()) {
LocationName name = LocationName.of("[PROJECT]", "[LOCATION]");
LookupServiceProjectAttachmentResponse response =
appHubClient.lookupServiceProjectAttachment(name);
}
Note: close() needs to be called on the AppHubClient 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 |
|---|---|---|
LookupServiceProjectAttachment |
Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project. |
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.
|
ListServiceProjectAttachments |
Lists service projects attached to the host project. |
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.
|
CreateServiceProjectAttachment |
Attaches a service project to the host project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetServiceProjectAttachment |
Gets a service project attachment. |
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.
|
DeleteServiceProjectAttachment |
Deletes a service project attachment. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DetachServiceProjectAttachment |
Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to. |
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.
|
ListDiscoveredServices |
Lists Discovered Services that can be added to an Application in a host project and location. |
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.
|
GetDiscoveredService |
Gets a Discovered Service in a host project and location. |
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.
|
LookupDiscoveredService |
Lists a Discovered Service in a host project and location, with a given resource URI. |
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 Services in an Application. |
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 in an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
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 in an Application. |
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 in an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
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 from an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListDiscoveredWorkloads |
Lists Discovered Workloads that can be added to an Application in a host project and location. |
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.
|
GetDiscoveredWorkload |
Gets a Discovered Workload in a host project and location. |
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.
|
LookupDiscoveredWorkload |
Lists a Discovered Workload in a host project and location, with a given resource URI. |
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.
|
ListWorkloads |
Lists Workloads in an Application. |
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.
|
CreateWorkload |
Creates a Workload in an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetWorkload |
Gets a Workload in an Application. |
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.
|
UpdateWorkload |
Updates a Workload in an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteWorkload |
Deletes a Workload from an Application. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListApplications |
Lists Applications in a host project and location. |
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.
|
CreateApplication |
Creates an Application in a host project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetApplication |
Gets an Application in a host project and location. |
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.
|
UpdateApplication |
Updates an Application in a host project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteApplication |
Deletes an Application in a host project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
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.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
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.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
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 |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
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 AppHubSettings 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
AppHubSettings appHubSettings =
AppHubSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AppHubClient appHubClient = AppHubClient.create(appHubSettings);
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
AppHubSettings appHubSettings = AppHubSettings.newBuilder().setEndpoint(myEndpoint).build();
AppHubClient appHubClient = AppHubClient.create(appHubSettings);
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
AppHubSettings appHubSettings = AppHubSettings.newHttpJsonBuilder().build();
AppHubClient appHubClient = AppHubClient.create(appHubSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAppHubClient(AppHubSettings settings) Constructs an instance of AppHubClient, using the given settings.protectedAppHubClient(AppHubStub stub) -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final AppHubClientcreate()Constructs an instance of AppHubClient with default settings.static final AppHubClientcreate(AppHubSettings settings) Constructs an instance of AppHubClient, using the given settings.static final AppHubClientcreate(AppHubStub stub) Constructs an instance of AppHubClient, using the given stub for making calls.Creates an Application in a host project and location.createApplicationAsync(LocationName parent, Application application, String applicationId) Creates an Application in a host project and location.createApplicationAsync(String parent, Application application, String applicationId) Creates an Application in a host project and location.Creates an Application in a host project and location.Creates an Application in a host project and location.createServiceAsync(ApplicationName parent, Service service, String serviceId) Creates a Service in an Application.createServiceAsync(CreateServiceRequest request) Creates a Service in an Application.createServiceAsync(String parent, Service service, String serviceId) Creates a Service in an Application.Creates a Service in an Application.Creates a Service in an Application.Attaches a service project to the host project.createServiceProjectAttachmentAsync(LocationName parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId) Attaches a service project to the host project.createServiceProjectAttachmentAsync(String parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId) Attaches a service project to the host project.Attaches a service project to the host project.final OperationCallable<CreateServiceProjectAttachmentRequest,ServiceProjectAttachment, OperationMetadata> Attaches a service project to the host project.createWorkloadAsync(ApplicationName parent, Workload workload, String workloadId) Creates a Workload in an Application.createWorkloadAsync(CreateWorkloadRequest request) Creates a Workload in an Application.createWorkloadAsync(String parent, Workload workload, String workloadId) Creates a Workload in an Application.Creates a Workload in an Application.Creates a Workload in an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes an Application in a host project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes an Application in a host project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(String name) Deletes an Application in a host project and location.Deletes an Application in a host project and location.final OperationCallable<DeleteApplicationRequest,com.google.protobuf.Empty, OperationMetadata> Deletes an Application in a host project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(DeleteServiceRequest request) Deletes a Service from an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a Service from an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(String name) Deletes a Service from an Application.Deletes a Service from an Application.final OperationCallable<DeleteServiceRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a Service from an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a service project attachment.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a service project attachment.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a service project attachment.Deletes a service project attachment.final OperationCallable<DeleteServiceProjectAttachmentRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a service project attachment.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(DeleteWorkloadRequest request) Deletes a Workload from an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a Workload from an Application.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(String name) Deletes a Workload from an Application.Deletes a Workload from an Application.final OperationCallable<DeleteWorkloadRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a Workload from an Application.Detaches a service project from a host project.Detaches a service project from a host project.Detaches a service project from a host project.Detaches a service project from a host project.final ApplicationGets an Application in a host project and location.final ApplicationgetApplication(GetApplicationRequest request) Gets an Application in a host project and location.final ApplicationgetApplication(String name) Gets an Application in a host project and location.Gets an Application in a host project and location.final DiscoveredServiceGets a Discovered Service in a host project and location.final DiscoveredServiceGets a Discovered Service in a host project and location.final DiscoveredServicegetDiscoveredService(String name) Gets a Discovered Service in a host project and location.Gets a Discovered Service in a host project and location.final DiscoveredWorkloadGets a Discovered Workload in a host project and location.final DiscoveredWorkloadGets a Discovered Workload in a host project and location.final DiscoveredWorkloadgetDiscoveredWorkload(String name) Gets a Discovered Workload in a host project and location.Gets a Discovered Workload in a host project and location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final ServicegetService(GetServiceRequest request) Gets a Service in an Application.final ServicegetService(ServiceName name) Gets a Service in an Application.final ServicegetService(String name) Gets a Service in an Application.Gets a Service in an Application.final ServiceProjectAttachmentGets a service project attachment.final ServiceProjectAttachmentGets a service project attachment.final ServiceProjectAttachmentGets a service project attachment.Gets a service project attachment.final AppHubSettingsgetStub()final WorkloadgetWorkload(GetWorkloadRequest request) Gets a Workload in an Application.final WorkloadgetWorkload(WorkloadName name) Gets a Workload in an Application.final WorkloadgetWorkload(String name) Gets a Workload in an Application.Gets a Workload in an Application.booleanbooleanlistApplications(ListApplicationsRequest request) Lists Applications in a host project and location.listApplications(LocationName parent) Lists Applications in a host project and location.listApplications(String parent) Lists Applications in a host project and location.Lists Applications in a host project and location.Lists Applications in a host project and location.Lists Discovered Services that can be added to an Application in a host project and location.listDiscoveredServices(LocationName parent) Lists Discovered Services that can be added to an Application in a host project and location.listDiscoveredServices(String parent) Lists Discovered Services that can be added to an Application in a host project and location.Lists Discovered Services that can be added to an Application in a host project and location.Lists Discovered Services that can be added to an Application in a host project and location.Lists Discovered Workloads that can be added to an Application in a host project and location.listDiscoveredWorkloads(LocationName parent) Lists Discovered Workloads that can be added to an Application in a host project and location.listDiscoveredWorkloads(String parent) Lists Discovered Workloads that can be added to an Application in a host project and location.Lists Discovered Workloads that can be added to an Application in a host project and location.final UnaryCallable<ListDiscoveredWorkloadsRequest,AppHubClient.ListDiscoveredWorkloadsPagedResponse> Lists Discovered Workloads that can be added to an Application in a host project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists service projects attached to the host project.Lists service projects attached to the host project.listServiceProjectAttachments(String parent) Lists service projects attached to the host project.Lists service projects attached to the host project.final UnaryCallable<ListServiceProjectAttachmentsRequest,AppHubClient.ListServiceProjectAttachmentsPagedResponse> Lists service projects attached to the host project.listServices(ApplicationName parent) Lists Services in an Application.listServices(ListServicesRequest request) Lists Services in an Application.listServices(String parent) Lists Services in an Application.Lists Services in an Application.Lists Services in an Application.listWorkloads(ApplicationName parent) Lists Workloads in an Application.listWorkloads(ListWorkloadsRequest request) Lists Workloads in an Application.listWorkloads(String parent) Lists Workloads in an Application.Lists Workloads in an Application.Lists Workloads in an Application.lookupDiscoveredService(LocationName parent, String uri) Lists a Discovered Service in a host project and location, with a given resource URI.Lists a Discovered Service in a host project and location, with a given resource URI.lookupDiscoveredService(String parent, String uri) Lists a Discovered Service in a host project and location, with a given resource URI.Lists a Discovered Service in a host project and location, with a given resource URI.lookupDiscoveredWorkload(LocationName parent, String uri) Lists a Discovered Workload in a host project and location, with a given resource URI.Lists a Discovered Workload in a host project and location, with a given resource URI.lookupDiscoveredWorkload(String parent, String uri) Lists a Discovered Workload in a host project and location, with a given resource URI.Lists a Discovered Workload in a host project and location, with a given resource URI.Lists a service project attachment for a given service project.Lists a service project attachment for a given service project.Lists a service project attachment for a given service project.Lists a service project attachment for a given service project.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateApplicationAsync(Application application, com.google.protobuf.FieldMask updateMask) Updates an Application in a host project and location.Updates an Application in a host project and location.Updates an Application in a host project and location.Updates an Application in a host project and location.updateServiceAsync(Service service, com.google.protobuf.FieldMask updateMask) Updates a Service in an Application.updateServiceAsync(UpdateServiceRequest request) Updates a Service in an Application.Updates a Service in an Application.Updates a Service in an Application.updateWorkloadAsync(UpdateWorkloadRequest request) Updates a Workload in an Application.updateWorkloadAsync(Workload workload, com.google.protobuf.FieldMask updateMask) Updates a Workload in an Application.Updates a Workload in an Application.Updates a Workload in an Application.
-
Constructor Details
-
AppHubClient
Constructs an instance of AppHubClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
AppHubClient
-
-
Method Details
-
create
Constructs an instance of AppHubClient with default settings.- Throws:
IOException
-
create
Constructs an instance of AppHubClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of AppHubClient, using the given stub for making calls. This is for advanced usage - prefer using create(AppHubSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
lookupServiceProjectAttachment
public final LookupServiceProjectAttachmentResponse lookupServiceProjectAttachment(LocationName name) Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); LookupServiceProjectAttachmentResponse response = appHubClient.lookupServiceProjectAttachment(name); }- Parameters:
name- Required. Service project ID and location to lookup service project attachment for. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
lookupServiceProjectAttachment
Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = LocationName.of("[PROJECT]", "[LOCATION]").toString(); LookupServiceProjectAttachmentResponse response = appHubClient.lookupServiceProjectAttachment(name); }- Parameters:
name- Required. Service project ID and location to lookup service project attachment for. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
lookupServiceProjectAttachment
public final LookupServiceProjectAttachmentResponse lookupServiceProjectAttachment(LookupServiceProjectAttachmentRequest request) Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupServiceProjectAttachmentRequest request = LookupServiceProjectAttachmentRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .build(); LookupServiceProjectAttachmentResponse response = appHubClient.lookupServiceProjectAttachment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
lookupServiceProjectAttachmentCallable
public final UnaryCallable<LookupServiceProjectAttachmentRequest,LookupServiceProjectAttachmentResponse> lookupServiceProjectAttachmentCallable()Lists a service project attachment for a given service project. You can call this API from any project to find if it is attached to a host project.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupServiceProjectAttachmentRequest request = LookupServiceProjectAttachmentRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .build(); ApiFuture<LookupServiceProjectAttachmentResponse> future = appHubClient.lookupServiceProjectAttachmentCallable().futureCall(request); // Do something. LookupServiceProjectAttachmentResponse response = future.get(); } -
listServiceProjectAttachments
public final AppHubClient.ListServiceProjectAttachmentsPagedResponse listServiceProjectAttachments(LocationName parent) Lists service projects attached to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ServiceProjectAttachment element : appHubClient.listServiceProjectAttachments(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Host project ID and location to list service project attachments. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listServiceProjectAttachments
public final AppHubClient.ListServiceProjectAttachmentsPagedResponse listServiceProjectAttachments(String parent) Lists service projects attached to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ServiceProjectAttachment element : appHubClient.listServiceProjectAttachments(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Host project ID and location to list service project attachments. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listServiceProjectAttachments
public final AppHubClient.ListServiceProjectAttachmentsPagedResponse listServiceProjectAttachments(ListServiceProjectAttachmentsRequest request) Lists service projects attached to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServiceProjectAttachmentsRequest request = ListServiceProjectAttachmentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (ServiceProjectAttachment element : appHubClient.listServiceProjectAttachments(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listServiceProjectAttachmentsPagedCallable
public final UnaryCallable<ListServiceProjectAttachmentsRequest,AppHubClient.ListServiceProjectAttachmentsPagedResponse> listServiceProjectAttachmentsPagedCallable()Lists service projects attached to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServiceProjectAttachmentsRequest request = ListServiceProjectAttachmentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<ServiceProjectAttachment> future = appHubClient.listServiceProjectAttachmentsPagedCallable().futureCall(request); // Do something. for (ServiceProjectAttachment element : future.get().iterateAll()) { // doThingsWith(element); } } -
listServiceProjectAttachmentsCallable
public final UnaryCallable<ListServiceProjectAttachmentsRequest,ListServiceProjectAttachmentsResponse> listServiceProjectAttachmentsCallable()Lists service projects attached to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServiceProjectAttachmentsRequest request = ListServiceProjectAttachmentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListServiceProjectAttachmentsResponse response = appHubClient.listServiceProjectAttachmentsCallable().call(request); for (ServiceProjectAttachment element : response.getServiceProjectAttachmentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createServiceProjectAttachmentAsync
public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(LocationName parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId) Attaches a service project to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); ServiceProjectAttachment serviceProjectAttachment = ServiceProjectAttachment.newBuilder().build(); String serviceProjectAttachmentId = "serviceProjectAttachmentId-1738589598"; ServiceProjectAttachment response = appHubClient .createServiceProjectAttachmentAsync( parent, serviceProjectAttachment, serviceProjectAttachmentId) .get(); }- Parameters:
parent- Required. Host project ID and location to which service project is being attached. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.serviceProjectAttachment- Required. The resource being created.serviceProjectAttachmentId- Required. The service project attachment identifier must contain the project id of the service project specified in the service_project_attachment.service_project field.- Throws:
ApiException- if the remote call fails
-
createServiceProjectAttachmentAsync
public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(String parent, ServiceProjectAttachment serviceProjectAttachment, String serviceProjectAttachmentId) Attaches a service project to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); ServiceProjectAttachment serviceProjectAttachment = ServiceProjectAttachment.newBuilder().build(); String serviceProjectAttachmentId = "serviceProjectAttachmentId-1738589598"; ServiceProjectAttachment response = appHubClient .createServiceProjectAttachmentAsync( parent, serviceProjectAttachment, serviceProjectAttachmentId) .get(); }- Parameters:
parent- Required. Host project ID and location to which service project is being attached. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.serviceProjectAttachment- Required. The resource being created.serviceProjectAttachmentId- Required. The service project attachment identifier must contain the project id of the service project specified in the service_project_attachment.service_project field.- Throws:
ApiException- if the remote call fails
-
createServiceProjectAttachmentAsync
public final OperationFuture<ServiceProjectAttachment,OperationMetadata> createServiceProjectAttachmentAsync(CreateServiceProjectAttachmentRequest request) Attaches a service project to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceProjectAttachmentRequest request = CreateServiceProjectAttachmentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598") .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build()) .setRequestId("requestId693933066") .build(); ServiceProjectAttachment response = appHubClient.createServiceProjectAttachmentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createServiceProjectAttachmentOperationCallable
public final OperationCallable<CreateServiceProjectAttachmentRequest,ServiceProjectAttachment, createServiceProjectAttachmentOperationCallable()OperationMetadata> Attaches a service project to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceProjectAttachmentRequest request = CreateServiceProjectAttachmentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598") .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<ServiceProjectAttachment, OperationMetadata> future = appHubClient.createServiceProjectAttachmentOperationCallable().futureCall(request); // Do something. ServiceProjectAttachment response = future.get(); } -
createServiceProjectAttachmentCallable
public final UnaryCallable<CreateServiceProjectAttachmentRequest,Operation> createServiceProjectAttachmentCallable()Attaches a service project to the host project.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceProjectAttachmentRequest request = CreateServiceProjectAttachmentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServiceProjectAttachmentId("serviceProjectAttachmentId-1738589598") .setServiceProjectAttachment(ServiceProjectAttachment.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.createServiceProjectAttachmentCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getServiceProjectAttachment
public final ServiceProjectAttachment getServiceProjectAttachment(ServiceProjectAttachmentName name) Gets a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { ServiceProjectAttachmentName name = ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]"); ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(name); }- Parameters:
name- Required. Fully qualified name of the service project attachment to retrieve. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.- Throws:
ApiException- if the remote call fails
-
getServiceProjectAttachment
Gets a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ServiceProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString(); ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(name); }- Parameters:
name- Required. Fully qualified name of the service project attachment to retrieve. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.- Throws:
ApiException- if the remote call fails
-
getServiceProjectAttachment
public final ServiceProjectAttachment getServiceProjectAttachment(GetServiceProjectAttachmentRequest request) Gets a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { GetServiceProjectAttachmentRequest request = GetServiceProjectAttachmentRequest.newBuilder() .setName( ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString()) .build(); ServiceProjectAttachment response = appHubClient.getServiceProjectAttachment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getServiceProjectAttachmentCallable
public final UnaryCallable<GetServiceProjectAttachmentRequest,ServiceProjectAttachment> getServiceProjectAttachmentCallable()Gets a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { GetServiceProjectAttachmentRequest request = GetServiceProjectAttachmentRequest.newBuilder() .setName( ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString()) .build(); ApiFuture<ServiceProjectAttachment> future = appHubClient.getServiceProjectAttachmentCallable().futureCall(request); // Do something. ServiceProjectAttachment response = future.get(); } -
deleteServiceProjectAttachmentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(ServiceProjectAttachmentName name) Deletes a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { ServiceProjectAttachmentName name = ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]"); appHubClient.deleteServiceProjectAttachmentAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the service project attachment to delete. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.- Throws:
ApiException- if the remote call fails
-
deleteServiceProjectAttachmentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(String name) Deletes a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ServiceProjectAttachmentName.of("[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString(); appHubClient.deleteServiceProjectAttachmentAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the service project attachment to delete. Expected format: `projects/{project}/locations/{location}/serviceProjectAttachments/{serviceProjectAttachment}`.- Throws:
ApiException- if the remote call fails
-
deleteServiceProjectAttachmentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceProjectAttachmentAsync(DeleteServiceProjectAttachmentRequest request) Deletes a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceProjectAttachmentRequest request = DeleteServiceProjectAttachmentRequest.newBuilder() .setName( ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString()) .setRequestId("requestId693933066") .build(); appHubClient.deleteServiceProjectAttachmentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteServiceProjectAttachmentOperationCallable
public final OperationCallable<DeleteServiceProjectAttachmentRequest,com.google.protobuf.Empty, deleteServiceProjectAttachmentOperationCallable()OperationMetadata> Deletes a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceProjectAttachmentRequest request = DeleteServiceProjectAttachmentRequest.newBuilder() .setName( ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = appHubClient.deleteServiceProjectAttachmentOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteServiceProjectAttachmentCallable
public final UnaryCallable<DeleteServiceProjectAttachmentRequest,Operation> deleteServiceProjectAttachmentCallable()Deletes a service project attachment.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceProjectAttachmentRequest request = DeleteServiceProjectAttachmentRequest.newBuilder() .setName( ServiceProjectAttachmentName.of( "[PROJECT]", "[LOCATION]", "[SERVICE_PROJECT_ATTACHMENT]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.deleteServiceProjectAttachmentCallable().futureCall(request); // Do something. future.get(); } -
detachServiceProjectAttachment
public final DetachServiceProjectAttachmentResponse detachServiceProjectAttachment(LocationName name) Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName name = LocationName.of("[PROJECT]", "[LOCATION]"); DetachServiceProjectAttachmentResponse response = appHubClient.detachServiceProjectAttachment(name); }- Parameters:
name- Required. Service project id and location to detach from a host project. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
detachServiceProjectAttachment
Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = LocationName.of("[PROJECT]", "[LOCATION]").toString(); DetachServiceProjectAttachmentResponse response = appHubClient.detachServiceProjectAttachment(name); }- Parameters:
name- Required. Service project id and location to detach from a host project. Only global location is supported. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
detachServiceProjectAttachment
public final DetachServiceProjectAttachmentResponse detachServiceProjectAttachment(DetachServiceProjectAttachmentRequest request) Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.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 (AppHubClient appHubClient = AppHubClient.create()) { DetachServiceProjectAttachmentRequest request = DetachServiceProjectAttachmentRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .build(); DetachServiceProjectAttachmentResponse response = appHubClient.detachServiceProjectAttachment(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
detachServiceProjectAttachmentCallable
public final UnaryCallable<DetachServiceProjectAttachmentRequest,DetachServiceProjectAttachmentResponse> detachServiceProjectAttachmentCallable()Detaches a service project from a host project. You can call this API from any service project without needing access to the host project that it is attached to.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 (AppHubClient appHubClient = AppHubClient.create()) { DetachServiceProjectAttachmentRequest request = DetachServiceProjectAttachmentRequest.newBuilder() .setName(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .build(); ApiFuture<DetachServiceProjectAttachmentResponse> future = appHubClient.detachServiceProjectAttachmentCallable().futureCall(request); // Do something. DetachServiceProjectAttachmentResponse response = future.get(); } -
listDiscoveredServices
public final AppHubClient.ListDiscoveredServicesPagedResponse listDiscoveredServices(LocationName parent) Lists Discovered Services that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DiscoveredService element : appHubClient.listDiscoveredServices(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Discovered Services on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listDiscoveredServices
Lists Discovered Services that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DiscoveredService element : appHubClient.listDiscoveredServices(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Discovered Services on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listDiscoveredServices
public final AppHubClient.ListDiscoveredServicesPagedResponse listDiscoveredServices(ListDiscoveredServicesRequest request) Lists Discovered Services that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredServicesRequest request = ListDiscoveredServicesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DiscoveredService element : appHubClient.listDiscoveredServices(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDiscoveredServicesPagedCallable
public final UnaryCallable<ListDiscoveredServicesRequest,AppHubClient.ListDiscoveredServicesPagedResponse> listDiscoveredServicesPagedCallable()Lists Discovered Services that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredServicesRequest request = ListDiscoveredServicesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DiscoveredService> future = appHubClient.listDiscoveredServicesPagedCallable().futureCall(request); // Do something. for (DiscoveredService element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDiscoveredServicesCallable
public final UnaryCallable<ListDiscoveredServicesRequest,ListDiscoveredServicesResponse> listDiscoveredServicesCallable()Lists Discovered Services that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredServicesRequest request = ListDiscoveredServicesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListDiscoveredServicesResponse response = appHubClient.listDiscoveredServicesCallable().call(request); for (DiscoveredService element : response.getDiscoveredServicesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDiscoveredService
Gets a Discovered Service in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { DiscoveredServiceName name = DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]"); DiscoveredService response = appHubClient.getDiscoveredService(name); }- Parameters:
name- Required. Fully qualified name of the Discovered Service to fetch. Expected format: `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.- Throws:
ApiException- if the remote call fails
-
getDiscoveredService
Gets a Discovered Service in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]").toString(); DiscoveredService response = appHubClient.getDiscoveredService(name); }- Parameters:
name- Required. Fully qualified name of the Discovered Service to fetch. Expected format: `projects/{project}/locations/{location}/discoveredServices/{discoveredService}`.- Throws:
ApiException- if the remote call fails
-
getDiscoveredService
Gets a Discovered Service in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetDiscoveredServiceRequest request = GetDiscoveredServiceRequest.newBuilder() .setName( DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]") .toString()) .build(); DiscoveredService response = appHubClient.getDiscoveredService(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDiscoveredServiceCallable
public final UnaryCallable<GetDiscoveredServiceRequest,DiscoveredService> getDiscoveredServiceCallable()Gets a Discovered Service in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetDiscoveredServiceRequest request = GetDiscoveredServiceRequest.newBuilder() .setName( DiscoveredServiceName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_SERVICE]") .toString()) .build(); ApiFuture<DiscoveredService> future = appHubClient.getDiscoveredServiceCallable().futureCall(request); // Do something. DiscoveredService response = future.get(); } -
lookupDiscoveredService
public final LookupDiscoveredServiceResponse lookupDiscoveredService(LocationName parent, String uri) Lists a Discovered Service in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); String uri = "uri116076"; LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(parent, uri); }- Parameters:
parent- Required. Host project ID and location to lookup Discovered Service in. Expected format: `projects/{project}/locations/{location}`.uri- Required. Resource URI to find DiscoveredService for. Accepts both project number and project ID and does translation when needed.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredService
Lists a Discovered Service in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); String uri = "uri116076"; LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(parent, uri); }- Parameters:
parent- Required. Host project ID and location to lookup Discovered Service in. Expected format: `projects/{project}/locations/{location}`.uri- Required. Resource URI to find DiscoveredService for. Accepts both project number and project ID and does translation when needed.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredService
public final LookupDiscoveredServiceResponse lookupDiscoveredService(LookupDiscoveredServiceRequest request) Lists a Discovered Service in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupDiscoveredServiceRequest request = LookupDiscoveredServiceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUri("uri116076") .build(); LookupDiscoveredServiceResponse response = appHubClient.lookupDiscoveredService(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredServiceCallable
public final UnaryCallable<LookupDiscoveredServiceRequest,LookupDiscoveredServiceResponse> lookupDiscoveredServiceCallable()Lists a Discovered Service in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupDiscoveredServiceRequest request = LookupDiscoveredServiceRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUri("uri116076") .build(); ApiFuture<LookupDiscoveredServiceResponse> future = appHubClient.lookupDiscoveredServiceCallable().futureCall(request); // Do something. LookupDiscoveredServiceResponse response = future.get(); } -
listServices
Lists Services in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); for (Service element : appHubClient.listServices(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Fully qualified name of the parent Application to list Services for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
listServices
Lists Services in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); for (Service element : appHubClient.listServices(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Fully qualified name of the parent Application to list Services for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
listServices
Lists Services in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServicesRequest request = ListServicesRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Service element : appHubClient.listServices(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listServicesPagedCallable
public final UnaryCallable<ListServicesRequest,AppHubClient.ListServicesPagedResponse> listServicesPagedCallable()Lists Services in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServicesRequest request = ListServicesRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Service> future = appHubClient.listServicesPagedCallable().futureCall(request); // Do something. for (Service element : future.get().iterateAll()) { // doThingsWith(element); } } -
listServicesCallable
Lists Services in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListServicesRequest request = ListServicesRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListServicesResponse response = appHubClient.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; } } } -
createServiceAsync
public final OperationFuture<Service,OperationMetadata> createServiceAsync(ApplicationName parent, Service service, String serviceId) Creates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); Service service = Service.newBuilder().build(); String serviceId = "serviceId-194185552"; Service response = appHubClient.createServiceAsync(parent, service, serviceId).get(); }- Parameters:
parent- Required. Fully qualified name of the parent Application to create the Service in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.service- Required. The resource being created.serviceId- Required. The Service identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createServiceAsync
public final OperationFuture<Service,OperationMetadata> createServiceAsync(String parent, Service service, String serviceId) Creates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); Service service = Service.newBuilder().build(); String serviceId = "serviceId-194185552"; Service response = appHubClient.createServiceAsync(parent, service, serviceId).get(); }- Parameters:
parent- Required. Fully qualified name of the parent Application to create the Service in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.service- Required. The resource being created.serviceId- Required. The Service identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createServiceAsync
public final OperationFuture<Service,OperationMetadata> createServiceAsync(CreateServiceRequest request) Creates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceRequest request = CreateServiceRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setServiceId("serviceId-194185552") .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); Service response = appHubClient.createServiceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createServiceOperationCallable
public final OperationCallable<CreateServiceRequest,Service, createServiceOperationCallable()OperationMetadata> Creates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceRequest request = CreateServiceRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setServiceId("serviceId-194185552") .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Service, OperationMetadata> future = appHubClient.createServiceOperationCallable().futureCall(request); // Do something. Service response = future.get(); } -
createServiceCallable
Creates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateServiceRequest request = CreateServiceRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setServiceId("serviceId-194185552") .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.createServiceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getService
Gets a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]"); Service response = appHubClient.getService(name); }- Parameters:
name- Required. Fully qualified name of the Service to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.- Throws:
ApiException- if the remote call fails
-
getService
Gets a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]").toString(); Service response = appHubClient.getService(name); }- Parameters:
name- Required. Fully qualified name of the Service to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.- Throws:
ApiException- if the remote call fails
-
getService
Gets a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { GetServiceRequest request = GetServiceRequest.newBuilder() .setName( ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]") .toString()) .build(); Service response = appHubClient.getService(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getServiceCallable
Gets a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { GetServiceRequest request = GetServiceRequest.newBuilder() .setName( ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]") .toString()) .build(); ApiFuture<Service> future = appHubClient.getServiceCallable().futureCall(request); // Do something. Service response = future.get(); } -
updateServiceAsync
public final OperationFuture<Service,OperationMetadata> updateServiceAsync(Service service, com.google.protobuf.FieldMask updateMask) Updates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { Service service = Service.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Service response = appHubClient.updateServiceAsync(service, updateMask).get(); }- Parameters:
service- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Service resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.- Throws:
ApiException- if the remote call fails
-
updateServiceAsync
public final OperationFuture<Service,OperationMetadata> updateServiceAsync(UpdateServiceRequest request) Updates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateServiceRequest request = UpdateServiceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); Service response = appHubClient.updateServiceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateServiceOperationCallable
public final OperationCallable<UpdateServiceRequest,Service, updateServiceOperationCallable()OperationMetadata> Updates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateServiceRequest request = UpdateServiceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Service, OperationMetadata> future = appHubClient.updateServiceOperationCallable().futureCall(request); // Do something. Service response = future.get(); } -
updateServiceCallable
Updates a Service in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateServiceRequest request = UpdateServiceRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setService(Service.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.updateServiceCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteServiceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(ServiceName name) Deletes a Service from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ServiceName name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]"); appHubClient.deleteServiceAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Service to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.- Throws:
ApiException- if the remote call fails
-
deleteServiceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(String name) Deletes a Service from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]").toString(); appHubClient.deleteServiceAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Service to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/services/{service}`.- Throws:
ApiException- if the remote call fails
-
deleteServiceAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteServiceAsync(DeleteServiceRequest request) Deletes a Service from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceRequest request = DeleteServiceRequest.newBuilder() .setName( ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]") .toString()) .setRequestId("requestId693933066") .build(); appHubClient.deleteServiceAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteServiceOperationCallable
public final OperationCallable<DeleteServiceRequest,com.google.protobuf.Empty, deleteServiceOperationCallable()OperationMetadata> Deletes a Service from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceRequest request = DeleteServiceRequest.newBuilder() .setName( ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = appHubClient.deleteServiceOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteServiceCallable
Deletes a Service from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteServiceRequest request = DeleteServiceRequest.newBuilder() .setName( ServiceName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[SERVICE]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.deleteServiceCallable().futureCall(request); // Do something. future.get(); } -
listDiscoveredWorkloads
public final AppHubClient.ListDiscoveredWorkloadsPagedResponse listDiscoveredWorkloads(LocationName parent) Lists Discovered Workloads that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DiscoveredWorkload element : appHubClient.listDiscoveredWorkloads(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Discovered Workloads on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listDiscoveredWorkloads
public final AppHubClient.ListDiscoveredWorkloadsPagedResponse listDiscoveredWorkloads(String parent) Lists Discovered Workloads that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DiscoveredWorkload element : appHubClient.listDiscoveredWorkloads(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Discovered Workloads on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listDiscoveredWorkloads
public final AppHubClient.ListDiscoveredWorkloadsPagedResponse listDiscoveredWorkloads(ListDiscoveredWorkloadsRequest request) Lists Discovered Workloads that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredWorkloadsRequest request = ListDiscoveredWorkloadsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (DiscoveredWorkload element : appHubClient.listDiscoveredWorkloads(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDiscoveredWorkloadsPagedCallable
public final UnaryCallable<ListDiscoveredWorkloadsRequest,AppHubClient.ListDiscoveredWorkloadsPagedResponse> listDiscoveredWorkloadsPagedCallable()Lists Discovered Workloads that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredWorkloadsRequest request = ListDiscoveredWorkloadsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<DiscoveredWorkload> future = appHubClient.listDiscoveredWorkloadsPagedCallable().futureCall(request); // Do something. for (DiscoveredWorkload element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDiscoveredWorkloadsCallable
public final UnaryCallable<ListDiscoveredWorkloadsRequest,ListDiscoveredWorkloadsResponse> listDiscoveredWorkloadsCallable()Lists Discovered Workloads that can be added to an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListDiscoveredWorkloadsRequest request = ListDiscoveredWorkloadsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListDiscoveredWorkloadsResponse response = appHubClient.listDiscoveredWorkloadsCallable().call(request); for (DiscoveredWorkload element : response.getDiscoveredWorkloadsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDiscoveredWorkload
Gets a Discovered Workload in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { DiscoveredWorkloadName name = DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]"); DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(name); }- Parameters:
name- Required. Fully qualified name of the Discovered Workload to fetch. Expected format: `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.- Throws:
ApiException- if the remote call fails
-
getDiscoveredWorkload
Gets a Discovered Workload in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]").toString(); DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(name); }- Parameters:
name- Required. Fully qualified name of the Discovered Workload to fetch. Expected format: `projects/{project}/locations/{location}/discoveredWorkloads/{discoveredWorkload}`.- Throws:
ApiException- if the remote call fails
-
getDiscoveredWorkload
Gets a Discovered Workload in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetDiscoveredWorkloadRequest request = GetDiscoveredWorkloadRequest.newBuilder() .setName( DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]") .toString()) .build(); DiscoveredWorkload response = appHubClient.getDiscoveredWorkload(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDiscoveredWorkloadCallable
public final UnaryCallable<GetDiscoveredWorkloadRequest,DiscoveredWorkload> getDiscoveredWorkloadCallable()Gets a Discovered Workload in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetDiscoveredWorkloadRequest request = GetDiscoveredWorkloadRequest.newBuilder() .setName( DiscoveredWorkloadName.of("[PROJECT]", "[LOCATION]", "[DISCOVERED_WORKLOAD]") .toString()) .build(); ApiFuture<DiscoveredWorkload> future = appHubClient.getDiscoveredWorkloadCallable().futureCall(request); // Do something. DiscoveredWorkload response = future.get(); } -
lookupDiscoveredWorkload
public final LookupDiscoveredWorkloadResponse lookupDiscoveredWorkload(LocationName parent, String uri) Lists a Discovered Workload in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); String uri = "uri116076"; LookupDiscoveredWorkloadResponse response = appHubClient.lookupDiscoveredWorkload(parent, uri); }- Parameters:
parent- Required. Host project ID and location to lookup Discovered Workload in. Expected format: `projects/{project}/locations/{location}`.uri- Required. Resource URI to find Discovered Workload for. Accepts both project number and project ID and does translation when needed.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredWorkload
Lists a Discovered Workload in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); String uri = "uri116076"; LookupDiscoveredWorkloadResponse response = appHubClient.lookupDiscoveredWorkload(parent, uri); }- Parameters:
parent- Required. Host project ID and location to lookup Discovered Workload in. Expected format: `projects/{project}/locations/{location}`.uri- Required. Resource URI to find Discovered Workload for. Accepts both project number and project ID and does translation when needed.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredWorkload
public final LookupDiscoveredWorkloadResponse lookupDiscoveredWorkload(LookupDiscoveredWorkloadRequest request) Lists a Discovered Workload in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupDiscoveredWorkloadRequest request = LookupDiscoveredWorkloadRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUri("uri116076") .build(); LookupDiscoveredWorkloadResponse response = appHubClient.lookupDiscoveredWorkload(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
lookupDiscoveredWorkloadCallable
public final UnaryCallable<LookupDiscoveredWorkloadRequest,LookupDiscoveredWorkloadResponse> lookupDiscoveredWorkloadCallable()Lists a Discovered Workload in a host project and location, with a given resource URI.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 (AppHubClient appHubClient = AppHubClient.create()) { LookupDiscoveredWorkloadRequest request = LookupDiscoveredWorkloadRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setUri("uri116076") .build(); ApiFuture<LookupDiscoveredWorkloadResponse> future = appHubClient.lookupDiscoveredWorkloadCallable().futureCall(request); // Do something. LookupDiscoveredWorkloadResponse response = future.get(); } -
listWorkloads
Lists Workloads in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); for (Workload element : appHubClient.listWorkloads(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Fully qualified name of the parent Application to list Workloads for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
listWorkloads
Lists Workloads in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); for (Workload element : appHubClient.listWorkloads(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Fully qualified name of the parent Application to list Workloads for. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
listWorkloads
Lists Workloads in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Workload element : appHubClient.listWorkloads(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listWorkloadsPagedCallable
public final UnaryCallable<ListWorkloadsRequest,AppHubClient.ListWorkloadsPagedResponse> listWorkloadsPagedCallable()Lists Workloads in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Workload> future = appHubClient.listWorkloadsPagedCallable().futureCall(request); // Do something. for (Workload element : future.get().iterateAll()) { // doThingsWith(element); } } -
listWorkloadsCallable
Lists Workloads in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ListWorkloadsRequest request = ListWorkloadsRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListWorkloadsResponse response = appHubClient.listWorkloadsCallable().call(request); for (Workload element : response.getWorkloadsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createWorkloadAsync
public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(ApplicationName parent, Workload workload, String workloadId) Creates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); Workload workload = Workload.newBuilder().build(); String workloadId = "workloadId-186277134"; Workload response = appHubClient.createWorkloadAsync(parent, workload, workloadId).get(); }- Parameters:
parent- Required. Fully qualified name of the Application to create Workload in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.workload- Required. The resource being created.workloadId- Required. The Workload identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createWorkloadAsync
public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(String parent, Workload workload, String workloadId) Creates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); Workload workload = Workload.newBuilder().build(); String workloadId = "workloadId-186277134"; Workload response = appHubClient.createWorkloadAsync(parent, workload, workloadId).get(); }- Parameters:
parent- Required. Fully qualified name of the Application to create Workload in. Expected format: `projects/{project}/locations/{location}/applications/{application}`.workload- Required. The resource being created.workloadId- Required. The Workload identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createWorkloadAsync
public final OperationFuture<Workload,OperationMetadata> createWorkloadAsync(CreateWorkloadRequest request) Creates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setWorkloadId("workloadId-186277134") .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); Workload response = appHubClient.createWorkloadAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createWorkloadOperationCallable
public final OperationCallable<CreateWorkloadRequest,Workload, createWorkloadOperationCallable()OperationMetadata> Creates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setWorkloadId("workloadId-186277134") .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Workload, OperationMetadata> future = appHubClient.createWorkloadOperationCallable().futureCall(request); // Do something. Workload response = future.get(); } -
createWorkloadCallable
Creates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateWorkloadRequest request = CreateWorkloadRequest.newBuilder() .setParent(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setWorkloadId("workloadId-186277134") .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.createWorkloadCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getWorkload
Gets a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { WorkloadName name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]"); Workload response = appHubClient.getWorkload(name); }- Parameters:
name- Required. Fully qualified name of the Workload to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.- Throws:
ApiException- if the remote call fails
-
getWorkload
Gets a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]").toString(); Workload response = appHubClient.getWorkload(name); }- Parameters:
name- Required. Fully qualified name of the Workload to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.- Throws:
ApiException- if the remote call fails
-
getWorkload
Gets a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { GetWorkloadRequest request = GetWorkloadRequest.newBuilder() .setName( WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]") .toString()) .build(); Workload response = appHubClient.getWorkload(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getWorkloadCallable
Gets a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { GetWorkloadRequest request = GetWorkloadRequest.newBuilder() .setName( WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]") .toString()) .build(); ApiFuture<Workload> future = appHubClient.getWorkloadCallable().futureCall(request); // Do something. Workload response = future.get(); } -
updateWorkloadAsync
public final OperationFuture<Workload,OperationMetadata> updateWorkloadAsync(Workload workload, com.google.protobuf.FieldMask updateMask) Updates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { Workload workload = Workload.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Workload response = appHubClient.updateWorkloadAsync(workload, updateMask).get(); }- Parameters:
workload- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Workload resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.- Throws:
ApiException- if the remote call fails
-
updateWorkloadAsync
public final OperationFuture<Workload,OperationMetadata> updateWorkloadAsync(UpdateWorkloadRequest request) Updates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateWorkloadRequest request = UpdateWorkloadRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); Workload response = appHubClient.updateWorkloadAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateWorkloadOperationCallable
public final OperationCallable<UpdateWorkloadRequest,Workload, updateWorkloadOperationCallable()OperationMetadata> Updates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateWorkloadRequest request = UpdateWorkloadRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Workload, OperationMetadata> future = appHubClient.updateWorkloadOperationCallable().futureCall(request); // Do something. Workload response = future.get(); } -
updateWorkloadCallable
Updates a Workload in an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateWorkloadRequest request = UpdateWorkloadRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setWorkload(Workload.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.updateWorkloadCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteWorkloadAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(WorkloadName name) Deletes a Workload from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { WorkloadName name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]"); appHubClient.deleteWorkloadAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Workload to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.- Throws:
ApiException- if the remote call fails
-
deleteWorkloadAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(String name) Deletes a Workload from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]").toString(); appHubClient.deleteWorkloadAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Workload to delete from an Application. Expected format: `projects/{project}/locations/{location}/applications/{application}/workloads/{workload}`.- Throws:
ApiException- if the remote call fails
-
deleteWorkloadAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteWorkloadAsync(DeleteWorkloadRequest request) Deletes a Workload from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder() .setName( WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]") .toString()) .setRequestId("requestId693933066") .build(); appHubClient.deleteWorkloadAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteWorkloadOperationCallable
public final OperationCallable<DeleteWorkloadRequest,com.google.protobuf.Empty, deleteWorkloadOperationCallable()OperationMetadata> Deletes a Workload from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder() .setName( WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]") .toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = appHubClient.deleteWorkloadOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteWorkloadCallable
Deletes a Workload from an Application.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteWorkloadRequest request = DeleteWorkloadRequest.newBuilder() .setName( WorkloadName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]", "[WORKLOAD]") .toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.deleteWorkloadCallable().futureCall(request); // Do something. future.get(); } -
listApplications
Lists Applications in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Application element : appHubClient.listApplications(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Applications on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listApplications
Lists Applications in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Application element : appHubClient.listApplications(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Project and location to list Applications on. Expected format: `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listApplications
public final AppHubClient.ListApplicationsPagedResponse listApplications(ListApplicationsRequest request) Lists Applications in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListApplicationsRequest request = ListApplicationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Application element : appHubClient.listApplications(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listApplicationsPagedCallable
public final UnaryCallable<ListApplicationsRequest,AppHubClient.ListApplicationsPagedResponse> listApplicationsPagedCallable()Lists Applications in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListApplicationsRequest request = ListApplicationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Application> future = appHubClient.listApplicationsPagedCallable().futureCall(request); // Do something. for (Application element : future.get().iterateAll()) { // doThingsWith(element); } } -
listApplicationsCallable
public final UnaryCallable<ListApplicationsRequest,ListApplicationsResponse> listApplicationsCallable()Lists Applications in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ListApplicationsRequest request = ListApplicationsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListApplicationsResponse response = appHubClient.listApplicationsCallable().call(request); for (Application element : response.getApplicationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createApplicationAsync
public final OperationFuture<Application,OperationMetadata> createApplicationAsync(LocationName parent, Application application, String applicationId) Creates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Application application = Application.newBuilder().build(); String applicationId = "applicationId-1011352949"; Application response = appHubClient.createApplicationAsync(parent, application, applicationId).get(); }- Parameters:
parent- Required. Project and location to create Application in. Expected format: `projects/{project}/locations/{location}`.application- Required. The resource being createdapplicationId- Required. The Application identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createApplicationAsync
public final OperationFuture<Application,OperationMetadata> createApplicationAsync(String parent, Application application, String applicationId) Creates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Application application = Application.newBuilder().build(); String applicationId = "applicationId-1011352949"; Application response = appHubClient.createApplicationAsync(parent, application, applicationId).get(); }- Parameters:
parent- Required. Project and location to create Application in. Expected format: `projects/{project}/locations/{location}`.application- Required. The resource being createdapplicationId- Required. The Application identifier. Must contain only lowercase letters, numbers or hyphens, with the first character a letter, the last a letter or a number, and a 63 character maximum.- Throws:
ApiException- if the remote call fails
-
createApplicationAsync
public final OperationFuture<Application,OperationMetadata> createApplicationAsync(CreateApplicationRequest request) Creates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateApplicationRequest request = CreateApplicationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApplicationId("applicationId-1011352949") .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); Application response = appHubClient.createApplicationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createApplicationOperationCallable
public final OperationCallable<CreateApplicationRequest,Application, createApplicationOperationCallable()OperationMetadata> Creates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateApplicationRequest request = CreateApplicationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApplicationId("applicationId-1011352949") .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Application, OperationMetadata> future = appHubClient.createApplicationOperationCallable().futureCall(request); // Do something. Application response = future.get(); } -
createApplicationCallable
Creates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { CreateApplicationRequest request = CreateApplicationRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setApplicationId("applicationId-1011352949") .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.createApplicationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getApplication
Gets an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); Application response = appHubClient.getApplication(name); }- Parameters:
name- Required. Fully qualified name of the Application to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
getApplication
Gets an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); Application response = appHubClient.getApplication(name); }- Parameters:
name- Required. Fully qualified name of the Application to fetch. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
getApplication
Gets an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetApplicationRequest request = GetApplicationRequest.newBuilder() .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .build(); Application response = appHubClient.getApplication(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getApplicationCallable
Gets an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetApplicationRequest request = GetApplicationRequest.newBuilder() .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .build(); ApiFuture<Application> future = appHubClient.getApplicationCallable().futureCall(request); // Do something. Application response = future.get(); } -
updateApplicationAsync
public final OperationFuture<Application,OperationMetadata> updateApplicationAsync(Application application, com.google.protobuf.FieldMask updateMask) Updates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { Application application = Application.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Application response = appHubClient.updateApplicationAsync(application, updateMask).get(); }- Parameters:
application- Required. The resource being updated.updateMask- Required. Field mask is used to specify the fields to be overwritten in the Application resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. The API changes the values of the fields as specified in the update_mask. The API ignores the values of all fields not covered by the update_mask. You can also unset a field by not specifying it in the updated message, but adding the field to the mask. This clears whatever value the field previously had.- Throws:
ApiException- if the remote call fails
-
updateApplicationAsync
public final OperationFuture<Application,OperationMetadata> updateApplicationAsync(UpdateApplicationRequest request) Updates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateApplicationRequest request = UpdateApplicationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); Application response = appHubClient.updateApplicationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateApplicationOperationCallable
public final OperationCallable<UpdateApplicationRequest,Application, updateApplicationOperationCallable()OperationMetadata> Updates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateApplicationRequest request = UpdateApplicationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Application, OperationMetadata> future = appHubClient.updateApplicationOperationCallable().futureCall(request); // Do something. Application response = future.get(); } -
updateApplicationCallable
Updates an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { UpdateApplicationRequest request = UpdateApplicationRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setApplication(Application.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.updateApplicationCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteApplicationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(ApplicationName name) Deletes an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { ApplicationName name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]"); appHubClient.deleteApplicationAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Application to delete. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
deleteApplicationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(String name) Deletes an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { String name = ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString(); appHubClient.deleteApplicationAsync(name).get(); }- Parameters:
name- Required. Fully qualified name of the Application to delete. Expected format: `projects/{project}/locations/{location}/applications/{application}`.- Throws:
ApiException- if the remote call fails
-
deleteApplicationAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteApplicationAsync(DeleteApplicationRequest request) Deletes an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder() .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setRequestId("requestId693933066") .build(); appHubClient.deleteApplicationAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteApplicationOperationCallable
public final OperationCallable<DeleteApplicationRequest,com.google.protobuf.Empty, deleteApplicationOperationCallable()OperationMetadata> Deletes an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder() .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = appHubClient.deleteApplicationOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteApplicationCallable
Deletes an Application in a host project and location.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 (AppHubClient appHubClient = AppHubClient.create()) { DeleteApplicationRequest request = DeleteApplicationRequest.newBuilder() .setName(ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = appHubClient.deleteApplicationCallable().futureCall(request); // Do something. future.get(); } -
listLocations
Lists information about the supported locations for this service.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 (AppHubClient appHubClient = AppHubClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : appHubClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,AppHubClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.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 (AppHubClient appHubClient = AppHubClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = appHubClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.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 (AppHubClient appHubClient = AppHubClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = appHubClient.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; } } } -
getLocation
Gets information about a location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = appHubClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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 (AppHubClient appHubClient = AppHubClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = appHubClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (AppHubClient appHubClient = AppHubClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = appHubClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
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 (AppHubClient appHubClient = AppHubClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = appHubClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (AppHubClient appHubClient = AppHubClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = appHubClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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 (AppHubClient appHubClient = AppHubClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = appHubClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
testIamPermissions
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (AppHubClient appHubClient = AppHubClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); TestIamPermissionsResponse response = appHubClient.testIamPermissions(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error.Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
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 (AppHubClient appHubClient = AppHubClient.create()) { TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder() .setResource( ApplicationName.of("[PROJECT]", "[LOCATION]", "[APPLICATION]").toString()) .addAllPermissions(new ArrayList<String>()) .build(); ApiFuture<TestIamPermissionsResponse> future = appHubClient.testIamPermissionsCallable().futureCall(request); // Do something. TestIamPermissionsResponse response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-