aws_lite_rs/types/iam.rs
1//! Types for the AWS Identity and Access Management 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/// Possible values for `iam.AccessKeyMetadata.Status`.
10///
11/// **AWS API**: `iam.AccessKeyMetadata.Status`
12#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
13pub enum AccessKeyStatus {
14 #[serde(rename = "Active")]
15 Active,
16
17 #[serde(rename = "Inactive")]
18 Inactive,
19
20 #[serde(rename = "Expired")]
21 Expired,
22
23 /// Unknown or future value not yet represented.
24 #[serde(other)]
25 Unknown,
26}
27
28/// Possible values for `iam.GenerateCredentialReportResponse.State`.
29///
30/// **AWS API**: `iam.GenerateCredentialReportResponse.State`
31#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
32#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
33pub enum ReportStateType {
34 Started,
35
36 Inprogress,
37
38 Complete,
39
40 /// Unknown or future value not yet represented.
41 #[serde(other)]
42 Unknown,
43}
44
45/// Possible values for `iam.GetCredentialReportResponse.ReportFormat`.
46///
47/// **AWS API**: `iam.GetCredentialReportResponse.ReportFormat`
48#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
49pub enum ReportFormatType {
50 #[serde(rename = "text/csv")]
51 TextPercsv,
52
53 /// Unknown or future value not yet represented.
54 #[serde(other)]
55 Unknown,
56}
57
58/// Contains the response to a successful ListUsers request.
59///
60/// **AWS API**: `iam.v1.ListUsersResponse`
61/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListUsersResponse>
62#[derive(Debug, Clone, Default, Serialize, Deserialize)]
63#[serde(rename_all = "PascalCase")]
64pub struct ListUsersResponse {
65 /// A list of users.
66 #[serde(default)]
67 pub users: Vec<User>,
68
69 /// A flag that indicates whether there are more items to return. If your results were
70 /// truncated, you can make a subsequent pagination request using the Marker request
71 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
72 /// number of results even when there are more results available. We recommend that you
73 /// check IsTruncated after every call to ensure that you receive all your results.
74 #[serde(skip_serializing_if = "Option::is_none")]
75 pub is_truncated: Option<bool>,
76
77 /// When IsTruncated is true, this element is present and contains the value to use for the
78 /// Marker parameter in a subsequent pagination request.
79 #[serde(skip_serializing_if = "Option::is_none")]
80 pub marker: Option<String>,
81}
82
83impl ListUsersResponse {
84 #[cfg(any(test, feature = "test-support"))]
85 /// Create a fixture instance for testing.
86 pub fn fixture() -> Self {
87 Self {
88 users: vec![],
89 is_truncated: Some(false),
90 marker: Some("test-marker".into()),
91 }
92 }
93}
94
95/// Contains information about an IAM user entity. This data type is used as a response element
96/// in the following operations: CreateUser GetUser ListUsers
97///
98/// **AWS API**: `iam.v1.User`
99/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//User>
100///
101/// ## Coverage
102/// 3 of 8 fields included.
103/// Omitted fields:
104/// - `Path` — not selected in manifest
105/// - `UserId` — not selected in manifest
106/// - `PasswordLastUsed` — not selected in manifest
107/// - `PermissionsBoundary` — not selected in manifest
108/// - `Tags` — not selected in manifest
109#[derive(Debug, Clone, Default, Serialize, Deserialize)]
110#[serde(rename_all = "PascalCase")]
111pub struct User {
112 /// The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs
113 /// and how to use ARNs in policies, see IAM Identifiers in the IAM User Guide.
114 pub arn: String,
115
116 /// The friendly name identifying the user.
117 pub user_name: String,
118
119 /// The date and time, in ISO 8601 date-time format, when the user was created.
120 pub create_date: String,
121}
122
123impl User {
124 #[cfg(any(test, feature = "test-support"))]
125 /// Create a fixture instance for testing.
126 pub fn fixture() -> Self {
127 Self {
128 arn: "test-arn".into(),
129 user_name: "test-user_name".into(),
130 create_date: "test-create_date".into(),
131 }
132 }
133}
134
135/// Contains the response to a successful ListAttachedUserPolicies request.
136///
137/// **AWS API**: `iam.v1.ListAttachedUserPoliciesResponse`
138/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAttachedUserPoliciesResponse>
139#[derive(Debug, Clone, Default, Serialize, Deserialize)]
140#[serde(rename_all = "PascalCase")]
141pub struct ListAttachedUserPoliciesResponse {
142 /// A list of the attached policies.
143 #[serde(default)]
144 #[serde(skip_serializing_if = "Vec::is_empty")]
145 pub attached_policies: Vec<AttachedPolicy>,
146
147 /// A flag that indicates whether there are more items to return. If your results were
148 /// truncated, you can make a subsequent pagination request using the Marker request
149 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
150 /// number of results even when there are more results available. We recommend that you
151 /// check IsTruncated after every call to ensure that you receive all your results.
152 #[serde(skip_serializing_if = "Option::is_none")]
153 pub is_truncated: Option<bool>,
154
155 /// When IsTruncated is true, this element is present and contains the value to use for the
156 /// Marker parameter in a subsequent pagination request.
157 #[serde(skip_serializing_if = "Option::is_none")]
158 pub marker: Option<String>,
159}
160
161impl ListAttachedUserPoliciesResponse {
162 #[cfg(any(test, feature = "test-support"))]
163 /// Create a fixture instance for testing.
164 pub fn fixture() -> Self {
165 Self {
166 attached_policies: vec![],
167 is_truncated: Some(false),
168 marker: Some("test-marker".into()),
169 }
170 }
171}
172
173/// Contains information about an attached policy. An attached policy is a managed policy that
174/// has been attached to a user, group, or role. This data type is used as a response element in
175/// the ListAttachedGroupPolicies, ListAttachedRolePolicies, ListAttachedUserPolicies, and
176/// GetAccountAuthorizationDetails operations. For more information about managed policies,
177/// refer to Managed policies and inline policies in the IAM User Guide.
178///
179/// **AWS API**: `iam.v1.AttachedPolicy`
180/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//AttachedPolicy>
181#[derive(Debug, Clone, Default, Serialize, Deserialize)]
182#[serde(rename_all = "PascalCase")]
183pub struct AttachedPolicy {
184 /// The `PolicyArn` field.
185 #[serde(skip_serializing_if = "Option::is_none")]
186 pub policy_arn: Option<String>,
187
188 /// The friendly name of the attached policy.
189 #[serde(skip_serializing_if = "Option::is_none")]
190 pub policy_name: Option<String>,
191}
192
193impl AttachedPolicy {
194 #[cfg(any(test, feature = "test-support"))]
195 /// Create a fixture instance for testing.
196 pub fn fixture() -> Self {
197 Self {
198 policy_arn: Some("test-policy_arn".into()),
199 policy_name: Some("test-policy_name".into()),
200 }
201 }
202}
203
204/// Contains the response to a successful ListAccessKeys request.
205///
206/// **AWS API**: `iam.v1.ListAccessKeysResponse`
207/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAccessKeysResponse>
208#[derive(Debug, Clone, Default, Serialize, Deserialize)]
209#[serde(rename_all = "PascalCase")]
210pub struct ListAccessKeysResponse {
211 /// A list of objects containing metadata about the access keys.
212 #[serde(default)]
213 pub access_key_metadata: Vec<AccessKeyMetadata>,
214
215 /// A flag that indicates whether there are more items to return. If your results were
216 /// truncated, you can make a subsequent pagination request using the Marker request
217 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
218 /// number of results even when there are more results available. We recommend that you
219 /// check IsTruncated after every call to ensure that you receive all your results.
220 #[serde(skip_serializing_if = "Option::is_none")]
221 pub is_truncated: Option<bool>,
222
223 /// When IsTruncated is true, this element is present and contains the value to use for the
224 /// Marker parameter in a subsequent pagination request.
225 #[serde(skip_serializing_if = "Option::is_none")]
226 pub marker: Option<String>,
227}
228
229impl ListAccessKeysResponse {
230 #[cfg(any(test, feature = "test-support"))]
231 /// Create a fixture instance for testing.
232 pub fn fixture() -> Self {
233 Self {
234 access_key_metadata: vec![],
235 is_truncated: Some(false),
236 marker: Some("test-marker".into()),
237 }
238 }
239}
240
241/// Contains information about an Amazon Web Services access key, without its secret key. This
242/// data type is used as a response element in the ListAccessKeys operation.
243///
244/// **AWS API**: `iam.v1.AccessKeyMetadata`
245/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//AccessKeyMetadata>
246#[derive(Debug, Clone, Default, Serialize, Deserialize)]
247#[serde(rename_all = "PascalCase")]
248pub struct AccessKeyMetadata {
249 /// The name of the IAM user that the key is associated with.
250 #[serde(skip_serializing_if = "Option::is_none")]
251 pub user_name: Option<String>,
252
253 /// The ID for this access key.
254 #[serde(skip_serializing_if = "Option::is_none")]
255 pub access_key_id: Option<String>,
256
257 /// The status of the access key. Active means that the key is valid for API calls; Inactive
258 /// means it is not.
259 #[serde(skip_serializing_if = "Option::is_none")]
260 pub status: Option<AccessKeyStatus>,
261
262 /// The date when the access key was created.
263 #[serde(skip_serializing_if = "Option::is_none")]
264 pub create_date: Option<String>,
265}
266
267impl AccessKeyMetadata {
268 #[cfg(any(test, feature = "test-support"))]
269 /// Create a fixture instance for testing.
270 pub fn fixture() -> Self {
271 Self {
272 user_name: Some("test-user_name".into()),
273 access_key_id: Some("test-access_key_id".into()),
274 create_date: Some("test-create_date".into()),
275 ..Default::default()
276 }
277 }
278}
279
280/// Contains the response to a successful GetAccessKeyLastUsed request. It is also returned as a
281/// member of the AccessKeyMetaData structure returned by the ListAccessKeys action.
282///
283/// **AWS API**: `iam.v1.GetAccessKeyLastUsedResponse`
284/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetAccessKeyLastUsedResponse>
285#[derive(Debug, Clone, Default, Serialize, Deserialize)]
286#[serde(rename_all = "PascalCase")]
287pub struct GetAccessKeyLastUsedResponse {
288 /// The name of the IAM user that owns this access key.
289 #[serde(skip_serializing_if = "Option::is_none")]
290 pub user_name: Option<String>,
291
292 /// Contains information about the last time the access key was used.
293 #[serde(skip_serializing_if = "Option::is_none")]
294 pub access_key_last_used: Option<AccessKeyLastUsed>,
295}
296
297impl GetAccessKeyLastUsedResponse {
298 #[cfg(any(test, feature = "test-support"))]
299 /// Create a fixture instance for testing.
300 pub fn fixture() -> Self {
301 Self {
302 user_name: Some("test-user_name".into()),
303 access_key_last_used: Some(AccessKeyLastUsed::fixture()),
304 }
305 }
306}
307
308/// Contains information about the last time an Amazon Web Services access key was used since
309/// IAM began tracking this information on April 22, 2015. This data type is used as a response
310/// element in the GetAccessKeyLastUsed operation.
311///
312/// **AWS API**: `iam.v1.AccessKeyLastUsed`
313/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//AccessKeyLastUsed>
314#[derive(Debug, Clone, Default, Serialize, Deserialize)]
315#[serde(rename_all = "PascalCase")]
316pub struct AccessKeyLastUsed {
317 /// The date and time, in ISO 8601 date-time format, when the access key was most recently
318 /// used. This field is null in the following situations: The user does not have an access
319 /// key. An access key exists but has not been used since IAM began tracking this
320 /// information. There is no sign-in data associated with the user.
321 #[serde(skip_serializing_if = "Option::is_none")]
322 pub last_used_date: Option<String>,
323
324 /// The name of the Amazon Web Services service with which this access key was most recently
325 /// used. The value of this field is "N/A" in the following situations: The user does not
326 /// have an access key. An access key exists but has not been used since IAM started
327 /// tracking this information. There is no sign-in data associated with the user.
328 pub service_name: String,
329
330 /// The Amazon Web Services Region where this access key was most recently used. The value
331 /// for this field is "N/A" in the following situations: The user does not have an access
332 /// key. An access key exists but has not been used since IAM began tracking this
333 /// information. There is no sign-in data associated with the user. For more information
334 /// about Amazon Web Services Regions, see Regions and endpoints in the Amazon Web Services
335 /// General Reference.
336 pub region: String,
337}
338
339impl AccessKeyLastUsed {
340 #[cfg(any(test, feature = "test-support"))]
341 /// Create a fixture instance for testing.
342 pub fn fixture() -> Self {
343 Self {
344 last_used_date: Some("test-last_used_date".into()),
345 service_name: "test-service_name".into(),
346 region: "test-region".into(),
347 }
348 }
349}
350
351/// Contains the response to a successful GenerateCredentialReport request.
352///
353/// **AWS API**: `iam.v1.GenerateCredentialReportResponse`
354/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GenerateCredentialReportResponse>
355#[derive(Debug, Clone, Default, Serialize, Deserialize)]
356#[serde(rename_all = "PascalCase")]
357pub struct GenerateCredentialReportResponse {
358 /// Information about the state of the credential report.
359 #[serde(skip_serializing_if = "Option::is_none")]
360 pub state: Option<ReportStateType>,
361
362 /// Information about the credential report.
363 #[serde(skip_serializing_if = "Option::is_none")]
364 pub description: Option<String>,
365}
366
367impl GenerateCredentialReportResponse {
368 #[cfg(any(test, feature = "test-support"))]
369 /// Create a fixture instance for testing.
370 pub fn fixture() -> Self {
371 Self {
372 description: Some("test-description".into()),
373 ..Default::default()
374 }
375 }
376}
377
378/// Contains the response to a successful GetCredentialReport request.
379///
380/// **AWS API**: `iam.v1.GetCredentialReportResponse`
381/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetCredentialReportResponse>
382#[derive(Debug, Clone, Default, Serialize, Deserialize)]
383#[serde(rename_all = "PascalCase")]
384pub struct GetCredentialReportResponse {
385 /// Contains the credential report. The report is Base64-encoded.
386 ///
387 /// *Wire format: base64-encoded. Serde handles encoding/decoding automatically.*
388 #[serde(
389 default,
390 skip_serializing_if = "Option::is_none",
391 serialize_with = "crate::serde_base64::serialize_base64_opt",
392 deserialize_with = "crate::serde_base64::deserialize_base64_opt"
393 )]
394 pub content: Option<String>,
395
396 /// The format (MIME type) of the credential report.
397 #[serde(skip_serializing_if = "Option::is_none")]
398 pub report_format: Option<ReportFormatType>,
399
400 /// The date and time when the credential report was created, in ISO 8601 date-time format.
401 #[serde(skip_serializing_if = "Option::is_none")]
402 pub generated_time: Option<String>,
403}
404
405impl GetCredentialReportResponse {
406 #[cfg(any(test, feature = "test-support"))]
407 /// Create a fixture instance for testing.
408 pub fn fixture() -> Self {
409 Self {
410 content: Some("test-content".into()),
411 generated_time: Some("test-generated_time".into()),
412 ..Default::default()
413 }
414 }
415}
416
417/// Contains the response to a successful ListMFADevices request.
418///
419/// **AWS API**: `iam.v1.ListMFADevicesResponse`
420/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListMFADevicesResponse>
421#[derive(Debug, Clone, Default, Serialize, Deserialize)]
422#[serde(rename_all = "PascalCase")]
423pub struct ListMFADevicesResponse {
424 /// A list of MFA devices.
425 #[serde(rename = "MFADevices")]
426 #[serde(default)]
427 pub mfa_devices: Vec<MFADevice>,
428
429 /// A flag that indicates whether there are more items to return. If your results were
430 /// truncated, you can make a subsequent pagination request using the Marker request
431 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
432 /// number of results even when there are more results available. We recommend that you
433 /// check IsTruncated after every call to ensure that you receive all your results.
434 #[serde(skip_serializing_if = "Option::is_none")]
435 pub is_truncated: Option<bool>,
436
437 /// When IsTruncated is true, this element is present and contains the value to use for the
438 /// Marker parameter in a subsequent pagination request.
439 #[serde(skip_serializing_if = "Option::is_none")]
440 pub marker: Option<String>,
441}
442
443impl ListMFADevicesResponse {
444 #[cfg(any(test, feature = "test-support"))]
445 /// Create a fixture instance for testing.
446 pub fn fixture() -> Self {
447 Self {
448 mfa_devices: vec![],
449 is_truncated: Some(false),
450 marker: Some("test-marker".into()),
451 }
452 }
453}
454
455/// Contains information about an MFA device. This data type is used as a response element in
456/// the ListMFADevices operation.
457///
458/// **AWS API**: `iam.v1.MFADevice`
459/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//MFADevice>
460#[derive(Debug, Clone, Default, Serialize, Deserialize)]
461#[serde(rename_all = "PascalCase")]
462pub struct MFADevice {
463 /// The user with whom the MFA device is associated.
464 pub user_name: String,
465
466 /// The serial number that uniquely identifies the MFA device. For virtual MFA devices, the
467 /// serial number is the device ARN.
468 pub serial_number: String,
469
470 /// The date when the MFA device was enabled for the user.
471 pub enable_date: String,
472}
473
474impl MFADevice {
475 #[cfg(any(test, feature = "test-support"))]
476 /// Create a fixture instance for testing.
477 pub fn fixture() -> Self {
478 Self {
479 user_name: "test-user_name".into(),
480 serial_number: "test-serial_number".into(),
481 enable_date: "test-enable_date".into(),
482 }
483 }
484}
485
486/// Contains the response to a successful GetLoginProfile request.
487///
488/// **AWS API**: `iam.v1.GetLoginProfileResponse`
489/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetLoginProfileResponse>
490#[derive(Debug, Clone, Default, Serialize, Deserialize)]
491#[serde(rename_all = "PascalCase")]
492pub struct GetLoginProfileResponse {
493 /// A structure containing the user name and the profile creation date for the user.
494 pub login_profile: LoginProfile,
495}
496
497impl GetLoginProfileResponse {
498 #[cfg(any(test, feature = "test-support"))]
499 /// Create a fixture instance for testing.
500 pub fn fixture() -> Self {
501 Self {
502 login_profile: LoginProfile::fixture(),
503 }
504 }
505}
506
507/// Contains the user name and password create date for a user. This data type is used as a
508/// response element in the CreateLoginProfile and GetLoginProfile operations.
509///
510/// **AWS API**: `iam.v1.LoginProfile`
511/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//LoginProfile>
512#[derive(Debug, Clone, Default, Serialize, Deserialize)]
513#[serde(rename_all = "PascalCase")]
514pub struct LoginProfile {
515 /// The name of the user, which can be used for signing in to the Amazon Web Services
516 /// Management Console.
517 pub user_name: String,
518
519 /// The date when the password for the user was created.
520 pub create_date: String,
521
522 /// Specifies whether the user is required to set a new password on next sign-in.
523 #[serde(skip_serializing_if = "Option::is_none")]
524 pub password_reset_required: Option<bool>,
525}
526
527impl LoginProfile {
528 #[cfg(any(test, feature = "test-support"))]
529 /// Create a fixture instance for testing.
530 pub fn fixture() -> Self {
531 Self {
532 user_name: "test-user_name".into(),
533 create_date: "test-create_date".into(),
534 password_reset_required: Some(false),
535 }
536 }
537}
538
539/// Contains the response to a successful GetAccountSummary request.
540///
541/// **AWS API**: `iam.v1.GetAccountSummaryResponse`
542/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetAccountSummaryResponse>
543#[derive(Debug, Clone, Default, Serialize, Deserialize)]
544#[serde(rename_all = "PascalCase")]
545pub struct GetAccountSummaryResponse {
546 /// A set of key–value pairs containing information about IAM entity usage and IAM quotas.
547 #[serde(default)]
548 #[serde(skip_serializing_if = "HashMap::is_empty")]
549 pub summary_map: HashMap<String, i32>,
550}
551
552impl GetAccountSummaryResponse {
553 #[cfg(any(test, feature = "test-support"))]
554 /// Create a fixture instance for testing.
555 pub fn fixture() -> Self {
556 Self {
557 summary_map: Default::default(),
558 }
559 }
560}
561
562/// Contains the response to a successful GetAccountPasswordPolicy request.
563///
564/// **AWS API**: `iam.v1.GetAccountPasswordPolicyResponse`
565/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetAccountPasswordPolicyResponse>
566#[derive(Debug, Clone, Default, Serialize, Deserialize)]
567#[serde(rename_all = "PascalCase")]
568pub struct GetAccountPasswordPolicyResponse {
569 /// A structure that contains details about the account's password policy.
570 pub password_policy: PasswordPolicy,
571}
572
573impl GetAccountPasswordPolicyResponse {
574 #[cfg(any(test, feature = "test-support"))]
575 /// Create a fixture instance for testing.
576 pub fn fixture() -> Self {
577 Self {
578 password_policy: PasswordPolicy::fixture(),
579 }
580 }
581}
582
583/// Contains information about the account password policy. This data type is used as a response
584/// element in the GetAccountPasswordPolicy operation.
585///
586/// **AWS API**: `iam.v1.PasswordPolicy`
587/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//PasswordPolicy>
588#[derive(Debug, Clone, Default, Serialize, Deserialize)]
589#[serde(rename_all = "PascalCase")]
590pub struct PasswordPolicy {
591 /// Minimum length to require for IAM user passwords.
592 #[serde(skip_serializing_if = "Option::is_none")]
593 pub minimum_password_length: Option<i32>,
594
595 /// Specifies whether IAM user passwords must contain at least one of the following symbols:
596 /// ! @ # $ % ^ & * ( ) _ + - = [ ] { } | '
597 #[serde(skip_serializing_if = "Option::is_none")]
598 pub require_symbols: Option<bool>,
599
600 /// Specifies whether IAM user passwords must contain at least one numeric character (0 to
601 /// 9).
602 #[serde(skip_serializing_if = "Option::is_none")]
603 pub require_numbers: Option<bool>,
604
605 /// Specifies whether IAM user passwords must contain at least one uppercase character (A to
606 /// Z).
607 #[serde(skip_serializing_if = "Option::is_none")]
608 pub require_uppercase_characters: Option<bool>,
609
610 /// Specifies whether IAM user passwords must contain at least one lowercase character (a to
611 /// z).
612 #[serde(skip_serializing_if = "Option::is_none")]
613 pub require_lowercase_characters: Option<bool>,
614
615 /// Specifies whether IAM users are allowed to change their own password. Gives IAM users
616 /// permissions to iam:ChangePassword for only their user and to the
617 /// iam:GetAccountPasswordPolicy action. This option does not attach a permissions policy to
618 /// each user, rather the permissions are applied at the account-level for all users by IAM.
619 #[serde(skip_serializing_if = "Option::is_none")]
620 pub allow_users_to_change_password: Option<bool>,
621
622 /// Indicates whether passwords in the account expire. Returns true if MaxPasswordAge
623 /// contains a value greater than 0. Returns false if MaxPasswordAge is 0 or not present.
624 #[serde(skip_serializing_if = "Option::is_none")]
625 pub expire_passwords: Option<bool>,
626
627 /// The number of days that an IAM user password is valid.
628 #[serde(skip_serializing_if = "Option::is_none")]
629 pub max_password_age: Option<i32>,
630
631 /// Specifies the number of previous passwords that IAM users are prevented from reusing.
632 #[serde(skip_serializing_if = "Option::is_none")]
633 pub password_reuse_prevention: Option<i32>,
634
635 /// Specifies whether IAM users are prevented from setting a new password via the Amazon Web
636 /// Services Management Console after their password has expired. The IAM user cannot access
637 /// the console until an administrator resets the password. IAM users with
638 /// iam:ChangePassword permission and active access keys can reset their own expired console
639 /// password using the CLI or API.
640 #[serde(skip_serializing_if = "Option::is_none")]
641 pub hard_expiry: Option<bool>,
642}
643
644impl PasswordPolicy {
645 #[cfg(any(test, feature = "test-support"))]
646 /// Create a fixture instance for testing.
647 pub fn fixture() -> Self {
648 Self {
649 minimum_password_length: Some(100),
650 require_symbols: Some(false),
651 require_numbers: Some(false),
652 require_uppercase_characters: Some(false),
653 require_lowercase_characters: Some(false),
654 allow_users_to_change_password: Some(false),
655 expire_passwords: Some(false),
656 max_password_age: Some(100),
657 password_reuse_prevention: Some(100),
658 hard_expiry: Some(false),
659 }
660 }
661}
662
663/// Contains the response to a successful ListRoles request.
664///
665/// **AWS API**: `iam.v1.ListRolesResponse`
666/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListRolesResponse>
667#[derive(Debug, Clone, Default, Serialize, Deserialize)]
668#[serde(rename_all = "PascalCase")]
669pub struct ListRolesResponse {
670 /// A list of roles.
671 #[serde(default)]
672 pub roles: Vec<Role>,
673
674 /// A flag that indicates whether there are more items to return. If your results were
675 /// truncated, you can make a subsequent pagination request using the Marker request
676 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
677 /// number of results even when there are more results available. We recommend that you
678 /// check IsTruncated after every call to ensure that you receive all your results.
679 #[serde(skip_serializing_if = "Option::is_none")]
680 pub is_truncated: Option<bool>,
681
682 /// When IsTruncated is true, this element is present and contains the value to use for the
683 /// Marker parameter in a subsequent pagination request.
684 #[serde(skip_serializing_if = "Option::is_none")]
685 pub marker: Option<String>,
686}
687
688impl ListRolesResponse {
689 #[cfg(any(test, feature = "test-support"))]
690 /// Create a fixture instance for testing.
691 pub fn fixture() -> Self {
692 Self {
693 roles: vec![],
694 is_truncated: Some(false),
695 marker: Some("test-marker".into()),
696 }
697 }
698}
699
700/// Contains information about an IAM role. This structure is returned as a response element in
701/// several API operations that interact with roles.
702///
703/// **AWS API**: `iam.v1.Role`
704/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//Role>
705///
706/// ## Coverage
707/// 4 of 11 fields included.
708/// Omitted fields:
709/// - `Path` — not selected in manifest
710/// - `RoleId` — not selected in manifest
711/// - `AssumeRolePolicyDocument` — not selected in manifest
712/// - `MaxSessionDuration` — not selected in manifest
713/// - `PermissionsBoundary` — not selected in manifest
714/// - `Tags` — not selected in manifest
715/// - `RoleLastUsed` — not selected in manifest
716#[derive(Debug, Clone, Default, Serialize, Deserialize)]
717#[serde(rename_all = "PascalCase")]
718pub struct Role {
719 /// The friendly name that identifies the role.
720 pub role_name: String,
721
722 /// The Amazon Resource Name (ARN) specifying the role. For more information about ARNs and
723 /// how to use them in policies, see IAM identifiers in the IAM User Guide guide.
724 pub arn: String,
725
726 /// The date and time, in ISO 8601 date-time format, when the role was created.
727 pub create_date: String,
728
729 /// A description of the role that you provide.
730 #[serde(skip_serializing_if = "Option::is_none")]
731 pub description: Option<String>,
732}
733
734impl Role {
735 #[cfg(any(test, feature = "test-support"))]
736 /// Create a fixture instance for testing.
737 pub fn fixture() -> Self {
738 Self {
739 role_name: "test-role_name".into(),
740 arn: "test-arn".into(),
741 create_date: "test-create_date".into(),
742 description: Some("test-description".into()),
743 }
744 }
745}
746
747/// Contains the response to a successful ListUserPolicies request.
748///
749/// **AWS API**: `iam.v1.ListUserPoliciesResponse`
750/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListUserPoliciesResponse>
751#[derive(Debug, Clone, Default, Serialize, Deserialize)]
752#[serde(rename_all = "PascalCase")]
753pub struct ListUserPoliciesResponse {
754 /// A list of policy names.
755 #[serde(default)]
756 pub policy_names: Vec<String>,
757
758 /// A flag that indicates whether there are more items to return. If your results were
759 /// truncated, you can make a subsequent pagination request using the Marker request
760 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
761 /// number of results even when there are more results available. We recommend that you
762 /// check IsTruncated after every call to ensure that you receive all your results.
763 #[serde(skip_serializing_if = "Option::is_none")]
764 pub is_truncated: Option<bool>,
765
766 /// When IsTruncated is true, this element is present and contains the value to use for the
767 /// Marker parameter in a subsequent pagination request.
768 #[serde(skip_serializing_if = "Option::is_none")]
769 pub marker: Option<String>,
770}
771
772impl ListUserPoliciesResponse {
773 #[cfg(any(test, feature = "test-support"))]
774 /// Create a fixture instance for testing.
775 pub fn fixture() -> Self {
776 Self {
777 policy_names: vec![],
778 is_truncated: Some(false),
779 marker: Some("test-marker".into()),
780 }
781 }
782}
783
784/// Contains the response to a successful ListGroupsForUser request.
785///
786/// **AWS API**: `iam.v1.ListGroupsForUserResponse`
787/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListGroupsForUserResponse>
788#[derive(Debug, Clone, Default, Serialize, Deserialize)]
789#[serde(rename_all = "PascalCase")]
790pub struct ListGroupsForUserResponse {
791 /// A list of groups.
792 #[serde(default)]
793 pub groups: Vec<Group>,
794
795 /// A flag that indicates whether there are more items to return. If your results were
796 /// truncated, you can make a subsequent pagination request using the Marker request
797 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
798 /// number of results even when there are more results available. We recommend that you
799 /// check IsTruncated after every call to ensure that you receive all your results.
800 #[serde(skip_serializing_if = "Option::is_none")]
801 pub is_truncated: Option<bool>,
802
803 /// When IsTruncated is true, this element is present and contains the value to use for the
804 /// Marker parameter in a subsequent pagination request.
805 #[serde(skip_serializing_if = "Option::is_none")]
806 pub marker: Option<String>,
807}
808
809impl ListGroupsForUserResponse {
810 #[cfg(any(test, feature = "test-support"))]
811 /// Create a fixture instance for testing.
812 pub fn fixture() -> Self {
813 Self {
814 groups: vec![],
815 is_truncated: Some(false),
816 marker: Some("test-marker".into()),
817 }
818 }
819}
820
821/// Contains information about an IAM group entity. This data type is used as a response element
822/// in the following operations: CreateGroup GetGroup ListGroups
823///
824/// **AWS API**: `iam.v1.Group`
825/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//Group>
826///
827/// ## Coverage
828/// 3 of 5 fields included.
829/// Omitted fields:
830/// - `Path` — not selected in manifest
831/// - `GroupId` — not selected in manifest
832#[derive(Debug, Clone, Default, Serialize, Deserialize)]
833#[serde(rename_all = "PascalCase")]
834pub struct Group {
835 /// The friendly name that identifies the group.
836 pub group_name: String,
837
838 /// The Amazon Resource Name (ARN) specifying the group. For more information about ARNs and
839 /// how to use them in policies, see IAM identifiers in the IAM User Guide.
840 pub arn: String,
841
842 /// The date and time, in ISO 8601 date-time format, when the group was created.
843 pub create_date: String,
844}
845
846impl Group {
847 #[cfg(any(test, feature = "test-support"))]
848 /// Create a fixture instance for testing.
849 pub fn fixture() -> Self {
850 Self {
851 group_name: "test-group_name".into(),
852 arn: "test-arn".into(),
853 create_date: "test-create_date".into(),
854 }
855 }
856}
857
858/// Contains the response to a successful ListServerCertificates request.
859///
860/// **AWS API**: `iam.v1.ListServerCertificatesResponse`
861/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListServerCertificatesResponse>
862#[derive(Debug, Clone, Default, Serialize, Deserialize)]
863#[serde(rename_all = "PascalCase")]
864pub struct ListServerCertificatesResponse {
865 /// A list of server certificates.
866 #[serde(default)]
867 pub server_certificate_metadata_list: Vec<ServerCertificateMetadata>,
868
869 /// A flag that indicates whether there are more items to return. If your results were
870 /// truncated, you can make a subsequent pagination request using the Marker request
871 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
872 /// number of results even when there are more results available. We recommend that you
873 /// check IsTruncated after every call to ensure that you receive all your results.
874 #[serde(skip_serializing_if = "Option::is_none")]
875 pub is_truncated: Option<bool>,
876
877 /// When IsTruncated is true, this element is present and contains the value to use for the
878 /// Marker parameter in a subsequent pagination request.
879 #[serde(skip_serializing_if = "Option::is_none")]
880 pub marker: Option<String>,
881}
882
883impl ListServerCertificatesResponse {
884 #[cfg(any(test, feature = "test-support"))]
885 /// Create a fixture instance for testing.
886 pub fn fixture() -> Self {
887 Self {
888 server_certificate_metadata_list: vec![],
889 is_truncated: Some(false),
890 marker: Some("test-marker".into()),
891 }
892 }
893}
894
895/// Contains information about a server certificate without its certificate body, certificate
896/// chain, and private key. This data type is used as a response element in the
897/// UploadServerCertificate and ListServerCertificates operations.
898///
899/// **AWS API**: `iam.v1.ServerCertificateMetadata`
900/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ServerCertificateMetadata>
901///
902/// ## Coverage
903/// 4 of 6 fields included.
904/// Omitted fields:
905/// - `Path` — not selected in manifest
906/// - `ServerCertificateId` — not selected in manifest
907#[derive(Debug, Clone, Default, Serialize, Deserialize)]
908#[serde(rename_all = "PascalCase")]
909pub struct ServerCertificateMetadata {
910 /// The name that identifies the server certificate.
911 pub server_certificate_name: String,
912
913 /// The Amazon Resource Name (ARN) specifying the server certificate. For more information
914 /// about ARNs and how to use them in policies, see IAM identifiers in the IAM User Guide.
915 pub arn: String,
916
917 /// The date on which the certificate is set to expire.
918 #[serde(skip_serializing_if = "Option::is_none")]
919 pub expiration: Option<String>,
920
921 /// The date when the server certificate was uploaded.
922 #[serde(skip_serializing_if = "Option::is_none")]
923 pub upload_date: Option<String>,
924}
925
926impl ServerCertificateMetadata {
927 #[cfg(any(test, feature = "test-support"))]
928 /// Create a fixture instance for testing.
929 pub fn fixture() -> Self {
930 Self {
931 server_certificate_name: "test-server_certificate_name".into(),
932 arn: "test-arn".into(),
933 expiration: Some("test-expiration".into()),
934 upload_date: Some("test-upload_date".into()),
935 }
936 }
937}
938
939///
940/// **AWS API**: `iam.v1.CreateServiceLinkedRoleRequest`
941/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//CreateServiceLinkedRoleRequest>
942#[derive(Debug, Clone, Default, Serialize, Deserialize)]
943#[serde(rename_all = "PascalCase")]
944pub struct CreateServiceLinkedRoleRequest {
945 /// The service principal for the Amazon Web Services service to which this role is
946 /// attached. You use a string similar to a URL but without the http:// in front. For
947 /// example: elasticbeanstalk.amazonaws.com. Service principals are unique and case-
948 /// sensitive. To find the exact service principal for your service-linked role, see Amazon
949 /// Web Services services that work with IAM in the IAM User Guide. Look for the services
950 /// that have Yes in the Service-Linked Role column. Choose the Yes link to view the
951 /// service-linked role documentation for that service.
952 #[serde(rename = "AWSServiceName")]
953 pub aws_service_name: String,
954
955 /// The description of the role.
956 #[serde(skip_serializing_if = "Option::is_none")]
957 pub description: Option<String>,
958
959 /// A string that you provide, which is combined with the service-provided prefix to form
960 /// the complete role name. If you make multiple requests for the same service, then you
961 /// must supply a different CustomSuffix for each request. Otherwise the request fails with
962 /// a duplicate role name error. For example, you could add -1 or -debug to the suffix. Some
963 /// services do not support the CustomSuffix parameter. If you provide an optional suffix
964 /// and the operation fails, try the operation again without the suffix.
965 #[serde(skip_serializing_if = "Option::is_none")]
966 pub custom_suffix: Option<String>,
967}
968
969impl CreateServiceLinkedRoleRequest {
970 #[cfg(any(test, feature = "test-support"))]
971 /// Create a fixture instance for testing.
972 pub fn fixture() -> Self {
973 Self {
974 aws_service_name: "test-aws_service_name".into(),
975 description: Some("test-description".into()),
976 custom_suffix: Some("test-custom_suffix".into()),
977 }
978 }
979}
980
981///
982/// **AWS API**: `iam.v1.CreateServiceLinkedRoleResponse`
983/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//CreateServiceLinkedRoleResponse>
984#[derive(Debug, Clone, Default, Serialize, Deserialize)]
985#[serde(rename_all = "PascalCase")]
986pub struct CreateServiceLinkedRoleResponse {
987 /// A Role object that contains details about the newly created role.
988 #[serde(skip_serializing_if = "Option::is_none")]
989 pub role: Option<Role>,
990}
991
992impl CreateServiceLinkedRoleResponse {
993 #[cfg(any(test, feature = "test-support"))]
994 /// Create a fixture instance for testing.
995 pub fn fixture() -> Self {
996 Self {
997 role: Some(Role::fixture()),
998 }
999 }
1000}
1001
1002/// Contains the response to a successful GetUserPolicy request.
1003///
1004/// **AWS API**: `iam.v1.GetUserPolicyResponse`
1005/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetUserPolicyResponse>
1006#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1007#[serde(rename_all = "PascalCase")]
1008pub struct GetUserPolicyResponse {
1009 /// The user the policy is associated with.
1010 pub user_name: String,
1011
1012 /// The name of the policy.
1013 pub policy_name: String,
1014
1015 /// The policy document. IAM stores policies in JSON format. However, resources that were
1016 /// created using CloudFormation templates can be formatted in YAML. CloudFormation always
1017 /// converts a YAML policy to JSON format before submitting it to IAM.
1018 pub policy_document: String,
1019}
1020
1021impl GetUserPolicyResponse {
1022 #[cfg(any(test, feature = "test-support"))]
1023 /// Create a fixture instance for testing.
1024 pub fn fixture() -> Self {
1025 Self {
1026 user_name: "test-user_name".into(),
1027 policy_name: "test-policy_name".into(),
1028 policy_document: "test-policy_document".into(),
1029 }
1030 }
1031}
1032
1033/// Contains the response to a successful ListAttachedGroupPolicies request.
1034///
1035/// **AWS API**: `iam.v1.ListAttachedGroupPoliciesResponse`
1036/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAttachedGroupPoliciesResponse>
1037#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1038#[serde(rename_all = "PascalCase")]
1039pub struct ListAttachedGroupPoliciesResponse {
1040 /// A list of the attached policies.
1041 #[serde(default)]
1042 #[serde(skip_serializing_if = "Vec::is_empty")]
1043 pub attached_policies: Vec<AttachedPolicy>,
1044
1045 /// A flag that indicates whether there are more items to return. If your results were
1046 /// truncated, you can make a subsequent pagination request using the Marker request
1047 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
1048 /// number of results even when there are more results available. We recommend that you
1049 /// check IsTruncated after every call to ensure that you receive all your results.
1050 #[serde(skip_serializing_if = "Option::is_none")]
1051 pub is_truncated: Option<bool>,
1052
1053 /// When IsTruncated is true, this element is present and contains the value to use for the
1054 /// Marker parameter in a subsequent pagination request.
1055 #[serde(skip_serializing_if = "Option::is_none")]
1056 pub marker: Option<String>,
1057}
1058
1059impl ListAttachedGroupPoliciesResponse {
1060 #[cfg(any(test, feature = "test-support"))]
1061 /// Create a fixture instance for testing.
1062 pub fn fixture() -> Self {
1063 Self {
1064 attached_policies: vec![],
1065 is_truncated: Some(false),
1066 marker: Some("test-marker".into()),
1067 }
1068 }
1069}
1070
1071/// Contains the response to a successful ListVirtualMFADevices request.
1072///
1073/// **AWS API**: `iam.v1.ListVirtualMFADevicesResponse`
1074/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListVirtualMFADevicesResponse>
1075#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1076#[serde(rename_all = "PascalCase")]
1077pub struct ListVirtualMFADevicesResponse {
1078 /// The list of virtual MFA devices in the current account that match the AssignmentStatus
1079 /// value that was passed in the request.
1080 #[serde(rename = "VirtualMFADevices")]
1081 #[serde(default)]
1082 pub virtual_mfa_devices: Vec<VirtualMFADevice>,
1083
1084 /// A flag that indicates whether there are more items to return. If your results were
1085 /// truncated, you can make a subsequent pagination request using the Marker request
1086 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
1087 /// number of results even when there are more results available. We recommend that you
1088 /// check IsTruncated after every call to ensure that you receive all your results.
1089 #[serde(skip_serializing_if = "Option::is_none")]
1090 pub is_truncated: Option<bool>,
1091
1092 /// When IsTruncated is true, this element is present and contains the value to use for the
1093 /// Marker parameter in a subsequent pagination request.
1094 #[serde(skip_serializing_if = "Option::is_none")]
1095 pub marker: Option<String>,
1096}
1097
1098impl ListVirtualMFADevicesResponse {
1099 #[cfg(any(test, feature = "test-support"))]
1100 /// Create a fixture instance for testing.
1101 pub fn fixture() -> Self {
1102 Self {
1103 virtual_mfa_devices: vec![],
1104 is_truncated: Some(false),
1105 marker: Some("test-marker".into()),
1106 }
1107 }
1108}
1109
1110/// Contains information about a virtual MFA device.
1111///
1112/// **AWS API**: `iam.v1.VirtualMFADevice`
1113/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//VirtualMFADevice>
1114///
1115/// ## Coverage
1116/// 3 of 6 fields included.
1117/// Omitted fields:
1118/// - `Base32StringSeed` — not selected in manifest
1119/// - `QRCodePNG` — not selected in manifest
1120/// - `Tags` — not selected in manifest
1121#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1122#[serde(rename_all = "PascalCase")]
1123pub struct VirtualMFADevice {
1124 /// The serial number associated with VirtualMFADevice.
1125 pub serial_number: String,
1126
1127 /// The date and time on which the virtual MFA device was enabled.
1128 #[serde(skip_serializing_if = "Option::is_none")]
1129 pub enable_date: Option<String>,
1130
1131 /// The IAM user associated with this virtual MFA device.
1132 #[serde(skip_serializing_if = "Option::is_none")]
1133 pub user: Option<User>,
1134}
1135
1136impl VirtualMFADevice {
1137 #[cfg(any(test, feature = "test-support"))]
1138 /// Create a fixture instance for testing.
1139 pub fn fixture() -> Self {
1140 Self {
1141 serial_number: "test-serial_number".into(),
1142 enable_date: Some("test-enable_date".into()),
1143 user: Some(User::fixture()),
1144 }
1145 }
1146}
1147
1148/// Contains the response to a successful ListPolicies request.
1149///
1150/// **AWS API**: `iam.v1.ListPoliciesResponse`
1151/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListPoliciesResponse>
1152#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1153#[serde(rename_all = "PascalCase")]
1154pub struct ListPoliciesResponse {
1155 /// A list of policies.
1156 #[serde(default)]
1157 #[serde(skip_serializing_if = "Vec::is_empty")]
1158 pub policies: Vec<Policy>,
1159
1160 /// A flag that indicates whether there are more items to return. If your results were
1161 /// truncated, you can make a subsequent pagination request using the Marker request
1162 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
1163 /// number of results even when there are more results available. We recommend that you
1164 /// check IsTruncated after every call to ensure that you receive all your results.
1165 #[serde(skip_serializing_if = "Option::is_none")]
1166 pub is_truncated: Option<bool>,
1167
1168 /// When IsTruncated is true, this element is present and contains the value to use for the
1169 /// Marker parameter in a subsequent pagination request.
1170 #[serde(skip_serializing_if = "Option::is_none")]
1171 pub marker: Option<String>,
1172}
1173
1174impl ListPoliciesResponse {
1175 #[cfg(any(test, feature = "test-support"))]
1176 /// Create a fixture instance for testing.
1177 pub fn fixture() -> Self {
1178 Self {
1179 policies: vec![],
1180 is_truncated: Some(false),
1181 marker: Some("test-marker".into()),
1182 }
1183 }
1184}
1185
1186/// Contains information about a managed policy. This data type is used as a response element in
1187/// the CreatePolicy, GetPolicy, and ListPolicies operations. For more information about managed
1188/// policies, refer to Managed policies and inline policies in the IAM User Guide.
1189///
1190/// **AWS API**: `iam.v1.Policy`
1191/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//Policy>
1192///
1193/// ## Coverage
1194/// 7 of 12 fields included.
1195/// Omitted fields:
1196/// - `Path` — not selected in manifest
1197/// - `AttachmentCount` — not selected in manifest
1198/// - `PermissionsBoundaryUsageCount` — not selected in manifest
1199/// - `Description` — not selected in manifest
1200/// - `Tags` — not selected in manifest
1201#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1202#[serde(rename_all = "PascalCase")]
1203pub struct Policy {
1204 /// The friendly name (not ARN) identifying the policy.
1205 #[serde(skip_serializing_if = "Option::is_none")]
1206 pub policy_name: Option<String>,
1207
1208 /// The stable and unique string identifying the policy. For more information about IDs, see
1209 /// IAM identifiers in the IAM User Guide.
1210 #[serde(skip_serializing_if = "Option::is_none")]
1211 pub policy_id: Option<String>,
1212
1213 /// The `Arn` field.
1214 #[serde(skip_serializing_if = "Option::is_none")]
1215 pub arn: Option<String>,
1216
1217 /// The identifier for the version of the policy that is set as the default version.
1218 #[serde(skip_serializing_if = "Option::is_none")]
1219 pub default_version_id: Option<String>,
1220
1221 /// Specifies whether the policy can be attached to an IAM user, group, or role.
1222 #[serde(skip_serializing_if = "Option::is_none")]
1223 pub is_attachable: Option<bool>,
1224
1225 /// The date and time, in ISO 8601 date-time format, when the policy was created.
1226 #[serde(skip_serializing_if = "Option::is_none")]
1227 pub create_date: Option<String>,
1228
1229 /// The date and time, in ISO 8601 date-time format, when the policy was last updated. When
1230 /// a policy has only one version, this field contains the date and time when the policy was
1231 /// created. When a policy has more than one version, this field contains the date and time
1232 /// when the most recent policy version was created.
1233 #[serde(skip_serializing_if = "Option::is_none")]
1234 pub update_date: Option<String>,
1235}
1236
1237impl Policy {
1238 #[cfg(any(test, feature = "test-support"))]
1239 /// Create a fixture instance for testing.
1240 pub fn fixture() -> Self {
1241 Self {
1242 policy_name: Some("test-policy_name".into()),
1243 policy_id: Some("test-policy_id".into()),
1244 arn: Some("test-arn".into()),
1245 default_version_id: Some("test-default_version_id".into()),
1246 is_attachable: Some(false),
1247 create_date: Some("test-create_date".into()),
1248 update_date: Some("test-update_date".into()),
1249 }
1250 }
1251}
1252
1253/// Contains the response to a successful GetPolicyVersion request.
1254///
1255/// **AWS API**: `iam.v1.GetPolicyVersionResponse`
1256/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetPolicyVersionResponse>
1257#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1258#[serde(rename_all = "PascalCase")]
1259pub struct GetPolicyVersionResponse {
1260 /// A structure containing details about the policy version.
1261 #[serde(skip_serializing_if = "Option::is_none")]
1262 pub policy_version: Option<PolicyVersion>,
1263}
1264
1265impl GetPolicyVersionResponse {
1266 #[cfg(any(test, feature = "test-support"))]
1267 /// Create a fixture instance for testing.
1268 pub fn fixture() -> Self {
1269 Self {
1270 policy_version: Some(PolicyVersion::fixture()),
1271 }
1272 }
1273}
1274
1275/// Contains information about a version of a managed policy. This data type is used as a
1276/// response element in the CreatePolicyVersion, GetPolicyVersion, ListPolicyVersions, and
1277/// GetAccountAuthorizationDetails operations. For more information about managed policies,
1278/// refer to Managed policies and inline policies in the IAM User Guide.
1279///
1280/// **AWS API**: `iam.v1.PolicyVersion`
1281/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//PolicyVersion>
1282#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1283#[serde(rename_all = "PascalCase")]
1284pub struct PolicyVersion {
1285 /// The policy document. The policy document is returned in the response to the
1286 /// GetPolicyVersion and GetAccountAuthorizationDetails operations. It is not returned in
1287 /// the response to the CreatePolicyVersion or ListPolicyVersions operations. The policy
1288 /// document returned in this structure is URL-encoded compliant with RFC 3986. You can use
1289 /// a URL decoding method to convert the policy back to plain JSON text. For example, if you
1290 /// use Java, you can use the decode method of the java.net.URLDecoder utility class in the
1291 /// Java SDK. Other languages and SDKs provide similar functionality.
1292 #[serde(skip_serializing_if = "Option::is_none")]
1293 pub document: Option<String>,
1294
1295 /// The identifier for the policy version. Policy version identifiers always begin with v
1296 /// (always lowercase). When a policy is created, the first policy version is v1.
1297 #[serde(skip_serializing_if = "Option::is_none")]
1298 pub version_id: Option<String>,
1299
1300 /// Specifies whether the policy version is set as the policy's default version.
1301 #[serde(skip_serializing_if = "Option::is_none")]
1302 pub is_default_version: Option<bool>,
1303
1304 /// The date and time, in ISO 8601 date-time format, when the policy version was created.
1305 #[serde(skip_serializing_if = "Option::is_none")]
1306 pub create_date: Option<String>,
1307}
1308
1309impl PolicyVersion {
1310 #[cfg(any(test, feature = "test-support"))]
1311 /// Create a fixture instance for testing.
1312 pub fn fixture() -> Self {
1313 Self {
1314 document: Some("test-document".into()),
1315 version_id: Some("test-version_id".into()),
1316 is_default_version: Some(false),
1317 create_date: Some("test-create_date".into()),
1318 }
1319 }
1320}
1321
1322/// Contains the response to a successful ListEntitiesForPolicy request.
1323///
1324/// **AWS API**: `iam.v1.ListEntitiesForPolicyResponse`
1325/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListEntitiesForPolicyResponse>
1326#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1327#[serde(rename_all = "PascalCase")]
1328pub struct ListEntitiesForPolicyResponse {
1329 /// A list of IAM groups that the policy is attached to.
1330 #[serde(default)]
1331 #[serde(skip_serializing_if = "Vec::is_empty")]
1332 pub policy_groups: Vec<PolicyGroup>,
1333
1334 /// A list of IAM users that the policy is attached to.
1335 #[serde(default)]
1336 #[serde(skip_serializing_if = "Vec::is_empty")]
1337 pub policy_users: Vec<PolicyUser>,
1338
1339 /// A list of IAM roles that the policy is attached to.
1340 #[serde(default)]
1341 #[serde(skip_serializing_if = "Vec::is_empty")]
1342 pub policy_roles: Vec<PolicyRole>,
1343
1344 /// A flag that indicates whether there are more items to return. If your results were
1345 /// truncated, you can make a subsequent pagination request using the Marker request
1346 /// parameter to retrieve more items. Note that IAM might return fewer than the MaxItems
1347 /// number of results even when there are more results available. We recommend that you
1348 /// check IsTruncated after every call to ensure that you receive all your results.
1349 #[serde(skip_serializing_if = "Option::is_none")]
1350 pub is_truncated: Option<bool>,
1351
1352 /// When IsTruncated is true, this element is present and contains the value to use for the
1353 /// Marker parameter in a subsequent pagination request.
1354 #[serde(skip_serializing_if = "Option::is_none")]
1355 pub marker: Option<String>,
1356}
1357
1358impl ListEntitiesForPolicyResponse {
1359 #[cfg(any(test, feature = "test-support"))]
1360 /// Create a fixture instance for testing.
1361 pub fn fixture() -> Self {
1362 Self {
1363 policy_groups: vec![],
1364 policy_users: vec![],
1365 policy_roles: vec![],
1366 is_truncated: Some(false),
1367 marker: Some("test-marker".into()),
1368 }
1369 }
1370}
1371
1372/// Contains information about a group that a managed policy is attached to. This data type is
1373/// used as a response element in the ListEntitiesForPolicy operation. For more information
1374/// about managed policies, refer to Managed policies and inline policies in the IAM User Guide.
1375///
1376/// **AWS API**: `iam.v1.PolicyGroup`
1377/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//PolicyGroup>
1378#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1379#[serde(rename_all = "PascalCase")]
1380pub struct PolicyGroup {
1381 /// The name (friendly name, not ARN) identifying the group.
1382 #[serde(skip_serializing_if = "Option::is_none")]
1383 pub group_name: Option<String>,
1384
1385 /// The stable and unique string identifying the group. For more information about IDs, see
1386 /// IAM identifiers in the IAM User Guide.
1387 #[serde(skip_serializing_if = "Option::is_none")]
1388 pub group_id: Option<String>,
1389}
1390
1391impl PolicyGroup {
1392 #[cfg(any(test, feature = "test-support"))]
1393 /// Create a fixture instance for testing.
1394 pub fn fixture() -> Self {
1395 Self {
1396 group_name: Some("test-group_name".into()),
1397 group_id: Some("test-group_id".into()),
1398 }
1399 }
1400}
1401
1402/// Contains information about a user that a managed policy is attached to. This data type is
1403/// used as a response element in the ListEntitiesForPolicy operation. For more information
1404/// about managed policies, refer to Managed policies and inline policies in the IAM User Guide.
1405///
1406/// **AWS API**: `iam.v1.PolicyUser`
1407/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//PolicyUser>
1408#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1409#[serde(rename_all = "PascalCase")]
1410pub struct PolicyUser {
1411 /// The name (friendly name, not ARN) identifying the user.
1412 #[serde(skip_serializing_if = "Option::is_none")]
1413 pub user_name: Option<String>,
1414
1415 /// The stable and unique string identifying the user. For more information about IDs, see
1416 /// IAM identifiers in the IAM User Guide.
1417 #[serde(skip_serializing_if = "Option::is_none")]
1418 pub user_id: Option<String>,
1419}
1420
1421impl PolicyUser {
1422 #[cfg(any(test, feature = "test-support"))]
1423 /// Create a fixture instance for testing.
1424 pub fn fixture() -> Self {
1425 Self {
1426 user_name: Some("test-user_name".into()),
1427 user_id: Some("test-user_id".into()),
1428 }
1429 }
1430}
1431
1432/// Contains information about a role that a managed policy is attached to. This data type is
1433/// used as a response element in the ListEntitiesForPolicy operation. For more information
1434/// about managed policies, refer to Managed policies and inline policies in the IAM User Guide.
1435///
1436/// **AWS API**: `iam.v1.PolicyRole`
1437/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//PolicyRole>
1438#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1439#[serde(rename_all = "PascalCase")]
1440pub struct PolicyRole {
1441 /// The name (friendly name, not ARN) identifying the role.
1442 #[serde(skip_serializing_if = "Option::is_none")]
1443 pub role_name: Option<String>,
1444
1445 /// The stable and unique string identifying the role. For more information about IDs, see
1446 /// IAM identifiers in the IAM User Guide.
1447 #[serde(skip_serializing_if = "Option::is_none")]
1448 pub role_id: Option<String>,
1449}
1450
1451impl PolicyRole {
1452 #[cfg(any(test, feature = "test-support"))]
1453 /// Create a fixture instance for testing.
1454 pub fn fixture() -> Self {
1455 Self {
1456 role_name: Some("test-role_name".into()),
1457 role_id: Some("test-role_id".into()),
1458 }
1459 }
1460}
1461
1462///
1463/// **AWS API**: `iam.v1.ListUsersRequest`
1464/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListUsersRequest>
1465#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1466#[serde(rename_all = "PascalCase")]
1467pub struct ListUsersRequest {
1468 /// The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/,
1469 /// which would get all user names whose path starts with /division_abc/subdivision_xyz/.
1470 /// This parameter is optional. If it is not included, it defaults to a slash (/), listing
1471 /// all user names. This parameter allows (through its regex pattern) a string of characters
1472 /// consisting of either a forward slash (/) by itself or a string that must begin and end
1473 /// with forward slashes. In addition, it can contain any ASCII character from the !
1474 /// (\u0021) through the DEL character (\u007F), including most punctuation characters,
1475 /// digits, and upper and lowercased letters.
1476 #[serde(skip_serializing_if = "Option::is_none")]
1477 pub path_prefix: Option<String>,
1478
1479 /// Use this parameter only when paginating results and only after you receive a response
1480 /// indicating that the results are truncated. Set it to the value of the Marker element in
1481 /// the response that you received to indicate where the next call should start.
1482 #[serde(skip_serializing_if = "Option::is_none")]
1483 pub marker: Option<String>,
1484
1485 /// Use this only when paginating results to indicate the maximum number of items you want
1486 /// in the response. If additional items exist beyond the maximum you specify, the
1487 /// IsTruncated response element is true. If you do not include this parameter, the number
1488 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1489 /// more results available. In that case, the IsTruncated response element returns true, and
1490 /// Marker contains a value to include in the subsequent call that tells the service where
1491 /// to continue from.
1492 #[serde(skip_serializing_if = "Option::is_none")]
1493 pub max_items: Option<i32>,
1494}
1495
1496impl ListUsersRequest {
1497 #[cfg(any(test, feature = "test-support"))]
1498 /// Create a fixture instance for testing.
1499 pub fn fixture() -> Self {
1500 Self {
1501 path_prefix: Some("test-path_prefix".into()),
1502 marker: Some("test-marker".into()),
1503 max_items: Some(100),
1504 }
1505 }
1506}
1507
1508///
1509/// **AWS API**: `iam.v1.ListAttachedUserPoliciesRequest`
1510/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAttachedUserPoliciesRequest>
1511#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1512#[serde(rename_all = "PascalCase")]
1513pub struct ListAttachedUserPoliciesRequest {
1514 /// The name (friendly name, not ARN) of the user to list attached policies for. This
1515 /// parameter allows (through its regex pattern) a string of characters consisting of upper
1516 /// and lowercase alphanumeric characters with no spaces. You can also include any of the
1517 /// following characters: _+=,.@-
1518 pub user_name: String,
1519
1520 /// The path prefix for filtering the results. This parameter is optional. If it is not
1521 /// included, it defaults to a slash (/), listing all policies. This parameter allows
1522 /// (through its regex pattern) a string of characters consisting of either a forward slash
1523 /// (/) by itself or a string that must begin and end with forward slashes. In addition, it
1524 /// can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F),
1525 /// including most punctuation characters, digits, and upper and lowercased letters.
1526 #[serde(skip_serializing_if = "Option::is_none")]
1527 pub path_prefix: Option<String>,
1528
1529 /// Use this parameter only when paginating results and only after you receive a response
1530 /// indicating that the results are truncated. Set it to the value of the Marker element in
1531 /// the response that you received to indicate where the next call should start.
1532 #[serde(skip_serializing_if = "Option::is_none")]
1533 pub marker: Option<String>,
1534
1535 /// Use this only when paginating results to indicate the maximum number of items you want
1536 /// in the response. If additional items exist beyond the maximum you specify, the
1537 /// IsTruncated response element is true. If you do not include this parameter, the number
1538 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1539 /// more results available. In that case, the IsTruncated response element returns true, and
1540 /// Marker contains a value to include in the subsequent call that tells the service where
1541 /// to continue from.
1542 #[serde(skip_serializing_if = "Option::is_none")]
1543 pub max_items: Option<i32>,
1544}
1545
1546impl ListAttachedUserPoliciesRequest {
1547 #[cfg(any(test, feature = "test-support"))]
1548 /// Create a fixture instance for testing.
1549 pub fn fixture() -> Self {
1550 Self {
1551 user_name: "test-user_name".into(),
1552 path_prefix: Some("test-path_prefix".into()),
1553 marker: Some("test-marker".into()),
1554 max_items: Some(100),
1555 }
1556 }
1557}
1558
1559///
1560/// **AWS API**: `iam.v1.DetachUserPolicyRequest`
1561/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//DetachUserPolicyRequest>
1562#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1563#[serde(rename_all = "PascalCase")]
1564pub struct DetachUserPolicyRequest {
1565 /// The name (friendly name, not ARN) of the IAM user to detach the policy from. This
1566 /// parameter allows (through its regex pattern) a string of characters consisting of upper
1567 /// and lowercase alphanumeric characters with no spaces. You can also include any of the
1568 /// following characters: _+=,.@-
1569 pub user_name: String,
1570
1571 /// The Amazon Resource Name (ARN) of the IAM policy you want to detach. For more
1572 /// information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services
1573 /// General Reference.
1574 pub policy_arn: String,
1575}
1576
1577impl DetachUserPolicyRequest {
1578 #[cfg(any(test, feature = "test-support"))]
1579 /// Create a fixture instance for testing.
1580 pub fn fixture() -> Self {
1581 Self {
1582 user_name: "test-user_name".into(),
1583 policy_arn: "test-policy_arn".into(),
1584 }
1585 }
1586}
1587
1588///
1589/// **AWS API**: `iam.v1.DeleteAccessKeyRequest`
1590/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//DeleteAccessKeyRequest>
1591#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1592#[serde(rename_all = "PascalCase")]
1593pub struct DeleteAccessKeyRequest {
1594 /// The name of the user whose access key pair you want to delete. This parameter allows
1595 /// (through its regex pattern) a string of characters consisting of upper and lowercase
1596 /// alphanumeric characters with no spaces. You can also include any of the following
1597 /// characters: _+=,.@-
1598 #[serde(skip_serializing_if = "Option::is_none")]
1599 pub user_name: Option<String>,
1600
1601 /// The access key ID for the access key ID and secret access key you want to delete. This
1602 /// parameter allows (through its regex pattern) a string of characters that can consist of
1603 /// any upper or lowercased letter or digit.
1604 pub access_key_id: String,
1605}
1606
1607impl DeleteAccessKeyRequest {
1608 #[cfg(any(test, feature = "test-support"))]
1609 /// Create a fixture instance for testing.
1610 pub fn fixture() -> Self {
1611 Self {
1612 user_name: Some("test-user_name".into()),
1613 access_key_id: "test-access_key_id".into(),
1614 }
1615 }
1616}
1617
1618///
1619/// **AWS API**: `iam.v1.ListAccessKeysRequest`
1620/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAccessKeysRequest>
1621#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1622#[serde(rename_all = "PascalCase")]
1623pub struct ListAccessKeysRequest {
1624 /// The name of the user. This parameter allows (through its regex pattern) a string of
1625 /// characters consisting of upper and lowercase alphanumeric characters with no spaces. You
1626 /// can also include any of the following characters: _+=,.@-
1627 #[serde(skip_serializing_if = "Option::is_none")]
1628 pub user_name: Option<String>,
1629
1630 /// Use this parameter only when paginating results and only after you receive a response
1631 /// indicating that the results are truncated. Set it to the value of the Marker element in
1632 /// the response that you received to indicate where the next call should start.
1633 #[serde(skip_serializing_if = "Option::is_none")]
1634 pub marker: Option<String>,
1635
1636 /// Use this only when paginating results to indicate the maximum number of items you want
1637 /// in the response. If additional items exist beyond the maximum you specify, the
1638 /// IsTruncated response element is true. If you do not include this parameter, the number
1639 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1640 /// more results available. In that case, the IsTruncated response element returns true, and
1641 /// Marker contains a value to include in the subsequent call that tells the service where
1642 /// to continue from.
1643 #[serde(skip_serializing_if = "Option::is_none")]
1644 pub max_items: Option<i32>,
1645}
1646
1647impl ListAccessKeysRequest {
1648 #[cfg(any(test, feature = "test-support"))]
1649 /// Create a fixture instance for testing.
1650 pub fn fixture() -> Self {
1651 Self {
1652 user_name: Some("test-user_name".into()),
1653 marker: Some("test-marker".into()),
1654 max_items: Some(100),
1655 }
1656 }
1657}
1658
1659///
1660/// **AWS API**: `iam.v1.GetAccessKeyLastUsedRequest`
1661/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetAccessKeyLastUsedRequest>
1662#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1663#[serde(rename_all = "PascalCase")]
1664pub struct GetAccessKeyLastUsedRequest {
1665 /// The identifier of an access key. This parameter allows (through its regex pattern) a
1666 /// string of characters that can consist of any upper or lowercased letter or digit.
1667 pub access_key_id: String,
1668}
1669
1670impl GetAccessKeyLastUsedRequest {
1671 #[cfg(any(test, feature = "test-support"))]
1672 /// Create a fixture instance for testing.
1673 pub fn fixture() -> Self {
1674 Self {
1675 access_key_id: "test-access_key_id".into(),
1676 }
1677 }
1678}
1679
1680///
1681/// **AWS API**: `iam.v1.UpdateAccessKeyRequest`
1682/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//UpdateAccessKeyRequest>
1683#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1684#[serde(rename_all = "PascalCase")]
1685pub struct UpdateAccessKeyRequest {
1686 /// The name of the user whose key you want to update. This parameter allows (through its
1687 /// regex pattern) a string of characters consisting of upper and lowercase alphanumeric
1688 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
1689 #[serde(skip_serializing_if = "Option::is_none")]
1690 pub user_name: Option<String>,
1691
1692 /// The access key ID of the secret access key you want to update. This parameter allows
1693 /// (through its regex pattern) a string of characters that can consist of any upper or
1694 /// lowercased letter or digit.
1695 pub access_key_id: String,
1696
1697 /// The status you want to assign to the secret access key. Active means that the key can be
1698 /// used for programmatic calls to Amazon Web Services, while Inactive means that the key
1699 /// cannot be used.
1700 pub status: String,
1701}
1702
1703impl UpdateAccessKeyRequest {
1704 #[cfg(any(test, feature = "test-support"))]
1705 /// Create a fixture instance for testing.
1706 pub fn fixture() -> Self {
1707 Self {
1708 user_name: Some("test-user_name".into()),
1709 access_key_id: "test-access_key_id".into(),
1710 status: "test-status".into(),
1711 }
1712 }
1713}
1714
1715///
1716/// **AWS API**: `iam.v1.ListMFADevicesRequest`
1717/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListMFADevicesRequest>
1718#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1719#[serde(rename_all = "PascalCase")]
1720pub struct ListMFADevicesRequest {
1721 /// The name of the user whose MFA devices you want to list. This parameter allows (through
1722 /// its regex pattern) a string of characters consisting of upper and lowercase alphanumeric
1723 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
1724 #[serde(skip_serializing_if = "Option::is_none")]
1725 pub user_name: Option<String>,
1726
1727 /// Use this parameter only when paginating results and only after you receive a response
1728 /// indicating that the results are truncated. Set it to the value of the Marker element in
1729 /// the response that you received to indicate where the next call should start.
1730 #[serde(skip_serializing_if = "Option::is_none")]
1731 pub marker: Option<String>,
1732
1733 /// Use this only when paginating results to indicate the maximum number of items you want
1734 /// in the response. If additional items exist beyond the maximum you specify, the
1735 /// IsTruncated response element is true. If you do not include this parameter, the number
1736 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1737 /// more results available. In that case, the IsTruncated response element returns true, and
1738 /// Marker contains a value to include in the subsequent call that tells the service where
1739 /// to continue from.
1740 #[serde(skip_serializing_if = "Option::is_none")]
1741 pub max_items: Option<i32>,
1742}
1743
1744impl ListMFADevicesRequest {
1745 #[cfg(any(test, feature = "test-support"))]
1746 /// Create a fixture instance for testing.
1747 pub fn fixture() -> Self {
1748 Self {
1749 user_name: Some("test-user_name".into()),
1750 marker: Some("test-marker".into()),
1751 max_items: Some(100),
1752 }
1753 }
1754}
1755
1756///
1757/// **AWS API**: `iam.v1.GetLoginProfileRequest`
1758/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetLoginProfileRequest>
1759#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1760#[serde(rename_all = "PascalCase")]
1761pub struct GetLoginProfileRequest {
1762 /// The name of the user whose login profile you want to retrieve. This parameter is
1763 /// optional. If no user name is included, it defaults to the principal making the request.
1764 /// When you make this request with root user credentials, you must use an AssumeRoot
1765 /// session to omit the user name. This parameter allows (through its regex pattern) a
1766 /// string of characters consisting of upper and lowercase alphanumeric characters with no
1767 /// spaces. You can also include any of the following characters: _+=,.@-
1768 #[serde(skip_serializing_if = "Option::is_none")]
1769 pub user_name: Option<String>,
1770}
1771
1772impl GetLoginProfileRequest {
1773 #[cfg(any(test, feature = "test-support"))]
1774 /// Create a fixture instance for testing.
1775 pub fn fixture() -> Self {
1776 Self {
1777 user_name: Some("test-user_name".into()),
1778 }
1779 }
1780}
1781
1782///
1783/// **AWS API**: `iam.v1.UpdateAccountPasswordPolicyRequest`
1784/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//UpdateAccountPasswordPolicyRequest>
1785#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1786#[serde(rename_all = "PascalCase")]
1787pub struct UpdateAccountPasswordPolicyRequest {
1788 /// The minimum number of characters allowed in an IAM user password. If you do not specify
1789 /// a value for this parameter, then the operation uses the default value of 6.
1790 #[serde(skip_serializing_if = "Option::is_none")]
1791 pub minimum_password_length: Option<i32>,
1792
1793 /// Specifies whether IAM user passwords must contain at least one of the following non-
1794 /// alphanumeric characters: ! @ # $ % ^ & * ( ) _ + - = [ ] { } | ' If you do not
1795 /// specify a value for this parameter, then the operation uses the default value of false.
1796 /// The result is that passwords do not require at least one symbol character.
1797 #[serde(skip_serializing_if = "Option::is_none")]
1798 pub require_symbols: Option<bool>,
1799
1800 /// Specifies whether IAM user passwords must contain at least one numeric character (0 to
1801 /// 9). If you do not specify a value for this parameter, then the operation uses the
1802 /// default value of false. The result is that passwords do not require at least one numeric
1803 /// character.
1804 #[serde(skip_serializing_if = "Option::is_none")]
1805 pub require_numbers: Option<bool>,
1806
1807 /// Specifies whether IAM user passwords must contain at least one uppercase character from
1808 /// the ISO basic Latin alphabet (A to Z). If you do not specify a value for this parameter,
1809 /// then the operation uses the default value of false. The result is that passwords do not
1810 /// require at least one uppercase character.
1811 #[serde(skip_serializing_if = "Option::is_none")]
1812 pub require_uppercase_characters: Option<bool>,
1813
1814 /// Specifies whether IAM user passwords must contain at least one lowercase character from
1815 /// the ISO basic Latin alphabet (a to z). If you do not specify a value for this parameter,
1816 /// then the operation uses the default value of false. The result is that passwords do not
1817 /// require at least one lowercase character.
1818 #[serde(skip_serializing_if = "Option::is_none")]
1819 pub require_lowercase_characters: Option<bool>,
1820
1821 /// Allows all IAM users in your account to use the Amazon Web Services Management Console
1822 /// to change their own passwords. For more information, see Permitting IAM users to change
1823 /// their own passwords in the IAM User Guide. If you do not specify a value for this
1824 /// parameter, then the operation uses the default value of false. The result is that IAM
1825 /// users in the account do not automatically have permissions to change their own password.
1826 #[serde(skip_serializing_if = "Option::is_none")]
1827 pub allow_users_to_change_password: Option<bool>,
1828
1829 /// The number of days that an IAM user password is valid. If you do not specify a value for
1830 /// this parameter, then the operation uses the default value of 0. The result is that IAM
1831 /// user passwords never expire.
1832 #[serde(skip_serializing_if = "Option::is_none")]
1833 pub max_password_age: Option<i32>,
1834
1835 /// Specifies the number of previous passwords that IAM users are prevented from reusing. If
1836 /// you do not specify a value for this parameter, then the operation uses the default value
1837 /// of 0. The result is that IAM users are not prevented from reusing previous passwords.
1838 #[serde(skip_serializing_if = "Option::is_none")]
1839 pub password_reuse_prevention: Option<i32>,
1840
1841 /// Prevents IAM users who are accessing the account via the Amazon Web Services Management
1842 /// Console from setting a new console password after their password has expired. The IAM
1843 /// user cannot access the console until an administrator resets the password. If you do not
1844 /// specify a value for this parameter, then the operation uses the default value of false.
1845 /// The result is that IAM users can change their passwords after they expire and continue
1846 /// to sign in as the user. In the Amazon Web Services Management Console, the custom
1847 /// password policy option Allow users to change their own password gives IAM users
1848 /// permissions to iam:ChangePassword for only their user and to the
1849 /// iam:GetAccountPasswordPolicy action. This option does not attach a permissions policy to
1850 /// each user, rather the permissions are applied at the account-level for all users by IAM.
1851 /// IAM users with iam:ChangePassword permission and active access keys can reset their own
1852 /// expired console password using the CLI or API.
1853 #[serde(skip_serializing_if = "Option::is_none")]
1854 pub hard_expiry: Option<bool>,
1855}
1856
1857impl UpdateAccountPasswordPolicyRequest {
1858 #[cfg(any(test, feature = "test-support"))]
1859 /// Create a fixture instance for testing.
1860 pub fn fixture() -> Self {
1861 Self {
1862 minimum_password_length: Some(100),
1863 require_symbols: Some(false),
1864 require_numbers: Some(false),
1865 require_uppercase_characters: Some(false),
1866 require_lowercase_characters: Some(false),
1867 allow_users_to_change_password: Some(false),
1868 max_password_age: Some(100),
1869 password_reuse_prevention: Some(100),
1870 hard_expiry: Some(false),
1871 }
1872 }
1873}
1874
1875///
1876/// **AWS API**: `iam.v1.ListRolesRequest`
1877/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListRolesRequest>
1878#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1879#[serde(rename_all = "PascalCase")]
1880pub struct ListRolesRequest {
1881 /// The path prefix for filtering the results. For example, the prefix
1882 /// /application_abc/component_xyz/ gets all roles whose path starts with
1883 /// /application_abc/component_xyz/. This parameter is optional. If it is not included, it
1884 /// defaults to a slash (/), listing all roles. This parameter allows (through its regex
1885 /// pattern) a string of characters consisting of either a forward slash (/) by itself or a
1886 /// string that must begin and end with forward slashes. In addition, it can contain any
1887 /// ASCII character from the ! (\u0021) through the DEL character (\u007F), including most
1888 /// punctuation characters, digits, and upper and lowercased letters.
1889 #[serde(skip_serializing_if = "Option::is_none")]
1890 pub path_prefix: Option<String>,
1891
1892 /// Use this parameter only when paginating results and only after you receive a response
1893 /// indicating that the results are truncated. Set it to the value of the Marker element in
1894 /// the response that you received to indicate where the next call should start.
1895 #[serde(skip_serializing_if = "Option::is_none")]
1896 pub marker: Option<String>,
1897
1898 /// Use this only when paginating results to indicate the maximum number of items you want
1899 /// in the response. If additional items exist beyond the maximum you specify, the
1900 /// IsTruncated response element is true. If you do not include this parameter, the number
1901 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1902 /// more results available. In that case, the IsTruncated response element returns true, and
1903 /// Marker contains a value to include in the subsequent call that tells the service where
1904 /// to continue from.
1905 #[serde(skip_serializing_if = "Option::is_none")]
1906 pub max_items: Option<i32>,
1907}
1908
1909impl ListRolesRequest {
1910 #[cfg(any(test, feature = "test-support"))]
1911 /// Create a fixture instance for testing.
1912 pub fn fixture() -> Self {
1913 Self {
1914 path_prefix: Some("test-path_prefix".into()),
1915 marker: Some("test-marker".into()),
1916 max_items: Some(100),
1917 }
1918 }
1919}
1920
1921///
1922/// **AWS API**: `iam.v1.ListUserPoliciesRequest`
1923/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListUserPoliciesRequest>
1924#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1925#[serde(rename_all = "PascalCase")]
1926pub struct ListUserPoliciesRequest {
1927 /// The name of the user to list policies for. This parameter allows (through its regex
1928 /// pattern) a string of characters consisting of upper and lowercase alphanumeric
1929 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
1930 pub user_name: String,
1931
1932 /// Use this parameter only when paginating results and only after you receive a response
1933 /// indicating that the results are truncated. Set it to the value of the Marker element in
1934 /// the response that you received to indicate where the next call should start.
1935 #[serde(skip_serializing_if = "Option::is_none")]
1936 pub marker: Option<String>,
1937
1938 /// Use this only when paginating results to indicate the maximum number of items you want
1939 /// in the response. If additional items exist beyond the maximum you specify, the
1940 /// IsTruncated response element is true. If you do not include this parameter, the number
1941 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1942 /// more results available. In that case, the IsTruncated response element returns true, and
1943 /// Marker contains a value to include in the subsequent call that tells the service where
1944 /// to continue from.
1945 #[serde(skip_serializing_if = "Option::is_none")]
1946 pub max_items: Option<i32>,
1947}
1948
1949impl ListUserPoliciesRequest {
1950 #[cfg(any(test, feature = "test-support"))]
1951 /// Create a fixture instance for testing.
1952 pub fn fixture() -> Self {
1953 Self {
1954 user_name: "test-user_name".into(),
1955 marker: Some("test-marker".into()),
1956 max_items: Some(100),
1957 }
1958 }
1959}
1960
1961///
1962/// **AWS API**: `iam.v1.ListGroupsForUserRequest`
1963/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListGroupsForUserRequest>
1964#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1965#[serde(rename_all = "PascalCase")]
1966pub struct ListGroupsForUserRequest {
1967 /// The name of the user to list groups for. This parameter allows (through its regex
1968 /// pattern) a string of characters consisting of upper and lowercase alphanumeric
1969 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
1970 pub user_name: String,
1971
1972 /// Use this parameter only when paginating results and only after you receive a response
1973 /// indicating that the results are truncated. Set it to the value of the Marker element in
1974 /// the response that you received to indicate where the next call should start.
1975 #[serde(skip_serializing_if = "Option::is_none")]
1976 pub marker: Option<String>,
1977
1978 /// Use this only when paginating results to indicate the maximum number of items you want
1979 /// in the response. If additional items exist beyond the maximum you specify, the
1980 /// IsTruncated response element is true. If you do not include this parameter, the number
1981 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
1982 /// more results available. In that case, the IsTruncated response element returns true, and
1983 /// Marker contains a value to include in the subsequent call that tells the service where
1984 /// to continue from.
1985 #[serde(skip_serializing_if = "Option::is_none")]
1986 pub max_items: Option<i32>,
1987}
1988
1989impl ListGroupsForUserRequest {
1990 #[cfg(any(test, feature = "test-support"))]
1991 /// Create a fixture instance for testing.
1992 pub fn fixture() -> Self {
1993 Self {
1994 user_name: "test-user_name".into(),
1995 marker: Some("test-marker".into()),
1996 max_items: Some(100),
1997 }
1998 }
1999}
2000
2001///
2002/// **AWS API**: `iam.v1.ListServerCertificatesRequest`
2003/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListServerCertificatesRequest>
2004#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2005#[serde(rename_all = "PascalCase")]
2006pub struct ListServerCertificatesRequest {
2007 /// The path prefix for filtering the results. For example: /company/servercerts would get
2008 /// all server certificates for which the path starts with /company/servercerts. This
2009 /// parameter is optional. If it is not included, it defaults to a slash (/), listing all
2010 /// server certificates. This parameter allows (through its regex pattern) a string of
2011 /// characters consisting of either a forward slash (/) by itself or a string that must
2012 /// begin and end with forward slashes. In addition, it can contain any ASCII character from
2013 /// the ! (\u0021) through the DEL character (\u007F), including most punctuation
2014 /// characters, digits, and upper and lowercased letters.
2015 #[serde(skip_serializing_if = "Option::is_none")]
2016 pub path_prefix: Option<String>,
2017
2018 /// Use this parameter only when paginating results and only after you receive a response
2019 /// indicating that the results are truncated. Set it to the value of the Marker element in
2020 /// the response that you received to indicate where the next call should start.
2021 #[serde(skip_serializing_if = "Option::is_none")]
2022 pub marker: Option<String>,
2023
2024 /// Use this only when paginating results to indicate the maximum number of items you want
2025 /// in the response. If additional items exist beyond the maximum you specify, the
2026 /// IsTruncated response element is true. If you do not include this parameter, the number
2027 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
2028 /// more results available. In that case, the IsTruncated response element returns true, and
2029 /// Marker contains a value to include in the subsequent call that tells the service where
2030 /// to continue from.
2031 #[serde(skip_serializing_if = "Option::is_none")]
2032 pub max_items: Option<i32>,
2033}
2034
2035impl ListServerCertificatesRequest {
2036 #[cfg(any(test, feature = "test-support"))]
2037 /// Create a fixture instance for testing.
2038 pub fn fixture() -> Self {
2039 Self {
2040 path_prefix: Some("test-path_prefix".into()),
2041 marker: Some("test-marker".into()),
2042 max_items: Some(100),
2043 }
2044 }
2045}
2046
2047///
2048/// **AWS API**: `iam.v1.DeleteUserPolicyRequest`
2049/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//DeleteUserPolicyRequest>
2050#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2051#[serde(rename_all = "PascalCase")]
2052pub struct DeleteUserPolicyRequest {
2053 /// The name (friendly name, not ARN) identifying the user that the policy is embedded in.
2054 /// This parameter allows (through its regex pattern) a string of characters consisting of
2055 /// upper and lowercase alphanumeric characters with no spaces. You can also include any of
2056 /// the following characters: _+=,.@-
2057 pub user_name: String,
2058
2059 /// The name identifying the policy document to delete. This parameter allows (through its
2060 /// regex pattern) a string of characters consisting of upper and lowercase alphanumeric
2061 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
2062 pub policy_name: String,
2063}
2064
2065impl DeleteUserPolicyRequest {
2066 #[cfg(any(test, feature = "test-support"))]
2067 /// Create a fixture instance for testing.
2068 pub fn fixture() -> Self {
2069 Self {
2070 user_name: "test-user_name".into(),
2071 policy_name: "test-policy_name".into(),
2072 }
2073 }
2074}
2075
2076///
2077/// **AWS API**: `iam.v1.AttachRolePolicyRequest`
2078/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//AttachRolePolicyRequest>
2079#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2080#[serde(rename_all = "PascalCase")]
2081pub struct AttachRolePolicyRequest {
2082 /// The name (friendly name, not ARN) of the role to attach the policy to. This parameter
2083 /// allows (through its regex pattern) a string of characters consisting of upper and
2084 /// lowercase alphanumeric characters with no spaces. You can also include any of the
2085 /// following characters: _+=,.@-
2086 pub role_name: String,
2087
2088 /// The Amazon Resource Name (ARN) of the IAM policy you want to attach. For more
2089 /// information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services
2090 /// General Reference.
2091 pub policy_arn: String,
2092}
2093
2094impl AttachRolePolicyRequest {
2095 #[cfg(any(test, feature = "test-support"))]
2096 /// Create a fixture instance for testing.
2097 pub fn fixture() -> Self {
2098 Self {
2099 role_name: "test-role_name".into(),
2100 policy_arn: "test-policy_arn".into(),
2101 }
2102 }
2103}
2104
2105///
2106/// **AWS API**: `iam.v1.DetachRolePolicyRequest`
2107/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//DetachRolePolicyRequest>
2108#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2109#[serde(rename_all = "PascalCase")]
2110pub struct DetachRolePolicyRequest {
2111 /// The name (friendly name, not ARN) of the IAM role to detach the policy from. This
2112 /// parameter allows (through its regex pattern) a string of characters consisting of upper
2113 /// and lowercase alphanumeric characters with no spaces. You can also include any of the
2114 /// following characters: _+=,.@-
2115 pub role_name: String,
2116
2117 /// The Amazon Resource Name (ARN) of the IAM policy you want to detach. For more
2118 /// information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services
2119 /// General Reference.
2120 pub policy_arn: String,
2121}
2122
2123impl DetachRolePolicyRequest {
2124 #[cfg(any(test, feature = "test-support"))]
2125 /// Create a fixture instance for testing.
2126 pub fn fixture() -> Self {
2127 Self {
2128 role_name: "test-role_name".into(),
2129 policy_arn: "test-policy_arn".into(),
2130 }
2131 }
2132}
2133
2134///
2135/// **AWS API**: `iam.v1.GetUserPolicyRequest`
2136/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetUserPolicyRequest>
2137#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2138#[serde(rename_all = "PascalCase")]
2139pub struct GetUserPolicyRequest {
2140 /// The name of the user who the policy is associated with. This parameter allows (through
2141 /// its regex pattern) a string of characters consisting of upper and lowercase alphanumeric
2142 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
2143 pub user_name: String,
2144
2145 /// The name of the policy document to get. This parameter allows (through its regex
2146 /// pattern) a string of characters consisting of upper and lowercase alphanumeric
2147 /// characters with no spaces. You can also include any of the following characters: _+=,.@-
2148 pub policy_name: String,
2149}
2150
2151impl GetUserPolicyRequest {
2152 #[cfg(any(test, feature = "test-support"))]
2153 /// Create a fixture instance for testing.
2154 pub fn fixture() -> Self {
2155 Self {
2156 user_name: "test-user_name".into(),
2157 policy_name: "test-policy_name".into(),
2158 }
2159 }
2160}
2161
2162///
2163/// **AWS API**: `iam.v1.ListAttachedGroupPoliciesRequest`
2164/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListAttachedGroupPoliciesRequest>
2165#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2166#[serde(rename_all = "PascalCase")]
2167pub struct ListAttachedGroupPoliciesRequest {
2168 /// The name (friendly name, not ARN) of the group to list attached policies for. This
2169 /// parameter allows (through its regex pattern) a string of characters consisting of upper
2170 /// and lowercase alphanumeric characters with no spaces. You can also include any of the
2171 /// following characters: _+=,.@-
2172 pub group_name: String,
2173
2174 /// The path prefix for filtering the results. This parameter is optional. If it is not
2175 /// included, it defaults to a slash (/), listing all policies. This parameter allows
2176 /// (through its regex pattern) a string of characters consisting of either a forward slash
2177 /// (/) by itself or a string that must begin and end with forward slashes. In addition, it
2178 /// can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F),
2179 /// including most punctuation characters, digits, and upper and lowercased letters.
2180 #[serde(skip_serializing_if = "Option::is_none")]
2181 pub path_prefix: Option<String>,
2182
2183 /// Use this parameter only when paginating results and only after you receive a response
2184 /// indicating that the results are truncated. Set it to the value of the Marker element in
2185 /// the response that you received to indicate where the next call should start.
2186 #[serde(skip_serializing_if = "Option::is_none")]
2187 pub marker: Option<String>,
2188
2189 /// Use this only when paginating results to indicate the maximum number of items you want
2190 /// in the response. If additional items exist beyond the maximum you specify, the
2191 /// IsTruncated response element is true. If you do not include this parameter, the number
2192 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
2193 /// more results available. In that case, the IsTruncated response element returns true, and
2194 /// Marker contains a value to include in the subsequent call that tells the service where
2195 /// to continue from.
2196 #[serde(skip_serializing_if = "Option::is_none")]
2197 pub max_items: Option<i32>,
2198}
2199
2200impl ListAttachedGroupPoliciesRequest {
2201 #[cfg(any(test, feature = "test-support"))]
2202 /// Create a fixture instance for testing.
2203 pub fn fixture() -> Self {
2204 Self {
2205 group_name: "test-group_name".into(),
2206 path_prefix: Some("test-path_prefix".into()),
2207 marker: Some("test-marker".into()),
2208 max_items: Some(100),
2209 }
2210 }
2211}
2212
2213///
2214/// **AWS API**: `iam.v1.ListVirtualMFADevicesRequest`
2215/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListVirtualMFADevicesRequest>
2216#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2217#[serde(rename_all = "PascalCase")]
2218pub struct ListVirtualMFADevicesRequest {
2219 /// The status (Unassigned or Assigned) of the devices to list. If you do not specify an
2220 /// AssignmentStatus, the operation defaults to Any, which lists both assigned and
2221 /// unassigned virtual MFA devices.,
2222 #[serde(skip_serializing_if = "Option::is_none")]
2223 pub assignment_status: Option<String>,
2224
2225 /// Use this parameter only when paginating results and only after you receive a response
2226 /// indicating that the results are truncated. Set it to the value of the Marker element in
2227 /// the response that you received to indicate where the next call should start.
2228 #[serde(skip_serializing_if = "Option::is_none")]
2229 pub marker: Option<String>,
2230
2231 /// Use this only when paginating results to indicate the maximum number of items you want
2232 /// in the response. If additional items exist beyond the maximum you specify, the
2233 /// IsTruncated response element is true. If you do not include this parameter, the number
2234 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
2235 /// more results available. In that case, the IsTruncated response element returns true, and
2236 /// Marker contains a value to include in the subsequent call that tells the service where
2237 /// to continue from.
2238 #[serde(skip_serializing_if = "Option::is_none")]
2239 pub max_items: Option<i32>,
2240}
2241
2242impl ListVirtualMFADevicesRequest {
2243 #[cfg(any(test, feature = "test-support"))]
2244 /// Create a fixture instance for testing.
2245 pub fn fixture() -> Self {
2246 Self {
2247 assignment_status: Some("test-assignment_status".into()),
2248 marker: Some("test-marker".into()),
2249 max_items: Some(100),
2250 }
2251 }
2252}
2253
2254///
2255/// **AWS API**: `iam.v1.ListPoliciesRequest`
2256/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListPoliciesRequest>
2257#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2258#[serde(rename_all = "PascalCase")]
2259pub struct ListPoliciesRequest {
2260 /// The scope to use for filtering the results. To list only Amazon Web Services managed
2261 /// policies, set Scope to AWS. To list only the customer managed policies in your Amazon
2262 /// Web Services account, set Scope to Local. This parameter is optional. If it is not
2263 /// included, or if it is set to All, all policies are returned.
2264 #[serde(skip_serializing_if = "Option::is_none")]
2265 pub scope: Option<String>,
2266
2267 /// A flag to filter the results to only the attached policies. When OnlyAttached is true,
2268 /// the returned list contains only the policies that are attached to an IAM user, group, or
2269 /// role. When OnlyAttached is false, or when the parameter is not included, all policies
2270 /// are returned.
2271 #[serde(skip_serializing_if = "Option::is_none")]
2272 pub only_attached: Option<bool>,
2273
2274 /// The path prefix for filtering the results. This parameter is optional. If it is not
2275 /// included, it defaults to a slash (/), listing all policies. This parameter allows
2276 /// (through its regex pattern) a string of characters consisting of either a forward slash
2277 /// (/) by itself or a string that must begin and end with forward slashes. In addition, it
2278 /// can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F),
2279 /// including most punctuation characters, digits, and upper and lowercased letters.
2280 #[serde(skip_serializing_if = "Option::is_none")]
2281 pub path_prefix: Option<String>,
2282
2283 /// The policy usage method to use for filtering the results. To list only permissions
2284 /// policies, set PolicyUsageFilter to PermissionsPolicy. To list only the policies used to
2285 /// set permissions boundaries, set the value to PermissionsBoundary. This parameter is
2286 /// optional. If it is not included, all policies are returned.
2287 #[serde(skip_serializing_if = "Option::is_none")]
2288 pub policy_usage_filter: Option<String>,
2289
2290 /// Use this parameter only when paginating results and only after you receive a response
2291 /// indicating that the results are truncated. Set it to the value of the Marker element in
2292 /// the response that you received to indicate where the next call should start.
2293 #[serde(skip_serializing_if = "Option::is_none")]
2294 pub marker: Option<String>,
2295
2296 /// Use this only when paginating results to indicate the maximum number of items you want
2297 /// in the response. If additional items exist beyond the maximum you specify, the
2298 /// IsTruncated response element is true. If you do not include this parameter, the number
2299 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
2300 /// more results available. In that case, the IsTruncated response element returns true, and
2301 /// Marker contains a value to include in the subsequent call that tells the service where
2302 /// to continue from.
2303 #[serde(skip_serializing_if = "Option::is_none")]
2304 pub max_items: Option<i32>,
2305}
2306
2307impl ListPoliciesRequest {
2308 #[cfg(any(test, feature = "test-support"))]
2309 /// Create a fixture instance for testing.
2310 pub fn fixture() -> Self {
2311 Self {
2312 scope: Some("test-scope".into()),
2313 only_attached: Some(false),
2314 path_prefix: Some("test-path_prefix".into()),
2315 policy_usage_filter: Some("test-policy_usage_filter".into()),
2316 marker: Some("test-marker".into()),
2317 max_items: Some(100),
2318 }
2319 }
2320}
2321
2322///
2323/// **AWS API**: `iam.v1.GetPolicyVersionRequest`
2324/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//GetPolicyVersionRequest>
2325#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2326#[serde(rename_all = "PascalCase")]
2327pub struct GetPolicyVersionRequest {
2328 /// The Amazon Resource Name (ARN) of the managed policy that you want information about.
2329 /// For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web
2330 /// Services General Reference.
2331 pub policy_arn: String,
2332
2333 /// Identifies the policy version to retrieve. This parameter allows (through its regex
2334 /// pattern) a string of characters that consists of the lowercase letter 'v' followed by
2335 /// one or two digits, and optionally followed by a period '.' and a string of letters and
2336 /// digits.
2337 pub version_id: String,
2338}
2339
2340impl GetPolicyVersionRequest {
2341 #[cfg(any(test, feature = "test-support"))]
2342 /// Create a fixture instance for testing.
2343 pub fn fixture() -> Self {
2344 Self {
2345 policy_arn: "test-policy_arn".into(),
2346 version_id: "test-version_id".into(),
2347 }
2348 }
2349}
2350
2351///
2352/// **AWS API**: `iam.v1.ListEntitiesForPolicyRequest`
2353/// **Reference**: <https://docs.aws.amazon.com/IAM/latest/APIReference//ListEntitiesForPolicyRequest>
2354#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2355#[serde(rename_all = "PascalCase")]
2356pub struct ListEntitiesForPolicyRequest {
2357 /// The Amazon Resource Name (ARN) of the IAM policy for which you want the versions. For
2358 /// more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services
2359 /// General Reference.
2360 pub policy_arn: String,
2361
2362 /// The entity type to use for filtering the results. For example, when EntityFilter is
2363 /// Role, only the roles that are attached to the specified policy are returned. This
2364 /// parameter is optional. If it is not included, all attached entities (users, groups, and
2365 /// roles) are returned. The argument for this parameter must be one of the valid values
2366 /// listed below.
2367 #[serde(skip_serializing_if = "Option::is_none")]
2368 pub entity_filter: Option<String>,
2369
2370 /// The path prefix for filtering the results. This parameter is optional. If it is not
2371 /// included, it defaults to a slash (/), listing all entities. This parameter allows
2372 /// (through its regex pattern) a string of characters consisting of either a forward slash
2373 /// (/) by itself or a string that must begin and end with forward slashes. In addition, it
2374 /// can contain any ASCII character from the ! (\u0021) through the DEL character (\u007F),
2375 /// including most punctuation characters, digits, and upper and lowercased letters.
2376 #[serde(skip_serializing_if = "Option::is_none")]
2377 pub path_prefix: Option<String>,
2378
2379 /// The policy usage method to use for filtering the results. To list only permissions
2380 /// policies, set PolicyUsageFilter to PermissionsPolicy. To list only the policies used to
2381 /// set permissions boundaries, set the value to PermissionsBoundary. This parameter is
2382 /// optional. If it is not included, all policies are returned.
2383 #[serde(skip_serializing_if = "Option::is_none")]
2384 pub policy_usage_filter: Option<String>,
2385
2386 /// Use this parameter only when paginating results and only after you receive a response
2387 /// indicating that the results are truncated. Set it to the value of the Marker element in
2388 /// the response that you received to indicate where the next call should start.
2389 #[serde(skip_serializing_if = "Option::is_none")]
2390 pub marker: Option<String>,
2391
2392 /// Use this only when paginating results to indicate the maximum number of items you want
2393 /// in the response. If additional items exist beyond the maximum you specify, the
2394 /// IsTruncated response element is true. If you do not include this parameter, the number
2395 /// of items defaults to 100. Note that IAM might return fewer results, even when there are
2396 /// more results available. In that case, the IsTruncated response element returns true, and
2397 /// Marker contains a value to include in the subsequent call that tells the service where
2398 /// to continue from.
2399 #[serde(skip_serializing_if = "Option::is_none")]
2400 pub max_items: Option<i32>,
2401}
2402
2403impl ListEntitiesForPolicyRequest {
2404 #[cfg(any(test, feature = "test-support"))]
2405 /// Create a fixture instance for testing.
2406 pub fn fixture() -> Self {
2407 Self {
2408 policy_arn: "test-policy_arn".into(),
2409 entity_filter: Some("test-entity_filter".into()),
2410 path_prefix: Some("test-path_prefix".into()),
2411 policy_usage_filter: Some("test-policy_usage_filter".into()),
2412 marker: Some("test-marker".into()),
2413 max_items: Some(100),
2414 }
2415 }
2416}