Struct aws_sdk_firehose::client::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Kinesis Firehose
Client for invoking operations on Amazon Kinesis Firehose. Each operation on Amazon Kinesis Firehose 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_firehose::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_firehose::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 CreateDeliveryStream
operation has
a Client::create_delivery_stream
, 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_delivery_stream()
.delivery_stream_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_delivery_stream(&self) -> CreateDeliveryStreamFluentBuilder
pub fn create_delivery_stream(&self) -> CreateDeliveryStreamFluentBuilder
Constructs a fluent builder for the CreateDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream. This name must be unique per Amazon Web Services account in the same Amazon Web Services Region. If the delivery streams are in different accounts or different Regions, you can have multiple delivery streams with the same name.
delivery_stream_type(DeliveryStreamType)
/set_delivery_stream_type(Option<DeliveryStreamType>)
:
required: falseThe delivery stream type. This parameter can be one of the following values:
-
DirectPut
: Provider applications access the delivery stream directly. -
KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
-
kinesis_stream_source_configuration(KinesisStreamSourceConfiguration)
/set_kinesis_stream_source_configuration(Option<KinesisStreamSourceConfiguration>)
:
required: falseWhen a Kinesis data stream is used as the source for the delivery stream, a
KinesisStreamSourceConfiguration
containing the Kinesis data stream Amazon Resource Name (ARN) and the role ARN for the source stream.delivery_stream_encryption_configuration_input(DeliveryStreamEncryptionConfigurationInput)
/set_delivery_stream_encryption_configuration_input(Option<DeliveryStreamEncryptionConfigurationInput>)
:
required: falseUsed to specify the type and Amazon Resource Name (ARN) of the KMS key needed for Server-Side Encryption (SSE).
s3_destination_configuration(S3DestinationConfiguration)
/set_s3_destination_configuration(Option<S3DestinationConfiguration>)
:
required: false[Deprecated] The destination in Amazon S3. You can specify only one destination.
extended_s3_destination_configuration(ExtendedS3DestinationConfiguration)
/set_extended_s3_destination_configuration(Option<ExtendedS3DestinationConfiguration>)
:
required: falseThe destination in Amazon S3. You can specify only one destination.
redshift_destination_configuration(RedshiftDestinationConfiguration)
/set_redshift_destination_configuration(Option<RedshiftDestinationConfiguration>)
:
required: falseThe destination in Amazon Redshift. You can specify only one destination.
elasticsearch_destination_configuration(ElasticsearchDestinationConfiguration)
/set_elasticsearch_destination_configuration(Option<ElasticsearchDestinationConfiguration>)
:
required: falseThe destination in Amazon ES. You can specify only one destination.
amazonopensearchservice_destination_configuration(AmazonopensearchserviceDestinationConfiguration)
/set_amazonopensearchservice_destination_configuration(Option<AmazonopensearchserviceDestinationConfiguration>)
:
required: falseThe destination in Amazon OpenSearch Service. You can specify only one destination.
splunk_destination_configuration(SplunkDestinationConfiguration)
/set_splunk_destination_configuration(Option<SplunkDestinationConfiguration>)
:
required: falseThe destination in Splunk. You can specify only one destination.
http_endpoint_destination_configuration(HttpEndpointDestinationConfiguration)
/set_http_endpoint_destination_configuration(Option<HttpEndpointDestinationConfiguration>)
:
required: falseEnables configuring Kinesis Firehose to deliver data to any HTTP endpoint destination. You can specify only one destination.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: falseA set of tags to assign to the delivery stream. A tag is a key-value pair that you can define and assign to Amazon Web Services resources. Tags are metadata. For example, you can add friendly names and descriptions or other types of information that can help you distinguish the delivery stream. For more information about tags, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.
You can specify up to 50 tags when creating a delivery stream.
If you specify tags in the
CreateDeliveryStream
action, Amazon Data Firehose performs an additional authorization on thefirehose:TagDeliveryStream
action to verify if users have permissions to create tags. If you do not provide this permission, requests to create new Firehose delivery streams with IAM resource tags will fail with anAccessDeniedException
such as following.AccessDeniedException
User: arn:aws:sts::x:assumed-role/x/x is not authorized to perform: firehose:TagDeliveryStream on resource: arn:aws:firehose:us-east-1:x:deliverystream/x with an explicit deny in an identity-based policy.
For an example IAM policy, see Tag example.
amazon_open_search_serverless_destination_configuration(AmazonOpenSearchServerlessDestinationConfiguration)
/set_amazon_open_search_serverless_destination_configuration(Option<AmazonOpenSearchServerlessDestinationConfiguration>)
:
required: falseThe destination in the Serverless offering for Amazon OpenSearch Service. You can specify only one destination.
msk_source_configuration(MskSourceConfiguration)
/set_msk_source_configuration(Option<MskSourceConfiguration>)
:
required: falseThe configuration for the Amazon MSK cluster to be used as the source for a delivery stream.
snowflake_destination_configuration(SnowflakeDestinationConfiguration)
/set_snowflake_destination_configuration(Option<SnowflakeDestinationConfiguration>)
:
required: falseConfigure Snowflake destination
- On success, responds with
CreateDeliveryStreamOutput
with field(s):delivery_stream_arn(Option<String>)
:The ARN of the delivery stream.
- On failure, responds with
SdkError<CreateDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn delete_delivery_stream(&self) -> DeleteDeliveryStreamFluentBuilder
pub fn delete_delivery_stream(&self) -> DeleteDeliveryStreamFluentBuilder
Constructs a fluent builder for the DeleteDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
allow_force_delete(bool)
/set_allow_force_delete(Option<bool>)
:
required: falseSet this to true if you want to delete the delivery stream even if Firehose is unable to retire the grant for the CMK. Firehose might be unable to retire the grant due to a customer error, such as when the CMK or the grant are in an invalid state. If you force deletion, you can then use the RevokeGrant operation to revoke the grant you gave to Firehose. If a failure to retire the grant happens due to an Amazon Web Services KMS issue, Firehose keeps retrying the delete operation.
The default value is false.
- On success, responds with
DeleteDeliveryStreamOutput
- On failure, responds with
SdkError<DeleteDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn describe_delivery_stream(&self) -> DescribeDeliveryStreamFluentBuilder
pub fn describe_delivery_stream(&self) -> DescribeDeliveryStreamFluentBuilder
Constructs a fluent builder for the DescribeDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe limit on the number of destinations to return. You can have one destination per delivery stream.
exclusive_start_destination_id(impl Into<String>)
/set_exclusive_start_destination_id(Option<String>)
:
required: falseThe ID of the destination to start returning the destination information. Firehose supports one destination per delivery stream.
- On success, responds with
DescribeDeliveryStreamOutput
with field(s):delivery_stream_description(Option<DeliveryStreamDescription>)
:Information about the delivery stream.
- On failure, responds with
SdkError<DescribeDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn list_delivery_streams(&self) -> ListDeliveryStreamsFluentBuilder
pub fn list_delivery_streams(&self) -> ListDeliveryStreamsFluentBuilder
Constructs a fluent builder for the ListDeliveryStreams
operation.
- The fluent builder is configurable:
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe maximum number of delivery streams to list. The default value is 10.
delivery_stream_type(DeliveryStreamType)
/set_delivery_stream_type(Option<DeliveryStreamType>)
:
required: falseThe delivery stream type. This can be one of the following values:
-
DirectPut
: Provider applications access the delivery stream directly. -
KinesisStreamAsSource
: The delivery stream uses a Kinesis data stream as a source.
This parameter is optional. If this parameter is omitted, delivery streams of all types are returned.
-
exclusive_start_delivery_stream_name(impl Into<String>)
/set_exclusive_start_delivery_stream_name(Option<String>)
:
required: falseThe list of delivery streams returned by this call to
ListDeliveryStreams
will start with the delivery stream whose name comes alphabetically immediately after the name you specify inExclusiveStartDeliveryStreamName
.
- On success, responds with
ListDeliveryStreamsOutput
with field(s):delivery_stream_names(Vec::<String>)
:The names of the delivery streams.
has_more_delivery_streams(bool)
:Indicates whether there are more delivery streams available to list.
- On failure, responds with
SdkError<ListDeliveryStreamsError>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream whose tags you want to list.
exclusive_start_tag_key(impl Into<String>)
/set_exclusive_start_tag_key(Option<String>)
:
required: falseThe key to use as the starting point for the list of tags. If you set this parameter,
ListTagsForDeliveryStream
gets all tags that occur afterExclusiveStartTagKey
.limit(i32)
/set_limit(Option<i32>)
:
required: falseThe number of tags to return. If this number is less than the total number of tags associated with the delivery stream,
HasMoreTags
is set totrue
in the response. To list additional tags, setExclusiveStartTagKey
to the last key in the response.
- On success, responds with
ListTagsForDeliveryStreamOutput
with field(s):tags(Vec::<Tag>)
:A list of tags associated with
DeliveryStreamName
, starting with the first tag afterExclusiveStartTagKey
and up to the specifiedLimit
.has_more_tags(bool)
:If this is
true
in the response, more tags are available. To list the remaining tags, setExclusiveStartTagKey
to the key of the last tag returned and callListTagsForDeliveryStream
again.
- On failure, responds with
SdkError<ListTagsForDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn put_record(&self) -> PutRecordFluentBuilder
pub fn put_record(&self) -> PutRecordFluentBuilder
Constructs a fluent builder for the PutRecord
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
record(Record)
/set_record(Option<Record>)
:
required: trueThe record.
- On success, responds with
PutRecordOutput
with field(s):record_id(String)
:The ID of the record.
encrypted(Option<bool>)
:Indicates whether server-side encryption (SSE) was enabled during this operation.
- On failure, responds with
SdkError<PutRecordError>
source§impl Client
impl Client
sourcepub fn put_record_batch(&self) -> PutRecordBatchFluentBuilder
pub fn put_record_batch(&self) -> PutRecordBatchFluentBuilder
Constructs a fluent builder for the PutRecordBatch
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
records(Record)
/set_records(Option<Vec::<Record>>)
:
required: trueOne or more records.
- On success, responds with
PutRecordBatchOutput
with field(s):failed_put_count(i32)
:The number of records that might have failed processing. This number might be greater than 0 even if the
PutRecordBatch
call succeeds. CheckFailedPutCount
to determine whether there are records that you need to resend.encrypted(Option<bool>)
:Indicates whether server-side encryption (SSE) was enabled during this operation.
request_responses(Vec::<PutRecordBatchResponseEntry>)
:The results array. For each record, the index of the response element is the same as the index used in the request array.
- On failure, responds with
SdkError<PutRecordBatchError>
source§impl Client
impl Client
sourcepub fn start_delivery_stream_encryption(
&self
) -> StartDeliveryStreamEncryptionFluentBuilder
pub fn start_delivery_stream_encryption( &self ) -> StartDeliveryStreamEncryptionFluentBuilder
Constructs a fluent builder for the StartDeliveryStreamEncryption
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream for which you want to enable server-side encryption (SSE).
delivery_stream_encryption_configuration_input(DeliveryStreamEncryptionConfigurationInput)
/set_delivery_stream_encryption_configuration_input(Option<DeliveryStreamEncryptionConfigurationInput>)
:
required: falseUsed to specify the type and Amazon Resource Name (ARN) of the KMS key needed for Server-Side Encryption (SSE).
- On success, responds with
StartDeliveryStreamEncryptionOutput
- On failure, responds with
SdkError<StartDeliveryStreamEncryptionError>
source§impl Client
impl Client
sourcepub fn stop_delivery_stream_encryption(
&self
) -> StopDeliveryStreamEncryptionFluentBuilder
pub fn stop_delivery_stream_encryption( &self ) -> StopDeliveryStreamEncryptionFluentBuilder
Constructs a fluent builder for the StopDeliveryStreamEncryption
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream for which you want to disable server-side encryption (SSE).
- On success, responds with
StopDeliveryStreamEncryptionOutput
- On failure, responds with
SdkError<StopDeliveryStreamEncryptionError>
source§impl Client
impl Client
sourcepub fn tag_delivery_stream(&self) -> TagDeliveryStreamFluentBuilder
pub fn tag_delivery_stream(&self) -> TagDeliveryStreamFluentBuilder
Constructs a fluent builder for the TagDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream to which you want to add the tags.
tags(Tag)
/set_tags(Option<Vec::<Tag>>)
:
required: trueA set of key-value pairs to use to create the tags.
- On success, responds with
TagDeliveryStreamOutput
- On failure, responds with
SdkError<TagDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn untag_delivery_stream(&self) -> UntagDeliveryStreamFluentBuilder
pub fn untag_delivery_stream(&self) -> UntagDeliveryStreamFluentBuilder
Constructs a fluent builder for the UntagDeliveryStream
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueA list of tag keys. Each corresponding tag is removed from the delivery stream.
- On success, responds with
UntagDeliveryStreamOutput
- On failure, responds with
SdkError<UntagDeliveryStreamError>
source§impl Client
impl Client
sourcepub fn update_destination(&self) -> UpdateDestinationFluentBuilder
pub fn update_destination(&self) -> UpdateDestinationFluentBuilder
Constructs a fluent builder for the UpdateDestination
operation.
- The fluent builder is configurable:
delivery_stream_name(impl Into<String>)
/set_delivery_stream_name(Option<String>)
:
required: trueThe name of the delivery stream.
current_delivery_stream_version_id(impl Into<String>)
/set_current_delivery_stream_version_id(Option<String>)
:
required: trueObtain this value from the
VersionId
result ofDeliveryStreamDescription
. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, theVersionId
value is updated. The service then performs a merge of the old configuration with the new configuration.destination_id(impl Into<String>)
/set_destination_id(Option<String>)
:
required: trueThe ID of the destination.
s3_destination_update(S3DestinationUpdate)
/set_s3_destination_update(Option<S3DestinationUpdate>)
:
required: false[Deprecated] Describes an update for a destination in Amazon S3.
extended_s3_destination_update(ExtendedS3DestinationUpdate)
/set_extended_s3_destination_update(Option<ExtendedS3DestinationUpdate>)
:
required: falseDescribes an update for a destination in Amazon S3.
redshift_destination_update(RedshiftDestinationUpdate)
/set_redshift_destination_update(Option<RedshiftDestinationUpdate>)
:
required: falseDescribes an update for a destination in Amazon Redshift.
elasticsearch_destination_update(ElasticsearchDestinationUpdate)
/set_elasticsearch_destination_update(Option<ElasticsearchDestinationUpdate>)
:
required: falseDescribes an update for a destination in Amazon ES.
amazonopensearchservice_destination_update(AmazonopensearchserviceDestinationUpdate)
/set_amazonopensearchservice_destination_update(Option<AmazonopensearchserviceDestinationUpdate>)
:
required: falseDescribes an update for a destination in Amazon OpenSearch Service.
splunk_destination_update(SplunkDestinationUpdate)
/set_splunk_destination_update(Option<SplunkDestinationUpdate>)
:
required: falseDescribes an update for a destination in Splunk.
http_endpoint_destination_update(HttpEndpointDestinationUpdate)
/set_http_endpoint_destination_update(Option<HttpEndpointDestinationUpdate>)
:
required: falseDescribes an update to the specified HTTP endpoint destination.
amazon_open_search_serverless_destination_update(AmazonOpenSearchServerlessDestinationUpdate)
/set_amazon_open_search_serverless_destination_update(Option<AmazonOpenSearchServerlessDestinationUpdate>)
:
required: falseDescribes an update for a destination in the Serverless offering for Amazon OpenSearch Service.
snowflake_destination_update(SnowflakeDestinationUpdate)
/set_snowflake_destination_update(Option<SnowflakeDestinationUpdate>)
:
required: falseUpdate to the Snowflake destination condiguration settings
- On success, responds with
UpdateDestinationOutput
- On failure, responds with
SdkError<UpdateDestinationError>
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