Skip to main content

aws_lite_rs/types/
lambda.rs

1//! Types for the AWS Lambda API (v1).
2//!
3//! Auto-generated from the AWS Botocore Model.
4//! **Do not edit manually** — modify the manifest and re-run codegen.
5
6use serde::{Deserialize, Serialize};
7use std::collections::HashMap;
8
9///
10/// **AWS API**: `lambda.v1.ListFunctionsRequest`
11///
12/// ## Coverage
13/// 2 of 4 fields included.
14/// Omitted fields:
15/// - `MasterRegion` — not selected in manifest
16/// - `FunctionVersion` — not selected in manifest
17#[derive(Debug, Clone, Default, Serialize, Deserialize)]
18#[serde(rename_all = "PascalCase")]
19pub struct ListFunctionsRequest {
20    /// Specify the pagination token that's returned by a previous request to retrieve the next
21    /// page of results.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub marker: Option<String>,
24
25    /// The maximum number of functions to return in the response. Note that ListFunctions
26    /// returns a maximum of 50 items in each response, even if you set the number higher.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub max_items: Option<i32>,
29}
30
31impl ListFunctionsRequest {
32    #[cfg(any(test, feature = "test-support"))]
33    /// Create a fixture instance for testing.
34    pub fn fixture() -> Self {
35        Self {
36            marker: Some("test-marker".into()),
37            max_items: Some(100),
38        }
39    }
40}
41
42/// A list of Lambda functions.
43///
44/// **AWS API**: `lambda.v1.ListFunctionsResponse`
45#[derive(Debug, Clone, Default, Serialize, Deserialize)]
46#[serde(rename_all = "PascalCase")]
47pub struct ListFunctionsResponse {
48    /// A list of Lambda functions.
49    #[serde(default)]
50    #[serde(skip_serializing_if = "Vec::is_empty")]
51    pub functions: Vec<FunctionConfiguration>,
52
53    /// The pagination token that's included if more results are available.
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub next_marker: Option<String>,
56}
57
58impl ListFunctionsResponse {
59    #[cfg(any(test, feature = "test-support"))]
60    /// Create a fixture instance for testing.
61    pub fn fixture() -> Self {
62        Self {
63            functions: vec![],
64            next_marker: Some("test-next_marker".into()),
65        }
66    }
67}
68
69/// Details about a function's configuration.
70///
71/// **AWS API**: `lambda.v1.FunctionConfiguration`
72///
73/// ## Coverage
74/// 12 of 40 fields included.
75/// Omitted fields:
76/// - `Role` — not selected in manifest
77/// - `CodeSha256` — not selected in manifest
78/// - `Version` — not selected in manifest
79/// - `DeadLetterConfig` — not selected in manifest
80/// - `KMSKeyArn` — not selected in manifest
81/// - `TracingConfig` — not selected in manifest
82/// - `MasterArn` — not selected in manifest
83/// - `RevisionId` — not selected in manifest
84/// - `Layers` — not selected in manifest
85/// - `State` — not selected in manifest
86/// - `StateReason` — not selected in manifest
87/// - `StateReasonCode` — not selected in manifest
88/// - `LastUpdateStatus` — not selected in manifest
89/// - `LastUpdateStatusReason` — not selected in manifest
90/// - `LastUpdateStatusReasonCode` — not selected in manifest
91/// - `FileSystemConfigs` — not selected in manifest
92/// - `PackageType` — not selected in manifest
93/// - `ImageConfigResponse` — not selected in manifest
94/// - `SigningProfileVersionArn` — not selected in manifest
95/// - `SigningJobArn` — not selected in manifest
96/// - `EphemeralStorage` — not selected in manifest
97/// - `SnapStart` — not selected in manifest
98/// - `RuntimeVersionConfig` — not selected in manifest
99/// - `LoggingConfig` — not selected in manifest
100/// - `CapacityProviderConfig` — not selected in manifest
101/// - `ConfigSha256` — not selected in manifest
102/// - `DurableConfig` — not selected in manifest
103/// - `TenancyConfig` — not selected in manifest
104#[derive(Debug, Clone, Default, Serialize, Deserialize)]
105#[serde(rename_all = "PascalCase")]
106pub struct FunctionConfiguration {
107    /// The name of the function.
108    pub function_name: String,
109
110    /// The function's Amazon Resource Name (ARN).
111    pub function_arn: String,
112
113    /// The identifier of the function's runtime. Runtime is required if the deployment package
114    /// is a .zip file archive. Specifying a runtime results in an error if you're deploying a
115    /// function using a container image. The following list includes deprecated runtimes.
116    /// Lambda blocks creating new functions and updating existing functions shortly after each
117    /// runtime is deprecated. For more information, see Runtime use after deprecation. For a
118    /// list of all currently supported runtimes, see Supported runtimes.
119    #[serde(skip_serializing_if = "Option::is_none")]
120    pub runtime: Option<String>,
121
122    /// The function that Lambda calls to begin running your function.
123    #[serde(skip_serializing_if = "Option::is_none")]
124    pub handler: Option<String>,
125
126    /// The size of the function's deployment package, in bytes.
127    #[serde(skip_serializing_if = "Option::is_none")]
128    pub code_size: Option<i64>,
129
130    /// The function's description.
131    #[serde(skip_serializing_if = "Option::is_none")]
132    pub description: Option<String>,
133
134    /// The amount of time in seconds that Lambda allows a function to run before stopping it.
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub timeout: Option<i32>,
137
138    /// The amount of memory available to the function at runtime.
139    #[serde(skip_serializing_if = "Option::is_none")]
140    pub memory_size: Option<i32>,
141
142    /// The date and time that the function was last updated, in ISO-8601 format (YYYY-MM-
143    /// DDThh:mm:ss.sTZD).
144    #[serde(skip_serializing_if = "Option::is_none")]
145    pub last_modified: Option<String>,
146
147    /// The function's environment variables. Omitted from CloudTrail logs.
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub environment: Option<Option<EnvironmentResponse>>,
150
151    /// The function's networking configuration.
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub vpc_config: Option<Option<VpcConfigResponse>>,
154
155    /// The instruction set architecture that the function supports. Architecture is a string
156    /// array with one of the valid values. The default architecture value is x86_64.
157    #[serde(default)]
158    #[serde(skip_serializing_if = "Vec::is_empty")]
159    pub architectures: Vec<String>,
160}
161
162impl FunctionConfiguration {
163    #[cfg(any(test, feature = "test-support"))]
164    /// Create a fixture instance for testing.
165    pub fn fixture() -> Self {
166        Self {
167            function_name: "test-function_name".into(),
168            function_arn: "test-function_arn".into(),
169            runtime: Some("test-runtime".into()),
170            handler: Some("test-handler".into()),
171            code_size: Some(100),
172            description: Some("test-description".into()),
173            timeout: Some(100),
174            memory_size: Some(100),
175            last_modified: Some("test-last_modified".into()),
176            architectures: vec![],
177            ..Default::default()
178        }
179    }
180}
181
182/// The results of an operation to update or read environment variables. If the operation
183/// succeeds, the response contains the environment variables. If it fails, the response
184/// contains details about the error.
185///
186/// **AWS API**: `lambda.v1.EnvironmentResponse`
187///
188/// ## Coverage
189/// 1 of 2 fields included.
190/// Omitted fields:
191/// - `Error` — not selected in manifest
192#[derive(Debug, Clone, Default, Serialize, Deserialize)]
193#[serde(rename_all = "PascalCase")]
194pub struct EnvironmentResponse {
195    /// Environment variable key-value pairs. Omitted from CloudTrail logs.
196    #[serde(default)]
197    #[serde(skip_serializing_if = "HashMap::is_empty")]
198    pub variables: std::collections::HashMap<String, String>,
199}
200
201impl EnvironmentResponse {
202    #[cfg(any(test, feature = "test-support"))]
203    /// Create a fixture instance for testing.
204    pub fn fixture() -> Self {
205        Self {
206            ..Default::default()
207        }
208    }
209}
210
211/// The VPC security groups and subnets that are attached to a Lambda function.
212///
213/// **AWS API**: `lambda.v1.VpcConfigResponse`
214///
215/// ## Coverage
216/// 3 of 4 fields included.
217/// Omitted fields:
218/// - `Ipv6AllowedForDualStack` — not selected in manifest
219#[derive(Debug, Clone, Default, Serialize, Deserialize)]
220#[serde(rename_all = "PascalCase")]
221pub struct VpcConfigResponse {
222    /// A list of VPC subnet IDs.
223    #[serde(default)]
224    #[serde(skip_serializing_if = "Vec::is_empty")]
225    pub subnet_ids: Vec<String>,
226
227    /// A list of VPC security group IDs.
228    #[serde(default)]
229    #[serde(skip_serializing_if = "Vec::is_empty")]
230    pub security_group_ids: Vec<String>,
231
232    /// The ID of the VPC.
233    #[serde(skip_serializing_if = "Option::is_none")]
234    pub vpc_id: Option<String>,
235}
236
237impl VpcConfigResponse {
238    #[cfg(any(test, feature = "test-support"))]
239    /// Create a fixture instance for testing.
240    pub fn fixture() -> Self {
241        Self {
242            subnet_ids: vec![],
243            security_group_ids: vec![],
244            vpc_id: Some("test-vpc_id".into()),
245        }
246    }
247}
248
249///
250/// **AWS API**: `lambda.v1.GetFunctionConfigurationRequest`
251#[derive(Debug, Clone, Default, Serialize, Deserialize)]
252#[serde(rename_all = "PascalCase")]
253pub struct GetFunctionConfigurationRequest {
254    /// The name or ARN of the Lambda function, version, or alias. Name formats Function name –
255    /// my-function (name-only), my-function:v1 (with alias). Function ARN – arn:aws:lambda:us-
256    /// west-2:123456789012:function:my-function. Partial ARN – 123456789012:function:my-
257    /// function. You can append a version number or alias to any of the formats. The length
258    /// constraint applies only to the full ARN. If you specify only the function name, it is
259    /// limited to 64 characters in length.
260    pub function_name: String,
261
262    /// Specify a version or alias to get details about a published version of the function.
263    #[serde(skip_serializing_if = "Option::is_none")]
264    pub qualifier: Option<String>,
265}
266
267impl GetFunctionConfigurationRequest {
268    #[cfg(any(test, feature = "test-support"))]
269    /// Create a fixture instance for testing.
270    pub fn fixture() -> Self {
271        Self {
272            function_name: "test-function_name".into(),
273            qualifier: Some("test-qualifier".into()),
274        }
275    }
276}
277
278///
279/// **AWS API**: `lambda.v1.UpdateFunctionConfigurationRequest`
280///
281/// ## Coverage
282/// 4 of 21 fields included.
283/// Omitted fields:
284/// - `Role` — not selected in manifest
285/// - `Handler` — not selected in manifest
286/// - `Description` — not selected in manifest
287/// - `VpcConfig` — not selected in manifest
288/// - `Environment` — not selected in manifest
289/// - `DeadLetterConfig` — not selected in manifest
290/// - `KMSKeyArn` — not selected in manifest
291/// - `TracingConfig` — not selected in manifest
292/// - `RevisionId` — not selected in manifest
293/// - `Layers` — not selected in manifest
294/// - `FileSystemConfigs` — not selected in manifest
295/// - `ImageConfig` — not selected in manifest
296/// - `EphemeralStorage` — not selected in manifest
297/// - `SnapStart` — not selected in manifest
298/// - `LoggingConfig` — not selected in manifest
299/// - `CapacityProviderConfig` — not selected in manifest
300/// - `DurableConfig` — not selected in manifest
301#[derive(Debug, Clone, Default, Serialize, Deserialize)]
302#[serde(rename_all = "PascalCase")]
303pub struct UpdateFunctionConfigurationRequest {
304    /// The name or ARN of the Lambda function. Name formats Function name – my-function.
305    /// Function ARN – arn:aws:lambda:us-west-2:123456789012:function:my-function. Partial ARN –
306    /// 123456789012:function:my-function. The length constraint applies only to the full ARN.
307    /// If you specify only the function name, it is limited to 64 characters in length.
308    pub function_name: String,
309
310    /// The amount of time (in seconds) that Lambda allows a function to run before stopping it.
311    /// The default is 3 seconds. The maximum allowed value is 900 seconds. For more
312    /// information, see Lambda execution environment.
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub timeout: Option<i32>,
315
316    /// The amount of memory available to the function at runtime. Increasing the function
317    /// memory also increases its CPU allocation. The default value is 128 MB. The value can be
318    /// any multiple of 1 MB.
319    #[serde(skip_serializing_if = "Option::is_none")]
320    pub memory_size: Option<i32>,
321
322    /// The identifier of the function's runtime. Runtime is required if the deployment package
323    /// is a .zip file archive. Specifying a runtime results in an error if you're deploying a
324    /// function using a container image. The following list includes deprecated runtimes.
325    /// Lambda blocks creating new functions and updating existing functions shortly after each
326    /// runtime is deprecated. For more information, see Runtime use after deprecation. For a
327    /// list of all currently supported runtimes, see Supported runtimes.
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub runtime: Option<String>,
330}
331
332impl UpdateFunctionConfigurationRequest {
333    #[cfg(any(test, feature = "test-support"))]
334    /// Create a fixture instance for testing.
335    pub fn fixture() -> Self {
336        Self {
337            function_name: "test-function_name".into(),
338            timeout: Some(100),
339            memory_size: Some(100),
340            runtime: Some("test-runtime".into()),
341        }
342    }
343}