Class DocumentSchemaServiceClient (0.32.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
MethodDescriptionMethod 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
TypeDescription
DocumentSchemaServiceClient
Exceptions
TypeDescription
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
NameDescription
settingsDocumentSchemaServiceSettings
Returns
TypeDescription
DocumentSchemaServiceClient
Exceptions
TypeDescription
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
NameDescription
stubDocumentSchemaServiceStub
Returns
TypeDescription
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
NameDescription
settingsDocumentSchemaServiceSettings

DocumentSchemaServiceClient(DocumentSchemaServiceStub stub)

protected DocumentSchemaServiceClient(DocumentSchemaServiceStub stub)
Parameter
NameDescription
stubDocumentSchemaServiceStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
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
NameDescription
requestCreateDocumentSchemaRequest

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

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. The parent name.

documentSchemaDocumentSchema

Required. The document schema to create.

Returns
TypeDescription
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
NameDescription
parentString

Required. The parent name.

documentSchemaDocumentSchema

Required. The document schema to create.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestDeleteDocumentSchemaRequest

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
NameDescription
nameDocumentSchemaName

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
NameDescription
nameString

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
TypeDescription
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
NameDescription
nameDocumentSchemaName

Required. The name of the document schema to retrieve.

Returns
TypeDescription
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
NameDescription
requestGetDocumentSchemaRequest

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

Returns
TypeDescription
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
NameDescription
nameString

Required. The name of the document schema to retrieve.

Returns
TypeDescription
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
TypeDescription
UnaryCallable<GetDocumentSchemaRequest,DocumentSchema>

getSettings()

public final DocumentSchemaServiceSettings getSettings()
Returns
TypeDescription
DocumentSchemaServiceSettings

getStub()

public DocumentSchemaServiceStub getStub()
Returns
TypeDescription
DocumentSchemaServiceStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
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
NameDescription
requestListDocumentSchemasRequest

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

Returns
TypeDescription
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
NameDescription
parentLocationName

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

Returns
TypeDescription
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
NameDescription
parentString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
nameDocumentSchemaName

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

documentSchemaDocumentSchema

Required. The document schema to update with.

Returns
TypeDescription
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
NameDescription
requestUpdateDocumentSchemaRequest

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

Returns
TypeDescription
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
NameDescription
nameString

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

documentSchemaDocumentSchema

Required. The document schema to update with.

Returns
TypeDescription
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
TypeDescription
UnaryCallable<UpdateDocumentSchemaRequest,DocumentSchema>