Skip to main content

aws_sdk_ssoadmin/operation/attach_customer_managed_policy_reference_to_permission_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::attach_customer_managed_policy_reference_to_permission_set::_attach_customer_managed_policy_reference_to_permission_set_input::AttachCustomerManagedPolicyReferenceToPermissionSetInputBuilder;
3
4pub use crate::operation::attach_customer_managed_policy_reference_to_permission_set::_attach_customer_managed_policy_reference_to_permission_set_output::AttachCustomerManagedPolicyReferenceToPermissionSetOutputBuilder;
5
6impl crate::operation::attach_customer_managed_policy_reference_to_permission_set::builders::AttachCustomerManagedPolicyReferenceToPermissionSetInputBuilder {
7                    /// Sends a request with this input using the given client.
8                    pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9                        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.attach_customer_managed_policy_reference_to_permission_set();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `AttachCustomerManagedPolicyReferenceToPermissionSet`.
21///
22/// <p>Attaches the specified customer managed policy to the specified <code>PermissionSet</code>.</p>
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
24pub struct AttachCustomerManagedPolicyReferenceToPermissionSetFluentBuilder {
25                handle: ::std::sync::Arc<crate::client::Handle>,
26                inner: crate::operation::attach_customer_managed_policy_reference_to_permission_set::builders::AttachCustomerManagedPolicyReferenceToPermissionSetInputBuilder,
27config_override: ::std::option::Option<crate::config::Builder>,
28            }
29impl
30    crate::client::customize::internal::CustomizableSend<
31        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetOutput,
32        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetError,
33    > for AttachCustomerManagedPolicyReferenceToPermissionSetFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<
40            crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetOutput,
41            crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetError,
42        >,
43    > {
44        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45    }
46}
47impl AttachCustomerManagedPolicyReferenceToPermissionSetFluentBuilder {
48    /// Creates a new `AttachCustomerManagedPolicyReferenceToPermissionSetFluentBuilder`.
49    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50        Self {
51            handle,
52            inner: ::std::default::Default::default(),
53            config_override: ::std::option::Option::None,
54        }
55    }
56    /// Access the AttachCustomerManagedPolicyReferenceToPermissionSet as a reference.
57    pub fn as_input(&self) -> &crate::operation::attach_customer_managed_policy_reference_to_permission_set::builders::AttachCustomerManagedPolicyReferenceToPermissionSetInputBuilder{
58        &self.inner
59    }
60    /// Sends the request and returns the response.
61    ///
62    /// If an error occurs, an `SdkError` will be returned with additional details that
63    /// can be matched against.
64    ///
65    /// By default, any retryable failures will be retried twice. Retry behavior
66    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67    /// set when configuring the client.
68    pub async fn send(
69        self,
70    ) -> ::std::result::Result<
71        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetOutput,
72        ::aws_smithy_runtime_api::client::result::SdkError<
73            crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetError,
74            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
75        >,
76    > {
77        let input = self
78            .inner
79            .build()
80            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
81        let runtime_plugins = crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSet::operation_runtime_plugins(
82                            self.handle.runtime_plugins.clone(),
83                            &self.handle.conf,
84                            self.config_override,
85                        );
86        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSet::orchestrate(&runtime_plugins, input).await
87    }
88
89    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
90    pub fn customize(
91        self,
92    ) -> crate::client::customize::CustomizableOperation<
93        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetOutput,
94        crate::operation::attach_customer_managed_policy_reference_to_permission_set::AttachCustomerManagedPolicyReferenceToPermissionSetError,
95        Self,
96    > {
97        crate::client::customize::CustomizableOperation::new(self)
98    }
99    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
100        self.set_config_override(::std::option::Option::Some(config_override.into()));
101        self
102    }
103
104    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
105        self.config_override = config_override;
106        self
107    }
108    /// <p>The ARN of the IAM Identity Center instance under which the operation will be executed.</p>
109    pub fn instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.inner = self.inner.instance_arn(input.into());
111        self
112    }
113    /// <p>The ARN of the IAM Identity Center instance under which the operation will be executed.</p>
114    pub fn set_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.inner = self.inner.set_instance_arn(input);
116        self
117    }
118    /// <p>The ARN of the IAM Identity Center instance under which the operation will be executed.</p>
119    pub fn get_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
120        self.inner.get_instance_arn()
121    }
122    /// <p>The ARN of the <code>PermissionSet</code>.</p>
123    pub fn permission_set_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.permission_set_arn(input.into());
125        self
126    }
127    /// <p>The ARN of the <code>PermissionSet</code>.</p>
128    pub fn set_permission_set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_permission_set_arn(input);
130        self
131    }
132    /// <p>The ARN of the <code>PermissionSet</code>.</p>
133    pub fn get_permission_set_arn(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_permission_set_arn()
135    }
136    /// <p>Specifies the name and path of a customer managed policy. You must have an IAM policy that matches the name and path in each Amazon Web Services account where you want to deploy your permission set.</p>
137    pub fn customer_managed_policy_reference(mut self, input: crate::types::CustomerManagedPolicyReference) -> Self {
138        self.inner = self.inner.customer_managed_policy_reference(input);
139        self
140    }
141    /// <p>Specifies the name and path of a customer managed policy. You must have an IAM policy that matches the name and path in each Amazon Web Services account where you want to deploy your permission set.</p>
142    pub fn set_customer_managed_policy_reference(mut self, input: ::std::option::Option<crate::types::CustomerManagedPolicyReference>) -> Self {
143        self.inner = self.inner.set_customer_managed_policy_reference(input);
144        self
145    }
146    /// <p>Specifies the name and path of a customer managed policy. You must have an IAM policy that matches the name and path in each Amazon Web Services account where you want to deploy your permission set.</p>
147    pub fn get_customer_managed_policy_reference(&self) -> &::std::option::Option<crate::types::CustomerManagedPolicyReference> {
148        self.inner.get_customer_managed_policy_reference()
149    }
150}