Class DocumentSchemaServiceClient (0.51.0)

GitHub RepositoryProduct Reference

Service Description: This service lets you manage document schema.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
   DocumentSchema response =
       documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
 }
 

Note: close() needs to be called on the DocumentSchemaServiceClient 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

CreateDocumentSchema

Creates a document schema.

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

  • createDocumentSchema(CreateDocumentSchemaRequest request)

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

  • createDocumentSchema(LocationName parent, DocumentSchema documentSchema)

  • createDocumentSchema(String parent, DocumentSchema documentSchema)

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

  • createDocumentSchemaCallable()

UpdateDocumentSchema

Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

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

  • updateDocumentSchema(UpdateDocumentSchemaRequest request)

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

  • updateDocumentSchema(DocumentSchemaName name, DocumentSchema documentSchema)

  • updateDocumentSchema(String name, DocumentSchema documentSchema)

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

  • updateDocumentSchemaCallable()

GetDocumentSchema

Gets a document schema. Returns NOT_FOUND if the document schema does not exist.

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

  • getDocumentSchema(GetDocumentSchemaRequest request)

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

  • getDocumentSchema(DocumentSchemaName name)

  • getDocumentSchema(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.

  • getDocumentSchemaCallable()

DeleteDocumentSchema

Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.

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

  • deleteDocumentSchema(DeleteDocumentSchemaRequest request)

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

  • deleteDocumentSchema(DocumentSchemaName name)

  • deleteDocumentSchema(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.

  • deleteDocumentSchemaCallable()

ListDocumentSchemas

Lists document schemas.

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

  • listDocumentSchemas(ListDocumentSchemasRequest request)

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

  • listDocumentSchemas(LocationName parent)

  • listDocumentSchemas(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.

  • listDocumentSchemasPagedCallable()

  • listDocumentSchemasCallable()

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 DocumentSchemaServiceSettings 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
 DocumentSchemaServiceSettings documentSchemaServiceSettings =
     DocumentSchemaServiceSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
 

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
 DocumentSchemaServiceSettings documentSchemaServiceSettings =
     DocumentSchemaServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
 DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
 

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
 DocumentSchemaServiceSettings documentSchemaServiceSettings =
     DocumentSchemaServiceSettings.newHttpJsonBuilder().build();
 DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create(documentSchemaServiceSettings);
 

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

Inheritance

java.lang.Object > DocumentSchemaServiceClient

Static Methods

create()

public static final DocumentSchemaServiceClient create()

Constructs an instance of DocumentSchemaServiceClient with default settings.

Returns
Type Description
DocumentSchemaServiceClient
Exceptions
Type Description
IOException

create(DocumentSchemaServiceSettings settings)

public static final DocumentSchemaServiceClient create(DocumentSchemaServiceSettings settings)

Constructs an instance of DocumentSchemaServiceClient, 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 DocumentSchemaServiceSettings
Returns
Type Description
DocumentSchemaServiceClient
Exceptions
Type Description
IOException

create(DocumentSchemaServiceStub stub)

public static final DocumentSchemaServiceClient create(DocumentSchemaServiceStub stub)

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

Parameter
Name Description
stub DocumentSchemaServiceStub
Returns
Type Description
DocumentSchemaServiceClient

Constructors

DocumentSchemaServiceClient(DocumentSchemaServiceSettings settings)

protected DocumentSchemaServiceClient(DocumentSchemaServiceSettings settings)

Constructs an instance of DocumentSchemaServiceClient, 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 DocumentSchemaServiceSettings

DocumentSchemaServiceClient(DocumentSchemaServiceStub stub)

protected DocumentSchemaServiceClient(DocumentSchemaServiceStub stub)
Parameter
Name Description
stub DocumentSchemaServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
Name Description
duration long
unit TimeUnit
Returns
Type Description
boolean
Exceptions
Type Description
InterruptedException

close()

public final void close()

createDocumentSchema(CreateDocumentSchemaRequest request)

public final DocumentSchema createDocumentSchema(CreateDocumentSchemaRequest request)

Creates a document 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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   CreateDocumentSchemaRequest request =
       CreateDocumentSchemaRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDocumentSchema(DocumentSchema.newBuilder().build())
           .build();
   DocumentSchema response = documentSchemaServiceClient.createDocumentSchema(request);
 }
 
Parameter
Name Description
request CreateDocumentSchemaRequest

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

Returns
Type Description
DocumentSchema

createDocumentSchema(LocationName parent, DocumentSchema documentSchema)

public final DocumentSchema createDocumentSchema(LocationName parent, DocumentSchema documentSchema)

Creates a document 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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
   DocumentSchema response =
       documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
 }
 
Parameters
Name Description
parent LocationName

Required. The parent name.

documentSchema DocumentSchema

Required. The document schema to create.

Returns
Type Description
DocumentSchema

createDocumentSchema(String parent, DocumentSchema documentSchema)

public final DocumentSchema createDocumentSchema(String parent, DocumentSchema documentSchema)

Creates a document 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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
   DocumentSchema response =
       documentSchemaServiceClient.createDocumentSchema(parent, documentSchema);
 }
 
Parameters
Name Description
parent String

Required. The parent name.

documentSchema DocumentSchema

Required. The document schema to create.

Returns
Type Description
DocumentSchema

createDocumentSchemaCallable()

public final UnaryCallable<CreateDocumentSchemaRequest,DocumentSchema> createDocumentSchemaCallable()

Creates a document 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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   CreateDocumentSchemaRequest request =
       CreateDocumentSchemaRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setDocumentSchema(DocumentSchema.newBuilder().build())
           .build();
   ApiFuture<DocumentSchema> future =
       documentSchemaServiceClient.createDocumentSchemaCallable().futureCall(request);
   // Do something.
   DocumentSchema response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateDocumentSchemaRequest,DocumentSchema>

deleteDocumentSchema(DeleteDocumentSchemaRequest request)

public final void deleteDocumentSchema(DeleteDocumentSchemaRequest request)

Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   DeleteDocumentSchemaRequest request =
       DeleteDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .build();
   documentSchemaServiceClient.deleteDocumentSchema(request);
 }
 
Parameter
Name Description
request DeleteDocumentSchemaRequest

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

deleteDocumentSchema(DocumentSchemaName name)

public final void deleteDocumentSchema(DocumentSchemaName name)

Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   DocumentSchemaName name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
   documentSchemaServiceClient.deleteDocumentSchema(name);
 }
 
Parameter
Name Description
name DocumentSchemaName

Required. The name of the document schema to delete.

deleteDocumentSchema(String name)

public final void deleteDocumentSchema(String name)

Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   String name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
   documentSchemaServiceClient.deleteDocumentSchema(name);
 }
 
Parameter
Name Description
name String

Required. The name of the document schema to delete.

deleteDocumentSchemaCallable()

public final UnaryCallable<DeleteDocumentSchemaRequest,Empty> deleteDocumentSchemaCallable()

Deletes a document schema. Returns NOT_FOUND if the document schema does not exist. Returns BAD_REQUEST if the document schema has documents depending on it.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   DeleteDocumentSchemaRequest request =
       DeleteDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .build();
   ApiFuture<Empty> future =
       documentSchemaServiceClient.deleteDocumentSchemaCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteDocumentSchemaRequest,Empty>

getDocumentSchema(DocumentSchemaName name)

public final DocumentSchema getDocumentSchema(DocumentSchemaName name)

Gets a document schema. Returns NOT_FOUND if the document schema does not exist.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   DocumentSchemaName name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
   DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(name);
 }
 
Parameter
Name Description
name DocumentSchemaName

Required. The name of the document schema to retrieve.

Returns
Type Description
DocumentSchema

getDocumentSchema(GetDocumentSchemaRequest request)

public final DocumentSchema getDocumentSchema(GetDocumentSchemaRequest request)

Gets a document schema. Returns NOT_FOUND if the document schema does not exist.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   GetDocumentSchemaRequest request =
       GetDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .build();
   DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(request);
 }
 
Parameter
Name Description
request GetDocumentSchemaRequest

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

Returns
Type Description
DocumentSchema

getDocumentSchema(String name)

public final DocumentSchema getDocumentSchema(String name)

Gets a document schema. Returns NOT_FOUND if the document schema does not exist.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   String name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
   DocumentSchema response = documentSchemaServiceClient.getDocumentSchema(name);
 }
 
Parameter
Name Description
name String

Required. The name of the document schema to retrieve.

Returns
Type Description
DocumentSchema

getDocumentSchemaCallable()

public final UnaryCallable<GetDocumentSchemaRequest,DocumentSchema> getDocumentSchemaCallable()

Gets a document schema. Returns NOT_FOUND if the document schema does not exist.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   GetDocumentSchemaRequest request =
       GetDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .build();
   ApiFuture<DocumentSchema> future =
       documentSchemaServiceClient.getDocumentSchemaCallable().futureCall(request);
   // Do something.
   DocumentSchema response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetDocumentSchemaRequest,DocumentSchema>

getSettings()

public final DocumentSchemaServiceSettings getSettings()
Returns
Type Description
DocumentSchemaServiceSettings

getStub()

public DocumentSchemaServiceStub getStub()
Returns
Type Description
DocumentSchemaServiceStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listDocumentSchemas(ListDocumentSchemasRequest request)

public final DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse listDocumentSchemas(ListDocumentSchemasRequest request)

Lists document schemas.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   ListDocumentSchemasRequest request =
       ListDocumentSchemasRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (DocumentSchema element :
       documentSchemaServiceClient.listDocumentSchemas(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListDocumentSchemasRequest

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

Returns
Type Description
DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse

listDocumentSchemas(LocationName parent)

public final DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse listDocumentSchemas(LocationName parent)

Lists document schemas.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   for (DocumentSchema element :
       documentSchemaServiceClient.listDocumentSchemas(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent LocationName

Required. The parent, which owns this collection of document schemas. Format: projects/{project_number}/locations/{location}.

Returns
Type Description
DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse

listDocumentSchemas(String parent)

public final DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse listDocumentSchemas(String parent)

Lists document schemas.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
   for (DocumentSchema element :
       documentSchemaServiceClient.listDocumentSchemas(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The parent, which owns this collection of document schemas. Format: projects/{project_number}/locations/{location}.

Returns
Type Description
DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse

listDocumentSchemasCallable()

public final UnaryCallable<ListDocumentSchemasRequest,ListDocumentSchemasResponse> listDocumentSchemasCallable()

Lists document schemas.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   ListDocumentSchemasRequest request =
       ListDocumentSchemasRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListDocumentSchemasResponse response =
         documentSchemaServiceClient.listDocumentSchemasCallable().call(request);
     for (DocumentSchema element : response.getDocumentSchemasList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListDocumentSchemasRequest,ListDocumentSchemasResponse>

listDocumentSchemasPagedCallable()

public final UnaryCallable<ListDocumentSchemasRequest,DocumentSchemaServiceClient.ListDocumentSchemasPagedResponse> listDocumentSchemasPagedCallable()

Lists document schemas.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   ListDocumentSchemasRequest request =
       ListDocumentSchemasRequest.newBuilder()
           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<DocumentSchema> future =
       documentSchemaServiceClient.listDocumentSchemasPagedCallable().futureCall(request);
   // Do something.
   for (DocumentSchema element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListDocumentSchemasRequest,ListDocumentSchemasPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateDocumentSchema(DocumentSchemaName name, DocumentSchema documentSchema)

public final DocumentSchema updateDocumentSchema(DocumentSchemaName name, DocumentSchema documentSchema)

Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   DocumentSchemaName name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]");
   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
   DocumentSchema response =
       documentSchemaServiceClient.updateDocumentSchema(name, documentSchema);
 }
 
Parameters
Name Description
name DocumentSchemaName

Required. The name of the document schema to update. Format: projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.

documentSchema DocumentSchema

Required. The document schema to update with.

Returns
Type Description
DocumentSchema

updateDocumentSchema(UpdateDocumentSchemaRequest request)

public final DocumentSchema updateDocumentSchema(UpdateDocumentSchemaRequest request)

Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   UpdateDocumentSchemaRequest request =
       UpdateDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .setDocumentSchema(DocumentSchema.newBuilder().build())
           .build();
   DocumentSchema response = documentSchemaServiceClient.updateDocumentSchema(request);
 }
 
Parameter
Name Description
request UpdateDocumentSchemaRequest

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

Returns
Type Description
DocumentSchema

updateDocumentSchema(String name, DocumentSchema documentSchema)

public final DocumentSchema updateDocumentSchema(String name, DocumentSchema documentSchema)

Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   String name =
       DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString();
   DocumentSchema documentSchema = DocumentSchema.newBuilder().build();
   DocumentSchema response =
       documentSchemaServiceClient.updateDocumentSchema(name, documentSchema);
 }
 
Parameters
Name Description
name String

Required. The name of the document schema to update. Format: projects/{project_number}/locations/{location}/documentSchemas/{document_schema_id}.

documentSchema DocumentSchema

Required. The document schema to update with.

Returns
Type Description
DocumentSchema

updateDocumentSchemaCallable()

public final UnaryCallable<UpdateDocumentSchemaRequest,DocumentSchema> updateDocumentSchemaCallable()

Updates a Document Schema. Returns INVALID_ARGUMENT if the name of the Document Schema is non-empty and does not equal the existing name. Supports only appending new properties, adding new ENUM possible values, and updating the EnumTypeOptions.validation_check_disabled flag for ENUM possible values. Updating existing properties will result into INVALID_ARGUMENT.

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 (DocumentSchemaServiceClient documentSchemaServiceClient =
     DocumentSchemaServiceClient.create()) {
   UpdateDocumentSchemaRequest request =
       UpdateDocumentSchemaRequest.newBuilder()
           .setName(
               DocumentSchemaName.of("[PROJECT]", "[LOCATION]", "[DOCUMENT_SCHEMA]").toString())
           .setDocumentSchema(DocumentSchema.newBuilder().build())
           .build();
   ApiFuture<DocumentSchema> future =
       documentSchemaServiceClient.updateDocumentSchemaCallable().futureCall(request);
   // Do something.
   DocumentSchema response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateDocumentSchemaRequest,DocumentSchema>