Skip to main content

aws_lite_rs/types/
efs.rs

1//! Types for the Amazon Elastic File System 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};
7
8///
9/// **AWS API**: `efs.v1.DescribeFileSystemsRequest`
10/// **Reference**: <https://docs.aws.amazon.com/efs/latest/ug/API_Operations.html/DescribeFileSystemsRequest>
11///
12/// ## Coverage
13/// 3 of 4 fields included.
14/// Omitted fields:
15/// - `CreationToken` — not selected in manifest
16#[derive(Debug, Clone, Default, Serialize, Deserialize)]
17#[serde(rename_all = "PascalCase")]
18pub struct DescribeFileSystemsRequest {
19    /// (Optional) Specifies the maximum number of file systems to return in the response
20    /// (integer). This number is automatically set to 100. The response is paginated at 100 per
21    /// page if you have more than 100 file systems.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub max_items: Option<i32>,
24
25    /// (Optional) Opaque pagination token returned from a previous DescribeFileSystems
26    /// operation (String). If present, specifies to continue the list from where the returning
27    /// call had left off.
28    #[serde(skip_serializing_if = "Option::is_none")]
29    pub marker: Option<String>,
30
31    /// (Optional) ID of the file system whose description you want to retrieve (String).
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub file_system_id: Option<String>,
34}
35
36impl DescribeFileSystemsRequest {
37    #[cfg(any(test, feature = "test-support"))]
38    /// Create a fixture instance for testing.
39    pub fn fixture() -> Self {
40        Self {
41            max_items: Some(100),
42            marker: Some("test-marker".into()),
43            file_system_id: Some("test-file_system_id".into()),
44        }
45    }
46}
47
48///
49/// **AWS API**: `efs.v1.DescribeFileSystemsResponse`
50/// **Reference**: <https://docs.aws.amazon.com/efs/latest/ug/API_Operations.html/DescribeFileSystemsResponse>
51#[derive(Debug, Clone, Default, Serialize, Deserialize)]
52#[serde(rename_all = "PascalCase")]
53pub struct DescribeFileSystemsResponse {
54    /// An array of file system descriptions.
55    #[serde(default)]
56    #[serde(skip_serializing_if = "Vec::is_empty")]
57    pub file_systems: Vec<FileSystemDescription>,
58
59    /// Present if there are more file systems than returned in the response (String). You can
60    /// use the NextMarker in the subsequent request to fetch the descriptions.
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub next_marker: Option<String>,
63
64    /// Present if provided by caller in the request (String).
65    #[serde(skip_serializing_if = "Option::is_none")]
66    pub marker: Option<String>,
67}
68
69impl DescribeFileSystemsResponse {
70    #[cfg(any(test, feature = "test-support"))]
71    /// Create a fixture instance for testing.
72    pub fn fixture() -> Self {
73        Self {
74            file_systems: vec![],
75            next_marker: Some("test-next_marker".into()),
76            marker: Some("test-marker".into()),
77        }
78    }
79}
80
81/// A description of the file system.
82///
83/// **AWS API**: `efs.v1.FileSystemDescription`
84/// **Reference**: <https://docs.aws.amazon.com/efs/latest/ug/API_Operations.html/FileSystemDescription>
85///
86/// ## Coverage
87/// 12 of 18 fields included.
88/// Omitted fields:
89/// - `CreationToken` — not selected in manifest
90/// - `SizeInBytes` — not selected in manifest
91/// - `ProvisionedThroughputInMibps` — not selected in manifest
92/// - `AvailabilityZoneName` — not selected in manifest
93/// - `AvailabilityZoneId` — not selected in manifest
94/// - `FileSystemProtection` — not selected in manifest
95#[derive(Debug, Clone, Default, Serialize, Deserialize)]
96#[serde(rename_all = "PascalCase")]
97pub struct FileSystemDescription {
98    /// The Amazon Web Services account that created the file system.
99    pub owner_id: String,
100
101    /// The ID of the file system, assigned by Amazon EFS.
102    pub file_system_id: String,
103
104    /// The Amazon Resource Name (ARN) for the EFS file system, in the format
105    /// arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id . Example with
106    /// sample data: arn:aws:elasticfilesystem:us-west-2:1111333322228888:file-
107    /// system/fs-01234567
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub file_system_arn: Option<String>,
110
111    /// The time that the file system was created, in seconds (since 1970-01-01T00:00:00Z).
112    pub creation_time: String,
113
114    /// The lifecycle phase of the file system.
115    pub life_cycle_state: String,
116
117    /// You can add tags to a file system, including a Name tag. For more information, see
118    /// CreateFileSystem. If the file system has a Name tag, Amazon EFS returns the value in
119    /// this field.
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub name: Option<String>,
122
123    /// The current number of mount targets that the file system has. For more information, see
124    /// CreateMountTarget.
125    pub number_of_mount_targets: i32,
126
127    /// The performance mode of the file system.
128    pub performance_mode: String,
129
130    /// A Boolean value that, if true, indicates that the file system is encrypted.
131    #[serde(skip_serializing_if = "Option::is_none")]
132    pub encrypted: Option<bool>,
133
134    /// The ID of an KMS key used to protect the encrypted file system.
135    #[serde(skip_serializing_if = "Option::is_none")]
136    pub kms_key_id: Option<String>,
137
138    /// Displays the file system's throughput mode. For more information, see Throughput modes
139    /// in the Amazon EFS User Guide.
140    #[serde(skip_serializing_if = "Option::is_none")]
141    pub throughput_mode: Option<String>,
142
143    /// The tags associated with the file system, presented as an array of Tag objects.
144    #[serde(default)]
145    pub tags: Vec<Tag>,
146}
147
148impl FileSystemDescription {
149    #[cfg(any(test, feature = "test-support"))]
150    /// Create a fixture instance for testing.
151    pub fn fixture() -> Self {
152        Self {
153            owner_id: "test-owner_id".into(),
154            file_system_id: "test-file_system_id".into(),
155            file_system_arn: Some("test-file_system_arn".into()),
156            creation_time: "test-creation_time".into(),
157            life_cycle_state: "test-life_cycle_state".into(),
158            name: Some("test-name".into()),
159            number_of_mount_targets: 100,
160            performance_mode: "test-performance_mode".into(),
161            encrypted: Some(false),
162            kms_key_id: Some("test-kms_key_id".into()),
163            throughput_mode: Some("test-throughput_mode".into()),
164            tags: vec![],
165        }
166    }
167}
168
169/// A tag is a key-value pair. Allowed characters are letters, white space, and numbers that can
170/// be represented in UTF-8, and the following characters: + - = . _ : /.
171///
172/// **AWS API**: `efs.v1.Tag`
173/// **Reference**: <https://docs.aws.amazon.com/efs/latest/ug/API_Operations.html/Tag>
174#[derive(Debug, Clone, Default, Serialize, Deserialize)]
175#[serde(rename_all = "PascalCase")]
176pub struct Tag {
177    /// The tag key (String). The key can't start with aws:.
178    pub key: String,
179
180    /// The value of the tag key.
181    pub value: String,
182}
183
184impl Tag {
185    #[cfg(any(test, feature = "test-support"))]
186    /// Create a fixture instance for testing.
187    pub fn fixture() -> Self {
188        Self {
189            key: "test-key".into(),
190            value: "test-value".into(),
191        }
192    }
193}