Struct aws_sdk_kinesisanalytics::client::Client

source ·
pub struct Client { /* private fields */ }
Expand description

Client for Amazon Kinesis Analytics

Client for invoking operations on Amazon Kinesis Analytics. Each operation on Amazon Kinesis Analytics 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_kinesisanalytics::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_kinesisanalytics::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 AddApplicationCloudWatchLoggingOption operation has a Client::add_application_cloud_watch_logging_option, 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.add_application_cloud_watch_logging_option()
    .application_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

source

pub fn add_application_cloud_watch_logging_option( &self ) -> AddApplicationCloudWatchLoggingOptionFluentBuilder

Constructs a fluent builder for the AddApplicationCloudWatchLoggingOption operation.

source§

impl Client

source

pub fn add_application_input(&self) -> AddApplicationInputFluentBuilder

Constructs a fluent builder for the AddApplicationInput operation.

source§

impl Client

source

pub fn add_application_input_processing_configuration( &self ) -> AddApplicationInputProcessingConfigurationFluentBuilder

Constructs a fluent builder for the AddApplicationInputProcessingConfiguration operation.

source§

impl Client

source

pub fn add_application_output(&self) -> AddApplicationOutputFluentBuilder

Constructs a fluent builder for the AddApplicationOutput operation.

source§

impl Client

source

pub fn add_application_reference_data_source( &self ) -> AddApplicationReferenceDataSourceFluentBuilder

Constructs a fluent builder for the AddApplicationReferenceDataSource operation.

source§

impl Client

source

pub fn create_application(&self) -> CreateApplicationFluentBuilder

Constructs a fluent builder for the CreateApplication operation.

  • The fluent builder is configurable:
    • application_name(impl Into<String>) / set_application_name(Option<String>):
      required: true

      Name of your Amazon Kinesis Analytics application (for example, sample-app).


    • application_description(impl Into<String>) / set_application_description(Option<String>):
      required: false

      Summary description of the application.


    • inputs(Input) / set_inputs(Option<Vec::<Input>>):
      required: false

      Use this parameter to configure the application input.

      You can configure your application to receive input from a single streaming source. In this configuration, you map this streaming source to an in-application stream that is created. Your application code can then query the in-application stream like a table (you can think of it as a constantly updating table).

      For the streaming source, you provide its Amazon Resource Name (ARN) and format of data on the stream (for example, JSON, CSV, etc.). You also must provide an IAM role that Amazon Kinesis Analytics can assume to read this stream on your behalf.

      To create the in-application stream, you need to specify a schema to transform your data into a schematized version used in SQL. In the schema, you provide the necessary mapping of the data elements in the streaming source to record columns in the in-app stream.


    • outputs(Output) / set_outputs(Option<Vec::<Output>>):
      required: false

      You can configure application output to write data from any of the in-application streams to up to three destinations.

      These destinations can be Amazon Kinesis streams, Amazon Kinesis Firehose delivery streams, AWS Lambda destinations, or any combination of the three.

      In the configuration, you specify the in-application stream name, the destination stream or Lambda function Amazon Resource Name (ARN), and the format to use when writing data. You must also provide an IAM role that Amazon Kinesis Analytics can assume to write to the destination stream or Lambda function on your behalf.

      In the output configuration, you also provide the output stream or Lambda function ARN. For stream destinations, you provide the format of data in the stream (for example, JSON, CSV). You also must provide an IAM role that Amazon Kinesis Analytics can assume to write to the stream or Lambda function on your behalf.


    • cloud_watch_logging_options(CloudWatchLoggingOption) / set_cloud_watch_logging_options(Option<Vec::<CloudWatchLoggingOption>>):
      required: false

      Use this parameter to configure a CloudWatch log stream to monitor application configuration errors. For more information, see Working with Amazon CloudWatch Logs.


    • application_code(impl Into<String>) / set_application_code(Option<String>):
      required: false

      One or more SQL statements that read input data, transform it, and generate output. For example, you can write a SQL statement that reads data from one in-application stream, generates a running average of the number of advertisement clicks by vendor, and insert resulting rows in another in-application stream using pumps. For more information about the typical pattern, see Application Code.

      You can provide such series of SQL statements, where output of one statement can be used as the input for the next statement. You store intermediate results by creating in-application streams and pumps.

      Note that the application code must create the streams with names specified in the Outputs. For example, if your Outputs defines output streams named ExampleOutputStream1 and ExampleOutputStream2, then your application code must create these streams.


    • tags(Tag) / set_tags(Option<Vec::<Tag>>):
      required: false

      A list of one or more tags to assign to the application. A tag is a key-value pair that identifies an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50. For more information, see Using Tagging.


  • On success, responds with CreateApplicationOutput with field(s):
    • application_summary(Option<ApplicationSummary>):

      In response to your CreateApplication request, Amazon Kinesis Analytics returns a response with a summary of the application it created, including the application Amazon Resource Name (ARN), name, and status.

  • On failure, responds with SdkError<CreateApplicationError>
source§

impl Client

source

pub fn delete_application(&self) -> DeleteApplicationFluentBuilder

Constructs a fluent builder for the DeleteApplication operation.

source§

impl Client

source

pub fn delete_application_cloud_watch_logging_option( &self ) -> DeleteApplicationCloudWatchLoggingOptionFluentBuilder

Constructs a fluent builder for the DeleteApplicationCloudWatchLoggingOption operation.

source§

impl Client

source

pub fn delete_application_input_processing_configuration( &self ) -> DeleteApplicationInputProcessingConfigurationFluentBuilder

Constructs a fluent builder for the DeleteApplicationInputProcessingConfiguration operation.

source§

impl Client

source

pub fn delete_application_output(&self) -> DeleteApplicationOutputFluentBuilder

Constructs a fluent builder for the DeleteApplicationOutput operation.

source§

impl Client

source

pub fn delete_application_reference_data_source( &self ) -> DeleteApplicationReferenceDataSourceFluentBuilder

Constructs a fluent builder for the DeleteApplicationReferenceDataSource operation.

source§

impl Client

source

pub fn describe_application(&self) -> DescribeApplicationFluentBuilder

Constructs a fluent builder for the DescribeApplication operation.

source§

impl Client

source

pub fn discover_input_schema(&self) -> DiscoverInputSchemaFluentBuilder

Constructs a fluent builder for the DiscoverInputSchema operation.

source§

impl Client

source

pub fn list_applications(&self) -> ListApplicationsFluentBuilder

Constructs a fluent builder for the ListApplications operation.

source§

impl Client

source

pub fn list_tags_for_resource(&self) -> ListTagsForResourceFluentBuilder

Constructs a fluent builder for the ListTagsForResource operation.

source§

impl Client

source

pub fn start_application(&self) -> StartApplicationFluentBuilder

Constructs a fluent builder for the StartApplication operation.

source§

impl Client

source

pub fn stop_application(&self) -> StopApplicationFluentBuilder

Constructs a fluent builder for the StopApplication operation.

source§

impl Client

source

pub fn tag_resource(&self) -> TagResourceFluentBuilder

Constructs a fluent builder for the TagResource operation.

source§

impl Client

source

pub fn untag_resource(&self) -> UntagResourceFluentBuilder

Constructs a fluent builder for the UntagResource operation.

source§

impl Client

source

pub fn update_application(&self) -> UpdateApplicationFluentBuilder

Constructs a fluent builder for the UpdateApplication operation.

source§

impl Client

source

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 and time_source configured.
  • No behavior_version is provided.

The panic message for each of these will have instructions on how to resolve them.

source

pub fn config(&self) -> &Config

Returns the client’s configuration.

source§

impl Client

source

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 the sleep_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 the http_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, set behavior_version on the Config or enable the behavior-version-latest Cargo feature.

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more