#[non_exhaustive]
pub enum AuthenticationProviderTypes {
AwsSso,
Saml,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against AuthenticationProviderTypes
, it is important to ensure
your code is forward-compatible. That is, if a match arm handles a case for a
feature that is supported by the service but has not been represented as an enum
variant in a current version of SDK, your code should continue to work when you
upgrade SDK to a future version in which the enum does include a variant for that
feature.
Here is an example of how you can make a match expression forward-compatible:
# let authenticationprovidertypes = unimplemented!();
match authenticationprovidertypes {
AuthenticationProviderTypes::AwsSso => { /* ... */ },
AuthenticationProviderTypes::Saml => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when authenticationprovidertypes
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant AuthenticationProviderTypes::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
AuthenticationProviderTypes::Unknown(UnknownVariantValue("NewFeature".to_owned()))
and calling as_str
on it yields "NewFeature"
.
This match expression is forward-compatible when executed with a newer
version of SDK where the variant AuthenticationProviderTypes::NewFeature
is defined.
Specifically, when authenticationprovidertypes
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on AuthenticationProviderTypes::NewFeature
also yielding "NewFeature"
.
Explicitly matching on the Unknown
variant should
be avoided for two reasons:
- The inner data
UnknownVariantValue
is opaque, and no further information can be extracted. - It might inadvertently shadow other intended match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AwsSso
Indicates that AMG workspace has AWS SSO enabled as its authentication provider.
Saml
Indicates that the AMG workspace has SAML enabled as its authentication provider.
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl AuthenticationProviderTypes
impl AuthenticationProviderTypes
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the &str
value of the enum member.
Examples found in repository?
More examples
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
pub fn serialize_structure_crate_input_create_workspace_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateWorkspaceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_1) = &input.account_access_type {
object.key("accountAccessType").string(var_1.as_str());
}
if let Some(var_2) = &input.authentication_providers {
let mut array_3 = object.key("authenticationProviders").start_array();
for item_4 in var_2 {
{
array_3.value().string(item_4.as_str());
}
}
array_3.finish();
}
if let Some(var_5) = &input.client_token {
object.key("clientToken").string(var_5.as_str());
}
if let Some(var_6) = &input.organization_role_name {
object.key("organizationRoleName").string(var_6.as_str());
}
if let Some(var_7) = &input.permission_type {
object.key("permissionType").string(var_7.as_str());
}
if let Some(var_8) = &input.stack_set_name {
object.key("stackSetName").string(var_8.as_str());
}
if let Some(var_9) = &input.tags {
#[allow(unused_mut)]
let mut object_10 = object.key("tags").start_object();
for (key_11, value_12) in var_9 {
{
object_10.key(key_11.as_str()).string(value_12.as_str());
}
}
object_10.finish();
}
if let Some(var_13) = &input.workspace_data_sources {
let mut array_14 = object.key("workspaceDataSources").start_array();
for item_15 in var_13 {
{
array_14.value().string(item_15.as_str());
}
}
array_14.finish();
}
if let Some(var_16) = &input.workspace_description {
object.key("workspaceDescription").string(var_16.as_str());
}
if let Some(var_17) = &input.workspace_name {
object.key("workspaceName").string(var_17.as_str());
}
if let Some(var_18) = &input.workspace_notification_destinations {
let mut array_19 = object
.key("workspaceNotificationDestinations")
.start_array();
for item_20 in var_18 {
{
array_19.value().string(item_20.as_str());
}
}
array_19.finish();
}
if let Some(var_21) = &input.workspace_organizational_units {
let mut array_22 = object.key("workspaceOrganizationalUnits").start_array();
for item_23 in var_21 {
{
array_22.value().string(item_23.as_str());
}
}
array_22.finish();
}
if let Some(var_24) = &input.workspace_role_arn {
object.key("workspaceRoleArn").string(var_24.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_create_workspace_api_key_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateWorkspaceApiKeyInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_25) = &input.key_name {
object.key("keyName").string(var_25.as_str());
}
if let Some(var_26) = &input.key_role {
object.key("keyRole").string(var_26.as_str());
}
if let Some(var_27) = &input.seconds_to_live {
object.key("secondsToLive").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_27).into()),
);
}
Ok(())
}
pub fn serialize_structure_crate_input_tag_resource_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::TagResourceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_28) = &input.tags {
#[allow(unused_mut)]
let mut object_29 = object.key("tags").start_object();
for (key_30, value_31) in var_28 {
{
object_29.key(key_30.as_str()).string(value_31.as_str());
}
}
object_29.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_update_permissions_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdatePermissionsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_32) = &input.update_instruction_batch {
let mut array_33 = object.key("updateInstructionBatch").start_array();
for item_34 in var_32 {
{
#[allow(unused_mut)]
let mut object_35 = array_33.value().start_object();
crate::json_ser::serialize_structure_crate_model_update_instruction(
&mut object_35,
item_34,
)?;
object_35.finish();
}
}
array_33.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_update_workspace_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateWorkspaceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_36) = &input.account_access_type {
object.key("accountAccessType").string(var_36.as_str());
}
if let Some(var_37) = &input.organization_role_name {
object.key("organizationRoleName").string(var_37.as_str());
}
if let Some(var_38) = &input.permission_type {
object.key("permissionType").string(var_38.as_str());
}
if let Some(var_39) = &input.stack_set_name {
object.key("stackSetName").string(var_39.as_str());
}
if let Some(var_40) = &input.workspace_data_sources {
let mut array_41 = object.key("workspaceDataSources").start_array();
for item_42 in var_40 {
{
array_41.value().string(item_42.as_str());
}
}
array_41.finish();
}
if let Some(var_43) = &input.workspace_description {
object.key("workspaceDescription").string(var_43.as_str());
}
if let Some(var_44) = &input.workspace_name {
object.key("workspaceName").string(var_44.as_str());
}
if let Some(var_45) = &input.workspace_notification_destinations {
let mut array_46 = object
.key("workspaceNotificationDestinations")
.start_array();
for item_47 in var_45 {
{
array_46.value().string(item_47.as_str());
}
}
array_46.finish();
}
if let Some(var_48) = &input.workspace_organizational_units {
let mut array_49 = object.key("workspaceOrganizationalUnits").start_array();
for item_50 in var_48 {
{
array_49.value().string(item_50.as_str());
}
}
array_49.finish();
}
if let Some(var_51) = &input.workspace_role_arn {
object.key("workspaceRoleArn").string(var_51.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_update_workspace_authentication_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateWorkspaceAuthenticationInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_52) = &input.authentication_providers {
let mut array_53 = object.key("authenticationProviders").start_array();
for item_54 in var_52 {
{
array_53.value().string(item_54.as_str());
}
}
array_53.finish();
}
if let Some(var_55) = &input.saml_configuration {
#[allow(unused_mut)]
let mut object_56 = object.key("samlConfiguration").start_object();
crate::json_ser::serialize_structure_crate_model_saml_configuration(
&mut object_56,
var_55,
)?;
object_56.finish();
}
Ok(())
}
Trait Implementations§
source§impl AsRef<str> for AuthenticationProviderTypes
impl AsRef<str> for AuthenticationProviderTypes
source§impl Clone for AuthenticationProviderTypes
impl Clone for AuthenticationProviderTypes
source§fn clone(&self) -> AuthenticationProviderTypes
fn clone(&self) -> AuthenticationProviderTypes
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for AuthenticationProviderTypes
impl Debug for AuthenticationProviderTypes
source§impl From<&str> for AuthenticationProviderTypes
impl From<&str> for AuthenticationProviderTypes
source§impl Hash for AuthenticationProviderTypes
impl Hash for AuthenticationProviderTypes
source§impl Ord for AuthenticationProviderTypes
impl Ord for AuthenticationProviderTypes
source§fn cmp(&self, other: &AuthenticationProviderTypes) -> Ordering
fn cmp(&self, other: &AuthenticationProviderTypes) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<AuthenticationProviderTypes> for AuthenticationProviderTypes
impl PartialEq<AuthenticationProviderTypes> for AuthenticationProviderTypes
source§fn eq(&self, other: &AuthenticationProviderTypes) -> bool
fn eq(&self, other: &AuthenticationProviderTypes) -> bool
source§impl PartialOrd<AuthenticationProviderTypes> for AuthenticationProviderTypes
impl PartialOrd<AuthenticationProviderTypes> for AuthenticationProviderTypes
source§fn partial_cmp(&self, other: &AuthenticationProviderTypes) -> Option<Ordering>
fn partial_cmp(&self, other: &AuthenticationProviderTypes) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for AuthenticationProviderTypes
impl StructuralEq for AuthenticationProviderTypes
impl StructuralPartialEq for AuthenticationProviderTypes
Auto Trait Implementations§
impl RefUnwindSafe for AuthenticationProviderTypes
impl Send for AuthenticationProviderTypes
impl Sync for AuthenticationProviderTypes
impl Unpin for AuthenticationProviderTypes
impl UnwindSafe for AuthenticationProviderTypes
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.