aws_sdk_workspacesweb/operation/create_portal/
_create_portal_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 CreatePortalOutput {
6    /// <p>The ARN of the web portal.</p>
7    pub portal_arn: ::std::string::String,
8    /// <p>The endpoint URL of the web portal that users access in order to start streaming sessions.</p>
9    pub portal_endpoint: ::std::string::String,
10    _request_id: Option<String>,
11}
12impl CreatePortalOutput {
13    /// <p>The ARN of the web portal.</p>
14    pub fn portal_arn(&self) -> &str {
15        use std::ops::Deref;
16        self.portal_arn.deref()
17    }
18    /// <p>The endpoint URL of the web portal that users access in order to start streaming sessions.</p>
19    pub fn portal_endpoint(&self) -> &str {
20        use std::ops::Deref;
21        self.portal_endpoint.deref()
22    }
23}
24impl ::aws_types::request_id::RequestId for CreatePortalOutput {
25    fn request_id(&self) -> Option<&str> {
26        self._request_id.as_deref()
27    }
28}
29impl CreatePortalOutput {
30    /// Creates a new builder-style object to manufacture [`CreatePortalOutput`](crate::operation::create_portal::CreatePortalOutput).
31    pub fn builder() -> crate::operation::create_portal::builders::CreatePortalOutputBuilder {
32        crate::operation::create_portal::builders::CreatePortalOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreatePortalOutput`](crate::operation::create_portal::CreatePortalOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreatePortalOutputBuilder {
40    pub(crate) portal_arn: ::std::option::Option<::std::string::String>,
41    pub(crate) portal_endpoint: ::std::option::Option<::std::string::String>,
42    _request_id: Option<String>,
43}
44impl CreatePortalOutputBuilder {
45    /// <p>The ARN of the web portal.</p>
46    /// This field is required.
47    pub fn portal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.portal_arn = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The ARN of the web portal.</p>
52    pub fn set_portal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.portal_arn = input;
54        self
55    }
56    /// <p>The ARN of the web portal.</p>
57    pub fn get_portal_arn(&self) -> &::std::option::Option<::std::string::String> {
58        &self.portal_arn
59    }
60    /// <p>The endpoint URL of the web portal that users access in order to start streaming sessions.</p>
61    /// This field is required.
62    pub fn portal_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.portal_endpoint = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The endpoint URL of the web portal that users access in order to start streaming sessions.</p>
67    pub fn set_portal_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.portal_endpoint = input;
69        self
70    }
71    /// <p>The endpoint URL of the web portal that users access in order to start streaming sessions.</p>
72    pub fn get_portal_endpoint(&self) -> &::std::option::Option<::std::string::String> {
73        &self.portal_endpoint
74    }
75    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
76        self._request_id = Some(request_id.into());
77        self
78    }
79
80    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
81        self._request_id = request_id;
82        self
83    }
84    /// Consumes the builder and constructs a [`CreatePortalOutput`](crate::operation::create_portal::CreatePortalOutput).
85    /// This method will fail if any of the following fields are not set:
86    /// - [`portal_arn`](crate::operation::create_portal::builders::CreatePortalOutputBuilder::portal_arn)
87    /// - [`portal_endpoint`](crate::operation::create_portal::builders::CreatePortalOutputBuilder::portal_endpoint)
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::create_portal::CreatePortalOutput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::create_portal::CreatePortalOutput {
92            portal_arn: self.portal_arn.ok_or_else(|| {
93                ::aws_smithy_types::error::operation::BuildError::missing_field(
94                    "portal_arn",
95                    "portal_arn was not specified but it is required when building CreatePortalOutput",
96                )
97            })?,
98            portal_endpoint: self.portal_endpoint.ok_or_else(|| {
99                ::aws_smithy_types::error::operation::BuildError::missing_field(
100                    "portal_endpoint",
101                    "portal_endpoint was not specified but it is required when building CreatePortalOutput",
102                )
103            })?,
104            _request_id: self._request_id,
105        })
106    }
107}