Class SchemaServiceClient
- java.lang.Object
-
- com.google.cloud.discoveryengine.v1.SchemaServiceClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class SchemaServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service for managing [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { SchemaName name = SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); Schema response = schemaServiceClient.getSchema(name); }
Note: close() needs to be called on the SchemaServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 SchemaServiceSettings 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 SchemaServiceSettings schemaServiceSettings = SchemaServiceSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
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 SchemaServiceSettings schemaServiceSettings = SchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
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 SchemaServiceSettings schemaServiceSettings = SchemaServiceSettings.newHttpJsonBuilder().build(); SchemaServiceClient schemaServiceClient = SchemaServiceClient.create(schemaServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaServiceClient.ListSchemasFixedSizeCollection
static class
SchemaServiceClient.ListSchemasPage
static class
SchemaServiceClient.ListSchemasPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
SchemaServiceClient(SchemaServiceSettings settings)
Constructs an instance of SchemaServiceClient, using the given settings.protected
SchemaServiceClient(SchemaServiceStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static SchemaServiceClient
create()
Constructs an instance of SchemaServiceClient with default settings.static SchemaServiceClient
create(SchemaServiceSettings settings)
Constructs an instance of SchemaServiceClient, using the given settings.static SchemaServiceClient
create(SchemaServiceStub stub)
Constructs an instance of SchemaServiceClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata>
createSchemaAsync(CreateSchemaRequest request)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata>
createSchemaAsync(DataStoreName parent, Schema schema, String schemaId)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata>
createSchemaAsync(String parent, Schema schema, String schemaId)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.UnaryCallable<CreateSchemaRequest,com.google.longrunning.Operation>
createSchemaCallable()
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.OperationCallable<CreateSchemaRequest,Schema,CreateSchemaMetadata>
createSchemaOperationCallable()
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata>
deleteSchemaAsync(DeleteSchemaRequest request)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata>
deleteSchemaAsync(SchemaName name)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata>
deleteSchemaAsync(String name)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.UnaryCallable<DeleteSchemaRequest,com.google.longrunning.Operation>
deleteSchemaCallable()
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.OperationCallable<DeleteSchemaRequest,com.google.protobuf.Empty,DeleteSchemaMetadata>
deleteSchemaOperationCallable()
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.Schema
getSchema(GetSchemaRequest request)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].Schema
getSchema(SchemaName name)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].Schema
getSchema(String name)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.UnaryCallable<GetSchemaRequest,Schema>
getSchemaCallable()
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].SchemaServiceSettings
getSettings()
SchemaServiceStub
getStub()
boolean
isShutdown()
boolean
isTerminated()
SchemaServiceClient.ListSchemasPagedResponse
listSchemas(DataStoreName parent)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.SchemaServiceClient.ListSchemasPagedResponse
listSchemas(ListSchemasRequest request)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.SchemaServiceClient.ListSchemasPagedResponse
listSchemas(String parent)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.com.google.api.gax.rpc.UnaryCallable<ListSchemasRequest,ListSchemasResponse>
listSchemasCallable()
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.com.google.api.gax.rpc.UnaryCallable<ListSchemasRequest,SchemaServiceClient.ListSchemasPagedResponse>
listSchemasPagedCallable()
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.void
shutdown()
void
shutdownNow()
com.google.api.gax.longrunning.OperationFuture<Schema,UpdateSchemaMetadata>
updateSchemaAsync(UpdateSchemaRequest request)
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.UnaryCallable<UpdateSchemaRequest,com.google.longrunning.Operation>
updateSchemaCallable()
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].com.google.api.gax.rpc.OperationCallable<UpdateSchemaRequest,Schema,UpdateSchemaMetadata>
updateSchemaOperationCallable()
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].
-
-
-
Constructor Detail
-
SchemaServiceClient
protected SchemaServiceClient(SchemaServiceSettings settings) throws IOException
Constructs an instance of SchemaServiceClient, 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
-
SchemaServiceClient
protected SchemaServiceClient(SchemaServiceStub stub)
-
-
Method Detail
-
create
public static final SchemaServiceClient create() throws IOException
Constructs an instance of SchemaServiceClient with default settings.- Throws:
IOException
-
create
public static final SchemaServiceClient create(SchemaServiceSettings settings) throws IOException
Constructs an instance of SchemaServiceClient, 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
public static final SchemaServiceClient create(SchemaServiceStub stub)
Constructs an instance of SchemaServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(SchemaServiceSettings).
-
getSettings
public final SchemaServiceSettings getSettings()
-
getStub
public SchemaServiceStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getSchema
public final Schema getSchema(SchemaName name)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { SchemaName name = SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); Schema response = schemaServiceClient.getSchema(name); }
- Parameters:
name
- Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getSchema
public final Schema getSchema(String name)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { String name = SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString(); Schema response = schemaServiceClient.getSchema(name); }
- Parameters:
name
- Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getSchema
public final Schema getSchema(GetSchemaRequest request)
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { GetSchemaRequest request = GetSchemaRequest.newBuilder() .setName( SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString()) .build(); Schema response = schemaServiceClient.getSchema(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getSchemaCallable
public final com.google.api.gax.rpc.UnaryCallable<GetSchemaRequest,Schema> getSchemaCallable()
Gets a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { GetSchemaRequest request = GetSchemaRequest.newBuilder() .setName( SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString()) .build(); ApiFuture<Schema> future = schemaServiceClient.getSchemaCallable().futureCall(request); // Do something. Schema response = future.get(); }
-
listSchemas
public final SchemaServiceClient.ListSchemasPagedResponse listSchemas(DataStoreName parent)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { DataStoreName parent = DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSchemas
public final SchemaServiceClient.ListSchemasPagedResponse listSchemas(String parent)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { String parent = DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString(); for (Schema element : schemaServiceClient.listSchemas(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSchemas
public final SchemaServiceClient.ListSchemasPagedResponse listSchemas(ListSchemasRequest request)
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { ListSchemasRequest request = ListSchemasRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Schema element : schemaServiceClient.listSchemas(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listSchemasPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListSchemasRequest,SchemaServiceClient.ListSchemasPagedResponse> listSchemasPagedCallable()
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { ListSchemasRequest request = ListSchemasRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Schema> future = schemaServiceClient.listSchemasPagedCallable().futureCall(request); // Do something. for (Schema element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listSchemasCallable
public final com.google.api.gax.rpc.UnaryCallable<ListSchemasRequest,ListSchemasResponse> listSchemasCallable()
Gets a list of [Schema][google.cloud.discoveryengine.v1.Schema]s.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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { ListSchemasRequest request = ListSchemasRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListSchemasResponse response = schemaServiceClient.listSchemasCallable().call(request); for (Schema element : response.getSchemasList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
createSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata> createSchemaAsync(DataStoreName parent, Schema schema, String schemaId)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { DataStoreName parent = DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]"); Schema schema = Schema.newBuilder().build(); String schemaId = "schemaId-697673060"; Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get(); }
- Parameters:
parent
- Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.schema
- Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create.schemaId
- Required. The ID to use for the [Schema][google.cloud.discoveryengine.v1.Schema], which will become the final component of the [Schema.name][google.cloud.discoveryengine.v1.Schema.name].This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata> createSchemaAsync(String parent, Schema schema, String schemaId)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { String parent = DataStoreName.ofProjectLocationDataStoreName("[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString(); Schema schema = Schema.newBuilder().build(); String schemaId = "schemaId-697673060"; Schema response = schemaServiceClient.createSchemaAsync(parent, schema, schemaId).get(); }
- Parameters:
parent
- Required. The parent data store resource name, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`.schema
- Required. The [Schema][google.cloud.discoveryengine.v1.Schema] to create.schemaId
- Required. The ID to use for the [Schema][google.cloud.discoveryengine.v1.Schema], which will become the final component of the [Schema.name][google.cloud.discoveryengine.v1.Schema.name].This field should conform to [RFC-1034](https://tools.ietf.org/html/rfc1034) standard with a length limit of 63 characters.
- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<Schema,CreateSchemaMetadata> createSchemaAsync(CreateSchemaRequest request)
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { CreateSchemaRequest request = CreateSchemaRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setSchema(Schema.newBuilder().build()) .setSchemaId("schemaId-697673060") .build(); Schema response = schemaServiceClient.createSchemaAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createSchemaOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateSchemaRequest,Schema,CreateSchemaMetadata> createSchemaOperationCallable()
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { CreateSchemaRequest request = CreateSchemaRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setSchema(Schema.newBuilder().build()) .setSchemaId("schemaId-697673060") .build(); OperationFuture<Schema, CreateSchemaMetadata> future = schemaServiceClient.createSchemaOperationCallable().futureCall(request); // Do something. Schema response = future.get(); }
-
createSchemaCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateSchemaRequest,com.google.longrunning.Operation> createSchemaCallable()
Creates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { CreateSchemaRequest request = CreateSchemaRequest.newBuilder() .setParent( DataStoreName.ofProjectLocationDataStoreName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]") .toString()) .setSchema(Schema.newBuilder().build()) .setSchemaId("schemaId-697673060") .build(); ApiFuture<Operation> future = schemaServiceClient.createSchemaCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
updateSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<Schema,UpdateSchemaMetadata> updateSchemaAsync(UpdateSchemaRequest request)
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { UpdateSchemaRequest request = UpdateSchemaRequest.newBuilder() .setSchema(Schema.newBuilder().build()) .setAllowMissing(true) .build(); Schema response = schemaServiceClient.updateSchemaAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateSchemaOperationCallable
public final com.google.api.gax.rpc.OperationCallable<UpdateSchemaRequest,Schema,UpdateSchemaMetadata> updateSchemaOperationCallable()
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { UpdateSchemaRequest request = UpdateSchemaRequest.newBuilder() .setSchema(Schema.newBuilder().build()) .setAllowMissing(true) .build(); OperationFuture<Schema, UpdateSchemaMetadata> future = schemaServiceClient.updateSchemaOperationCallable().futureCall(request); // Do something. Schema response = future.get(); }
-
updateSchemaCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateSchemaRequest,com.google.longrunning.Operation> updateSchemaCallable()
Updates a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { UpdateSchemaRequest request = UpdateSchemaRequest.newBuilder() .setSchema(Schema.newBuilder().build()) .setAllowMissing(true) .build(); ApiFuture<Operation> future = schemaServiceClient.updateSchemaCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
deleteSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata> deleteSchemaAsync(SchemaName name)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { SchemaName name = SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]"); schemaServiceClient.deleteSchemaAsync(name).get(); }
- Parameters:
name
- Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata> deleteSchemaAsync(String name)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { String name = SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString(); schemaServiceClient.deleteSchemaAsync(name).get(); }
- Parameters:
name
- Required. The full resource name of the schema, in the format of `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/schemas/{schema}`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSchemaAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteSchemaMetadata> deleteSchemaAsync(DeleteSchemaRequest request)
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder() .setName( SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString()) .build(); schemaServiceClient.deleteSchemaAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteSchemaOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteSchemaRequest,com.google.protobuf.Empty,DeleteSchemaMetadata> deleteSchemaOperationCallable()
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder() .setName( SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString()) .build(); OperationFuture<Empty, DeleteSchemaMetadata> future = schemaServiceClient.deleteSchemaOperationCallable().futureCall(request); // Do something. future.get(); }
-
deleteSchemaCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteSchemaRequest,com.google.longrunning.Operation> deleteSchemaCallable()
Deletes a [Schema][google.cloud.discoveryengine.v1.Schema].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 (SchemaServiceClient schemaServiceClient = SchemaServiceClient.create()) { DeleteSchemaRequest request = DeleteSchemaRequest.newBuilder() .setName( SchemaName.ofProjectLocationDataStoreSchemaName( "[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SCHEMA]") .toString()) .build(); ApiFuture<Operation> future = schemaServiceClient.deleteSchemaCallable().futureCall(request); // Do something. future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-