Struct aws_sdk_rbin::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Recycle Bin
Client for invoking operations on Amazon Recycle Bin. Each operation on Amazon Recycle Bin is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_rbin::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::retry::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_rbin::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_rbin::Client::from_conf(config);
Implementations§
source§impl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
source§impl Client
impl Client
sourcepub fn create_rule(&self) -> CreateRule
pub fn create_rule(&self) -> CreateRule
Constructs a fluent builder for the CreateRule
operation.
- The fluent builder is configurable:
retention_period(RetentionPeriod)
/set_retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
description(impl Into<String>)
/set_description(Option<String>)
:The retention rule description.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:Information about the tags to assign to the retention rule.
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:The resource type to be retained by the retention rule. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To retain snapshots, specify
EBS_SNAPSHOT
. To retain EBS-backed AMIs, specifyEC2_IMAGE
.resource_tags(Vec<ResourceTag>)
/set_resource_tags(Option<Vec<ResourceTag>>)
:Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.
You can add the same tag key and value pair to a maximum or five retention rules.
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.
lock_configuration(LockConfiguration)
/set_lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
- On success, responds with
CreateRuleOutput
with field(s):identifier(Option<String>)
:The unique ID of the retention rule.
retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
description(Option<String>)
:The retention rule description.
tags(Option<Vec<Tag>>)
:Information about the tags assigned to the retention rule.
resource_type(Option<ResourceType>)
:The resource type retained by the retention rule.
resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
status(Option<RuleStatus>)
:The state of the retention rule. Only retention rules that are in the
available
state retain resources.lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
lock_state(Option<LockState>)
:The lock state for the retention rule.
-
locked
- The retention rule is locked and can’t be modified or deleted. -
pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired. -
unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions. -
null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
-
- On failure, responds with
SdkError<CreateRuleError>
sourcepub fn delete_rule(&self) -> DeleteRule
pub fn delete_rule(&self) -> DeleteRule
Constructs a fluent builder for the DeleteRule
operation.
- The fluent builder is configurable:
identifier(impl Into<String>)
/set_identifier(Option<String>)
:The unique ID of the retention rule.
- On success, responds with
DeleteRuleOutput
- On failure, responds with
SdkError<DeleteRuleError>
sourcepub fn get_rule(&self) -> GetRule
pub fn get_rule(&self) -> GetRule
Constructs a fluent builder for the GetRule
operation.
- The fluent builder is configurable:
identifier(impl Into<String>)
/set_identifier(Option<String>)
:The unique ID of the retention rule.
- On success, responds with
GetRuleOutput
with field(s):identifier(Option<String>)
:The unique ID of the retention rule.
description(Option<String>)
:The retention rule description.
resource_type(Option<ResourceType>)
:The resource type retained by the retention rule.
retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
status(Option<RuleStatus>)
:The state of the retention rule. Only retention rules that are in the
available
state retain resources.lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
lock_state(Option<LockState>)
:The lock state for the retention rule.
-
locked
- The retention rule is locked and can’t be modified or deleted. -
pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired. -
unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions. -
null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
-
lock_end_time(Option<DateTime>)
:The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.
- On failure, responds with
SdkError<GetRuleError>
sourcepub fn list_rules(&self) -> ListRules
pub fn list_rules(&self) -> ListRules
Constructs a fluent builder for the ListRules
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned
NextToken
value.next_token(impl Into<String>)
/set_next_token(Option<String>)
:The token for the next page of results.
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:The resource type retained by the retention rule. Only retention rules that retain the specified resource type are listed. Currently, only Amazon EBS snapshots and EBS-backed AMIs are supported. To list retention rules that retain snapshots, specify
EBS_SNAPSHOT
. To list retention rules that retain EBS-backed AMIs, specifyEC2_IMAGE
.resource_tags(Vec<ResourceTag>)
/set_resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
lock_state(LockState)
/set_lock_state(Option<LockState>)
:The lock state of the retention rules to list. Only retention rules with the specified lock state are returned.
- On success, responds with
ListRulesOutput
with field(s):rules(Option<Vec<RuleSummary>>)
:Information about the retention rules.
next_token(Option<String>)
:The token to use to retrieve the next page of results. This value is
null
when there are no more results to return.
- On failure, responds with
SdkError<ListRulesError>
Constructs a fluent builder for the ListTagsForResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the retention rule.
- On success, responds with
ListTagsForResourceOutput
with field(s):tags(Option<Vec<Tag>>)
:Information about the tags assigned to the retention rule.
- On failure, responds with
SdkError<ListTagsForResourceError>
sourcepub fn lock_rule(&self) -> LockRule
pub fn lock_rule(&self) -> LockRule
Constructs a fluent builder for the LockRule
operation.
- The fluent builder is configurable:
identifier(impl Into<String>)
/set_identifier(Option<String>)
:The unique ID of the retention rule.
lock_configuration(LockConfiguration)
/set_lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
- On success, responds with
LockRuleOutput
with field(s):identifier(Option<String>)
:The unique ID of the retention rule.
description(Option<String>)
:The retention rule description.
resource_type(Option<ResourceType>)
:The resource type retained by the retention rule.
retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
status(Option<RuleStatus>)
:The state of the retention rule. Only retention rules that are in the
available
state retain resources.lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
lock_state(Option<LockState>)
:The lock state for the retention rule.
-
locked
- The retention rule is locked and can’t be modified or deleted. -
pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired. -
unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions. -
null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
-
- On failure, responds with
SdkError<LockRuleError>
sourcepub fn tag_resource(&self) -> TagResource
pub fn tag_resource(&self) -> TagResource
Constructs a fluent builder for the TagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the retention rule.
tags(Vec<Tag>)
/set_tags(Option<Vec<Tag>>)
:Information about the tags to assign to the retention rule.
- On success, responds with
TagResourceOutput
- On failure, responds with
SdkError<TagResourceError>
sourcepub fn unlock_rule(&self) -> UnlockRule
pub fn unlock_rule(&self) -> UnlockRule
Constructs a fluent builder for the UnlockRule
operation.
- The fluent builder is configurable:
identifier(impl Into<String>)
/set_identifier(Option<String>)
:The unique ID of the retention rule.
- On success, responds with
UnlockRuleOutput
with field(s):identifier(Option<String>)
:The unique ID of the retention rule.
description(Option<String>)
:The retention rule description.
resource_type(Option<ResourceType>)
:The resource type retained by the retention rule.
retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
status(Option<RuleStatus>)
:The state of the retention rule. Only retention rules that are in the
available
state retain resources.lock_configuration(Option<LockConfiguration>)
:Information about the retention rule lock configuration.
lock_state(Option<LockState>)
:The lock state for the retention rule.
-
locked
- The retention rule is locked and can’t be modified or deleted. -
pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired. -
unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions. -
null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
-
lock_end_time(Option<DateTime>)
:The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.
- On failure, responds with
SdkError<UnlockRuleError>
sourcepub fn untag_resource(&self) -> UntagResource
pub fn untag_resource(&self) -> UntagResource
Constructs a fluent builder for the UntagResource
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:The Amazon Resource Name (ARN) of the retention rule.
tag_keys(Vec<String>)
/set_tag_keys(Option<Vec<String>>)
:The tag keys of the tags to unassign. All tags that have the specified tag key are unassigned.
- On success, responds with
UntagResourceOutput
- On failure, responds with
SdkError<UntagResourceError>
sourcepub fn update_rule(&self) -> UpdateRule
pub fn update_rule(&self) -> UpdateRule
Constructs a fluent builder for the UpdateRule
operation.
- The fluent builder is configurable:
identifier(impl Into<String>)
/set_identifier(Option<String>)
:The unique ID of the retention rule.
retention_period(RetentionPeriod)
/set_retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
description(impl Into<String>)
/set_description(Option<String>)
:The retention rule description.
resource_type(ResourceType)
/set_resource_type(Option<ResourceType>)
:This parameter is currently not supported. You can’t update a retention rule’s resource type after creation.
resource_tags(Vec<ResourceTag>)
/set_resource_tags(Option<Vec<ResourceTag>>)
:Specifies the resource tags to use to identify resources that are to be retained by a tag-level retention rule. For tag-level retention rules, only deleted resources, of the specified resource type, that have one or more of the specified tag key and value pairs are retained. If a resource is deleted, but it does not have any of the specified tag key and value pairs, it is immediately deleted without being retained by the retention rule.
You can add the same tag key and value pair to a maximum or five retention rules.
To create a Region-level retention rule, omit this parameter. A Region-level retention rule does not have any resource tags specified. It retains all deleted resources of the specified resource type in the Region in which the rule is created, even if the resources are not tagged.
- On success, responds with
UpdateRuleOutput
with field(s):identifier(Option<String>)
:The unique ID of the retention rule.
retention_period(Option<RetentionPeriod>)
:Information about the retention period for which the retention rule is to retain resources.
description(Option<String>)
:The retention rule description.
resource_type(Option<ResourceType>)
:The resource type retained by the retention rule.
resource_tags(Option<Vec<ResourceTag>>)
:Information about the resource tags used to identify resources that are retained by the retention rule.
status(Option<RuleStatus>)
:The state of the retention rule. Only retention rules that are in the
available
state retain resources.lock_state(Option<LockState>)
:The lock state for the retention rule.
-
locked
- The retention rule is locked and can’t be modified or deleted. -
pending_unlock
- The retention rule has been unlocked but it is still within the unlock delay period. The retention rule can be modified or deleted only after the unlock delay period has expired. -
unlocked
- The retention rule is unlocked and it can be modified or deleted by any user with the required permissions. -
null
- The retention rule has never been locked. Once a retention rule has been locked, it can transition between thelocked
andunlocked
states only; it can never transition back tonull
.
-
lock_end_time(Option<DateTime>)
:The date and time at which the unlock delay is set to expire. Only returned for retention rules that have been unlocked and that are still within the unlock delay period.
- On failure, responds with
SdkError<UpdateRuleError>
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.
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 if the
conf
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
conf
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.