Skip to main content

aws_sdk_workspacesweb/operation/create_browser_settings/
_create_browser_settings_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)]
5pub struct CreateBrowserSettingsInput {
6    /// <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
7    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
8    /// <p>The custom managed key of the browser settings.</p>
9    pub customer_managed_key: ::std::option::Option<::std::string::String>,
10    /// <p>Additional encryption context of the browser settings.</p>
11    pub additional_encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
13    pub browser_policy: ::std::option::Option<::std::string::String>,
14    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
15    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
16    pub client_token: ::std::option::Option<::std::string::String>,
17    /// <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</p>
18    pub web_content_filtering_policy: ::std::option::Option<crate::types::WebContentFilteringPolicy>,
19}
20impl CreateBrowserSettingsInput {
21    /// <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
22    ///
23    /// 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()`.
24    pub fn tags(&self) -> &[crate::types::Tag] {
25        self.tags.as_deref().unwrap_or_default()
26    }
27    /// <p>The custom managed key of the browser settings.</p>
28    pub fn customer_managed_key(&self) -> ::std::option::Option<&str> {
29        self.customer_managed_key.as_deref()
30    }
31    /// <p>Additional encryption context of the browser settings.</p>
32    pub fn additional_encryption_context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
33        self.additional_encryption_context.as_ref()
34    }
35    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
36    pub fn browser_policy(&self) -> ::std::option::Option<&str> {
37        self.browser_policy.as_deref()
38    }
39    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
40    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
41    pub fn client_token(&self) -> ::std::option::Option<&str> {
42        self.client_token.as_deref()
43    }
44    /// <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</p>
45    pub fn web_content_filtering_policy(&self) -> ::std::option::Option<&crate::types::WebContentFilteringPolicy> {
46        self.web_content_filtering_policy.as_ref()
47    }
48}
49impl ::std::fmt::Debug for CreateBrowserSettingsInput {
50    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
51        let mut formatter = f.debug_struct("CreateBrowserSettingsInput");
52        formatter.field("tags", &"*** Sensitive Data Redacted ***");
53        formatter.field("customer_managed_key", &self.customer_managed_key);
54        formatter.field("additional_encryption_context", &self.additional_encryption_context);
55        formatter.field("browser_policy", &"*** Sensitive Data Redacted ***");
56        formatter.field("client_token", &self.client_token);
57        formatter.field("web_content_filtering_policy", &self.web_content_filtering_policy);
58        formatter.finish()
59    }
60}
61impl CreateBrowserSettingsInput {
62    /// Creates a new builder-style object to manufacture [`CreateBrowserSettingsInput`](crate::operation::create_browser_settings::CreateBrowserSettingsInput).
63    pub fn builder() -> crate::operation::create_browser_settings::builders::CreateBrowserSettingsInputBuilder {
64        crate::operation::create_browser_settings::builders::CreateBrowserSettingsInputBuilder::default()
65    }
66}
67
68/// A builder for [`CreateBrowserSettingsInput`](crate::operation::create_browser_settings::CreateBrowserSettingsInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
70#[non_exhaustive]
71pub struct CreateBrowserSettingsInputBuilder {
72    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
73    pub(crate) customer_managed_key: ::std::option::Option<::std::string::String>,
74    pub(crate) additional_encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
75    pub(crate) browser_policy: ::std::option::Option<::std::string::String>,
76    pub(crate) client_token: ::std::option::Option<::std::string::String>,
77    pub(crate) web_content_filtering_policy: ::std::option::Option<crate::types::WebContentFilteringPolicy>,
78}
79impl CreateBrowserSettingsInputBuilder {
80    /// Appends an item to `tags`.
81    ///
82    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
83    ///
84    /// <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
85    pub fn tags(mut self, input: crate::types::Tag) -> Self {
86        let mut v = self.tags.unwrap_or_default();
87        v.push(input);
88        self.tags = ::std::option::Option::Some(v);
89        self
90    }
91    /// <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
92    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
93        self.tags = input;
94        self
95    }
96    /// <p>The tags to add to the browser settings resource. A tag is a key-value pair.</p>
97    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
98        &self.tags
99    }
100    /// <p>The custom managed key of the browser settings.</p>
101    pub fn customer_managed_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.customer_managed_key = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>The custom managed key of the browser settings.</p>
106    pub fn set_customer_managed_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.customer_managed_key = input;
108        self
109    }
110    /// <p>The custom managed key of the browser settings.</p>
111    pub fn get_customer_managed_key(&self) -> &::std::option::Option<::std::string::String> {
112        &self.customer_managed_key
113    }
114    /// Adds a key-value pair to `additional_encryption_context`.
115    ///
116    /// To override the contents of this collection use [`set_additional_encryption_context`](Self::set_additional_encryption_context).
117    ///
118    /// <p>Additional encryption context of the browser settings.</p>
119    pub fn additional_encryption_context(
120        mut self,
121        k: impl ::std::convert::Into<::std::string::String>,
122        v: impl ::std::convert::Into<::std::string::String>,
123    ) -> Self {
124        let mut hash_map = self.additional_encryption_context.unwrap_or_default();
125        hash_map.insert(k.into(), v.into());
126        self.additional_encryption_context = ::std::option::Option::Some(hash_map);
127        self
128    }
129    /// <p>Additional encryption context of the browser settings.</p>
130    pub fn set_additional_encryption_context(
131        mut self,
132        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
133    ) -> Self {
134        self.additional_encryption_context = input;
135        self
136    }
137    /// <p>Additional encryption context of the browser settings.</p>
138    pub fn get_additional_encryption_context(
139        &self,
140    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
141        &self.additional_encryption_context
142    }
143    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
144    pub fn browser_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.browser_policy = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
149    pub fn set_browser_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.browser_policy = input;
151        self
152    }
153    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
154    pub fn get_browser_policy(&self) -> &::std::option::Option<::std::string::String> {
155        &self.browser_policy
156    }
157    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
158    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
159    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.client_token = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
164    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
165    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.client_token = input;
167        self
168    }
169    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
170    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
171    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
172        &self.client_token
173    }
174    /// <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</p>
175    pub fn web_content_filtering_policy(mut self, input: crate::types::WebContentFilteringPolicy) -> Self {
176        self.web_content_filtering_policy = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</p>
180    pub fn set_web_content_filtering_policy(mut self, input: ::std::option::Option<crate::types::WebContentFilteringPolicy>) -> Self {
181        self.web_content_filtering_policy = input;
182        self
183    }
184    /// <p>The policy that specifies which URLs end users are allowed to access or which URLs or domain categories they are restricted from accessing for enhanced security.</p>
185    pub fn get_web_content_filtering_policy(&self) -> &::std::option::Option<crate::types::WebContentFilteringPolicy> {
186        &self.web_content_filtering_policy
187    }
188    /// Consumes the builder and constructs a [`CreateBrowserSettingsInput`](crate::operation::create_browser_settings::CreateBrowserSettingsInput).
189    pub fn build(
190        self,
191    ) -> ::std::result::Result<crate::operation::create_browser_settings::CreateBrowserSettingsInput, ::aws_smithy_types::error::operation::BuildError>
192    {
193        ::std::result::Result::Ok(crate::operation::create_browser_settings::CreateBrowserSettingsInput {
194            tags: self.tags,
195            customer_managed_key: self.customer_managed_key,
196            additional_encryption_context: self.additional_encryption_context,
197            browser_policy: self.browser_policy,
198            client_token: self.client_token,
199            web_content_filtering_policy: self.web_content_filtering_policy,
200        })
201    }
202}
203impl ::std::fmt::Debug for CreateBrowserSettingsInputBuilder {
204    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
205        let mut formatter = f.debug_struct("CreateBrowserSettingsInputBuilder");
206        formatter.field("tags", &"*** Sensitive Data Redacted ***");
207        formatter.field("customer_managed_key", &self.customer_managed_key);
208        formatter.field("additional_encryption_context", &self.additional_encryption_context);
209        formatter.field("browser_policy", &"*** Sensitive Data Redacted ***");
210        formatter.field("client_token", &self.client_token);
211        formatter.field("web_content_filtering_policy", &self.web_content_filtering_policy);
212        formatter.finish()
213    }
214}