aws-sdk-identitystore 0.24.0

AWS SDK for AWS SSO Identity Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn serialize_structure_crate_input_create_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGroupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_1) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_1.as_str());
    }
    if let Some(var_2) = &input.display_name {
        object.key("DisplayName").string(var_2.as_str());
    }
    if let Some(var_3) = &input.description {
        object.key("Description").string(var_3.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_group_membership_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateGroupMembershipInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_4) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_4.as_str());
    }
    if let Some(var_5) = &input.group_id {
        object.key("GroupId").string(var_5.as_str());
    }
    if let Some(var_6) = &input.member_id {
        #[allow(unused_mut)]
        let mut object_7 = object.key("MemberId").start_object();
        crate::json_ser::serialize_union_crate_model_member_id(&mut object_7, var_6)?;
        object_7.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_create_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::CreateUserInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_8) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_8.as_str());
    }
    if let Some(var_9) = &input.user_name {
        object.key("UserName").string(var_9.as_str());
    }
    if let Some(var_10) = &input.name {
        #[allow(unused_mut)]
        let mut object_11 = object.key("Name").start_object();
        crate::json_ser::serialize_structure_crate_model_name(&mut object_11, var_10)?;
        object_11.finish();
    }
    if let Some(var_12) = &input.display_name {
        object.key("DisplayName").string(var_12.as_str());
    }
    if let Some(var_13) = &input.nick_name {
        object.key("NickName").string(var_13.as_str());
    }
    if let Some(var_14) = &input.profile_url {
        object.key("ProfileUrl").string(var_14.as_str());
    }
    if let Some(var_15) = &input.emails {
        let mut array_16 = object.key("Emails").start_array();
        for item_17 in var_15 {
            {
                #[allow(unused_mut)]
                let mut object_18 = array_16.value().start_object();
                crate::json_ser::serialize_structure_crate_model_email(&mut object_18, item_17)?;
                object_18.finish();
            }
        }
        array_16.finish();
    }
    if let Some(var_19) = &input.addresses {
        let mut array_20 = object.key("Addresses").start_array();
        for item_21 in var_19 {
            {
                #[allow(unused_mut)]
                let mut object_22 = array_20.value().start_object();
                crate::json_ser::serialize_structure_crate_model_address(&mut object_22, item_21)?;
                object_22.finish();
            }
        }
        array_20.finish();
    }
    if let Some(var_23) = &input.phone_numbers {
        let mut array_24 = object.key("PhoneNumbers").start_array();
        for item_25 in var_23 {
            {
                #[allow(unused_mut)]
                let mut object_26 = array_24.value().start_object();
                crate::json_ser::serialize_structure_crate_model_phone_number(
                    &mut object_26,
                    item_25,
                )?;
                object_26.finish();
            }
        }
        array_24.finish();
    }
    if let Some(var_27) = &input.user_type {
        object.key("UserType").string(var_27.as_str());
    }
    if let Some(var_28) = &input.title {
        object.key("Title").string(var_28.as_str());
    }
    if let Some(var_29) = &input.preferred_language {
        object.key("PreferredLanguage").string(var_29.as_str());
    }
    if let Some(var_30) = &input.locale {
        object.key("Locale").string(var_30.as_str());
    }
    if let Some(var_31) = &input.timezone {
        object.key("Timezone").string(var_31.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteGroupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_32) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_32.as_str());
    }
    if let Some(var_33) = &input.group_id {
        object.key("GroupId").string(var_33.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_group_membership_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteGroupMembershipInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_34) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_34.as_str());
    }
    if let Some(var_35) = &input.membership_id {
        object.key("MembershipId").string(var_35.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_delete_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DeleteUserInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_36) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_36.as_str());
    }
    if let Some(var_37) = &input.user_id {
        object.key("UserId").string(var_37.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGroupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_38) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_38.as_str());
    }
    if let Some(var_39) = &input.group_id {
        object.key("GroupId").string(var_39.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_group_membership_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeGroupMembershipInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_40) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_40.as_str());
    }
    if let Some(var_41) = &input.membership_id {
        object.key("MembershipId").string(var_41.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_describe_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::DescribeUserInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_42) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_42.as_str());
    }
    if let Some(var_43) = &input.user_id {
        object.key("UserId").string(var_43.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_group_id_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetGroupIdInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_44) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_44.as_str());
    }
    if let Some(var_45) = &input.alternate_identifier {
        #[allow(unused_mut)]
        let mut object_46 = object.key("AlternateIdentifier").start_object();
        crate::json_ser::serialize_union_crate_model_alternate_identifier(&mut object_46, var_45)?;
        object_46.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_group_membership_id_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetGroupMembershipIdInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_47) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_47.as_str());
    }
    if let Some(var_48) = &input.group_id {
        object.key("GroupId").string(var_48.as_str());
    }
    if let Some(var_49) = &input.member_id {
        #[allow(unused_mut)]
        let mut object_50 = object.key("MemberId").start_object();
        crate::json_ser::serialize_union_crate_model_member_id(&mut object_50, var_49)?;
        object_50.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_get_user_id_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::GetUserIdInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_51) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_51.as_str());
    }
    if let Some(var_52) = &input.alternate_identifier {
        #[allow(unused_mut)]
        let mut object_53 = object.key("AlternateIdentifier").start_object();
        crate::json_ser::serialize_union_crate_model_alternate_identifier(&mut object_53, var_52)?;
        object_53.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_is_member_in_groups_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::IsMemberInGroupsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_54) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_54.as_str());
    }
    if let Some(var_55) = &input.member_id {
        #[allow(unused_mut)]
        let mut object_56 = object.key("MemberId").start_object();
        crate::json_ser::serialize_union_crate_model_member_id(&mut object_56, var_55)?;
        object_56.finish();
    }
    if let Some(var_57) = &input.group_ids {
        let mut array_58 = object.key("GroupIds").start_array();
        for item_59 in var_57 {
            {
                array_58.value().string(item_59.as_str());
            }
        }
        array_58.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_group_memberships_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListGroupMembershipsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_60) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_60.as_str());
    }
    if let Some(var_61) = &input.group_id {
        object.key("GroupId").string(var_61.as_str());
    }
    if let Some(var_62) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_62).into()),
        );
    }
    if let Some(var_63) = &input.next_token {
        object.key("NextToken").string(var_63.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_group_memberships_for_member_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListGroupMembershipsForMemberInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_64) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_64.as_str());
    }
    if let Some(var_65) = &input.member_id {
        #[allow(unused_mut)]
        let mut object_66 = object.key("MemberId").start_object();
        crate::json_ser::serialize_union_crate_model_member_id(&mut object_66, var_65)?;
        object_66.finish();
    }
    if let Some(var_67) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_67).into()),
        );
    }
    if let Some(var_68) = &input.next_token {
        object.key("NextToken").string(var_68.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_groups_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListGroupsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_69) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_69.as_str());
    }
    if let Some(var_70) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_70).into()),
        );
    }
    if let Some(var_71) = &input.next_token {
        object.key("NextToken").string(var_71.as_str());
    }
    if let Some(var_72) = &input.filters {
        let mut array_73 = object.key("Filters").start_array();
        for item_74 in var_72 {
            {
                #[allow(unused_mut)]
                let mut object_75 = array_73.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_75, item_74)?;
                object_75.finish();
            }
        }
        array_73.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_list_users_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::ListUsersInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_76) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_76.as_str());
    }
    if let Some(var_77) = &input.max_results {
        object.key("MaxResults").number(
            #[allow(clippy::useless_conversion)]
            aws_smithy_types::Number::NegInt((*var_77).into()),
        );
    }
    if let Some(var_78) = &input.next_token {
        object.key("NextToken").string(var_78.as_str());
    }
    if let Some(var_79) = &input.filters {
        let mut array_80 = object.key("Filters").start_array();
        for item_81 in var_79 {
            {
                #[allow(unused_mut)]
                let mut object_82 = array_80.value().start_object();
                crate::json_ser::serialize_structure_crate_model_filter(&mut object_82, item_81)?;
                object_82.finish();
            }
        }
        array_80.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_group_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateGroupInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_83) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_83.as_str());
    }
    if let Some(var_84) = &input.group_id {
        object.key("GroupId").string(var_84.as_str());
    }
    if let Some(var_85) = &input.operations {
        let mut array_86 = object.key("Operations").start_array();
        for item_87 in var_85 {
            {
                #[allow(unused_mut)]
                let mut object_88 = array_86.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_operation(
                    &mut object_88,
                    item_87,
                )?;
                object_88.finish();
            }
        }
        array_86.finish();
    }
    Ok(())
}

pub fn serialize_structure_crate_input_update_user_input(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::input::UpdateUserInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_89) = &input.identity_store_id {
        object.key("IdentityStoreId").string(var_89.as_str());
    }
    if let Some(var_90) = &input.user_id {
        object.key("UserId").string(var_90.as_str());
    }
    if let Some(var_91) = &input.operations {
        let mut array_92 = object.key("Operations").start_array();
        for item_93 in var_91 {
            {
                #[allow(unused_mut)]
                let mut object_94 = array_92.value().start_object();
                crate::json_ser::serialize_structure_crate_model_attribute_operation(
                    &mut object_94,
                    item_93,
                )?;
                object_94.finish();
            }
        }
        array_92.finish();
    }
    Ok(())
}

pub fn serialize_union_crate_model_member_id(
    object_7: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::MemberId,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    match input {
        crate::model::MemberId::UserId(inner) => {
            object_7.key("UserId").string(inner.as_str());
        }
        crate::model::MemberId::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant("MemberId"),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_name(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Name,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_95) = &input.formatted {
        object.key("Formatted").string(var_95.as_str());
    }
    if let Some(var_96) = &input.family_name {
        object.key("FamilyName").string(var_96.as_str());
    }
    if let Some(var_97) = &input.given_name {
        object.key("GivenName").string(var_97.as_str());
    }
    if let Some(var_98) = &input.middle_name {
        object.key("MiddleName").string(var_98.as_str());
    }
    if let Some(var_99) = &input.honorific_prefix {
        object.key("HonorificPrefix").string(var_99.as_str());
    }
    if let Some(var_100) = &input.honorific_suffix {
        object.key("HonorificSuffix").string(var_100.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_email(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Email,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_101) = &input.value {
        object.key("Value").string(var_101.as_str());
    }
    if let Some(var_102) = &input.r#type {
        object.key("Type").string(var_102.as_str());
    }
    if input.primary {
        object.key("Primary").boolean(input.primary);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_address(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Address,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_103) = &input.street_address {
        object.key("StreetAddress").string(var_103.as_str());
    }
    if let Some(var_104) = &input.locality {
        object.key("Locality").string(var_104.as_str());
    }
    if let Some(var_105) = &input.region {
        object.key("Region").string(var_105.as_str());
    }
    if let Some(var_106) = &input.postal_code {
        object.key("PostalCode").string(var_106.as_str());
    }
    if let Some(var_107) = &input.country {
        object.key("Country").string(var_107.as_str());
    }
    if let Some(var_108) = &input.formatted {
        object.key("Formatted").string(var_108.as_str());
    }
    if let Some(var_109) = &input.r#type {
        object.key("Type").string(var_109.as_str());
    }
    if input.primary {
        object.key("Primary").boolean(input.primary);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_phone_number(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::PhoneNumber,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_110) = &input.value {
        object.key("Value").string(var_110.as_str());
    }
    if let Some(var_111) = &input.r#type {
        object.key("Type").string(var_111.as_str());
    }
    if input.primary {
        object.key("Primary").boolean(input.primary);
    }
    Ok(())
}

pub fn serialize_union_crate_model_alternate_identifier(
    object_46: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AlternateIdentifier,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    match input {
        crate::model::AlternateIdentifier::ExternalId(inner) => {
            #[allow(unused_mut)]
            let mut object_112 = object_46.key("ExternalId").start_object();
            crate::json_ser::serialize_structure_crate_model_external_id(&mut object_112, inner)?;
            object_112.finish();
        }
        crate::model::AlternateIdentifier::UniqueAttribute(inner) => {
            #[allow(unused_mut)]
            let mut object_113 = object_46.key("UniqueAttribute").start_object();
            crate::json_ser::serialize_structure_crate_model_unique_attribute(
                &mut object_113,
                inner,
            )?;
            object_113.finish();
        }
        crate::model::AlternateIdentifier::Unknown => {
            return Err(
                aws_smithy_http::operation::error::SerializationError::unknown_variant(
                    "AlternateIdentifier",
                ),
            )
        }
    }
    Ok(())
}

pub fn serialize_structure_crate_model_filter(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::Filter,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_114) = &input.attribute_path {
        object.key("AttributePath").string(var_114.as_str());
    }
    if let Some(var_115) = &input.attribute_value {
        object.key("AttributeValue").string(var_115.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_attribute_operation(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::AttributeOperation,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_116) = &input.attribute_path {
        object.key("AttributePath").string(var_116.as_str());
    }
    if let Some(var_117) = &input.attribute_value {
        object.key("AttributeValue").document(var_117);
    }
    Ok(())
}

pub fn serialize_structure_crate_model_external_id(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::ExternalId,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_118) = &input.issuer {
        object.key("Issuer").string(var_118.as_str());
    }
    if let Some(var_119) = &input.id {
        object.key("Id").string(var_119.as_str());
    }
    Ok(())
}

pub fn serialize_structure_crate_model_unique_attribute(
    object: &mut aws_smithy_json::serialize::JsonObjectWriter,
    input: &crate::model::UniqueAttribute,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
    if let Some(var_120) = &input.attribute_path {
        object.key("AttributePath").string(var_120.as_str());
    }
    if let Some(var_121) = &input.attribute_value {
        object.key("AttributeValue").document(var_121);
    }
    Ok(())
}