aws_sdk_iotsitewise/operation/create_gateway/
_create_gateway_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 CreateGatewayInput {
6    /// <p>A unique name for the gateway.</p>
7    pub gateway_name: ::std::option::Option<::std::string::String>,
8    /// <p>The gateway's platform. You can only specify one platform in a gateway.</p>
9    pub gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
10    /// <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p><note>
11    /// <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p>
12    /// </note>
13    /// <p>We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
14    pub gateway_version: ::std::option::Option<::std::string::String>,
15    /// <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
16    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17}
18impl CreateGatewayInput {
19    /// <p>A unique name for the gateway.</p>
20    pub fn gateway_name(&self) -> ::std::option::Option<&str> {
21        self.gateway_name.as_deref()
22    }
23    /// <p>The gateway's platform. You can only specify one platform in a gateway.</p>
24    pub fn gateway_platform(&self) -> ::std::option::Option<&crate::types::GatewayPlatform> {
25        self.gateway_platform.as_ref()
26    }
27    /// <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p><note>
28    /// <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p>
29    /// </note>
30    /// <p>We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
31    pub fn gateway_version(&self) -> ::std::option::Option<&str> {
32        self.gateway_version.as_deref()
33    }
34    /// <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
35    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
36        self.tags.as_ref()
37    }
38}
39impl CreateGatewayInput {
40    /// Creates a new builder-style object to manufacture [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
41    pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayInputBuilder {
42        crate::operation::create_gateway::builders::CreateGatewayInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateGatewayInputBuilder {
50    pub(crate) gateway_name: ::std::option::Option<::std::string::String>,
51    pub(crate) gateway_platform: ::std::option::Option<crate::types::GatewayPlatform>,
52    pub(crate) gateway_version: ::std::option::Option<::std::string::String>,
53    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
54}
55impl CreateGatewayInputBuilder {
56    /// <p>A unique name for the gateway.</p>
57    /// This field is required.
58    pub fn gateway_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.gateway_name = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>A unique name for the gateway.</p>
63    pub fn set_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.gateway_name = input;
65        self
66    }
67    /// <p>A unique name for the gateway.</p>
68    pub fn get_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
69        &self.gateway_name
70    }
71    /// <p>The gateway's platform. You can only specify one platform in a gateway.</p>
72    /// This field is required.
73    pub fn gateway_platform(mut self, input: crate::types::GatewayPlatform) -> Self {
74        self.gateway_platform = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>The gateway's platform. You can only specify one platform in a gateway.</p>
78    pub fn set_gateway_platform(mut self, input: ::std::option::Option<crate::types::GatewayPlatform>) -> Self {
79        self.gateway_platform = input;
80        self
81    }
82    /// <p>The gateway's platform. You can only specify one platform in a gateway.</p>
83    pub fn get_gateway_platform(&self) -> &::std::option::Option<crate::types::GatewayPlatform> {
84        &self.gateway_platform
85    }
86    /// <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p><note>
87    /// <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p>
88    /// </note>
89    /// <p>We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
90    pub fn gateway_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.gateway_version = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p><note>
95    /// <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p>
96    /// </note>
97    /// <p>We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
98    pub fn set_gateway_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.gateway_version = input;
100        self
101    }
102    /// <p>The version of the gateway to create. Specify <code>3</code> to create an MQTT-enabled, V3 gateway and <code>2</code> to create a Classic streams, V2 gateway. If not specified, the default is <code>2</code> (Classic streams, V2 gateway).</p><note>
103    /// <p>When creating a V3 gateway (<code>gatewayVersion=3</code>) with the <code>GreengrassV2</code> platform, you must also specify the <code>coreDeviceOperatingSystem</code> parameter.</p>
104    /// </note>
105    /// <p>We recommend creating an MQTT-enabled gateway for self-hosted gateways and Siemens Industrial Edge gateways. For more information on gateway versions, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/gateways.html">Use Amazon Web Services IoT SiteWise Edge Edge gateways</a>.</p>
106    pub fn get_gateway_version(&self) -> &::std::option::Option<::std::string::String> {
107        &self.gateway_version
108    }
109    /// Adds a key-value pair to `tags`.
110    ///
111    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
112    ///
113    /// <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
114    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
115        let mut hash_map = self.tags.unwrap_or_default();
116        hash_map.insert(k.into(), v.into());
117        self.tags = ::std::option::Option::Some(hash_map);
118        self
119    }
120    /// <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
121    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
122        self.tags = input;
123        self
124    }
125    /// <p>A list of key-value pairs that contain metadata for the gateway. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
126    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
127        &self.tags
128    }
129    /// Consumes the builder and constructs a [`CreateGatewayInput`](crate::operation::create_gateway::CreateGatewayInput).
130    pub fn build(
131        self,
132    ) -> ::std::result::Result<crate::operation::create_gateway::CreateGatewayInput, ::aws_smithy_types::error::operation::BuildError> {
133        ::std::result::Result::Ok(crate::operation::create_gateway::CreateGatewayInput {
134            gateway_name: self.gateway_name,
135            gateway_platform: self.gateway_platform,
136            gateway_version: self.gateway_version,
137            tags: self.tags,
138        })
139    }
140}