1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A function's environment variable settings. You can use environment variables to adjust your function's behavior without updating code. An environment variable is a pair of strings that are stored in a function's version-specific configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Environment {
/// <p>Environment variable key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">Using Lambda environment variables</a>.</p>
pub variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Environment {
/// <p>Environment variable key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">Using Lambda environment variables</a>.</p>
pub fn variables(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.variables.as_ref()
}
}
impl ::std::fmt::Debug for Environment {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("Environment");
formatter.field("variables", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
impl Environment {
/// Creates a new builder-style object to manufacture [`Environment`](crate::types::Environment).
pub fn builder() -> crate::types::builders::EnvironmentBuilder {
crate::types::builders::EnvironmentBuilder::default()
}
}
/// A builder for [`Environment`](crate::types::Environment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct EnvironmentBuilder {
pub(crate) variables: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl EnvironmentBuilder {
/// Adds a key-value pair to `variables`.
///
/// To override the contents of this collection use [`set_variables`](Self::set_variables).
///
/// <p>Environment variable key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">Using Lambda environment variables</a>.</p>
pub fn variables(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.variables.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.variables = ::std::option::Option::Some(hash_map);
self
}
/// <p>Environment variable key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">Using Lambda environment variables</a>.</p>
pub fn set_variables(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.variables = input;
self
}
/// <p>Environment variable key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html">Using Lambda environment variables</a>.</p>
pub fn get_variables(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.variables
}
/// Consumes the builder and constructs a [`Environment`](crate::types::Environment).
pub fn build(self) -> crate::types::Environment {
crate::types::Environment { variables: self.variables }
}
}
impl ::std::fmt::Debug for EnvironmentBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("EnvironmentBuilder");
formatter.field("variables", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}