aws_sdk_appstream/operation/create_entitlement/
_create_entitlement_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 CreateEntitlementInput {
6    /// <p>The name of the entitlement.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the stack with which the entitlement is associated.</p>
9    pub stack_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the entitlement.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies whether all or selected apps are entitled.</p>
13    pub app_visibility: ::std::option::Option<crate::types::AppVisibility>,
14    /// <p>The attributes of the entitlement.</p>
15    pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>>,
16}
17impl CreateEntitlementInput {
18    /// <p>The name of the entitlement.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>The name of the stack with which the entitlement is associated.</p>
23    pub fn stack_name(&self) -> ::std::option::Option<&str> {
24        self.stack_name.as_deref()
25    }
26    /// <p>The description of the entitlement.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>Specifies whether all or selected apps are entitled.</p>
31    pub fn app_visibility(&self) -> ::std::option::Option<&crate::types::AppVisibility> {
32        self.app_visibility.as_ref()
33    }
34    /// <p>The attributes of the entitlement.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attributes.is_none()`.
37    pub fn attributes(&self) -> &[crate::types::EntitlementAttribute] {
38        self.attributes.as_deref().unwrap_or_default()
39    }
40}
41impl CreateEntitlementInput {
42    /// Creates a new builder-style object to manufacture [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
43    pub fn builder() -> crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder {
44        crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder::default()
45    }
46}
47
48/// A builder for [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateEntitlementInputBuilder {
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) stack_name: ::std::option::Option<::std::string::String>,
54    pub(crate) description: ::std::option::Option<::std::string::String>,
55    pub(crate) app_visibility: ::std::option::Option<crate::types::AppVisibility>,
56    pub(crate) attributes: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>>,
57}
58impl CreateEntitlementInputBuilder {
59    /// <p>The name of the entitlement.</p>
60    /// This field is required.
61    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the entitlement.</p>
66    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.name = input;
68        self
69    }
70    /// <p>The name of the entitlement.</p>
71    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.name
73    }
74    /// <p>The name of the stack with which the entitlement is associated.</p>
75    /// This field is required.
76    pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.stack_name = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The name of the stack with which the entitlement is associated.</p>
81    pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.stack_name = input;
83        self
84    }
85    /// <p>The name of the stack with which the entitlement is associated.</p>
86    pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
87        &self.stack_name
88    }
89    /// <p>The description of the entitlement.</p>
90    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.description = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The description of the entitlement.</p>
95    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.description = input;
97        self
98    }
99    /// <p>The description of the entitlement.</p>
100    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
101        &self.description
102    }
103    /// <p>Specifies whether all or selected apps are entitled.</p>
104    /// This field is required.
105    pub fn app_visibility(mut self, input: crate::types::AppVisibility) -> Self {
106        self.app_visibility = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>Specifies whether all or selected apps are entitled.</p>
110    pub fn set_app_visibility(mut self, input: ::std::option::Option<crate::types::AppVisibility>) -> Self {
111        self.app_visibility = input;
112        self
113    }
114    /// <p>Specifies whether all or selected apps are entitled.</p>
115    pub fn get_app_visibility(&self) -> &::std::option::Option<crate::types::AppVisibility> {
116        &self.app_visibility
117    }
118    /// Appends an item to `attributes`.
119    ///
120    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
121    ///
122    /// <p>The attributes of the entitlement.</p>
123    pub fn attributes(mut self, input: crate::types::EntitlementAttribute) -> Self {
124        let mut v = self.attributes.unwrap_or_default();
125        v.push(input);
126        self.attributes = ::std::option::Option::Some(v);
127        self
128    }
129    /// <p>The attributes of the entitlement.</p>
130    pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>>) -> Self {
131        self.attributes = input;
132        self
133    }
134    /// <p>The attributes of the entitlement.</p>
135    pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>> {
136        &self.attributes
137    }
138    /// Consumes the builder and constructs a [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
139    pub fn build(
140        self,
141    ) -> ::std::result::Result<crate::operation::create_entitlement::CreateEntitlementInput, ::aws_smithy_types::error::operation::BuildError> {
142        ::std::result::Result::Ok(crate::operation::create_entitlement::CreateEntitlementInput {
143            name: self.name,
144            stack_name: self.stack_name,
145            description: self.description,
146            app_visibility: self.app_visibility,
147            attributes: self.attributes,
148        })
149    }
150}