aws_sdk_iotsitewise/operation/create_gateway/_create_gateway_output.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 CreateGatewayOutput {
6 /// <p>The ID of the gateway device. You can use this ID when you call other IoT SiteWise API operations.</p>
7 pub gateway_id: ::std::string::String,
8 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
9 /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
10 pub gateway_arn: ::std::string::String,
11 _request_id: Option<String>,
12}
13impl CreateGatewayOutput {
14 /// <p>The ID of the gateway device. You can use this ID when you call other IoT SiteWise API operations.</p>
15 pub fn gateway_id(&self) -> &str {
16 use std::ops::Deref;
17 self.gateway_id.deref()
18 }
19 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
20 /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
21 pub fn gateway_arn(&self) -> &str {
22 use std::ops::Deref;
23 self.gateway_arn.deref()
24 }
25}
26impl ::aws_types::request_id::RequestId for CreateGatewayOutput {
27 fn request_id(&self) -> Option<&str> {
28 self._request_id.as_deref()
29 }
30}
31impl CreateGatewayOutput {
32 /// Creates a new builder-style object to manufacture [`CreateGatewayOutput`](crate::operation::create_gateway::CreateGatewayOutput).
33 pub fn builder() -> crate::operation::create_gateway::builders::CreateGatewayOutputBuilder {
34 crate::operation::create_gateway::builders::CreateGatewayOutputBuilder::default()
35 }
36}
37
38/// A builder for [`CreateGatewayOutput`](crate::operation::create_gateway::CreateGatewayOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct CreateGatewayOutputBuilder {
42 pub(crate) gateway_id: ::std::option::Option<::std::string::String>,
43 pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
44 _request_id: Option<String>,
45}
46impl CreateGatewayOutputBuilder {
47 /// <p>The ID of the gateway device. You can use this ID when you call other IoT SiteWise API operations.</p>
48 /// This field is required.
49 pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50 self.gateway_id = ::std::option::Option::Some(input.into());
51 self
52 }
53 /// <p>The ID of the gateway device. You can use this ID when you call other IoT SiteWise API operations.</p>
54 pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55 self.gateway_id = input;
56 self
57 }
58 /// <p>The ID of the gateway device. You can use this ID when you call other IoT SiteWise API operations.</p>
59 pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
60 &self.gateway_id
61 }
62 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
63 /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
64 /// This field is required.
65 pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.gateway_arn = ::std::option::Option::Some(input.into());
67 self
68 }
69 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
70 /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
71 pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.gateway_arn = input;
73 self
74 }
75 /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the gateway, which has the following format.</p>
76 /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:gateway/${GatewayId}</code></p>
77 pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
78 &self.gateway_arn
79 }
80 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81 self._request_id = Some(request_id.into());
82 self
83 }
84
85 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86 self._request_id = request_id;
87 self
88 }
89 /// Consumes the builder and constructs a [`CreateGatewayOutput`](crate::operation::create_gateway::CreateGatewayOutput).
90 /// This method will fail if any of the following fields are not set:
91 /// - [`gateway_id`](crate::operation::create_gateway::builders::CreateGatewayOutputBuilder::gateway_id)
92 /// - [`gateway_arn`](crate::operation::create_gateway::builders::CreateGatewayOutputBuilder::gateway_arn)
93 pub fn build(
94 self,
95 ) -> ::std::result::Result<crate::operation::create_gateway::CreateGatewayOutput, ::aws_smithy_types::error::operation::BuildError> {
96 ::std::result::Result::Ok(crate::operation::create_gateway::CreateGatewayOutput {
97 gateway_id: self.gateway_id.ok_or_else(|| {
98 ::aws_smithy_types::error::operation::BuildError::missing_field(
99 "gateway_id",
100 "gateway_id was not specified but it is required when building CreateGatewayOutput",
101 )
102 })?,
103 gateway_arn: self.gateway_arn.ok_or_else(|| {
104 ::aws_smithy_types::error::operation::BuildError::missing_field(
105 "gateway_arn",
106 "gateway_arn was not specified but it is required when building CreateGatewayOutput",
107 )
108 })?,
109 _request_id: self._request_id,
110 })
111 }
112}