aws_sdk_groundstation/operation/register_agent/
_register_agent_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RegisterAgentInput {
6    /// <p>Data for associating an agent with the capabilities it is managing.</p>
7    pub discovery_data: ::std::option::Option<crate::types::DiscoveryData>,
8    /// <p>Detailed information about the agent being registered.</p>
9    pub agent_details: ::std::option::Option<crate::types::AgentDetails>,
10    /// <p>Tags assigned to an <code>Agent</code>.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl RegisterAgentInput {
14    /// <p>Data for associating an agent with the capabilities it is managing.</p>
15    pub fn discovery_data(&self) -> ::std::option::Option<&crate::types::DiscoveryData> {
16        self.discovery_data.as_ref()
17    }
18    /// <p>Detailed information about the agent being registered.</p>
19    pub fn agent_details(&self) -> ::std::option::Option<&crate::types::AgentDetails> {
20        self.agent_details.as_ref()
21    }
22    /// <p>Tags assigned to an <code>Agent</code>.</p>
23    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24        self.tags.as_ref()
25    }
26}
27impl RegisterAgentInput {
28    /// Creates a new builder-style object to manufacture [`RegisterAgentInput`](crate::operation::register_agent::RegisterAgentInput).
29    pub fn builder() -> crate::operation::register_agent::builders::RegisterAgentInputBuilder {
30        crate::operation::register_agent::builders::RegisterAgentInputBuilder::default()
31    }
32}
33
34/// A builder for [`RegisterAgentInput`](crate::operation::register_agent::RegisterAgentInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct RegisterAgentInputBuilder {
38    pub(crate) discovery_data: ::std::option::Option<crate::types::DiscoveryData>,
39    pub(crate) agent_details: ::std::option::Option<crate::types::AgentDetails>,
40    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl RegisterAgentInputBuilder {
43    /// <p>Data for associating an agent with the capabilities it is managing.</p>
44    /// This field is required.
45    pub fn discovery_data(mut self, input: crate::types::DiscoveryData) -> Self {
46        self.discovery_data = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>Data for associating an agent with the capabilities it is managing.</p>
50    pub fn set_discovery_data(mut self, input: ::std::option::Option<crate::types::DiscoveryData>) -> Self {
51        self.discovery_data = input;
52        self
53    }
54    /// <p>Data for associating an agent with the capabilities it is managing.</p>
55    pub fn get_discovery_data(&self) -> &::std::option::Option<crate::types::DiscoveryData> {
56        &self.discovery_data
57    }
58    /// <p>Detailed information about the agent being registered.</p>
59    /// This field is required.
60    pub fn agent_details(mut self, input: crate::types::AgentDetails) -> Self {
61        self.agent_details = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>Detailed information about the agent being registered.</p>
65    pub fn set_agent_details(mut self, input: ::std::option::Option<crate::types::AgentDetails>) -> Self {
66        self.agent_details = input;
67        self
68    }
69    /// <p>Detailed information about the agent being registered.</p>
70    pub fn get_agent_details(&self) -> &::std::option::Option<crate::types::AgentDetails> {
71        &self.agent_details
72    }
73    /// Adds a key-value pair to `tags`.
74    ///
75    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
76    ///
77    /// <p>Tags assigned to an <code>Agent</code>.</p>
78    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
79        let mut hash_map = self.tags.unwrap_or_default();
80        hash_map.insert(k.into(), v.into());
81        self.tags = ::std::option::Option::Some(hash_map);
82        self
83    }
84    /// <p>Tags assigned to an <code>Agent</code>.</p>
85    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
86        self.tags = input;
87        self
88    }
89    /// <p>Tags assigned to an <code>Agent</code>.</p>
90    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
91        &self.tags
92    }
93    /// Consumes the builder and constructs a [`RegisterAgentInput`](crate::operation::register_agent::RegisterAgentInput).
94    pub fn build(
95        self,
96    ) -> ::std::result::Result<crate::operation::register_agent::RegisterAgentInput, ::aws_smithy_types::error::operation::BuildError> {
97        ::std::result::Result::Ok(crate::operation::register_agent::RegisterAgentInput {
98            discovery_data: self.discovery_data,
99            agent_details: self.agent_details,
100            tags: self.tags,
101        })
102    }
103}