Skip to main content

aws_sdk_cloudextensions/operation/create_profile_entry/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_profile_entry::_create_profile_entry_input::CreateProfileEntryInputBuilder;
3
4pub use crate::operation::create_profile_entry::_create_profile_entry_output::CreateProfileEntryOutputBuilder;
5
6impl crate::operation::create_profile_entry::builders::CreateProfileEntryInputBuilder {
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::create_profile_entry::CreateProfileEntryOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_profile_entry::CreateProfileEntryError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_profile_entry();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateProfileEntry`.
24///
25/// Creates a profile entry that binds an extension to a profile. The extension must exist and the profile must not already have an entry for that extension.
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateProfileEntryFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_profile_entry::builders::CreateProfileEntryInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_profile_entry::CreateProfileEntryOutput,
35        crate::operation::create_profile_entry::CreateProfileEntryError,
36    > for CreateProfileEntryFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_profile_entry::CreateProfileEntryOutput,
44            crate::operation::create_profile_entry::CreateProfileEntryError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateProfileEntryFluentBuilder {
51    /// Creates a new `CreateProfileEntryFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateProfileEntry as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_profile_entry::builders::CreateProfileEntryInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_profile_entry::CreateProfileEntryOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_profile_entry::CreateProfileEntryError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_profile_entry::CreateProfileEntry::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_profile_entry::CreateProfileEntry::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_profile_entry::CreateProfileEntryOutput,
97        crate::operation::create_profile_entry::CreateProfileEntryError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// The identifier (id or name) of the profile to bind the extension to.
112    pub fn profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.profile_identifier(input.into());
114        self
115    }
116    /// The identifier (id or name) of the profile to bind the extension to.
117    pub fn set_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_profile_identifier(input);
119        self
120    }
121    /// The identifier (id or name) of the profile to bind the extension to.
122    pub fn get_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_profile_identifier()
124    }
125    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
126    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.client_token(input.into());
128        self
129    }
130    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
131    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_client_token(input);
133        self
134    }
135    /// A unique, case-sensitive identifier that you provide to ensure the request is processed at most once.
136    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_client_token()
138    }
139    /// The id of the extension to bind, such as aws:secretsmanager.
140    pub fn extension_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.extension_identifier(input.into());
142        self
143    }
144    /// The id of the extension to bind, such as aws:secretsmanager.
145    pub fn set_extension_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_extension_identifier(input);
147        self
148    }
149    /// The id of the extension to bind, such as aws:secretsmanager.
150    pub fn get_extension_identifier(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_extension_identifier()
152    }
153    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
154    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.name(input.into());
156        self
157    }
158    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
159    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_name(input);
161        self
162    }
163    /// The entry's name, unique within the profile. Defaults to the name in the extension's id.
164    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_name()
166    }
167    /// A description of the entry's purpose.
168    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.description(input.into());
170        self
171    }
172    /// A description of the entry's purpose.
173    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_description(input);
175        self
176    }
177    /// A description of the entry's purpose.
178    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_description()
180    }
181    ///
182    /// Adds a key-value pair to `interfaces`.
183    ///
184    /// To override the contents of this collection use [`set_interfaces`](Self::set_interfaces).
185    ///
186    /// Per-interface options, keyed by the id of an interface the extension declares.
187    pub fn interfaces(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::InterfaceOptions) -> Self {
188        self.inner = self.inner.interfaces(k.into(), v);
189        self
190    }
191    /// Per-interface options, keyed by the id of an interface the extension declares.
192    pub fn set_interfaces(
193        mut self,
194        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>>,
195    ) -> Self {
196        self.inner = self.inner.set_interfaces(input);
197        self
198    }
199    /// Per-interface options, keyed by the id of an interface the extension declares.
200    pub fn get_interfaces(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InterfaceOptions>> {
201        self.inner.get_interfaces()
202    }
203    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
204    pub fn execution_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.execution_role(input.into());
206        self
207    }
208    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
209    pub fn set_execution_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_execution_role(input);
211        self
212    }
213    /// The IAM role an extension assumes when calling AWS services. The role must be assumable by the Cloud Extensions Runtime's principal.
214    pub fn get_execution_role(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_execution_role()
216    }
217    /// Controls which extension version this entry tracks and how it adopts new releases.
218    pub fn version_policy(mut self, input: crate::types::VersionPolicy) -> Self {
219        self.inner = self.inner.version_policy(input);
220        self
221    }
222    /// Controls which extension version this entry tracks and how it adopts new releases.
223    pub fn set_version_policy(mut self, input: ::std::option::Option<crate::types::VersionPolicy>) -> Self {
224        self.inner = self.inner.set_version_policy(input);
225        self
226    }
227    /// Controls which extension version this entry tracks and how it adopts new releases.
228    pub fn get_version_policy(&self) -> &::std::option::Option<crate::types::VersionPolicy> {
229        self.inner.get_version_policy()
230    }
231    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
232    pub fn settings(mut self, input: ::aws_smithy_types::Document) -> Self {
233        self.inner = self.inner.settings(input);
234        self
235    }
236    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
237    pub fn set_settings(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
238        self.inner = self.inner.set_settings(input);
239        self
240    }
241    /// The setting values to use for this extension, as free-form JSON. Keys are the extension's setting ids and the values are validated against the extension's settings definitions. A setting that is omitted or null takes its default, if it has one. A null inside an array is rejected.
242    pub fn get_settings(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
243        self.inner.get_settings()
244    }
245    ///
246    /// Appends an item to `approve`.
247    ///
248    /// To override the contents of this collection use [`set_approve`](Self::set_approve).
249    ///
250    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
251    pub fn approve(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252        self.inner = self.inner.approve(input.into());
253        self
254    }
255    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
256    pub fn set_approve(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
257        self.inner = self.inner.set_approve(input);
258        self
259    }
260    /// A list of capability paths to approve. Each path must correspond to a capability instance declared by the extension.
261    pub fn get_approve(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
262        self.inner.get_approve()
263    }
264    ///
265    /// Adds a key-value pair to `tags`.
266    ///
267    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
268    ///
269    /// Tags to assign to the profile entry.
270    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.tags(k.into(), v.into());
272        self
273    }
274    /// Tags to assign to the profile entry.
275    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
276        self.inner = self.inner.set_tags(input);
277        self
278    }
279    /// Tags to assign to the profile entry.
280    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
281        self.inner.get_tags()
282    }
283}