aws_sdk_sms/operation/create_app/
_create_app_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 CreateAppOutput {
6    /// <p>A summary description of the application.</p>
7    pub app_summary: ::std::option::Option<crate::types::AppSummary>,
8    /// <p>The server groups included in the application.</p>
9    pub server_groups: ::std::option::Option<::std::vec::Vec<crate::types::ServerGroup>>,
10    /// <p>The tags associated with the application.</p>
11    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12    _request_id: Option<String>,
13}
14impl CreateAppOutput {
15    /// <p>A summary description of the application.</p>
16    pub fn app_summary(&self) -> ::std::option::Option<&crate::types::AppSummary> {
17        self.app_summary.as_ref()
18    }
19    /// <p>The server groups included in the application.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.server_groups.is_none()`.
22    pub fn server_groups(&self) -> &[crate::types::ServerGroup] {
23        self.server_groups.as_deref().unwrap_or_default()
24    }
25    /// <p>The tags associated with the application.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
28    pub fn tags(&self) -> &[crate::types::Tag] {
29        self.tags.as_deref().unwrap_or_default()
30    }
31}
32impl ::aws_types::request_id::RequestId for CreateAppOutput {
33    fn request_id(&self) -> Option<&str> {
34        self._request_id.as_deref()
35    }
36}
37impl CreateAppOutput {
38    /// Creates a new builder-style object to manufacture [`CreateAppOutput`](crate::operation::create_app::CreateAppOutput).
39    pub fn builder() -> crate::operation::create_app::builders::CreateAppOutputBuilder {
40        crate::operation::create_app::builders::CreateAppOutputBuilder::default()
41    }
42}
43
44/// A builder for [`CreateAppOutput`](crate::operation::create_app::CreateAppOutput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct CreateAppOutputBuilder {
48    pub(crate) app_summary: ::std::option::Option<crate::types::AppSummary>,
49    pub(crate) server_groups: ::std::option::Option<::std::vec::Vec<crate::types::ServerGroup>>,
50    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
51    _request_id: Option<String>,
52}
53impl CreateAppOutputBuilder {
54    /// <p>A summary description of the application.</p>
55    pub fn app_summary(mut self, input: crate::types::AppSummary) -> Self {
56        self.app_summary = ::std::option::Option::Some(input);
57        self
58    }
59    /// <p>A summary description of the application.</p>
60    pub fn set_app_summary(mut self, input: ::std::option::Option<crate::types::AppSummary>) -> Self {
61        self.app_summary = input;
62        self
63    }
64    /// <p>A summary description of the application.</p>
65    pub fn get_app_summary(&self) -> &::std::option::Option<crate::types::AppSummary> {
66        &self.app_summary
67    }
68    /// Appends an item to `server_groups`.
69    ///
70    /// To override the contents of this collection use [`set_server_groups`](Self::set_server_groups).
71    ///
72    /// <p>The server groups included in the application.</p>
73    pub fn server_groups(mut self, input: crate::types::ServerGroup) -> Self {
74        let mut v = self.server_groups.unwrap_or_default();
75        v.push(input);
76        self.server_groups = ::std::option::Option::Some(v);
77        self
78    }
79    /// <p>The server groups included in the application.</p>
80    pub fn set_server_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ServerGroup>>) -> Self {
81        self.server_groups = input;
82        self
83    }
84    /// <p>The server groups included in the application.</p>
85    pub fn get_server_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ServerGroup>> {
86        &self.server_groups
87    }
88    /// Appends an item to `tags`.
89    ///
90    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
91    ///
92    /// <p>The tags associated with the application.</p>
93    pub fn tags(mut self, input: crate::types::Tag) -> Self {
94        let mut v = self.tags.unwrap_or_default();
95        v.push(input);
96        self.tags = ::std::option::Option::Some(v);
97        self
98    }
99    /// <p>The tags associated with the application.</p>
100    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
101        self.tags = input;
102        self
103    }
104    /// <p>The tags associated with the application.</p>
105    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
106        &self.tags
107    }
108    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
109        self._request_id = Some(request_id.into());
110        self
111    }
112
113    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
114        self._request_id = request_id;
115        self
116    }
117    /// Consumes the builder and constructs a [`CreateAppOutput`](crate::operation::create_app::CreateAppOutput).
118    pub fn build(self) -> crate::operation::create_app::CreateAppOutput {
119        crate::operation::create_app::CreateAppOutput {
120            app_summary: self.app_summary,
121            server_groups: self.server_groups,
122            tags: self.tags,
123            _request_id: self._request_id,
124        }
125    }
126}