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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The DataSync agents that are connecting to a Network File System (NFS) location.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct OnPremConfig {
/// <p>The Amazon Resource Names (ARNs) of the agents connecting to a transfer location.</p>
pub agent_arns: ::std::vec::Vec<::std::string::String>,
}
impl OnPremConfig {
/// <p>The Amazon Resource Names (ARNs) of the agents connecting to a transfer location.</p>
pub fn agent_arns(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.agent_arns.deref()
}
}
impl OnPremConfig {
/// Creates a new builder-style object to manufacture [`OnPremConfig`](crate::types::OnPremConfig).
pub fn builder() -> crate::types::builders::OnPremConfigBuilder {
crate::types::builders::OnPremConfigBuilder::default()
}
}
/// A builder for [`OnPremConfig`](crate::types::OnPremConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct OnPremConfigBuilder {
pub(crate) agent_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl OnPremConfigBuilder {
/// Appends an item to `agent_arns`.
///
/// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
///
/// <p>The Amazon Resource Names (ARNs) of the agents connecting to a transfer location.</p>
pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.agent_arns.unwrap_or_default();
v.push(input.into());
self.agent_arns = ::std::option::Option::Some(v);
self
}
/// <p>The Amazon Resource Names (ARNs) of the agents connecting to a transfer location.</p>
pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.agent_arns = input;
self
}
/// <p>The Amazon Resource Names (ARNs) of the agents connecting to a transfer location.</p>
pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.agent_arns
}
/// Consumes the builder and constructs a [`OnPremConfig`](crate::types::OnPremConfig).
/// This method will fail if any of the following fields are not set:
/// - [`agent_arns`](crate::types::builders::OnPremConfigBuilder::agent_arns)
pub fn build(self) -> ::std::result::Result<crate::types::OnPremConfig, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::OnPremConfig {
agent_arns: self.agent_arns.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"agent_arns",
"agent_arns was not specified but it is required when building OnPremConfig",
)
})?,
})
}
}