@Generated(value="software.amazon.awssdk:codegen") public interface CodestarNotificationsAsyncClient extends SdkClient
builder()
method.
This AWS CodeStar Notifications API Reference provides descriptions and usage examples of the operations and data types for the AWS CodeStar Notifications API. You can use the AWS CodeStar Notifications API to work with the following objects:
Notification rules, by calling the following:
CreateNotificationRule, which creates a notification rule for a resource in your account.
DeleteNotificationRule, which deletes a notification rule.
DescribeNotificationRule, which provides information about a notification rule.
ListNotificationRules, which lists the notification rules associated with your account.
UpdateNotificationRule, which changes the name, events, or targets associated with a notification rule.
Subscribe, which subscribes a target to a notification rule.
Unsubscribe, which removes a target from a notification rule.
Targets, by calling the following:
DeleteTarget, which removes a notification rule target (SNS topic) from a notification rule.
ListTargets, which lists the targets associated with a notification rule.
Events, by calling the following:
ListEventTypes, which lists the event types you can include in a notification rule.
Tags, by calling the following:
ListTagsForResource, which lists the tags already associated with a notification rule in your account.
TagResource, which associates a tag you provide with a notification rule in your account.
UntagResource, which removes a tag from a notification rule in your account.
For information about how to use AWS CodeStar Notifications, see link in the CodeStarNotifications User Guide.
Modifier and Type | Field and Description |
---|---|
static String |
SERVICE_METADATA_ID
Value for looking up the service's metadata from the
ServiceMetadataProvider . |
static String |
SERVICE_NAME |
Modifier and Type | Method and Description |
---|---|
static CodestarNotificationsAsyncClientBuilder |
builder()
Create a builder that can be used to configure and create a
CodestarNotificationsAsyncClient . |
static CodestarNotificationsAsyncClient |
create()
Create a
CodestarNotificationsAsyncClient with the region loaded from the
DefaultAwsRegionProviderChain and credentials loaded from the
DefaultCredentialsProvider . |
default CompletableFuture<CreateNotificationRuleResponse> |
createNotificationRule(Consumer<CreateNotificationRuleRequest.Builder> createNotificationRuleRequest)
Creates a notification rule for a resource.
|
default CompletableFuture<CreateNotificationRuleResponse> |
createNotificationRule(CreateNotificationRuleRequest createNotificationRuleRequest)
Creates a notification rule for a resource.
|
default CompletableFuture<DeleteNotificationRuleResponse> |
deleteNotificationRule(Consumer<DeleteNotificationRuleRequest.Builder> deleteNotificationRuleRequest)
Deletes a notification rule for a resource.
|
default CompletableFuture<DeleteNotificationRuleResponse> |
deleteNotificationRule(DeleteNotificationRuleRequest deleteNotificationRuleRequest)
Deletes a notification rule for a resource.
|
default CompletableFuture<DeleteTargetResponse> |
deleteTarget(Consumer<DeleteTargetRequest.Builder> deleteTargetRequest)
Deletes a specified target for notifications.
|
default CompletableFuture<DeleteTargetResponse> |
deleteTarget(DeleteTargetRequest deleteTargetRequest)
Deletes a specified target for notifications.
|
default CompletableFuture<DescribeNotificationRuleResponse> |
describeNotificationRule(Consumer<DescribeNotificationRuleRequest.Builder> describeNotificationRuleRequest)
Returns information about a specified notification rule.
|
default CompletableFuture<DescribeNotificationRuleResponse> |
describeNotificationRule(DescribeNotificationRuleRequest describeNotificationRuleRequest)
Returns information about a specified notification rule.
|
default CompletableFuture<ListEventTypesResponse> |
listEventTypes(Consumer<ListEventTypesRequest.Builder> listEventTypesRequest)
Returns information about the event types available for configuring notifications.
|
default CompletableFuture<ListEventTypesResponse> |
listEventTypes(ListEventTypesRequest listEventTypesRequest)
Returns information about the event types available for configuring notifications.
|
default ListEventTypesPublisher |
listEventTypesPaginator(Consumer<ListEventTypesRequest.Builder> listEventTypesRequest)
Returns information about the event types available for configuring notifications.
|
default ListEventTypesPublisher |
listEventTypesPaginator(ListEventTypesRequest listEventTypesRequest)
Returns information about the event types available for configuring notifications.
|
default CompletableFuture<ListNotificationRulesResponse> |
listNotificationRules(Consumer<ListNotificationRulesRequest.Builder> listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
|
default CompletableFuture<ListNotificationRulesResponse> |
listNotificationRules(ListNotificationRulesRequest listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
|
default ListNotificationRulesPublisher |
listNotificationRulesPaginator(Consumer<ListNotificationRulesRequest.Builder> listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
|
default ListNotificationRulesPublisher |
listNotificationRulesPaginator(ListNotificationRulesRequest listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
|
default CompletableFuture<ListTagsForResourceResponse> |
listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest)
Returns a list of the tags associated with a notification rule.
|
default CompletableFuture<ListTagsForResourceResponse> |
listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
Returns a list of the tags associated with a notification rule.
|
default CompletableFuture<ListTargetsResponse> |
listTargets(Consumer<ListTargetsRequest.Builder> listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
|
default CompletableFuture<ListTargetsResponse> |
listTargets(ListTargetsRequest listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
|
default ListTargetsPublisher |
listTargetsPaginator(Consumer<ListTargetsRequest.Builder> listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
|
default ListTargetsPublisher |
listTargetsPaginator(ListTargetsRequest listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
|
default CompletableFuture<SubscribeResponse> |
subscribe(Consumer<SubscribeRequest.Builder> subscribeRequest)
Creates an association between a notification rule and an SNS topic so that the associated target can receive
notifications when the events described in the rule are triggered.
|
default CompletableFuture<SubscribeResponse> |
subscribe(SubscribeRequest subscribeRequest)
Creates an association between a notification rule and an SNS topic so that the associated target can receive
notifications when the events described in the rule are triggered.
|
default CompletableFuture<TagResourceResponse> |
tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest)
Associates a set of provided tags with a notification rule.
|
default CompletableFuture<TagResourceResponse> |
tagResource(TagResourceRequest tagResourceRequest)
Associates a set of provided tags with a notification rule.
|
default CompletableFuture<UnsubscribeResponse> |
unsubscribe(Consumer<UnsubscribeRequest.Builder> unsubscribeRequest)
Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop
receiving notifications when the events described in the rule are triggered.
|
default CompletableFuture<UnsubscribeResponse> |
unsubscribe(UnsubscribeRequest unsubscribeRequest)
Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop
receiving notifications when the events described in the rule are triggered.
|
default CompletableFuture<UntagResourceResponse> |
untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest)
Removes the association between one or more provided tags and a notification rule.
|
default CompletableFuture<UntagResourceResponse> |
untagResource(UntagResourceRequest untagResourceRequest)
Removes the association between one or more provided tags and a notification rule.
|
default CompletableFuture<UpdateNotificationRuleResponse> |
updateNotificationRule(Consumer<UpdateNotificationRuleRequest.Builder> updateNotificationRuleRequest)
Updates a notification rule for a resource.
|
default CompletableFuture<UpdateNotificationRuleResponse> |
updateNotificationRule(UpdateNotificationRuleRequest updateNotificationRuleRequest)
Updates a notification rule for a resource.
|
serviceName
close
static final String SERVICE_NAME
static final String SERVICE_METADATA_ID
ServiceMetadataProvider
.static CodestarNotificationsAsyncClient create()
CodestarNotificationsAsyncClient
with the region loaded from the
DefaultAwsRegionProviderChain
and credentials loaded from the
DefaultCredentialsProvider
.static CodestarNotificationsAsyncClientBuilder builder()
CodestarNotificationsAsyncClient
.default CompletableFuture<CreateNotificationRuleResponse> createNotificationRule(CreateNotificationRuleRequest createNotificationRuleRequest)
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.
createNotificationRuleRequest
- default CompletableFuture<CreateNotificationRuleResponse> createNotificationRule(Consumer<CreateNotificationRuleRequest.Builder> createNotificationRuleRequest)
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as SNS topics) where you want to receive them.
This is a convenience which creates an instance of the CreateNotificationRuleRequest.Builder
avoiding the
need to create one manually via CreateNotificationRuleRequest.builder()
createNotificationRuleRequest
- A Consumer
that will call methods on CreateNotificationRuleRequest.Builder
to create a
request.default CompletableFuture<DeleteNotificationRuleResponse> deleteNotificationRule(DeleteNotificationRuleRequest deleteNotificationRuleRequest)
Deletes a notification rule for a resource.
deleteNotificationRuleRequest
- default CompletableFuture<DeleteNotificationRuleResponse> deleteNotificationRule(Consumer<DeleteNotificationRuleRequest.Builder> deleteNotificationRuleRequest)
Deletes a notification rule for a resource.
This is a convenience which creates an instance of the DeleteNotificationRuleRequest.Builder
avoiding the
need to create one manually via DeleteNotificationRuleRequest.builder()
deleteNotificationRuleRequest
- A Consumer
that will call methods on DeleteNotificationRuleRequest.Builder
to create a
request.default CompletableFuture<DeleteTargetResponse> deleteTarget(DeleteTargetRequest deleteTargetRequest)
Deletes a specified target for notifications.
deleteTargetRequest
- default CompletableFuture<DeleteTargetResponse> deleteTarget(Consumer<DeleteTargetRequest.Builder> deleteTargetRequest)
Deletes a specified target for notifications.
This is a convenience which creates an instance of the DeleteTargetRequest.Builder
avoiding the need to
create one manually via DeleteTargetRequest.builder()
deleteTargetRequest
- A Consumer
that will call methods on DeleteTargetRequest.Builder
to create a request.default CompletableFuture<DescribeNotificationRuleResponse> describeNotificationRule(DescribeNotificationRuleRequest describeNotificationRuleRequest)
Returns information about a specified notification rule.
describeNotificationRuleRequest
- default CompletableFuture<DescribeNotificationRuleResponse> describeNotificationRule(Consumer<DescribeNotificationRuleRequest.Builder> describeNotificationRuleRequest)
Returns information about a specified notification rule.
This is a convenience which creates an instance of the DescribeNotificationRuleRequest.Builder
avoiding
the need to create one manually via DescribeNotificationRuleRequest.builder()
describeNotificationRuleRequest
- A Consumer
that will call methods on DescribeNotificationRuleRequest.Builder
to create a
request.default CompletableFuture<ListEventTypesResponse> listEventTypes(ListEventTypesRequest listEventTypesRequest)
Returns information about the event types available for configuring notifications.
listEventTypesRequest
- default CompletableFuture<ListEventTypesResponse> listEventTypes(Consumer<ListEventTypesRequest.Builder> listEventTypesRequest)
Returns information about the event types available for configuring notifications.
This is a convenience which creates an instance of the ListEventTypesRequest.Builder
avoiding the need to
create one manually via ListEventTypesRequest.builder()
listEventTypesRequest
- A Consumer
that will call methods on ListEventTypesRequest.Builder
to create a request.default ListEventTypesPublisher listEventTypesPaginator(ListEventTypesRequest listEventTypesRequest)
Returns information about the event types available for configuring notifications.
This is a variant of
listEventTypes(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListEventTypesPublisher publisher = client.listEventTypesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListEventTypesPublisher publisher = client.listEventTypesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listEventTypes(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesRequest)
operation.
listEventTypesRequest
- default ListEventTypesPublisher listEventTypesPaginator(Consumer<ListEventTypesRequest.Builder> listEventTypesRequest)
Returns information about the event types available for configuring notifications.
This is a variant of
listEventTypes(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListEventTypesPublisher publisher = client.listEventTypesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListEventTypesPublisher publisher = client.listEventTypesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listEventTypes(software.amazon.awssdk.services.codestarnotifications.model.ListEventTypesRequest)
operation.
This is a convenience which creates an instance of the ListEventTypesRequest.Builder
avoiding the need to
create one manually via ListEventTypesRequest.builder()
listEventTypesRequest
- A Consumer
that will call methods on ListEventTypesRequest.Builder
to create a request.default CompletableFuture<ListNotificationRulesResponse> listNotificationRules(ListNotificationRulesRequest listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
listNotificationRulesRequest
- default CompletableFuture<ListNotificationRulesResponse> listNotificationRules(Consumer<ListNotificationRulesRequest.Builder> listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
This is a convenience which creates an instance of the ListNotificationRulesRequest.Builder
avoiding the
need to create one manually via ListNotificationRulesRequest.builder()
listNotificationRulesRequest
- A Consumer
that will call methods on ListNotificationRulesRequest.Builder
to create a
request.default ListNotificationRulesPublisher listNotificationRulesPaginator(ListNotificationRulesRequest listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
This is a variant of
listNotificationRules(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListNotificationRulesPublisher publisher = client.listNotificationRulesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListNotificationRulesPublisher publisher = client.listNotificationRulesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listNotificationRules(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesRequest)
operation.
listNotificationRulesRequest
- default ListNotificationRulesPublisher listNotificationRulesPaginator(Consumer<ListNotificationRulesRequest.Builder> listNotificationRulesRequest)
Returns a list of the notification rules for an AWS account.
This is a variant of
listNotificationRules(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesRequest)
operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
SDK will internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListNotificationRulesPublisher publisher = client.listNotificationRulesPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListNotificationRulesPublisher publisher = client.listNotificationRulesPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listNotificationRules(software.amazon.awssdk.services.codestarnotifications.model.ListNotificationRulesRequest)
operation.
This is a convenience which creates an instance of the ListNotificationRulesRequest.Builder
avoiding the
need to create one manually via ListNotificationRulesRequest.builder()
listNotificationRulesRequest
- A Consumer
that will call methods on ListNotificationRulesRequest.Builder
to create a
request.default CompletableFuture<ListTagsForResourceResponse> listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
Returns a list of the tags associated with a notification rule.
listTagsForResourceRequest
- default CompletableFuture<ListTagsForResourceResponse> listTagsForResource(Consumer<ListTagsForResourceRequest.Builder> listTagsForResourceRequest)
Returns a list of the tags associated with a notification rule.
This is a convenience which creates an instance of the ListTagsForResourceRequest.Builder
avoiding the
need to create one manually via ListTagsForResourceRequest.builder()
listTagsForResourceRequest
- A Consumer
that will call methods on ListTagsForResourceRequest.Builder
to create a
request.default CompletableFuture<ListTargetsResponse> listTargets(ListTargetsRequest listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
listTargetsRequest
- default CompletableFuture<ListTargetsResponse> listTargets(Consumer<ListTargetsRequest.Builder> listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
This is a convenience which creates an instance of the ListTargetsRequest.Builder
avoiding the need to
create one manually via ListTargetsRequest.builder()
listTargetsRequest
- A Consumer
that will call methods on ListTargetsRequest.Builder
to create a request.default ListTargetsPublisher listTargetsPaginator(ListTargetsRequest listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
This is a variant of
listTargets(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsRequest)
operation.
The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListTargetsPublisher publisher = client.listTargetsPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListTargetsPublisher publisher = client.listTargetsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListTargetsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listTargets(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsRequest)
operation.
listTargetsRequest
- default ListTargetsPublisher listTargetsPaginator(Consumer<ListTargetsRequest.Builder> listTargetsRequest)
Returns a list of the notification rule targets for an AWS account.
This is a variant of
listTargets(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsRequest)
operation.
The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
internally handle making service calls for you.
When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
failures only after you start streaming the data. The subscribe method should be called as a request to start
streaming data. For more info, see
Publisher.subscribe(org.reactivestreams.Subscriber)
. Each call to the subscribe
method will result in a new Subscription
i.e., a new contract to stream data from the
starting request.
The following are few ways to use the response class:
1) Using the subscribe helper method
software.amazon.awssdk.services.codestarnotifications.paginators.ListTargetsPublisher publisher = client.listTargetsPaginator(request);
CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
future.get();
2) Using a custom subscriber
software.amazon.awssdk.services.codestarnotifications.paginators.ListTargetsPublisher publisher = client.listTargetsPaginator(request);
publisher.subscribe(new Subscriber<software.amazon.awssdk.services.codestarnotifications.model.ListTargetsResponse>() {
public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
public void onNext(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsResponse response) { //... };
});
As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
Please notice that the configuration of MaxResults won't limit the number of results you get with the paginator. It only limits the number of results in each page.
Note: If you prefer to have control on service calls, use the
listTargets(software.amazon.awssdk.services.codestarnotifications.model.ListTargetsRequest)
operation.
This is a convenience which creates an instance of the ListTargetsRequest.Builder
avoiding the need to
create one manually via ListTargetsRequest.builder()
listTargetsRequest
- A Consumer
that will call methods on ListTargetsRequest.Builder
to create a request.default CompletableFuture<SubscribeResponse> subscribe(SubscribeRequest subscribeRequest)
Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.
subscribeRequest
- default CompletableFuture<SubscribeResponse> subscribe(Consumer<SubscribeRequest.Builder> subscribeRequest)
Creates an association between a notification rule and an SNS topic so that the associated target can receive notifications when the events described in the rule are triggered.
This is a convenience which creates an instance of the SubscribeRequest.Builder
avoiding the need to
create one manually via SubscribeRequest.builder()
subscribeRequest
- A Consumer
that will call methods on SubscribeRequest.Builder
to create a request.default CompletableFuture<TagResourceResponse> tagResource(TagResourceRequest tagResourceRequest)
Associates a set of provided tags with a notification rule.
tagResourceRequest
- default CompletableFuture<TagResourceResponse> tagResource(Consumer<TagResourceRequest.Builder> tagResourceRequest)
Associates a set of provided tags with a notification rule.
This is a convenience which creates an instance of the TagResourceRequest.Builder
avoiding the need to
create one manually via TagResourceRequest.builder()
tagResourceRequest
- A Consumer
that will call methods on TagResourceRequest.Builder
to create a request.default CompletableFuture<UnsubscribeResponse> unsubscribe(UnsubscribeRequest unsubscribeRequest)
Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.
unsubscribeRequest
- default CompletableFuture<UnsubscribeResponse> unsubscribe(Consumer<UnsubscribeRequest.Builder> unsubscribeRequest)
Removes an association between a notification rule and an Amazon SNS topic so that subscribers to that topic stop receiving notifications when the events described in the rule are triggered.
This is a convenience which creates an instance of the UnsubscribeRequest.Builder
avoiding the need to
create one manually via UnsubscribeRequest.builder()
unsubscribeRequest
- A Consumer
that will call methods on UnsubscribeRequest.Builder
to create a request.default CompletableFuture<UntagResourceResponse> untagResource(UntagResourceRequest untagResourceRequest)
Removes the association between one or more provided tags and a notification rule.
untagResourceRequest
- default CompletableFuture<UntagResourceResponse> untagResource(Consumer<UntagResourceRequest.Builder> untagResourceRequest)
Removes the association between one or more provided tags and a notification rule.
This is a convenience which creates an instance of the UntagResourceRequest.Builder
avoiding the need to
create one manually via UntagResourceRequest.builder()
untagResourceRequest
- A Consumer
that will call methods on UntagResourceRequest.Builder
to create a request.default CompletableFuture<UpdateNotificationRuleResponse> updateNotificationRule(UpdateNotificationRuleRequest updateNotificationRuleRequest)
Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.
To add or remove tags for a notification rule, you must use TagResource and UntagResource.
updateNotificationRuleRequest
- default CompletableFuture<UpdateNotificationRuleResponse> updateNotificationRule(Consumer<UpdateNotificationRuleRequest.Builder> updateNotificationRuleRequest)
Updates a notification rule for a resource. You can change the events that trigger the notification rule, the status of the rule, and the targets that receive the notifications.
To add or remove tags for a notification rule, you must use TagResource and UntagResource.
This is a convenience which creates an instance of the UpdateNotificationRuleRequest.Builder
avoiding the
need to create one manually via UpdateNotificationRuleRequest.builder()
updateNotificationRuleRequest
- A Consumer
that will call methods on UpdateNotificationRuleRequest.Builder
to create a
request.