aws_sdk_appstream/operation/create_entitlement/
_create_entitlement_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateEntitlementInput {
6 pub name: ::std::option::Option<::std::string::String>,
8 pub stack_name: ::std::option::Option<::std::string::String>,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub app_visibility: ::std::option::Option<crate::types::AppVisibility>,
14 pub attributes: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>>,
16}
17impl CreateEntitlementInput {
18 pub fn name(&self) -> ::std::option::Option<&str> {
20 self.name.as_deref()
21 }
22 pub fn stack_name(&self) -> ::std::option::Option<&str> {
24 self.stack_name.as_deref()
25 }
26 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 pub fn app_visibility(&self) -> ::std::option::Option<&crate::types::AppVisibility> {
32 self.app_visibility.as_ref()
33 }
34 pub fn attributes(&self) -> &[crate::types::EntitlementAttribute] {
38 self.attributes.as_deref().unwrap_or_default()
39 }
40}
41impl CreateEntitlementInput {
42 pub fn builder() -> crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder {
44 crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder::default()
45 }
46}
47
48#[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 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.name = input;
68 self
69 }
70 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.name
73 }
74 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 pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.stack_name = input;
83 self
84 }
85 pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
87 &self.stack_name
88 }
89 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.description = input;
97 self
98 }
99 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
101 &self.description
102 }
103 pub fn app_visibility(mut self, input: crate::types::AppVisibility) -> Self {
106 self.app_visibility = ::std::option::Option::Some(input);
107 self
108 }
109 pub fn set_app_visibility(mut self, input: ::std::option::Option<crate::types::AppVisibility>) -> Self {
111 self.app_visibility = input;
112 self
113 }
114 pub fn get_app_visibility(&self) -> &::std::option::Option<crate::types::AppVisibility> {
116 &self.app_visibility
117 }
118 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 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 pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>> {
136 &self.attributes
137 }
138 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}