AWS SDK

AWS SDK

rev. bbca34fa2eddb4be623fbbc6b6df1a2401de0029 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_maintenance_window_schedule/_describe_maintenance_window_schedule_input.rs

@@ -0,1 +0,415 @@
           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 DescribeMaintenanceWindowScheduleInput {
           6  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
           7  +
    pub window_id: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
           9  +
    pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
          10  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
          11  +
    pub resource_type: ::std::option::Option<crate::types::MaintenanceWindowResourceType>,
          12  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
          13  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
          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  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          17  +
    pub next_token: ::std::option::Option<::std::string::String>,
          18  +
}
          19  +
impl DescribeMaintenanceWindowScheduleInput {
          20  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
          21  +
    pub fn window_id(&self) -> ::std::option::Option<&str> {
          22  +
        self.window_id.as_deref()
          23  +
    }
          24  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</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 `.targets.is_none()`.
          27  +
    pub fn targets(&self) -> &[crate::types::Target] {
          28  +
        self.targets.as_deref().unwrap_or_default()
          29  +
    }
          30  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
          31  +
    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::MaintenanceWindowResourceType> {
          32  +
        self.resource_type.as_ref()
          33  +
    }
          34  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
          35  +
    ///
          36  +
    /// 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()`.
          37  +
    pub fn filters(&self) -> &[crate::types::PatchOrchestratorFilter] {
          38  +
        self.filters.as_deref().unwrap_or_default()
          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  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          45  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          46  +
        self.next_token.as_deref()
          47  +
    }
          48  +
}
          49  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_WINDOW_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          50  +
    ::aws_smithy_schema::ShapeId::from_parts(
          51  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$WindowId",
          52  +
        "com.amazonaws.ssm.synthetic",
          53  +
        "DescribeMaintenanceWindowScheduleInput",
          54  +
    ),
          55  +
    ::aws_smithy_schema::ShapeType::String,
          56  +
    "WindowId",
          57  +
    0,
          58  +
);
          59  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_TARGETS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          60  +
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#Targets$member", "com.amazonaws.ssm", "Targets"),
          61  +
    ::aws_smithy_schema::ShapeType::Structure,
          62  +
    "member",
          63  +
    0,
          64  +
);
          65  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_TARGETS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          66  +
    ::aws_smithy_schema::ShapeId::from_parts(
          67  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$Targets",
          68  +
        "com.amazonaws.ssm.synthetic",
          69  +
        "DescribeMaintenanceWindowScheduleInput",
          70  +
    ),
          71  +
    ::aws_smithy_schema::ShapeType::List,
          72  +
    "Targets",
          73  +
    1,
          74  +
)
          75  +
.with_list_member(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_TARGETS_MEMBER);
          76  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_RESOURCE_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          77  +
    ::aws_smithy_schema::ShapeId::from_parts(
          78  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$ResourceType",
          79  +
        "com.amazonaws.ssm.synthetic",
          80  +
        "DescribeMaintenanceWindowScheduleInput",
          81  +
    ),
          82  +
    ::aws_smithy_schema::ShapeType::String,
          83  +
    "ResourceType",
          84  +
    2,
          85  +
);
          86  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          87  +
    ::aws_smithy_schema::ShapeId::from_parts(
          88  +
        "com.amazonaws.ssm#PatchOrchestratorFilterList$member",
          89  +
        "com.amazonaws.ssm",
          90  +
        "PatchOrchestratorFilterList",
          91  +
    ),
          92  +
    ::aws_smithy_schema::ShapeType::Structure,
          93  +
    "member",
          94  +
    0,
          95  +
);
          96  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          97  +
    ::aws_smithy_schema::ShapeId::from_parts(
          98  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$Filters",
          99  +
        "com.amazonaws.ssm.synthetic",
         100  +
        "DescribeMaintenanceWindowScheduleInput",
         101  +
    ),
         102  +
    ::aws_smithy_schema::ShapeType::List,
         103  +
    "Filters",
         104  +
    3,
         105  +
)
         106  +
.with_list_member(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_FILTERS_MEMBER);
         107  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         108  +
    ::aws_smithy_schema::ShapeId::from_parts(
         109  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$MaxResults",
         110  +
        "com.amazonaws.ssm.synthetic",
         111  +
        "DescribeMaintenanceWindowScheduleInput",
         112  +
    ),
         113  +
    ::aws_smithy_schema::ShapeType::Integer,
         114  +
    "MaxResults",
         115  +
    4,
         116  +
);
         117  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         118  +
    ::aws_smithy_schema::ShapeId::from_parts(
         119  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput$NextToken",
         120  +
        "com.amazonaws.ssm.synthetic",
         121  +
        "DescribeMaintenanceWindowScheduleInput",
         122  +
    ),
         123  +
    ::aws_smithy_schema::ShapeType::String,
         124  +
    "NextToken",
         125  +
    5,
         126  +
);
         127  +
static DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         128  +
    ::aws_smithy_schema::ShapeId::from_parts(
         129  +
        "com.amazonaws.ssm.synthetic#DescribeMaintenanceWindowScheduleInput",
         130  +
        "com.amazonaws.ssm.synthetic",
         131  +
        "DescribeMaintenanceWindowScheduleInput",
         132  +
    ),
         133  +
    ::aws_smithy_schema::ShapeType::Structure,
         134  +
    &[
         135  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_WINDOW_ID,
         136  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_TARGETS,
         137  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_RESOURCE_TYPE,
         138  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_FILTERS,
         139  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_MAX_RESULTS,
         140  +
        &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_NEXT_TOKEN,
         141  +
    ],
         142  +
)
         143  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         144  +
.with_original_name("DescribeMaintenanceWindowScheduleRequest");
         145  +
impl DescribeMaintenanceWindowScheduleInput {
         146  +
    /// The schema for this shape.
         147  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_SCHEMA;
         148  +
}
         149  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribeMaintenanceWindowScheduleInput {
         150  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         151  +
    fn serialize_members(
         152  +
        &self,
         153  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         154  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         155  +
        if let Some(ref val) = self.window_id {
         156  +
            ser.write_string(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_WINDOW_ID, val)?;
         157  +
        }
         158  +
        if let Some(ref val) = self.targets {
         159  +
            ser.write_list(
         160  +
                &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_TARGETS,
         161  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         162  +
                    for item in val {
         163  +
                        ser.write_struct(crate::types::Target::SCHEMA, item)?;
         164  +
                    }
         165  +
                    Ok(())
         166  +
                },
         167  +
            )?;
         168  +
        }
         169  +
        if let Some(ref val) = self.resource_type {
         170  +
            ser.write_string(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_RESOURCE_TYPE, val.as_str())?;
         171  +
        }
         172  +
        if let Some(ref val) = self.filters {
         173  +
            ser.write_list(
         174  +
                &DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_FILTERS,
         175  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         176  +
                    for item in val {
         177  +
                        ser.write_struct(crate::types::PatchOrchestratorFilter::SCHEMA, item)?;
         178  +
                    }
         179  +
                    Ok(())
         180  +
                },
         181  +
            )?;
         182  +
        }
         183  +
        if let Some(ref val) = self.max_results {
         184  +
            ser.write_integer(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_MAX_RESULTS, *val)?;
         185  +
        }
         186  +
        if let Some(ref val) = self.next_token {
         187  +
            ser.write_string(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_MEMBER_NEXT_TOKEN, val)?;
         188  +
        }
         189  +
        Ok(())
         190  +
    }
         191  +
}
         192  +
impl DescribeMaintenanceWindowScheduleInput {
         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(&DESCRIBEMAINTENANCEWINDOWSCHEDULEINPUT_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.window_id = Some(deser.read_string(member)?);
         213  +
                    }
         214  +
                }
         215  +
                Some(1) => {
         216  +
                    if deser.is_null() {
         217  +
                        deser.read_null()?;
         218  +
                    } else {
         219  +
                        builder.targets = Some({
         220  +
                            let mut container = Vec::new();
         221  +
                            deser.read_list(member, &mut |deser| {
         222  +
                                container.push(crate::types::Target::deserialize(deser)?);
         223  +
                                Ok(())
         224  +
                            })?;
         225  +
                            container
         226  +
                        });
         227  +
                    }
         228  +
                }
         229  +
                Some(2) => {
         230  +
                    if deser.is_null() {
         231  +
                        deser.read_null()?;
         232  +
                    } else {
         233  +
                        builder.resource_type = Some(crate::types::MaintenanceWindowResourceType::from(deser.read_string(member)?.as_str()));
         234  +
                    }
         235  +
                }
         236  +
                Some(3) => {
         237  +
                    if deser.is_null() {
         238  +
                        deser.read_null()?;
         239  +
                    } else {
         240  +
                        builder.filters = Some({
         241  +
                            let mut container = Vec::new();
         242  +
                            deser.read_list(member, &mut |deser| {
         243  +
                                container.push(crate::types::PatchOrchestratorFilter::deserialize(deser)?);
         244  +
                                Ok(())
         245  +
                            })?;
         246  +
                            container
         247  +
                        });
         248  +
                    }
         249  +
                }
         250  +
                Some(4) => {
         251  +
                    if deser.is_null() {
         252  +
                        deser.read_null()?;
         253  +
                    } else {
         254  +
                        builder.max_results = Some(deser.read_integer(member)?);
         255  +
                    }
         256  +
                }
         257  +
                Some(5) => {
         258  +
                    if deser.is_null() {
         259  +
                        deser.read_null()?;
         260  +
                    } else {
         261  +
                        builder.next_token = Some(deser.read_string(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 DescribeMaintenanceWindowScheduleInput {
         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 DescribeMaintenanceWindowScheduleInput {
         283  +
    /// Creates a new builder-style object to manufacture [`DescribeMaintenanceWindowScheduleInput`](crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleInput).
         284  +
    pub fn builder() -> crate::operation::describe_maintenance_window_schedule::builders::DescribeMaintenanceWindowScheduleInputBuilder {
         285  +
        crate::operation::describe_maintenance_window_schedule::builders::DescribeMaintenanceWindowScheduleInputBuilder::default()
         286  +
    }
         287  +
}
         288  +
         289  +
/// A builder for [`DescribeMaintenanceWindowScheduleInput`](crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleInput).
         290  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         291  +
#[non_exhaustive]
         292  +
pub struct DescribeMaintenanceWindowScheduleInputBuilder {
         293  +
    pub(crate) window_id: ::std::option::Option<::std::string::String>,
         294  +
    pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
         295  +
    pub(crate) resource_type: ::std::option::Option<crate::types::MaintenanceWindowResourceType>,
         296  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
         297  +
    pub(crate) max_results: ::std::option::Option<i32>,
         298  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         299  +
}
         300  +
impl DescribeMaintenanceWindowScheduleInputBuilder {
         301  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         302  +
    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         303  +
        self.window_id = ::std::option::Option::Some(input.into());
         304  +
        self
         305  +
    }
         306  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         307  +
    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         308  +
        self.window_id = input;
         309  +
        self
         310  +
    }
         311  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         312  +
    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
         313  +
        &self.window_id
         314  +
    }
         315  +
    /// Appends an item to `targets`.
         316  +
    ///
         317  +
    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
         318  +
    ///
         319  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         320  +
    pub fn targets(mut self, input: crate::types::Target) -> Self {
         321  +
        let mut v = self.targets.unwrap_or_default();
         322  +
        v.push(input);
         323  +
        self.targets = ::std::option::Option::Some(v);
         324  +
        self
         325  +
    }
         326  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         327  +
    pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
         328  +
        self.targets = input;
         329  +
        self
         330  +
    }
         331  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         332  +
    pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
         333  +
        &self.targets
         334  +
    }
         335  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         336  +
    pub fn resource_type(mut self, input: crate::types::MaintenanceWindowResourceType) -> Self {
         337  +
        self.resource_type = ::std::option::Option::Some(input);
         338  +
        self
         339  +
    }
         340  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         341  +
    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowResourceType>) -> Self {
         342  +
        self.resource_type = input;
         343  +
        self
         344  +
    }
         345  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         346  +
    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::MaintenanceWindowResourceType> {
         347  +
        &self.resource_type
         348  +
    }
         349  +
    /// Appends an item to `filters`.
         350  +
    ///
         351  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         352  +
    ///
         353  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         354  +
    pub fn filters(mut self, input: crate::types::PatchOrchestratorFilter) -> Self {
         355  +
        let mut v = self.filters.unwrap_or_default();
         356  +
        v.push(input);
         357  +
        self.filters = ::std::option::Option::Some(v);
         358  +
        self
         359  +
    }
         360  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         361  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>) -> Self {
         362  +
        self.filters = input;
         363  +
        self
         364  +
    }
         365  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         366  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>> {
         367  +
        &self.filters
         368  +
    }
         369  +
    /// <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>
         370  +
    pub fn max_results(mut self, input: i32) -> Self {
         371  +
        self.max_results = ::std::option::Option::Some(input);
         372  +
        self
         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 set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         376  +
        self.max_results = 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 get_max_results(&self) -> &::std::option::Option<i32> {
         381  +
        &self.max_results
         382  +
    }
         383  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         384  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         385  +
        self.next_token = ::std::option::Option::Some(input.into());
         386  +
        self
         387  +
    }
         388  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         389  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         390  +
        self.next_token = input;
         391  +
        self
         392  +
    }
         393  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         394  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         395  +
        &self.next_token
         396  +
    }
         397  +
    /// Consumes the builder and constructs a [`DescribeMaintenanceWindowScheduleInput`](crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleInput).
         398  +
    pub fn build(
         399  +
        self,
         400  +
    ) -> ::std::result::Result<
         401  +
        crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleInput,
         402  +
        ::aws_smithy_types::error::operation::BuildError,
         403  +
    > {
         404  +
        ::std::result::Result::Ok(
         405  +
            crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleInput {
         406  +
                window_id: self.window_id,
         407  +
                targets: self.targets,
         408  +
                resource_type: self.resource_type,
         409  +
                filters: self.filters,
         410  +
                max_results: self.max_results,
         411  +
                next_token: self.next_token,
         412  +
            },
         413  +
        )
         414  +
    }
         415  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/describe_maintenance_window_schedule/_describe_maintenance_window_schedule_output.rs

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

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

@@ -0,1 +0,211 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::describe_maintenance_window_schedule::_describe_maintenance_window_schedule_input::DescribeMaintenanceWindowScheduleInputBuilder;
           3  +
           4  +
pub use crate::operation::describe_maintenance_window_schedule::_describe_maintenance_window_schedule_output::DescribeMaintenanceWindowScheduleOutputBuilder;
           5  +
           6  +
impl crate::operation::describe_maintenance_window_schedule::builders::DescribeMaintenanceWindowScheduleInputBuilder {
           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_maintenance_window_schedule::DescribeMaintenanceWindowScheduleOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.describe_maintenance_window_schedule();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `DescribeMaintenanceWindowSchedule`.
          24  +
///
          25  +
/// <p>Retrieves information about upcoming executions of a maintenance window.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct DescribeMaintenanceWindowScheduleFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::describe_maintenance_window_schedule::builders::DescribeMaintenanceWindowScheduleInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleOutput,
          35  +
        crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleError,
          36  +
    > for DescribeMaintenanceWindowScheduleFluentBuilder
          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_maintenance_window_schedule::DescribeMaintenanceWindowScheduleOutput,
          44  +
            crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl DescribeMaintenanceWindowScheduleFluentBuilder {
          51  +
    /// Creates a new `DescribeMaintenanceWindowScheduleFluentBuilder`.
          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 DescribeMaintenanceWindowSchedule as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::describe_maintenance_window_schedule::builders::DescribeMaintenanceWindowScheduleInputBuilder {
          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_maintenance_window_schedule::DescribeMaintenanceWindowScheduleOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleError,
          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_maintenance_window_schedule::DescribeMaintenanceWindowSchedule::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowSchedule::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_maintenance_window_schedule::DescribeMaintenanceWindowScheduleOutput,
          97  +
        crate::operation::describe_maintenance_window_schedule::DescribeMaintenanceWindowScheduleError,
          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_maintenance_window_schedule::paginator::DescribeMaintenanceWindowSchedulePaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
         114  +
    pub fn into_paginator(self) -> crate::operation::describe_maintenance_window_schedule::paginator::DescribeMaintenanceWindowSchedulePaginator {
         115  +
        crate::operation::describe_maintenance_window_schedule::paginator::DescribeMaintenanceWindowSchedulePaginator::new(self.handle, self.inner)
         116  +
    }
         117  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         118  +
    pub fn window_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         119  +
        self.inner = self.inner.window_id(input.into());
         120  +
        self
         121  +
    }
         122  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         123  +
    pub fn set_window_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         124  +
        self.inner = self.inner.set_window_id(input);
         125  +
        self
         126  +
    }
         127  +
    /// <p>The ID of the maintenance window to retrieve information about.</p>
         128  +
    pub fn get_window_id(&self) -> &::std::option::Option<::std::string::String> {
         129  +
        self.inner.get_window_id()
         130  +
    }
         131  +
    ///
         132  +
    /// Appends an item to `Targets`.
         133  +
    ///
         134  +
    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
         135  +
    ///
         136  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         137  +
    pub fn targets(mut self, input: crate::types::Target) -> Self {
         138  +
        self.inner = self.inner.targets(input);
         139  +
        self
         140  +
    }
         141  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         142  +
    pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
         143  +
        self.inner = self.inner.set_targets(input);
         144  +
        self
         145  +
    }
         146  +
    /// <p>The managed node ID or key-value pair to retrieve information about.</p>
         147  +
    pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
         148  +
        self.inner.get_targets()
         149  +
    }
         150  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         151  +
    pub fn resource_type(mut self, input: crate::types::MaintenanceWindowResourceType) -> Self {
         152  +
        self.inner = self.inner.resource_type(input);
         153  +
        self
         154  +
    }
         155  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         156  +
    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::MaintenanceWindowResourceType>) -> Self {
         157  +
        self.inner = self.inner.set_resource_type(input);
         158  +
        self
         159  +
    }
         160  +
    /// <p>The type of resource you want to retrieve information about. For example, <code>INSTANCE</code>.</p>
         161  +
    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::MaintenanceWindowResourceType> {
         162  +
        self.inner.get_resource_type()
         163  +
    }
         164  +
    ///
         165  +
    /// Appends an item to `Filters`.
         166  +
    ///
         167  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         168  +
    ///
         169  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         170  +
    pub fn filters(mut self, input: crate::types::PatchOrchestratorFilter) -> Self {
         171  +
        self.inner = self.inner.filters(input);
         172  +
        self
         173  +
    }
         174  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         175  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>) -> Self {
         176  +
        self.inner = self.inner.set_filters(input);
         177  +
        self
         178  +
    }
         179  +
    /// <p>Filters used to limit the range of results. For example, you can limit maintenance window executions to only those scheduled before or after a certain date and time.</p>
         180  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>> {
         181  +
        self.inner.get_filters()
         182  +
    }
         183  +
    /// <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>
         184  +
    pub fn max_results(mut self, input: i32) -> Self {
         185  +
        self.inner = self.inner.max_results(input);
         186  +
        self
         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 set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         190  +
        self.inner = self.inner.set_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 get_max_results(&self) -> &::std::option::Option<i32> {
         195  +
        self.inner.get_max_results()
         196  +
    }
         197  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         198  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         199  +
        self.inner = self.inner.next_token(input.into());
         200  +
        self
         201  +
    }
         202  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         203  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         204  +
        self.inner = self.inner.set_next_token(input);
         205  +
        self
         206  +
    }
         207  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         208  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         209  +
        self.inner.get_next_token()
         210  +
    }
         211  +
}

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

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