Struct aws_sdk_codestarnotifications::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for AWS CodeStar Notifications
Client for invoking operations on AWS CodeStar Notifications. Each operation on AWS CodeStar Notifications is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_codestarnotifications::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_codestarnotifications::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the CreateNotificationRule
operation has
a Client::create_notification_rule
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.create_notification_rule()
.name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
source§impl Client
impl Client
sourcepub fn create_notification_rule(&self) -> CreateNotificationRuleFluentBuilder
pub fn create_notification_rule(&self) -> CreateNotificationRuleFluentBuilder
Constructs a fluent builder for the CreateNotificationRule
operation.
- The fluent builder is configurable:
name(impl Into<String>)
/set_name(Option<String>)
:
required: trueThe name for the notification rule. Notification rule names must be unique in your Amazon Web Services account.
event_type_ids(impl Into<String>)
/set_event_type_ids(Option<Vec::<String>>)
:
required: trueA list of event types associated with this notification rule. For a list of allowed events, see
EventTypeSummary
.resource(impl Into<String>)
/set_resource(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in CodePipeline, repositories in CodeCommit, and build projects in CodeBuild.
targets(Target)
/set_targets(Option<Vec::<Target>>)
:
required: trueA list of Amazon Resource Names (ARNs) of Amazon Simple Notification Service topics and Chatbot clients to associate with the notification rule.
detail_type(DetailType)
/set_detail_type(Option<DetailType>)
:
required: trueThe level of detail to include in the notifications for this resource.
BASIC
will include only the contents of the event as it would appear in Amazon CloudWatch.FULL
will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseA unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request with the same parameters is received and a token is included, the request returns information about the initial request that used that token.
The Amazon Web Services SDKs prepopulate client request tokens. If you are using an Amazon Web Services SDK, an idempotency token is created for you.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: falseA list of tags to apply to this notification rule. Key names cannot start with “
aws
”.status(NotificationRuleStatus)
/set_status(Option<NotificationRuleStatus>)
:
required: falseThe status of the notification rule. The default value is
ENABLED
. If the status is set toDISABLED
, notifications aren’t sent for the notification rule.
- On success, responds with
CreateNotificationRuleOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) of the notification rule.
- On failure, responds with
SdkError<CreateNotificationRuleError>
source§impl Client
impl Client
sourcepub fn delete_notification_rule(&self) -> DeleteNotificationRuleFluentBuilder
pub fn delete_notification_rule(&self) -> DeleteNotificationRuleFluentBuilder
Constructs a fluent builder for the DeleteNotificationRule
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule you want to delete.
- On success, responds with
DeleteNotificationRuleOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) of the deleted notification rule.
- On failure, responds with
SdkError<DeleteNotificationRuleError>
source§impl Client
impl Client
sourcepub fn delete_target(&self) -> DeleteTargetFluentBuilder
pub fn delete_target(&self) -> DeleteTargetFluentBuilder
Constructs a fluent builder for the DeleteTarget
operation.
- The fluent builder is configurable:
target_address(impl Into<String>)
/set_target_address(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client to delete.
force_unsubscribe_all(bool)
/set_force_unsubscribe_all(Option<bool>)
:
required: falseA Boolean value that can be used to delete all associations with this Chatbot topic. The default value is FALSE. If set to TRUE, all associations between that target and every notification rule in your Amazon Web Services account are deleted.
- On success, responds with
DeleteTargetOutput
- On failure, responds with
SdkError<DeleteTargetError>
source§impl Client
impl Client
sourcepub fn describe_notification_rule(
&self
) -> DescribeNotificationRuleFluentBuilder
pub fn describe_notification_rule( &self ) -> DescribeNotificationRuleFluentBuilder
Constructs a fluent builder for the DescribeNotificationRule
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule.
- On success, responds with
DescribeNotificationRuleOutput
with field(s):arn(String)
:The Amazon Resource Name (ARN) of the notification rule.
name(Option<String>)
:The name of the notification rule.
event_types(Option<Vec::<EventTypeSummary>>)
:A list of the event types associated with the notification rule.
resource(Option<String>)
:The Amazon Resource Name (ARN) of the resource associated with the notification rule.
targets(Option<Vec::<TargetSummary>>)
:A list of the Chatbot topics and Chatbot clients associated with the notification rule.
detail_type(Option<DetailType>)
:The level of detail included in the notifications for this resource. BASIC will include only the contents of the event as it would appear in Amazon CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
created_by(Option<String>)
:The name or email alias of the person who created the notification rule.
status(Option<NotificationRuleStatus>)
:The status of the notification rule. Valid statuses are on (sending notifications) or off (not sending notifications).
created_timestamp(Option<DateTime>)
:The date and time the notification rule was created, in timestamp format.
last_modified_timestamp(Option<DateTime>)
:The date and time the notification rule was most recently updated, in timestamp format.
tags(Option<HashMap::<String, String>>)
:The tags associated with the notification rule.
- On failure, responds with
SdkError<DescribeNotificationRuleError>
source§impl Client
impl Client
sourcepub fn list_event_types(&self) -> ListEventTypesFluentBuilder
pub fn list_event_types(&self) -> ListEventTypesFluentBuilder
Constructs a fluent builder for the ListEventTypes
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(ListEventTypesFilter)
/set_filters(Option<Vec::<ListEventTypesFilter>>)
:
required: falseThe filters to use to return information by service or resource type.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn enumeration token that, when provided in a request, returns the next batch of the results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseA non-negative integer used to limit the number of returned results. The default number is 50. The maximum number of results that can be returned is 100.
- On success, responds with
ListEventTypesOutput
with field(s):event_types(Option<Vec::<EventTypeSummary>>)
:Information about each event, including service name, resource type, event ID, and event name.
next_token(Option<String>)
:An enumeration token that can be used in a request to return the next batch of the results.
- On failure, responds with
SdkError<ListEventTypesError>
source§impl Client
impl Client
sourcepub fn list_notification_rules(&self) -> ListNotificationRulesFluentBuilder
pub fn list_notification_rules(&self) -> ListNotificationRulesFluentBuilder
Constructs a fluent builder for the ListNotificationRules
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(ListNotificationRulesFilter)
/set_filters(Option<Vec::<ListNotificationRulesFilter>>)
:
required: falseThe filters to use to return information by service or resource type. For valid values, see
ListNotificationRulesFilter
.A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn enumeration token that, when provided in a request, returns the next batch of the results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseA non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.
- On success, responds with
ListNotificationRulesOutput
with field(s):next_token(Option<String>)
:An enumeration token that can be used in a request to return the next batch of the results.
notification_rules(Option<Vec::<NotificationRuleSummary>>)
:The list of notification rules for the Amazon Web Services account, by Amazon Resource Name (ARN) and ID.
- On failure, responds with
SdkError<ListNotificationRulesError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) for the notification rule.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The tags associated with the notification rule.
- On failure, responds with
SdkError<ListTagsForResourceError>
source§impl Client
impl Client
sourcepub fn list_targets(&self) -> ListTargetsFluentBuilder
pub fn list_targets(&self) -> ListTargetsFluentBuilder
Constructs a fluent builder for the ListTargets
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
filters(ListTargetsFilter)
/set_filters(Option<Vec::<ListTargetsFilter>>)
:
required: falseThe filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.
A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: falseAn enumeration token that, when provided in a request, returns the next batch of the results.
max_results(i32)
/set_max_results(Option<i32>)
:
required: falseA non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.
- On success, responds with
ListTargetsOutput
with field(s):targets(Option<Vec::<TargetSummary>>)
:The list of notification rule targets.
next_token(Option<String>)
:An enumeration token that can be used in a request to return the next batch of results.
- On failure, responds with
SdkError<ListTargetsError>
source§impl Client
impl Client
sourcepub fn subscribe(&self) -> SubscribeFluentBuilder
pub fn subscribe(&self) -> SubscribeFluentBuilder
Constructs a fluent builder for the Subscribe
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule for which you want to create the association.
target(Target)
/set_target(Option<Target>)
:
required: trueInformation about the Chatbot topics or Chatbot clients associated with a notification rule.
client_request_token(impl Into<String>)
/set_client_request_token(Option<String>)
:
required: falseAn enumeration token that, when provided in a request, returns the next batch of the results.
- On success, responds with
SubscribeOutput
with field(s):arn(Option<String>)
:The Amazon Resource Name (ARN) of the notification rule for which you have created assocations.
- On failure, responds with
SdkError<SubscribeError>
source§impl Client
impl Client
sourcepub fn tag_resource(&self) -> TagResourceFluentBuilder
pub fn tag_resource(&self) -> TagResourceFluentBuilder
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule to tag.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueThe list of tags to associate with the resource. Tag key names cannot start with “
aws
”.
- On success, responds with
TagResourceOutput
with field(s):tags(Option<HashMap::<String, String>>)
:The list of tags associated with the resource.
- On failure, responds with
SdkError<TagResourceError>
source§impl Client
impl Client
sourcepub fn unsubscribe(&self) -> UnsubscribeFluentBuilder
pub fn unsubscribe(&self) -> UnsubscribeFluentBuilder
Constructs a fluent builder for the Unsubscribe
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule.
target_address(impl Into<String>)
/set_target_address(Option<String>)
:
required: trueThe ARN of the Chatbot topic to unsubscribe from the notification rule.
- On success, responds with
UnsubscribeOutput
with field(s):arn(String)
:The Amazon Resource Name (ARN) of the the notification rule from which you have removed a subscription.
- On failure, responds with
SdkError<UnsubscribeError>
source§impl Client
impl Client
sourcepub fn untag_resource(&self) -> UntagResourceFluentBuilder
pub fn untag_resource(&self) -> UntagResourceFluentBuilder
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule from which to remove the tags.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueThe key names of the tags to remove.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
source§impl Client
impl Client
sourcepub fn update_notification_rule(&self) -> UpdateNotificationRuleFluentBuilder
pub fn update_notification_rule(&self) -> UpdateNotificationRuleFluentBuilder
Constructs a fluent builder for the UpdateNotificationRule
operation.
- The fluent builder is configurable:
arn(impl Into<String>)
/set_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the notification rule.
name(impl Into<String>)
/set_name(Option<String>)
:
required: falseThe name of the notification rule.
status(NotificationRuleStatus)
/set_status(Option<NotificationRuleStatus>)
:
required: falseThe status of the notification rule. Valid statuses include enabled (sending notifications) or disabled (not sending notifications).
event_type_ids(impl Into<String>)
/set_event_type_ids(Option<Vec::<String>>)
:
required: falseA list of event types associated with this notification rule. For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide.
targets(Target)
/set_targets(Option<Vec::<Target>>)
:
required: falseThe address and type of the targets to receive notifications from this notification rule.
detail_type(DetailType)
/set_detail_type(Option<DetailType>)
:
required: falseThe level of detail to include in the notifications for this resource. BASIC will include only the contents of the event as it would appear in Amazon CloudWatch. FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.
- On success, responds with
UpdateNotificationRuleOutput
- On failure, responds with
SdkError<UpdateNotificationRuleError>
source§impl Client
impl Client
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
§Panics
This method will panic in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
§Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more