aws_sdk_appstream/operation/update_entitlement/
_update_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 UpdateEntitlementInput {
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 only 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 UpdateEntitlementInput {
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 only 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 UpdateEntitlementInput {
42    /// Creates a new builder-style object to manufacture [`UpdateEntitlementInput`](crate::operation::update_entitlement::UpdateEntitlementInput).
43    pub fn builder() -> crate::operation::update_entitlement::builders::UpdateEntitlementInputBuilder {
44        crate::operation::update_entitlement::builders::UpdateEntitlementInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateEntitlementInput`](crate::operation::update_entitlement::UpdateEntitlementInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateEntitlementInputBuilder {
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 UpdateEntitlementInputBuilder {
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 only selected apps are entitled.</p>
104    pub fn app_visibility(mut self, input: crate::types::AppVisibility) -> Self {
105        self.app_visibility = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>Specifies whether all or only selected apps are entitled.</p>
109    pub fn set_app_visibility(mut self, input: ::std::option::Option<crate::types::AppVisibility>) -> Self {
110        self.app_visibility = input;
111        self
112    }
113    /// <p>Specifies whether all or only selected apps are entitled.</p>
114    pub fn get_app_visibility(&self) -> &::std::option::Option<crate::types::AppVisibility> {
115        &self.app_visibility
116    }
117    /// Appends an item to `attributes`.
118    ///
119    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
120    ///
121    /// <p>The attributes of the entitlement.</p>
122    pub fn attributes(mut self, input: crate::types::EntitlementAttribute) -> Self {
123        let mut v = self.attributes.unwrap_or_default();
124        v.push(input);
125        self.attributes = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>The attributes of the entitlement.</p>
129    pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>>) -> Self {
130        self.attributes = input;
131        self
132    }
133    /// <p>The attributes of the entitlement.</p>
134    pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementAttribute>> {
135        &self.attributes
136    }
137    /// Consumes the builder and constructs a [`UpdateEntitlementInput`](crate::operation::update_entitlement::UpdateEntitlementInput).
138    pub fn build(
139        self,
140    ) -> ::std::result::Result<crate::operation::update_entitlement::UpdateEntitlementInput, ::aws_smithy_types::error::operation::BuildError> {
141        ::std::result::Result::Ok(crate::operation::update_entitlement::UpdateEntitlementInput {
142            name: self.name,
143            stack_name: self.stack_name,
144            description: self.description,
145            app_visibility: self.app_visibility,
146            attributes: self.attributes,
147        })
148    }
149}