Skip to main content

aws_sdk_datasync/types/
_on_prem_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct OnPremConfig {
7    /// <p>The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.</p>
8    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
9    pub agent_arns: ::std::vec::Vec<::std::string::String>,
10}
11impl OnPremConfig {
12    /// <p>The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.</p>
13    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
14    pub fn agent_arns(&self) -> &[::std::string::String] {
15        use std::ops::Deref;
16        self.agent_arns.deref()
17    }
18}
19impl OnPremConfig {
20    /// Creates a new builder-style object to manufacture [`OnPremConfig`](crate::types::OnPremConfig).
21    pub fn builder() -> crate::types::builders::OnPremConfigBuilder {
22        crate::types::builders::OnPremConfigBuilder::default()
23    }
24}
25
26/// A builder for [`OnPremConfig`](crate::types::OnPremConfig).
27#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
28#[non_exhaustive]
29pub struct OnPremConfigBuilder {
30    pub(crate) agent_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
31}
32impl OnPremConfigBuilder {
33    /// Appends an item to `agent_arns`.
34    ///
35    /// To override the contents of this collection use [`set_agent_arns`](Self::set_agent_arns).
36    ///
37    /// <p>The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.</p>
38    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
39    pub fn agent_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        let mut v = self.agent_arns.unwrap_or_default();
41        v.push(input.into());
42        self.agent_arns = ::std::option::Option::Some(v);
43        self
44    }
45    /// <p>The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.</p>
46    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
47    pub fn set_agent_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
48        self.agent_arns = input;
49        self
50    }
51    /// <p>The Amazon Resource Names (ARNs) of the DataSync agents that can connect to your NFS file server.</p>
52    /// <p>You can specify more than one agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/do-i-need-datasync-agent.html#multiple-agents">Using multiple DataSync agents</a>.</p>
53    pub fn get_agent_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
54        &self.agent_arns
55    }
56    /// Consumes the builder and constructs a [`OnPremConfig`](crate::types::OnPremConfig).
57    /// This method will fail if any of the following fields are not set:
58    /// - [`agent_arns`](crate::types::builders::OnPremConfigBuilder::agent_arns)
59    pub fn build(self) -> ::std::result::Result<crate::types::OnPremConfig, ::aws_smithy_types::error::operation::BuildError> {
60        ::std::result::Result::Ok(crate::types::OnPremConfig {
61            agent_arns: self.agent_arns.ok_or_else(|| {
62                ::aws_smithy_types::error::operation::BuildError::missing_field(
63                    "agent_arns",
64                    "agent_arns was not specified but it is required when building OnPremConfig",
65                )
66            })?,
67        })
68    }
69}