AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_instance_patches/_describe_instance_patches_input.rs

@@ -0,1 +0,379 @@
           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 DescribeInstancePatchesInput {
           6  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
           7  +
    pub instance_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
           9  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
          10  +
    /// <ul>
          11  +
    /// <li>
          12  +
    /// <p><b> <code>Classification</code> </b></p>
          13  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
          14  +
    /// <li>
          15  +
    /// <p><b> <code>KBId</code> </b></p>
          16  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
          17  +
    /// <li>
          18  +
    /// <p><b> <code>Severity</code> </b></p>
          19  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
          20  +
    /// <li>
          21  +
    /// <p><b> <code>State</code> </b></p>
          22  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
          23  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
          24  +
    /// </ul>
          25  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
          26  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          27  +
    pub next_token: ::std::option::Option<::std::string::String>,
          28  +
    /// <p>The maximum number of patches to return (per page).</p>
          29  +
    pub max_results: ::std::option::Option<i32>,
          30  +
}
          31  +
impl DescribeInstancePatchesInput {
          32  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
          33  +
    pub fn instance_id(&self) -> ::std::option::Option<&str> {
          34  +
        self.instance_id.as_deref()
          35  +
    }
          36  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
          37  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
          38  +
    /// <ul>
          39  +
    /// <li>
          40  +
    /// <p><b> <code>Classification</code> </b></p>
          41  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
          42  +
    /// <li>
          43  +
    /// <p><b> <code>KBId</code> </b></p>
          44  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
          45  +
    /// <li>
          46  +
    /// <p><b> <code>Severity</code> </b></p>
          47  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
          48  +
    /// <li>
          49  +
    /// <p><b> <code>State</code> </b></p>
          50  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
          51  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
          52  +
    /// </ul>
          53  +
    ///
          54  +
    /// 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()`.
          55  +
    pub fn filters(&self) -> &[crate::types::PatchOrchestratorFilter] {
          56  +
        self.filters.as_deref().unwrap_or_default()
          57  +
    }
          58  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          59  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          60  +
        self.next_token.as_deref()
          61  +
    }
          62  +
    /// <p>The maximum number of patches to return (per page).</p>
          63  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          64  +
        self.max_results
          65  +
    }
          66  +
}
          67  +
static DESCRIBEINSTANCEPATCHESINPUT_MEMBER_INSTANCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          68  +
    ::aws_smithy_schema::ShapeId::from_parts(
          69  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesInput$InstanceId",
          70  +
        "com.amazonaws.ssm.synthetic",
          71  +
        "DescribeInstancePatchesInput",
          72  +
    ),
          73  +
    ::aws_smithy_schema::ShapeType::String,
          74  +
    "InstanceId",
          75  +
    0,
          76  +
);
          77  +
static DESCRIBEINSTANCEPATCHESINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          78  +
    ::aws_smithy_schema::ShapeId::from_parts(
          79  +
        "com.amazonaws.ssm#PatchOrchestratorFilterList$member",
          80  +
        "com.amazonaws.ssm",
          81  +
        "PatchOrchestratorFilterList",
          82  +
    ),
          83  +
    ::aws_smithy_schema::ShapeType::Structure,
          84  +
    "member",
          85  +
    0,
          86  +
);
          87  +
static DESCRIBEINSTANCEPATCHESINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          88  +
    ::aws_smithy_schema::ShapeId::from_parts(
          89  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesInput$Filters",
          90  +
        "com.amazonaws.ssm.synthetic",
          91  +
        "DescribeInstancePatchesInput",
          92  +
    ),
          93  +
    ::aws_smithy_schema::ShapeType::List,
          94  +
    "Filters",
          95  +
    1,
          96  +
)
          97  +
.with_list_member(&DESCRIBEINSTANCEPATCHESINPUT_MEMBER_FILTERS_MEMBER);
          98  +
static DESCRIBEINSTANCEPATCHESINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          99  +
    ::aws_smithy_schema::ShapeId::from_parts(
         100  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesInput$NextToken",
         101  +
        "com.amazonaws.ssm.synthetic",
         102  +
        "DescribeInstancePatchesInput",
         103  +
    ),
         104  +
    ::aws_smithy_schema::ShapeType::String,
         105  +
    "NextToken",
         106  +
    2,
         107  +
);
         108  +
static DESCRIBEINSTANCEPATCHESINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         109  +
    ::aws_smithy_schema::ShapeId::from_parts(
         110  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesInput$MaxResults",
         111  +
        "com.amazonaws.ssm.synthetic",
         112  +
        "DescribeInstancePatchesInput",
         113  +
    ),
         114  +
    ::aws_smithy_schema::ShapeType::Integer,
         115  +
    "MaxResults",
         116  +
    3,
         117  +
);
         118  +
static DESCRIBEINSTANCEPATCHESINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         119  +
    ::aws_smithy_schema::ShapeId::from_parts(
         120  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesInput",
         121  +
        "com.amazonaws.ssm.synthetic",
         122  +
        "DescribeInstancePatchesInput",
         123  +
    ),
         124  +
    ::aws_smithy_schema::ShapeType::Structure,
         125  +
    &[
         126  +
        &DESCRIBEINSTANCEPATCHESINPUT_MEMBER_INSTANCE_ID,
         127  +
        &DESCRIBEINSTANCEPATCHESINPUT_MEMBER_FILTERS,
         128  +
        &DESCRIBEINSTANCEPATCHESINPUT_MEMBER_NEXT_TOKEN,
         129  +
        &DESCRIBEINSTANCEPATCHESINPUT_MEMBER_MAX_RESULTS,
         130  +
    ],
         131  +
)
         132  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         133  +
.with_original_name("DescribeInstancePatchesRequest");
         134  +
impl DescribeInstancePatchesInput {
         135  +
    /// The schema for this shape.
         136  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEINSTANCEPATCHESINPUT_SCHEMA;
         137  +
}
         138  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeInstancePatchesInput {
         139  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         140  +
    fn serialize_members(
         141  +
        &self,
         142  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         143  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         144  +
        if let Some(ref val) = self.instance_id {
         145  +
            ser.write_string(&DESCRIBEINSTANCEPATCHESINPUT_MEMBER_INSTANCE_ID, val)?;
         146  +
        }
         147  +
        if let Some(ref val) = self.filters {
         148  +
            ser.write_list(
         149  +
                &DESCRIBEINSTANCEPATCHESINPUT_MEMBER_FILTERS,
         150  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         151  +
                    for item in val {
         152  +
                        ser.write_struct(crate::types::PatchOrchestratorFilter::SCHEMA, item)?;
         153  +
                    }
         154  +
                    Ok(())
         155  +
                },
         156  +
            )?;
         157  +
        }
         158  +
        if let Some(ref val) = self.next_token {
         159  +
            ser.write_string(&DESCRIBEINSTANCEPATCHESINPUT_MEMBER_NEXT_TOKEN, val)?;
         160  +
        }
         161  +
        if let Some(ref val) = self.max_results {
         162  +
            ser.write_integer(&DESCRIBEINSTANCEPATCHESINPUT_MEMBER_MAX_RESULTS, *val)?;
         163  +
        }
         164  +
        Ok(())
         165  +
    }
         166  +
}
         167  +
impl DescribeInstancePatchesInput {
         168  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         169  +
    pub fn deserialize(
         170  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         171  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         172  +
        #[allow(unused_variables, unused_mut)]
         173  +
        let mut builder = Self::builder();
         174  +
        #[allow(
         175  +
            unused_variables,
         176  +
            unreachable_code,
         177  +
            clippy::single_match,
         178  +
            clippy::match_single_binding,
         179  +
            clippy::diverging_sub_expression
         180  +
        )]
         181  +
        deserializer.read_struct(&DESCRIBEINSTANCEPATCHESINPUT_SCHEMA, &mut |member, deser| {
         182  +
            match member.member_index() {
         183  +
                Some(0) => {
         184  +
                    if deser.is_null() {
         185  +
                        deser.read_null()?;
         186  +
                    } else {
         187  +
                        builder.instance_id = Some(deser.read_string(member)?);
         188  +
                    }
         189  +
                }
         190  +
                Some(1) => {
         191  +
                    if deser.is_null() {
         192  +
                        deser.read_null()?;
         193  +
                    } else {
         194  +
                        builder.filters = Some({
         195  +
                            let mut container = Vec::new();
         196  +
                            deser.read_list(member, &mut |deser| {
         197  +
                                container.push(crate::types::PatchOrchestratorFilter::deserialize(deser)?);
         198  +
                                Ok(())
         199  +
                            })?;
         200  +
                            container
         201  +
                        });
         202  +
                    }
         203  +
                }
         204  +
                Some(2) => {
         205  +
                    if deser.is_null() {
         206  +
                        deser.read_null()?;
         207  +
                    } else {
         208  +
                        builder.next_token = Some(deser.read_string(member)?);
         209  +
                    }
         210  +
                }
         211  +
                Some(3) => {
         212  +
                    if deser.is_null() {
         213  +
                        deser.read_null()?;
         214  +
                    } else {
         215  +
                        builder.max_results = Some(deser.read_integer(member)?);
         216  +
                    }
         217  +
                }
         218  +
                _ => {}
         219  +
            }
         220  +
            Ok(())
         221  +
        })?;
         222  +
        builder.instance_id = builder.instance_id.or(Some(String::new()));
         223  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         224  +
    }
         225  +
}
         226  +
impl DescribeInstancePatchesInput {
         227  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         228  +
    pub fn deserialize_with_response(
         229  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         230  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         231  +
        _status: u16,
         232  +
        _body: &[u8],
         233  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         234  +
        Self::deserialize(deserializer)
         235  +
    }
         236  +
}
         237  +
impl DescribeInstancePatchesInput {
         238  +
    /// Creates a new builder-style object to manufacture [`DescribeInstancePatchesInput`](crate::operation::describe_instance_patches::DescribeInstancePatchesInput).
         239  +
    pub fn builder() -> crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder {
         240  +
        crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder::default()
         241  +
    }
         242  +
}
         243  +
         244  +
/// A builder for [`DescribeInstancePatchesInput`](crate::operation::describe_instance_patches::DescribeInstancePatchesInput).
         245  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         246  +
#[non_exhaustive]
         247  +
pub struct DescribeInstancePatchesInputBuilder {
         248  +
    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
         249  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
         250  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         251  +
    pub(crate) max_results: ::std::option::Option<i32>,
         252  +
}
         253  +
impl DescribeInstancePatchesInputBuilder {
         254  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         255  +
    /// This field is required.
         256  +
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         257  +
        self.instance_id = ::std::option::Option::Some(input.into());
         258  +
        self
         259  +
    }
         260  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         261  +
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         262  +
        self.instance_id = input;
         263  +
        self
         264  +
    }
         265  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         266  +
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
         267  +
        &self.instance_id
         268  +
    }
         269  +
    /// Appends an item to `filters`.
         270  +
    ///
         271  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         272  +
    ///
         273  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         274  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         275  +
    /// <ul>
         276  +
    /// <li>
         277  +
    /// <p><b> <code>Classification</code> </b></p>
         278  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         279  +
    /// <li>
         280  +
    /// <p><b> <code>KBId</code> </b></p>
         281  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         282  +
    /// <li>
         283  +
    /// <p><b> <code>Severity</code> </b></p>
         284  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         285  +
    /// <li>
         286  +
    /// <p><b> <code>State</code> </b></p>
         287  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         288  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         289  +
    /// </ul>
         290  +
    pub fn filters(mut self, input: crate::types::PatchOrchestratorFilter) -> Self {
         291  +
        let mut v = self.filters.unwrap_or_default();
         292  +
        v.push(input);
         293  +
        self.filters = ::std::option::Option::Some(v);
         294  +
        self
         295  +
    }
         296  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         297  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         298  +
    /// <ul>
         299  +
    /// <li>
         300  +
    /// <p><b> <code>Classification</code> </b></p>
         301  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         302  +
    /// <li>
         303  +
    /// <p><b> <code>KBId</code> </b></p>
         304  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         305  +
    /// <li>
         306  +
    /// <p><b> <code>Severity</code> </b></p>
         307  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         308  +
    /// <li>
         309  +
    /// <p><b> <code>State</code> </b></p>
         310  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         311  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         312  +
    /// </ul>
         313  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>) -> Self {
         314  +
        self.filters = input;
         315  +
        self
         316  +
    }
         317  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         318  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         319  +
    /// <ul>
         320  +
    /// <li>
         321  +
    /// <p><b> <code>Classification</code> </b></p>
         322  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         323  +
    /// <li>
         324  +
    /// <p><b> <code>KBId</code> </b></p>
         325  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         326  +
    /// <li>
         327  +
    /// <p><b> <code>Severity</code> </b></p>
         328  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         329  +
    /// <li>
         330  +
    /// <p><b> <code>State</code> </b></p>
         331  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         332  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         333  +
    /// </ul>
         334  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>> {
         335  +
        &self.filters
         336  +
    }
         337  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         338  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         339  +
        self.next_token = ::std::option::Option::Some(input.into());
         340  +
        self
         341  +
    }
         342  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         343  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         344  +
        self.next_token = input;
         345  +
        self
         346  +
    }
         347  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         348  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         349  +
        &self.next_token
         350  +
    }
         351  +
    /// <p>The maximum number of patches to return (per page).</p>
         352  +
    pub fn max_results(mut self, input: i32) -> Self {
         353  +
        self.max_results = ::std::option::Option::Some(input);
         354  +
        self
         355  +
    }
         356  +
    /// <p>The maximum number of patches to return (per page).</p>
         357  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         358  +
        self.max_results = input;
         359  +
        self
         360  +
    }
         361  +
    /// <p>The maximum number of patches to return (per page).</p>
         362  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         363  +
        &self.max_results
         364  +
    }
         365  +
    /// Consumes the builder and constructs a [`DescribeInstancePatchesInput`](crate::operation::describe_instance_patches::DescribeInstancePatchesInput).
         366  +
    pub fn build(
         367  +
        self,
         368  +
    ) -> ::std::result::Result<
         369  +
        crate::operation::describe_instance_patches::DescribeInstancePatchesInput,
         370  +
        ::aws_smithy_types::error::operation::BuildError,
         371  +
    > {
         372  +
        ::std::result::Result::Ok(crate::operation::describe_instance_patches::DescribeInstancePatchesInput {
         373  +
            instance_id: self.instance_id,
         374  +
            filters: self.filters,
         375  +
            next_token: self.next_token,
         376  +
            max_results: self.max_results,
         377  +
        })
         378  +
    }
         379  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_instance_patches/_describe_instance_patches_output.rs

@@ -0,1 +0,353 @@
           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 DescribeInstancePatchesOutput {
           6  +
    /// <p>Each entry in the array is a structure containing:</p>
           7  +
    /// <ul>
           8  +
    /// <li>
           9  +
    /// <p>Title (string)</p></li>
          10  +
    /// <li>
          11  +
    /// <p>KBId (string)</p></li>
          12  +
    /// <li>
          13  +
    /// <p>Classification (string)</p></li>
          14  +
    /// <li>
          15  +
    /// <p>Severity (string)</p></li>
          16  +
    /// <li>
          17  +
    /// <p>State (string, such as "INSTALLED" or "FAILED")</p></li>
          18  +
    /// <li>
          19  +
    /// <p>InstalledTime (DateTime)</p></li>
          20  +
    /// <li>
          21  +
    /// <p>InstalledBy (string)</p></li>
          22  +
    /// </ul>
          23  +
    pub patches: ::std::option::Option<::std::vec::Vec<crate::types::PatchComplianceData>>,
          24  +
    /// <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>
          25  +
    pub next_token: ::std::option::Option<::std::string::String>,
          26  +
    _request_id: Option<String>,
          27  +
}
          28  +
impl DescribeInstancePatchesOutput {
          29  +
    /// <p>Each entry in the array is a structure containing:</p>
          30  +
    /// <ul>
          31  +
    /// <li>
          32  +
    /// <p>Title (string)</p></li>
          33  +
    /// <li>
          34  +
    /// <p>KBId (string)</p></li>
          35  +
    /// <li>
          36  +
    /// <p>Classification (string)</p></li>
          37  +
    /// <li>
          38  +
    /// <p>Severity (string)</p></li>
          39  +
    /// <li>
          40  +
    /// <p>State (string, such as "INSTALLED" or "FAILED")</p></li>
          41  +
    /// <li>
          42  +
    /// <p>InstalledTime (DateTime)</p></li>
          43  +
    /// <li>
          44  +
    /// <p>InstalledBy (string)</p></li>
          45  +
    /// </ul>
          46  +
    ///
          47  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.patches.is_none()`.
          48  +
    pub fn patches(&self) -> &[crate::types::PatchComplianceData] {
          49  +
        self.patches.as_deref().unwrap_or_default()
          50  +
    }
          51  +
    /// <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>
          52  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          53  +
        self.next_token.as_deref()
          54  +
    }
          55  +
}
          56  +
static DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_PATCHES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          57  +
    ::aws_smithy_schema::ShapeId::from_parts(
          58  +
        "com.amazonaws.ssm#PatchComplianceDataList$member",
          59  +
        "com.amazonaws.ssm",
          60  +
        "PatchComplianceDataList",
          61  +
    ),
          62  +
    ::aws_smithy_schema::ShapeType::Structure,
          63  +
    "member",
          64  +
    0,
          65  +
);
          66  +
static DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_PATCHES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          67  +
    ::aws_smithy_schema::ShapeId::from_parts(
          68  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesOutput$Patches",
          69  +
        "com.amazonaws.ssm.synthetic",
          70  +
        "DescribeInstancePatchesOutput",
          71  +
    ),
          72  +
    ::aws_smithy_schema::ShapeType::List,
          73  +
    "Patches",
          74  +
    0,
          75  +
)
          76  +
.with_list_member(&DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_PATCHES_MEMBER);
          77  +
static DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          78  +
    ::aws_smithy_schema::ShapeId::from_parts(
          79  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesOutput$NextToken",
          80  +
        "com.amazonaws.ssm.synthetic",
          81  +
        "DescribeInstancePatchesOutput",
          82  +
    ),
          83  +
    ::aws_smithy_schema::ShapeType::String,
          84  +
    "NextToken",
          85  +
    1,
          86  +
);
          87  +
static DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          88  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          89  +
    ::aws_smithy_schema::ShapeType::String,
          90  +
    "request_id",
          91  +
    2,
          92  +
)
          93  +
.with_http_header("x-amzn-requestid");
          94  +
static DESCRIBEINSTANCEPATCHESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          95  +
    ::aws_smithy_schema::ShapeId::from_parts(
          96  +
        "com.amazonaws.ssm.synthetic#DescribeInstancePatchesOutput",
          97  +
        "com.amazonaws.ssm.synthetic",
          98  +
        "DescribeInstancePatchesOutput",
          99  +
    ),
         100  +
    ::aws_smithy_schema::ShapeType::Structure,
         101  +
    &[
         102  +
        &DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_PATCHES,
         103  +
        &DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_NEXT_TOKEN,
         104  +
        &DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER__REQUEST_ID,
         105  +
    ],
         106  +
)
         107  +
.with_original_name("DescribeInstancePatchesResult");
         108  +
impl DescribeInstancePatchesOutput {
         109  +
    /// The schema for this shape.
         110  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEINSTANCEPATCHESOUTPUT_SCHEMA;
         111  +
}
         112  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeInstancePatchesOutput {
         113  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         114  +
    fn serialize_members(
         115  +
        &self,
         116  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         117  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         118  +
        if let Some(ref val) = self.patches {
         119  +
            ser.write_list(
         120  +
                &DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_PATCHES,
         121  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         122  +
                    for item in val {
         123  +
                        ser.write_struct(crate::types::PatchComplianceData::SCHEMA, item)?;
         124  +
                    }
         125  +
                    Ok(())
         126  +
                },
         127  +
            )?;
         128  +
        }
         129  +
        if let Some(ref val) = self.next_token {
         130  +
            ser.write_string(&DESCRIBEINSTANCEPATCHESOUTPUT_MEMBER_NEXT_TOKEN, val)?;
         131  +
        }
         132  +
        Ok(())
         133  +
    }
         134  +
}
         135  +
impl DescribeInstancePatchesOutput {
         136  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         137  +
    pub fn deserialize(
         138  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         139  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         140  +
        #[allow(unused_variables, unused_mut)]
         141  +
        let mut builder = Self::builder();
         142  +
        #[allow(
         143  +
            unused_variables,
         144  +
            unreachable_code,
         145  +
            clippy::single_match,
         146  +
            clippy::match_single_binding,
         147  +
            clippy::diverging_sub_expression
         148  +
        )]
         149  +
        deserializer.read_struct(&DESCRIBEINSTANCEPATCHESOUTPUT_SCHEMA, &mut |member, deser| {
         150  +
            match member.member_index() {
         151  +
                Some(0) => {
         152  +
                    if deser.is_null() {
         153  +
                        deser.read_null()?;
         154  +
                    } else {
         155  +
                        builder.patches = Some({
         156  +
                            let mut container = Vec::new();
         157  +
                            deser.read_list(member, &mut |deser| {
         158  +
                                container.push(crate::types::PatchComplianceData::deserialize(deser)?);
         159  +
                                Ok(())
         160  +
                            })?;
         161  +
                            container
         162  +
                        });
         163  +
                    }
         164  +
                }
         165  +
                Some(1) => {
         166  +
                    if deser.is_null() {
         167  +
                        deser.read_null()?;
         168  +
                    } else {
         169  +
                        builder.next_token = Some(deser.read_string(member)?);
         170  +
                    }
         171  +
                }
         172  +
                Some(2) => {
         173  +
                    builder._request_id = Some(deser.read_string(member)?);
         174  +
                }
         175  +
                _ => {}
         176  +
            }
         177  +
            Ok(())
         178  +
        })?;
         179  +
        Ok(builder.build())
         180  +
    }
         181  +
}
         182  +
impl DescribeInstancePatchesOutput {
         183  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         184  +
    /// Header-bound members are read directly from headers, avoiding runtime
         185  +
    /// member iteration overhead. Body members are read via the deserializer.
         186  +
    pub fn deserialize_with_response(
         187  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         188  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         189  +
        _status: u16,
         190  +
        _body: &[u8],
         191  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         192  +
        #[allow(unused_variables, unused_mut)]
         193  +
        let mut builder = Self::builder();
         194  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         195  +
            builder._request_id = Some(val.to_string());
         196  +
        }
         197  +
         198  +
        #[allow(
         199  +
            unused_variables,
         200  +
            unreachable_code,
         201  +
            clippy::single_match,
         202  +
            clippy::match_single_binding,
         203  +
            clippy::diverging_sub_expression
         204  +
        )]
         205  +
        deserializer.read_struct(&DESCRIBEINSTANCEPATCHESOUTPUT_SCHEMA, &mut |member, deser| {
         206  +
            match member.member_index() {
         207  +
                Some(0) => {
         208  +
                    builder.patches = Some({
         209  +
                        let mut container = Vec::new();
         210  +
                        deser.read_list(member, &mut |deser| {
         211  +
                            container.push(crate::types::PatchComplianceData::deserialize(deser)?);
         212  +
                            Ok(())
         213  +
                        })?;
         214  +
                        container
         215  +
                    });
         216  +
                }
         217  +
                Some(1) => {
         218  +
                    builder.next_token = Some(deser.read_string(member)?);
         219  +
                }
         220  +
                _ => {}
         221  +
            }
         222  +
            Ok(())
         223  +
        })?;
         224  +
        Ok(builder.build())
         225  +
    }
         226  +
}
         227  +
impl ::aws_types::request_id::RequestId for DescribeInstancePatchesOutput {
         228  +
    fn request_id(&self) -> Option<&str> {
         229  +
        self._request_id.as_deref()
         230  +
    }
         231  +
}
         232  +
impl DescribeInstancePatchesOutput {
         233  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         234  +
        self._request_id = request_id;
         235  +
        self
         236  +
    }
         237  +
}
         238  +
impl DescribeInstancePatchesOutput {
         239  +
    /// Creates a new builder-style object to manufacture [`DescribeInstancePatchesOutput`](crate::operation::describe_instance_patches::DescribeInstancePatchesOutput).
         240  +
    pub fn builder() -> crate::operation::describe_instance_patches::builders::DescribeInstancePatchesOutputBuilder {
         241  +
        crate::operation::describe_instance_patches::builders::DescribeInstancePatchesOutputBuilder::default()
         242  +
    }
         243  +
}
         244  +
         245  +
/// A builder for [`DescribeInstancePatchesOutput`](crate::operation::describe_instance_patches::DescribeInstancePatchesOutput).
         246  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         247  +
#[non_exhaustive]
         248  +
pub struct DescribeInstancePatchesOutputBuilder {
         249  +
    pub(crate) patches: ::std::option::Option<::std::vec::Vec<crate::types::PatchComplianceData>>,
         250  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         251  +
    _request_id: Option<String>,
         252  +
}
         253  +
impl DescribeInstancePatchesOutputBuilder {
         254  +
    /// Appends an item to `patches`.
         255  +
    ///
         256  +
    /// To override the contents of this collection use [`set_patches`](Self::set_patches).
         257  +
    ///
         258  +
    /// <p>Each entry in the array is a structure containing:</p>
         259  +
    /// <ul>
         260  +
    /// <li>
         261  +
    /// <p>Title (string)</p></li>
         262  +
    /// <li>
         263  +
    /// <p>KBId (string)</p></li>
         264  +
    /// <li>
         265  +
    /// <p>Classification (string)</p></li>
         266  +
    /// <li>
         267  +
    /// <p>Severity (string)</p></li>
         268  +
    /// <li>
         269  +
    /// <p>State (string, such as "INSTALLED" or "FAILED")</p></li>
         270  +
    /// <li>
         271  +
    /// <p>InstalledTime (DateTime)</p></li>
         272  +
    /// <li>
         273  +
    /// <p>InstalledBy (string)</p></li>
         274  +
    /// </ul>
         275  +
    pub fn patches(mut self, input: crate::types::PatchComplianceData) -> Self {
         276  +
        let mut v = self.patches.unwrap_or_default();
         277  +
        v.push(input);
         278  +
        self.patches = ::std::option::Option::Some(v);
         279  +
        self
         280  +
    }
         281  +
    /// <p>Each entry in the array is a structure containing:</p>
         282  +
    /// <ul>
         283  +
    /// <li>
         284  +
    /// <p>Title (string)</p></li>
         285  +
    /// <li>
         286  +
    /// <p>KBId (string)</p></li>
         287  +
    /// <li>
         288  +
    /// <p>Classification (string)</p></li>
         289  +
    /// <li>
         290  +
    /// <p>Severity (string)</p></li>
         291  +
    /// <li>
         292  +
    /// <p>State (string, such as "INSTALLED" or "FAILED")</p></li>
         293  +
    /// <li>
         294  +
    /// <p>InstalledTime (DateTime)</p></li>
         295  +
    /// <li>
         296  +
    /// <p>InstalledBy (string)</p></li>
         297  +
    /// </ul>
         298  +
    pub fn set_patches(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchComplianceData>>) -> Self {
         299  +
        self.patches = input;
         300  +
        self
         301  +
    }
         302  +
    /// <p>Each entry in the array is a structure containing:</p>
         303  +
    /// <ul>
         304  +
    /// <li>
         305  +
    /// <p>Title (string)</p></li>
         306  +
    /// <li>
         307  +
    /// <p>KBId (string)</p></li>
         308  +
    /// <li>
         309  +
    /// <p>Classification (string)</p></li>
         310  +
    /// <li>
         311  +
    /// <p>Severity (string)</p></li>
         312  +
    /// <li>
         313  +
    /// <p>State (string, such as "INSTALLED" or "FAILED")</p></li>
         314  +
    /// <li>
         315  +
    /// <p>InstalledTime (DateTime)</p></li>
         316  +
    /// <li>
         317  +
    /// <p>InstalledBy (string)</p></li>
         318  +
    /// </ul>
         319  +
    pub fn get_patches(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchComplianceData>> {
         320  +
        &self.patches
         321  +
    }
         322  +
    /// <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>
         323  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         324  +
        self.next_token = ::std::option::Option::Some(input.into());
         325  +
        self
         326  +
    }
         327  +
    /// <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>
         328  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         329  +
        self.next_token = input;
         330  +
        self
         331  +
    }
         332  +
    /// <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>
         333  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         334  +
        &self.next_token
         335  +
    }
         336  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         337  +
        self._request_id = Some(request_id.into());
         338  +
        self
         339  +
    }
         340  +
         341  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         342  +
        self._request_id = request_id;
         343  +
        self
         344  +
    }
         345  +
    /// Consumes the builder and constructs a [`DescribeInstancePatchesOutput`](crate::operation::describe_instance_patches::DescribeInstancePatchesOutput).
         346  +
    pub fn build(self) -> crate::operation::describe_instance_patches::DescribeInstancePatchesOutput {
         347  +
        crate::operation::describe_instance_patches::DescribeInstancePatchesOutput {
         348  +
            patches: self.patches,
         349  +
            next_token: self.next_token,
         350  +
            _request_id: self._request_id,
         351  +
        }
         352  +
    }
         353  +
}

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

@@ -0,1 +0,226 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::describe_instance_patches::_describe_instance_patches_input::DescribeInstancePatchesInputBuilder;
           3  +
           4  +
pub use crate::operation::describe_instance_patches::_describe_instance_patches_output::DescribeInstancePatchesOutputBuilder;
           5  +
           6  +
impl crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder {
           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::describe_instance_patches::DescribeInstancePatchesOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.describe_instance_patches();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DescribeInstancePatches`.
          24  +
///
          25  +
/// <p>Retrieves information about the patches on the specified managed node and their state relative to the patch baseline being used for the node.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct DescribeInstancePatchesFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::describe_instance_patches::DescribeInstancePatchesOutput,
          35  +
        crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          36  +
    > for DescribeInstancePatchesFluentBuilder
          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::describe_instance_patches::DescribeInstancePatchesOutput,
          44  +
            crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl DescribeInstancePatchesFluentBuilder {
          51  +
    /// Creates a new `DescribeInstancePatchesFluentBuilder`.
          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 DescribeInstancePatches as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder {
          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::describe_instance_patches::DescribeInstancePatchesOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          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::describe_instance_patches::DescribeInstancePatches::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::describe_instance_patches::DescribeInstancePatches::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::describe_instance_patches::DescribeInstancePatchesOutput,
          97  +
        crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          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::describe_instance_patches::paginator::DescribeInstancePatchesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
         114  +
    pub fn into_paginator(self) -> crate::operation::describe_instance_patches::paginator::DescribeInstancePatchesPaginator {
         115  +
        crate::operation::describe_instance_patches::paginator::DescribeInstancePatchesPaginator::new(self.handle, self.inner)
         116  +
    }
         117  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         118  +
    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.instance_id(input.into());
         120  +
        self
         121  +
    }
         122  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         123  +
    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.set_instance_id(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>The ID of the managed node whose patch state information should be retrieved.</p>
         128  +
    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_instance_id()
         130  +
    }
         131  +
    ///
         132  +
    /// Appends an item to `Filters`.
         133  +
    ///
         134  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         135  +
    ///
         136  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         137  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         138  +
    /// <ul>
         139  +
    /// <li>
         140  +
    /// <p><b> <code>Classification</code> </b></p>
         141  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         142  +
    /// <li>
         143  +
    /// <p><b> <code>KBId</code> </b></p>
         144  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         145  +
    /// <li>
         146  +
    /// <p><b> <code>Severity</code> </b></p>
         147  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         148  +
    /// <li>
         149  +
    /// <p><b> <code>State</code> </b></p>
         150  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         151  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         152  +
    /// </ul>
         153  +
    pub fn filters(mut self, input: crate::types::PatchOrchestratorFilter) -> Self {
         154  +
        self.inner = self.inner.filters(input);
         155  +
        self
         156  +
    }
         157  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         158  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         159  +
    /// <ul>
         160  +
    /// <li>
         161  +
    /// <p><b> <code>Classification</code> </b></p>
         162  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         163  +
    /// <li>
         164  +
    /// <p><b> <code>KBId</code> </b></p>
         165  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         166  +
    /// <li>
         167  +
    /// <p><b> <code>Severity</code> </b></p>
         168  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         169  +
    /// <li>
         170  +
    /// <p><b> <code>State</code> </b></p>
         171  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         172  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         173  +
    /// </ul>
         174  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>) -> Self {
         175  +
        self.inner = self.inner.set_filters(input);
         176  +
        self
         177  +
    }
         178  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         179  +
    /// <p>Supported keys for <code>DescribeInstancePatches</code>include the following:</p>
         180  +
    /// <ul>
         181  +
    /// <li>
         182  +
    /// <p><b> <code>Classification</code> </b></p>
         183  +
    /// <p>Sample values: <code>Security</code> | <code>SecurityUpdates</code></p></li>
         184  +
    /// <li>
         185  +
    /// <p><b> <code>KBId</code> </b></p>
         186  +
    /// <p>Sample values: <code>KB4480056</code> | <code>java-1.7.0-openjdk.x86_64</code></p></li>
         187  +
    /// <li>
         188  +
    /// <p><b> <code>Severity</code> </b></p>
         189  +
    /// <p>Sample values: <code>Important</code> | <code>Medium</code> | <code>Low</code></p></li>
         190  +
    /// <li>
         191  +
    /// <p><b> <code>State</code> </b></p>
         192  +
    /// <p>Sample values: <code>Installed</code> | <code>InstalledOther</code> | <code>InstalledPendingReboot</code></p>
         193  +
    /// <p>For lists of all <code>State</code> values, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-compliance-states.html">Patch compliance state values</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p></li>
         194  +
    /// </ul>
         195  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>> {
         196  +
        self.inner.get_filters()
         197  +
    }
         198  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         199  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         200  +
        self.inner = self.inner.next_token(input.into());
         201  +
        self
         202  +
    }
         203  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         204  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         205  +
        self.inner = self.inner.set_next_token(input);
         206  +
        self
         207  +
    }
         208  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         209  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         210  +
        self.inner.get_next_token()
         211  +
    }
         212  +
    /// <p>The maximum number of patches to return (per page).</p>
         213  +
    pub fn max_results(mut self, input: i32) -> Self {
         214  +
        self.inner = self.inner.max_results(input);
         215  +
        self
         216  +
    }
         217  +
    /// <p>The maximum number of patches to return (per page).</p>
         218  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         219  +
        self.inner = self.inner.set_max_results(input);
         220  +
        self
         221  +
    }
         222  +
    /// <p>The maximum number of patches to return (per page).</p>
         223  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         224  +
        self.inner.get_max_results()
         225  +
    }
         226  +
}

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

@@ -0,1 +0,149 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Paginator for [`DescribeInstancePatches`](crate::operation::describe_instance_patches::DescribeInstancePatches)
           3  +
pub struct DescribeInstancePatchesPaginator {
           4  +
    handle: std::sync::Arc<crate::client::Handle>,
           5  +
    builder: crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder,
           6  +
    stop_on_duplicate_token: bool,
           7  +
}
           8  +
           9  +
impl DescribeInstancePatchesPaginator {
          10  +
    /// Create a new paginator-wrapper
          11  +
    pub(crate) fn new(
          12  +
        handle: std::sync::Arc<crate::client::Handle>,
          13  +
        builder: crate::operation::describe_instance_patches::builders::DescribeInstancePatchesInputBuilder,
          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 `patches`. Queries to the underlying service
          33  +
    /// are dispatched lazily.
          34  +
    pub fn items(self) -> crate::operation::describe_instance_patches::paginator::DescribeInstancePatchesPaginatorItems {
          35  +
        crate::operation::describe_instance_patches::paginator::DescribeInstancePatchesPaginatorItems(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::describe_instance_patches::DescribeInstancePatchesOutput,
          59  +
            ::aws_smithy_runtime_api::client::result::SdkError<
          60  +
                crate::operation::describe_instance_patches::DescribeInstancePatchesError,
          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::describe_instance_patches::DescribeInstancePatches::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 =
          90  +
                            crate::operation::describe_instance_patches::DescribeInstancePatches::orchestrate(&runtime_plugins, input.clone()).await;
          91  +
                        // If the input member is None or it was an error
          92  +
                        let done = match resp {
          93  +
                            ::std::result::Result::Ok(ref resp) => {
          94  +
                                let new_token = crate::lens::reflens_describe_instance_patches_output_output_next_token(resp);
          95  +
                                // Pagination is exhausted when the next token is an empty string
          96  +
                                let is_empty = new_token.map(|token| token.is_empty()).unwrap_or(true);
          97  +
                                if !is_empty && new_token == input.next_token.as_ref() && self.stop_on_duplicate_token {
          98  +
                                    true
          99  +
                                } else {
         100  +
                                    input.next_token = new_token.cloned();
         101  +
                                    is_empty
         102  +
                                }
         103  +
                            }
         104  +
                            ::std::result::Result::Err(_) => true,
         105  +
                        };
         106  +
                        if tx.send(resp).await.is_err() {
         107  +
                            // receiving end was dropped
         108  +
                            return;
         109  +
                        }
         110  +
                        if done {
         111  +
                            return;
         112  +
                        }
         113  +
                    }
         114  +
                })
         115  +
            },
         116  +
        ))
         117  +
    }
         118  +
}
         119  +
         120  +
/// Flattened paginator for `DescribeInstancePatchesPaginator`
         121  +
///
         122  +
/// This is created with [`.items()`](DescribeInstancePatchesPaginator::items)
         123  +
pub struct DescribeInstancePatchesPaginatorItems(DescribeInstancePatchesPaginator);
         124  +
         125  +
impl DescribeInstancePatchesPaginatorItems {
         126  +
    /// Create the pagination stream
         127  +
    ///
         128  +
    /// _Note_: No requests will be dispatched until the stream is used
         129  +
    /// (e.g. with the [`.next().await`](aws_smithy_async::future::pagination_stream::PaginationStream::next) method).
         130  +
    ///
         131  +
    /// To read the entirety of the paginator, use [`.collect::<Result<Vec<_>, _>()`](aws_smithy_async::future::pagination_stream::PaginationStream::collect).
         132  +
    pub fn send(
         133  +
        self,
         134  +
    ) -> ::aws_smithy_async::future::pagination_stream::PaginationStream<
         135  +
        ::std::result::Result<
         136  +
            crate::types::PatchComplianceData,
         137  +
            ::aws_smithy_runtime_api::client::result::SdkError<
         138  +
                crate::operation::describe_instance_patches::DescribeInstancePatchesError,
         139  +
                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         140  +
            >,
         141  +
        >,
         142  +
    > {
         143  +
        ::aws_smithy_async::future::pagination_stream::TryFlatMap::new(self.0.send()).flat_map(|page| {
         144  +
            crate::lens::lens_describe_instance_patches_output_output_patches(page)
         145  +
                .unwrap_or_default()
         146  +
                .into_iter()
         147  +
        })
         148  +
    }
         149  +
}