This API implements a REST model with the following objects: + * + *
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: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * PolicyName name = PolicyName.ofProjectName("[PROJECT]"); + * Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name); + * } + * }+ * + *
Note: close() needs to be called on the BinauthzManagementServiceV1Client 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 + * BinauthzManagementServiceV1Settings to create(). For example: + * + *
To customize credentials: + * + *
{@code + * BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + * BinauthzManagementServiceV1Settings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + * BinauthzManagementServiceV1Settings.newBuilder().setEndpoint(myEndpoint).build(); + * BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create(binauthzManagementServiceV1Settings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class BinauthzManagementServiceV1Client implements BackgroundResource { + private final BinauthzManagementServiceV1Settings settings; + private final BinauthzManagementServiceV1Stub stub; + + /** Constructs an instance of BinauthzManagementServiceV1Client with default settings. */ + public static final BinauthzManagementServiceV1Client create() throws IOException { + return create(BinauthzManagementServiceV1Settings.newBuilder().build()); + } + + /** + * Constructs an instance of BinauthzManagementServiceV1Client, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final BinauthzManagementServiceV1Client create( + BinauthzManagementServiceV1Settings settings) throws IOException { + return new BinauthzManagementServiceV1Client(settings); + } + + /** + * Constructs an instance of BinauthzManagementServiceV1Client, using the given stub for making + * calls. This is for advanced usage - prefer using create(BinauthzManagementServiceV1Settings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final BinauthzManagementServiceV1Client create( + BinauthzManagementServiceV1Stub stub) { + return new BinauthzManagementServiceV1Client(stub); + } + + /** + * Constructs an instance of BinauthzManagementServiceV1Client, 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. + */ + protected BinauthzManagementServiceV1Client(BinauthzManagementServiceV1Settings settings) + throws IOException { + this.settings = settings; + this.stub = ((BinauthzManagementServiceV1StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected BinauthzManagementServiceV1Client(BinauthzManagementServiceV1Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final BinauthzManagementServiceV1Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public BinauthzManagementServiceV1Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * A [policy][google.cloud.binaryauthorization.v1.Policy] specifies the + * [attestors][google.cloud.binaryauthorization.v1.Attestor] that must attest to a container + * image, before the project is allowed to deploy that image. There is at most one policy per + * project. All image admission requests are permitted if a project has no policy. + * + *
Gets the [policy][google.cloud.binaryauthorization.v1.Policy] for this project. Returns a + * default [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * PolicyName name = PolicyName.ofProjectName("[PROJECT]"); + * Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name); + * } + * }+ * + * @param name Required. The resource name of the + * [policy][google.cloud.binaryauthorization.v1.Policy] to retrieve, in the format + * `projects/*/policy`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Policy getPolicy(PolicyName name) { + Service.GetPolicyRequest request = + Service.GetPolicyRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * A [policy][google.cloud.binaryauthorization.v1.Policy] specifies the + * [attestors][google.cloud.binaryauthorization.v1.Attestor] that must attest to a container + * image, before the project is allowed to deploy that image. There is at most one policy per + * project. All image admission requests are permitted if a project has no policy. + * + *
Gets the [policy][google.cloud.binaryauthorization.v1.Policy] for this project. Returns a + * default [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * String name = PolicyName.ofProjectName("[PROJECT]").toString(); + * Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name); + * } + * }+ * + * @param name Required. The resource name of the + * [policy][google.cloud.binaryauthorization.v1.Policy] to retrieve, in the format + * `projects/*/policy`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Policy getPolicy(String name) { + Service.GetPolicyRequest request = Service.GetPolicyRequest.newBuilder().setName(name).build(); + return getPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * A [policy][google.cloud.binaryauthorization.v1.Policy] specifies the + * [attestors][google.cloud.binaryauthorization.v1.Attestor] that must attest to a container + * image, before the project is allowed to deploy that image. There is at most one policy per + * project. All image admission requests are permitted if a project has no policy. + * + *
Gets the [policy][google.cloud.binaryauthorization.v1.Policy] for this project. Returns a + * default [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.GetPolicyRequest request = + * Service.GetPolicyRequest.newBuilder() + * .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + * .build(); + * Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Policy getPolicy(Service.GetPolicyRequest request) { + return getPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * A [policy][google.cloud.binaryauthorization.v1.Policy] specifies the + * [attestors][google.cloud.binaryauthorization.v1.Attestor] that must attest to a container + * image, before the project is allowed to deploy that image. There is at most one policy per + * project. All image admission requests are permitted if a project has no policy. + * + *
Gets the [policy][google.cloud.binaryauthorization.v1.Policy] for this project. Returns a + * default [policy][google.cloud.binaryauthorization.v1.Policy] if the project does not have one. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.GetPolicyRequest request = + * Service.GetPolicyRequest.newBuilder() + * .setName(PolicyName.ofProjectName("[PROJECT]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.getPolicyCallable().futureCall(request); + * // Do something. + * Resources.Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Resources.Policy policy = Resources.Policy.newBuilder().build(); + * Resources.Policy response = binauthzManagementServiceV1Client.updatePolicy(policy); + * } + * }+ * + * @param policy Required. A new or updated [policy][google.cloud.binaryauthorization.v1.Policy] + * value. The service will overwrite the [policy + * name][google.cloud.binaryauthorization.v1.Policy.name] field with the resource name in the + * request URL, in the format `projects/*/policy`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Policy updatePolicy(Resources.Policy policy) { + Service.UpdatePolicyRequest request = + Service.UpdatePolicyRequest.newBuilder().setPolicy(policy).build(); + return updatePolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1.Policy], and + * returns a copy of the new [policy][google.cloud.binaryauthorization.v1.Policy]. A policy is + * always updated as a whole, to avoid race conditions with concurrent policy enforcement (or + * management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the + * request is malformed. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.UpdatePolicyRequest request = + * Service.UpdatePolicyRequest.newBuilder() + * .setPolicy(Resources.Policy.newBuilder().build()) + * .build(); + * Resources.Policy response = binauthzManagementServiceV1Client.updatePolicy(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Policy updatePolicy(Service.UpdatePolicyRequest request) { + return updatePolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1.Policy], and + * returns a copy of the new [policy][google.cloud.binaryauthorization.v1.Policy]. A policy is + * always updated as a whole, to avoid race conditions with concurrent policy enforcement (or + * management!) requests. Returns NOT_FOUND if the project does not exist, INVALID_ARGUMENT if the + * request is malformed. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.UpdatePolicyRequest request = + * Service.UpdatePolicyRequest.newBuilder() + * .setPolicy(Resources.Policy.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.updatePolicyCallable().futureCall(request); + * // Do something. + * Resources.Policy response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * String attestorId = "attestorId2055733027"; + * Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + * Resources.Attestor response = + * binauthzManagementServiceV1Client.createAttestor(parent, attestorId, attestor); + * } + * }+ * + * @param parent Required. The parent of this + * [attestor][google.cloud.binaryauthorization.v1.Attestor]. + * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1.Attestor] ID. + * @param attestor Required. The initial [attestor][google.cloud.binaryauthorization.v1.Attestor] + * value. The service will overwrite the [attestor + * name][google.cloud.binaryauthorization.v1.Attestor.name] field with the resource name, in + * the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor createAttestor( + ProjectName parent, String attestorId, Resources.Attestor attestor) { + Service.CreateAttestorRequest request = + Service.CreateAttestorRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAttestorId(attestorId) + .setAttestor(attestor) + .build(); + return createAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the + * new [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project + * does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * String attestorId = "attestorId2055733027"; + * Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + * Resources.Attestor response = + * binauthzManagementServiceV1Client.createAttestor(parent, attestorId, attestor); + * } + * }+ * + * @param parent Required. The parent of this + * [attestor][google.cloud.binaryauthorization.v1.Attestor]. + * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1.Attestor] ID. + * @param attestor Required. The initial [attestor][google.cloud.binaryauthorization.v1.Attestor] + * value. The service will overwrite the [attestor + * name][google.cloud.binaryauthorization.v1.Attestor.name] field with the resource name, in + * the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor createAttestor( + String parent, String attestorId, Resources.Attestor attestor) { + Service.CreateAttestorRequest request = + Service.CreateAttestorRequest.newBuilder() + .setParent(parent) + .setAttestorId(attestorId) + .setAttestor(attestor) + .build(); + return createAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the + * new [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project + * does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.CreateAttestorRequest request = + * Service.CreateAttestorRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setAttestorId("attestorId2055733027") + * .setAttestor(Resources.Attestor.newBuilder().build()) + * .build(); + * Resources.Attestor response = binauthzManagementServiceV1Client.createAttestor(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor createAttestor(Service.CreateAttestorRequest request) { + return createAttestorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an [attestor][google.cloud.binaryauthorization.v1.Attestor], and returns a copy of the + * new [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the project + * does not exist, INVALID_ARGUMENT if the request is malformed, ALREADY_EXISTS if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] already exists. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.CreateAttestorRequest request = + * Service.CreateAttestorRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setAttestorId("attestorId2055733027") + * .setAttestor(Resources.Attestor.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.createAttestorCallable().futureCall(request); + * // Do something. + * Resources.Attestor response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + * Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(name); + * } + * }+ * + * @param name Required. The name of the [attestor][google.cloud.binaryauthorization.v1.Attestor] + * to retrieve, in the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor getAttestor(AttestorName name) { + Service.GetAttestorRequest request = + Service.GetAttestorRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + * Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(name); + * } + * }+ * + * @param name Required. The name of the [attestor][google.cloud.binaryauthorization.v1.Attestor] + * to retrieve, in the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor getAttestor(String name) { + Service.GetAttestorRequest request = + Service.GetAttestorRequest.newBuilder().setName(name).build(); + return getAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.GetAttestorRequest request = + * Service.GetAttestorRequest.newBuilder() + * .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + * .build(); + * Resources.Attestor response = binauthzManagementServiceV1Client.getAttestor(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor getAttestor(Service.GetAttestorRequest request) { + return getAttestorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.GetAttestorRequest request = + * Service.GetAttestorRequest.newBuilder() + * .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.getAttestorCallable().futureCall(request); + * // Do something. + * Resources.Attestor response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Resources.Attestor attestor = Resources.Attestor.newBuilder().build(); + * Resources.Attestor response = binauthzManagementServiceV1Client.updateAttestor(attestor); + * } + * }+ * + * @param attestor Required. The updated [attestor][google.cloud.binaryauthorization.v1.Attestor] + * value. The service will overwrite the [attestor + * name][google.cloud.binaryauthorization.v1.Attestor.name] field with the resource name in + * the request URL, in the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor updateAttestor(Resources.Attestor attestor) { + Service.UpdateAttestorRequest request = + Service.UpdateAttestorRequest.newBuilder().setAttestor(attestor).build(); + return updateAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.UpdateAttestorRequest request = + * Service.UpdateAttestorRequest.newBuilder() + * .setAttestor(Resources.Attestor.newBuilder().build()) + * .build(); + * Resources.Attestor response = binauthzManagementServiceV1Client.updateAttestor(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Resources.Attestor updateAttestor(Service.UpdateAttestorRequest request) { + return updateAttestorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.UpdateAttestorRequest request = + * Service.UpdateAttestorRequest.newBuilder() + * .setAttestor(Resources.Attestor.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.updateAttestorCallable().futureCall(request); + * // Do something. + * Resources.Attestor response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * for (Resources.Attestor element : + * binauthzManagementServiceV1Client.listAttestors(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the project associated with the + * [attestors][google.cloud.binaryauthorization.v1.Attestor], in the format `projects/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttestorsPagedResponse listAttestors(ProjectName parent) { + Service.ListAttestorsRequest request = + Service.ListAttestorsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listAttestors(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. Returns INVALID_ARGUMENT if + * the project does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * String parent = ProjectName.of("[PROJECT]").toString(); + * for (Resources.Attestor element : + * binauthzManagementServiceV1Client.listAttestors(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The resource name of the project associated with the + * [attestors][google.cloud.binaryauthorization.v1.Attestor], in the format `projects/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttestorsPagedResponse listAttestors(String parent) { + Service.ListAttestorsRequest request = + Service.ListAttestorsRequest.newBuilder().setParent(parent).build(); + return listAttestors(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. Returns INVALID_ARGUMENT if + * the project does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.ListAttestorsRequest request = + * Service.ListAttestorsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Resources.Attestor element : + * binauthzManagementServiceV1Client.listAttestors(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAttestorsPagedResponse listAttestors(Service.ListAttestorsRequest request) { + return listAttestorsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists [attestors][google.cloud.binaryauthorization.v1.Attestor]. Returns INVALID_ARGUMENT if + * the project does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.ListAttestorsRequest request = + * Service.ListAttestorsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.listAttestorsPagedCallable().futureCall(request); + * // Do something. + * for (Resources.Attestor element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.ListAttestorsRequest request = + * Service.ListAttestorsRequest.newBuilder() + * .setParent(ProjectName.of("[PROJECT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * Service.ListAttestorsResponse response = + * binauthzManagementServiceV1Client.listAttestorsCallable().call(request); + * for (Resources.Attestor element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]"); + * binauthzManagementServiceV1Client.deleteAttestor(name); + * } + * }+ * + * @param name Required. The name of the [attestors][google.cloud.binaryauthorization.v1.Attestor] + * to delete, in the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttestor(AttestorName name) { + Service.DeleteAttestorRequest request = + Service.DeleteAttestorRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + deleteAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString(); + * binauthzManagementServiceV1Client.deleteAttestor(name); + * } + * }+ * + * @param name Required. The name of the [attestors][google.cloud.binaryauthorization.v1.Attestor] + * to delete, in the format `projects/*/attestors/*`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttestor(String name) { + Service.DeleteAttestorRequest request = + Service.DeleteAttestorRequest.newBuilder().setName(name).build(); + deleteAttestor(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.DeleteAttestorRequest request = + * Service.DeleteAttestorRequest.newBuilder() + * .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + * .build(); + * binauthzManagementServiceV1Client.deleteAttestor(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteAttestor(Service.DeleteAttestorRequest request) { + deleteAttestorCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes an [attestor][google.cloud.binaryauthorization.v1.Attestor]. Returns NOT_FOUND if the + * [attestor][google.cloud.binaryauthorization.v1.Attestor] does not exist. + * + *
Sample code: + * + *
{@code + * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client = + * BinauthzManagementServiceV1Client.create()) { + * Service.DeleteAttestorRequest request = + * Service.DeleteAttestorRequest.newBuilder() + * .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * binauthzManagementServiceV1Client.deleteAttestorCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of getPolicy to 30 seconds: + * + *
{@code + * BinauthzManagementServiceV1Settings.Builder binauthzManagementServiceV1SettingsBuilder = + * BinauthzManagementServiceV1Settings.newBuilder(); + * binauthzManagementServiceV1SettingsBuilder + * .getPolicySettings() + * .setRetrySettings( + * binauthzManagementServiceV1SettingsBuilder + * .getPolicySettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * BinauthzManagementServiceV1Settings binauthzManagementServiceV1Settings = + * binauthzManagementServiceV1SettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class BinauthzManagementServiceV1Settings + extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the SystemPolicyV1Client 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 SystemPolicyV1Settings to
+ * create(). For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class SystemPolicyV1Client implements BackgroundResource {
+ private final SystemPolicyV1Settings settings;
+ private final SystemPolicyV1Stub stub;
+
+ /** Constructs an instance of SystemPolicyV1Client with default settings. */
+ public static final SystemPolicyV1Client create() throws IOException {
+ return create(SystemPolicyV1Settings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of SystemPolicyV1Client, using the given settings. The channels are
+ * created based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final SystemPolicyV1Client create(SystemPolicyV1Settings settings)
+ throws IOException {
+ return new SystemPolicyV1Client(settings);
+ }
+
+ /**
+ * Constructs an instance of SystemPolicyV1Client, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(SystemPolicyV1Settings).
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final SystemPolicyV1Client create(SystemPolicyV1Stub stub) {
+ return new SystemPolicyV1Client(stub);
+ }
+
+ /**
+ * Constructs an instance of SystemPolicyV1Client, 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.
+ */
+ protected SystemPolicyV1Client(SystemPolicyV1Settings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((SystemPolicyV1StubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected SystemPolicyV1Client(SystemPolicyV1Stub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final SystemPolicyV1Settings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public SystemPolicyV1Stub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the current system policy in the specified location.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getSystemPolicy to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * 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:
+ *
+ * To customize the endpoint:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@Generated("by gapic-generator-java")
+public class ValidationHelperV1Client implements BackgroundResource {
+ private final ValidationHelperV1Settings settings;
+ private final ValidationHelperV1Stub stub;
+
+ /** Constructs an instance of ValidationHelperV1Client with default settings. */
+ public static final ValidationHelperV1Client create() throws IOException {
+ return create(ValidationHelperV1Settings.newBuilder().build());
+ }
+
+ /**
+ * 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.
+ */
+ public static final ValidationHelperV1Client create(ValidationHelperV1Settings settings)
+ throws IOException {
+ return new ValidationHelperV1Client(settings);
+ }
+
+ /**
+ * Constructs an instance of ValidationHelperV1Client, using the given stub for making calls. This
+ * is for advanced usage - prefer using create(ValidationHelperV1Settings).
+ */
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public static final ValidationHelperV1Client create(ValidationHelperV1Stub stub) {
+ return new ValidationHelperV1Client(stub);
+ }
+
+ /**
+ * 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.
+ */
+ protected ValidationHelperV1Client(ValidationHelperV1Settings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((ValidationHelperV1StubSettings) settings.getStubSettings()).createStub();
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ protected ValidationHelperV1Client(ValidationHelperV1Stub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final ValidationHelperV1Settings getSettings() {
+ return settings;
+ }
+
+ @BetaApi("A restructuring of stub classes is planned, so this may break in the future")
+ public ValidationHelperV1Stub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns whether the given Attestation for the given image URI was signed by the given Attestor
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of validateAttestationOccurrence to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= BinauthzManagementServiceV1Client =======================
+ *
+ * Service Description: Google Cloud Management Service for Binary Authorization admission
+ * policies and attestation authorities.
+ *
+ * This API implements a REST model with the following objects:
+ *
+ * Sample for BinauthzManagementServiceV1Client:
+ *
+ * ======================= SystemPolicyV1Client =======================
+ *
+ * Service Description: API for working with the system policy.
+ *
+ * Sample for SystemPolicyV1Client:
+ *
+ * ======================= ValidationHelperV1Client =======================
+ *
+ * Service Description: BinAuthz Attestor verification
+ *
+ * Sample for ValidationHelperV1Client:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class BinauthzManagementServiceV1Stub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of getPolicy to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcBinauthzManagementServiceV1CallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcBinauthzManagementServiceV1Stub extends BinauthzManagementServiceV1Stub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSystemPolicyV1CallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSystemPolicyV1Stub extends SystemPolicyV1Stub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcValidationHelperV1CallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcValidationHelperV1Stub extends ValidationHelperV1Stub {
+ private static final MethodDescriptor<
+ Service.ValidateAttestationOccurrenceRequest,
+ Service.ValidateAttestationOccurrenceResponse>
+ validateAttestationOccurrenceMethodDescriptor =
+ MethodDescriptor
+ .{@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * PolicyName name = PolicyName.ofProjectName("[PROJECT]");
+ * Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * SystemPolicyV1Settings systemPolicyV1Settings =
+ * SystemPolicyV1Settings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings);
+ * }
+ *
+ * {@code
+ * SystemPolicyV1Settings systemPolicyV1Settings =
+ * SystemPolicyV1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create(systemPolicyV1Settings);
+ * }
+ *
+ * {@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * PolicyName name = PolicyName.ofProjectName("[PROJECT]");
+ * Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name, in the format `locations/*/policy`. Note that the
+ * system policy is not associated with a project.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Resources.Policy getSystemPolicy(PolicyName name) {
+ Service.GetSystemPolicyRequest request =
+ Service.GetSystemPolicyRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getSystemPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the current system policy in the specified location.
+ *
+ * {@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * String name = PolicyName.ofProjectName("[PROJECT]").toString();
+ * Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
+ * }
+ * }
+ *
+ * @param name Required. The resource name, in the format `locations/*/policy`. Note that the
+ * system policy is not associated with a project.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Resources.Policy getSystemPolicy(String name) {
+ Service.GetSystemPolicyRequest request =
+ Service.GetSystemPolicyRequest.newBuilder().setName(name).build();
+ return getSystemPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the current system policy in the specified location.
+ *
+ * {@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * Service.GetSystemPolicyRequest request =
+ * Service.GetSystemPolicyRequest.newBuilder()
+ * .setName(PolicyName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * Resources.Policy response = systemPolicyV1Client.getSystemPolicy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Resources.Policy getSystemPolicy(Service.GetSystemPolicyRequest request) {
+ return getSystemPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the current system policy in the specified location.
+ *
+ * {@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * Service.GetSystemPolicyRequest request =
+ * Service.GetSystemPolicyRequest.newBuilder()
+ * .setName(PolicyName.ofProjectName("[PROJECT]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * SystemPolicyV1Settings.Builder systemPolicyV1SettingsBuilder =
+ * SystemPolicyV1Settings.newBuilder();
+ * systemPolicyV1SettingsBuilder
+ * .getSystemPolicySettings()
+ * .setRetrySettings(
+ * systemPolicyV1SettingsBuilder
+ * .getSystemPolicySettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SystemPolicyV1Settings systemPolicyV1Settings = systemPolicyV1SettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class SystemPolicyV1Settings extends ClientSettings{@code
+ * 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);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * ValidationHelperV1Settings validationHelperV1Settings =
+ * ValidationHelperV1Settings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * ValidationHelperV1Client validationHelperV1Client =
+ * ValidationHelperV1Client.create(validationHelperV1Settings);
+ * }
+ *
+ * {@code
+ * ValidationHelperV1Settings validationHelperV1Settings =
+ * ValidationHelperV1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * ValidationHelperV1Client validationHelperV1Client =
+ * ValidationHelperV1Client.create(validationHelperV1Settings);
+ * }
+ *
+ * {@code
+ * 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);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Service.ValidateAttestationOccurrenceResponse validateAttestationOccurrence(
+ Service.ValidateAttestationOccurrenceRequest request) {
+ return validateAttestationOccurrenceCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns whether the given Attestation for the given image URI was signed by the given Attestor
+ *
+ * {@code
+ * try (ValidationHelperV1Client validationHelperV1Client = ValidationHelperV1Client.create()) {
+ * Service.ValidateAttestationOccurrenceRequest request =
+ * Service.ValidateAttestationOccurrenceRequest.newBuilder()
+ * .setAttestor("attestor542920680")
+ * .setAttestation(AttestationOccurrence.newBuilder().build())
+ * .setOccurrenceNote("occurrenceNote1722072419")
+ * .setOccurrenceResourceUri("occurrenceResourceUri1001424877")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable<
+ Service.ValidateAttestationOccurrenceRequest,
+ Service.ValidateAttestationOccurrenceResponse>
+ validateAttestationOccurrenceCallable() {
+ return stub.validateAttestationOccurrenceCallable();
+ }
+
+ @Override
+ public final void close() {
+ stub.close();
+ }
+
+ @Override
+ public void shutdown() {
+ stub.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return stub.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return stub.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ stub.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return stub.awaitTermination(duration, unit);
+ }
+}
diff --git a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
new file mode 100644
index 00000000..b3adada0
--- /dev/null
+++ b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/ValidationHelperV1Settings.java
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.protos.google.cloud.binaryauthorization.v1;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.protos.google.cloud.binaryauthorization.v1.stub.ValidationHelperV1StubSettings;
+import java.io.IOException;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link ValidationHelperV1Client}.
+ *
+ *
+ *
+ *
+ * {@code
+ * ValidationHelperV1Settings.Builder validationHelperV1SettingsBuilder =
+ * ValidationHelperV1Settings.newBuilder();
+ * validationHelperV1SettingsBuilder
+ * .validateAttestationOccurrenceSettings()
+ * .setRetrySettings(
+ * validationHelperV1SettingsBuilder
+ * .validateAttestationOccurrenceSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ValidationHelperV1Settings validationHelperV1Settings =
+ * validationHelperV1SettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class ValidationHelperV1Settings extends ClientSettings
+ *
+ *
+ * {@code
+ * try (BinauthzManagementServiceV1Client binauthzManagementServiceV1Client =
+ * BinauthzManagementServiceV1Client.create()) {
+ * PolicyName name = PolicyName.ofProjectName("[PROJECT]");
+ * Resources.Policy response = binauthzManagementServiceV1Client.getPolicy(name);
+ * }
+ * }
+ *
+ * {@code
+ * try (SystemPolicyV1Client systemPolicyV1Client = SystemPolicyV1Client.create()) {
+ * PolicyName name = PolicyName.ofProjectName("[PROJECT]");
+ * Resources.Policy response = systemPolicyV1Client.getSystemPolicy(name);
+ * }
+ * }
+ *
+ * {@code
+ * 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);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.protos.google.cloud.binaryauthorization.v1;
+
+import javax.annotation.Generated;
diff --git a/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1Stub.java b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1Stub.java
new file mode 100644
index 00000000..a5f29095
--- /dev/null
+++ b/google-cloud-binary-authorization/src/main/java/com/google/protos/google/cloud/binaryauthorization/v1/stub/BinauthzManagementServiceV1Stub.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.protos.google.cloud.binaryauthorization.v1.stub;
+
+import static com.google.protos.google.cloud.binaryauthorization.v1.BinauthzManagementServiceV1Client.ListAttestorsPagedResponse;
+
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.protobuf.Empty;
+import com.google.protos.google.cloud.binaryauthorization.v1.Resources;
+import com.google.protos.google.cloud.binaryauthorization.v1.Service;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the BinauthzManagementServiceV1 service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * BinauthzManagementServiceV1StubSettings.Builder binauthzManagementServiceV1SettingsBuilder =
+ * BinauthzManagementServiceV1StubSettings.newBuilder();
+ * binauthzManagementServiceV1SettingsBuilder
+ * .getPolicySettings()
+ * .setRetrySettings(
+ * binauthzManagementServiceV1SettingsBuilder
+ * .getPolicySettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * BinauthzManagementServiceV1StubSettings binauthzManagementServiceV1Settings =
+ * binauthzManagementServiceV1SettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class BinauthzManagementServiceV1StubSettings
+ extends StubSettings