Class ValidationHelperV1Client (1.52.0)

Service Description: BinAuthz Attestor verification

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(ValidationHelperV1ClientvalidationHelperV1Client=ValidationHelperV1Client.create()){
Service.ValidateAttestationOccurrenceRequestrequest=
Service.ValidateAttestationOccurrenceRequest.newBuilder()
.setAttestor("attestor542920680")
.setAttestation(AttestationOccurrence.newBuilder().build())
.setOccurrenceNote("occurrenceNote1722072419")
.setOccurrenceResourceUri("occurrenceResourceUri1001424877")
.build();
Service.ValidateAttestationOccurrenceResponseresponse=
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().

Methods
Method Description Method Variants

ValidateAttestationOccurrence

Returns whether the given Attestation for the given image URI was signed by the given Attestor

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

  • validateAttestationOccurrence(Service.ValidateAttestationOccurrenceRequest request)

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

  • validateAttestationOccurrenceCallable()

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 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
ValidationHelperV1SettingsvalidationHelperV1Settings=
ValidationHelperV1Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ValidationHelperV1ClientvalidationHelperV1Client=
ValidationHelperV1Client.create(validationHelperV1Settings);

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
ValidationHelperV1SettingsvalidationHelperV1Settings=
ValidationHelperV1Settings.newBuilder().setEndpoint(myEndpoint).build();
ValidationHelperV1ClientvalidationHelperV1Client=
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 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
ValidationHelperV1SettingsvalidationHelperV1Settings=
ValidationHelperV1Settings.newHttpJsonBuilder().build();
ValidationHelperV1ClientvalidationHelperV1Client=
ValidationHelperV1Client.create(validationHelperV1Settings);

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

Inheritance

java.lang.Object > ValidationHelperV1Client

Static Methods

create()

publicstaticfinalValidationHelperV1Clientcreate()

Constructs an instance of ValidationHelperV1Client with default settings.

Returns
Type Description
ValidationHelperV1Client
Exceptions
Type Description
IOException

create(ValidationHelperV1Settings settings)

publicstaticfinalValidationHelperV1Clientcreate(ValidationHelperV1Settingssettings)

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

create(ValidationHelperV1Stub stub)

publicstaticfinalValidationHelperV1Clientcreate(ValidationHelperV1Stubstub)

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

Parameter
Name Description
stub ValidationHelperV1Stub
Returns
Type Description
ValidationHelperV1Client

Constructors

ValidationHelperV1Client(ValidationHelperV1Settings settings)

protectedValidationHelperV1Client(ValidationHelperV1Settingssettings)

Constructs an instance of ValidationHelperV1Client, 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 ValidationHelperV1Settings

ValidationHelperV1Client(ValidationHelperV1Stub stub)

protectedValidationHelperV1Client(ValidationHelperV1Stubstub)
Parameter
Name Description
stub ValidationHelperV1Stub

Methods

awaitTermination(long duration, TimeUnit unit)

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

close()

publicfinalvoidclose()

getSettings()

publicfinalValidationHelperV1SettingsgetSettings()
Returns
Type Description
ValidationHelperV1Settings

getStub()

publicValidationHelperV1StubgetStub()
Returns
Type Description
ValidationHelperV1Stub

isShutdown()

publicbooleanisShutdown()
Returns
Type Description
boolean

isTerminated()

publicbooleanisTerminated()
Returns
Type Description
boolean

shutdown()

publicvoidshutdown()

shutdownNow()

publicvoidshutdownNow()

validateAttestationOccurrence(Service.ValidateAttestationOccurrenceRequest request)

publicfinalService.ValidateAttestationOccurrenceResponsevalidateAttestationOccurrence(Service.ValidateAttestationOccurrenceRequestrequest)

Returns whether the given Attestation for the given image URI was signed by the given Attestor

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(ValidationHelperV1ClientvalidationHelperV1Client=ValidationHelperV1Client.create()){
Service.ValidateAttestationOccurrenceRequestrequest=
Service.ValidateAttestationOccurrenceRequest.newBuilder()
.setAttestor("attestor542920680")
.setAttestation(AttestationOccurrence.newBuilder().build())
.setOccurrenceNote("occurrenceNote1722072419")
.setOccurrenceResourceUri("occurrenceResourceUri1001424877")
.build();
Service.ValidateAttestationOccurrenceResponseresponse=
validationHelperV1Client.validateAttestationOccurrence(request);
}
Parameter
Name Description
request Service.ValidateAttestationOccurrenceRequest

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

Returns
Type Description
Service.ValidateAttestationOccurrenceResponse

validateAttestationOccurrenceCallable()

publicfinalUnaryCallable<Service.ValidateAttestationOccurrenceRequest,Service.ValidateAttestationOccurrenceResponse>validateAttestationOccurrenceCallable()

Returns whether the given Attestation for the given image URI was signed by the given Attestor

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(ValidationHelperV1ClientvalidationHelperV1Client=ValidationHelperV1Client.create()){
Service.ValidateAttestationOccurrenceRequestrequest=
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.ValidateAttestationOccurrenceResponseresponse=future.get();
}
Returns
Type Description
UnaryCallable<ValidateAttestationOccurrenceRequest,ValidateAttestationOccurrenceResponse>

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

Last updated 2025年11月19日 UTC.