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 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutAccessControlRuleInput {
/// <p>The rule name.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The rule effect.</p>
pub effect: ::std::option::Option<crate::types::AccessControlRuleEffect>,
/// <p>The rule description.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>IPv4 CIDR ranges to include in the rule.</p>
pub ip_ranges: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>IPv4 CIDR ranges to exclude from the rule.</p>
pub not_ip_ranges: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Access protocol actions to include in the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Access protocol actions to exclude from the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub not_actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>User IDs to include in the rule.</p>
pub user_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>User IDs to exclude from the rule.</p>
pub not_user_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The identifier of the organization.</p>
pub organization_id: ::std::option::Option<::std::string::String>,
/// <p>Impersonation role IDs to include in the rule.</p>
pub impersonation_role_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Impersonation role IDs to exclude from the rule.</p>
pub not_impersonation_role_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PutAccessControlRuleInput {
/// <p>The rule name.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The rule effect.</p>
pub fn effect(&self) -> ::std::option::Option<&crate::types::AccessControlRuleEffect> {
self.effect.as_ref()
}
/// <p>The rule description.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>IPv4 CIDR ranges to include in the rule.</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 `.ip_ranges.is_none()`.
pub fn ip_ranges(&self) -> &[::std::string::String] {
self.ip_ranges.as_deref().unwrap_or_default()
}
/// <p>IPv4 CIDR ranges to exclude from the rule.</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 `.not_ip_ranges.is_none()`.
pub fn not_ip_ranges(&self) -> &[::std::string::String] {
self.not_ip_ranges.as_deref().unwrap_or_default()
}
/// <p>Access protocol actions to include in the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</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 `.actions.is_none()`.
pub fn actions(&self) -> &[::std::string::String] {
self.actions.as_deref().unwrap_or_default()
}
/// <p>Access protocol actions to exclude from the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</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 `.not_actions.is_none()`.
pub fn not_actions(&self) -> &[::std::string::String] {
self.not_actions.as_deref().unwrap_or_default()
}
/// <p>User IDs to include in the rule.</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 `.user_ids.is_none()`.
pub fn user_ids(&self) -> &[::std::string::String] {
self.user_ids.as_deref().unwrap_or_default()
}
/// <p>User IDs to exclude from the rule.</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 `.not_user_ids.is_none()`.
pub fn not_user_ids(&self) -> &[::std::string::String] {
self.not_user_ids.as_deref().unwrap_or_default()
}
/// <p>The identifier of the organization.</p>
pub fn organization_id(&self) -> ::std::option::Option<&str> {
self.organization_id.as_deref()
}
/// <p>Impersonation role IDs to include in the rule.</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 `.impersonation_role_ids.is_none()`.
pub fn impersonation_role_ids(&self) -> &[::std::string::String] {
self.impersonation_role_ids.as_deref().unwrap_or_default()
}
/// <p>Impersonation role IDs to exclude from the rule.</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 `.not_impersonation_role_ids.is_none()`.
pub fn not_impersonation_role_ids(&self) -> &[::std::string::String] {
self.not_impersonation_role_ids.as_deref().unwrap_or_default()
}
}
impl PutAccessControlRuleInput {
/// Creates a new builder-style object to manufacture [`PutAccessControlRuleInput`](crate::operation::put_access_control_rule::PutAccessControlRuleInput).
pub fn builder() -> crate::operation::put_access_control_rule::builders::PutAccessControlRuleInputBuilder {
crate::operation::put_access_control_rule::builders::PutAccessControlRuleInputBuilder::default()
}
}
/// A builder for [`PutAccessControlRuleInput`](crate::operation::put_access_control_rule::PutAccessControlRuleInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PutAccessControlRuleInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) effect: ::std::option::Option<crate::types::AccessControlRuleEffect>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) ip_ranges: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) not_ip_ranges: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) not_actions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) user_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) not_user_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) organization_id: ::std::option::Option<::std::string::String>,
pub(crate) impersonation_role_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) not_impersonation_role_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PutAccessControlRuleInputBuilder {
/// <p>The rule name.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The rule name.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The rule name.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The rule effect.</p>
/// This field is required.
pub fn effect(mut self, input: crate::types::AccessControlRuleEffect) -> Self {
self.effect = ::std::option::Option::Some(input);
self
}
/// <p>The rule effect.</p>
pub fn set_effect(mut self, input: ::std::option::Option<crate::types::AccessControlRuleEffect>) -> Self {
self.effect = input;
self
}
/// <p>The rule effect.</p>
pub fn get_effect(&self) -> &::std::option::Option<crate::types::AccessControlRuleEffect> {
&self.effect
}
/// <p>The rule description.</p>
/// This field is required.
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The rule description.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The rule description.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// Appends an item to `ip_ranges`.
///
/// To override the contents of this collection use [`set_ip_ranges`](Self::set_ip_ranges).
///
/// <p>IPv4 CIDR ranges to include in the rule.</p>
pub fn ip_ranges(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.ip_ranges.unwrap_or_default();
v.push(input.into());
self.ip_ranges = ::std::option::Option::Some(v);
self
}
/// <p>IPv4 CIDR ranges to include in the rule.</p>
pub fn set_ip_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.ip_ranges = input;
self
}
/// <p>IPv4 CIDR ranges to include in the rule.</p>
pub fn get_ip_ranges(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.ip_ranges
}
/// Appends an item to `not_ip_ranges`.
///
/// To override the contents of this collection use [`set_not_ip_ranges`](Self::set_not_ip_ranges).
///
/// <p>IPv4 CIDR ranges to exclude from the rule.</p>
pub fn not_ip_ranges(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.not_ip_ranges.unwrap_or_default();
v.push(input.into());
self.not_ip_ranges = ::std::option::Option::Some(v);
self
}
/// <p>IPv4 CIDR ranges to exclude from the rule.</p>
pub fn set_not_ip_ranges(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.not_ip_ranges = input;
self
}
/// <p>IPv4 CIDR ranges to exclude from the rule.</p>
pub fn get_not_ip_ranges(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.not_ip_ranges
}
/// Appends an item to `actions`.
///
/// To override the contents of this collection use [`set_actions`](Self::set_actions).
///
/// <p>Access protocol actions to include in the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.actions.unwrap_or_default();
v.push(input.into());
self.actions = ::std::option::Option::Some(v);
self
}
/// <p>Access protocol actions to include in the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.actions = input;
self
}
/// <p>Access protocol actions to include in the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.actions
}
/// Appends an item to `not_actions`.
///
/// To override the contents of this collection use [`set_not_actions`](Self::set_not_actions).
///
/// <p>Access protocol actions to exclude from the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn not_actions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.not_actions.unwrap_or_default();
v.push(input.into());
self.not_actions = ::std::option::Option::Some(v);
self
}
/// <p>Access protocol actions to exclude from the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn set_not_actions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.not_actions = input;
self
}
/// <p>Access protocol actions to exclude from the rule. Valid values include <code>ActiveSync</code>, <code>AutoDiscover</code>, <code>EWS</code>, <code>IMAP</code>, <code>SMTP</code>, <code>WindowsOutlook</code>, and <code>WebMail</code>.</p>
pub fn get_not_actions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.not_actions
}
/// Appends an item to `user_ids`.
///
/// To override the contents of this collection use [`set_user_ids`](Self::set_user_ids).
///
/// <p>User IDs to include in the rule.</p>
pub fn user_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.user_ids.unwrap_or_default();
v.push(input.into());
self.user_ids = ::std::option::Option::Some(v);
self
}
/// <p>User IDs to include in the rule.</p>
pub fn set_user_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.user_ids = input;
self
}
/// <p>User IDs to include in the rule.</p>
pub fn get_user_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.user_ids
}
/// Appends an item to `not_user_ids`.
///
/// To override the contents of this collection use [`set_not_user_ids`](Self::set_not_user_ids).
///
/// <p>User IDs to exclude from the rule.</p>
pub fn not_user_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.not_user_ids.unwrap_or_default();
v.push(input.into());
self.not_user_ids = ::std::option::Option::Some(v);
self
}
/// <p>User IDs to exclude from the rule.</p>
pub fn set_not_user_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.not_user_ids = input;
self
}
/// <p>User IDs to exclude from the rule.</p>
pub fn get_not_user_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.not_user_ids
}
/// <p>The identifier of the organization.</p>
/// This field is required.
pub fn organization_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.organization_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the organization.</p>
pub fn set_organization_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.organization_id = input;
self
}
/// <p>The identifier of the organization.</p>
pub fn get_organization_id(&self) -> &::std::option::Option<::std::string::String> {
&self.organization_id
}
/// Appends an item to `impersonation_role_ids`.
///
/// To override the contents of this collection use [`set_impersonation_role_ids`](Self::set_impersonation_role_ids).
///
/// <p>Impersonation role IDs to include in the rule.</p>
pub fn impersonation_role_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.impersonation_role_ids.unwrap_or_default();
v.push(input.into());
self.impersonation_role_ids = ::std::option::Option::Some(v);
self
}
/// <p>Impersonation role IDs to include in the rule.</p>
pub fn set_impersonation_role_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.impersonation_role_ids = input;
self
}
/// <p>Impersonation role IDs to include in the rule.</p>
pub fn get_impersonation_role_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.impersonation_role_ids
}
/// Appends an item to `not_impersonation_role_ids`.
///
/// To override the contents of this collection use [`set_not_impersonation_role_ids`](Self::set_not_impersonation_role_ids).
///
/// <p>Impersonation role IDs to exclude from the rule.</p>
pub fn not_impersonation_role_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.not_impersonation_role_ids.unwrap_or_default();
v.push(input.into());
self.not_impersonation_role_ids = ::std::option::Option::Some(v);
self
}
/// <p>Impersonation role IDs to exclude from the rule.</p>
pub fn set_not_impersonation_role_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.not_impersonation_role_ids = input;
self
}
/// <p>Impersonation role IDs to exclude from the rule.</p>
pub fn get_not_impersonation_role_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.not_impersonation_role_ids
}
/// Consumes the builder and constructs a [`PutAccessControlRuleInput`](crate::operation::put_access_control_rule::PutAccessControlRuleInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::put_access_control_rule::PutAccessControlRuleInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::put_access_control_rule::PutAccessControlRuleInput {
name: self.name,
effect: self.effect,
description: self.description,
ip_ranges: self.ip_ranges,
not_ip_ranges: self.not_ip_ranges,
actions: self.actions,
not_actions: self.not_actions,
user_ids: self.user_ids,
not_user_ids: self.not_user_ids,
organization_id: self.organization_id,
impersonation_role_ids: self.impersonation_role_ids,
not_impersonation_role_ids: self.not_impersonation_role_ids,
})
}
}