AWS SDK

AWS SDK

rev. 2915cec5ef64cb1ed4992565a748d76a11505b3b (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/update_document/_update_document_input.rs

@@ -0,1 +0,480 @@
           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 UpdateDocumentInput {
           6  +
    /// <p>A valid JSON or YAML string.</p>
           7  +
    pub content: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
           9  +
    pub attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>,
          10  +
    /// <p>The name of the SSM document that you want to update.</p>
          11  +
    pub name: ::std::option::Option<::std::string::String>,
          12  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
          13  +
    pub display_name: ::std::option::Option<::std::string::String>,
          14  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
          15  +
    pub version_name: ::std::option::Option<::std::string::String>,
          16  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
          17  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
          18  +
    /// </note>
          19  +
    pub document_version: ::std::option::Option<::std::string::String>,
          20  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
          21  +
    pub document_format: ::std::option::Option<crate::types::DocumentFormat>,
          22  +
    /// <p>Specify a new target type for the document.</p>
          23  +
    pub target_type: ::std::option::Option<::std::string::String>,
          24  +
}
          25  +
impl UpdateDocumentInput {
          26  +
    /// <p>A valid JSON or YAML string.</p>
          27  +
    pub fn content(&self) -> ::std::option::Option<&str> {
          28  +
        self.content.as_deref()
          29  +
    }
          30  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
          31  +
    ///
          32  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attachments.is_none()`.
          33  +
    pub fn attachments(&self) -> &[crate::types::AttachmentsSource] {
          34  +
        self.attachments.as_deref().unwrap_or_default()
          35  +
    }
          36  +
    /// <p>The name of the SSM document that you want to update.</p>
          37  +
    pub fn name(&self) -> ::std::option::Option<&str> {
          38  +
        self.name.as_deref()
          39  +
    }
          40  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
          41  +
    pub fn display_name(&self) -> ::std::option::Option<&str> {
          42  +
        self.display_name.as_deref()
          43  +
    }
          44  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
          45  +
    pub fn version_name(&self) -> ::std::option::Option<&str> {
          46  +
        self.version_name.as_deref()
          47  +
    }
          48  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
          49  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
          50  +
    /// </note>
          51  +
    pub fn document_version(&self) -> ::std::option::Option<&str> {
          52  +
        self.document_version.as_deref()
          53  +
    }
          54  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
          55  +
    pub fn document_format(&self) -> ::std::option::Option<&crate::types::DocumentFormat> {
          56  +
        self.document_format.as_ref()
          57  +
    }
          58  +
    /// <p>Specify a new target type for the document.</p>
          59  +
    pub fn target_type(&self) -> ::std::option::Option<&str> {
          60  +
        self.target_type.as_deref()
          61  +
    }
          62  +
}
          63  +
static UPDATEDOCUMENTINPUT_MEMBER_CONTENT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          64  +
    ::aws_smithy_schema::ShapeId::from_parts(
          65  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$Content",
          66  +
        "com.amazonaws.ssm.synthetic",
          67  +
        "UpdateDocumentInput",
          68  +
    ),
          69  +
    ::aws_smithy_schema::ShapeType::String,
          70  +
    "Content",
          71  +
    0,
          72  +
);
          73  +
static UPDATEDOCUMENTINPUT_MEMBER_ATTACHMENTS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          74  +
    ::aws_smithy_schema::ShapeId::from_parts(
          75  +
        "com.amazonaws.ssm#AttachmentsSourceList$member",
          76  +
        "com.amazonaws.ssm",
          77  +
        "AttachmentsSourceList",
          78  +
    ),
          79  +
    ::aws_smithy_schema::ShapeType::Structure,
          80  +
    "member",
          81  +
    0,
          82  +
);
          83  +
static UPDATEDOCUMENTINPUT_MEMBER_ATTACHMENTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          84  +
    ::aws_smithy_schema::ShapeId::from_parts(
          85  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$Attachments",
          86  +
        "com.amazonaws.ssm.synthetic",
          87  +
        "UpdateDocumentInput",
          88  +
    ),
          89  +
    ::aws_smithy_schema::ShapeType::List,
          90  +
    "Attachments",
          91  +
    1,
          92  +
)
          93  +
.with_list_member(&UPDATEDOCUMENTINPUT_MEMBER_ATTACHMENTS_MEMBER);
          94  +
static UPDATEDOCUMENTINPUT_MEMBER_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          95  +
    ::aws_smithy_schema::ShapeId::from_parts(
          96  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$Name",
          97  +
        "com.amazonaws.ssm.synthetic",
          98  +
        "UpdateDocumentInput",
          99  +
    ),
         100  +
    ::aws_smithy_schema::ShapeType::String,
         101  +
    "Name",
         102  +
    2,
         103  +
);
         104  +
static UPDATEDOCUMENTINPUT_MEMBER_DISPLAY_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         105  +
    ::aws_smithy_schema::ShapeId::from_parts(
         106  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$DisplayName",
         107  +
        "com.amazonaws.ssm.synthetic",
         108  +
        "UpdateDocumentInput",
         109  +
    ),
         110  +
    ::aws_smithy_schema::ShapeType::String,
         111  +
    "DisplayName",
         112  +
    3,
         113  +
);
         114  +
static UPDATEDOCUMENTINPUT_MEMBER_VERSION_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         115  +
    ::aws_smithy_schema::ShapeId::from_parts(
         116  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$VersionName",
         117  +
        "com.amazonaws.ssm.synthetic",
         118  +
        "UpdateDocumentInput",
         119  +
    ),
         120  +
    ::aws_smithy_schema::ShapeType::String,
         121  +
    "VersionName",
         122  +
    4,
         123  +
);
         124  +
static UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         125  +
    ::aws_smithy_schema::ShapeId::from_parts(
         126  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$DocumentVersion",
         127  +
        "com.amazonaws.ssm.synthetic",
         128  +
        "UpdateDocumentInput",
         129  +
    ),
         130  +
    ::aws_smithy_schema::ShapeType::String,
         131  +
    "DocumentVersion",
         132  +
    5,
         133  +
);
         134  +
static UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         135  +
    ::aws_smithy_schema::ShapeId::from_parts(
         136  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$DocumentFormat",
         137  +
        "com.amazonaws.ssm.synthetic",
         138  +
        "UpdateDocumentInput",
         139  +
    ),
         140  +
    ::aws_smithy_schema::ShapeType::String,
         141  +
    "DocumentFormat",
         142  +
    6,
         143  +
);
         144  +
static UPDATEDOCUMENTINPUT_MEMBER_TARGET_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
         145  +
    ::aws_smithy_schema::ShapeId::from_parts(
         146  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput$TargetType",
         147  +
        "com.amazonaws.ssm.synthetic",
         148  +
        "UpdateDocumentInput",
         149  +
    ),
         150  +
    ::aws_smithy_schema::ShapeType::String,
         151  +
    "TargetType",
         152  +
    7,
         153  +
);
         154  +
static UPDATEDOCUMENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
         155  +
    ::aws_smithy_schema::ShapeId::from_parts(
         156  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentInput",
         157  +
        "com.amazonaws.ssm.synthetic",
         158  +
        "UpdateDocumentInput",
         159  +
    ),
         160  +
    ::aws_smithy_schema::ShapeType::Structure,
         161  +
    &[
         162  +
        &UPDATEDOCUMENTINPUT_MEMBER_CONTENT,
         163  +
        &UPDATEDOCUMENTINPUT_MEMBER_ATTACHMENTS,
         164  +
        &UPDATEDOCUMENTINPUT_MEMBER_NAME,
         165  +
        &UPDATEDOCUMENTINPUT_MEMBER_DISPLAY_NAME,
         166  +
        &UPDATEDOCUMENTINPUT_MEMBER_VERSION_NAME,
         167  +
        &UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION,
         168  +
        &UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT,
         169  +
        &UPDATEDOCUMENTINPUT_MEMBER_TARGET_TYPE,
         170  +
    ],
         171  +
)
         172  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         173  +
.with_original_name("UpdateDocumentRequest");
         174  +
impl UpdateDocumentInput {
         175  +
    /// The schema for this shape.
         176  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UPDATEDOCUMENTINPUT_SCHEMA;
         177  +
}
         178  +
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateDocumentInput {
         179  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         180  +
    fn serialize_members(
         181  +
        &self,
         182  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         183  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         184  +
        if let Some(ref val) = self.content {
         185  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_CONTENT, val)?;
         186  +
        }
         187  +
        if let Some(ref val) = self.attachments {
         188  +
            ser.write_list(
         189  +
                &UPDATEDOCUMENTINPUT_MEMBER_ATTACHMENTS,
         190  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         191  +
                    for item in val {
         192  +
                        ser.write_struct(crate::types::AttachmentsSource::SCHEMA, item)?;
         193  +
                    }
         194  +
                    Ok(())
         195  +
                },
         196  +
            )?;
         197  +
        }
         198  +
        if let Some(ref val) = self.name {
         199  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_NAME, val)?;
         200  +
        }
         201  +
        if let Some(ref val) = self.display_name {
         202  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_DISPLAY_NAME, val)?;
         203  +
        }
         204  +
        if let Some(ref val) = self.version_name {
         205  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_VERSION_NAME, val)?;
         206  +
        }
         207  +
        if let Some(ref val) = self.document_version {
         208  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_VERSION, val)?;
         209  +
        }
         210  +
        if let Some(ref val) = self.document_format {
         211  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_DOCUMENT_FORMAT, val.as_str())?;
         212  +
        }
         213  +
        if let Some(ref val) = self.target_type {
         214  +
            ser.write_string(&UPDATEDOCUMENTINPUT_MEMBER_TARGET_TYPE, val)?;
         215  +
        }
         216  +
        Ok(())
         217  +
    }
         218  +
}
         219  +
impl UpdateDocumentInput {
         220  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         221  +
    pub fn deserialize(
         222  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         223  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         224  +
        #[allow(unused_variables, unused_mut)]
         225  +
        let mut builder = Self::builder();
         226  +
        #[allow(
         227  +
            unused_variables,
         228  +
            unreachable_code,
         229  +
            clippy::single_match,
         230  +
            clippy::match_single_binding,
         231  +
            clippy::diverging_sub_expression
         232  +
        )]
         233  +
        deserializer.read_struct(&UPDATEDOCUMENTINPUT_SCHEMA, &mut |member, deser| {
         234  +
            match member.member_index() {
         235  +
                Some(0) => {
         236  +
                    if deser.is_null() {
         237  +
                        deser.read_null()?;
         238  +
                    } else {
         239  +
                        builder.content = Some(deser.read_string(member)?);
         240  +
                    }
         241  +
                }
         242  +
                Some(1) => {
         243  +
                    if deser.is_null() {
         244  +
                        deser.read_null()?;
         245  +
                    } else {
         246  +
                        builder.attachments = Some({
         247  +
                            let mut container = Vec::new();
         248  +
                            deser.read_list(member, &mut |deser| {
         249  +
                                container.push(crate::types::AttachmentsSource::deserialize(deser)?);
         250  +
                                Ok(())
         251  +
                            })?;
         252  +
                            container
         253  +
                        });
         254  +
                    }
         255  +
                }
         256  +
                Some(2) => {
         257  +
                    if deser.is_null() {
         258  +
                        deser.read_null()?;
         259  +
                    } else {
         260  +
                        builder.name = Some(deser.read_string(member)?);
         261  +
                    }
         262  +
                }
         263  +
                Some(3) => {
         264  +
                    if deser.is_null() {
         265  +
                        deser.read_null()?;
         266  +
                    } else {
         267  +
                        builder.display_name = Some(deser.read_string(member)?);
         268  +
                    }
         269  +
                }
         270  +
                Some(4) => {
         271  +
                    if deser.is_null() {
         272  +
                        deser.read_null()?;
         273  +
                    } else {
         274  +
                        builder.version_name = Some(deser.read_string(member)?);
         275  +
                    }
         276  +
                }
         277  +
                Some(5) => {
         278  +
                    if deser.is_null() {
         279  +
                        deser.read_null()?;
         280  +
                    } else {
         281  +
                        builder.document_version = Some(deser.read_string(member)?);
         282  +
                    }
         283  +
                }
         284  +
                Some(6) => {
         285  +
                    if deser.is_null() {
         286  +
                        deser.read_null()?;
         287  +
                    } else {
         288  +
                        builder.document_format = Some(crate::types::DocumentFormat::from(deser.read_string(member)?.as_str()));
         289  +
                    }
         290  +
                }
         291  +
                Some(7) => {
         292  +
                    if deser.is_null() {
         293  +
                        deser.read_null()?;
         294  +
                    } else {
         295  +
                        builder.target_type = Some(deser.read_string(member)?);
         296  +
                    }
         297  +
                }
         298  +
                _ => {}
         299  +
            }
         300  +
            Ok(())
         301  +
        })?;
         302  +
        builder.content = builder.content.or(Some(String::new()));
         303  +
        builder.name = builder.name.or(Some(String::new()));
         304  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         305  +
    }
         306  +
}
         307  +
impl UpdateDocumentInput {
         308  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         309  +
    pub fn deserialize_with_response(
         310  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         311  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         312  +
        _status: u16,
         313  +
        _body: &[u8],
         314  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         315  +
        Self::deserialize(deserializer)
         316  +
    }
         317  +
}
         318  +
impl UpdateDocumentInput {
         319  +
    /// Creates a new builder-style object to manufacture [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
         320  +
    pub fn builder() -> crate::operation::update_document::builders::UpdateDocumentInputBuilder {
         321  +
        crate::operation::update_document::builders::UpdateDocumentInputBuilder::default()
         322  +
    }
         323  +
}
         324  +
         325  +
/// A builder for [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
         326  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         327  +
#[non_exhaustive]
         328  +
pub struct UpdateDocumentInputBuilder {
         329  +
    pub(crate) content: ::std::option::Option<::std::string::String>,
         330  +
    pub(crate) attachments: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>,
         331  +
    pub(crate) name: ::std::option::Option<::std::string::String>,
         332  +
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
         333  +
    pub(crate) version_name: ::std::option::Option<::std::string::String>,
         334  +
    pub(crate) document_version: ::std::option::Option<::std::string::String>,
         335  +
    pub(crate) document_format: ::std::option::Option<crate::types::DocumentFormat>,
         336  +
    pub(crate) target_type: ::std::option::Option<::std::string::String>,
         337  +
}
         338  +
impl UpdateDocumentInputBuilder {
         339  +
    /// <p>A valid JSON or YAML string.</p>
         340  +
    /// This field is required.
         341  +
    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         342  +
        self.content = ::std::option::Option::Some(input.into());
         343  +
        self
         344  +
    }
         345  +
    /// <p>A valid JSON or YAML string.</p>
         346  +
    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         347  +
        self.content = input;
         348  +
        self
         349  +
    }
         350  +
    /// <p>A valid JSON or YAML string.</p>
         351  +
    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
         352  +
        &self.content
         353  +
    }
         354  +
    /// Appends an item to `attachments`.
         355  +
    ///
         356  +
    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
         357  +
    ///
         358  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         359  +
    pub fn attachments(mut self, input: crate::types::AttachmentsSource) -> Self {
         360  +
        let mut v = self.attachments.unwrap_or_default();
         361  +
        v.push(input);
         362  +
        self.attachments = ::std::option::Option::Some(v);
         363  +
        self
         364  +
    }
         365  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         366  +
    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>) -> Self {
         367  +
        self.attachments = input;
         368  +
        self
         369  +
    }
         370  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         371  +
    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>> {
         372  +
        &self.attachments
         373  +
    }
         374  +
    /// <p>The name of the SSM document that you want to update.</p>
         375  +
    /// This field is required.
         376  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         377  +
        self.name = ::std::option::Option::Some(input.into());
         378  +
        self
         379  +
    }
         380  +
    /// <p>The name of the SSM document that you want to update.</p>
         381  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         382  +
        self.name = input;
         383  +
        self
         384  +
    }
         385  +
    /// <p>The name of the SSM document that you want to update.</p>
         386  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         387  +
        &self.name
         388  +
    }
         389  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         390  +
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         391  +
        self.display_name = ::std::option::Option::Some(input.into());
         392  +
        self
         393  +
    }
         394  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         395  +
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         396  +
        self.display_name = input;
         397  +
        self
         398  +
    }
         399  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         400  +
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
         401  +
        &self.display_name
         402  +
    }
         403  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         404  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         405  +
        self.version_name = ::std::option::Option::Some(input.into());
         406  +
        self
         407  +
    }
         408  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         409  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         410  +
        self.version_name = input;
         411  +
        self
         412  +
    }
         413  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         414  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         415  +
        &self.version_name
         416  +
    }
         417  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         418  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         419  +
    /// </note>
         420  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         421  +
        self.document_version = ::std::option::Option::Some(input.into());
         422  +
        self
         423  +
    }
         424  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         425  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         426  +
    /// </note>
         427  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         428  +
        self.document_version = input;
         429  +
        self
         430  +
    }
         431  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         432  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         433  +
    /// </note>
         434  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         435  +
        &self.document_version
         436  +
    }
         437  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         438  +
    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
         439  +
        self.document_format = ::std::option::Option::Some(input);
         440  +
        self
         441  +
    }
         442  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         443  +
    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
         444  +
        self.document_format = input;
         445  +
        self
         446  +
    }
         447  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         448  +
    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
         449  +
        &self.document_format
         450  +
    }
         451  +
    /// <p>Specify a new target type for the document.</p>
         452  +
    pub fn target_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         453  +
        self.target_type = ::std::option::Option::Some(input.into());
         454  +
        self
         455  +
    }
         456  +
    /// <p>Specify a new target type for the document.</p>
         457  +
    pub fn set_target_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         458  +
        self.target_type = input;
         459  +
        self
         460  +
    }
         461  +
    /// <p>Specify a new target type for the document.</p>
         462  +
    pub fn get_target_type(&self) -> &::std::option::Option<::std::string::String> {
         463  +
        &self.target_type
         464  +
    }
         465  +
    /// Consumes the builder and constructs a [`UpdateDocumentInput`](crate::operation::update_document::UpdateDocumentInput).
         466  +
    pub fn build(
         467  +
        self,
         468  +
    ) -> ::std::result::Result<crate::operation::update_document::UpdateDocumentInput, ::aws_smithy_types::error::operation::BuildError> {
         469  +
        ::std::result::Result::Ok(crate::operation::update_document::UpdateDocumentInput {
         470  +
            content: self.content,
         471  +
            attachments: self.attachments,
         472  +
            name: self.name,
         473  +
            display_name: self.display_name,
         474  +
            version_name: self.version_name,
         475  +
            document_version: self.document_version,
         476  +
            document_format: self.document_format,
         477  +
            target_type: self.target_type,
         478  +
        })
         479  +
    }
         480  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/update_document/_update_document_output.rs

@@ -0,1 +0,186 @@
           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 UpdateDocumentOutput {
           6  +
    /// <p>A description of the document that was updated.</p>
           7  +
    pub document_description: ::std::option::Option<crate::types::DocumentDescription>,
           8  +
    _request_id: Option<String>,
           9  +
}
          10  +
impl UpdateDocumentOutput {
          11  +
    /// <p>A description of the document that was updated.</p>
          12  +
    pub fn document_description(&self) -> ::std::option::Option<&crate::types::DocumentDescription> {
          13  +
        self.document_description.as_ref()
          14  +
    }
          15  +
}
          16  +
static UPDATEDOCUMENTOUTPUT_MEMBER_DOCUMENT_DESCRIPTION: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          17  +
    ::aws_smithy_schema::ShapeId::from_parts(
          18  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentOutput$DocumentDescription",
          19  +
        "com.amazonaws.ssm.synthetic",
          20  +
        "UpdateDocumentOutput",
          21  +
    ),
          22  +
    ::aws_smithy_schema::ShapeType::Structure,
          23  +
    "DocumentDescription",
          24  +
    0,
          25  +
);
          26  +
static UPDATEDOCUMENTOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          27  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          28  +
    ::aws_smithy_schema::ShapeType::String,
          29  +
    "request_id",
          30  +
    1,
          31  +
)
          32  +
.with_http_header("x-amzn-requestid");
          33  +
static UPDATEDOCUMENTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          34  +
    ::aws_smithy_schema::ShapeId::from_parts(
          35  +
        "com.amazonaws.ssm.synthetic#UpdateDocumentOutput",
          36  +
        "com.amazonaws.ssm.synthetic",
          37  +
        "UpdateDocumentOutput",
          38  +
    ),
          39  +
    ::aws_smithy_schema::ShapeType::Structure,
          40  +
    &[
          41  +
        &UPDATEDOCUMENTOUTPUT_MEMBER_DOCUMENT_DESCRIPTION,
          42  +
        &UPDATEDOCUMENTOUTPUT_MEMBER__REQUEST_ID,
          43  +
    ],
          44  +
)
          45  +
.with_original_name("UpdateDocumentResult");
          46  +
impl UpdateDocumentOutput {
          47  +
    /// The schema for this shape.
          48  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UPDATEDOCUMENTOUTPUT_SCHEMA;
          49  +
}
          50  +
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateDocumentOutput {
          51  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          52  +
    fn serialize_members(
          53  +
        &self,
          54  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          55  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          56  +
        if let Some(ref val) = self.document_description {
          57  +
            ser.write_struct(&UPDATEDOCUMENTOUTPUT_MEMBER_DOCUMENT_DESCRIPTION, val)?;
          58  +
        }
          59  +
        Ok(())
          60  +
    }
          61  +
}
          62  +
impl UpdateDocumentOutput {
          63  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          64  +
    pub fn deserialize(
          65  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          66  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          67  +
        #[allow(unused_variables, unused_mut)]
          68  +
        let mut builder = Self::builder();
          69  +
        #[allow(
          70  +
            unused_variables,
          71  +
            unreachable_code,
          72  +
            clippy::single_match,
          73  +
            clippy::match_single_binding,
          74  +
            clippy::diverging_sub_expression
          75  +
        )]
          76  +
        deserializer.read_struct(&UPDATEDOCUMENTOUTPUT_SCHEMA, &mut |member, deser| {
          77  +
            match member.member_index() {
          78  +
                Some(0) => {
          79  +
                    if deser.is_null() {
          80  +
                        deser.read_null()?;
          81  +
                    } else {
          82  +
                        builder.document_description = Some(crate::types::DocumentDescription::deserialize(deser)?);
          83  +
                    }
          84  +
                }
          85  +
                Some(1) => {
          86  +
                    builder._request_id = Some(deser.read_string(member)?);
          87  +
                }
          88  +
                _ => {}
          89  +
            }
          90  +
            Ok(())
          91  +
        })?;
          92  +
        Ok(builder.build())
          93  +
    }
          94  +
}
          95  +
impl UpdateDocumentOutput {
          96  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          97  +
    /// Header-bound members are read directly from headers, avoiding runtime
          98  +
    /// member iteration overhead. Body members are read via the deserializer.
          99  +
    pub fn deserialize_with_response(
         100  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         101  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         102  +
        _status: u16,
         103  +
        _body: &[u8],
         104  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         105  +
        #[allow(unused_variables, unused_mut)]
         106  +
        let mut builder = Self::builder();
         107  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         108  +
            builder._request_id = Some(val.to_string());
         109  +
        }
         110  +
         111  +
        #[allow(
         112  +
            unused_variables,
         113  +
            unreachable_code,
         114  +
            clippy::single_match,
         115  +
            clippy::match_single_binding,
         116  +
            clippy::diverging_sub_expression
         117  +
        )]
         118  +
        deserializer.read_struct(&UPDATEDOCUMENTOUTPUT_SCHEMA, &mut |member, deser| {
         119  +
            match member.member_index() {
         120  +
                Some(0) => {
         121  +
                    builder.document_description = Some(crate::types::DocumentDescription::deserialize(deser)?);
         122  +
                }
         123  +
                _ => {}
         124  +
            }
         125  +
            Ok(())
         126  +
        })?;
         127  +
        Ok(builder.build())
         128  +
    }
         129  +
}
         130  +
impl ::aws_types::request_id::RequestId for UpdateDocumentOutput {
         131  +
    fn request_id(&self) -> Option<&str> {
         132  +
        self._request_id.as_deref()
         133  +
    }
         134  +
}
         135  +
impl UpdateDocumentOutput {
         136  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         137  +
        self._request_id = request_id;
         138  +
        self
         139  +
    }
         140  +
}
         141  +
impl UpdateDocumentOutput {
         142  +
    /// Creates a new builder-style object to manufacture [`UpdateDocumentOutput`](crate::operation::update_document::UpdateDocumentOutput).
         143  +
    pub fn builder() -> crate::operation::update_document::builders::UpdateDocumentOutputBuilder {
         144  +
        crate::operation::update_document::builders::UpdateDocumentOutputBuilder::default()
         145  +
    }
         146  +
}
         147  +
         148  +
/// A builder for [`UpdateDocumentOutput`](crate::operation::update_document::UpdateDocumentOutput).
         149  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         150  +
#[non_exhaustive]
         151  +
pub struct UpdateDocumentOutputBuilder {
         152  +
    pub(crate) document_description: ::std::option::Option<crate::types::DocumentDescription>,
         153  +
    _request_id: Option<String>,
         154  +
}
         155  +
impl UpdateDocumentOutputBuilder {
         156  +
    /// <p>A description of the document that was updated.</p>
         157  +
    pub fn document_description(mut self, input: crate::types::DocumentDescription) -> Self {
         158  +
        self.document_description = ::std::option::Option::Some(input);
         159  +
        self
         160  +
    }
         161  +
    /// <p>A description of the document that was updated.</p>
         162  +
    pub fn set_document_description(mut self, input: ::std::option::Option<crate::types::DocumentDescription>) -> Self {
         163  +
        self.document_description = input;
         164  +
        self
         165  +
    }
         166  +
    /// <p>A description of the document that was updated.</p>
         167  +
    pub fn get_document_description(&self) -> &::std::option::Option<crate::types::DocumentDescription> {
         168  +
        &self.document_description
         169  +
    }
         170  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         171  +
        self._request_id = Some(request_id.into());
         172  +
        self
         173  +
    }
         174  +
         175  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         176  +
        self._request_id = request_id;
         177  +
        self
         178  +
    }
         179  +
    /// Consumes the builder and constructs a [`UpdateDocumentOutput`](crate::operation::update_document::UpdateDocumentOutput).
         180  +
    pub fn build(self) -> crate::operation::update_document::UpdateDocumentOutput {
         181  +
        crate::operation::update_document::UpdateDocumentOutput {
         182  +
            document_description: self.document_description,
         183  +
            _request_id: self._request_id,
         184  +
        }
         185  +
    }
         186  +
}

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

@@ -0,1 +0,234 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::update_document::_update_document_input::UpdateDocumentInputBuilder;
           3  +
           4  +
pub use crate::operation::update_document::_update_document_output::UpdateDocumentOutputBuilder;
           5  +
           6  +
impl crate::operation::update_document::builders::UpdateDocumentInputBuilder {
           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::update_document::UpdateDocumentOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::update_document::UpdateDocumentError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.update_document();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `UpdateDocument`.
          24  +
///
          25  +
/// <p>Updates one or more values for an SSM document.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct UpdateDocumentFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::update_document::builders::UpdateDocumentInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::update_document::UpdateDocumentOutput,
          35  +
        crate::operation::update_document::UpdateDocumentError,
          36  +
    > for UpdateDocumentFluentBuilder
          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::update_document::UpdateDocumentOutput,
          44  +
            crate::operation::update_document::UpdateDocumentError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl UpdateDocumentFluentBuilder {
          51  +
    /// Creates a new `UpdateDocumentFluentBuilder`.
          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 UpdateDocument as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::update_document::builders::UpdateDocumentInputBuilder {
          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::update_document::UpdateDocumentOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::update_document::UpdateDocumentError,
          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::update_document::UpdateDocument::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::update_document::UpdateDocument::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::update_document::UpdateDocumentOutput,
          97  +
        crate::operation::update_document::UpdateDocumentError,
          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  +
    /// <p>A valid JSON or YAML string.</p>
         112  +
    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.inner = self.inner.content(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>A valid JSON or YAML string.</p>
         117  +
    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.inner = self.inner.set_content(input);
         119  +
        self
         120  +
    }
         121  +
    /// <p>A valid JSON or YAML string.</p>
         122  +
    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        self.inner.get_content()
         124  +
    }
         125  +
    ///
         126  +
    /// Appends an item to `Attachments`.
         127  +
    ///
         128  +
    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
         129  +
    ///
         130  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         131  +
    pub fn attachments(mut self, input: crate::types::AttachmentsSource) -> Self {
         132  +
        self.inner = self.inner.attachments(input);
         133  +
        self
         134  +
    }
         135  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         136  +
    pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>>) -> Self {
         137  +
        self.inner = self.inner.set_attachments(input);
         138  +
        self
         139  +
    }
         140  +
    /// <p>A list of key-value pairs that describe attachments to a version of a document.</p>
         141  +
    pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentsSource>> {
         142  +
        self.inner.get_attachments()
         143  +
    }
         144  +
    /// <p>The name of the SSM document that you want to update.</p>
         145  +
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         146  +
        self.inner = self.inner.name(input.into());
         147  +
        self
         148  +
    }
         149  +
    /// <p>The name of the SSM document that you want to update.</p>
         150  +
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         151  +
        self.inner = self.inner.set_name(input);
         152  +
        self
         153  +
    }
         154  +
    /// <p>The name of the SSM document that you want to update.</p>
         155  +
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
         156  +
        self.inner.get_name()
         157  +
    }
         158  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         159  +
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         160  +
        self.inner = self.inner.display_name(input.into());
         161  +
        self
         162  +
    }
         163  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         164  +
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         165  +
        self.inner = self.inner.set_display_name(input);
         166  +
        self
         167  +
    }
         168  +
    /// <p>The friendly name of the SSM document that you want to update. This value can differ for each version of the document. If you don't specify a value for this parameter in your request, the existing value is applied to the new document version.</p>
         169  +
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
         170  +
        self.inner.get_display_name()
         171  +
    }
         172  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         173  +
    pub fn version_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         174  +
        self.inner = self.inner.version_name(input.into());
         175  +
        self
         176  +
    }
         177  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         178  +
    pub fn set_version_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         179  +
        self.inner = self.inner.set_version_name(input);
         180  +
        self
         181  +
    }
         182  +
    /// <p>An optional field specifying the version of the artifact you are updating with the document. For example, 12.6. This value is unique across all versions of a document, and can't be changed.</p>
         183  +
    pub fn get_version_name(&self) -> &::std::option::Option<::std::string::String> {
         184  +
        self.inner.get_version_name()
         185  +
    }
         186  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         187  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         188  +
    /// </note>
         189  +
    pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         190  +
        self.inner = self.inner.document_version(input.into());
         191  +
        self
         192  +
    }
         193  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         194  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         195  +
    /// </note>
         196  +
    pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         197  +
        self.inner = self.inner.set_document_version(input);
         198  +
        self
         199  +
    }
         200  +
    /// <p>The version of the document that you want to update. Currently, Systems Manager supports updating only the latest version of the document. You can specify the version number of the latest version or use the <code>$LATEST</code> variable.</p><note>
         201  +
    /// <p>If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p>
         202  +
    /// </note>
         203  +
    pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
         204  +
        self.inner.get_document_version()
         205  +
    }
         206  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         207  +
    pub fn document_format(mut self, input: crate::types::DocumentFormat) -> Self {
         208  +
        self.inner = self.inner.document_format(input);
         209  +
        self
         210  +
    }
         211  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         212  +
    pub fn set_document_format(mut self, input: ::std::option::Option<crate::types::DocumentFormat>) -> Self {
         213  +
        self.inner = self.inner.set_document_format(input);
         214  +
        self
         215  +
    }
         216  +
    /// <p>Specify the document format for the new document version. Systems Manager supports JSON and YAML documents. JSON is the default format.</p>
         217  +
    pub fn get_document_format(&self) -> &::std::option::Option<crate::types::DocumentFormat> {
         218  +
        self.inner.get_document_format()
         219  +
    }
         220  +
    /// <p>Specify a new target type for the document.</p>
         221  +
    pub fn target_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         222  +
        self.inner = self.inner.target_type(input.into());
         223  +
        self
         224  +
    }
         225  +
    /// <p>Specify a new target type for the document.</p>
         226  +
    pub fn set_target_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         227  +
        self.inner = self.inner.set_target_type(input);
         228  +
        self
         229  +
    }
         230  +
    /// <p>Specify a new target type for the document.</p>
         231  +
    pub fn get_target_type(&self) -> &::std::option::Option<::std::string::String> {
         232  +
        self.inner.get_target_type()
         233  +
    }
         234  +
}

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

@@ -0,1 +0,653 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `UpdateDocumentDefaultVersion`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct UpdateDocumentDefaultVersion;
           6  +
impl UpdateDocumentDefaultVersion {
           7  +
    /// Creates a new `UpdateDocumentDefaultVersion`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          13  +
        crate::operation::update_document_default_version::UpdateDocumentDefaultVersionInput::SCHEMA;
          14  +
    /// The schema for this operation's output shape.
          15  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> =
          16  +
        crate::operation::update_document_default_version::UpdateDocumentDefaultVersionOutput::SCHEMA;
          17  +
    pub(crate) async fn orchestrate(
          18  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          19  +
        input: crate::operation::update_document_default_version::UpdateDocumentDefaultVersionInput,
          20  +
    ) -> ::std::result::Result<
          21  +
        crate::operation::update_document_default_version::UpdateDocumentDefaultVersionOutput,
          22  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          23  +
            crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError,
          24  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          25  +
        >,
          26  +
    > {
          27  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          28  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          29  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          30  +
        >| {
          31  +
            err.map_service_error(|err| {
          32  +
                err.downcast::<crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError>()
          33  +
                    .expect("correct error type")
          34  +
            })
          35  +
        };
          36  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          37  +
            .await
          38  +
            .map_err(map_err)?;
          39  +
        let output = context.finalize().map_err(map_err)?;
          40  +
        ::std::result::Result::Ok(
          41  +
            output
          42  +
                .downcast::<crate::operation::update_document_default_version::UpdateDocumentDefaultVersionOutput>()
          43  +
                .expect("correct output type"),
          44  +
        )
          45  +
    }
          46  +
          47  +
    pub(crate) async fn orchestrate_with_stop_point(
          48  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          49  +
        input: crate::operation::update_document_default_version::UpdateDocumentDefaultVersionInput,
          50  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          51  +
    ) -> ::std::result::Result<
          52  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          53  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          54  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          55  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          56  +
        >,
          57  +
    > {
          58  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          59  +
        use ::tracing::Instrument;
          60  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("SSM", "UpdateDocumentDefaultVersion", input, runtime_plugins, stop_point)
          61  +
            // Create a parent span for the entire operation. Includes a random, internal-only,
          62  +
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          63  +
            .instrument(::tracing::debug_span!(
          64  +
                "SSM.UpdateDocumentDefaultVersion",
          65  +
                "rpc.service" = "SSM",
          66  +
                "rpc.method" = "UpdateDocumentDefaultVersion",
          67  +
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          68  +
                "rpc.system" = "aws-api",
          69  +
            ))
          70  +
            .await
          71  +
    }
          72  +
          73  +
    pub(crate) fn operation_runtime_plugins(
          74  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          75  +
        client_config: &crate::config::Config,
          76  +
        config_override: ::std::option::Option<crate::config::Builder>,
          77  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          78  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          79  +
          80  +
        if let ::std::option::Option::Some(config_override) = config_override {
          81  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          82  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          83  +
            }
          84  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          85  +
                config_override,
          86  +
                client_config.config.clone(),
          87  +
                &client_config.runtime_components,
          88  +
            ));
          89  +
        }
          90  +
        runtime_plugins
          91  +
    }
          92  +
}
          93  +
/// Per-operation error registry. Contains an entry for every modeled
          94  +
/// error this operation can throw.
          95  +
///
          96  +
/// Used by the schema-serde error path as the operation-scoped lookup
          97  +
/// for registry-backed error reification: an error code that does not
          98  +
/// match one of the operation's modeled errors directly is resolved
          99  +
/// against this registry first, then widened to the service-wide error
         100  +
/// registry.
         101  +
pub(crate) mod error_registry {
         102  +
    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
         103  +
        ::aws_smithy_schema::registry::TypeRegistry::builder()
         104  +
                            .insert_error_shape(
         105  +
                        crate::types::error::InternalServerError::SCHEMA,
         106  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         107  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServerError::deserialize(d)?))
         108  +
                        },
         109  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         110  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServerError::deserialize(d)?))
         111  +
                        },
         112  +
                    )
         113  +
.insert_error_shape(
         114  +
                        crate::types::error::InvalidDocument::SCHEMA,
         115  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         116  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocument::deserialize(d)?))
         117  +
                        },
         118  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         119  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocument::deserialize(d)?))
         120  +
                        },
         121  +
                    )
         122  +
.insert_error_shape(
         123  +
                        crate::types::error::InvalidDocumentSchemaVersion::SCHEMA,
         124  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         125  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocumentSchemaVersion::deserialize(d)?))
         126  +
                        },
         127  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         128  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocumentSchemaVersion::deserialize(d)?))
         129  +
                        },
         130  +
                    )
         131  +
.insert_error_shape(
         132  +
                        crate::types::error::InvalidDocumentVersion::SCHEMA,
         133  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         134  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidDocumentVersion::deserialize(d)?))
         135  +
                        },
         136  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         137  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidDocumentVersion::deserialize(d)?))
         138  +
                        },
         139  +
                    )
         140  +
                            .build()
         141  +
    });
         142  +
}
         143  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateDocumentDefaultVersion {
         144  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         145  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateDocumentDefaultVersion");
         146  +
         147  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         148  +
            UpdateDocumentDefaultVersionRequestSerializer,
         149  +
        ));
         150  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         151  +
            UpdateDocumentDefaultVersionResponseDeserializer,
         152  +
        ));
         153  +
         154  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         155  +
            crate::config::auth::Params::builder()
         156  +
                .operation_name("UpdateDocumentDefaultVersion")
         157  +
                .build()
         158  +
                .expect("required fields set"),
         159  +
        ));
         160  +
         161  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         162  +
            "UpdateDocumentDefaultVersion",
         163  +
            "SSM",
         164  +
        ));
         165  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         166  +
        signing_options.double_uri_encode = true;
         167  +
        signing_options.content_sha256_header = false;
         168  +
        signing_options.normalize_uri_path = true;
         169  +
        signing_options.payload_override = None;
         170  +
         171  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         172  +
            signing_options,
         173  +
            ..::std::default::Default::default()
         174  +
        });
         175  +
         176  +
        ::std::option::Option::Some(cfg.freeze())
         177  +
    }
         178  +
         179  +
    fn runtime_components(
         180  +
        &self,
         181  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         182  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         183  +
        #[allow(unused_mut)]
         184  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateDocumentDefaultVersion")
         185  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         186  +
                UpdateDocumentDefaultVersionTelemetryInputCaptureInterceptor,
         187  +
            ))
         188  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         189  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         190  +
            ))
         191  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         192  +
                UpdateDocumentDefaultVersionEndpointParamsInterceptor,
         193  +
            ))
         194  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         195  +
                crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError,
         196  +
            >::new())
         197  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         198  +
                crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError,
         199  +
            >::new())
         200  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         201  +
                crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError,
         202  +
            >::new())
         203  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         204  +
                crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError,
         205  +
            >::new());
         206  +
         207  +
        ::std::borrow::Cow::Owned(rcb)
         208  +
    }
         209  +
}
         210  +
         211  +
#[derive(Debug)]
         212  +
struct UpdateDocumentDefaultVersionTelemetryInputCaptureInterceptor;
         213  +
         214  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         215  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDocumentDefaultVersionTelemetryInputCaptureInterceptor {
         216  +
    fn name(&self) -> &'static str {
         217  +
        "UpdateDocumentDefaultVersionTelemetryInputCaptureInterceptor"
         218  +
    }
         219  +
         220  +
    fn read_before_execution(
         221  +
        &self,
         222  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         223  +
            '_,
         224  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         225  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         226  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         227  +
        >,
         228  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         229  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         230  +
        // Nothing to do unless the customer opted in by naming members to record.
         231  +
        let ::std::option::Option::Some(requested) = cfg
         232  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         233  +
            .filter(|r| !r.is_empty())
         234  +
        else {
         235  +
            return ::std::result::Result::Ok(());
         236  +
        };
         237  +
         238  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<UpdateDocumentDefaultVersionInput>() else {
         239  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         240  +
            return ::std::result::Result::Ok(());
         241  +
        };
         242  +
         243  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         244  +
        if requested.should_capture("Name") {
         245  +
            if let ::std::option::Option::Some(value) = input.name.as_deref() {
         246  +
                captured.insert("Name", value);
         247  +
            }
         248  +
        }
         249  +
        if requested.should_capture("DocumentVersion") {
         250  +
            if let ::std::option::Option::Some(value) = input.document_version.as_deref() {
         251  +
                captured.insert("DocumentVersion", value);
         252  +
            }
         253  +
        }
         254  +
         255  +
        cfg.interceptor_state().store_put(captured);
         256  +
        ::std::result::Result::Ok(())
         257  +
    }
         258  +
}
         259  +
#[derive(Debug)]
         260  +
struct UpdateDocumentDefaultVersionResponseDeserializer;
         261  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateDocumentDefaultVersionResponseDeserializer {
         262  +
    fn deserialize_nonstreaming_with_config(
         263  +
        &self,
         264  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         265  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         266  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         267  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         268  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         269  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         270  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         271  +
        // loads `body` before firing this hook.
         272  +
        let body = response.body().bytes().expect("body loaded");
         273  +
        let headers = response.headers();
         274  +
        #[allow(unused_mut)]
         275  +
        let mut force_error = false;
         276  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         277  +
        if !success && status != 200 || force_error {
         278  +
            let protocol = _cfg
         279  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         280  +
                .expect("a SharedClientProtocol is required");
         281  +
            #[allow(unused_mut)]
         282  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         283  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         284  +
            })?;
         285  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         286  +
            let generic = generic_builder.build();
         287  +
            let error_code = match generic.code() {
         288  +
                ::std::option::Option::Some(code) => code,
         289  +
                ::std::option::Option::None => {
         290  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         291  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         292  +
                            crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::unhandled(generic),
         293  +
                        ),
         294  +
                    ))
         295  +
                }
         296  +
            };
         297  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         298  +
            let err = match error_code {
         299  +
                "InternalServerError" => crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::InternalServerError({
         300  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         301  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         302  +
                            &mut *deser,
         303  +
                            response.headers(),
         304  +
                            response.status().into(),
         305  +
                            body,
         306  +
                        )
         307  +
                    }) {
         308  +
                        ::std::result::Result::Ok(val) => val,
         309  +
                        ::std::result::Result::Err(e) => {
         310  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         311  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         312  +
                            ))
         313  +
                        }
         314  +
                    };
         315  +
                    tmp.meta = generic;
         316  +
                    if tmp.message.is_none() {
         317  +
                        tmp.message = _error_message;
         318  +
                    }
         319  +
                    tmp
         320  +
                }),
         321  +
                "InvalidDocument" => crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::InvalidDocument({
         322  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         323  +
                        crate::types::error::InvalidDocument::deserialize_with_response(
         324  +
                            &mut *deser,
         325  +
                            response.headers(),
         326  +
                            response.status().into(),
         327  +
                            body,
         328  +
                        )
         329  +
                    }) {
         330  +
                        ::std::result::Result::Ok(val) => val,
         331  +
                        ::std::result::Result::Err(e) => {
         332  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         333  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         334  +
                            ))
         335  +
                        }
         336  +
                    };
         337  +
                    tmp.meta = generic;
         338  +
                    if tmp.message.is_none() {
         339  +
                        tmp.message = _error_message;
         340  +
                    }
         341  +
                    tmp
         342  +
                }),
         343  +
                "InvalidDocumentSchemaVersion" => {
         344  +
                    crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::InvalidDocumentSchemaVersion({
         345  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         346  +
                            crate::types::error::InvalidDocumentSchemaVersion::deserialize_with_response(
         347  +
                                &mut *deser,
         348  +
                                response.headers(),
         349  +
                                response.status().into(),
         350  +
                                body,
         351  +
                            )
         352  +
                        }) {
         353  +
                            ::std::result::Result::Ok(val) => val,
         354  +
                            ::std::result::Result::Err(e) => {
         355  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         356  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         357  +
                                ))
         358  +
                            }
         359  +
                        };
         360  +
                        tmp.meta = generic;
         361  +
                        if tmp.message.is_none() {
         362  +
                            tmp.message = _error_message;
         363  +
                        }
         364  +
                        tmp
         365  +
                    })
         366  +
                }
         367  +
                "InvalidDocumentVersion" => {
         368  +
                    crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::InvalidDocumentVersion({
         369  +
                        let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         370  +
                            crate::types::error::InvalidDocumentVersion::deserialize_with_response(
         371  +
                                &mut *deser,
         372  +
                                response.headers(),
         373  +
                                response.status().into(),
         374  +
                                body,
         375  +
                            )
         376  +
                        }) {
         377  +
                            ::std::result::Result::Ok(val) => val,
         378  +
                            ::std::result::Result::Err(e) => {
         379  +
                                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         380  +
                                    ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         381  +
                                ))
         382  +
                            }
         383  +
                        };
         384  +
                        tmp.meta = generic;
         385  +
                        if tmp.message.is_none() {
         386  +
                            tmp.message = _error_message;
         387  +
                        }
         388  +
                        tmp
         389  +
                    })
         390  +
                }
         391  +
                _ => {
         392  +
                    // Registry-backed, operation-scoped reification of an error whose
         393  +
                    // code this operation does not model directly: the operation's own
         394  +
                    // error registry is consulted first, then the lookup widens to the
         395  +
                    // service-wide error registry. On a hit, the reified error is attached
         396  +
                    // as the source of the returned unhandled error while its metadata
         397  +
                    // (code, message, request id) is preserved; on a miss the generic
         398  +
                    // error is returned unchanged.
         399  +
                    match protocol
         400  +
                        .deserialize_error_response(response, _cfg)
         401  +
                        .ok()
         402  +
                        .and_then(|mut deser| {
         403  +
                            ::aws_smithy_schema::registry::reify_error(
         404  +
                                crate::operation::update_document_default_version::error_registry::REGISTRY
         405  +
                                    .or(&crate::error_type_registry::REGISTRY),
         406  +
                                error_code,
         407  +
                                &mut *deser,
         408  +
                            )
         409  +
                        }) {
         410  +
                        ::std::option::Option::Some(source) => <crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         411  +
                        ::std::option::Option::None => crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError::generic(generic),
         412  +
                    }
         413  +
                }
         414  +
            };
         415  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         416  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         417  +
            ))
         418  +
        } else {
         419  +
            let protocol = _cfg
         420  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         421  +
                .expect("a SharedClientProtocol is required");
         422  +
            let mut deser = protocol
         423  +
                .deserialize_response(response, UpdateDocumentDefaultVersion::OUTPUT_SCHEMA, _cfg)
         424  +
                .map_err(|e| {
         425  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         426  +
                })?;
         427  +
            // body and headers are already in scope from the top of the function;
         428  +
            // alias `headers` as `_response_headers` so MutateOutput
         429  +
            // customizations have a stable name to read from.
         430  +
            let _response_headers = headers;
         431  +
            #[allow(unused_mut)]
         432  +
            let mut output = crate::operation::update_document_default_version::UpdateDocumentDefaultVersionOutput::deserialize_with_response(
         433  +
                &mut *deser,
         434  +
                _response_headers,
         435  +
                response.status().into(),
         436  +
                body,
         437  +
            )
         438  +
            .map_err(|e| {
         439  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         440  +
            })?;
         441  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         442  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         443  +
        }
         444  +
    }
         445  +
}
         446  +
#[derive(Debug)]
         447  +
struct UpdateDocumentDefaultVersionRequestSerializer;
         448  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateDocumentDefaultVersionRequestSerializer {
         449  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         450  +
    fn serialize_input(
         451  +
        &self,
         452  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         453  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         454  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         455  +
        let input = input
         456  +
            .downcast::<crate::operation::update_document_default_version::UpdateDocumentDefaultVersionInput>()
         457  +
            .expect("correct type");
         458  +
         459  +
        let protocol = _cfg
         460  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         461  +
            .expect("a SharedClientProtocol is required");
         462  +
        let mut request = protocol
         463  +
            .serialize_request(&input, UpdateDocumentDefaultVersion::INPUT_SCHEMA, "/", _cfg)
         464  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         465  +
         466  +
        return ::std::result::Result::Ok(request);
         467  +
    }
         468  +
}
         469  +
#[derive(Debug)]
         470  +
struct UpdateDocumentDefaultVersionEndpointParamsInterceptor;
         471  +
         472  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         473  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDocumentDefaultVersionEndpointParamsInterceptor {
         474  +
    fn name(&self) -> &'static str {
         475  +
        "UpdateDocumentDefaultVersionEndpointParamsInterceptor"
         476  +
    }
         477  +
         478  +
    fn read_before_execution(
         479  +
        &self,
         480  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         481  +
            '_,
         482  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         483  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         484  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         485  +
        >,
         486  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         487  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         488  +
        let _input = context
         489  +
            .input()
         490  +
            .downcast_ref::<UpdateDocumentDefaultVersionInput>()
         491  +
            .ok_or("failed to downcast to UpdateDocumentDefaultVersionInput")?;
         492  +
         493  +
        let params = crate::config::endpoint::Params::builder()
         494  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         495  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         496  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         497  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         498  +
            .build()
         499  +
            .map_err(|err| {
         500  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         501  +
            })?;
         502  +
        cfg.interceptor_state()
         503  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         504  +
        ::std::result::Result::Ok(())
         505  +
    }
         506  +
}
         507  +
         508  +
// The get_* functions below are generated from JMESPath expressions in the
         509  +
// operationContextParams trait. They target the operation's input shape.
         510  +
         511  +
/// Error type for the `UpdateDocumentDefaultVersionError` operation.
         512  +
#[non_exhaustive]
         513  +
#[derive(::std::fmt::Debug)]
         514  +
pub enum UpdateDocumentDefaultVersionError {
         515  +
    /// <p>An error occurred on the server side.</p>
         516  +
    InternalServerError(crate::types::error::InternalServerError),
         517  +
    /// <p>The specified SSM document doesn't exist.</p>
         518  +
    InvalidDocument(crate::types::error::InvalidDocument),
         519  +
    /// <p>The version of the document schema isn't supported.</p>
         520  +
    InvalidDocumentSchemaVersion(crate::types::error::InvalidDocumentSchemaVersion),
         521  +
    /// <p>The document version isn't valid or doesn't exist.</p>
         522  +
    InvalidDocumentVersion(crate::types::error::InvalidDocumentVersion),
         523  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         524  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         525  +
    variable wildcard pattern and check `.code()`:
         526  +
     \
         527  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         528  +
     \
         529  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateDocumentDefaultVersionError) for what information is available for the error.")]
         530  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         531  +
}
         532  +
impl UpdateDocumentDefaultVersionError {
         533  +
    /// Creates the `UpdateDocumentDefaultVersionError::Unhandled` variant from any error type.
         534  +
    pub fn unhandled(
         535  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         536  +
    ) -> Self {
         537  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         538  +
            source: err.into(),
         539  +
            meta: ::std::default::Default::default(),
         540  +
        })
         541  +
    }
         542  +
         543  +
    /// Creates the `UpdateDocumentDefaultVersionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         544  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         545  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         546  +
            source: err.clone().into(),
         547  +
            meta: err,
         548  +
        })
         549  +
    }
         550  +
    ///
         551  +
    /// Returns error metadata, which includes the error code, message,
         552  +
    /// request ID, and potentially additional information.
         553  +
    ///
         554  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         555  +
        match self {
         556  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         557  +
            Self::InvalidDocument(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         558  +
            Self::InvalidDocumentSchemaVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         559  +
            Self::InvalidDocumentVersion(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         560  +
            Self::Unhandled(e) => &e.meta,
         561  +
        }
         562  +
    }
         563  +
    /// Returns `true` if the error kind is `UpdateDocumentDefaultVersionError::InternalServerError`.
         564  +
    pub fn is_internal_server_error(&self) -> bool {
         565  +
        matches!(self, Self::InternalServerError(_))
         566  +
    }
         567  +
    /// Returns `true` if the error kind is `UpdateDocumentDefaultVersionError::InvalidDocument`.
         568  +
    pub fn is_invalid_document(&self) -> bool {
         569  +
        matches!(self, Self::InvalidDocument(_))
         570  +
    }
         571  +
    /// Returns `true` if the error kind is `UpdateDocumentDefaultVersionError::InvalidDocumentSchemaVersion`.
         572  +
    pub fn is_invalid_document_schema_version(&self) -> bool {
         573  +
        matches!(self, Self::InvalidDocumentSchemaVersion(_))
         574  +
    }
         575  +
    /// Returns `true` if the error kind is `UpdateDocumentDefaultVersionError::InvalidDocumentVersion`.
         576  +
    pub fn is_invalid_document_version(&self) -> bool {
         577  +
        matches!(self, Self::InvalidDocumentVersion(_))
         578  +
    }
         579  +
}
         580  +
impl ::std::error::Error for UpdateDocumentDefaultVersionError {
         581  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         582  +
        match self {
         583  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         584  +
            Self::InvalidDocument(_inner) => ::std::option::Option::Some(_inner),
         585  +
            Self::InvalidDocumentSchemaVersion(_inner) => ::std::option::Option::Some(_inner),
         586  +
            Self::InvalidDocumentVersion(_inner) => ::std::option::Option::Some(_inner),
         587  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         588  +
        }
         589  +
    }
         590  +
}
         591  +
impl ::std::fmt::Display for UpdateDocumentDefaultVersionError {
         592  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         593  +
        match self {
         594  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         595  +
            Self::InvalidDocument(_inner) => _inner.fmt(f),
         596  +
            Self::InvalidDocumentSchemaVersion(_inner) => _inner.fmt(f),
         597  +
            Self::InvalidDocumentVersion(_inner) => _inner.fmt(f),
         598  +
            Self::Unhandled(_inner) => {
         599  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         600  +
                    write!(f, "unhandled error ({code})")
         601  +
                } else {
         602  +
                    f.write_str("unhandled error")
         603  +
                }
         604  +
            }
         605  +
        }
         606  +
    }
         607  +
}
         608  +
impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateDocumentDefaultVersionError {
         609  +
    fn code(&self) -> ::std::option::Option<&str> {
         610  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         611  +
    }
         612  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         613  +
        ::std::option::Option::None
         614  +
    }
         615  +
}
         616  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateDocumentDefaultVersionError {
         617  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         618  +
        match self {
         619  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         620  +
            Self::InvalidDocument(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         621  +
            Self::InvalidDocumentSchemaVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         622  +
            Self::InvalidDocumentVersion(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         623  +
            Self::Unhandled(_inner) => &_inner.meta,
         624  +
        }
         625  +
    }
         626  +
}
         627  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateDocumentDefaultVersionError {
         628  +
    fn create_unhandled_error(
         629  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         630  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         631  +
    ) -> Self {
         632  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         633  +
            source,
         634  +
            meta: meta.unwrap_or_default(),
         635  +
        })
         636  +
    }
         637  +
}
         638  +
impl ::aws_types::request_id::RequestId for crate::operation::update_document_default_version::UpdateDocumentDefaultVersionError {
         639  +
    fn request_id(&self) -> Option<&str> {
         640  +
        self.meta().request_id()
         641  +
    }
         642  +
}
         643  +
         644  +
pub use crate::operation::update_document_default_version::_update_document_default_version_input::UpdateDocumentDefaultVersionInput;
         645  +
         646  +
pub use crate::operation::update_document_default_version::_update_document_default_version_output::UpdateDocumentDefaultVersionOutput;
         647  +
         648  +
mod _update_document_default_version_input;
         649  +
         650  +
mod _update_document_default_version_output;
         651  +
         652  +
/// Builders
         653  +
pub mod builders;