AWS SDK

AWS SDK

rev. bbca34fa2eddb4be623fbbc6b6df1a2401de0029

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/list_compliance_items/_list_compliance_items_input.rs

@@ -0,1 +0,393 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ListComplianceItemsInput {
           6  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
           7  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>>,
           8  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
           9  +
    pub resource_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          10  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
          11  +
    pub resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
          12  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
          13  +
    pub next_token: ::std::option::Option<::std::string::String>,
          14  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          15  +
    pub max_results: ::std::option::Option<i32>,
          16  +
}
          17  +
impl ListComplianceItemsInput {
          18  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
          19  +
    ///
          20  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
          21  +
    pub fn filters(&self) -> &[crate::types::ComplianceStringFilter] {
          22  +
        self.filters.as_deref().unwrap_or_default()
          23  +
    }
          24  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
          25  +
    ///
          26  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_ids.is_none()`.
          27  +
    pub fn resource_ids(&self) -> &[::std::string::String] {
          28  +
        self.resource_ids.as_deref().unwrap_or_default()
          29  +
    }
          30  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
          31  +
    ///
          32  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_types.is_none()`.
          33  +
    pub fn resource_types(&self) -> &[::std::string::String] {
          34  +
        self.resource_types.as_deref().unwrap_or_default()
          35  +
    }
          36  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
          37  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          38  +
        self.next_token.as_deref()
          39  +
    }
          40  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          41  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          42  +
        self.max_results
          43  +
    }
          44  +
}
          45  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          46  +
    ::aws_smithy_schema::ShapeId::from_parts(
          47  +
        "com.amazonaws.ssm#ComplianceStringFilterList$member",
          48  +
        "com.amazonaws.ssm",
          49  +
        "ComplianceStringFilterList",
          50  +
    ),
          51  +
    ::aws_smithy_schema::ShapeType::Structure,
          52  +
    "member",
          53  +
    0,
          54  +
)
          55  +
.with_xml_name("ComplianceFilter");
          56  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          57  +
    ::aws_smithy_schema::ShapeId::from_parts(
          58  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput$Filters",
          59  +
        "com.amazonaws.ssm.synthetic",
          60  +
        "ListComplianceItemsInput",
          61  +
    ),
          62  +
    ::aws_smithy_schema::ShapeType::List,
          63  +
    "Filters",
          64  +
    0,
          65  +
)
          66  +
.with_list_member(&LISTCOMPLIANCEITEMSINPUT_MEMBER_FILTERS_MEMBER);
          67  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_IDS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          68  +
    ::aws_smithy_schema::ShapeId::from_parts(
          69  +
        "com.amazonaws.ssm#ComplianceResourceIdList$member",
          70  +
        "com.amazonaws.ssm",
          71  +
        "ComplianceResourceIdList",
          72  +
    ),
          73  +
    ::aws_smithy_schema::ShapeType::String,
          74  +
    "member",
          75  +
    0,
          76  +
);
          77  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_IDS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          78  +
    ::aws_smithy_schema::ShapeId::from_parts(
          79  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput$ResourceIds",
          80  +
        "com.amazonaws.ssm.synthetic",
          81  +
        "ListComplianceItemsInput",
          82  +
    ),
          83  +
    ::aws_smithy_schema::ShapeType::List,
          84  +
    "ResourceIds",
          85  +
    1,
          86  +
)
          87  +
.with_list_member(&LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_IDS_MEMBER);
          88  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_TYPES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          89  +
    ::aws_smithy_schema::ShapeId::from_parts(
          90  +
        "com.amazonaws.ssm#ComplianceResourceTypeList$member",
          91  +
        "com.amazonaws.ssm",
          92  +
        "ComplianceResourceTypeList",
          93  +
    ),
          94  +
    ::aws_smithy_schema::ShapeType::String,
          95  +
    "member",
          96  +
    0,
          97  +
);
          98  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_TYPES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          99  +
    ::aws_smithy_schema::ShapeId::from_parts(
         100  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput$ResourceTypes",
         101  +
        "com.amazonaws.ssm.synthetic",
         102  +
        "ListComplianceItemsInput",
         103  +
    ),
         104  +
    ::aws_smithy_schema::ShapeType::List,
         105  +
    "ResourceTypes",
         106  +
    2,
         107  +
)
         108  +
.with_list_member(&LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_TYPES_MEMBER);
         109  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         110  +
    ::aws_smithy_schema::ShapeId::from_parts(
         111  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput$NextToken",
         112  +
        "com.amazonaws.ssm.synthetic",
         113  +
        "ListComplianceItemsInput",
         114  +
    ),
         115  +
    ::aws_smithy_schema::ShapeType::String,
         116  +
    "NextToken",
         117  +
    3,
         118  +
);
         119  +
static LISTCOMPLIANCEITEMSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         120  +
    ::aws_smithy_schema::ShapeId::from_parts(
         121  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput$MaxResults",
         122  +
        "com.amazonaws.ssm.synthetic",
         123  +
        "ListComplianceItemsInput",
         124  +
    ),
         125  +
    ::aws_smithy_schema::ShapeType::Integer,
         126  +
    "MaxResults",
         127  +
    4,
         128  +
);
         129  +
static LISTCOMPLIANCEITEMSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         130  +
    ::aws_smithy_schema::ShapeId::from_parts(
         131  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsInput",
         132  +
        "com.amazonaws.ssm.synthetic",
         133  +
        "ListComplianceItemsInput",
         134  +
    ),
         135  +
    ::aws_smithy_schema::ShapeType::Structure,
         136  +
    &[
         137  +
        &LISTCOMPLIANCEITEMSINPUT_MEMBER_FILTERS,
         138  +
        &LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_IDS,
         139  +
        &LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_TYPES,
         140  +
        &LISTCOMPLIANCEITEMSINPUT_MEMBER_NEXT_TOKEN,
         141  +
        &LISTCOMPLIANCEITEMSINPUT_MEMBER_MAX_RESULTS,
         142  +
    ],
         143  +
)
         144  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         145  +
.with_original_name("ListComplianceItemsRequest");
         146  +
impl ListComplianceItemsInput {
         147  +
    /// The schema for this shape.
         148  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &LISTCOMPLIANCEITEMSINPUT_SCHEMA;
         149  +
}
         150  +
impl ::aws_smithy_schema::serde::SerializableStruct for ListComplianceItemsInput {
         151  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         152  +
    fn serialize_members(
         153  +
        &self,
         154  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         155  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         156  +
        if let Some(ref val) = self.filters {
         157  +
            ser.write_list(
         158  +
                &LISTCOMPLIANCEITEMSINPUT_MEMBER_FILTERS,
         159  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         160  +
                    for item in val {
         161  +
                        ser.write_struct(crate::types::ComplianceStringFilter::SCHEMA, item)?;
         162  +
                    }
         163  +
                    Ok(())
         164  +
                },
         165  +
            )?;
         166  +
        }
         167  +
        if let Some(ref val) = self.resource_ids {
         168  +
            ser.write_list(
         169  +
                &LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_IDS,
         170  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         171  +
                    for item in val {
         172  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         173  +
                    }
         174  +
                    Ok(())
         175  +
                },
         176  +
            )?;
         177  +
        }
         178  +
        if let Some(ref val) = self.resource_types {
         179  +
            ser.write_list(
         180  +
                &LISTCOMPLIANCEITEMSINPUT_MEMBER_RESOURCE_TYPES,
         181  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         182  +
                    for item in val {
         183  +
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
         184  +
                    }
         185  +
                    Ok(())
         186  +
                },
         187  +
            )?;
         188  +
        }
         189  +
        if let Some(ref val) = self.next_token {
         190  +
            ser.write_string(&LISTCOMPLIANCEITEMSINPUT_MEMBER_NEXT_TOKEN, val)?;
         191  +
        }
         192  +
        if let Some(ref val) = self.max_results {
         193  +
            ser.write_integer(&LISTCOMPLIANCEITEMSINPUT_MEMBER_MAX_RESULTS, *val)?;
         194  +
        }
         195  +
        Ok(())
         196  +
    }
         197  +
}
         198  +
impl ListComplianceItemsInput {
         199  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         200  +
    pub fn deserialize(
         201  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         202  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         203  +
        #[allow(unused_variables, unused_mut)]
         204  +
        let mut builder = Self::builder();
         205  +
        #[allow(
         206  +
            unused_variables,
         207  +
            unreachable_code,
         208  +
            clippy::single_match,
         209  +
            clippy::match_single_binding,
         210  +
            clippy::diverging_sub_expression
         211  +
        )]
         212  +
        deserializer.read_struct(&LISTCOMPLIANCEITEMSINPUT_SCHEMA, &mut |member, deser| {
         213  +
            match member.member_index() {
         214  +
                Some(0) => {
         215  +
                    if deser.is_null() {
         216  +
                        deser.read_null()?;
         217  +
                    } else {
         218  +
                        builder.filters = Some({
         219  +
                            let mut container = Vec::new();
         220  +
                            deser.read_list(member, &mut |deser| {
         221  +
                                container.push(crate::types::ComplianceStringFilter::deserialize(deser)?);
         222  +
                                Ok(())
         223  +
                            })?;
         224  +
                            container
         225  +
                        });
         226  +
                    }
         227  +
                }
         228  +
                Some(1) => {
         229  +
                    if deser.is_null() {
         230  +
                        deser.read_null()?;
         231  +
                    } else {
         232  +
                        builder.resource_ids = Some(deser.read_string_list(member)?);
         233  +
                    }
         234  +
                }
         235  +
                Some(2) => {
         236  +
                    if deser.is_null() {
         237  +
                        deser.read_null()?;
         238  +
                    } else {
         239  +
                        builder.resource_types = Some(deser.read_string_list(member)?);
         240  +
                    }
         241  +
                }
         242  +
                Some(3) => {
         243  +
                    if deser.is_null() {
         244  +
                        deser.read_null()?;
         245  +
                    } else {
         246  +
                        builder.next_token = Some(deser.read_string(member)?);
         247  +
                    }
         248  +
                }
         249  +
                Some(4) => {
         250  +
                    if deser.is_null() {
         251  +
                        deser.read_null()?;
         252  +
                    } else {
         253  +
                        builder.max_results = Some(deser.read_integer(member)?);
         254  +
                    }
         255  +
                }
         256  +
                _ => {}
         257  +
            }
         258  +
            Ok(())
         259  +
        })?;
         260  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         261  +
    }
         262  +
}
         263  +
impl ListComplianceItemsInput {
         264  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         265  +
    pub fn deserialize_with_response(
         266  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         267  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         268  +
        _status: u16,
         269  +
        _body: &[u8],
         270  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         271  +
        Self::deserialize(deserializer)
         272  +
    }
         273  +
}
         274  +
impl ListComplianceItemsInput {
         275  +
    /// Creates a new builder-style object to manufacture [`ListComplianceItemsInput`](crate::operation::list_compliance_items::ListComplianceItemsInput).
         276  +
    pub fn builder() -> crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder {
         277  +
        crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder::default()
         278  +
    }
         279  +
}
         280  +
         281  +
/// A builder for [`ListComplianceItemsInput`](crate::operation::list_compliance_items::ListComplianceItemsInput).
         282  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         283  +
#[non_exhaustive]
         284  +
pub struct ListComplianceItemsInputBuilder {
         285  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>>,
         286  +
    pub(crate) resource_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         287  +
    pub(crate) resource_types: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         288  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         289  +
    pub(crate) max_results: ::std::option::Option<i32>,
         290  +
}
         291  +
impl ListComplianceItemsInputBuilder {
         292  +
    /// Appends an item to `filters`.
         293  +
    ///
         294  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         295  +
    ///
         296  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         297  +
    pub fn filters(mut self, input: crate::types::ComplianceStringFilter) -> Self {
         298  +
        let mut v = self.filters.unwrap_or_default();
         299  +
        v.push(input);
         300  +
        self.filters = ::std::option::Option::Some(v);
         301  +
        self
         302  +
    }
         303  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         304  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>>) -> Self {
         305  +
        self.filters = input;
         306  +
        self
         307  +
    }
         308  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         309  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>> {
         310  +
        &self.filters
         311  +
    }
         312  +
    /// Appends an item to `resource_ids`.
         313  +
    ///
         314  +
    /// To override the contents of this collection use [`set_resource_ids`](Self::set_resource_ids).
         315  +
    ///
         316  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         317  +
    pub fn resource_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         318  +
        let mut v = self.resource_ids.unwrap_or_default();
         319  +
        v.push(input.into());
         320  +
        self.resource_ids = ::std::option::Option::Some(v);
         321  +
        self
         322  +
    }
         323  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         324  +
    pub fn set_resource_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         325  +
        self.resource_ids = input;
         326  +
        self
         327  +
    }
         328  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         329  +
    pub fn get_resource_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         330  +
        &self.resource_ids
         331  +
    }
         332  +
    /// Appends an item to `resource_types`.
         333  +
    ///
         334  +
    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
         335  +
    ///
         336  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         337  +
    pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         338  +
        let mut v = self.resource_types.unwrap_or_default();
         339  +
        v.push(input.into());
         340  +
        self.resource_types = ::std::option::Option::Some(v);
         341  +
        self
         342  +
    }
         343  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         344  +
    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         345  +
        self.resource_types = input;
         346  +
        self
         347  +
    }
         348  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         349  +
    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         350  +
        &self.resource_types
         351  +
    }
         352  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         353  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         354  +
        self.next_token = ::std::option::Option::Some(input.into());
         355  +
        self
         356  +
    }
         357  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         358  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         359  +
        self.next_token = input;
         360  +
        self
         361  +
    }
         362  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         363  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         364  +
        &self.next_token
         365  +
    }
         366  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         367  +
    pub fn max_results(mut self, input: i32) -> Self {
         368  +
        self.max_results = ::std::option::Option::Some(input);
         369  +
        self
         370  +
    }
         371  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         372  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         373  +
        self.max_results = input;
         374  +
        self
         375  +
    }
         376  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         377  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         378  +
        &self.max_results
         379  +
    }
         380  +
    /// Consumes the builder and constructs a [`ListComplianceItemsInput`](crate::operation::list_compliance_items::ListComplianceItemsInput).
         381  +
    pub fn build(
         382  +
        self,
         383  +
    ) -> ::std::result::Result<crate::operation::list_compliance_items::ListComplianceItemsInput, ::aws_smithy_types::error::operation::BuildError>
         384  +
    {
         385  +
        ::std::result::Result::Ok(crate::operation::list_compliance_items::ListComplianceItemsInput {
         386  +
            filters: self.filters,
         387  +
            resource_ids: self.resource_ids,
         388  +
            resource_types: self.resource_types,
         389  +
            next_token: self.next_token,
         390  +
            max_results: self.max_results,
         391  +
        })
         392  +
    }
         393  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/list_compliance_items/_list_compliance_items_output.rs

@@ -0,1 +0,270 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct ListComplianceItemsOutput {
           6  +
    /// <p>A list of compliance information for the specified resource ID.</p>
           7  +
    pub compliance_items: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceItem>>,
           8  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
           9  +
    pub next_token: ::std::option::Option<::std::string::String>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl ListComplianceItemsOutput {
          13  +
    /// <p>A list of compliance information for the specified resource ID.</p>
          14  +
    ///
          15  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.compliance_items.is_none()`.
          16  +
    pub fn compliance_items(&self) -> &[crate::types::ComplianceItem] {
          17  +
        self.compliance_items.as_deref().unwrap_or_default()
          18  +
    }
          19  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
          20  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          21  +
        self.next_token.as_deref()
          22  +
    }
          23  +
}
          24  +
static LISTCOMPLIANCEITEMSOUTPUT_MEMBER_COMPLIANCE_ITEMS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          25  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ComplianceItemList$member", "com.amazonaws.ssm", "ComplianceItemList"),
          26  +
    ::aws_smithy_schema::ShapeType::Structure,
          27  +
    "member",
          28  +
    0,
          29  +
)
          30  +
.with_xml_name("Item");
          31  +
static LISTCOMPLIANCEITEMSOUTPUT_MEMBER_COMPLIANCE_ITEMS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_parts(
          33  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsOutput$ComplianceItems",
          34  +
        "com.amazonaws.ssm.synthetic",
          35  +
        "ListComplianceItemsOutput",
          36  +
    ),
          37  +
    ::aws_smithy_schema::ShapeType::List,
          38  +
    "ComplianceItems",
          39  +
    0,
          40  +
)
          41  +
.with_list_member(&LISTCOMPLIANCEITEMSOUTPUT_MEMBER_COMPLIANCE_ITEMS_MEMBER);
          42  +
static LISTCOMPLIANCEITEMSOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          43  +
    ::aws_smithy_schema::ShapeId::from_parts(
          44  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsOutput$NextToken",
          45  +
        "com.amazonaws.ssm.synthetic",
          46  +
        "ListComplianceItemsOutput",
          47  +
    ),
          48  +
    ::aws_smithy_schema::ShapeType::String,
          49  +
    "NextToken",
          50  +
    1,
          51  +
);
          52  +
static LISTCOMPLIANCEITEMSOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          53  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          54  +
    ::aws_smithy_schema::ShapeType::String,
          55  +
    "request_id",
          56  +
    2,
          57  +
)
          58  +
.with_http_header("x-amzn-requestid");
          59  +
static LISTCOMPLIANCEITEMSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          60  +
    ::aws_smithy_schema::ShapeId::from_parts(
          61  +
        "com.amazonaws.ssm.synthetic#ListComplianceItemsOutput",
          62  +
        "com.amazonaws.ssm.synthetic",
          63  +
        "ListComplianceItemsOutput",
          64  +
    ),
          65  +
    ::aws_smithy_schema::ShapeType::Structure,
          66  +
    &[
          67  +
        &LISTCOMPLIANCEITEMSOUTPUT_MEMBER_COMPLIANCE_ITEMS,
          68  +
        &LISTCOMPLIANCEITEMSOUTPUT_MEMBER_NEXT_TOKEN,
          69  +
        &LISTCOMPLIANCEITEMSOUTPUT_MEMBER__REQUEST_ID,
          70  +
    ],
          71  +
)
          72  +
.with_original_name("ListComplianceItemsResult");
          73  +
impl ListComplianceItemsOutput {
          74  +
    /// The schema for this shape.
          75  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &LISTCOMPLIANCEITEMSOUTPUT_SCHEMA;
          76  +
}
          77  +
impl ::aws_smithy_schema::serde::SerializableStruct for ListComplianceItemsOutput {
          78  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          79  +
    fn serialize_members(
          80  +
        &self,
          81  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          82  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          83  +
        if let Some(ref val) = self.compliance_items {
          84  +
            ser.write_list(
          85  +
                &LISTCOMPLIANCEITEMSOUTPUT_MEMBER_COMPLIANCE_ITEMS,
          86  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          87  +
                    for item in val {
          88  +
                        ser.write_struct(crate::types::ComplianceItem::SCHEMA, item)?;
          89  +
                    }
          90  +
                    Ok(())
          91  +
                },
          92  +
            )?;
          93  +
        }
          94  +
        if let Some(ref val) = self.next_token {
          95  +
            ser.write_string(&LISTCOMPLIANCEITEMSOUTPUT_MEMBER_NEXT_TOKEN, val)?;
          96  +
        }
          97  +
        Ok(())
          98  +
    }
          99  +
}
         100  +
impl ListComplianceItemsOutput {
         101  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         102  +
    pub fn deserialize(
         103  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         104  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         105  +
        #[allow(unused_variables, unused_mut)]
         106  +
        let mut builder = Self::builder();
         107  +
        #[allow(
         108  +
            unused_variables,
         109  +
            unreachable_code,
         110  +
            clippy::single_match,
         111  +
            clippy::match_single_binding,
         112  +
            clippy::diverging_sub_expression
         113  +
        )]
         114  +
        deserializer.read_struct(&LISTCOMPLIANCEITEMSOUTPUT_SCHEMA, &mut |member, deser| {
         115  +
            match member.member_index() {
         116  +
                Some(0) => {
         117  +
                    if deser.is_null() {
         118  +
                        deser.read_null()?;
         119  +
                    } else {
         120  +
                        builder.compliance_items = Some({
         121  +
                            let mut container = Vec::new();
         122  +
                            deser.read_list(member, &mut |deser| {
         123  +
                                container.push(crate::types::ComplianceItem::deserialize(deser)?);
         124  +
                                Ok(())
         125  +
                            })?;
         126  +
                            container
         127  +
                        });
         128  +
                    }
         129  +
                }
         130  +
                Some(1) => {
         131  +
                    if deser.is_null() {
         132  +
                        deser.read_null()?;
         133  +
                    } else {
         134  +
                        builder.next_token = Some(deser.read_string(member)?);
         135  +
                    }
         136  +
                }
         137  +
                Some(2) => {
         138  +
                    builder._request_id = Some(deser.read_string(member)?);
         139  +
                }
         140  +
                _ => {}
         141  +
            }
         142  +
            Ok(())
         143  +
        })?;
         144  +
        Ok(builder.build())
         145  +
    }
         146  +
}
         147  +
impl ListComplianceItemsOutput {
         148  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         149  +
    /// Header-bound members are read directly from headers, avoiding runtime
         150  +
    /// member iteration overhead. Body members are read via the deserializer.
         151  +
    pub fn deserialize_with_response(
         152  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         153  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         154  +
        _status: u16,
         155  +
        _body: &[u8],
         156  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         157  +
        #[allow(unused_variables, unused_mut)]
         158  +
        let mut builder = Self::builder();
         159  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         160  +
            builder._request_id = Some(val.to_string());
         161  +
        }
         162  +
         163  +
        #[allow(
         164  +
            unused_variables,
         165  +
            unreachable_code,
         166  +
            clippy::single_match,
         167  +
            clippy::match_single_binding,
         168  +
            clippy::diverging_sub_expression
         169  +
        )]
         170  +
        deserializer.read_struct(&LISTCOMPLIANCEITEMSOUTPUT_SCHEMA, &mut |member, deser| {
         171  +
            match member.member_index() {
         172  +
                Some(0) => {
         173  +
                    builder.compliance_items = Some({
         174  +
                        let mut container = Vec::new();
         175  +
                        deser.read_list(member, &mut |deser| {
         176  +
                            container.push(crate::types::ComplianceItem::deserialize(deser)?);
         177  +
                            Ok(())
         178  +
                        })?;
         179  +
                        container
         180  +
                    });
         181  +
                }
         182  +
                Some(1) => {
         183  +
                    builder.next_token = Some(deser.read_string(member)?);
         184  +
                }
         185  +
                _ => {}
         186  +
            }
         187  +
            Ok(())
         188  +
        })?;
         189  +
        Ok(builder.build())
         190  +
    }
         191  +
}
         192  +
impl ::aws_types::request_id::RequestId for ListComplianceItemsOutput {
         193  +
    fn request_id(&self) -> Option<&str> {
         194  +
        self._request_id.as_deref()
         195  +
    }
         196  +
}
         197  +
impl ListComplianceItemsOutput {
         198  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         199  +
        self._request_id = request_id;
         200  +
        self
         201  +
    }
         202  +
}
         203  +
impl ListComplianceItemsOutput {
         204  +
    /// Creates a new builder-style object to manufacture [`ListComplianceItemsOutput`](crate::operation::list_compliance_items::ListComplianceItemsOutput).
         205  +
    pub fn builder() -> crate::operation::list_compliance_items::builders::ListComplianceItemsOutputBuilder {
         206  +
        crate::operation::list_compliance_items::builders::ListComplianceItemsOutputBuilder::default()
         207  +
    }
         208  +
}
         209  +
         210  +
/// A builder for [`ListComplianceItemsOutput`](crate::operation::list_compliance_items::ListComplianceItemsOutput).
         211  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         212  +
#[non_exhaustive]
         213  +
pub struct ListComplianceItemsOutputBuilder {
         214  +
    pub(crate) compliance_items: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceItem>>,
         215  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         216  +
    _request_id: Option<String>,
         217  +
}
         218  +
impl ListComplianceItemsOutputBuilder {
         219  +
    /// Appends an item to `compliance_items`.
         220  +
    ///
         221  +
    /// To override the contents of this collection use [`set_compliance_items`](Self::set_compliance_items).
         222  +
    ///
         223  +
    /// <p>A list of compliance information for the specified resource ID.</p>
         224  +
    pub fn compliance_items(mut self, input: crate::types::ComplianceItem) -> Self {
         225  +
        let mut v = self.compliance_items.unwrap_or_default();
         226  +
        v.push(input);
         227  +
        self.compliance_items = ::std::option::Option::Some(v);
         228  +
        self
         229  +
    }
         230  +
    /// <p>A list of compliance information for the specified resource ID.</p>
         231  +
    pub fn set_compliance_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceItem>>) -> Self {
         232  +
        self.compliance_items = input;
         233  +
        self
         234  +
    }
         235  +
    /// <p>A list of compliance information for the specified resource ID.</p>
         236  +
    pub fn get_compliance_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComplianceItem>> {
         237  +
        &self.compliance_items
         238  +
    }
         239  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         240  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         241  +
        self.next_token = ::std::option::Option::Some(input.into());
         242  +
        self
         243  +
    }
         244  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         245  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         246  +
        self.next_token = input;
         247  +
        self
         248  +
    }
         249  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         250  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         251  +
        &self.next_token
         252  +
    }
         253  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         254  +
        self._request_id = Some(request_id.into());
         255  +
        self
         256  +
    }
         257  +
         258  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         259  +
        self._request_id = request_id;
         260  +
        self
         261  +
    }
         262  +
    /// Consumes the builder and constructs a [`ListComplianceItemsOutput`](crate::operation::list_compliance_items::ListComplianceItemsOutput).
         263  +
    pub fn build(self) -> crate::operation::list_compliance_items::ListComplianceItemsOutput {
         264  +
        crate::operation::list_compliance_items::ListComplianceItemsOutput {
         265  +
            compliance_items: self.compliance_items,
         266  +
            next_token: self.next_token,
         267  +
            _request_id: self._request_id,
         268  +
        }
         269  +
    }
         270  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/list_compliance_items/builders.rs

@@ -0,1 +0,202 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::list_compliance_items::_list_compliance_items_input::ListComplianceItemsInputBuilder;
           3  +
           4  +
pub use crate::operation::list_compliance_items::_list_compliance_items_output::ListComplianceItemsOutputBuilder;
           5  +
           6  +
impl crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::list_compliance_items::ListComplianceItemsOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::list_compliance_items::ListComplianceItemsError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.list_compliance_items();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `ListComplianceItems`.
          24  +
///
          25  +
/// <p>For a specified resource ID, this API operation returns a list of compliance statuses for different resource types. Currently, you can only specify one resource ID per call. List results depend on the criteria specified in the filter.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct ListComplianceItemsFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::list_compliance_items::ListComplianceItemsOutput,
          35  +
        crate::operation::list_compliance_items::ListComplianceItemsError,
          36  +
    > for ListComplianceItemsFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::list_compliance_items::ListComplianceItemsOutput,
          44  +
            crate::operation::list_compliance_items::ListComplianceItemsError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl ListComplianceItemsFluentBuilder {
          51  +
    /// Creates a new `ListComplianceItemsFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the ListComplianceItems as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::list_compliance_items::ListComplianceItemsOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::list_compliance_items::ListComplianceItemsError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::list_compliance_items::ListComplianceItems::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::list_compliance_items::ListComplianceItems::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::list_compliance_items::ListComplianceItemsOutput,
          97  +
        crate::operation::list_compliance_items::ListComplianceItemsError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// Create a paginator for this request
         112  +
    ///
         113  +
    /// Paginators are used by calling [`send().await`](crate::operation::list_compliance_items::paginator::ListComplianceItemsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
         114  +
    pub fn into_paginator(self) -> crate::operation::list_compliance_items::paginator::ListComplianceItemsPaginator {
         115  +
        crate::operation::list_compliance_items::paginator::ListComplianceItemsPaginator::new(self.handle, self.inner)
         116  +
    }
         117  +
    ///
         118  +
    /// Appends an item to `Filters`.
         119  +
    ///
         120  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         121  +
    ///
         122  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         123  +
    pub fn filters(mut self, input: crate::types::ComplianceStringFilter) -> Self {
         124  +
        self.inner = self.inner.filters(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         128  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>>) -> Self {
         129  +
        self.inner = self.inner.set_filters(input);
         130  +
        self
         131  +
    }
         132  +
    /// <p>One or more compliance filters. Use a filter to return a more specific list of results.</p>
         133  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComplianceStringFilter>> {
         134  +
        self.inner.get_filters()
         135  +
    }
         136  +
    ///
         137  +
    /// Appends an item to `ResourceIds`.
         138  +
    ///
         139  +
    /// To override the contents of this collection use [`set_resource_ids`](Self::set_resource_ids).
         140  +
    ///
         141  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         142  +
    pub fn resource_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         143  +
        self.inner = self.inner.resource_ids(input.into());
         144  +
        self
         145  +
    }
         146  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         147  +
    pub fn set_resource_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         148  +
        self.inner = self.inner.set_resource_ids(input);
         149  +
        self
         150  +
    }
         151  +
    /// <p>The ID for the resources from which to get compliance information. Currently, you can only specify one resource ID.</p>
         152  +
    pub fn get_resource_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         153  +
        self.inner.get_resource_ids()
         154  +
    }
         155  +
    ///
         156  +
    /// Appends an item to `ResourceTypes`.
         157  +
    ///
         158  +
    /// To override the contents of this collection use [`set_resource_types`](Self::set_resource_types).
         159  +
    ///
         160  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         161  +
    pub fn resource_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         162  +
        self.inner = self.inner.resource_types(input.into());
         163  +
        self
         164  +
    }
         165  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         166  +
    pub fn set_resource_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         167  +
        self.inner = self.inner.set_resource_types(input);
         168  +
        self
         169  +
    }
         170  +
    /// <p>The type of resource from which to get compliance information. Currently, the only supported resource type is <code>ManagedInstance</code>.</p>
         171  +
    pub fn get_resource_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         172  +
        self.inner.get_resource_types()
         173  +
    }
         174  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         175  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         176  +
        self.inner = self.inner.next_token(input.into());
         177  +
        self
         178  +
    }
         179  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         180  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         181  +
        self.inner = self.inner.set_next_token(input);
         182  +
        self
         183  +
    }
         184  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         185  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         186  +
        self.inner.get_next_token()
         187  +
    }
         188  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         189  +
    pub fn max_results(mut self, input: i32) -> Self {
         190  +
        self.inner = self.inner.max_results(input);
         191  +
        self
         192  +
    }
         193  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         194  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         195  +
        self.inner = self.inner.set_max_results(input);
         196  +
        self
         197  +
    }
         198  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         199  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         200  +
        self.inner.get_max_results()
         201  +
    }
         202  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/list_compliance_items/paginator.rs

@@ -0,1 +0,148 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Paginator for [`ListComplianceItems`](crate::operation::list_compliance_items::ListComplianceItems)
           3  +
pub struct ListComplianceItemsPaginator {
           4  +
    handle: std::sync::Arc<crate::client::Handle>,
           5  +
    builder: crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder,
           6  +
    stop_on_duplicate_token: bool,
           7  +
}
           8  +
           9  +
impl ListComplianceItemsPaginator {
          10  +
    /// Create a new paginator-wrapper
          11  +
    pub(crate) fn new(
          12  +
        handle: std::sync::Arc<crate::client::Handle>,
          13  +
        builder: crate::operation::list_compliance_items::builders::ListComplianceItemsInputBuilder,
          14  +
    ) -> Self {
          15  +
        Self {
          16  +
            handle,
          17  +
            builder,
          18  +
            stop_on_duplicate_token: true,
          19  +
        }
          20  +
    }
          21  +
          22  +
    /// Set the page size
          23  +
    ///
          24  +
    /// _Note: this method will override any previously set value for `max_results`_
          25  +
    pub fn page_size(mut self, limit: i32) -> Self {
          26  +
        self.builder.max_results = ::std::option::Option::Some(limit);
          27  +
        self
          28  +
    }
          29  +
          30  +
    /// Create a flattened paginator
          31  +
    ///
          32  +
    /// This paginator automatically flattens results using `compliance_items`. Queries to the underlying service
          33  +
    /// are dispatched lazily.
          34  +
    pub fn items(self) -> crate::operation::list_compliance_items::paginator::ListComplianceItemsPaginatorItems {
          35  +
        crate::operation::list_compliance_items::paginator::ListComplianceItemsPaginatorItems(self)
          36  +
    }
          37  +
          38  +
    /// Stop paginating when the service returns the same pagination token twice in a row.
          39  +
    ///
          40  +
    /// Defaults to true.
          41  +
    ///
          42  +
    /// For certain operations, it may be useful to continue on duplicate token. For example,
          43  +
    /// if an operation is for tailing a log file in real-time, then continuing may be desired.
          44  +
    /// This option can be set to `false` to accommodate these use cases.
          45  +
    pub fn stop_on_duplicate_token(mut self, stop_on_duplicate_token: bool) -> Self {
          46  +
        self.stop_on_duplicate_token = stop_on_duplicate_token;
          47  +
        self
          48  +
    }
          49  +
          50  +
    /// Create the pagination stream
          51  +
    ///
          52  +
    /// _Note:_ No requests will be dispatched until the stream is used
          53  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
          54  +
    pub fn send(
          55  +
        self,
          56  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
          57  +
        ::std::result::Result<
          58  +
            crate::operation::list_compliance_items::ListComplianceItemsOutput,
          59  +
            ::aws_smithy_runtime_api::client::result::SdkError<
          60  +
                crate::operation::list_compliance_items::ListComplianceItemsError,
          61  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          62  +
            >,
          63  +
        >,
          64  +
    > {
          65  +
        // Move individual fields out of self for the borrow checker
          66  +
        let builder = self.builder;
          67  +
        let handle = self.handle;
          68  +
        let runtime_plugins = crate::operation::list_compliance_items::ListComplianceItems::operation_runtime_plugins(
          69  +
            handle.runtime_plugins.clone(),
          70  +
            &handle.conf,
          71  +
            ::std::option::Option::None,
          72  +
        )
          73  +
        .with_operation_plugin(crate::sdk_feature_tracker::paginator::PaginatorFeatureTrackerRuntimePlugin::new());
          74  +
        ::aws_smithy_async::future::pagination_stream::PaginationStream::new(::aws_smithy_async::future::pagination_stream::fn_stream::FnStream::new(
          75  +
            move |tx| {
          76  +
                ::std::boxed::Box::pin(async move {
          77  +
                    // Build the input for the first time. If required fields are missing, this is where we'll produce an early error.
          78  +
                    let mut input = match builder
          79  +
                        .build()
          80  +
                        .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
          81  +
                    {
          82  +
                        ::std::result::Result::Ok(input) => input,
          83  +
                        ::std::result::Result::Err(e) => {
          84  +
                            let _ = tx.send(::std::result::Result::Err(e)).await;
          85  +
                            return;
          86  +
                        }
          87  +
                    };
          88  +
                    loop {
          89  +
                        let resp = crate::operation::list_compliance_items::ListComplianceItems::orchestrate(&runtime_plugins, input.clone()).await;
          90  +
                        // If the input member is None or it was an error
          91  +
                        let done = match resp {
          92  +
                            ::std::result::Result::Ok(ref resp) => {
          93  +
                                let new_token = crate::lens::reflens_list_compliance_items_output_output_next_token(resp);
          94  +
                                // Pagination is exhausted when the next token is an empty string
          95  +
                                let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
          96  +
                                if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token {
          97  +
                                    true
          98  +
                                } else {
          99  +
                                    input.next_token = new_token.cloned();
         100  +
                                    is_empty
         101  +
                                }
         102  +
                            }
         103  +
                            ::std::result::Result::Err(_) => true,
         104  +
                        };
         105  +
                        if tx.send(resp).await.is_err() {
         106  +
                            // receiving end was dropped
         107  +
                            return;
         108  +
                        }
         109  +
                        if done {
         110  +
                            return;
         111  +
                        }
         112  +
                    }
         113  +
                })
         114  +
            },
         115  +
        ))
         116  +
    }
         117  +
}
         118  +
         119  +
/// Flattened paginator for `ListComplianceItemsPaginator`
         120  +
///
         121  +
/// This is created with [`.items()`](ListComplianceItemsPaginator::items)
         122  +
pub struct ListComplianceItemsPaginatorItems(ListComplianceItemsPaginator);
         123  +
         124  +
impl ListComplianceItemsPaginatorItems {
         125  +
    /// Create the pagination stream
         126  +
    ///
         127  +
    /// _Note_: No requests will be dispatched until the stream is used
         128  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
         129  +
    ///
         130  +
    /// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect).
         131  +
    pub fn send(
         132  +
        self,
         133  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
         134  +
        ::std::result::Result<
         135  +
            crate::types::ComplianceItem,
         136  +
            ::aws_smithy_runtime_api::client::result::SdkError<
         137  +
                crate::operation::list_compliance_items::ListComplianceItemsError,
         138  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         139  +
            >,
         140  +
        >,
         141  +
    > {
         142  +
        ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
         143  +
            crate::lens::lens_list_compliance_items_output_output_compliance_items(page)
         144  +
                .unwrap_or_default()
         145  +
                .into_iter()
         146  +
        })
         147  +
    }
         148  +
}