1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The browser settings resource that can be associated with a web portal. Once associated with a web portal, browser settings control how the browser will behave once a user starts a streaming session for the web portal.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct BrowserSettings {
    /// <p>The ARN of the browser settings.</p>
    pub browser_settings_arn: ::std::string::String,
    /// <p>A list of web portal ARNs that this browser settings is associated with.</p>
    pub associated_portal_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
    pub browser_policy: ::std::option::Option<::std::string::String>,
    /// <p>The customer managed key used to encrypt sensitive information in the browser settings.</p>
    pub customer_managed_key: ::std::option::Option<::std::string::String>,
    /// <p>The additional encryption context of the browser settings.</p>
    pub additional_encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl BrowserSettings {
    /// <p>The ARN of the browser settings.</p>
    pub fn browser_settings_arn(&self) -> &str {
        use std::ops::Deref;
        self.browser_settings_arn.deref()
    }
    /// <p>A list of web portal ARNs that this browser settings is associated with.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.associated_portal_arns.is_none()`.
    pub fn associated_portal_arns(&self) -> &[::std::string::String] {
        self.associated_portal_arns.as_deref().unwrap_or_default()
    }
    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
    pub fn browser_policy(&self) -> ::std::option::Option<&str> {
        self.browser_policy.as_deref()
    }
    /// <p>The customer managed key used to encrypt sensitive information in the browser settings.</p>
    pub fn customer_managed_key(&self) -> ::std::option::Option<&str> {
        self.customer_managed_key.as_deref()
    }
    /// <p>The additional encryption context of the browser settings.</p>
    pub fn additional_encryption_context(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.additional_encryption_context.as_ref()
    }
}
impl ::std::fmt::Debug for BrowserSettings {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("BrowserSettings");
        formatter.field("browser_settings_arn", &self.browser_settings_arn);
        formatter.field("associated_portal_arns", &self.associated_portal_arns);
        formatter.field("browser_policy", &"*** Sensitive Data Redacted ***");
        formatter.field("customer_managed_key", &self.customer_managed_key);
        formatter.field("additional_encryption_context", &self.additional_encryption_context);
        formatter.finish()
    }
}
impl BrowserSettings {
    /// Creates a new builder-style object to manufacture [`BrowserSettings`](crate::types::BrowserSettings).
    pub fn builder() -> crate::types::builders::BrowserSettingsBuilder {
        crate::types::builders::BrowserSettingsBuilder::default()
    }
}

/// A builder for [`BrowserSettings`](crate::types::BrowserSettings).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct BrowserSettingsBuilder {
    pub(crate) browser_settings_arn: ::std::option::Option<::std::string::String>,
    pub(crate) associated_portal_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) browser_policy: ::std::option::Option<::std::string::String>,
    pub(crate) customer_managed_key: ::std::option::Option<::std::string::String>,
    pub(crate) additional_encryption_context: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl BrowserSettingsBuilder {
    /// <p>The ARN of the browser settings.</p>
    /// This field is required.
    pub fn browser_settings_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.browser_settings_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the browser settings.</p>
    pub fn set_browser_settings_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.browser_settings_arn = input;
        self
    }
    /// <p>The ARN of the browser settings.</p>
    pub fn get_browser_settings_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.browser_settings_arn
    }
    /// Appends an item to `associated_portal_arns`.
    ///
    /// To override the contents of this collection use [`set_associated_portal_arns`](Self::set_associated_portal_arns).
    ///
    /// <p>A list of web portal ARNs that this browser settings is associated with.</p>
    pub fn associated_portal_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.associated_portal_arns.unwrap_or_default();
        v.push(input.into());
        self.associated_portal_arns = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of web portal ARNs that this browser settings is associated with.</p>
    pub fn set_associated_portal_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.associated_portal_arns = input;
        self
    }
    /// <p>A list of web portal ARNs that this browser settings is associated with.</p>
    pub fn get_associated_portal_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.associated_portal_arns
    }
    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
    pub fn browser_policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.browser_policy = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
    pub fn set_browser_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.browser_policy = input;
        self
    }
    /// <p>A JSON string containing Chrome Enterprise policies that will be applied to all streaming sessions.</p>
    pub fn get_browser_policy(&self) -> &::std::option::Option<::std::string::String> {
        &self.browser_policy
    }
    /// <p>The customer managed key used to encrypt sensitive information in the browser settings.</p>
    pub fn customer_managed_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.customer_managed_key = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The customer managed key used to encrypt sensitive information in the browser settings.</p>
    pub fn set_customer_managed_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.customer_managed_key = input;
        self
    }
    /// <p>The customer managed key used to encrypt sensitive information in the browser settings.</p>
    pub fn get_customer_managed_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.customer_managed_key
    }
    /// Adds a key-value pair to `additional_encryption_context`.
    ///
    /// To override the contents of this collection use [`set_additional_encryption_context`](Self::set_additional_encryption_context).
    ///
    /// <p>The additional encryption context of the browser settings.</p>
    pub fn additional_encryption_context(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.additional_encryption_context.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.additional_encryption_context = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The additional encryption context of the browser settings.</p>
    pub fn set_additional_encryption_context(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.additional_encryption_context = input;
        self
    }
    /// <p>The additional encryption context of the browser settings.</p>
    pub fn get_additional_encryption_context(
        &self,
    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.additional_encryption_context
    }
    /// Consumes the builder and constructs a [`BrowserSettings`](crate::types::BrowserSettings).
    /// This method will fail if any of the following fields are not set:
    /// - [`browser_settings_arn`](crate::types::builders::BrowserSettingsBuilder::browser_settings_arn)
    pub fn build(self) -> ::std::result::Result<crate::types::BrowserSettings, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::BrowserSettings {
            browser_settings_arn: self.browser_settings_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "browser_settings_arn",
                    "browser_settings_arn was not specified but it is required when building BrowserSettings",
                )
            })?,
            associated_portal_arns: self.associated_portal_arns,
            browser_policy: self.browser_policy,
            customer_managed_key: self.customer_managed_key,
            additional_encryption_context: self.additional_encryption_context,
        })
    }
}
impl ::std::fmt::Debug for BrowserSettingsBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("BrowserSettingsBuilder");
        formatter.field("browser_settings_arn", &self.browser_settings_arn);
        formatter.field("associated_portal_arns", &self.associated_portal_arns);
        formatter.field("browser_policy", &"*** Sensitive Data Redacted ***");
        formatter.field("customer_managed_key", &self.customer_managed_key);
        formatter.field("additional_encryption_context", &self.additional_encryption_context);
        formatter.finish()
    }
}