1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateMountTargetInput {
/// <p>The ID of the mount target to update.</p>
pub mount_target_id: ::std::option::Option<::std::string::String>,
/// <p>An array of VPC security group IDs to associate with the mount target's network interface. This replaces the existing security groups. All security groups must belong to the same VPC as the mount target's subnet.</p>
pub security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateMountTargetInput {
/// <p>The ID of the mount target to update.</p>
pub fn mount_target_id(&self) -> ::std::option::Option<&str> {
self.mount_target_id.as_deref()
}
/// <p>An array of VPC security group IDs to associate with the mount target's network interface. This replaces the existing security groups. All security groups must belong to the same VPC as the mount target's subnet.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_groups.is_none()`.
pub fn security_groups(&self) -> &[::std::string::String] {
self.security_groups.as_deref().unwrap_or_default()
}
}
impl UpdateMountTargetInput {
/// Creates a new builder-style object to manufacture [`UpdateMountTargetInput`](crate::operation::update_mount_target::UpdateMountTargetInput).
pub fn builder() -> crate::operation::update_mount_target::builders::UpdateMountTargetInputBuilder {
crate::operation::update_mount_target::builders::UpdateMountTargetInputBuilder::default()
}
}
/// A builder for [`UpdateMountTargetInput`](crate::operation::update_mount_target::UpdateMountTargetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateMountTargetInputBuilder {
pub(crate) mount_target_id: ::std::option::Option<::std::string::String>,
pub(crate) security_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl UpdateMountTargetInputBuilder {
/// <p>The ID of the mount target to update.</p>
/// This field is required.
pub fn mount_target_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.mount_target_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the mount target to update.</p>
pub fn set_mount_target_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.mount_target_id = input;
self
}
/// <p>The ID of the mount target to update.</p>
pub fn get_mount_target_id(&self) -> &::std::option::Option<::std::string::String> {
&self.mount_target_id
}
/// Appends an item to `security_groups`.
///
/// To override the contents of this collection use [`set_security_groups`](Self::set_security_groups).
///
/// <p>An array of VPC security group IDs to associate with the mount target's network interface. This replaces the existing security groups. All security groups must belong to the same VPC as the mount target's subnet.</p>
pub fn security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.security_groups.unwrap_or_default();
v.push(input.into());
self.security_groups = ::std::option::Option::Some(v);
self
}
/// <p>An array of VPC security group IDs to associate with the mount target's network interface. This replaces the existing security groups. All security groups must belong to the same VPC as the mount target's subnet.</p>
pub fn set_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.security_groups = input;
self
}
/// <p>An array of VPC security group IDs to associate with the mount target's network interface. This replaces the existing security groups. All security groups must belong to the same VPC as the mount target's subnet.</p>
pub fn get_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.security_groups
}
/// Consumes the builder and constructs a [`UpdateMountTargetInput`](crate::operation::update_mount_target::UpdateMountTargetInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::update_mount_target::UpdateMountTargetInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::update_mount_target::UpdateMountTargetInput {
mount_target_id: self.mount_target_id,
security_groups: self.security_groups,
})
}
}