@Generated(value="by gapic-generator-java") public class ValidationHelperV1Client extends Object implements com.google.api.gax.core.BackgroundResource
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 for illustrative purposes only.
// It may require modifications to work in your environment.
try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) {
Service.ValidateAttestationOccurrenceRequest request =
Service.ValidateAttestationOccurrenceRequest.newBuilder()
.setAttestor("attestor542920680")
.setAttestation(AttestationOccurrence.newBuilder().build())
.setOccurrenceNote("occurrenceNote1722072419")
.setOccurrenceResourceUri("occurrenceResourceUri1001424877")
.build();
Service.ValidateAttestationOccurrenceResponse response =
validationHelperV1Client.validateAttestationOccurrence(request);
}
Note: close() needs to be called on the ValidationHelperV1Client 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:
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 ValidationHelperV1Settings to create(). For example:
To customize credentials:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
ValidationHelperV1Settings validationHelperV1Settings =
ValidationHelperV1Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ValidationHelperV1Client validationHelperV1Client =
ValidationHelperV1Client.create(validationHelperV1Settings);
To customize the endpoint:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
ValidationHelperV1Settings validationHelperV1Settings =
ValidationHelperV1Settings.newBuilder().setEndpoint(myEndpoint).build();
ValidationHelperV1Client validationHelperV1Client =
ValidationHelperV1Client.create(validationHelperV1Settings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
ValidationHelperV1Settings validationHelperV1Settings =
ValidationHelperV1Settings.newBuilder()
.setTransportChannelProvider(
ValidationHelperV1Settings.defaultHttpJsonTransportProviderBuilder().build())
.build();
ValidationHelperV1Client validationHelperV1Client =
ValidationHelperV1Client.create(validationHelperV1Settings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
ValidationHelperV1Client(ValidationHelperV1Settings settings)
Constructs an instance of ValidationHelperV1Client, using the given settings.
|
protected |
ValidationHelperV1Client(ValidationHelperV1Stub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ValidationHelperV1Client |
create()
Constructs an instance of ValidationHelperV1Client with default settings.
|
static ValidationHelperV1Client |
create(ValidationHelperV1Settings settings)
Constructs an instance of ValidationHelperV1Client, using the given settings.
|
static ValidationHelperV1Client |
create(ValidationHelperV1Stub stub)
Constructs an instance of ValidationHelperV1Client, using the given stub for making calls.
|
ValidationHelperV1Settings |
getSettings() |
ValidationHelperV1Stub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
void |
shutdownNow() |
Service.ValidateAttestationOccurrenceResponse |
validateAttestationOccurrence(Service.ValidateAttestationOccurrenceRequest request)
Returns whether the given Attestation for the given image URI was signed by the given Attestor
|
com.google.api.gax.rpc.UnaryCallable<Service.ValidateAttestationOccurrenceRequest,Service.ValidateAttestationOccurrenceResponse> |
validateAttestationOccurrenceCallable()
Returns whether the given Attestation for the given image URI was signed by the given Attestor
|
protected ValidationHelperV1Client(ValidationHelperV1Settings settings) throws IOException
IOExceptionprotected ValidationHelperV1Client(ValidationHelperV1Stub stub)
public static final ValidationHelperV1Client create() throws IOException
IOExceptionpublic static final ValidationHelperV1Client create(ValidationHelperV1Settings settings) throws IOException
IOExceptionpublic static final ValidationHelperV1Client create(ValidationHelperV1Stub stub)
public final ValidationHelperV1Settings getSettings()
public ValidationHelperV1Stub getStub()
public final Service.ValidateAttestationOccurrenceResponse validateAttestationOccurrence(Service.ValidateAttestationOccurrenceRequest request)
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) {
Service.ValidateAttestationOccurrenceRequest request =
Service.ValidateAttestationOccurrenceRequest.newBuilder()
.setAttestor("attestor542920680")
.setAttestation(AttestationOccurrence.newBuilder().build())
.setOccurrenceNote("occurrenceNote1722072419")
.setOccurrenceResourceUri("occurrenceResourceUri1001424877")
.build();
Service.ValidateAttestationOccurrenceResponse response =
validationHelperV1Client.validateAttestationOccurrence(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<Service.ValidateAttestationOccurrenceRequest,Service.ValidateAttestationOccurrenceResponse> validateAttestationOccurrenceCallable()
Sample code:
// This snippet has been automatically generated for illustrative purposes only.
// It may require modifications to work in your environment.
try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) {
Service.ValidateAttestationOccurrenceRequest request =
Service.ValidateAttestationOccurrenceRequest.newBuilder()
.setAttestor("attestor542920680")
.setAttestation(AttestationOccurrence.newBuilder().build())
.setOccurrenceNote("occurrenceNote1722072419")
.setOccurrenceResourceUri("occurrenceResourceUri1001424877")
.build();
ApiFuture<Service.ValidateAttestationOccurrenceResponse> future =
validationHelperV1Client.validateAttestationOccurrenceCallable().futureCall(request);
// Do something.
Service.ValidateAttestationOccurrenceResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2022 Google LLC. All rights reserved.