aws_sdk_lambda/operation/get_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_policy::_get_policy_output::GetPolicyOutputBuilder;
3
4pub use crate::operation::get_policy::_get_policy_input::GetPolicyInputBuilder;
5
6impl crate::operation::get_policy::builders::GetPolicyInputBuilder {
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::get_policy::GetPolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_policy::GetPolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetPolicy`.
24///
25/// <p>Returns the <a href="https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html">resource-based IAM policy</a> for a function, version, or alias.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetPolicyFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_policy::builders::GetPolicyInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl crate::client::customize::internal::CustomizableSend<crate::operation::get_policy::GetPolicyOutput, crate::operation::get_policy::GetPolicyError>
33    for GetPolicyFluentBuilder
34{
35    fn send(
36        self,
37        config_override: crate::config::Builder,
38    ) -> crate::client::customize::internal::BoxFuture<
39        crate::client::customize::internal::SendResult<crate::operation::get_policy::GetPolicyOutput, crate::operation::get_policy::GetPolicyError>,
40    > {
41        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
42    }
43}
44impl GetPolicyFluentBuilder {
45    /// Creates a new `GetPolicyFluentBuilder`.
46    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
47        Self {
48            handle,
49            inner: ::std::default::Default::default(),
50            config_override: ::std::option::Option::None,
51        }
52    }
53    /// Access the GetPolicy as a reference.
54    pub fn as_input(&self) -> &crate::operation::get_policy::builders::GetPolicyInputBuilder {
55        &self.inner
56    }
57    /// Sends the request and returns the response.
58    ///
59    /// If an error occurs, an `SdkError` will be returned with additional details that
60    /// can be matched against.
61    ///
62    /// By default, any retryable failures will be retried twice. Retry behavior
63    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
64    /// set when configuring the client.
65    pub async fn send(
66        self,
67    ) -> ::std::result::Result<
68        crate::operation::get_policy::GetPolicyOutput,
69        ::aws_smithy_runtime_api::client::result::SdkError<
70            crate::operation::get_policy::GetPolicyError,
71            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
72        >,
73    > {
74        let input = self
75            .inner
76            .build()
77            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78        let runtime_plugins = crate::operation::get_policy::GetPolicy::operation_runtime_plugins(
79            self.handle.runtime_plugins.clone(),
80            &self.handle.conf,
81            self.config_override,
82        );
83        crate::operation::get_policy::GetPolicy::orchestrate(&runtime_plugins, input).await
84    }
85
86    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87    pub fn customize(
88        self,
89    ) -> crate::client::customize::CustomizableOperation<
90        crate::operation::get_policy::GetPolicyOutput,
91        crate::operation::get_policy::GetPolicyError,
92        Self,
93    > {
94        crate::client::customize::CustomizableOperation::new(self)
95    }
96    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
97        self.set_config_override(::std::option::Option::Some(config_override.into()));
98        self
99    }
100
101    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
102        self.config_override = config_override;
103        self
104    }
105    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
106    /// <p class="title"><b>Name formats</b></p>
107    /// <ul>
108    /// <li>
109    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
110    /// <li>
111    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
112    /// <li>
113    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
114    /// </ul>
115    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
116    pub fn function_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.function_name(input.into());
118        self
119    }
120    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
121    /// <p class="title"><b>Name formats</b></p>
122    /// <ul>
123    /// <li>
124    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
125    /// <li>
126    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
127    /// <li>
128    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
129    /// </ul>
130    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
131    pub fn set_function_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_function_name(input);
133        self
134    }
135    /// <p>The name or ARN of the Lambda function, version, or alias.</p>
136    /// <p class="title"><b>Name formats</b></p>
137    /// <ul>
138    /// <li>
139    /// <p><b>Function name</b> – <code>my-function</code> (name-only), <code>my-function:v1</code> (with alias).</p></li>
140    /// <li>
141    /// <p><b>Function ARN</b> – <code>arn:aws:lambda:us-west-2:123456789012:function:my-function</code>.</p></li>
142    /// <li>
143    /// <p><b>Partial ARN</b> – <code>123456789012:function:my-function</code>.</p></li>
144    /// </ul>
145    /// <p>You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length.</p>
146    pub fn get_function_name(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_function_name()
148    }
149    /// <p>Specify a version or alias to get the policy for that resource.</p>
150    pub fn qualifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.qualifier(input.into());
152        self
153    }
154    /// <p>Specify a version or alias to get the policy for that resource.</p>
155    pub fn set_qualifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_qualifier(input);
157        self
158    }
159    /// <p>Specify a version or alias to get the policy for that resource.</p>
160    pub fn get_qualifier(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_qualifier()
162    }
163}