All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.binaryauthorization.v1beta1.BinauthzManagementServiceV1Beta1Client Maven / Gradle / Ivy

Go to download

Binary Authorization is a service on Google Cloud that provides centralized software supply-chain security for applications that run on Google Kubernetes Engine (GKE) and Anthos clusters on VMware

There is a newer version: 1.48.0
Show newest version
/*
 * Copyright 2024 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.cloud.binaryauthorization.v1beta1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1Stub;
import com.google.cloud.binaryauthorization.v1beta1.stub.BinauthzManagementServiceV1Beta1StubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.Empty;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Service Description: Google Cloud Management Service for Binary Authorization admission policies
 * and attestation authorities.
 *
 * 

This API implements a REST model with the following objects: * *

    *
  • [Policy][google.cloud.binaryauthorization.v1beta1.Policy] *
  • [Attestor][google.cloud.binaryauthorization.v1beta1.Attestor] *
* *

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
 * // 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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
 *     BinauthzManagementServiceV1Beta1Client.create()) {
 *   PolicyName name = PolicyName.ofProjectName("[PROJECT]");
 *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
 * }
 * }
* *

Note: close() needs to be called on the BinauthzManagementServiceV1Beta1Client object to clean * up resources such as threads. In the example above, try-with-resources is used, which * automatically calls close(). * *

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Methods
MethodDescriptionMethod Variants

GetPolicy

A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the [attestors][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Policy] for this project. Returns a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not have one.

*

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

*
    *
  • getPolicy(GetPolicyRequest request) *

*

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

*
    *
  • getPolicy(PolicyName name) *

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

*
    *
  • getPolicyCallable() *

*

UpdatePolicy

Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.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.

*

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

*
    *
  • updatePolicy(UpdatePolicyRequest request) *

*

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

*
    *
  • updatePolicy(Policy policy) *

*

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

*
    *
  • updatePolicyCallable() *

*

CreateAttestor

Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of the new [attestor][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Attestor] already exists.

*

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

*
    *
  • createAttestor(CreateAttestorRequest request) *

*

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

*
    *
  • createAttestor(ProjectName parent, String attestorId, Attestor attestor) *

  • createAttestor(String parent, String attestorId, Attestor attestor) *

*

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

*
    *
  • createAttestorCallable() *

*

GetAttestor

Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.

*

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

*
    *
  • getAttestor(GetAttestorRequest request) *

*

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

*
    *
  • getAttestor(AttestorName name) *

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

*
    *
  • getAttestorCallable() *

*

UpdateAttestor

Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.

*

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

*
    *
  • updateAttestor(UpdateAttestorRequest request) *

*

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

*
    *
  • updateAttestor(Attestor attestor) *

*

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

*
    *
  • updateAttestorCallable() *

*

ListAttestors

Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT if the project does not exist.

*

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

*
    *
  • listAttestors(ListAttestorsRequest request) *

*

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

*
    *
  • listAttestors(ProjectName parent) *

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

*
    *
  • listAttestorsPagedCallable() *

  • listAttestorsCallable() *

*

DeleteAttestor

Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist.

*

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

*
    *
  • deleteAttestor(DeleteAttestorRequest request) *

*

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

*
    *
  • deleteAttestor(AttestorName name) *

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

*
    *
  • deleteAttestorCallable() *

*
* *

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 * BinauthzManagementServiceV1Beta1Settings to create(). For example: * *

To customize credentials: * *

{@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
 * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
 *     BinauthzManagementServiceV1Beta1Settings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
 *     BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
 * }
* *

To customize the endpoint: * *

{@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
 * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
 *     BinauthzManagementServiceV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
 * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
 *     BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
 * }
* *

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over * the wire: * *

{@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
 * BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
 *     BinauthzManagementServiceV1Beta1Settings.newHttpJsonBuilder().build();
 * BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
 *     BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @Generated("by gapic-generator-java") public class BinauthzManagementServiceV1Beta1Client implements BackgroundResource { private final BinauthzManagementServiceV1Beta1Settings settings; private final BinauthzManagementServiceV1Beta1Stub stub; /** Constructs an instance of BinauthzManagementServiceV1Beta1Client with default settings. */ public static final BinauthzManagementServiceV1Beta1Client create() throws IOException { return create(BinauthzManagementServiceV1Beta1Settings.newBuilder().build()); } /** * Constructs an instance of BinauthzManagementServiceV1Beta1Client, 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 BinauthzManagementServiceV1Beta1Client create( BinauthzManagementServiceV1Beta1Settings settings) throws IOException { return new BinauthzManagementServiceV1Beta1Client(settings); } /** * Constructs an instance of BinauthzManagementServiceV1Beta1Client, using the given stub for * making calls. This is for advanced usage - prefer using * create(BinauthzManagementServiceV1Beta1Settings). */ public static final BinauthzManagementServiceV1Beta1Client create( BinauthzManagementServiceV1Beta1Stub stub) { return new BinauthzManagementServiceV1Beta1Client(stub); } /** * Constructs an instance of BinauthzManagementServiceV1Beta1Client, 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 BinauthzManagementServiceV1Beta1Client( BinauthzManagementServiceV1Beta1Settings settings) throws IOException { this.settings = settings; this.stub = ((BinauthzManagementServiceV1Beta1StubSettings) settings.getStubSettings()).createStub(); } protected BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Stub stub) { this.settings = null; this.stub = stub; } public final BinauthzManagementServiceV1Beta1Settings getSettings() { return settings; } public BinauthzManagementServiceV1Beta1Stub getStub() { return stub; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the * [attestors][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Policy] for this project. Returns * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not * have one. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   PolicyName name = PolicyName.ofProjectName("[PROJECT]");
   *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
   * }
   * }
* * @param name Required. The resource name of the * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format * `projects/*/policy`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Policy getPolicy(PolicyName name) { GetPolicyRequest request = GetPolicyRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the * [attestors][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Policy] for this project. Returns * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not * have one. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   String name = PolicyName.ofProjectName("[PROJECT]").toString();
   *   Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
   * }
   * }
* * @param name Required. The resource name of the * [policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format * `projects/*/policy`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Policy getPolicy(String name) { GetPolicyRequest request = GetPolicyRequest.newBuilder().setName(name).build(); return getPolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the * [attestors][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Policy] for this project. Returns * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not * have one. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   GetPolicyRequest request =
   *       GetPolicyRequest.newBuilder()
   *           .setName(PolicyName.ofProjectName("[PROJECT]").toString())
   *           .build();
   *   Policy response = binauthzManagementServiceV1Beta1Client.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 Policy getPolicy(GetPolicyRequest request) { return getPolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * A [policy][google.cloud.binaryauthorization.v1beta1.Policy] specifies the * [attestors][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Policy] for this project. Returns * a default [policy][google.cloud.binaryauthorization.v1beta1.Policy] if the project does not * have one. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   GetPolicyRequest request =
   *       GetPolicyRequest.newBuilder()
   *           .setName(PolicyName.ofProjectName("[PROJECT]").toString())
   *           .build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.getPolicyCallable().futureCall(request);
   *   // Do something.
   *   Policy response = future.get();
   * }
   * }
*/ public final UnaryCallable getPolicyCallable() { return stub.getPolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.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
   * // 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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   Policy policy = Policy.newBuilder().build();
   *   Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(policy);
   * }
   * }
* * @param policy Required. A new or updated * [policy][google.cloud.binaryauthorization.v1beta1.Policy] value. The service will overwrite * the [policy name][google.cloud.binaryauthorization.v1beta1.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 Policy updatePolicy(Policy policy) { UpdatePolicyRequest request = UpdatePolicyRequest.newBuilder().setPolicy(policy).build(); return updatePolicy(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.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
   * // 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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   UpdatePolicyRequest request =
   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
   *   Policy response = binauthzManagementServiceV1Beta1Client.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 Policy updatePolicy(UpdatePolicyRequest request) { return updatePolicyCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates or updates a project's [policy][google.cloud.binaryauthorization.v1beta1.Policy], and * returns a copy of the new [policy][google.cloud.binaryauthorization.v1beta1.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
   * // 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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   UpdatePolicyRequest request =
   *       UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.updatePolicyCallable().futureCall(request);
   *   // Do something.
   *   Policy response = future.get();
   * }
   * }
*/ public final UnaryCallable updatePolicyCallable() { return stub.updatePolicyCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of * the new [attestor][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Attestor] already exists. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   ProjectName parent = ProjectName.of("[PROJECT]");
   *   String attestorId = "attestorId2055733027";
   *   Attestor attestor = Attestor.newBuilder().build();
   *   Attestor response =
   *       binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor);
   * }
   * }
* * @param parent Required. The parent of this * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] * ID. * @param attestor Required. The initial * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.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 Attestor createAttestor(ProjectName parent, String attestorId, Attestor attestor) { CreateAttestorRequest request = 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.v1beta1.Attestor], and returns a copy of * the new [attestor][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Attestor] already exists. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   String parent = ProjectName.of("[PROJECT]").toString();
   *   String attestorId = "attestorId2055733027";
   *   Attestor attestor = Attestor.newBuilder().build();
   *   Attestor response =
   *       binauthzManagementServiceV1Beta1Client.createAttestor(parent, attestorId, attestor);
   * }
   * }
* * @param parent Required. The parent of this * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. * @param attestorId Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor] * ID. * @param attestor Required. The initial * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.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 Attestor createAttestor(String parent, String attestorId, Attestor attestor) { CreateAttestorRequest request = CreateAttestorRequest.newBuilder() .setParent(parent) .setAttestorId(attestorId) .setAttestor(attestor) .build(); return createAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of * the new [attestor][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Attestor] already exists. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   CreateAttestorRequest request =
   *       CreateAttestorRequest.newBuilder()
   *           .setParent(ProjectName.of("[PROJECT]").toString())
   *           .setAttestorId("attestorId2055733027")
   *           .setAttestor(Attestor.newBuilder().build())
   *           .build();
   *   Attestor response = binauthzManagementServiceV1Beta1Client.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 Attestor createAttestor(CreateAttestorRequest request) { return createAttestorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of * the new [attestor][google.cloud.binaryauthorization.v1beta1.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.v1beta1.Attestor] already exists. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   CreateAttestorRequest request =
   *       CreateAttestorRequest.newBuilder()
   *           .setParent(ProjectName.of("[PROJECT]").toString())
   *           .setAttestorId("attestorId2055733027")
   *           .setAttestor(Attestor.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.createAttestorCallable().futureCall(request);
   *   // Do something.
   *   Attestor response = future.get();
   * }
   * }
*/ public final UnaryCallable createAttestorCallable() { return stub.createAttestorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
   *   Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
   * }
   * }
* * @param name Required. The name of the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format * `projects/*/attestors/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Attestor getAttestor(AttestorName name) { GetAttestorRequest request = GetAttestorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
   *   Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
   * }
   * }
* * @param name Required. The name of the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format * `projects/*/attestors/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Attestor getAttestor(String name) { GetAttestorRequest request = GetAttestorRequest.newBuilder().setName(name).build(); return getAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   GetAttestorRequest request =
   *       GetAttestorRequest.newBuilder()
   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
   *           .build();
   *   Attestor response = binauthzManagementServiceV1Beta1Client.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 Attestor getAttestor(GetAttestorRequest request) { return getAttestorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if the * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   GetAttestorRequest request =
   *       GetAttestorRequest.newBuilder()
   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
   *           .build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.getAttestorCallable().futureCall(request);
   *   // Do something.
   *   Attestor response = future.get();
   * }
   * }
*/ public final UnaryCallable getAttestorCallable() { return stub.getAttestorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   Attestor attestor = Attestor.newBuilder().build();
   *   Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(attestor);
   * }
   * }
* * @param attestor Required. The updated * [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] value. The service will * overwrite the [attestor name][google.cloud.binaryauthorization.v1beta1.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 Attestor updateAttestor(Attestor attestor) { UpdateAttestorRequest request = UpdateAttestorRequest.newBuilder().setAttestor(attestor).build(); return updateAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   UpdateAttestorRequest request =
   *       UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
   *   Attestor response = binauthzManagementServiceV1Beta1Client.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 Attestor updateAttestor(UpdateAttestorRequest request) { return updateAttestorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   UpdateAttestorRequest request =
   *       UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.updateAttestorCallable().futureCall(request);
   *   // Do something.
   *   Attestor response = future.get();
   * }
   * }
*/ public final UnaryCallable updateAttestorCallable() { return stub.updateAttestorCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT * if the project does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   ProjectName parent = ProjectName.of("[PROJECT]");
   *   for (Attestor element :
   *       binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The resource name of the project associated with the * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format * `projects/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAttestorsPagedResponse listAttestors(ProjectName parent) { ListAttestorsRequest request = ListAttestorsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listAttestors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT * if the project does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   String parent = ProjectName.of("[PROJECT]").toString();
   *   for (Attestor element :
   *       binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The resource name of the project associated with the * [attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format * `projects/*`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListAttestorsPagedResponse listAttestors(String parent) { ListAttestorsRequest request = ListAttestorsRequest.newBuilder().setParent(parent).build(); return listAttestors(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT * if the project does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   ListAttestorsRequest request =
   *       ListAttestorsRequest.newBuilder()
   *           .setParent(ProjectName.of("[PROJECT]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   for (Attestor element :
   *       binauthzManagementServiceV1Beta1Client.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(ListAttestorsRequest request) { return listAttestorsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT * if the project does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   ListAttestorsRequest request =
   *       ListAttestorsRequest.newBuilder()
   *           .setParent(ProjectName.of("[PROJECT]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.listAttestorsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Attestor element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listAttestorsPagedCallable() { return stub.listAttestorsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns INVALID_ARGUMENT * if the project does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   ListAttestorsRequest request =
   *       ListAttestorsRequest.newBuilder()
   *           .setParent(ProjectName.of("[PROJECT]").toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   while (true) {
   *     ListAttestorsResponse response =
   *         binauthzManagementServiceV1Beta1Client.listAttestorsCallable().call(request);
   *     for (Attestor element : response.getAttestorsList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listAttestorsCallable() { return stub.listAttestorsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
   *   binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
   * }
   * }
* * @param name Required. The name of the * [attestors][google.cloud.binaryauthorization.v1beta1.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) { DeleteAttestorRequest request = DeleteAttestorRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
   *   binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
   * }
   * }
* * @param name Required. The name of the * [attestors][google.cloud.binaryauthorization.v1beta1.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) { DeleteAttestorRequest request = DeleteAttestorRequest.newBuilder().setName(name).build(); deleteAttestor(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   DeleteAttestorRequest request =
   *       DeleteAttestorRequest.newBuilder()
   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
   *           .build();
   *   binauthzManagementServiceV1Beta1Client.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(DeleteAttestorRequest request) { deleteAttestorCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor]. Returns NOT_FOUND if * the [attestor][google.cloud.binaryauthorization.v1beta1.Attestor] does not exist. * *

Sample code: * *

{@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 (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
   *     BinauthzManagementServiceV1Beta1Client.create()) {
   *   DeleteAttestorRequest request =
   *       DeleteAttestorRequest.newBuilder()
   *           .setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
   *           .build();
   *   ApiFuture future =
   *       binauthzManagementServiceV1Beta1Client.deleteAttestorCallable().futureCall(request);
   *   // Do something.
   *   future.get();
   * }
   * }
*/ public final UnaryCallable deleteAttestorCallable() { return stub.deleteAttestorCallable(); } @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); } public static class ListAttestorsPagedResponse extends AbstractPagedListResponse< ListAttestorsRequest, ListAttestorsResponse, Attestor, ListAttestorsPage, ListAttestorsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListAttestorsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListAttestorsPagedResponse(input), MoreExecutors.directExecutor()); } private ListAttestorsPagedResponse(ListAttestorsPage page) { super(page, ListAttestorsFixedSizeCollection.createEmptyCollection()); } } public static class ListAttestorsPage extends AbstractPage< ListAttestorsRequest, ListAttestorsResponse, Attestor, ListAttestorsPage> { private ListAttestorsPage( PageContext context, ListAttestorsResponse response) { super(context, response); } private static ListAttestorsPage createEmptyPage() { return new ListAttestorsPage(null, null); } @Override protected ListAttestorsPage createPage( PageContext context, ListAttestorsResponse response) { return new ListAttestorsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListAttestorsFixedSizeCollection extends AbstractFixedSizeCollection< ListAttestorsRequest, ListAttestorsResponse, Attestor, ListAttestorsPage, ListAttestorsFixedSizeCollection> { private ListAttestorsFixedSizeCollection(List pages, int collectionSize) { super(pages, collectionSize); } private static ListAttestorsFixedSizeCollection createEmptyCollection() { return new ListAttestorsFixedSizeCollection(null, 0); } @Override protected ListAttestorsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListAttestorsFixedSizeCollection(pages, collectionSize); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy