aws_sdk_elastictranscoder/operation/test_role/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::test_role::_test_role_output::TestRoleOutputBuilder;
3
4pub use crate::operation::test_role::_test_role_input::TestRoleInputBuilder;
5
6impl crate::operation::test_role::builders::TestRoleInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::test_role::TestRoleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::test_role::TestRoleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.test_role();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `TestRole`.
24///
25/// <p>The TestRole operation tests the IAM role used to create the pipeline.</p>
26/// <p>The <code>TestRole</code> action lets you determine whether the IAM role you are using has sufficient permissions to let Elastic Transcoder perform tasks associated with the transcoding process. The action attempts to assume the specified IAM role, checks read access to the input and output buckets, and tries to send a test notification to Amazon SNS topics that you specify.</p>
27#[deprecated]
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct TestRoleFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::test_role::builders::TestRoleInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl crate::client::customize::internal::CustomizableSend<crate::operation::test_role::TestRoleOutput, crate::operation::test_role::TestRoleError>
35    for TestRoleFluentBuilder
36{
37    fn send(
38        self,
39        config_override: crate::config::Builder,
40    ) -> crate::client::customize::internal::BoxFuture<
41        crate::client::customize::internal::SendResult<crate::operation::test_role::TestRoleOutput, crate::operation::test_role::TestRoleError>,
42    > {
43        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
44    }
45}
46impl TestRoleFluentBuilder {
47    /// Creates a new `TestRoleFluentBuilder`.
48    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
49        Self {
50            handle,
51            inner: ::std::default::Default::default(),
52            config_override: ::std::option::Option::None,
53        }
54    }
55    /// Access the TestRole as a reference.
56    pub fn as_input(&self) -> &crate::operation::test_role::builders::TestRoleInputBuilder {
57        &self.inner
58    }
59    /// Sends the request and returns the response.
60    ///
61    /// If an error occurs, an `SdkError` will be returned with additional details that
62    /// can be matched against.
63    ///
64    /// By default, any retryable failures will be retried twice. Retry behavior
65    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
66    /// set when configuring the client.
67    pub async fn send(
68        self,
69    ) -> ::std::result::Result<
70        crate::operation::test_role::TestRoleOutput,
71        ::aws_smithy_runtime_api::client::result::SdkError<
72            crate::operation::test_role::TestRoleError,
73            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
74        >,
75    > {
76        let input = self
77            .inner
78            .build()
79            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
80        let runtime_plugins = crate::operation::test_role::TestRole::operation_runtime_plugins(
81            self.handle.runtime_plugins.clone(),
82            &self.handle.conf,
83            self.config_override,
84        );
85        crate::operation::test_role::TestRole::orchestrate(&runtime_plugins, input).await
86    }
87
88    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
89    pub fn customize(
90        self,
91    ) -> crate::client::customize::CustomizableOperation<crate::operation::test_role::TestRoleOutput, crate::operation::test_role::TestRoleError, Self>
92    {
93        crate::client::customize::CustomizableOperation::new(self)
94    }
95    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
96        self.set_config_override(::std::option::Option::Some(config_override.into()));
97        self
98    }
99
100    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
101        self.config_override = config_override;
102        self
103    }
104    /// <p>The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to test.</p>
105    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.inner = self.inner.role(input.into());
107        self
108    }
109    /// <p>The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to test.</p>
110    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.inner = self.inner.set_role(input);
112        self
113    }
114    /// <p>The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to test.</p>
115    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
116        self.inner.get_role()
117    }
118    /// <p>The Amazon S3 bucket that contains media files to be transcoded. The action attempts to read from this bucket.</p>
119    pub fn input_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.input_bucket(input.into());
121        self
122    }
123    /// <p>The Amazon S3 bucket that contains media files to be transcoded. The action attempts to read from this bucket.</p>
124    pub fn set_input_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_input_bucket(input);
126        self
127    }
128    /// <p>The Amazon S3 bucket that contains media files to be transcoded. The action attempts to read from this bucket.</p>
129    pub fn get_input_bucket(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_input_bucket()
131    }
132    /// <p>The Amazon S3 bucket that Elastic Transcoder writes transcoded media files to. The action attempts to read from this bucket.</p>
133    pub fn output_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.output_bucket(input.into());
135        self
136    }
137    /// <p>The Amazon S3 bucket that Elastic Transcoder writes transcoded media files to. The action attempts to read from this bucket.</p>
138    pub fn set_output_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_output_bucket(input);
140        self
141    }
142    /// <p>The Amazon S3 bucket that Elastic Transcoder writes transcoded media files to. The action attempts to read from this bucket.</p>
143    pub fn get_output_bucket(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_output_bucket()
145    }
146    ///
147    /// Appends an item to `Topics`.
148    ///
149    /// To override the contents of this collection use [`set_topics`](Self::set_topics).
150    ///
151    /// <p>The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics that you want the action to send a test notification to.</p>
152    pub fn topics(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.topics(input.into());
154        self
155    }
156    /// <p>The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics that you want the action to send a test notification to.</p>
157    pub fn set_topics(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158        self.inner = self.inner.set_topics(input);
159        self
160    }
161    /// <p>The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics that you want the action to send a test notification to.</p>
162    pub fn get_topics(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
163        self.inner.get_topics()
164    }
165}