AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory/_get_inventory_input.rs

@@ -0,1 +0,400 @@
           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 GetInventoryInput {
           6  +
    /// <p>One or more filters. Use a filter to return a more specific list of results.</p>
           7  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::InventoryFilter>>,
           8  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
           9  +
    pub aggregators: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>,
          10  +
    /// <p>The list of inventory item types to return.</p>
          11  +
    pub result_attributes: ::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>>,
          12  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</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 GetInventoryInput {
          18  +
    /// <p>One or more 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::InventoryFilter] {
          22  +
        self.filters.as_deref().unwrap_or_default()
          23  +
    }
          24  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</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 `.aggregators.is_none()`.
          27  +
    pub fn aggregators(&self) -> &[crate::types::InventoryAggregator] {
          28  +
        self.aggregators.as_deref().unwrap_or_default()
          29  +
    }
          30  +
    /// <p>The list of inventory item types to return.</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 `.result_attributes.is_none()`.
          33  +
    pub fn result_attributes(&self) -> &[crate::types::ResultAttribute] {
          34  +
        self.result_attributes.as_deref().unwrap_or_default()
          35  +
    }
          36  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</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 GETINVENTORYINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          46  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#InventoryFilterList$member", "com.amazonaws.ssm", "InventoryFilterList"),
          47  +
    ::aws_smithy_schema::ShapeType::Structure,
          48  +
    "member",
          49  +
    0,
          50  +
)
          51  +
.with_xml_name("InventoryFilter");
          52  +
static GETINVENTORYINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          53  +
    ::aws_smithy_schema::ShapeId::from_parts(
          54  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput$Filters",
          55  +
        "com.amazonaws.ssm.synthetic",
          56  +
        "GetInventoryInput",
          57  +
    ),
          58  +
    ::aws_smithy_schema::ShapeType::List,
          59  +
    "Filters",
          60  +
    0,
          61  +
)
          62  +
.with_list_member(&GETINVENTORYINPUT_MEMBER_FILTERS_MEMBER);
          63  +
static GETINVENTORYINPUT_MEMBER_AGGREGATORS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm#InventoryAggregatorList$member",
          66  +
        "com.amazonaws.ssm",
          67  +
        "InventoryAggregatorList",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::Structure,
          70  +
    "member",
          71  +
    0,
          72  +
)
          73  +
.with_xml_name("Aggregator");
          74  +
static GETINVENTORYINPUT_MEMBER_AGGREGATORS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          75  +
    ::aws_smithy_schema::ShapeId::from_parts(
          76  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput$Aggregators",
          77  +
        "com.amazonaws.ssm.synthetic",
          78  +
        "GetInventoryInput",
          79  +
    ),
          80  +
    ::aws_smithy_schema::ShapeType::List,
          81  +
    "Aggregators",
          82  +
    1,
          83  +
)
          84  +
.with_list_member(&GETINVENTORYINPUT_MEMBER_AGGREGATORS_MEMBER);
          85  +
static GETINVENTORYINPUT_MEMBER_RESULT_ATTRIBUTES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          86  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#ResultAttributeList$member", "com.amazonaws.ssm", "ResultAttributeList"),
          87  +
    ::aws_smithy_schema::ShapeType::Structure,
          88  +
    "member",
          89  +
    0,
          90  +
)
          91  +
.with_xml_name("ResultAttribute");
          92  +
static GETINVENTORYINPUT_MEMBER_RESULT_ATTRIBUTES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          93  +
    ::aws_smithy_schema::ShapeId::from_parts(
          94  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput$ResultAttributes",
          95  +
        "com.amazonaws.ssm.synthetic",
          96  +
        "GetInventoryInput",
          97  +
    ),
          98  +
    ::aws_smithy_schema::ShapeType::List,
          99  +
    "ResultAttributes",
         100  +
    2,
         101  +
)
         102  +
.with_list_member(&GETINVENTORYINPUT_MEMBER_RESULT_ATTRIBUTES_MEMBER);
         103  +
static GETINVENTORYINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         104  +
    ::aws_smithy_schema::ShapeId::from_parts(
         105  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput$NextToken",
         106  +
        "com.amazonaws.ssm.synthetic",
         107  +
        "GetInventoryInput",
         108  +
    ),
         109  +
    ::aws_smithy_schema::ShapeType::String,
         110  +
    "NextToken",
         111  +
    3,
         112  +
);
         113  +
static GETINVENTORYINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         114  +
    ::aws_smithy_schema::ShapeId::from_parts(
         115  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput$MaxResults",
         116  +
        "com.amazonaws.ssm.synthetic",
         117  +
        "GetInventoryInput",
         118  +
    ),
         119  +
    ::aws_smithy_schema::ShapeType::Integer,
         120  +
    "MaxResults",
         121  +
    4,
         122  +
);
         123  +
static GETINVENTORYINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         124  +
    ::aws_smithy_schema::ShapeId::from_parts(
         125  +
        "com.amazonaws.ssm.synthetic#GetInventoryInput",
         126  +
        "com.amazonaws.ssm.synthetic",
         127  +
        "GetInventoryInput",
         128  +
    ),
         129  +
    ::aws_smithy_schema::ShapeType::Structure,
         130  +
    &[
         131  +
        &GETINVENTORYINPUT_MEMBER_FILTERS,
         132  +
        &GETINVENTORYINPUT_MEMBER_AGGREGATORS,
         133  +
        &GETINVENTORYINPUT_MEMBER_RESULT_ATTRIBUTES,
         134  +
        &GETINVENTORYINPUT_MEMBER_NEXT_TOKEN,
         135  +
        &GETINVENTORYINPUT_MEMBER_MAX_RESULTS,
         136  +
    ],
         137  +
)
         138  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         139  +
.with_original_name("GetInventoryRequest");
         140  +
impl GetInventoryInput {
         141  +
    /// The schema for this shape.
         142  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETINVENTORYINPUT_SCHEMA;
         143  +
}
         144  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetInventoryInput {
         145  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         146  +
    fn serialize_members(
         147  +
        &self,
         148  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         149  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         150  +
        if let Some(ref val) = self.filters {
         151  +
            ser.write_list(
         152  +
                &GETINVENTORYINPUT_MEMBER_FILTERS,
         153  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         154  +
                    for item in val {
         155  +
                        ser.write_struct(crate::types::InventoryFilter::SCHEMA, item)?;
         156  +
                    }
         157  +
                    Ok(())
         158  +
                },
         159  +
            )?;
         160  +
        }
         161  +
        if let Some(ref val) = self.aggregators {
         162  +
            ser.write_list(
         163  +
                &GETINVENTORYINPUT_MEMBER_AGGREGATORS,
         164  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         165  +
                    for item in val {
         166  +
                        ser.write_struct(crate::types::InventoryAggregator::SCHEMA, item)?;
         167  +
                    }
         168  +
                    Ok(())
         169  +
                },
         170  +
            )?;
         171  +
        }
         172  +
        if let Some(ref val) = self.result_attributes {
         173  +
            ser.write_list(
         174  +
                &GETINVENTORYINPUT_MEMBER_RESULT_ATTRIBUTES,
         175  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         176  +
                    for item in val {
         177  +
                        ser.write_struct(crate::types::ResultAttribute::SCHEMA, item)?;
         178  +
                    }
         179  +
                    Ok(())
         180  +
                },
         181  +
            )?;
         182  +
        }
         183  +
        if let Some(ref val) = self.next_token {
         184  +
            ser.write_string(&GETINVENTORYINPUT_MEMBER_NEXT_TOKEN, val)?;
         185  +
        }
         186  +
        if let Some(ref val) = self.max_results {
         187  +
            ser.write_integer(&GETINVENTORYINPUT_MEMBER_MAX_RESULTS, *val)?;
         188  +
        }
         189  +
        Ok(())
         190  +
    }
         191  +
}
         192  +
impl GetInventoryInput {
         193  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         194  +
    pub fn deserialize(
         195  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         196  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         197  +
        #[allow(unused_variables, unused_mut)]
         198  +
        let mut builder = Self::builder();
         199  +
        #[allow(
         200  +
            unused_variables,
         201  +
            unreachable_code,
         202  +
            clippy::single_match,
         203  +
            clippy::match_single_binding,
         204  +
            clippy::diverging_sub_expression
         205  +
        )]
         206  +
        deserializer.read_struct(&GETINVENTORYINPUT_SCHEMA, &mut |member, deser| {
         207  +
            match member.member_index() {
         208  +
                Some(0) => {
         209  +
                    if deser.is_null() {
         210  +
                        deser.read_null()?;
         211  +
                    } else {
         212  +
                        builder.filters = Some({
         213  +
                            let mut container = Vec::new();
         214  +
                            deser.read_list(member, &mut |deser| {
         215  +
                                container.push(crate::types::InventoryFilter::deserialize(deser)?);
         216  +
                                Ok(())
         217  +
                            })?;
         218  +
                            container
         219  +
                        });
         220  +
                    }
         221  +
                }
         222  +
                Some(1) => {
         223  +
                    if deser.is_null() {
         224  +
                        deser.read_null()?;
         225  +
                    } else {
         226  +
                        builder.aggregators = Some({
         227  +
                            let mut container = Vec::new();
         228  +
                            deser.read_list(member, &mut |deser| {
         229  +
                                container.push(crate::types::InventoryAggregator::deserialize(deser)?);
         230  +
                                Ok(())
         231  +
                            })?;
         232  +
                            container
         233  +
                        });
         234  +
                    }
         235  +
                }
         236  +
                Some(2) => {
         237  +
                    if deser.is_null() {
         238  +
                        deser.read_null()?;
         239  +
                    } else {
         240  +
                        builder.result_attributes = Some({
         241  +
                            let mut container = Vec::new();
         242  +
                            deser.read_list(member, &mut |deser| {
         243  +
                                container.push(crate::types::ResultAttribute::deserialize(deser)?);
         244  +
                                Ok(())
         245  +
                            })?;
         246  +
                            container
         247  +
                        });
         248  +
                    }
         249  +
                }
         250  +
                Some(3) => {
         251  +
                    if deser.is_null() {
         252  +
                        deser.read_null()?;
         253  +
                    } else {
         254  +
                        builder.next_token = Some(deser.read_string(member)?);
         255  +
                    }
         256  +
                }
         257  +
                Some(4) => {
         258  +
                    if deser.is_null() {
         259  +
                        deser.read_null()?;
         260  +
                    } else {
         261  +
                        builder.max_results = Some(deser.read_integer(member)?);
         262  +
                    }
         263  +
                }
         264  +
                _ => {}
         265  +
            }
         266  +
            Ok(())
         267  +
        })?;
         268  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         269  +
    }
         270  +
}
         271  +
impl GetInventoryInput {
         272  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         273  +
    pub fn deserialize_with_response(
         274  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         275  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         276  +
        _status: u16,
         277  +
        _body: &[u8],
         278  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         279  +
        Self::deserialize(deserializer)
         280  +
    }
         281  +
}
         282  +
impl GetInventoryInput {
         283  +
    /// Creates a new builder-style object to manufacture [`GetInventoryInput`](crate::operation::get_inventory::GetInventoryInput).
         284  +
    pub fn builder() -> crate::operation::get_inventory::builders::GetInventoryInputBuilder {
         285  +
        crate::operation::get_inventory::builders::GetInventoryInputBuilder::default()
         286  +
    }
         287  +
}
         288  +
         289  +
/// A builder for [`GetInventoryInput`](crate::operation::get_inventory::GetInventoryInput).
         290  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         291  +
#[non_exhaustive]
         292  +
pub struct GetInventoryInputBuilder {
         293  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::InventoryFilter>>,
         294  +
    pub(crate) aggregators: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>,
         295  +
    pub(crate) result_attributes: ::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>>,
         296  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         297  +
    pub(crate) max_results: ::std::option::Option<i32>,
         298  +
}
         299  +
impl GetInventoryInputBuilder {
         300  +
    /// Appends an item to `filters`.
         301  +
    ///
         302  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         303  +
    ///
         304  +
    /// <p>One or more filters. Use a filter to return a more specific list of results.</p>
         305  +
    pub fn filters(mut self, input: crate::types::InventoryFilter) -> Self {
         306  +
        let mut v = self.filters.unwrap_or_default();
         307  +
        v.push(input);
         308  +
        self.filters = ::std::option::Option::Some(v);
         309  +
        self
         310  +
    }
         311  +
    /// <p>One or more filters. Use a filter to return a more specific list of results.</p>
         312  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryFilter>>) -> Self {
         313  +
        self.filters = input;
         314  +
        self
         315  +
    }
         316  +
    /// <p>One or more filters. Use a filter to return a more specific list of results.</p>
         317  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryFilter>> {
         318  +
        &self.filters
         319  +
    }
         320  +
    /// Appends an item to `aggregators`.
         321  +
    ///
         322  +
    /// To override the contents of this collection use [`set_aggregators`](Self::set_aggregators).
         323  +
    ///
         324  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         325  +
    pub fn aggregators(mut self, input: crate::types::InventoryAggregator) -> Self {
         326  +
        let mut v = self.aggregators.unwrap_or_default();
         327  +
        v.push(input);
         328  +
        self.aggregators = ::std::option::Option::Some(v);
         329  +
        self
         330  +
    }
         331  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         332  +
    pub fn set_aggregators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>) -> Self {
         333  +
        self.aggregators = input;
         334  +
        self
         335  +
    }
         336  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         337  +
    pub fn get_aggregators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>> {
         338  +
        &self.aggregators
         339  +
    }
         340  +
    /// Appends an item to `result_attributes`.
         341  +
    ///
         342  +
    /// To override the contents of this collection use [`set_result_attributes`](Self::set_result_attributes).
         343  +
    ///
         344  +
    /// <p>The list of inventory item types to return.</p>
         345  +
    pub fn result_attributes(mut self, input: crate::types::ResultAttribute) -> Self {
         346  +
        let mut v = self.result_attributes.unwrap_or_default();
         347  +
        v.push(input);
         348  +
        self.result_attributes = ::std::option::Option::Some(v);
         349  +
        self
         350  +
    }
         351  +
    /// <p>The list of inventory item types to return.</p>
         352  +
    pub fn set_result_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>>) -> Self {
         353  +
        self.result_attributes = input;
         354  +
        self
         355  +
    }
         356  +
    /// <p>The list of inventory item types to return.</p>
         357  +
    pub fn get_result_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>> {
         358  +
        &self.result_attributes
         359  +
    }
         360  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         361  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         362  +
        self.next_token = ::std::option::Option::Some(input.into());
         363  +
        self
         364  +
    }
         365  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         366  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         367  +
        self.next_token = input;
         368  +
        self
         369  +
    }
         370  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         371  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         372  +
        &self.next_token
         373  +
    }
         374  +
    /// <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>
         375  +
    pub fn max_results(mut self, input: i32) -> Self {
         376  +
        self.max_results = ::std::option::Option::Some(input);
         377  +
        self
         378  +
    }
         379  +
    /// <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>
         380  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         381  +
        self.max_results = input;
         382  +
        self
         383  +
    }
         384  +
    /// <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>
         385  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         386  +
        &self.max_results
         387  +
    }
         388  +
    /// Consumes the builder and constructs a [`GetInventoryInput`](crate::operation::get_inventory::GetInventoryInput).
         389  +
    pub fn build(
         390  +
        self,
         391  +
    ) -> ::std::result::Result<crate::operation::get_inventory::GetInventoryInput, ::aws_smithy_types::error::operation::BuildError> {
         392  +
        ::std::result::Result::Ok(crate::operation::get_inventory::GetInventoryInput {
         393  +
            filters: self.filters,
         394  +
            aggregators: self.aggregators,
         395  +
            result_attributes: self.result_attributes,
         396  +
            next_token: self.next_token,
         397  +
            max_results: self.max_results,
         398  +
        })
         399  +
    }
         400  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory/_get_inventory_output.rs

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

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory/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::get_inventory::_get_inventory_input::GetInventoryInputBuilder;
           3  +
           4  +
pub use crate::operation::get_inventory::_get_inventory_output::GetInventoryOutputBuilder;
           5  +
           6  +
impl crate::operation::get_inventory::builders::GetInventoryInputBuilder {
           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::get_inventory::GetInventoryOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_inventory::GetInventoryError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_inventory();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetInventory`.
          24  +
///
          25  +
/// <p>Query inventory information. This includes managed node status, such as <code>Stopped</code> or <code>Terminated</code>.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct GetInventoryFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::get_inventory::builders::GetInventoryInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::get_inventory::GetInventoryOutput,
          35  +
        crate::operation::get_inventory::GetInventoryError,
          36  +
    > for GetInventoryFluentBuilder
          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::get_inventory::GetInventoryOutput,
          44  +
            crate::operation::get_inventory::GetInventoryError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl GetInventoryFluentBuilder {
          51  +
    /// Creates a new `GetInventoryFluentBuilder`.
          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 GetInventory as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::get_inventory::builders::GetInventoryInputBuilder {
          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::get_inventory::GetInventoryOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::get_inventory::GetInventoryError,
          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::get_inventory::GetInventory::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::get_inventory::GetInventory::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::get_inventory::GetInventoryOutput,
          97  +
        crate::operation::get_inventory::GetInventoryError,
          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::get_inventory::paginator::GetInventoryPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
         114  +
    pub fn into_paginator(self) -> crate::operation::get_inventory::paginator::GetInventoryPaginator {
         115  +
        crate::operation::get_inventory::paginator::GetInventoryPaginator::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 filters. Use a filter to return a more specific list of results.</p>
         123  +
    pub fn filters(mut self, input: crate::types::InventoryFilter) -> Self {
         124  +
        self.inner = self.inner.filters(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>One or more 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::InventoryFilter>>) -> Self {
         129  +
        self.inner = self.inner.set_filters(input);
         130  +
        self
         131  +
    }
         132  +
    /// <p>One or more 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::InventoryFilter>> {
         134  +
        self.inner.get_filters()
         135  +
    }
         136  +
    ///
         137  +
    /// Appends an item to `Aggregators`.
         138  +
    ///
         139  +
    /// To override the contents of this collection use [`set_aggregators`](Self::set_aggregators).
         140  +
    ///
         141  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         142  +
    pub fn aggregators(mut self, input: crate::types::InventoryAggregator) -> Self {
         143  +
        self.inner = self.inner.aggregators(input);
         144  +
        self
         145  +
    }
         146  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         147  +
    pub fn set_aggregators(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>>) -> Self {
         148  +
        self.inner = self.inner.set_aggregators(input);
         149  +
        self
         150  +
    }
         151  +
    /// <p>Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the <code>AWS:InstanceInformation.PlatformType</code> type, you can see a count of how many Windows and Linux managed nodes exist in your inventoried fleet.</p>
         152  +
    pub fn get_aggregators(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryAggregator>> {
         153  +
        self.inner.get_aggregators()
         154  +
    }
         155  +
    ///
         156  +
    /// Appends an item to `ResultAttributes`.
         157  +
    ///
         158  +
    /// To override the contents of this collection use [`set_result_attributes`](Self::set_result_attributes).
         159  +
    ///
         160  +
    /// <p>The list of inventory item types to return.</p>
         161  +
    pub fn result_attributes(mut self, input: crate::types::ResultAttribute) -> Self {
         162  +
        self.inner = self.inner.result_attributes(input);
         163  +
        self
         164  +
    }
         165  +
    /// <p>The list of inventory item types to return.</p>
         166  +
    pub fn set_result_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>>) -> Self {
         167  +
        self.inner = self.inner.set_result_attributes(input);
         168  +
        self
         169  +
    }
         170  +
    /// <p>The list of inventory item types to return.</p>
         171  +
    pub fn get_result_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResultAttribute>> {
         172  +
        self.inner.get_result_attributes()
         173  +
    }
         174  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</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>The token for the next set of items to return. (You received this token from a previous call.)</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>The token for the next set of items to return. (You received this token from a previous call.)</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/get_inventory/paginator.rs

@@ -0,1 +0,148 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Paginator for [`GetInventory`](crate::operation::get_inventory::GetInventory)
           3  +
pub struct GetInventoryPaginator {
           4  +
    handle: std::sync::Arc<crate::client::Handle>,
           5  +
    builder: crate::operation::get_inventory::builders::GetInventoryInputBuilder,
           6  +
    stop_on_duplicate_token: bool,
           7  +
}
           8  +
           9  +
impl GetInventoryPaginator {
          10  +
    /// Create a new paginator-wrapper
          11  +
    pub(crate) fn new(
          12  +
        handle: std::sync::Arc<crate::client::Handle>,
          13  +
        builder: crate::operation::get_inventory::builders::GetInventoryInputBuilder,
          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 `entities`. Queries to the underlying service
          33  +
    /// are dispatched lazily.
          34  +
    pub fn items(self) -> crate::operation::get_inventory::paginator::GetInventoryPaginatorItems {
          35  +
        crate::operation::get_inventory::paginator::GetInventoryPaginatorItems(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::get_inventory::GetInventoryOutput,
          59  +
            ::aws_smithy_runtime_api::client::result::SdkError<
          60  +
                crate::operation::get_inventory::GetInventoryError,
          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::get_inventory::GetInventory::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::get_inventory::GetInventory::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_get_inventory_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 `GetInventoryPaginator`
         120  +
///
         121  +
/// This is created with [`.items()`](GetInventoryPaginator::items)
         122  +
pub struct GetInventoryPaginatorItems(GetInventoryPaginator);
         123  +
         124  +
impl GetInventoryPaginatorItems {
         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::InventoryResultEntity,
         136  +
            ::aws_smithy_runtime_api::client::result::SdkError<
         137  +
                crate::operation::get_inventory::GetInventoryError,
         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_get_inventory_output_output_entities(page)
         144  +
                .unwrap_or_default()
         145  +
                .into_iter()
         146  +
        })
         147  +
    }
         148  +
}