@Generated(value="by gapic-generator-java") public class EventarcClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated 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 (EventarcClient eventarcClient = EventarcClient.create()) {
TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
Trigger response = eventarcClient.getTrigger(name);
}
Note: close() needs to be called on the EventarcClient 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 EventarcSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
EventarcSettings eventarcSettings =
EventarcSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
EventarcSettings eventarcSettings =
EventarcSettings.newBuilder().setEndpoint(myEndpoint).build();
EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
EventarcSettings eventarcSettings = EventarcSettings.newHttpJsonBuilder().build();
EventarcClient eventarcClient = EventarcClient.create(eventarcSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
EventarcClient.ListChannelConnectionsFixedSizeCollection |
static class |
EventarcClient.ListChannelConnectionsPage |
static class |
EventarcClient.ListChannelConnectionsPagedResponse |
static class |
EventarcClient.ListChannelsFixedSizeCollection |
static class |
EventarcClient.ListChannelsPage |
static class |
EventarcClient.ListChannelsPagedResponse |
static class |
EventarcClient.ListLocationsFixedSizeCollection |
static class |
EventarcClient.ListLocationsPage |
static class |
EventarcClient.ListLocationsPagedResponse |
static class |
EventarcClient.ListProvidersFixedSizeCollection |
static class |
EventarcClient.ListProvidersPage |
static class |
EventarcClient.ListProvidersPagedResponse |
static class |
EventarcClient.ListTriggersFixedSizeCollection |
static class |
EventarcClient.ListTriggersPage |
static class |
EventarcClient.ListTriggersPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
EventarcClient(EventarcSettings settings)
Constructs an instance of EventarcClient, using the given settings.
|
protected |
EventarcClient(EventarcStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static EventarcClient |
create()
Constructs an instance of EventarcClient with default settings.
|
static EventarcClient |
create(EventarcSettings settings)
Constructs an instance of EventarcClient, using the given settings.
|
static EventarcClient |
create(EventarcStub stub)
Constructs an instance of EventarcClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
createChannelAsync(CreateChannelRequest request)
Create a new channel in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
createChannelAsync(LocationName parent,
Channel channel,
String channelId)
Create a new channel in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
createChannelAsync(String parent,
Channel channel,
String channelId)
Create a new channel in a particular project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateChannelRequest,com.google.longrunning.Operation> |
createChannelCallable()
Create a new channel in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
createChannelConnectionAsync(CreateChannelConnectionRequest request)
Create a new ChannelConnection in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
createChannelConnectionAsync(LocationName parent,
ChannelConnection channelConnection,
String channelConnectionId)
Create a new ChannelConnection in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
createChannelConnectionAsync(String parent,
ChannelConnection channelConnection,
String channelConnectionId)
Create a new ChannelConnection in a particular project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateChannelConnectionRequest,com.google.longrunning.Operation> |
createChannelConnectionCallable()
Create a new ChannelConnection in a particular project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateChannelConnectionRequest,ChannelConnection,OperationMetadata> |
createChannelConnectionOperationCallable()
Create a new ChannelConnection in a particular project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateChannelRequest,Channel,OperationMetadata> |
createChannelOperationCallable()
Create a new channel in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
createTriggerAsync(CreateTriggerRequest request)
Create a new trigger in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
createTriggerAsync(LocationName parent,
Trigger trigger,
String triggerId)
Create a new trigger in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
createTriggerAsync(String parent,
Trigger trigger,
String triggerId)
Create a new trigger in a particular project and location.
|
com.google.api.gax.rpc.UnaryCallable<CreateTriggerRequest,com.google.longrunning.Operation> |
createTriggerCallable()
Create a new trigger in a particular project and location.
|
com.google.api.gax.rpc.OperationCallable<CreateTriggerRequest,Trigger,OperationMetadata> |
createTriggerOperationCallable()
Create a new trigger in a particular project and location.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
deleteChannelAsync(ChannelName name)
Delete a single channel.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
deleteChannelAsync(DeleteChannelRequest request)
Delete a single channel.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
deleteChannelAsync(String name)
Delete a single channel.
|
com.google.api.gax.rpc.UnaryCallable<DeleteChannelRequest,com.google.longrunning.Operation> |
deleteChannelCallable()
Delete a single channel.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
deleteChannelConnectionAsync(ChannelConnectionName name)
Delete a single ChannelConnection.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
deleteChannelConnectionAsync(DeleteChannelConnectionRequest request)
Delete a single ChannelConnection.
|
com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> |
deleteChannelConnectionAsync(String name)
Delete a single ChannelConnection.
|
com.google.api.gax.rpc.UnaryCallable<DeleteChannelConnectionRequest,com.google.longrunning.Operation> |
deleteChannelConnectionCallable()
Delete a single ChannelConnection.
|
com.google.api.gax.rpc.OperationCallable<DeleteChannelConnectionRequest,ChannelConnection,OperationMetadata> |
deleteChannelConnectionOperationCallable()
Delete a single ChannelConnection.
|
com.google.api.gax.rpc.OperationCallable<DeleteChannelRequest,Channel,OperationMetadata> |
deleteChannelOperationCallable()
Delete a single channel.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
deleteTriggerAsync(DeleteTriggerRequest request)
Delete a single trigger.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
deleteTriggerAsync(String name,
boolean allowMissing)
Delete a single trigger.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
deleteTriggerAsync(TriggerName name,
boolean allowMissing)
Delete a single trigger.
|
com.google.api.gax.rpc.UnaryCallable<DeleteTriggerRequest,com.google.longrunning.Operation> |
deleteTriggerCallable()
Delete a single trigger.
|
com.google.api.gax.rpc.OperationCallable<DeleteTriggerRequest,Trigger,OperationMetadata> |
deleteTriggerOperationCallable()
Delete a single trigger.
|
Channel |
getChannel(ChannelName name)
Get a single Channel.
|
Channel |
getChannel(GetChannelRequest request)
Get a single Channel.
|
Channel |
getChannel(String name)
Get a single Channel.
|
com.google.api.gax.rpc.UnaryCallable<GetChannelRequest,Channel> |
getChannelCallable()
Get a single Channel.
|
ChannelConnection |
getChannelConnection(ChannelConnectionName name)
Get a single ChannelConnection.
|
ChannelConnection |
getChannelConnection(GetChannelConnectionRequest request)
Get a single ChannelConnection.
|
ChannelConnection |
getChannelConnection(String name)
Get a single ChannelConnection.
|
com.google.api.gax.rpc.UnaryCallable<GetChannelConnectionRequest,ChannelConnection> |
getChannelConnectionCallable()
Get a single ChannelConnection.
|
GoogleChannelConfig |
getGoogleChannelConfig(GetGoogleChannelConfigRequest request)
Get a GoogleChannelConfig
|
GoogleChannelConfig |
getGoogleChannelConfig(GoogleChannelConfigName name)
Get a GoogleChannelConfig
|
GoogleChannelConfig |
getGoogleChannelConfig(String name)
Get a GoogleChannelConfig
|
com.google.api.gax.rpc.UnaryCallable<GetGoogleChannelConfigRequest,GoogleChannelConfig> |
getGoogleChannelConfigCallable()
Get a GoogleChannelConfig
|
com.google.api.gax.httpjson.longrunning.OperationsClient |
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
Provider |
getProvider(GetProviderRequest request)
Get a single Provider.
|
Provider |
getProvider(ProviderName name)
Get a single Provider.
|
Provider |
getProvider(String name)
Get a single Provider.
|
com.google.api.gax.rpc.UnaryCallable<GetProviderRequest,Provider> |
getProviderCallable()
Get a single Provider.
|
EventarcSettings |
getSettings() |
EventarcStub |
getStub() |
Trigger |
getTrigger(GetTriggerRequest request)
Get a single trigger.
|
Trigger |
getTrigger(String name)
Get a single trigger.
|
Trigger |
getTrigger(TriggerName name)
Get a single trigger.
|
com.google.api.gax.rpc.UnaryCallable<GetTriggerRequest,Trigger> |
getTriggerCallable()
Get a single trigger.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
EventarcClient.ListChannelConnectionsPagedResponse |
listChannelConnections(ListChannelConnectionsRequest request)
List channel connections.
|
EventarcClient.ListChannelConnectionsPagedResponse |
listChannelConnections(LocationName parent)
List channel connections.
|
EventarcClient.ListChannelConnectionsPagedResponse |
listChannelConnections(String parent)
List channel connections.
|
com.google.api.gax.rpc.UnaryCallable<ListChannelConnectionsRequest,ListChannelConnectionsResponse> |
listChannelConnectionsCallable()
List channel connections.
|
com.google.api.gax.rpc.UnaryCallable<ListChannelConnectionsRequest,EventarcClient.ListChannelConnectionsPagedResponse> |
listChannelConnectionsPagedCallable()
List channel connections.
|
EventarcClient.ListChannelsPagedResponse |
listChannels(ListChannelsRequest request)
List channels.
|
EventarcClient.ListChannelsPagedResponse |
listChannels(LocationName parent)
List channels.
|
EventarcClient.ListChannelsPagedResponse |
listChannels(String parent)
List channels.
|
com.google.api.gax.rpc.UnaryCallable<ListChannelsRequest,ListChannelsResponse> |
listChannelsCallable()
List channels.
|
com.google.api.gax.rpc.UnaryCallable<ListChannelsRequest,EventarcClient.ListChannelsPagedResponse> |
listChannelsPagedCallable()
List channels.
|
EventarcClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,EventarcClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
EventarcClient.ListProvidersPagedResponse |
listProviders(ListProvidersRequest request)
List providers.
|
EventarcClient.ListProvidersPagedResponse |
listProviders(LocationName parent)
List providers.
|
EventarcClient.ListProvidersPagedResponse |
listProviders(String parent)
List providers.
|
com.google.api.gax.rpc.UnaryCallable<ListProvidersRequest,ListProvidersResponse> |
listProvidersCallable()
List providers.
|
com.google.api.gax.rpc.UnaryCallable<ListProvidersRequest,EventarcClient.ListProvidersPagedResponse> |
listProvidersPagedCallable()
List providers.
|
EventarcClient.ListTriggersPagedResponse |
listTriggers(ListTriggersRequest request)
List triggers.
|
EventarcClient.ListTriggersPagedResponse |
listTriggers(LocationName parent)
List triggers.
|
EventarcClient.ListTriggersPagedResponse |
listTriggers(String parent)
List triggers.
|
com.google.api.gax.rpc.UnaryCallable<ListTriggersRequest,ListTriggersResponse> |
listTriggersCallable()
List triggers.
|
com.google.api.gax.rpc.UnaryCallable<ListTriggersRequest,EventarcClient.ListTriggersPagedResponse> |
listTriggersPagedCallable()
List triggers.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
updateChannelAsync(Channel channel,
com.google.protobuf.FieldMask updateMask)
Update a single channel.
|
com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> |
updateChannelAsync(UpdateChannelRequest request)
Update a single channel.
|
com.google.api.gax.rpc.UnaryCallable<UpdateChannelRequest,com.google.longrunning.Operation> |
updateChannelCallable()
Update a single channel.
|
com.google.api.gax.rpc.OperationCallable<UpdateChannelRequest,Channel,OperationMetadata> |
updateChannelOperationCallable()
Update a single channel.
|
GoogleChannelConfig |
updateGoogleChannelConfig(GoogleChannelConfig googleChannelConfig,
com.google.protobuf.FieldMask updateMask)
Update a single GoogleChannelConfig
|
GoogleChannelConfig |
updateGoogleChannelConfig(UpdateGoogleChannelConfigRequest request)
Update a single GoogleChannelConfig
|
com.google.api.gax.rpc.UnaryCallable<UpdateGoogleChannelConfigRequest,GoogleChannelConfig> |
updateGoogleChannelConfigCallable()
Update a single GoogleChannelConfig
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
updateTriggerAsync(Trigger trigger,
com.google.protobuf.FieldMask updateMask,
boolean allowMissing)
Update a single trigger.
|
com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> |
updateTriggerAsync(UpdateTriggerRequest request)
Update a single trigger.
|
com.google.api.gax.rpc.UnaryCallable<UpdateTriggerRequest,com.google.longrunning.Operation> |
updateTriggerCallable()
Update a single trigger.
|
com.google.api.gax.rpc.OperationCallable<UpdateTriggerRequest,Trigger,OperationMetadata> |
updateTriggerOperationCallable()
Update a single trigger.
|
protected EventarcClient(EventarcSettings settings) throws IOException
IOExceptionprotected EventarcClient(EventarcStub stub)
public static final EventarcClient create() throws IOException
IOExceptionpublic static final EventarcClient create(EventarcSettings settings) throws IOException
IOExceptionpublic static final EventarcClient create(EventarcStub stub)
public final EventarcSettings getSettings()
public EventarcStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
public final Trigger getTrigger(TriggerName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
Trigger response = eventarcClient.getTrigger(name);
}
name - Required. The name of the trigger to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Trigger getTrigger(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString();
Trigger response = eventarcClient.getTrigger(name);
}
name - Required. The name of the trigger to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Trigger getTrigger(GetTriggerRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetTriggerRequest request =
GetTriggerRequest.newBuilder()
.setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
.build();
Trigger response = eventarcClient.getTrigger(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<GetTriggerRequest,Trigger> getTriggerCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetTriggerRequest request =
GetTriggerRequest.newBuilder()
.setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
.build();
ApiFuture<Trigger> future = eventarcClient.getTriggerCallable().futureCall(request);
// Do something.
Trigger response = future.get();
}
public final EventarcClient.ListTriggersPagedResponse listTriggers(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection to list triggers on.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListTriggersPagedResponse listTriggers(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Trigger element : eventarcClient.listTriggers(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection to list triggers on.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListTriggersPagedResponse listTriggers(ListTriggersRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListTriggersRequest request =
ListTriggersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
for (Trigger element : eventarcClient.listTriggers(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<ListTriggersRequest,EventarcClient.ListTriggersPagedResponse> listTriggersPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListTriggersRequest request =
ListTriggersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
ApiFuture<Trigger> future = eventarcClient.listTriggersPagedCallable().futureCall(request);
// Do something.
for (Trigger element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListTriggersRequest,ListTriggersResponse> listTriggersCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListTriggersRequest request =
ListTriggersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
while (true) {
ListTriggersResponse response = eventarcClient.listTriggersCallable().call(request);
for (Trigger element : response.getTriggersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> createTriggerAsync(LocationName parent, Trigger trigger, String triggerId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Trigger trigger = Trigger.newBuilder().build();
String triggerId = "triggerId-648752909";
Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get();
}
parent - Required. The parent collection in which to add this trigger.trigger - Required. The trigger to create.triggerId - Required. The user-provided ID to be assigned to the trigger.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> createTriggerAsync(String parent, Trigger trigger, String triggerId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Trigger trigger = Trigger.newBuilder().build();
String triggerId = "triggerId-648752909";
Trigger response = eventarcClient.createTriggerAsync(parent, trigger, triggerId).get();
}
parent - Required. The parent collection in which to add this trigger.trigger - Required. The trigger to create.triggerId - Required. The user-provided ID to be assigned to the trigger.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> createTriggerAsync(CreateTriggerRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateTriggerRequest request =
CreateTriggerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTrigger(Trigger.newBuilder().build())
.setTriggerId("triggerId-648752909")
.setValidateOnly(true)
.build();
Trigger response = eventarcClient.createTriggerAsync(request).get();
}
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.OperationCallable<CreateTriggerRequest,Trigger,OperationMetadata> createTriggerOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateTriggerRequest request =
CreateTriggerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTrigger(Trigger.newBuilder().build())
.setTriggerId("triggerId-648752909")
.setValidateOnly(true)
.build();
OperationFuture<Trigger, OperationMetadata> future =
eventarcClient.createTriggerOperationCallable().futureCall(request);
// Do something.
Trigger response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateTriggerRequest,com.google.longrunning.Operation> createTriggerCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateTriggerRequest request =
CreateTriggerRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setTrigger(Trigger.newBuilder().build())
.setTriggerId("triggerId-648752909")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.createTriggerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> updateTriggerAsync(Trigger trigger, com.google.protobuf.FieldMask updateMask, boolean allowMissing)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
Trigger trigger = Trigger.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
boolean allowMissing = true;
Trigger response = eventarcClient.updateTriggerAsync(trigger, updateMask, allowMissing).get();
}
trigger - The trigger to be updated.updateMask - The fields to be updated; only fields explicitly provided are updated. If no
field mask is provided, all provided fields in the request are updated. To update all
fields, provide a field mask of "*".allowMissing - If set to true, and the trigger is not found, a new trigger will be
created. In this situation, `update_mask` is ignored.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> updateTriggerAsync(UpdateTriggerRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateTriggerRequest request =
UpdateTriggerRequest.newBuilder()
.setTrigger(Trigger.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setValidateOnly(true)
.build();
Trigger response = eventarcClient.updateTriggerAsync(request).get();
}
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.OperationCallable<UpdateTriggerRequest,Trigger,OperationMetadata> updateTriggerOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateTriggerRequest request =
UpdateTriggerRequest.newBuilder()
.setTrigger(Trigger.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setValidateOnly(true)
.build();
OperationFuture<Trigger, OperationMetadata> future =
eventarcClient.updateTriggerOperationCallable().futureCall(request);
// Do something.
Trigger response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateTriggerRequest,com.google.longrunning.Operation> updateTriggerCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateTriggerRequest request =
UpdateTriggerRequest.newBuilder()
.setTrigger(Trigger.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setAllowMissing(true)
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.updateTriggerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> deleteTriggerAsync(TriggerName name, boolean allowMissing)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
TriggerName name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]");
boolean allowMissing = true;
Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get();
}
name - Required. The name of the trigger to be deleted.allowMissing - If set to true, and the trigger is not found, the request will succeed but
no action will be taken on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> deleteTriggerAsync(String name, boolean allowMissing)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString();
boolean allowMissing = true;
Trigger response = eventarcClient.deleteTriggerAsync(name, allowMissing).get();
}
name - Required. The name of the trigger to be deleted.allowMissing - If set to true, and the trigger is not found, the request will succeed but
no action will be taken on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Trigger,OperationMetadata> deleteTriggerAsync(DeleteTriggerRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteTriggerRequest request =
DeleteTriggerRequest.newBuilder()
.setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
.setEtag("etag3123477")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
Trigger response = eventarcClient.deleteTriggerAsync(request).get();
}
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.OperationCallable<DeleteTriggerRequest,Trigger,OperationMetadata> deleteTriggerOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteTriggerRequest request =
DeleteTriggerRequest.newBuilder()
.setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
.setEtag("etag3123477")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
OperationFuture<Trigger, OperationMetadata> future =
eventarcClient.deleteTriggerOperationCallable().futureCall(request);
// Do something.
Trigger response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteTriggerRequest,com.google.longrunning.Operation> deleteTriggerCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteTriggerRequest request =
DeleteTriggerRequest.newBuilder()
.setName(TriggerName.of("[PROJECT]", "[LOCATION]", "[TRIGGER]").toString())
.setEtag("etag3123477")
.setAllowMissing(true)
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.deleteTriggerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Channel getChannel(ChannelName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]");
Channel response = eventarcClient.getChannel(name);
}
name - Required. The name of the channel to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Channel getChannel(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString();
Channel response = eventarcClient.getChannel(name);
}
name - Required. The name of the channel to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Channel getChannel(GetChannelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetChannelRequest request =
GetChannelRequest.newBuilder()
.setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.build();
Channel response = eventarcClient.getChannel(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<GetChannelRequest,Channel> getChannelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetChannelRequest request =
GetChannelRequest.newBuilder()
.setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.build();
ApiFuture<Channel> future = eventarcClient.getChannelCallable().futureCall(request);
// Do something.
Channel response = future.get();
}
public final EventarcClient.ListChannelsPagedResponse listChannels(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Channel element : eventarcClient.listChannels(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection to list channels on.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListChannelsPagedResponse listChannels(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Channel element : eventarcClient.listChannels(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection to list channels on.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListChannelsPagedResponse listChannels(ListChannelsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelsRequest request =
ListChannelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
for (Channel element : eventarcClient.listChannels(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<ListChannelsRequest,EventarcClient.ListChannelsPagedResponse> listChannelsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelsRequest request =
ListChannelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
ApiFuture<Channel> future = eventarcClient.listChannelsPagedCallable().futureCall(request);
// Do something.
for (Channel element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListChannelsRequest,ListChannelsResponse> listChannelsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelsRequest request =
ListChannelsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.build();
while (true) {
ListChannelsResponse response = eventarcClient.listChannelsCallable().call(request);
for (Channel element : response.getChannelsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> createChannelAsync(LocationName parent, Channel channel, String channelId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
Channel channel = Channel.newBuilder().build();
String channelId = "channelId1461735806";
Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get();
}
parent - Required. The parent collection in which to add this channel.channel - Required. The channel to create.channelId - Required. The user-provided ID to be assigned to the channel.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> createChannelAsync(String parent, Channel channel, String channelId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
Channel channel = Channel.newBuilder().build();
String channelId = "channelId1461735806";
Channel response = eventarcClient.createChannelAsync(parent, channel, channelId).get();
}
parent - Required. The parent collection in which to add this channel.channel - Required. The channel to create.channelId - Required. The user-provided ID to be assigned to the channel.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> createChannelAsync(CreateChannelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelRequest request =
CreateChannelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannel(Channel.newBuilder().build())
.setChannelId("channelId1461735806")
.setValidateOnly(true)
.build();
Channel response = eventarcClient.createChannelAsync(request).get();
}
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.OperationCallable<CreateChannelRequest,Channel,OperationMetadata> createChannelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelRequest request =
CreateChannelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannel(Channel.newBuilder().build())
.setChannelId("channelId1461735806")
.setValidateOnly(true)
.build();
OperationFuture<Channel, OperationMetadata> future =
eventarcClient.createChannelOperationCallable().futureCall(request);
// Do something.
Channel response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateChannelRequest,com.google.longrunning.Operation> createChannelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelRequest request =
CreateChannelRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannel(Channel.newBuilder().build())
.setChannelId("channelId1461735806")
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.createChannelCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> updateChannelAsync(Channel channel, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
Channel channel = Channel.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Channel response = eventarcClient.updateChannelAsync(channel, updateMask).get();
}
channel - The channel to be updated.updateMask - The fields to be updated; only fields explicitly provided are updated. If no
field mask is provided, all provided fields in the request are updated. To update all
fields, provide a field mask of "*".com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> updateChannelAsync(UpdateChannelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateChannelRequest request =
UpdateChannelRequest.newBuilder()
.setChannel(Channel.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
Channel response = eventarcClient.updateChannelAsync(request).get();
}
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.OperationCallable<UpdateChannelRequest,Channel,OperationMetadata> updateChannelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateChannelRequest request =
UpdateChannelRequest.newBuilder()
.setChannel(Channel.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
OperationFuture<Channel, OperationMetadata> future =
eventarcClient.updateChannelOperationCallable().futureCall(request);
// Do something.
Channel response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateChannelRequest,com.google.longrunning.Operation> updateChannelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateChannelRequest request =
UpdateChannelRequest.newBuilder()
.setChannel(Channel.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.updateChannelCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> deleteChannelAsync(ChannelName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ChannelName name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]");
Channel response = eventarcClient.deleteChannelAsync(name).get();
}
name - Required. The name of the channel to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> deleteChannelAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString();
Channel response = eventarcClient.deleteChannelAsync(name).get();
}
name - Required. The name of the channel to be deleted.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<Channel,OperationMetadata> deleteChannelAsync(DeleteChannelRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelRequest request =
DeleteChannelRequest.newBuilder()
.setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setValidateOnly(true)
.build();
Channel response = eventarcClient.deleteChannelAsync(request).get();
}
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.OperationCallable<DeleteChannelRequest,Channel,OperationMetadata> deleteChannelOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelRequest request =
DeleteChannelRequest.newBuilder()
.setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setValidateOnly(true)
.build();
OperationFuture<Channel, OperationMetadata> future =
eventarcClient.deleteChannelOperationCallable().futureCall(request);
// Do something.
Channel response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteChannelRequest,com.google.longrunning.Operation> deleteChannelCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelRequest request =
DeleteChannelRequest.newBuilder()
.setName(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setValidateOnly(true)
.build();
ApiFuture<Operation> future = eventarcClient.deleteChannelCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final Provider getProvider(ProviderName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ProviderName name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]");
Provider response = eventarcClient.getProvider(name);
}
name - Required. The name of the provider to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Provider getProvider(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString();
Provider response = eventarcClient.getProvider(name);
}
name - Required. The name of the provider to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Provider getProvider(GetProviderRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetProviderRequest request =
GetProviderRequest.newBuilder()
.setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
.build();
Provider response = eventarcClient.getProvider(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<GetProviderRequest,Provider> getProviderCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetProviderRequest request =
GetProviderRequest.newBuilder()
.setName(ProviderName.of("[PROJECT]", "[LOCATION]", "[PROVIDER]").toString())
.build();
ApiFuture<Provider> future = eventarcClient.getProviderCallable().futureCall(request);
// Do something.
Provider response = future.get();
}
public final EventarcClient.ListProvidersPagedResponse listProviders(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the provider to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListProvidersPagedResponse listProviders(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (Provider element : eventarcClient.listProviders(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent of the provider to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListProvidersPagedResponse listProviders(ListProvidersRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListProvidersRequest request =
ListProvidersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
for (Provider element : eventarcClient.listProviders(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<ListProvidersRequest,EventarcClient.ListProvidersPagedResponse> listProvidersPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListProvidersRequest request =
ListProvidersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
ApiFuture<Provider> future = eventarcClient.listProvidersPagedCallable().futureCall(request);
// Do something.
for (Provider element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListProvidersRequest,ListProvidersResponse> listProvidersCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListProvidersRequest request =
ListProvidersRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setOrderBy("orderBy-1207110587")
.setFilter("filter-1274492040")
.build();
while (true) {
ListProvidersResponse response = eventarcClient.listProvidersCallable().call(request);
for (Provider element : response.getProvidersList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ChannelConnection getChannelConnection(ChannelConnectionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ChannelConnectionName name =
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]");
ChannelConnection response = eventarcClient.getChannelConnection(name);
}
name - Required. The name of the channel connection to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ChannelConnection getChannelConnection(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name =
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString();
ChannelConnection response = eventarcClient.getChannelConnection(name);
}
name - Required. The name of the channel connection to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ChannelConnection getChannelConnection(GetChannelConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetChannelConnectionRequest request =
GetChannelConnectionRequest.newBuilder()
.setName(
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
.toString())
.build();
ChannelConnection response = eventarcClient.getChannelConnection(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<GetChannelConnectionRequest,ChannelConnection> getChannelConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetChannelConnectionRequest request =
GetChannelConnectionRequest.newBuilder()
.setName(
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
.toString())
.build();
ApiFuture<ChannelConnection> future =
eventarcClient.getChannelConnectionCallable().futureCall(request);
// Do something.
ChannelConnection response = future.get();
}
public final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection from which to list channel connections.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (ChannelConnection element : eventarcClient.listChannelConnections(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The parent collection from which to list channel connections.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EventarcClient.ListChannelConnectionsPagedResponse listChannelConnections(ListChannelConnectionsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelConnectionsRequest request =
ListChannelConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (ChannelConnection element :
eventarcClient.listChannelConnections(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<ListChannelConnectionsRequest,EventarcClient.ListChannelConnectionsPagedResponse> listChannelConnectionsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelConnectionsRequest request =
ListChannelConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ChannelConnection> future =
eventarcClient.listChannelConnectionsPagedCallable().futureCall(request);
// Do something.
for (ChannelConnection element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListChannelConnectionsRequest,ListChannelConnectionsResponse> listChannelConnectionsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListChannelConnectionsRequest request =
ListChannelConnectionsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListChannelConnectionsResponse response =
eventarcClient.listChannelConnectionsCallable().call(request);
for (ChannelConnection element : response.getChannelConnectionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> createChannelConnectionAsync(LocationName parent, ChannelConnection channelConnection, String channelConnectionId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ChannelConnection channelConnection = ChannelConnection.newBuilder().build();
String channelConnectionId = "channelConnectionId-1246974660";
ChannelConnection response =
eventarcClient
.createChannelConnectionAsync(parent, channelConnection, channelConnectionId)
.get();
}
parent - Required. The parent collection in which to add this channel connection.channelConnection - Required. Channel connection to create.channelConnectionId - Required. The user-provided ID to be assigned to the channel
connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> createChannelConnectionAsync(String parent, ChannelConnection channelConnection, String channelConnectionId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
ChannelConnection channelConnection = ChannelConnection.newBuilder().build();
String channelConnectionId = "channelConnectionId-1246974660";
ChannelConnection response =
eventarcClient
.createChannelConnectionAsync(parent, channelConnection, channelConnectionId)
.get();
}
parent - Required. The parent collection in which to add this channel connection.channelConnection - Required. Channel connection to create.channelConnectionId - Required. The user-provided ID to be assigned to the channel
connection.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> createChannelConnectionAsync(CreateChannelConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelConnectionRequest request =
CreateChannelConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannelConnection(ChannelConnection.newBuilder().build())
.setChannelConnectionId("channelConnectionId-1246974660")
.build();
ChannelConnection response = eventarcClient.createChannelConnectionAsync(request).get();
}
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.OperationCallable<CreateChannelConnectionRequest,ChannelConnection,OperationMetadata> createChannelConnectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelConnectionRequest request =
CreateChannelConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannelConnection(ChannelConnection.newBuilder().build())
.setChannelConnectionId("channelConnectionId-1246974660")
.build();
OperationFuture<ChannelConnection, OperationMetadata> future =
eventarcClient.createChannelConnectionOperationCallable().futureCall(request);
// Do something.
ChannelConnection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateChannelConnectionRequest,com.google.longrunning.Operation> createChannelConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
CreateChannelConnectionRequest request =
CreateChannelConnectionRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setChannelConnection(ChannelConnection.newBuilder().build())
.setChannelConnectionId("channelConnectionId-1246974660")
.build();
ApiFuture<Operation> future =
eventarcClient.createChannelConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> deleteChannelConnectionAsync(ChannelConnectionName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ChannelConnectionName name =
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]");
ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get();
}
name - Required. The name of the channel connection to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> deleteChannelConnectionAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name =
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]").toString();
ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(name).get();
}
name - Required. The name of the channel connection to delete.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ChannelConnection,OperationMetadata> deleteChannelConnectionAsync(DeleteChannelConnectionRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelConnectionRequest request =
DeleteChannelConnectionRequest.newBuilder()
.setName(
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
.toString())
.build();
ChannelConnection response = eventarcClient.deleteChannelConnectionAsync(request).get();
}
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.OperationCallable<DeleteChannelConnectionRequest,ChannelConnection,OperationMetadata> deleteChannelConnectionOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelConnectionRequest request =
DeleteChannelConnectionRequest.newBuilder()
.setName(
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
.toString())
.build();
OperationFuture<ChannelConnection, OperationMetadata> future =
eventarcClient.deleteChannelConnectionOperationCallable().futureCall(request);
// Do something.
ChannelConnection response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteChannelConnectionRequest,com.google.longrunning.Operation> deleteChannelConnectionCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
DeleteChannelConnectionRequest request =
DeleteChannelConnectionRequest.newBuilder()
.setName(
ChannelConnectionName.of("[PROJECT]", "[LOCATION]", "[CHANNEL_CONNECTION]")
.toString())
.build();
ApiFuture<Operation> future =
eventarcClient.deleteChannelConnectionCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final GoogleChannelConfig getGoogleChannelConfig(GoogleChannelConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GoogleChannelConfigName name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]");
GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
}
name - Required. The name of the config to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GoogleChannelConfig getGoogleChannelConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
String name = GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString();
GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(name);
}
name - Required. The name of the config to get.com.google.api.gax.rpc.ApiException - if the remote call failspublic final GoogleChannelConfig getGoogleChannelConfig(GetGoogleChannelConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetGoogleChannelConfigRequest request =
GetGoogleChannelConfigRequest.newBuilder()
.setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
GoogleChannelConfig response = eventarcClient.getGoogleChannelConfig(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<GetGoogleChannelConfigRequest,GoogleChannelConfig> getGoogleChannelConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetGoogleChannelConfigRequest request =
GetGoogleChannelConfigRequest.newBuilder()
.setName(GoogleChannelConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<GoogleChannelConfig> future =
eventarcClient.getGoogleChannelConfigCallable().futureCall(request);
// Do something.
GoogleChannelConfig response = future.get();
}
public final GoogleChannelConfig updateGoogleChannelConfig(GoogleChannelConfig googleChannelConfig, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GoogleChannelConfig googleChannelConfig = GoogleChannelConfig.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
GoogleChannelConfig response =
eventarcClient.updateGoogleChannelConfig(googleChannelConfig, updateMask);
}
googleChannelConfig - Required. The config to be updated.updateMask - The fields to be updated; only fields explicitly provided are updated. If no
field mask is provided, all provided fields in the request are updated. To update all
fields, provide a field mask of "*".com.google.api.gax.rpc.ApiException - if the remote call failspublic final GoogleChannelConfig updateGoogleChannelConfig(UpdateGoogleChannelConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateGoogleChannelConfigRequest request =
UpdateGoogleChannelConfigRequest.newBuilder()
.setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
GoogleChannelConfig response = eventarcClient.updateGoogleChannelConfig(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<UpdateGoogleChannelConfigRequest,GoogleChannelConfig> updateGoogleChannelConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
UpdateGoogleChannelConfigRequest request =
UpdateGoogleChannelConfigRequest.newBuilder()
.setGoogleChannelConfig(GoogleChannelConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<GoogleChannelConfig> future =
eventarcClient.updateGoogleChannelConfigCallable().futureCall(request);
// Do something.
GoogleChannelConfig response = future.get();
}
public final EventarcClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : eventarcClient.listLocations(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<com.google.cloud.location.ListLocationsRequest,EventarcClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future = eventarcClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = eventarcClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = eventarcClient.getLocation(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<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = eventarcClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = eventarcClient.setIamPolicy(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<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future = eventarcClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = eventarcClient.getIamPolicy(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<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future = eventarcClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = eventarcClient.testIamPermissions(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<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EventarcClient eventarcClient = EventarcClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(ChannelName.of("[PROJECT]", "[LOCATION]", "[CHANNEL]").toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
eventarcClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2023 Google LLC. All rights reserved.