@BetaApi @Generated(value="by gapic-generator-java") public class BinauthzManagementServiceV1Beta1Client extends Object implements com.google.api.gax.core.BackgroundResource
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:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
PolicyName name = PolicyName.of("[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().
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 BinauthzManagementServiceV1Beta1Settings to create(). For example:
To customize credentials:
BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
BinauthzManagementServiceV1Beta1Settings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
To customize the endpoint:
BinauthzManagementServiceV1Beta1Settings binauthzManagementServiceV1Beta1Settings =
BinauthzManagementServiceV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create(binauthzManagementServiceV1Beta1Settings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
BinauthzManagementServiceV1Beta1Client.ListAttestorsFixedSizeCollection |
static class |
BinauthzManagementServiceV1Beta1Client.ListAttestorsPage |
static class |
BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Settings settings)
Constructs an instance of BinauthzManagementServiceV1Beta1Client, using the given settings.
|
protected |
BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Stub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static BinauthzManagementServiceV1Beta1Client |
create()
Constructs an instance of BinauthzManagementServiceV1Beta1Client with default settings.
|
static BinauthzManagementServiceV1Beta1Client |
create(BinauthzManagementServiceV1Beta1Settings settings)
Constructs an instance of BinauthzManagementServiceV1Beta1Client, using the given settings.
|
static BinauthzManagementServiceV1Beta1Client |
create(BinauthzManagementServiceV1Beta1Stub stub)
Constructs an instance of BinauthzManagementServiceV1Beta1Client, using the given stub for
making calls.
|
Attestor |
createAttestor(CreateAttestorRequest request)
Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of
the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
createAttestor(ProjectName parent,
String attestorId,
Attestor attestor)
Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of
the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
createAttestor(String parent,
String attestorId,
Attestor attestor)
Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of
the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<CreateAttestorRequest,Attestor> |
createAttestorCallable()
Creates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor], and returns a copy of
the new [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
void |
deleteAttestor(AttestorName name)
Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
void |
deleteAttestor(DeleteAttestorRequest request)
Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
void |
deleteAttestor(String name)
Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<DeleteAttestorRequest,com.google.protobuf.Empty> |
deleteAttestorCallable()
Deletes an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
getAttestor(AttestorName name)
Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
getAttestor(GetAttestorRequest request)
Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
getAttestor(String name)
Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<GetAttestorRequest,Attestor> |
getAttestorCallable()
Gets an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Policy |
getPolicy(GetPolicyRequest request)
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.
|
Policy |
getPolicy(PolicyName name)
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.
|
Policy |
getPolicy(String name)
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.
|
com.google.api.gax.rpc.UnaryCallable<GetPolicyRequest,Policy> |
getPolicyCallable()
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.
|
BinauthzManagementServiceV1Beta1Settings |
getSettings() |
BinauthzManagementServiceV1Beta1Stub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse |
listAttestors(ListAttestorsRequest request)
Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
|
BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse |
listAttestors(ProjectName parent)
Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
|
BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse |
listAttestors(String parent)
Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<ListAttestorsRequest,ListAttestorsResponse> |
listAttestorsCallable()
Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<ListAttestorsRequest,BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse> |
listAttestorsPagedCallable()
Lists [attestors][google.cloud.binaryauthorization.v1beta1.Attestor].
|
void |
shutdown() |
void |
shutdownNow() |
Attestor |
updateAttestor(Attestor attestor)
Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Attestor |
updateAttestor(UpdateAttestorRequest request)
Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
com.google.api.gax.rpc.UnaryCallable<UpdateAttestorRequest,Attestor> |
updateAttestorCallable()
Updates an [attestor][google.cloud.binaryauthorization.v1beta1.Attestor].
|
Policy |
updatePolicy(Policy policy)
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].
|
Policy |
updatePolicy(UpdatePolicyRequest request)
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].
|
com.google.api.gax.rpc.UnaryCallable<UpdatePolicyRequest,Policy> |
updatePolicyCallable()
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].
|
protected BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Settings settings) throws IOException
IOException@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected BinauthzManagementServiceV1Beta1Client(BinauthzManagementServiceV1Beta1Stub stub)
public static final BinauthzManagementServiceV1Beta1Client create() throws IOException
IOExceptionpublic static final BinauthzManagementServiceV1Beta1Client create(BinauthzManagementServiceV1Beta1Settings settings) throws IOException
IOException@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final BinauthzManagementServiceV1Beta1Client create(BinauthzManagementServiceV1Beta1Stub stub)
public final BinauthzManagementServiceV1Beta1Settings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public BinauthzManagementServiceV1Beta1Stub getStub()
public final Policy getPolicy(PolicyName name)
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:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
PolicyName name = PolicyName.of("[PROJECT]");
Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
}
name - Required. The resource name of the
[policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format
`projects/*/policy`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy getPolicy(String name)
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:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
String name = PolicyName.of("[PROJECT]").toString();
Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(name);
}
name - Required. The resource name of the
[policy][google.cloud.binaryauthorization.v1beta1.Policy] to retrieve, in the format
`projects/*/policy`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy getPolicy(GetPolicyRequest request)
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:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
GetPolicyRequest request =
GetPolicyRequest.newBuilder().setName(PolicyName.of("[PROJECT]").toString()).build();
Policy response = binauthzManagementServiceV1Beta1Client.getPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetPolicyRequest,Policy> getPolicyCallable()
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:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
GetPolicyRequest request =
GetPolicyRequest.newBuilder().setName(PolicyName.of("[PROJECT]").toString()).build();
ApiFuture<Policy> future =
binauthzManagementServiceV1Beta1Client.getPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final Policy updatePolicy(Policy policy)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
Policy policy = Policy.newBuilder().build();
Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(policy);
}
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`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Policy updatePolicy(UpdatePolicyRequest request)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
UpdatePolicyRequest request =
UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
Policy response = binauthzManagementServiceV1Beta1Client.updatePolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdatePolicyRequest,Policy> updatePolicyCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
UpdatePolicyRequest request =
UpdatePolicyRequest.newBuilder().setPolicy(Policy.newBuilder().build()).build();
ApiFuture<Policy> future =
binauthzManagementServiceV1Beta1Client.updatePolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final Attestor createAttestor(ProjectName parent, String attestorId, Attestor attestor)
Sample code:
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);
}
parent - Required. The parent of this
[attestor][google.cloud.binaryauthorization.v1beta1.Attestor].attestorId - Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]
ID.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/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Attestor createAttestor(String parent, String attestorId, Attestor attestor)
Sample code:
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);
}
parent - Required. The parent of this
[attestor][google.cloud.binaryauthorization.v1beta1.Attestor].attestorId - Required. The [attestors][google.cloud.binaryauthorization.v1beta1.Attestor]
ID.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/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Attestor createAttestor(CreateAttestorRequest request)
Sample code:
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateAttestorRequest,Attestor> createAttestorCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
CreateAttestorRequest request =
CreateAttestorRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setAttestorId("attestorId2055733027")
.setAttestor(Attestor.newBuilder().build())
.build();
ApiFuture<Attestor> future =
binauthzManagementServiceV1Beta1Client.createAttestorCallable().futureCall(request);
// Do something.
Attestor response = future.get();
}
public final Attestor getAttestor(AttestorName name)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
}
name - Required. The name of the
[attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format
`projects/*/attestors/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Attestor getAttestor(String name)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(name);
}
name - Required. The name of the
[attestor][google.cloud.binaryauthorization.v1beta1.Attestor] to retrieve, in the format
`projects/*/attestors/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Attestor getAttestor(GetAttestorRequest request)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
GetAttestorRequest request =
GetAttestorRequest.newBuilder()
.setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
.build();
Attestor response = binauthzManagementServiceV1Beta1Client.getAttestor(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetAttestorRequest,Attestor> getAttestorCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
GetAttestorRequest request =
GetAttestorRequest.newBuilder()
.setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
.build();
ApiFuture<Attestor> future =
binauthzManagementServiceV1Beta1Client.getAttestorCallable().futureCall(request);
// Do something.
Attestor response = future.get();
}
public final Attestor updateAttestor(Attestor attestor)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
Attestor attestor = Attestor.newBuilder().build();
Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(attestor);
}
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/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Attestor updateAttestor(UpdateAttestorRequest request)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
UpdateAttestorRequest request =
UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
Attestor response = binauthzManagementServiceV1Beta1Client.updateAttestor(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateAttestorRequest,Attestor> updateAttestorCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
UpdateAttestorRequest request =
UpdateAttestorRequest.newBuilder().setAttestor(Attestor.newBuilder().build()).build();
ApiFuture<Attestor> future =
binauthzManagementServiceV1Beta1Client.updateAttestorCallable().futureCall(request);
// Do something.
Attestor response = future.get();
}
public final BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse listAttestors(ProjectName parent)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (Attestor element :
binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the project associated with the
[attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format
`projects/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse listAttestors(String parent)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (Attestor element :
binauthzManagementServiceV1Beta1Client.listAttestors(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the project associated with the
[attestors][google.cloud.binaryauthorization.v1beta1.Attestor], in the format
`projects/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse listAttestors(ListAttestorsRequest request)
Sample code:
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListAttestorsRequest,BinauthzManagementServiceV1Beta1Client.ListAttestorsPagedResponse> listAttestorsPagedCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
ListAttestorsRequest request =
ListAttestorsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Attestor> future =
binauthzManagementServiceV1Beta1Client.listAttestorsPagedCallable().futureCall(request);
// Do something.
for (Attestor element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListAttestorsRequest,ListAttestorsResponse> listAttestorsCallable()
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deleteAttestor(AttestorName name)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
AttestorName name = AttestorName.of("[PROJECT]", "[ATTESTOR]");
binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
}
name - Required. The name of the
[attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format
`projects/*/attestors/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteAttestor(String name)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
String name = AttestorName.of("[PROJECT]", "[ATTESTOR]").toString();
binauthzManagementServiceV1Beta1Client.deleteAttestor(name);
}
name - Required. The name of the
[attestors][google.cloud.binaryauthorization.v1beta1.Attestor] to delete, in the format
`projects/*/attestors/*`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteAttestor(DeleteAttestorRequest request)
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
DeleteAttestorRequest request =
DeleteAttestorRequest.newBuilder()
.setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
.build();
binauthzManagementServiceV1Beta1Client.deleteAttestor(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteAttestorRequest,com.google.protobuf.Empty> deleteAttestorCallable()
Sample code:
try (BinauthzManagementServiceV1Beta1Client binauthzManagementServiceV1Beta1Client =
BinauthzManagementServiceV1Beta1Client.create()) {
DeleteAttestorRequest request =
DeleteAttestorRequest.newBuilder()
.setName(AttestorName.of("[PROJECT]", "[ATTESTOR]").toString())
.build();
ApiFuture<Empty> future =
binauthzManagementServiceV1Beta1Client.deleteAttestorCallable().futureCall(request);
// Do something.
future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2021 Google LLC. All rights reserved.