aws_sdk_lambda/operation/get_function/
_get_function_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetFunctionOutput {
6    /// <p>The configuration of the function or version.</p>
7    pub configuration: ::std::option::Option<crate::types::FunctionConfiguration>,
8    /// <p>The deployment package of the function or version.</p>
9    pub code: ::std::option::Option<crate::types::FunctionCodeLocation>,
10    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <p>An object that contains details about an error related to retrieving tags.</p>
13    pub tags_error: ::std::option::Option<crate::types::TagsError>,
14    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html">reserved concurrency</a>.</p>
15    pub concurrency: ::std::option::Option<crate::types::Concurrency>,
16    _request_id: Option<String>,
17}
18impl GetFunctionOutput {
19    /// <p>The configuration of the function or version.</p>
20    pub fn configuration(&self) -> ::std::option::Option<&crate::types::FunctionConfiguration> {
21        self.configuration.as_ref()
22    }
23    /// <p>The deployment package of the function or version.</p>
24    pub fn code(&self) -> ::std::option::Option<&crate::types::FunctionCodeLocation> {
25        self.code.as_ref()
26    }
27    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
28    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
29        self.tags.as_ref()
30    }
31    /// <p>An object that contains details about an error related to retrieving tags.</p>
32    pub fn tags_error(&self) -> ::std::option::Option<&crate::types::TagsError> {
33        self.tags_error.as_ref()
34    }
35    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html">reserved concurrency</a>.</p>
36    pub fn concurrency(&self) -> ::std::option::Option<&crate::types::Concurrency> {
37        self.concurrency.as_ref()
38    }
39}
40impl ::aws_types::request_id::RequestId for GetFunctionOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl GetFunctionOutput {
46    /// Creates a new builder-style object to manufacture [`GetFunctionOutput`](crate::operation::get_function::GetFunctionOutput).
47    pub fn builder() -> crate::operation::get_function::builders::GetFunctionOutputBuilder {
48        crate::operation::get_function::builders::GetFunctionOutputBuilder::default()
49    }
50}
51
52/// A builder for [`GetFunctionOutput`](crate::operation::get_function::GetFunctionOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct GetFunctionOutputBuilder {
56    pub(crate) configuration: ::std::option::Option<crate::types::FunctionConfiguration>,
57    pub(crate) code: ::std::option::Option<crate::types::FunctionCodeLocation>,
58    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
59    pub(crate) tags_error: ::std::option::Option<crate::types::TagsError>,
60    pub(crate) concurrency: ::std::option::Option<crate::types::Concurrency>,
61    _request_id: Option<String>,
62}
63impl GetFunctionOutputBuilder {
64    /// <p>The configuration of the function or version.</p>
65    pub fn configuration(mut self, input: crate::types::FunctionConfiguration) -> Self {
66        self.configuration = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>The configuration of the function or version.</p>
70    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::FunctionConfiguration>) -> Self {
71        self.configuration = input;
72        self
73    }
74    /// <p>The configuration of the function or version.</p>
75    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::FunctionConfiguration> {
76        &self.configuration
77    }
78    /// <p>The deployment package of the function or version.</p>
79    pub fn code(mut self, input: crate::types::FunctionCodeLocation) -> Self {
80        self.code = ::std::option::Option::Some(input);
81        self
82    }
83    /// <p>The deployment package of the function or version.</p>
84    pub fn set_code(mut self, input: ::std::option::Option<crate::types::FunctionCodeLocation>) -> Self {
85        self.code = input;
86        self
87    }
88    /// <p>The deployment package of the function or version.</p>
89    pub fn get_code(&self) -> &::std::option::Option<crate::types::FunctionCodeLocation> {
90        &self.code
91    }
92    /// Adds a key-value pair to `tags`.
93    ///
94    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
95    ///
96    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
97    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
98        let mut hash_map = self.tags.unwrap_or_default();
99        hash_map.insert(k.into(), v.into());
100        self.tags = ::std::option::Option::Some(hash_map);
101        self
102    }
103    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
104    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
105        self.tags = input;
106        self
107    }
108    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/tagging.html">tags</a>. Lambda returns tag data only if you have explicit allow permissions for <a href="https://docs.aws.amazon.com/lambda/latest/api/API_ListTags.html">lambda:ListTags</a>.</p>
109    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
110        &self.tags
111    }
112    /// <p>An object that contains details about an error related to retrieving tags.</p>
113    pub fn tags_error(mut self, input: crate::types::TagsError) -> Self {
114        self.tags_error = ::std::option::Option::Some(input);
115        self
116    }
117    /// <p>An object that contains details about an error related to retrieving tags.</p>
118    pub fn set_tags_error(mut self, input: ::std::option::Option<crate::types::TagsError>) -> Self {
119        self.tags_error = input;
120        self
121    }
122    /// <p>An object that contains details about an error related to retrieving tags.</p>
123    pub fn get_tags_error(&self) -> &::std::option::Option<crate::types::TagsError> {
124        &self.tags_error
125    }
126    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html">reserved concurrency</a>.</p>
127    pub fn concurrency(mut self, input: crate::types::Concurrency) -> Self {
128        self.concurrency = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html">reserved concurrency</a>.</p>
132    pub fn set_concurrency(mut self, input: ::std::option::Option<crate::types::Concurrency>) -> Self {
133        self.concurrency = input;
134        self
135    }
136    /// <p>The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html">reserved concurrency</a>.</p>
137    pub fn get_concurrency(&self) -> &::std::option::Option<crate::types::Concurrency> {
138        &self.concurrency
139    }
140    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
141        self._request_id = Some(request_id.into());
142        self
143    }
144
145    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
146        self._request_id = request_id;
147        self
148    }
149    /// Consumes the builder and constructs a [`GetFunctionOutput`](crate::operation::get_function::GetFunctionOutput).
150    pub fn build(self) -> crate::operation::get_function::GetFunctionOutput {
151        crate::operation::get_function::GetFunctionOutput {
152            configuration: self.configuration,
153            code: self.code,
154            tags: self.tags,
155            tags_error: self.tags_error,
156            concurrency: self.concurrency,
157            _request_id: self._request_id,
158        }
159    }
160}