Class InsightsConfigServiceClient (0.37.0)

Service Description: Creates and manages InsightsConfigs.

The InsightsConfig resource is the core configuration object to capture events from your Software Development Lifecycle. It acts as the central hub for managing how Developer connect understands your application, its runtime environments, and the artifacts deployed within them. A user can create an InsightsConfig, list previously-requested InsightsConfigs or get InsightsConfigs by their ID to determine the status of the InsightsConfig.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
InsightsConfigNamename=
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]");
InsightsConfigresponse=insightsConfigServiceClient.getInsightsConfig(name);
}

Note: close() needs to be called on the InsightsConfigServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

Methods
Method Description Method Variants

ListInsightsConfigs

Lists InsightsConfigs in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • listInsightsConfigs(ListInsightsConfigsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listInsightsConfigs(LocationName parent)

  • listInsightsConfigs(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listInsightsConfigsPagedCallable()

  • listInsightsConfigsCallable()

CreateInsightsConfig

Creates a new InsightsConfig in a given project and location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • createInsightsConfigAsync(CreateInsightsConfigRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • createInsightsConfigAsync(LocationName parent, InsightsConfig insightsConfig, String insightsConfigId)

  • createInsightsConfigAsync(String parent, InsightsConfig insightsConfig, String insightsConfigId)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createInsightsConfigOperationCallable()

  • createInsightsConfigCallable()

GetInsightsConfig

Gets details of a single Insight.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getInsightsConfig(GetInsightsConfigRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getInsightsConfig(InsightsConfigName name)

  • getInsightsConfig(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getInsightsConfigCallable()

UpdateInsightsConfig

Updates the parameters of a single InsightsConfig.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updateInsightsConfigAsync(UpdateInsightsConfigRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updateInsightsConfigOperationCallable()

  • updateInsightsConfigCallable()

DeleteInsightsConfig

Delete a single Insight.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deleteInsightsConfigAsync(DeleteInsightsConfigRequest request)

Methods that return long-running operations have "Async" method variants that return OperationFuture, which is used to track polling of the service.

  • deleteInsightsConfigAsync(InsightsConfigName name)

  • deleteInsightsConfigAsync(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deleteInsightsConfigOperationCallable()

  • deleteInsightsConfigCallable()

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.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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 InsightsConfigServiceSettings 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
InsightsConfigServiceSettingsinsightsConfigServiceSettings=
InsightsConfigServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create(insightsConfigServiceSettings);

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
InsightsConfigServiceSettingsinsightsConfigServiceSettings=
InsightsConfigServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create(insightsConfigServiceSettings);

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
InsightsConfigServiceSettingsinsightsConfigServiceSettings=
InsightsConfigServiceSettings.newHttpJsonBuilder().build();
InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create(insightsConfigServiceSettings);

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > InsightsConfigServiceClient

Static Methods

create()

publicstaticfinalInsightsConfigServiceClientcreate()

Constructs an instance of InsightsConfigServiceClient with default settings.

Returns
Type Description
InsightsConfigServiceClient
Exceptions
Type Description
IOException

create(InsightsConfigServiceSettings settings)

publicstaticfinalInsightsConfigServiceClientcreate(InsightsConfigServiceSettingssettings)

Constructs an instance of InsightsConfigServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.

Parameter
Name Description
settings InsightsConfigServiceSettings
Returns
Type Description
InsightsConfigServiceClient
Exceptions
Type Description
IOException

create(InsightsConfigServiceStub stub)

publicstaticfinalInsightsConfigServiceClientcreate(InsightsConfigServiceStubstub)

Constructs an instance of InsightsConfigServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(InsightsConfigServiceSettings).

Parameter
Name Description
stub InsightsConfigServiceStub
Returns
Type Description
InsightsConfigServiceClient

Constructors

InsightsConfigServiceClient(InsightsConfigServiceSettings settings)

protectedInsightsConfigServiceClient(InsightsConfigServiceSettingssettings)

Constructs an instance of InsightsConfigServiceClient, 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.

Parameter
Name Description
settings InsightsConfigServiceSettings

InsightsConfigServiceClient(InsightsConfigServiceStub stub)

protectedInsightsConfigServiceClient(InsightsConfigServiceStubstub)
Parameter
Name Description
stub InsightsConfigServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

publicbooleanawaitTermination(longduration,TimeUnitunit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

publicfinalvoidclose()

createInsightsConfigAsync(CreateInsightsConfigRequest request)

publicfinalOperationFuture<InsightsConfig,OperationMetadata>createInsightsConfigAsync(CreateInsightsConfigRequestrequest)

Creates a new InsightsConfig in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
CreateInsightsConfigRequestrequest=
CreateInsightsConfigRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInsightsConfigId("insightsConfigId774395128")
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setValidateOnly(true)
.build();
InsightsConfigresponse=
insightsConfigServiceClient.createInsightsConfigAsync(request).get();
}
Parameter
Name Description
request CreateInsightsConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<InsightsConfig,OperationMetadata>

createInsightsConfigAsync(LocationName parent, InsightsConfig insightsConfig, String insightsConfigId)

publicfinalOperationFuture<InsightsConfig,OperationMetadata>createInsightsConfigAsync(LocationNameparent,InsightsConfiginsightsConfig,StringinsightsConfigId)

Creates a new InsightsConfig in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
InsightsConfiginsightsConfig=InsightsConfig.newBuilder().build();
StringinsightsConfigId="insightsConfigId774395128";
InsightsConfigresponse=
insightsConfigServiceClient
.createInsightsConfigAsync(parent,insightsConfig,insightsConfigId)
.get();
}
Parameters
Name Description
parent LocationName

Required. Value for parent.

insightsConfig InsightsConfig

Required. The resource being created.

insightsConfigId String

Required. ID of the requesting InsightsConfig.

Returns
Type Description
OperationFuture<InsightsConfig,OperationMetadata>

createInsightsConfigAsync(String parent, InsightsConfig insightsConfig, String insightsConfigId)

publicfinalOperationFuture<InsightsConfig,OperationMetadata>createInsightsConfigAsync(Stringparent,InsightsConfiginsightsConfig,StringinsightsConfigId)

Creates a new InsightsConfig in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
InsightsConfiginsightsConfig=InsightsConfig.newBuilder().build();
StringinsightsConfigId="insightsConfigId774395128";
InsightsConfigresponse=
insightsConfigServiceClient
.createInsightsConfigAsync(parent,insightsConfig,insightsConfigId)
.get();
}
Parameters
Name Description
parent String

Required. Value for parent.

insightsConfig InsightsConfig

Required. The resource being created.

insightsConfigId String

Required. ID of the requesting InsightsConfig.

Returns
Type Description
OperationFuture<InsightsConfig,OperationMetadata>

createInsightsConfigCallable()

publicfinalUnaryCallable<CreateInsightsConfigRequest,Operation>createInsightsConfigCallable()

Creates a new InsightsConfig in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
CreateInsightsConfigRequestrequest=
CreateInsightsConfigRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInsightsConfigId("insightsConfigId774395128")
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation>future=
insightsConfigServiceClient.createInsightsConfigCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<CreateInsightsConfigRequest,Operation>

createInsightsConfigOperationCallable()

publicfinalOperationCallable<CreateInsightsConfigRequest,InsightsConfig,OperationMetadata>createInsightsConfigOperationCallable()

Creates a new InsightsConfig in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
CreateInsightsConfigRequestrequest=
CreateInsightsConfigRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setInsightsConfigId("insightsConfigId774395128")
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<InsightsConfig,OperationMetadata>future=
insightsConfigServiceClient.createInsightsConfigOperationCallable().futureCall(request);
// Do something.
InsightsConfigresponse=future.get();
}
Returns
Type Description
OperationCallable<CreateInsightsConfigRequest,InsightsConfig,OperationMetadata>

deleteInsightsConfigAsync(DeleteInsightsConfigRequest request)

publicfinalOperationFuture<Empty,OperationMetadata>deleteInsightsConfigAsync(DeleteInsightsConfigRequestrequest)

Delete a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
DeleteInsightsConfigRequestrequest=
DeleteInsightsConfigRequest.newBuilder()
.setName(
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
insightsConfigServiceClient.deleteInsightsConfigAsync(request).get();
}
Parameter
Name Description
request DeleteInsightsConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInsightsConfigAsync(InsightsConfigName name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteInsightsConfigAsync(InsightsConfigNamename)

Delete a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
InsightsConfigNamename=
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]");
insightsConfigServiceClient.deleteInsightsConfigAsync(name).get();
}
Parameter
Name Description
name InsightsConfigName

Required. Value for parent.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInsightsConfigAsync(String name)

publicfinalOperationFuture<Empty,OperationMetadata>deleteInsightsConfigAsync(Stringname)

Delete a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
Stringname=
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString();
insightsConfigServiceClient.deleteInsightsConfigAsync(name).get();
}
Parameter
Name Description
name String

Required. Value for parent.

Returns
Type Description
OperationFuture<Empty,OperationMetadata>

deleteInsightsConfigCallable()

publicfinalUnaryCallable<DeleteInsightsConfigRequest,Operation>deleteInsightsConfigCallable()

Delete a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
DeleteInsightsConfigRequestrequest=
DeleteInsightsConfigRequest.newBuilder()
.setName(
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
ApiFuture<Operation>future=
insightsConfigServiceClient.deleteInsightsConfigCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
UnaryCallable<DeleteInsightsConfigRequest,Operation>

deleteInsightsConfigOperationCallable()

publicfinalOperationCallable<DeleteInsightsConfigRequest,Empty,OperationMetadata>deleteInsightsConfigOperationCallable()

Delete a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
DeleteInsightsConfigRequestrequest=
DeleteInsightsConfigRequest.newBuilder()
.setName(
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString())
.setRequestId("requestId693933066")
.setValidateOnly(true)
.setEtag("etag3123477")
.build();
OperationFuture<Empty,OperationMetadata>future=
insightsConfigServiceClient.deleteInsightsConfigOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns
Type Description
OperationCallable<DeleteInsightsConfigRequest,Empty,OperationMetadata>

getHttpJsonOperationsClient()

publicfinalOperationsClientgetHttpJsonOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getInsightsConfig(GetInsightsConfigRequest request)

publicfinalInsightsConfiggetInsightsConfig(GetInsightsConfigRequestrequest)

Gets details of a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
GetInsightsConfigRequestrequest=
GetInsightsConfigRequest.newBuilder()
.setName(
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString())
.build();
InsightsConfigresponse=insightsConfigServiceClient.getInsightsConfig(request);
}
Parameter
Name Description
request GetInsightsConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
InsightsConfig

getInsightsConfig(InsightsConfigName name)

publicfinalInsightsConfiggetInsightsConfig(InsightsConfigNamename)

Gets details of a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
InsightsConfigNamename=
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]");
InsightsConfigresponse=insightsConfigServiceClient.getInsightsConfig(name);
}
Parameter
Name Description
name InsightsConfigName

Required. Name of the resource.

Returns
Type Description
InsightsConfig

getInsightsConfig(String name)

publicfinalInsightsConfiggetInsightsConfig(Stringname)

Gets details of a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
Stringname=
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString();
InsightsConfigresponse=insightsConfigServiceClient.getInsightsConfig(name);
}
Parameter
Name Description
name String

Required. Name of the resource.

Returns
Type Description
InsightsConfig

getInsightsConfigCallable()

publicfinalUnaryCallable<GetInsightsConfigRequest,InsightsConfig>getInsightsConfigCallable()

Gets details of a single Insight.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
GetInsightsConfigRequestrequest=
GetInsightsConfigRequest.newBuilder()
.setName(
InsightsConfigName.of("[PROJECT]","[LOCATION]","[INSIGHTS_CONFIG]").toString())
.build();
ApiFuture<InsightsConfig>future=
insightsConfigServiceClient.getInsightsConfigCallable().futureCall(request);
// Do something.
InsightsConfigresponse=future.get();
}
Returns
Type Description
UnaryCallable<GetInsightsConfigRequest,InsightsConfig>

getLocation(GetLocationRequest request)

publicfinalLocationgetLocation(GetLocationRequestrequest)

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
Locationresponse=insightsConfigServiceClient.getLocation(request);
}
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

publicfinalUnaryCallable<GetLocationRequest,Location>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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
GetLocationRequestrequest=GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location>future=
insightsConfigServiceClient.getLocationCallable().futureCall(request);
// Do something.
Locationresponse=future.get();
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getOperationsClient()

publicfinalOperationsClientgetOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.

Returns
Type Description
OperationsClient

getSettings()

publicfinalInsightsConfigServiceSettingsgetSettings()
Returns
Type Description
InsightsConfigServiceSettings

getStub()

publicInsightsConfigServiceStubgetStub()
Returns
Type Description
InsightsConfigServiceStub

isShutdown()

publicbooleanisShutdown()
Returns
Type Description
boolean

isTerminated()

publicbooleanisTerminated()
Returns
Type Description
boolean

listInsightsConfigs(ListInsightsConfigsRequest request)

publicfinalInsightsConfigServiceClient.ListInsightsConfigsPagedResponselistInsightsConfigs(ListInsightsConfigsRequestrequest)

Lists InsightsConfigs in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListInsightsConfigsRequestrequest=
ListInsightsConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
for(InsightsConfigelement:
insightsConfigServiceClient.listInsightsConfigs(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request ListInsightsConfigsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
InsightsConfigServiceClient.ListInsightsConfigsPagedResponse

listInsightsConfigs(LocationName parent)

publicfinalInsightsConfigServiceClient.ListInsightsConfigsPagedResponselistInsightsConfigs(LocationNameparent)

Lists InsightsConfigs in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
LocationNameparent=LocationName.of("[PROJECT]","[LOCATION]");
for(InsightsConfigelement:
insightsConfigServiceClient.listInsightsConfigs(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent LocationName

Required. Parent value for ListInsightsConfigsRequest.

Returns
Type Description
InsightsConfigServiceClient.ListInsightsConfigsPagedResponse

listInsightsConfigs(String parent)

publicfinalInsightsConfigServiceClient.ListInsightsConfigsPagedResponselistInsightsConfigs(Stringparent)

Lists InsightsConfigs in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
Stringparent=LocationName.of("[PROJECT]","[LOCATION]").toString();
for(InsightsConfigelement:
insightsConfigServiceClient.listInsightsConfigs(parent).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
parent String

Required. Parent value for ListInsightsConfigsRequest.

Returns
Type Description
InsightsConfigServiceClient.ListInsightsConfigsPagedResponse

listInsightsConfigsCallable()

publicfinalUnaryCallable<ListInsightsConfigsRequest,ListInsightsConfigsResponse>listInsightsConfigsCallable()

Lists InsightsConfigs in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListInsightsConfigsRequestrequest=
ListInsightsConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
while(true){
ListInsightsConfigsResponseresponse=
insightsConfigServiceClient.listInsightsConfigsCallable().call(request);
for(InsightsConfigelement:response.getInsightsConfigsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<ListInsightsConfigsRequest,ListInsightsConfigsResponse>

listInsightsConfigsPagedCallable()

publicfinalUnaryCallable<ListInsightsConfigsRequest,InsightsConfigServiceClient.ListInsightsConfigsPagedResponse>listInsightsConfigsPagedCallable()

Lists InsightsConfigs in a given 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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListInsightsConfigsRequestrequest=
ListInsightsConfigsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]","[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<InsightsConfig>future=
insightsConfigServiceClient.listInsightsConfigsPagedCallable().futureCall(request);
// Do something.
for(InsightsConfigelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<ListInsightsConfigsRequest,ListInsightsConfigsPagedResponse>

listLocations(ListLocationsRequest request)

publicfinalInsightsConfigServiceClient.ListLocationsPagedResponselistLocations(ListLocationsRequestrequest)

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for(Locationelement:insightsConfigServiceClient.listLocations(request).iterateAll()){
// doThingsWith(element);
}
}
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
InsightsConfigServiceClient.ListLocationsPagedResponse

listLocationsCallable()

publicfinalUnaryCallable<ListLocationsRequest,ListLocationsResponse>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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while(true){
ListLocationsResponseresponse=
insightsConfigServiceClient.listLocationsCallable().call(request);
for(Locationelement:response.getLocationsList()){
// doThingsWith(element);
}
StringnextPageToken=response.getNextPageToken();
if(!Strings.isNullOrEmpty(nextPageToken)){
request=request.toBuilder().setPageToken(nextPageToken).build();
}else{
break;
}
}
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

publicfinalUnaryCallable<ListLocationsRequest,InsightsConfigServiceClient.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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
ListLocationsRequestrequest=
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location>future=
insightsConfigServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for(Locationelement:future.get().iterateAll()){
// doThingsWith(element);
}
}
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

updateInsightsConfigAsync(UpdateInsightsConfigRequest request)

publicfinalOperationFuture<InsightsConfig,OperationMetadata>updateInsightsConfigAsync(UpdateInsightsConfigRequestrequest)

Updates the parameters of a single InsightsConfig.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
UpdateInsightsConfigRequestrequest=
UpdateInsightsConfigRequest.newBuilder()
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
InsightsConfigresponse=
insightsConfigServiceClient.updateInsightsConfigAsync(request).get();
}
Parameter
Name Description
request UpdateInsightsConfigRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
OperationFuture<InsightsConfig,OperationMetadata>

updateInsightsConfigCallable()

publicfinalUnaryCallable<UpdateInsightsConfigRequest,Operation>updateInsightsConfigCallable()

Updates the parameters of a single InsightsConfig.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
UpdateInsightsConfigRequestrequest=
UpdateInsightsConfigRequest.newBuilder()
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
ApiFuture<Operation>future=
insightsConfigServiceClient.updateInsightsConfigCallable().futureCall(request);
// Do something.
Operationresponse=future.get();
}
Returns
Type Description
UnaryCallable<UpdateInsightsConfigRequest,Operation>

updateInsightsConfigOperationCallable()

publicfinalOperationCallable<UpdateInsightsConfigRequest,InsightsConfig,OperationMetadata>updateInsightsConfigOperationCallable()

Updates the parameters of a single InsightsConfig.

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(InsightsConfigServiceClientinsightsConfigServiceClient=
InsightsConfigServiceClient.create()){
UpdateInsightsConfigRequestrequest=
UpdateInsightsConfigRequest.newBuilder()
.setInsightsConfig(InsightsConfig.newBuilder().build())
.setRequestId("requestId693933066")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
OperationFuture<InsightsConfig,OperationMetadata>future=
insightsConfigServiceClient.updateInsightsConfigOperationCallable().futureCall(request);
// Do something.
InsightsConfigresponse=future.get();
}
Returns
Type Description
OperationCallable<UpdateInsightsConfigRequest,InsightsConfig,OperationMetadata>

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.