AWS SDK

AWS SDK

rev. aa190e630077955f0bc8f58dee6a16530c1e0578

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_resource_data_sync_organizational_unit.rs

@@ -0,1 +0,127 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The Organizations organizational unit data source for the sync.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ResourceDataSyncOrganizationalUnit {
           7  +
    /// <p>The Organizations unit ID data source for the sync.</p>
           8  +
    pub organizational_unit_id: ::std::option::Option<::std::string::String>,
           9  +
}
          10  +
impl ResourceDataSyncOrganizationalUnit {
          11  +
    /// <p>The Organizations unit ID data source for the sync.</p>
          12  +
    pub fn organizational_unit_id(&self) -> ::std::option::Option<&str> {
          13  +
        self.organizational_unit_id.as_deref()
          14  +
    }
          15  +
}
          16  +
static RESOURCEDATASYNCORGANIZATIONALUNIT_MEMBER_ORGANIZATIONAL_UNIT_ID: ::aws_smithy_schema::Schema<'static> =
          17  +
    ::aws_smithy_schema::Schema::new_member(
          18  +
        ::aws_smithy_schema::ShapeId::from_parts(
          19  +
            "com.amazonaws.ssm#ResourceDataSyncOrganizationalUnit$OrganizationalUnitId",
          20  +
            "com.amazonaws.ssm",
          21  +
            "ResourceDataSyncOrganizationalUnit",
          22  +
        ),
          23  +
        ::aws_smithy_schema::ShapeType::String,
          24  +
        "OrganizationalUnitId",
          25  +
        0,
          26  +
    );
          27  +
static RESOURCEDATASYNCORGANIZATIONALUNIT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          28  +
    ::aws_smithy_schema::ShapeId::from_parts(
          29  +
        "com.amazonaws.ssm#ResourceDataSyncOrganizationalUnit",
          30  +
        "com.amazonaws.ssm",
          31  +
        "ResourceDataSyncOrganizationalUnit",
          32  +
    ),
          33  +
    ::aws_smithy_schema::ShapeType::Structure,
          34  +
    &[&RESOURCEDATASYNCORGANIZATIONALUNIT_MEMBER_ORGANIZATIONAL_UNIT_ID],
          35  +
);
          36  +
impl ResourceDataSyncOrganizationalUnit {
          37  +
    /// The schema for this shape.
          38  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RESOURCEDATASYNCORGANIZATIONALUNIT_SCHEMA;
          39  +
}
          40  +
impl ::aws_smithy_schema::serde::SerializableStruct for ResourceDataSyncOrganizationalUnit {
          41  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          42  +
    fn serialize_members(
          43  +
        &self,
          44  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          45  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          46  +
        if let Some(ref val) = self.organizational_unit_id {
          47  +
            ser.write_string(&RESOURCEDATASYNCORGANIZATIONALUNIT_MEMBER_ORGANIZATIONAL_UNIT_ID, val)?;
          48  +
        }
          49  +
        Ok(())
          50  +
    }
          51  +
}
          52  +
impl ResourceDataSyncOrganizationalUnit {
          53  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          54  +
    pub fn deserialize(
          55  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          56  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          57  +
        #[allow(unused_variables, unused_mut)]
          58  +
        let mut builder = Self::builder();
          59  +
        #[allow(
          60  +
            unused_variables,
          61  +
            unreachable_code,
          62  +
            clippy::single_match,
          63  +
            clippy::match_single_binding,
          64  +
            clippy::diverging_sub_expression
          65  +
        )]
          66  +
        deserializer.read_struct(&RESOURCEDATASYNCORGANIZATIONALUNIT_SCHEMA, &mut |member, deser| {
          67  +
            match member.member_index() {
          68  +
                Some(0) => {
          69  +
                    if deser.is_null() {
          70  +
                        deser.read_null()?;
          71  +
                    } else {
          72  +
                        builder.organizational_unit_id = Some(deser.read_string(member)?);
          73  +
                    }
          74  +
                }
          75  +
                _ => {}
          76  +
            }
          77  +
            Ok(())
          78  +
        })?;
          79  +
        Ok(builder.build())
          80  +
    }
          81  +
}
          82  +
impl ResourceDataSyncOrganizationalUnit {
          83  +
    /// Deserializes this structure from a body deserializer and HTTP response.
          84  +
    pub fn deserialize_with_response(
          85  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          86  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
          87  +
        _status: u16,
          88  +
        _body: &[u8],
          89  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          90  +
        Self::deserialize(deserializer)
          91  +
    }
          92  +
}
          93  +
impl ResourceDataSyncOrganizationalUnit {
          94  +
    /// Creates a new builder-style object to manufacture [`ResourceDataSyncOrganizationalUnit`](crate::types::ResourceDataSyncOrganizationalUnit).
          95  +
    pub fn builder() -> crate::types::builders::ResourceDataSyncOrganizationalUnitBuilder {
          96  +
        crate::types::builders::ResourceDataSyncOrganizationalUnitBuilder::default()
          97  +
    }
          98  +
}
          99  +
         100  +
/// A builder for [`ResourceDataSyncOrganizationalUnit`](crate::types::ResourceDataSyncOrganizationalUnit).
         101  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         102  +
#[non_exhaustive]
         103  +
pub struct ResourceDataSyncOrganizationalUnitBuilder {
         104  +
    pub(crate) organizational_unit_id: ::std::option::Option<::std::string::String>,
         105  +
}
         106  +
impl ResourceDataSyncOrganizationalUnitBuilder {
         107  +
    /// <p>The Organizations unit ID data source for the sync.</p>
         108  +
    pub fn organizational_unit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         109  +
        self.organizational_unit_id = ::std::option::Option::Some(input.into());
         110  +
        self
         111  +
    }
         112  +
    /// <p>The Organizations unit ID data source for the sync.</p>
         113  +
    pub fn set_organizational_unit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         114  +
        self.organizational_unit_id = input;
         115  +
        self
         116  +
    }
         117  +
    /// <p>The Organizations unit ID data source for the sync.</p>
         118  +
    pub fn get_organizational_unit_id(&self) -> &::std::option::Option<::std::string::String> {
         119  +
        &self.organizational_unit_id
         120  +
    }
         121  +
    /// Consumes the builder and constructs a [`ResourceDataSyncOrganizationalUnit`](crate::types::ResourceDataSyncOrganizationalUnit).
         122  +
    pub fn build(self) -> crate::types::ResourceDataSyncOrganizationalUnit {
         123  +
        crate::types::ResourceDataSyncOrganizationalUnit {
         124  +
            organizational_unit_id: self.organizational_unit_id,
         125  +
        }
         126  +
    }
         127  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_resource_data_sync_s3_destination.rs

@@ -0,1 +0,360 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about the target S3 bucket for the resource data sync.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ResourceDataSyncS3Destination {
           7  +
    /// <p>The name of the S3 bucket where the aggregated data is stored.</p>
           8  +
    pub bucket_name: ::std::string::String,
           9  +
    /// <p>An Amazon S3 prefix for the bucket.</p>
          10  +
    pub prefix: ::std::option::Option<::std::string::String>,
          11  +
    /// <p>A supported sync format. The following format is currently supported: JsonSerDe</p>
          12  +
    pub sync_format: crate::types::ResourceDataSyncS3Format,
          13  +
    /// <p>The Amazon Web Services Region with the S3 bucket targeted by the resource data sync.</p>
          14  +
    pub region: ::std::string::String,
          15  +
    /// <p>The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 bucket.</p>
          16  +
    pub awskms_key_arn: ::std::option::Option<::std::string::String>,
          17  +
    /// <p>Enables destination data sharing. By default, this field is <code>null</code>.</p>
          18  +
    pub destination_data_sharing: ::std::option::Option<crate::types::ResourceDataSyncDestinationDataSharing>,
          19  +
}
          20  +
impl ResourceDataSyncS3Destination {
          21  +
    /// <p>The name of the S3 bucket where the aggregated data is stored.</p>
          22  +
    pub fn bucket_name(&self) -> &str {
          23  +
        use std::ops::Deref;
          24  +
        self.bucket_name.deref()
          25  +
    }
          26  +
    /// <p>An Amazon S3 prefix for the bucket.</p>
          27  +
    pub fn prefix(&self) -> ::std::option::Option<&str> {
          28  +
        self.prefix.as_deref()
          29  +
    }
          30  +
    /// <p>A supported sync format. The following format is currently supported: JsonSerDe</p>
          31  +
    pub fn sync_format(&self) -> &crate::types::ResourceDataSyncS3Format {
          32  +
        &self.sync_format
          33  +
    }
          34  +
    /// <p>The Amazon Web Services Region with the S3 bucket targeted by the resource data sync.</p>
          35  +
    pub fn region(&self) -> &str {
          36  +
        use std::ops::Deref;
          37  +
        self.region.deref()
          38  +
    }
          39  +
    /// <p>The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 bucket.</p>
          40  +
    pub fn awskms_key_arn(&self) -> ::std::option::Option<&str> {
          41  +
        self.awskms_key_arn.as_deref()
          42  +
    }
          43  +
    /// <p>Enables destination data sharing. By default, this field is <code>null</code>.</p>
          44  +
    pub fn destination_data_sharing(&self) -> ::std::option::Option<&crate::types::ResourceDataSyncDestinationDataSharing> {
          45  +
        self.destination_data_sharing.as_ref()
          46  +
    }
          47  +
}
          48  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_BUCKET_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          49  +
    ::aws_smithy_schema::ShapeId::from_parts(
          50  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$BucketName",
          51  +
        "com.amazonaws.ssm",
          52  +
        "ResourceDataSyncS3Destination",
          53  +
    ),
          54  +
    ::aws_smithy_schema::ShapeType::String,
          55  +
    "BucketName",
          56  +
    0,
          57  +
);
          58  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_PREFIX: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          59  +
    ::aws_smithy_schema::ShapeId::from_parts(
          60  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$Prefix",
          61  +
        "com.amazonaws.ssm",
          62  +
        "ResourceDataSyncS3Destination",
          63  +
    ),
          64  +
    ::aws_smithy_schema::ShapeType::String,
          65  +
    "Prefix",
          66  +
    1,
          67  +
);
          68  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_SYNC_FORMAT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          69  +
    ::aws_smithy_schema::ShapeId::from_parts(
          70  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$SyncFormat",
          71  +
        "com.amazonaws.ssm",
          72  +
        "ResourceDataSyncS3Destination",
          73  +
    ),
          74  +
    ::aws_smithy_schema::ShapeType::String,
          75  +
    "SyncFormat",
          76  +
    2,
          77  +
);
          78  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_REGION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          79  +
    ::aws_smithy_schema::ShapeId::from_parts(
          80  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$Region",
          81  +
        "com.amazonaws.ssm",
          82  +
        "ResourceDataSyncS3Destination",
          83  +
    ),
          84  +
    ::aws_smithy_schema::ShapeType::String,
          85  +
    "Region",
          86  +
    3,
          87  +
);
          88  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_AWSKMS_KEY_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          89  +
    ::aws_smithy_schema::ShapeId::from_parts(
          90  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$AWSKMSKeyARN",
          91  +
        "com.amazonaws.ssm",
          92  +
        "ResourceDataSyncS3Destination",
          93  +
    ),
          94  +
    ::aws_smithy_schema::ShapeType::String,
          95  +
    "AWSKMSKeyARN",
          96  +
    4,
          97  +
);
          98  +
static RESOURCEDATASYNCS3DESTINATION_MEMBER_DESTINATION_DATA_SHARING: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          99  +
    ::aws_smithy_schema::ShapeId::from_parts(
         100  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination$DestinationDataSharing",
         101  +
        "com.amazonaws.ssm",
         102  +
        "ResourceDataSyncS3Destination",
         103  +
    ),
         104  +
    ::aws_smithy_schema::ShapeType::Structure,
         105  +
    "DestinationDataSharing",
         106  +
    5,
         107  +
);
         108  +
static RESOURCEDATASYNCS3DESTINATION_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         109  +
    ::aws_smithy_schema::ShapeId::from_parts(
         110  +
        "com.amazonaws.ssm#ResourceDataSyncS3Destination",
         111  +
        "com.amazonaws.ssm",
         112  +
        "ResourceDataSyncS3Destination",
         113  +
    ),
         114  +
    ::aws_smithy_schema::ShapeType::Structure,
         115  +
    &[
         116  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_BUCKET_NAME,
         117  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_PREFIX,
         118  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_SYNC_FORMAT,
         119  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_REGION,
         120  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_AWSKMS_KEY_ARN,
         121  +
        &RESOURCEDATASYNCS3DESTINATION_MEMBER_DESTINATION_DATA_SHARING,
         122  +
    ],
         123  +
);
         124  +
impl ResourceDataSyncS3Destination {
         125  +
    /// The schema for this shape.
         126  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RESOURCEDATASYNCS3DESTINATION_SCHEMA;
         127  +
}
         128  +
impl ::aws_smithy_schema::serde::SerializableStruct for ResourceDataSyncS3Destination {
         129  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         130  +
    fn serialize_members(
         131  +
        &self,
         132  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         133  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         134  +
        {
         135  +
            let val = &self.bucket_name;
         136  +
            ser.write_string(&RESOURCEDATASYNCS3DESTINATION_MEMBER_BUCKET_NAME, val)?;
         137  +
        }
         138  +
        if let Some(ref val) = self.prefix {
         139  +
            ser.write_string(&RESOURCEDATASYNCS3DESTINATION_MEMBER_PREFIX, val)?;
         140  +
        }
         141  +
        {
         142  +
            let val = &self.sync_format;
         143  +
            ser.write_string(&RESOURCEDATASYNCS3DESTINATION_MEMBER_SYNC_FORMAT, val.as_str())?;
         144  +
        }
         145  +
        {
         146  +
            let val = &self.region;
         147  +
            ser.write_string(&RESOURCEDATASYNCS3DESTINATION_MEMBER_REGION, val)?;
         148  +
        }
         149  +
        if let Some(ref val) = self.awskms_key_arn {
         150  +
            ser.write_string(&RESOURCEDATASYNCS3DESTINATION_MEMBER_AWSKMS_KEY_ARN, val)?;
         151  +
        }
         152  +
        if let Some(ref val) = self.destination_data_sharing {
         153  +
            ser.write_struct(&RESOURCEDATASYNCS3DESTINATION_MEMBER_DESTINATION_DATA_SHARING, val)?;
         154  +
        }
         155  +
        Ok(())
         156  +
    }
         157  +
}
         158  +
impl ResourceDataSyncS3Destination {
         159  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         160  +
    pub fn deserialize(
         161  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         162  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         163  +
        #[allow(unused_variables, unused_mut)]
         164  +
        let mut builder = Self::builder();
         165  +
        #[allow(
         166  +
            unused_variables,
         167  +
            unreachable_code,
         168  +
            clippy::single_match,
         169  +
            clippy::match_single_binding,
         170  +
            clippy::diverging_sub_expression
         171  +
        )]
         172  +
        deserializer.read_struct(&RESOURCEDATASYNCS3DESTINATION_SCHEMA, &mut |member, deser| {
         173  +
            match member.member_index() {
         174  +
                Some(0) => {
         175  +
                    builder.bucket_name = Some(deser.read_string(member)?);
         176  +
                }
         177  +
                Some(1) => {
         178  +
                    if deser.is_null() {
         179  +
                        deser.read_null()?;
         180  +
                    } else {
         181  +
                        builder.prefix = Some(deser.read_string(member)?);
         182  +
                    }
         183  +
                }
         184  +
                Some(2) => {
         185  +
                    builder.sync_format = Some(crate::types::ResourceDataSyncS3Format::from(deser.read_string(member)?.as_str()));
         186  +
                }
         187  +
                Some(3) => {
         188  +
                    builder.region = Some(deser.read_string(member)?);
         189  +
                }
         190  +
                Some(4) => {
         191  +
                    if deser.is_null() {
         192  +
                        deser.read_null()?;
         193  +
                    } else {
         194  +
                        builder.awskms_key_arn = Some(deser.read_string(member)?);
         195  +
                    }
         196  +
                }
         197  +
                Some(5) => {
         198  +
                    if deser.is_null() {
         199  +
                        deser.read_null()?;
         200  +
                    } else {
         201  +
                        builder.destination_data_sharing = Some(crate::types::ResourceDataSyncDestinationDataSharing::deserialize(deser)?);
         202  +
                    }
         203  +
                }
         204  +
                _ => {}
         205  +
            }
         206  +
            Ok(())
         207  +
        })?;
         208  +
        builder.bucket_name = builder.bucket_name.or(Some(String::new()));
         209  +
        builder.region = builder.region.or(Some(String::new()));
         210  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         211  +
    }
         212  +
}
         213  +
impl ResourceDataSyncS3Destination {
         214  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         215  +
    pub fn deserialize_with_response(
         216  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         217  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         218  +
        _status: u16,
         219  +
        _body: &[u8],
         220  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         221  +
        Self::deserialize(deserializer)
         222  +
    }
         223  +
}
         224  +
impl ResourceDataSyncS3Destination {
         225  +
    /// Creates a new builder-style object to manufacture [`ResourceDataSyncS3Destination`](crate::types::ResourceDataSyncS3Destination).
         226  +
    pub fn builder() -> crate::types::builders::ResourceDataSyncS3DestinationBuilder {
         227  +
        crate::types::builders::ResourceDataSyncS3DestinationBuilder::default()
         228  +
    }
         229  +
}
         230  +
         231  +
/// A builder for [`ResourceDataSyncS3Destination`](crate::types::ResourceDataSyncS3Destination).
         232  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         233  +
#[non_exhaustive]
         234  +
pub struct ResourceDataSyncS3DestinationBuilder {
         235  +
    pub(crate) bucket_name: ::std::option::Option<::std::string::String>,
         236  +
    pub(crate) prefix: ::std::option::Option<::std::string::String>,
         237  +
    pub(crate) sync_format: ::std::option::Option<crate::types::ResourceDataSyncS3Format>,
         238  +
    pub(crate) region: ::std::option::Option<::std::string::String>,
         239  +
    pub(crate) awskms_key_arn: ::std::option::Option<::std::string::String>,
         240  +
    pub(crate) destination_data_sharing: ::std::option::Option<crate::types::ResourceDataSyncDestinationDataSharing>,
         241  +
}
         242  +
impl ResourceDataSyncS3DestinationBuilder {
         243  +
    /// <p>The name of the S3 bucket where the aggregated data is stored.</p>
         244  +
    /// This field is required.
         245  +
    pub fn bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         246  +
        self.bucket_name = ::std::option::Option::Some(input.into());
         247  +
        self
         248  +
    }
         249  +
    /// <p>The name of the S3 bucket where the aggregated data is stored.</p>
         250  +
    pub fn set_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         251  +
        self.bucket_name = input;
         252  +
        self
         253  +
    }
         254  +
    /// <p>The name of the S3 bucket where the aggregated data is stored.</p>
         255  +
    pub fn get_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
         256  +
        &self.bucket_name
         257  +
    }
         258  +
    /// <p>An Amazon S3 prefix for the bucket.</p>
         259  +
    pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         260  +
        self.prefix = ::std::option::Option::Some(input.into());
         261  +
        self
         262  +
    }
         263  +
    /// <p>An Amazon S3 prefix for the bucket.</p>
         264  +
    pub fn set_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         265  +
        self.prefix = input;
         266  +
        self
         267  +
    }
         268  +
    /// <p>An Amazon S3 prefix for the bucket.</p>
         269  +
    pub fn get_prefix(&self) -> &::std::option::Option<::std::string::String> {
         270  +
        &self.prefix
         271  +
    }
         272  +
    /// <p>A supported sync format. The following format is currently supported: JsonSerDe</p>
         273  +
    /// This field is required.
         274  +
    pub fn sync_format(mut self, input: crate::types::ResourceDataSyncS3Format) -> Self {
         275  +
        self.sync_format = ::std::option::Option::Some(input);
         276  +
        self
         277  +
    }
         278  +
    /// <p>A supported sync format. The following format is currently supported: JsonSerDe</p>
         279  +
    pub fn set_sync_format(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncS3Format>) -> Self {
         280  +
        self.sync_format = input;
         281  +
        self
         282  +
    }
         283  +
    /// <p>A supported sync format. The following format is currently supported: JsonSerDe</p>
         284  +
    pub fn get_sync_format(&self) -> &::std::option::Option<crate::types::ResourceDataSyncS3Format> {
         285  +
        &self.sync_format
         286  +
    }
         287  +
    /// <p>The Amazon Web Services Region with the S3 bucket targeted by the resource data sync.</p>
         288  +
    /// This field is required.
         289  +
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         290  +
        self.region = ::std::option::Option::Some(input.into());
         291  +
        self
         292  +
    }
         293  +
    /// <p>The Amazon Web Services Region with the S3 bucket targeted by the resource data sync.</p>
         294  +
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         295  +
        self.region = input;
         296  +
        self
         297  +
    }
         298  +
    /// <p>The Amazon Web Services Region with the S3 bucket targeted by the resource data sync.</p>
         299  +
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
         300  +
        &self.region
         301  +
    }
         302  +
    /// <p>The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 bucket.</p>
         303  +
    pub fn awskms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         304  +
        self.awskms_key_arn = ::std::option::Option::Some(input.into());
         305  +
        self
         306  +
    }
         307  +
    /// <p>The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 bucket.</p>
         308  +
    pub fn set_awskms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         309  +
        self.awskms_key_arn = input;
         310  +
        self
         311  +
    }
         312  +
    /// <p>The ARN of an encryption key for a destination in Amazon S3. Must belong to the same Region as the destination S3 bucket.</p>
         313  +
    pub fn get_awskms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
         314  +
        &self.awskms_key_arn
         315  +
    }
         316  +
    /// <p>Enables destination data sharing. By default, this field is <code>null</code>.</p>
         317  +
    pub fn destination_data_sharing(mut self, input: crate::types::ResourceDataSyncDestinationDataSharing) -> Self {
         318  +
        self.destination_data_sharing = ::std::option::Option::Some(input);
         319  +
        self
         320  +
    }
         321  +
    /// <p>Enables destination data sharing. By default, this field is <code>null</code>.</p>
         322  +
    pub fn set_destination_data_sharing(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncDestinationDataSharing>) -> Self {
         323  +
        self.destination_data_sharing = input;
         324  +
        self
         325  +
    }
         326  +
    /// <p>Enables destination data sharing. By default, this field is <code>null</code>.</p>
         327  +
    pub fn get_destination_data_sharing(&self) -> &::std::option::Option<crate::types::ResourceDataSyncDestinationDataSharing> {
         328  +
        &self.destination_data_sharing
         329  +
    }
         330  +
    /// Consumes the builder and constructs a [`ResourceDataSyncS3Destination`](crate::types::ResourceDataSyncS3Destination).
         331  +
    /// This method will fail if any of the following fields are not set:
         332  +
    /// - [`bucket_name`](crate::types::builders::ResourceDataSyncS3DestinationBuilder::bucket_name)
         333  +
    /// - [`sync_format`](crate::types::builders::ResourceDataSyncS3DestinationBuilder::sync_format)
         334  +
    /// - [`region`](crate::types::builders::ResourceDataSyncS3DestinationBuilder::region)
         335  +
    pub fn build(self) -> ::std::result::Result<crate::types::ResourceDataSyncS3Destination, ::aws_smithy_types::error::operation::BuildError> {
         336  +
        ::std::result::Result::Ok(crate::types::ResourceDataSyncS3Destination {
         337  +
            bucket_name: self.bucket_name.ok_or_else(|| {
         338  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         339  +
                    "bucket_name",
         340  +
                    "bucket_name was not specified but it is required when building ResourceDataSyncS3Destination",
         341  +
                )
         342  +
            })?,
         343  +
            prefix: self.prefix,
         344  +
            sync_format: self.sync_format.ok_or_else(|| {
         345  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         346  +
                    "sync_format",
         347  +
                    "sync_format was not specified but it is required when building ResourceDataSyncS3Destination",
         348  +
                )
         349  +
            })?,
         350  +
            region: self.region.ok_or_else(|| {
         351  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         352  +
                    "region",
         353  +
                    "region was not specified but it is required when building ResourceDataSyncS3Destination",
         354  +
                )
         355  +
            })?,
         356  +
            awskms_key_arn: self.awskms_key_arn,
         357  +
            destination_data_sharing: self.destination_data_sharing,
         358  +
        })
         359  +
    }
         360  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_resource_data_sync_s3_format.rs

@@ -0,1 +0,102 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// When writing a match expression against `ResourceDataSyncS3Format`, it is important to ensure
           4  +
/// your code is forward-compatible. That is, if a match arm handles a case for a
           5  +
/// feature that is supported by the service but has not been represented as an enum
           6  +
/// variant in a current version of SDK, your code should continue to work when you
           7  +
/// upgrade SDK to a future version in which the enum does include a variant for that
           8  +
/// feature.
           9  +
///
          10  +
/// Here is an example of how you can make a match expression forward-compatible:
          11  +
///
          12  +
/// ```text
          13  +
/// # let resourcedatasyncs3format = unimplemented!();
          14  +
/// match resourcedatasyncs3format {
          15  +
///     ResourceDataSyncS3Format::JsonSerde => { /* ... */ },
          16  +
///     other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
          17  +
///     _ => { /* ... */ },
          18  +
/// }
          19  +
/// ```
          20  +
/// The above code demonstrates that when `resourcedatasyncs3format` represents
          21  +
/// `NewFeature`, the execution path will lead to the second last match arm,
          22  +
/// even though the enum does not contain a variant `ResourceDataSyncS3Format::NewFeature`
          23  +
/// in the current version of SDK. The reason is that the variable `other`,
          24  +
/// created by the `@` operator, is bound to
          25  +
/// `ResourceDataSyncS3Format::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
          26  +
/// and calling `as_str` on it yields `"NewFeature"`.
          27  +
/// This match expression is forward-compatible when executed with a newer
          28  +
/// version of SDK where the variant `ResourceDataSyncS3Format::NewFeature` is defined.
          29  +
/// Specifically, when `resourcedatasyncs3format` represents `NewFeature`,
          30  +
/// the execution path will hit the second last match arm as before by virtue of
          31  +
/// calling `as_str` on `ResourceDataSyncS3Format::NewFeature` also yielding `"NewFeature"`.
          32  +
///
          33  +
/// Explicitly matching on the `Unknown` variant should
          34  +
/// be avoided for two reasons:
          35  +
/// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
          36  +
/// - It might inadvertently shadow other intended match arms.
          37  +
///
          38  +
#[allow(missing_docs)] // documentation missing in model
          39  +
#[non_exhaustive]
          40  +
#[derive(
          41  +
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
          42  +
)]
          43  +
pub enum ResourceDataSyncS3Format {
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    JsonSerde,
          46  +
    /// `Unknown` contains new variants that have been added since this code was generated.
          47  +
    #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
          48  +
    Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
          49  +
}
          50  +
impl ::std::convert::From<&str> for ResourceDataSyncS3Format {
          51  +
    fn from(s: &str) -> Self {
          52  +
        match s {
          53  +
            "JsonSerDe" => ResourceDataSyncS3Format::JsonSerde,
          54  +
            other => ResourceDataSyncS3Format::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
          55  +
        }
          56  +
    }
          57  +
}
          58  +
impl ::std::str::FromStr for ResourceDataSyncS3Format {
          59  +
    type Err = ::std::convert::Infallible;
          60  +
          61  +
    fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
          62  +
        ::std::result::Result::Ok(ResourceDataSyncS3Format::from(s))
          63  +
    }
          64  +
}
          65  +
impl ResourceDataSyncS3Format {
          66  +
    /// Returns the `&str` value of the enum member.
          67  +
    pub fn as_str(&self) -> &str {
          68  +
        match self {
          69  +
            ResourceDataSyncS3Format::JsonSerde => "JsonSerDe",
          70  +
            ResourceDataSyncS3Format::Unknown(value) => value.as_str(),
          71  +
        }
          72  +
    }
          73  +
    /// Returns all the `&str` representations of the enum members.
          74  +
    pub const fn values() -> &'static [&'static str] {
          75  +
        &["JsonSerDe"]
          76  +
    }
          77  +
}
          78  +
impl ::std::convert::AsRef<str> for ResourceDataSyncS3Format {
          79  +
    fn as_ref(&self) -> &str {
          80  +
        self.as_str()
          81  +
    }
          82  +
}
          83  +
impl ResourceDataSyncS3Format {
          84  +
    /// Parses the enum value while disallowing unknown variants.
          85  +
    ///
          86  +
    /// Unknown variants will result in an error.
          87  +
    pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
          88  +
        match Self::from(value) {
          89  +
            #[allow(deprecated)]
          90  +
            Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
          91  +
            known => Ok(known),
          92  +
        }
          93  +
    }
          94  +
}
          95  +
impl ::std::fmt::Display for ResourceDataSyncS3Format {
          96  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
          97  +
        match self {
          98  +
            ResourceDataSyncS3Format::JsonSerde => write!(f, "JsonSerDe"),
          99  +
            ResourceDataSyncS3Format::Unknown(value) => write!(f, "{value}"),
         100  +
        }
         101  +
    }
         102  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_resource_data_sync_source.rs

@@ -0,1 +0,328 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>Information about the source of the data included in the resource data sync.</p>
           4  +
#[non_exhaustive]
           5  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           6  +
pub struct ResourceDataSyncSource {
           7  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>SingleAccountMultiRegions</code>.</p>
           8  +
    pub source_type: ::std::string::String,
           9  +
    /// <p>Information about the <code>AwsOrganizationsSource</code> resource data sync source. A sync source of this type can synchronize data from Organizations.</p>
          10  +
    pub aws_organizations_source: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>,
          11  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
          12  +
    pub source_regions: ::std::vec::Vec<::std::string::String>,
          13  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
          14  +
    pub include_future_regions: bool,
          15  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          16  +
    pub enable_all_ops_data_sources: bool,
          17  +
}
          18  +
impl ResourceDataSyncSource {
          19  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>SingleAccountMultiRegions</code>.</p>
          20  +
    pub fn source_type(&self) -> &str {
          21  +
        use std::ops::Deref;
          22  +
        self.source_type.deref()
          23  +
    }
          24  +
    /// <p>Information about the <code>AwsOrganizationsSource</code> resource data sync source. A sync source of this type can synchronize data from Organizations.</p>
          25  +
    pub fn aws_organizations_source(&self) -> ::std::option::Option<&crate::types::ResourceDataSyncAwsOrganizationsSource> {
          26  +
        self.aws_organizations_source.as_ref()
          27  +
    }
          28  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
          29  +
    pub fn source_regions(&self) -> &[::std::string::String] {
          30  +
        use std::ops::Deref;
          31  +
        self.source_regions.deref()
          32  +
    }
          33  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
          34  +
    pub fn include_future_regions(&self) -> bool {
          35  +
        self.include_future_regions
          36  +
    }
          37  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          38  +
    pub fn enable_all_ops_data_sources(&self) -> bool {
          39  +
        self.enable_all_ops_data_sources
          40  +
    }
          41  +
}
          42  +
static RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts(
          44  +
        "com.amazonaws.ssm#ResourceDataSyncSource$SourceType",
          45  +
        "com.amazonaws.ssm",
          46  +
        "ResourceDataSyncSource",
          47  +
    ),
          48  +
    ::aws_smithy_schema::ShapeType::String,
          49  +
    "SourceType",
          50  +
    0,
          51  +
);
          52  +
static RESOURCEDATASYNCSOURCE_MEMBER_AWS_ORGANIZATIONS_SOURCE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          53  +
    ::aws_smithy_schema::ShapeId::from_parts(
          54  +
        "com.amazonaws.ssm#ResourceDataSyncSource$AwsOrganizationsSource",
          55  +
        "com.amazonaws.ssm",
          56  +
        "ResourceDataSyncSource",
          57  +
    ),
          58  +
    ::aws_smithy_schema::ShapeType::Structure,
          59  +
    "AwsOrganizationsSource",
          60  +
    1,
          61  +
);
          62  +
static RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_REGIONS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts(
          64  +
        "com.amazonaws.ssm#ResourceDataSyncSourceRegionList$member",
          65  +
        "com.amazonaws.ssm",
          66  +
        "ResourceDataSyncSourceRegionList",
          67  +
    ),
          68  +
    ::aws_smithy_schema::ShapeType::String,
          69  +
    "member",
          70  +
    0,
          71  +
);
          72  +
static RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_REGIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          73  +
    ::aws_smithy_schema::ShapeId::from_parts(
          74  +
        "com.amazonaws.ssm#ResourceDataSyncSource$SourceRegions",
          75  +
        "com.amazonaws.ssm",
          76  +
        "ResourceDataSyncSource",
          77  +
    ),
          78  +
    ::aws_smithy_schema::ShapeType::List,
          79  +
    "SourceRegions",
          80  +
    2,
          81  +
)
          82  +
.with_list_member(&RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_REGIONS_MEMBER);
          83  +
static RESOURCEDATASYNCSOURCE_MEMBER_INCLUDE_FUTURE_REGIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          84  +
    ::aws_smithy_schema::ShapeId::from_parts(
          85  +
        "com.amazonaws.ssm#ResourceDataSyncSource$IncludeFutureRegions",
          86  +
        "com.amazonaws.ssm",
          87  +
        "ResourceDataSyncSource",
          88  +
    ),
          89  +
    ::aws_smithy_schema::ShapeType::Boolean,
          90  +
    "IncludeFutureRegions",
          91  +
    3,
          92  +
);
          93  +
static RESOURCEDATASYNCSOURCE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          94  +
    ::aws_smithy_schema::ShapeId::from_parts(
          95  +
        "com.amazonaws.ssm#ResourceDataSyncSource$EnableAllOpsDataSources",
          96  +
        "com.amazonaws.ssm",
          97  +
        "ResourceDataSyncSource",
          98  +
    ),
          99  +
    ::aws_smithy_schema::ShapeType::Boolean,
         100  +
    "EnableAllOpsDataSources",
         101  +
    4,
         102  +
);
         103  +
static RESOURCEDATASYNCSOURCE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         104  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ResourceDataSyncSource", "com.amazonaws.ssm", "ResourceDataSyncSource"),
         105  +
    ::aws_smithy_schema::ShapeType::Structure,
         106  +
    &[
         107  +
        &RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_TYPE,
         108  +
        &RESOURCEDATASYNCSOURCE_MEMBER_AWS_ORGANIZATIONS_SOURCE,
         109  +
        &RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_REGIONS,
         110  +
        &RESOURCEDATASYNCSOURCE_MEMBER_INCLUDE_FUTURE_REGIONS,
         111  +
        &RESOURCEDATASYNCSOURCE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES,
         112  +
    ],
         113  +
);
         114  +
impl ResourceDataSyncSource {
         115  +
    /// The schema for this shape.
         116  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RESOURCEDATASYNCSOURCE_SCHEMA;
         117  +
}
         118  +
impl ::aws_smithy_schema::serde::SerializableStruct for ResourceDataSyncSource {
         119  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         120  +
    fn serialize_members(
         121  +
        &self,
         122  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         123  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         124  +
        {
         125  +
            let val = &self.source_type;
         126  +
            ser.write_string(&RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_TYPE, val)?;
         127  +
        }
         128  +
        if let Some(ref val) = self.aws_organizations_source {
         129  +
            ser.write_struct(&RESOURCEDATASYNCSOURCE_MEMBER_AWS_ORGANIZATIONS_SOURCE, val)?;
         130  +
        }
         131  +
        {
         132  +
            let val = &self.source_regions;
         133  +
         134  +
            ser.write_list(
         135  +
                &RESOURCEDATASYNCSOURCE_MEMBER_SOURCE_REGIONS,
         136  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         137  +
                    for item in val {
         138  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         139  +
                    }
         140  +
                    Ok(())
         141  +
                },
         142  +
            )?;
         143  +
        }
         144  +
        {
         145  +
            let val = &self.include_future_regions;
         146  +
            ser.write_boolean(&RESOURCEDATASYNCSOURCE_MEMBER_INCLUDE_FUTURE_REGIONS, *val)?;
         147  +
        }
         148  +
        {
         149  +
            let val = &self.enable_all_ops_data_sources;
         150  +
            ser.write_boolean(&RESOURCEDATASYNCSOURCE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES, *val)?;
         151  +
        }
         152  +
        Ok(())
         153  +
    }
         154  +
}
         155  +
impl ResourceDataSyncSource {
         156  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         157  +
    pub fn deserialize(
         158  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         159  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         160  +
        #[allow(unused_variables, unused_mut)]
         161  +
        let mut builder = Self::builder();
         162  +
        #[allow(
         163  +
            unused_variables,
         164  +
            unreachable_code,
         165  +
            clippy::single_match,
         166  +
            clippy::match_single_binding,
         167  +
            clippy::diverging_sub_expression
         168  +
        )]
         169  +
        deserializer.read_struct(&RESOURCEDATASYNCSOURCE_SCHEMA, &mut |member, deser| {
         170  +
            match member.member_index() {
         171  +
                Some(0) => {
         172  +
                    builder.source_type = Some(deser.read_string(member)?);
         173  +
                }
         174  +
                Some(1) => {
         175  +
                    if deser.is_null() {
         176  +
                        deser.read_null()?;
         177  +
                    } else {
         178  +
                        builder.aws_organizations_source = Some(crate::types::ResourceDataSyncAwsOrganizationsSource::deserialize(deser)?);
         179  +
                    }
         180  +
                }
         181  +
                Some(2) => {
         182  +
                    builder.source_regions = Some(deser.read_string_list(member)?);
         183  +
                }
         184  +
                Some(3) => {
         185  +
                    builder.include_future_regions = Some(deser.read_boolean(member)?);
         186  +
                }
         187  +
                Some(4) => {
         188  +
                    builder.enable_all_ops_data_sources = Some(deser.read_boolean(member)?);
         189  +
                }
         190  +
                _ => {}
         191  +
            }
         192  +
            Ok(())
         193  +
        })?;
         194  +
        builder.source_type = builder.source_type.or(Some(String::new()));
         195  +
        builder.source_regions = builder.source_regions.or(Some(Vec::new()));
         196  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         197  +
    }
         198  +
}
         199  +
impl ResourceDataSyncSource {
         200  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         201  +
    pub fn deserialize_with_response(
         202  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         203  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         204  +
        _status: u16,
         205  +
        _body: &[u8],
         206  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         207  +
        Self::deserialize(deserializer)
         208  +
    }
         209  +
}
         210  +
impl ResourceDataSyncSource {
         211  +
    /// Creates a new builder-style object to manufacture [`ResourceDataSyncSource`](crate::types::ResourceDataSyncSource).
         212  +
    pub fn builder() -> crate::types::builders::ResourceDataSyncSourceBuilder {
         213  +
        crate::types::builders::ResourceDataSyncSourceBuilder::default()
         214  +
    }
         215  +
}
         216  +
         217  +
/// A builder for [`ResourceDataSyncSource`](crate::types::ResourceDataSyncSource).
         218  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         219  +
#[non_exhaustive]
         220  +
pub struct ResourceDataSyncSourceBuilder {
         221  +
    pub(crate) source_type: ::std::option::Option<::std::string::String>,
         222  +
    pub(crate) aws_organizations_source: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>,
         223  +
    pub(crate) source_regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         224  +
    pub(crate) include_future_regions: ::std::option::Option<bool>,
         225  +
    pub(crate) enable_all_ops_data_sources: ::std::option::Option<bool>,
         226  +
}
         227  +
impl ResourceDataSyncSourceBuilder {
         228  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>SingleAccountMultiRegions</code>.</p>
         229  +
    /// This field is required.
         230  +
    pub fn source_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         231  +
        self.source_type = ::std::option::Option::Some(input.into());
         232  +
        self
         233  +
    }
         234  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>SingleAccountMultiRegions</code>.</p>
         235  +
    pub fn set_source_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         236  +
        self.source_type = input;
         237  +
        self
         238  +
    }
         239  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>SingleAccountMultiRegions</code>.</p>
         240  +
    pub fn get_source_type(&self) -> &::std::option::Option<::std::string::String> {
         241  +
        &self.source_type
         242  +
    }
         243  +
    /// <p>Information about the <code>AwsOrganizationsSource</code> resource data sync source. A sync source of this type can synchronize data from Organizations.</p>
         244  +
    pub fn aws_organizations_source(mut self, input: crate::types::ResourceDataSyncAwsOrganizationsSource) -> Self {
         245  +
        self.aws_organizations_source = ::std::option::Option::Some(input);
         246  +
        self
         247  +
    }
         248  +
    /// <p>Information about the <code>AwsOrganizationsSource</code> resource data sync source. A sync source of this type can synchronize data from Organizations.</p>
         249  +
    pub fn set_aws_organizations_source(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>) -> Self {
         250  +
        self.aws_organizations_source = input;
         251  +
        self
         252  +
    }
         253  +
    /// <p>Information about the <code>AwsOrganizationsSource</code> resource data sync source. A sync source of this type can synchronize data from Organizations.</p>
         254  +
    pub fn get_aws_organizations_source(&self) -> &::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource> {
         255  +
        &self.aws_organizations_source
         256  +
    }
         257  +
    /// Appends an item to `source_regions`.
         258  +
    ///
         259  +
    /// To override the contents of this collection use [`set_source_regions`](Self::set_source_regions).
         260  +
    ///
         261  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         262  +
    pub fn source_regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         263  +
        let mut v = self.source_regions.unwrap_or_default();
         264  +
        v.push(input.into());
         265  +
        self.source_regions = ::std::option::Option::Some(v);
         266  +
        self
         267  +
    }
         268  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         269  +
    pub fn set_source_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         270  +
        self.source_regions = input;
         271  +
        self
         272  +
    }
         273  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         274  +
    pub fn get_source_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         275  +
        &self.source_regions
         276  +
    }
         277  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         278  +
    pub fn include_future_regions(mut self, input: bool) -> Self {
         279  +
        self.include_future_regions = ::std::option::Option::Some(input);
         280  +
        self
         281  +
    }
         282  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         283  +
    pub fn set_include_future_regions(mut self, input: ::std::option::Option<bool>) -> Self {
         284  +
        self.include_future_regions = input;
         285  +
        self
         286  +
    }
         287  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         288  +
    pub fn get_include_future_regions(&self) -> &::std::option::Option<bool> {
         289  +
        &self.include_future_regions
         290  +
    }
         291  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         292  +
    pub fn enable_all_ops_data_sources(mut self, input: bool) -> Self {
         293  +
        self.enable_all_ops_data_sources = ::std::option::Option::Some(input);
         294  +
        self
         295  +
    }
         296  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         297  +
    pub fn set_enable_all_ops_data_sources(mut self, input: ::std::option::Option<bool>) -> Self {
         298  +
        self.enable_all_ops_data_sources = input;
         299  +
        self
         300  +
    }
         301  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         302  +
    pub fn get_enable_all_ops_data_sources(&self) -> &::std::option::Option<bool> {
         303  +
        &self.enable_all_ops_data_sources
         304  +
    }
         305  +
    /// Consumes the builder and constructs a [`ResourceDataSyncSource`](crate::types::ResourceDataSyncSource).
         306  +
    /// This method will fail if any of the following fields are not set:
         307  +
    /// - [`source_type`](crate::types::builders::ResourceDataSyncSourceBuilder::source_type)
         308  +
    /// - [`source_regions`](crate::types::builders::ResourceDataSyncSourceBuilder::source_regions)
         309  +
    pub fn build(self) -> ::std::result::Result<crate::types::ResourceDataSyncSource, ::aws_smithy_types::error::operation::BuildError> {
         310  +
        ::std::result::Result::Ok(crate::types::ResourceDataSyncSource {
         311  +
            source_type: self.source_type.ok_or_else(|| {
         312  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         313  +
                    "source_type",
         314  +
                    "source_type was not specified but it is required when building ResourceDataSyncSource",
         315  +
                )
         316  +
            })?,
         317  +
            aws_organizations_source: self.aws_organizations_source,
         318  +
            source_regions: self.source_regions.ok_or_else(|| {
         319  +
                ::aws_smithy_types::error::operation::BuildError::missing_field(
         320  +
                    "source_regions",
         321  +
                    "source_regions was not specified but it is required when building ResourceDataSyncSource",
         322  +
                )
         323  +
            })?,
         324  +
            include_future_regions: self.include_future_regions.unwrap_or_default(),
         325  +
            enable_all_ops_data_sources: self.enable_all_ops_data_sources.unwrap_or_default(),
         326  +
        })
         327  +
    }
         328  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/types/_resource_data_sync_source_with_state.rs

@@ -0,1 +0,390 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
           3  +
/// <p>The data type name for including resource data sync state. There are four sync states:</p>
           4  +
/// <p><code>OrganizationNotExists</code> (Your organization doesn't exist)</p>
           5  +
/// <p><code>NoPermissions</code> (The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Amazon Web Services Systems Manager Explorer.)</p>
           6  +
/// <p><code>InvalidOrganizationalUnit</code> (You specified or selected an invalid unit in the resource data sync configuration.)</p>
           7  +
/// <p><code>TrustedAccessDisabled</code> (You disabled Systems Manager access in the organization in Organizations.)</p>
           8  +
#[non_exhaustive]
           9  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
          10  +
pub struct ResourceDataSyncSourceWithState {
          11  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>singleAccountMultiRegions</code>.</p>
          12  +
    pub source_type: ::std::option::Option<::std::string::String>,
          13  +
    /// <p>The field name in <code>SyncSource</code> for the <code>ResourceDataSyncAwsOrganizationsSource</code> type.</p>
          14  +
    pub aws_organizations_source: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>,
          15  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
          16  +
    pub source_regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          17  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
          18  +
    pub include_future_regions: bool,
          19  +
    /// <p>The data type name for including resource data sync state. There are four sync states:</p>
          20  +
    /// <p><code>OrganizationNotExists</code>: Your organization doesn't exist.</p>
          21  +
    /// <p><code>NoPermissions</code>: The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Explorer.</p>
          22  +
    /// <p><code>InvalidOrganizationalUnit</code>: You specified or selected an invalid unit in the resource data sync configuration.</p>
          23  +
    /// <p><code>TrustedAccessDisabled</code>: You disabled Systems Manager access in the organization in Organizations.</p>
          24  +
    pub state: ::std::option::Option<::std::string::String>,
          25  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          26  +
    pub enable_all_ops_data_sources: bool,
          27  +
}
          28  +
impl ResourceDataSyncSourceWithState {
          29  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>singleAccountMultiRegions</code>.</p>
          30  +
    pub fn source_type(&self) -> ::std::option::Option<&str> {
          31  +
        self.source_type.as_deref()
          32  +
    }
          33  +
    /// <p>The field name in <code>SyncSource</code> for the <code>ResourceDataSyncAwsOrganizationsSource</code> type.</p>
          34  +
    pub fn aws_organizations_source(&self) -> ::std::option::Option<&crate::types::ResourceDataSyncAwsOrganizationsSource> {
          35  +
        self.aws_organizations_source.as_ref()
          36  +
    }
          37  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
          38  +
    ///
          39  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.source_regions.is_none()`.
          40  +
    pub fn source_regions(&self) -> &[::std::string::String] {
          41  +
        self.source_regions.as_deref().unwrap_or_default()
          42  +
    }
          43  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
          44  +
    pub fn include_future_regions(&self) -> bool {
          45  +
        self.include_future_regions
          46  +
    }
          47  +
    /// <p>The data type name for including resource data sync state. There are four sync states:</p>
          48  +
    /// <p><code>OrganizationNotExists</code>: Your organization doesn't exist.</p>
          49  +
    /// <p><code>NoPermissions</code>: The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Explorer.</p>
          50  +
    /// <p><code>InvalidOrganizationalUnit</code>: You specified or selected an invalid unit in the resource data sync configuration.</p>
          51  +
    /// <p><code>TrustedAccessDisabled</code>: You disabled Systems Manager access in the organization in Organizations.</p>
          52  +
    pub fn state(&self) -> ::std::option::Option<&str> {
          53  +
        self.state.as_deref()
          54  +
    }
          55  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
          56  +
    pub fn enable_all_ops_data_sources(&self) -> bool {
          57  +
        self.enable_all_ops_data_sources
          58  +
    }
          59  +
}
          60  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          61  +
    ::aws_smithy_schema::ShapeId::from_parts(
          62  +
        "com.amazonaws.ssm#ResourceDataSyncSourceWithState$SourceType",
          63  +
        "com.amazonaws.ssm",
          64  +
        "ResourceDataSyncSourceWithState",
          65  +
    ),
          66  +
    ::aws_smithy_schema::ShapeType::String,
          67  +
    "SourceType",
          68  +
    0,
          69  +
);
          70  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_AWS_ORGANIZATIONS_SOURCE: ::aws_smithy_schema::Schema<'static> =
          71  +
    ::aws_smithy_schema::Schema::new_member(
          72  +
        ::aws_smithy_schema::ShapeId::from_parts(
          73  +
            "com.amazonaws.ssm#ResourceDataSyncSourceWithState$AwsOrganizationsSource",
          74  +
            "com.amazonaws.ssm",
          75  +
            "ResourceDataSyncSourceWithState",
          76  +
        ),
          77  +
        ::aws_smithy_schema::ShapeType::Structure,
          78  +
        "AwsOrganizationsSource",
          79  +
        1,
          80  +
    );
          81  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_REGIONS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          82  +
    ::aws_smithy_schema::ShapeId::from_parts(
          83  +
        "com.amazonaws.ssm#ResourceDataSyncSourceRegionList$member",
          84  +
        "com.amazonaws.ssm",
          85  +
        "ResourceDataSyncSourceRegionList",
          86  +
    ),
          87  +
    ::aws_smithy_schema::ShapeType::String,
          88  +
    "member",
          89  +
    0,
          90  +
);
          91  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_REGIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          92  +
    ::aws_smithy_schema::ShapeId::from_parts(
          93  +
        "com.amazonaws.ssm#ResourceDataSyncSourceWithState$SourceRegions",
          94  +
        "com.amazonaws.ssm",
          95  +
        "ResourceDataSyncSourceWithState",
          96  +
    ),
          97  +
    ::aws_smithy_schema::ShapeType::List,
          98  +
    "SourceRegions",
          99  +
    2,
         100  +
)
         101  +
.with_list_member(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_REGIONS_MEMBER);
         102  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_INCLUDE_FUTURE_REGIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         103  +
    ::aws_smithy_schema::ShapeId::from_parts(
         104  +
        "com.amazonaws.ssm#ResourceDataSyncSourceWithState$IncludeFutureRegions",
         105  +
        "com.amazonaws.ssm",
         106  +
        "ResourceDataSyncSourceWithState",
         107  +
    ),
         108  +
    ::aws_smithy_schema::ShapeType::Boolean,
         109  +
    "IncludeFutureRegions",
         110  +
    3,
         111  +
);
         112  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_STATE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         113  +
    ::aws_smithy_schema::ShapeId::from_parts(
         114  +
        "com.amazonaws.ssm#ResourceDataSyncSourceWithState$State",
         115  +
        "com.amazonaws.ssm",
         116  +
        "ResourceDataSyncSourceWithState",
         117  +
    ),
         118  +
    ::aws_smithy_schema::ShapeType::String,
         119  +
    "State",
         120  +
    4,
         121  +
);
         122  +
static RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES: ::aws_smithy_schema::Schema<'static> =
         123  +
    ::aws_smithy_schema::Schema::new_member(
         124  +
        ::aws_smithy_schema::ShapeId::from_parts(
         125  +
            "com.amazonaws.ssm#ResourceDataSyncSourceWithState$EnableAllOpsDataSources",
         126  +
            "com.amazonaws.ssm",
         127  +
            "ResourceDataSyncSourceWithState",
         128  +
        ),
         129  +
        ::aws_smithy_schema::ShapeType::Boolean,
         130  +
        "EnableAllOpsDataSources",
         131  +
        5,
         132  +
    );
         133  +
static RESOURCEDATASYNCSOURCEWITHSTATE_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         134  +
    ::aws_smithy_schema::ShapeId::from_parts(
         135  +
        "com.amazonaws.ssm#ResourceDataSyncSourceWithState",
         136  +
        "com.amazonaws.ssm",
         137  +
        "ResourceDataSyncSourceWithState",
         138  +
    ),
         139  +
    ::aws_smithy_schema::ShapeType::Structure,
         140  +
    &[
         141  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_TYPE,
         142  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_AWS_ORGANIZATIONS_SOURCE,
         143  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_REGIONS,
         144  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_INCLUDE_FUTURE_REGIONS,
         145  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_STATE,
         146  +
        &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES,
         147  +
    ],
         148  +
);
         149  +
impl ResourceDataSyncSourceWithState {
         150  +
    /// The schema for this shape.
         151  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &RESOURCEDATASYNCSOURCEWITHSTATE_SCHEMA;
         152  +
}
         153  +
impl ::aws_smithy_schema::serde::SerializableStruct for ResourceDataSyncSourceWithState {
         154  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         155  +
    fn serialize_members(
         156  +
        &self,
         157  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         158  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         159  +
        if let Some(ref val) = self.source_type {
         160  +
            ser.write_string(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_TYPE, val)?;
         161  +
        }
         162  +
        if let Some(ref val) = self.aws_organizations_source {
         163  +
            ser.write_struct(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_AWS_ORGANIZATIONS_SOURCE, val)?;
         164  +
        }
         165  +
        if let Some(ref val) = self.source_regions {
         166  +
            ser.write_list(
         167  +
                &RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_SOURCE_REGIONS,
         168  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         169  +
                    for item in val {
         170  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         171  +
                    }
         172  +
                    Ok(())
         173  +
                },
         174  +
            )?;
         175  +
        }
         176  +
        {
         177  +
            let val = &self.include_future_regions;
         178  +
            ser.write_boolean(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_INCLUDE_FUTURE_REGIONS, *val)?;
         179  +
        }
         180  +
        if let Some(ref val) = self.state {
         181  +
            ser.write_string(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_STATE, val)?;
         182  +
        }
         183  +
        {
         184  +
            let val = &self.enable_all_ops_data_sources;
         185  +
            ser.write_boolean(&RESOURCEDATASYNCSOURCEWITHSTATE_MEMBER_ENABLE_ALL_OPS_DATA_SOURCES, *val)?;
         186  +
        }
         187  +
        Ok(())
         188  +
    }
         189  +
}
         190  +
impl ResourceDataSyncSourceWithState {
         191  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         192  +
    pub fn deserialize(
         193  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         194  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         195  +
        #[allow(unused_variables, unused_mut)]
         196  +
        let mut builder = Self::builder();
         197  +
        #[allow(
         198  +
            unused_variables,
         199  +
            unreachable_code,
         200  +
            clippy::single_match,
         201  +
            clippy::match_single_binding,
         202  +
            clippy::diverging_sub_expression
         203  +
        )]
         204  +
        deserializer.read_struct(&RESOURCEDATASYNCSOURCEWITHSTATE_SCHEMA, &mut |member, deser| {
         205  +
            match member.member_index() {
         206  +
                Some(0) => {
         207  +
                    if deser.is_null() {
         208  +
                        deser.read_null()?;
         209  +
                    } else {
         210  +
                        builder.source_type = Some(deser.read_string(member)?);
         211  +
                    }
         212  +
                }
         213  +
                Some(1) => {
         214  +
                    if deser.is_null() {
         215  +
                        deser.read_null()?;
         216  +
                    } else {
         217  +
                        builder.aws_organizations_source = Some(crate::types::ResourceDataSyncAwsOrganizationsSource::deserialize(deser)?);
         218  +
                    }
         219  +
                }
         220  +
                Some(2) => {
         221  +
                    if deser.is_null() {
         222  +
                        deser.read_null()?;
         223  +
                    } else {
         224  +
                        builder.source_regions = Some(deser.read_string_list(member)?);
         225  +
                    }
         226  +
                }
         227  +
                Some(3) => {
         228  +
                    builder.include_future_regions = Some(deser.read_boolean(member)?);
         229  +
                }
         230  +
                Some(4) => {
         231  +
                    if deser.is_null() {
         232  +
                        deser.read_null()?;
         233  +
                    } else {
         234  +
                        builder.state = Some(deser.read_string(member)?);
         235  +
                    }
         236  +
                }
         237  +
                Some(5) => {
         238  +
                    builder.enable_all_ops_data_sources = Some(deser.read_boolean(member)?);
         239  +
                }
         240  +
                _ => {}
         241  +
            }
         242  +
            Ok(())
         243  +
        })?;
         244  +
        Ok(builder.build())
         245  +
    }
         246  +
}
         247  +
impl ResourceDataSyncSourceWithState {
         248  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         249  +
    pub fn deserialize_with_response(
         250  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         251  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         252  +
        _status: u16,
         253  +
        _body: &[u8],
         254  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         255  +
        Self::deserialize(deserializer)
         256  +
    }
         257  +
}
         258  +
impl ResourceDataSyncSourceWithState {
         259  +
    /// Creates a new builder-style object to manufacture [`ResourceDataSyncSourceWithState`](crate::types::ResourceDataSyncSourceWithState).
         260  +
    pub fn builder() -> crate::types::builders::ResourceDataSyncSourceWithStateBuilder {
         261  +
        crate::types::builders::ResourceDataSyncSourceWithStateBuilder::default()
         262  +
    }
         263  +
}
         264  +
         265  +
/// A builder for [`ResourceDataSyncSourceWithState`](crate::types::ResourceDataSyncSourceWithState).
         266  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         267  +
#[non_exhaustive]
         268  +
pub struct ResourceDataSyncSourceWithStateBuilder {
         269  +
    pub(crate) source_type: ::std::option::Option<::std::string::String>,
         270  +
    pub(crate) aws_organizations_source: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>,
         271  +
    pub(crate) source_regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         272  +
    pub(crate) include_future_regions: ::std::option::Option<bool>,
         273  +
    pub(crate) state: ::std::option::Option<::std::string::String>,
         274  +
    pub(crate) enable_all_ops_data_sources: ::std::option::Option<bool>,
         275  +
}
         276  +
impl ResourceDataSyncSourceWithStateBuilder {
         277  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>singleAccountMultiRegions</code>.</p>
         278  +
    pub fn source_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         279  +
        self.source_type = ::std::option::Option::Some(input.into());
         280  +
        self
         281  +
    }
         282  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>singleAccountMultiRegions</code>.</p>
         283  +
    pub fn set_source_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         284  +
        self.source_type = input;
         285  +
        self
         286  +
    }
         287  +
    /// <p>The type of data source for the resource data sync. <code>SourceType</code> is either <code>AwsOrganizations</code> (if an organization is present in Organizations) or <code>singleAccountMultiRegions</code>.</p>
         288  +
    pub fn get_source_type(&self) -> &::std::option::Option<::std::string::String> {
         289  +
        &self.source_type
         290  +
    }
         291  +
    /// <p>The field name in <code>SyncSource</code> for the <code>ResourceDataSyncAwsOrganizationsSource</code> type.</p>
         292  +
    pub fn aws_organizations_source(mut self, input: crate::types::ResourceDataSyncAwsOrganizationsSource) -> Self {
         293  +
        self.aws_organizations_source = ::std::option::Option::Some(input);
         294  +
        self
         295  +
    }
         296  +
    /// <p>The field name in <code>SyncSource</code> for the <code>ResourceDataSyncAwsOrganizationsSource</code> type.</p>
         297  +
    pub fn set_aws_organizations_source(mut self, input: ::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource>) -> Self {
         298  +
        self.aws_organizations_source = input;
         299  +
        self
         300  +
    }
         301  +
    /// <p>The field name in <code>SyncSource</code> for the <code>ResourceDataSyncAwsOrganizationsSource</code> type.</p>
         302  +
    pub fn get_aws_organizations_source(&self) -> &::std::option::Option<crate::types::ResourceDataSyncAwsOrganizationsSource> {
         303  +
        &self.aws_organizations_source
         304  +
    }
         305  +
    /// Appends an item to `source_regions`.
         306  +
    ///
         307  +
    /// To override the contents of this collection use [`set_source_regions`](Self::set_source_regions).
         308  +
    ///
         309  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         310  +
    pub fn source_regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         311  +
        let mut v = self.source_regions.unwrap_or_default();
         312  +
        v.push(input.into());
         313  +
        self.source_regions = ::std::option::Option::Some(v);
         314  +
        self
         315  +
    }
         316  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         317  +
    pub fn set_source_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         318  +
        self.source_regions = input;
         319  +
        self
         320  +
    }
         321  +
    /// <p>The <code>SyncSource</code> Amazon Web Services Regions included in the resource data sync.</p>
         322  +
    pub fn get_source_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         323  +
        &self.source_regions
         324  +
    }
         325  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         326  +
    pub fn include_future_regions(mut self, input: bool) -> Self {
         327  +
        self.include_future_regions = ::std::option::Option::Some(input);
         328  +
        self
         329  +
    }
         330  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         331  +
    pub fn set_include_future_regions(mut self, input: ::std::option::Option<bool>) -> Self {
         332  +
        self.include_future_regions = input;
         333  +
        self
         334  +
    }
         335  +
    /// <p>Whether to automatically synchronize and aggregate data from new Amazon Web Services Regions when those Regions come online.</p>
         336  +
    pub fn get_include_future_regions(&self) -> &::std::option::Option<bool> {
         337  +
        &self.include_future_regions
         338  +
    }
         339  +
    /// <p>The data type name for including resource data sync state. There are four sync states:</p>
         340  +
    /// <p><code>OrganizationNotExists</code>: Your organization doesn't exist.</p>
         341  +
    /// <p><code>NoPermissions</code>: The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Explorer.</p>
         342  +
    /// <p><code>InvalidOrganizationalUnit</code>: You specified or selected an invalid unit in the resource data sync configuration.</p>
         343  +
    /// <p><code>TrustedAccessDisabled</code>: You disabled Systems Manager access in the organization in Organizations.</p>
         344  +
    pub fn state(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         345  +
        self.state = ::std::option::Option::Some(input.into());
         346  +
        self
         347  +
    }
         348  +
    /// <p>The data type name for including resource data sync state. There are four sync states:</p>
         349  +
    /// <p><code>OrganizationNotExists</code>: Your organization doesn't exist.</p>
         350  +
    /// <p><code>NoPermissions</code>: The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Explorer.</p>
         351  +
    /// <p><code>InvalidOrganizationalUnit</code>: You specified or selected an invalid unit in the resource data sync configuration.</p>
         352  +
    /// <p><code>TrustedAccessDisabled</code>: You disabled Systems Manager access in the organization in Organizations.</p>
         353  +
    pub fn set_state(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         354  +
        self.state = input;
         355  +
        self
         356  +
    }
         357  +
    /// <p>The data type name for including resource data sync state. There are four sync states:</p>
         358  +
    /// <p><code>OrganizationNotExists</code>: Your organization doesn't exist.</p>
         359  +
    /// <p><code>NoPermissions</code>: The system can't locate the service-linked role. This role is automatically created when a user creates a resource data sync in Explorer.</p>
         360  +
    /// <p><code>InvalidOrganizationalUnit</code>: You specified or selected an invalid unit in the resource data sync configuration.</p>
         361  +
    /// <p><code>TrustedAccessDisabled</code>: You disabled Systems Manager access in the organization in Organizations.</p>
         362  +
    pub fn get_state(&self) -> &::std::option::Option<::std::string::String> {
         363  +
        &self.state
         364  +
    }
         365  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         366  +
    pub fn enable_all_ops_data_sources(mut self, input: bool) -> Self {
         367  +
        self.enable_all_ops_data_sources = ::std::option::Option::Some(input);
         368  +
        self
         369  +
    }
         370  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         371  +
    pub fn set_enable_all_ops_data_sources(mut self, input: ::std::option::Option<bool>) -> Self {
         372  +
        self.enable_all_ops_data_sources = input;
         373  +
        self
         374  +
    }
         375  +
    /// <p>When you create a resource data sync, if you choose one of the Organizations options, then Systems Manager automatically enables all OpsData sources in the selected Amazon Web Services Regions for all Amazon Web Services accounts in your organization (or in the selected organization units). For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html">Setting up Systems Manager Explorer to display data from multiple accounts and Regions</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p>
         376  +
    pub fn get_enable_all_ops_data_sources(&self) -> &::std::option::Option<bool> {
         377  +
        &self.enable_all_ops_data_sources
         378  +
    }
         379  +
    /// Consumes the builder and constructs a [`ResourceDataSyncSourceWithState`](crate::types::ResourceDataSyncSourceWithState).
         380  +
    pub fn build(self) -> crate::types::ResourceDataSyncSourceWithState {
         381  +
        crate::types::ResourceDataSyncSourceWithState {
         382  +
            source_type: self.source_type,
         383  +
            aws_organizations_source: self.aws_organizations_source,
         384  +
            source_regions: self.source_regions,
         385  +
            include_future_regions: self.include_future_regions.unwrap_or_default(),
         386  +
            state: self.state,
         387  +
            enable_all_ops_data_sources: self.enable_all_ops_data_sources.unwrap_or_default(),
         388  +
        }
         389  +
    }
         390  +
}