Client Test

Client Test

rev. 0b749be6d000fdc7ef59d1bc26f1dce00358d95c

Files changed:

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/operation_with_defaults/_operation_with_defaults_output.rs

@@ -0,1 +0,679 @@
           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 OperationWithDefaultsOutput {
           6  +
    #[allow(missing_docs)] // documentation missing in model
           7  +
    pub default_string: ::std::string::String,
           8  +
    #[allow(missing_docs)] // documentation missing in model
           9  +
    pub default_boolean: bool,
          10  +
    #[allow(missing_docs)] // documentation missing in model
          11  +
    pub default_list: ::std::vec::Vec<::std::string::String>,
          12  +
    #[allow(missing_docs)] // documentation missing in model
          13  +
    pub default_document_map: ::aws_smithy_types::Document,
          14  +
    #[allow(missing_docs)] // documentation missing in model
          15  +
    pub default_document_string: ::aws_smithy_types::Document,
          16  +
    #[allow(missing_docs)] // documentation missing in model
          17  +
    pub default_document_boolean: ::aws_smithy_types::Document,
          18  +
    #[allow(missing_docs)] // documentation missing in model
          19  +
    pub default_document_list: ::aws_smithy_types::Document,
          20  +
    #[allow(missing_docs)] // documentation missing in model
          21  +
    pub default_null_document: ::std::option::Option<::aws_smithy_types::Document>,
          22  +
    #[allow(missing_docs)] // documentation missing in model
          23  +
    pub default_timestamp: ::aws_smithy_types::DateTime,
          24  +
    #[allow(missing_docs)] // documentation missing in model
          25  +
    pub default_blob: ::aws_smithy_types::Blob,
          26  +
    #[allow(missing_docs)] // documentation missing in model
          27  +
    pub default_byte: i8,
          28  +
    #[allow(missing_docs)] // documentation missing in model
          29  +
    pub default_short: i16,
          30  +
    #[allow(missing_docs)] // documentation missing in model
          31  +
    pub default_integer: i32,
          32  +
    #[allow(missing_docs)] // documentation missing in model
          33  +
    pub default_long: i64,
          34  +
    #[allow(missing_docs)] // documentation missing in model
          35  +
    pub default_float: f32,
          36  +
    #[allow(missing_docs)] // documentation missing in model
          37  +
    pub default_double: f64,
          38  +
    #[allow(missing_docs)] // documentation missing in model
          39  +
    pub default_map: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
          40  +
    #[allow(missing_docs)] // documentation missing in model
          41  +
    pub default_enum: crate::types::TestEnum,
          42  +
    #[allow(missing_docs)] // documentation missing in model
          43  +
    pub default_int_enum: i32,
          44  +
    #[allow(missing_docs)] // documentation missing in model
          45  +
    pub empty_string: ::std::string::String,
          46  +
    #[allow(missing_docs)] // documentation missing in model
          47  +
    pub false_boolean: bool,
          48  +
    #[allow(missing_docs)] // documentation missing in model
          49  +
    pub empty_blob: ::aws_smithy_types::Blob,
          50  +
    #[allow(missing_docs)] // documentation missing in model
          51  +
    pub zero_byte: i8,
          52  +
    #[allow(missing_docs)] // documentation missing in model
          53  +
    pub zero_short: i16,
          54  +
    #[allow(missing_docs)] // documentation missing in model
          55  +
    pub zero_integer: i32,
          56  +
    #[allow(missing_docs)] // documentation missing in model
          57  +
    pub zero_long: i64,
          58  +
    #[allow(missing_docs)] // documentation missing in model
          59  +
    pub zero_float: f32,
          60  +
    #[allow(missing_docs)] // documentation missing in model
          61  +
    pub zero_double: f64,
          62  +
}
          63  +
impl OperationWithDefaultsOutput {
          64  +
    #[allow(missing_docs)] // documentation missing in model
          65  +
    pub fn default_string(&self) -> &str {
          66  +
        use std::ops::Deref;
          67  +
        self.default_string.deref()
          68  +
    }
          69  +
    #[allow(missing_docs)] // documentation missing in model
          70  +
    pub fn default_boolean(&self) -> bool {
          71  +
        self.default_boolean
          72  +
    }
          73  +
    #[allow(missing_docs)] // documentation missing in model
          74  +
    pub fn default_list(&self) -> &[::std::string::String] {
          75  +
        use std::ops::Deref;
          76  +
        self.default_list.deref()
          77  +
    }
          78  +
    #[allow(missing_docs)] // documentation missing in model
          79  +
    pub fn default_document_map(&self) -> &::aws_smithy_types::Document {
          80  +
        &self.default_document_map
          81  +
    }
          82  +
    #[allow(missing_docs)] // documentation missing in model
          83  +
    pub fn default_document_string(&self) -> &::aws_smithy_types::Document {
          84  +
        &self.default_document_string
          85  +
    }
          86  +
    #[allow(missing_docs)] // documentation missing in model
          87  +
    pub fn default_document_boolean(&self) -> &::aws_smithy_types::Document {
          88  +
        &self.default_document_boolean
          89  +
    }
          90  +
    #[allow(missing_docs)] // documentation missing in model
          91  +
    pub fn default_document_list(&self) -> &::aws_smithy_types::Document {
          92  +
        &self.default_document_list
          93  +
    }
          94  +
    #[allow(missing_docs)] // documentation missing in model
          95  +
    pub fn default_null_document(&self) -> ::std::option::Option<&::aws_smithy_types::Document> {
          96  +
        self.default_null_document.as_ref()
          97  +
    }
          98  +
    #[allow(missing_docs)] // documentation missing in model
          99  +
    pub fn default_timestamp(&self) -> &::aws_smithy_types::DateTime {
         100  +
        &self.default_timestamp
         101  +
    }
         102  +
    #[allow(missing_docs)] // documentation missing in model
         103  +
    pub fn default_blob(&self) -> &::aws_smithy_types::Blob {
         104  +
        &self.default_blob
         105  +
    }
         106  +
    #[allow(missing_docs)] // documentation missing in model
         107  +
    pub fn default_byte(&self) -> i8 {
         108  +
        self.default_byte
         109  +
    }
         110  +
    #[allow(missing_docs)] // documentation missing in model
         111  +
    pub fn default_short(&self) -> i16 {
         112  +
        self.default_short
         113  +
    }
         114  +
    #[allow(missing_docs)] // documentation missing in model
         115  +
    pub fn default_integer(&self) -> i32 {
         116  +
        self.default_integer
         117  +
    }
         118  +
    #[allow(missing_docs)] // documentation missing in model
         119  +
    pub fn default_long(&self) -> i64 {
         120  +
        self.default_long
         121  +
    }
         122  +
    #[allow(missing_docs)] // documentation missing in model
         123  +
    pub fn default_float(&self) -> f32 {
         124  +
        self.default_float
         125  +
    }
         126  +
    #[allow(missing_docs)] // documentation missing in model
         127  +
    pub fn default_double(&self) -> f64 {
         128  +
        self.default_double
         129  +
    }
         130  +
    #[allow(missing_docs)] // documentation missing in model
         131  +
    pub fn default_map(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
         132  +
        &self.default_map
         133  +
    }
         134  +
    #[allow(missing_docs)] // documentation missing in model
         135  +
    pub fn default_enum(&self) -> &crate::types::TestEnum {
         136  +
        &self.default_enum
         137  +
    }
         138  +
    #[allow(missing_docs)] // documentation missing in model
         139  +
    pub fn default_int_enum(&self) -> i32 {
         140  +
        self.default_int_enum
         141  +
    }
         142  +
    #[allow(missing_docs)] // documentation missing in model
         143  +
    pub fn empty_string(&self) -> &str {
         144  +
        use std::ops::Deref;
         145  +
        self.empty_string.deref()
         146  +
    }
         147  +
    #[allow(missing_docs)] // documentation missing in model
         148  +
    pub fn false_boolean(&self) -> bool {
         149  +
        self.false_boolean
         150  +
    }
         151  +
    #[allow(missing_docs)] // documentation missing in model
         152  +
    pub fn empty_blob(&self) -> &::aws_smithy_types::Blob {
         153  +
        &self.empty_blob
         154  +
    }
         155  +
    #[allow(missing_docs)] // documentation missing in model
         156  +
    pub fn zero_byte(&self) -> i8 {
         157  +
        self.zero_byte
         158  +
    }
         159  +
    #[allow(missing_docs)] // documentation missing in model
         160  +
    pub fn zero_short(&self) -> i16 {
         161  +
        self.zero_short
         162  +
    }
         163  +
    #[allow(missing_docs)] // documentation missing in model
         164  +
    pub fn zero_integer(&self) -> i32 {
         165  +
        self.zero_integer
         166  +
    }
         167  +
    #[allow(missing_docs)] // documentation missing in model
         168  +
    pub fn zero_long(&self) -> i64 {
         169  +
        self.zero_long
         170  +
    }
         171  +
    #[allow(missing_docs)] // documentation missing in model
         172  +
    pub fn zero_float(&self) -> f32 {
         173  +
        self.zero_float
         174  +
    }
         175  +
    #[allow(missing_docs)] // documentation missing in model
         176  +
    pub fn zero_double(&self) -> f64 {
         177  +
        self.zero_double
         178  +
    }
         179  +
}
         180  +
impl OperationWithDefaultsOutput {
         181  +
    /// Creates a new builder-style object to manufacture [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
         182  +
    pub fn builder() -> crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder {
         183  +
        crate::operation::operation_with_defaults::builders::OperationWithDefaultsOutputBuilder::default()
         184  +
    }
         185  +
}
         186  +
         187  +
/// A builder for [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
         188  +
#[non_exhaustive]
         189  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         190  +
pub struct OperationWithDefaultsOutputBuilder {
         191  +
    pub(crate) default_string: ::std::option::Option<::std::string::String>,
         192  +
    pub(crate) default_boolean: ::std::option::Option<bool>,
         193  +
    pub(crate) default_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
         194  +
    pub(crate) default_document_map: ::std::option::Option<::aws_smithy_types::Document>,
         195  +
    pub(crate) default_document_string: ::std::option::Option<::aws_smithy_types::Document>,
         196  +
    pub(crate) default_document_boolean: ::std::option::Option<::aws_smithy_types::Document>,
         197  +
    pub(crate) default_document_list: ::std::option::Option<::aws_smithy_types::Document>,
         198  +
    pub(crate) default_null_document: ::std::option::Option<::aws_smithy_types::Document>,
         199  +
    pub(crate) default_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
         200  +
    pub(crate) default_blob: ::std::option::Option<::aws_smithy_types::Blob>,
         201  +
    pub(crate) default_byte: ::std::option::Option<i8>,
         202  +
    pub(crate) default_short: ::std::option::Option<i16>,
         203  +
    pub(crate) default_integer: ::std::option::Option<i32>,
         204  +
    pub(crate) default_long: ::std::option::Option<i64>,
         205  +
    pub(crate) default_float: ::std::option::Option<f32>,
         206  +
    pub(crate) default_double: ::std::option::Option<f64>,
         207  +
    pub(crate) default_map: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         208  +
    pub(crate) default_enum: ::std::option::Option<crate::types::TestEnum>,
         209  +
    pub(crate) default_int_enum: ::std::option::Option<i32>,
         210  +
    pub(crate) empty_string: ::std::option::Option<::std::string::String>,
         211  +
    pub(crate) false_boolean: ::std::option::Option<bool>,
         212  +
    pub(crate) empty_blob: ::std::option::Option<::aws_smithy_types::Blob>,
         213  +
    pub(crate) zero_byte: ::std::option::Option<i8>,
         214  +
    pub(crate) zero_short: ::std::option::Option<i16>,
         215  +
    pub(crate) zero_integer: ::std::option::Option<i32>,
         216  +
    pub(crate) zero_long: ::std::option::Option<i64>,
         217  +
    pub(crate) zero_float: ::std::option::Option<f32>,
         218  +
    pub(crate) zero_double: ::std::option::Option<f64>,
         219  +
}
         220  +
impl OperationWithDefaultsOutputBuilder {
         221  +
    #[allow(missing_docs)] // documentation missing in model
         222  +
    pub fn default_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         223  +
        self.default_string = ::std::option::Option::Some(input.into());
         224  +
        self
         225  +
    }
         226  +
    #[allow(missing_docs)] // documentation missing in model
         227  +
    pub fn set_default_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         228  +
        self.default_string = input;
         229  +
        self
         230  +
    }
         231  +
    #[allow(missing_docs)] // documentation missing in model
         232  +
    pub fn get_default_string(&self) -> &::std::option::Option<::std::string::String> {
         233  +
        &self.default_string
         234  +
    }
         235  +
    #[allow(missing_docs)] // documentation missing in model
         236  +
    pub fn default_boolean(mut self, input: bool) -> Self {
         237  +
        self.default_boolean = ::std::option::Option::Some(input);
         238  +
        self
         239  +
    }
         240  +
    #[allow(missing_docs)] // documentation missing in model
         241  +
    pub fn set_default_boolean(mut self, input: ::std::option::Option<bool>) -> Self {
         242  +
        self.default_boolean = input;
         243  +
        self
         244  +
    }
         245  +
    #[allow(missing_docs)] // documentation missing in model
         246  +
    pub fn get_default_boolean(&self) -> &::std::option::Option<bool> {
         247  +
        &self.default_boolean
         248  +
    }
         249  +
    /// Appends an item to `default_list`.
         250  +
    ///
         251  +
    /// To override the contents of this collection use [`set_default_list`](Self::set_default_list).
         252  +
    ///
         253  +
    pub fn default_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         254  +
        let mut v = self.default_list.unwrap_or_default();
         255  +
        v.push(input.into());
         256  +
        self.default_list = ::std::option::Option::Some(v);
         257  +
        self
         258  +
    }
         259  +
    #[allow(missing_docs)] // documentation missing in model
         260  +
    pub fn set_default_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
         261  +
        self.default_list = input;
         262  +
        self
         263  +
    }
         264  +
    #[allow(missing_docs)] // documentation missing in model
         265  +
    pub fn get_default_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
         266  +
        &self.default_list
         267  +
    }
         268  +
    #[allow(missing_docs)] // documentation missing in model
         269  +
    pub fn default_document_map(mut self, input: ::aws_smithy_types::Document) -> Self {
         270  +
        self.default_document_map = ::std::option::Option::Some(input);
         271  +
        self
         272  +
    }
         273  +
    #[allow(missing_docs)] // documentation missing in model
         274  +
    pub fn set_default_document_map(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         275  +
        self.default_document_map = input;
         276  +
        self
         277  +
    }
         278  +
    #[allow(missing_docs)] // documentation missing in model
         279  +
    pub fn get_default_document_map(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         280  +
        &self.default_document_map
         281  +
    }
         282  +
    #[allow(missing_docs)] // documentation missing in model
         283  +
    pub fn default_document_string(mut self, input: ::aws_smithy_types::Document) -> Self {
         284  +
        self.default_document_string = ::std::option::Option::Some(input);
         285  +
        self
         286  +
    }
         287  +
    #[allow(missing_docs)] // documentation missing in model
         288  +
    pub fn set_default_document_string(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         289  +
        self.default_document_string = input;
         290  +
        self
         291  +
    }
         292  +
    #[allow(missing_docs)] // documentation missing in model
         293  +
    pub fn get_default_document_string(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         294  +
        &self.default_document_string
         295  +
    }
         296  +
    #[allow(missing_docs)] // documentation missing in model
         297  +
    pub fn default_document_boolean(mut self, input: ::aws_smithy_types::Document) -> Self {
         298  +
        self.default_document_boolean = ::std::option::Option::Some(input);
         299  +
        self
         300  +
    }
         301  +
    #[allow(missing_docs)] // documentation missing in model
         302  +
    pub fn set_default_document_boolean(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         303  +
        self.default_document_boolean = input;
         304  +
        self
         305  +
    }
         306  +
    #[allow(missing_docs)] // documentation missing in model
         307  +
    pub fn get_default_document_boolean(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         308  +
        &self.default_document_boolean
         309  +
    }
         310  +
    #[allow(missing_docs)] // documentation missing in model
         311  +
    pub fn default_document_list(mut self, input: ::aws_smithy_types::Document) -> Self {
         312  +
        self.default_document_list = ::std::option::Option::Some(input);
         313  +
        self
         314  +
    }
         315  +
    #[allow(missing_docs)] // documentation missing in model
         316  +
    pub fn set_default_document_list(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         317  +
        self.default_document_list = input;
         318  +
        self
         319  +
    }
         320  +
    #[allow(missing_docs)] // documentation missing in model
         321  +
    pub fn get_default_document_list(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         322  +
        &self.default_document_list
         323  +
    }
         324  +
    #[allow(missing_docs)] // documentation missing in model
         325  +
    pub fn default_null_document(mut self, input: ::aws_smithy_types::Document) -> Self {
         326  +
        self.default_null_document = ::std::option::Option::Some(input);
         327  +
        self
         328  +
    }
         329  +
    #[allow(missing_docs)] // documentation missing in model
         330  +
    pub fn set_default_null_document(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
         331  +
        self.default_null_document = input;
         332  +
        self
         333  +
    }
         334  +
    #[allow(missing_docs)] // documentation missing in model
         335  +
    pub fn get_default_null_document(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
         336  +
        &self.default_null_document
         337  +
    }
         338  +
    #[allow(missing_docs)] // documentation missing in model
         339  +
    pub fn default_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
         340  +
        self.default_timestamp = ::std::option::Option::Some(input);
         341  +
        self
         342  +
    }
         343  +
    #[allow(missing_docs)] // documentation missing in model
         344  +
    pub fn set_default_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
         345  +
        self.default_timestamp = input;
         346  +
        self
         347  +
    }
         348  +
    #[allow(missing_docs)] // documentation missing in model
         349  +
    pub fn get_default_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
         350  +
        &self.default_timestamp
         351  +
    }
         352  +
    #[allow(missing_docs)] // documentation missing in model
         353  +
    pub fn default_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
         354  +
        self.default_blob = ::std::option::Option::Some(input);
         355  +
        self
         356  +
    }
         357  +
    #[allow(missing_docs)] // documentation missing in model
         358  +
    pub fn set_default_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         359  +
        self.default_blob = input;
         360  +
        self
         361  +
    }
         362  +
    #[allow(missing_docs)] // documentation missing in model
         363  +
    pub fn get_default_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         364  +
        &self.default_blob
         365  +
    }
         366  +
    #[allow(missing_docs)] // documentation missing in model
         367  +
    pub fn default_byte(mut self, input: i8) -> Self {
         368  +
        self.default_byte = ::std::option::Option::Some(input);
         369  +
        self
         370  +
    }
         371  +
    #[allow(missing_docs)] // documentation missing in model
         372  +
    pub fn set_default_byte(mut self, input: ::std::option::Option<i8>) -> Self {
         373  +
        self.default_byte = input;
         374  +
        self
         375  +
    }
         376  +
    #[allow(missing_docs)] // documentation missing in model
         377  +
    pub fn get_default_byte(&self) -> &::std::option::Option<i8> {
         378  +
        &self.default_byte
         379  +
    }
         380  +
    #[allow(missing_docs)] // documentation missing in model
         381  +
    pub fn default_short(mut self, input: i16) -> Self {
         382  +
        self.default_short = ::std::option::Option::Some(input);
         383  +
        self
         384  +
    }
         385  +
    #[allow(missing_docs)] // documentation missing in model
         386  +
    pub fn set_default_short(mut self, input: ::std::option::Option<i16>) -> Self {
         387  +
        self.default_short = input;
         388  +
        self
         389  +
    }
         390  +
    #[allow(missing_docs)] // documentation missing in model
         391  +
    pub fn get_default_short(&self) -> &::std::option::Option<i16> {
         392  +
        &self.default_short
         393  +
    }
         394  +
    #[allow(missing_docs)] // documentation missing in model
         395  +
    pub fn default_integer(mut self, input: i32) -> Self {
         396  +
        self.default_integer = ::std::option::Option::Some(input);
         397  +
        self
         398  +
    }
         399  +
    #[allow(missing_docs)] // documentation missing in model
         400  +
    pub fn set_default_integer(mut self, input: ::std::option::Option<i32>) -> Self {
         401  +
        self.default_integer = input;
         402  +
        self
         403  +
    }
         404  +
    #[allow(missing_docs)] // documentation missing in model
         405  +
    pub fn get_default_integer(&self) -> &::std::option::Option<i32> {
         406  +
        &self.default_integer
         407  +
    }
         408  +
    #[allow(missing_docs)] // documentation missing in model
         409  +
    pub fn default_long(mut self, input: i64) -> Self {
         410  +
        self.default_long = ::std::option::Option::Some(input);
         411  +
        self
         412  +
    }
         413  +
    #[allow(missing_docs)] // documentation missing in model
         414  +
    pub fn set_default_long(mut self, input: ::std::option::Option<i64>) -> Self {
         415  +
        self.default_long = input;
         416  +
        self
         417  +
    }
         418  +
    #[allow(missing_docs)] // documentation missing in model
         419  +
    pub fn get_default_long(&self) -> &::std::option::Option<i64> {
         420  +
        &self.default_long
         421  +
    }
         422  +
    #[allow(missing_docs)] // documentation missing in model
         423  +
    pub fn default_float(mut self, input: f32) -> Self {
         424  +
        self.default_float = ::std::option::Option::Some(input);
         425  +
        self
         426  +
    }
         427  +
    #[allow(missing_docs)] // documentation missing in model
         428  +
    pub fn set_default_float(mut self, input: ::std::option::Option<f32>) -> Self {
         429  +
        self.default_float = input;
         430  +
        self
         431  +
    }
         432  +
    #[allow(missing_docs)] // documentation missing in model
         433  +
    pub fn get_default_float(&self) -> &::std::option::Option<f32> {
         434  +
        &self.default_float
         435  +
    }
         436  +
    #[allow(missing_docs)] // documentation missing in model
         437  +
    pub fn default_double(mut self, input: f64) -> Self {
         438  +
        self.default_double = ::std::option::Option::Some(input);
         439  +
        self
         440  +
    }
         441  +
    #[allow(missing_docs)] // documentation missing in model
         442  +
    pub fn set_default_double(mut self, input: ::std::option::Option<f64>) -> Self {
         443  +
        self.default_double = input;
         444  +
        self
         445  +
    }
         446  +
    #[allow(missing_docs)] // documentation missing in model
         447  +
    pub fn get_default_double(&self) -> &::std::option::Option<f64> {
         448  +
        &self.default_double
         449  +
    }
         450  +
    /// Adds a key-value pair to `default_map`.
         451  +
    ///
         452  +
    /// To override the contents of this collection use [`set_default_map`](Self::set_default_map).
         453  +
    ///
         454  +
    pub fn default_map(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
         455  +
        let mut hash_map = self.default_map.unwrap_or_default();
         456  +
        hash_map.insert(k.into(), v.into());
         457  +
        self.default_map = ::std::option::Option::Some(hash_map);
         458  +
        self
         459  +
    }
         460  +
    #[allow(missing_docs)] // documentation missing in model
         461  +
    pub fn set_default_map(
         462  +
        mut self,
         463  +
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
         464  +
    ) -> Self {
         465  +
        self.default_map = input;
         466  +
        self
         467  +
    }
         468  +
    #[allow(missing_docs)] // documentation missing in model
         469  +
    pub fn get_default_map(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
         470  +
        &self.default_map
         471  +
    }
         472  +
    #[allow(missing_docs)] // documentation missing in model
         473  +
    pub fn default_enum(mut self, input: crate::types::TestEnum) -> Self {
         474  +
        self.default_enum = ::std::option::Option::Some(input);
         475  +
        self
         476  +
    }
         477  +
    #[allow(missing_docs)] // documentation missing in model
         478  +
    pub fn set_default_enum(mut self, input: ::std::option::Option<crate::types::TestEnum>) -> Self {
         479  +
        self.default_enum = input;
         480  +
        self
         481  +
    }
         482  +
    #[allow(missing_docs)] // documentation missing in model
         483  +
    pub fn get_default_enum(&self) -> &::std::option::Option<crate::types::TestEnum> {
         484  +
        &self.default_enum
         485  +
    }
         486  +
    #[allow(missing_docs)] // documentation missing in model
         487  +
    pub fn default_int_enum(mut self, input: i32) -> Self {
         488  +
        self.default_int_enum = ::std::option::Option::Some(input);
         489  +
        self
         490  +
    }
         491  +
    #[allow(missing_docs)] // documentation missing in model
         492  +
    pub fn set_default_int_enum(mut self, input: ::std::option::Option<i32>) -> Self {
         493  +
        self.default_int_enum = input;
         494  +
        self
         495  +
    }
         496  +
    #[allow(missing_docs)] // documentation missing in model
         497  +
    pub fn get_default_int_enum(&self) -> &::std::option::Option<i32> {
         498  +
        &self.default_int_enum
         499  +
    }
         500  +
    #[allow(missing_docs)] // documentation missing in model
         501  +
    pub fn empty_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         502  +
        self.empty_string = ::std::option::Option::Some(input.into());
         503  +
        self
         504  +
    }
         505  +
    #[allow(missing_docs)] // documentation missing in model
         506  +
    pub fn set_empty_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         507  +
        self.empty_string = input;
         508  +
        self
         509  +
    }
         510  +
    #[allow(missing_docs)] // documentation missing in model
         511  +
    pub fn get_empty_string(&self) -> &::std::option::Option<::std::string::String> {
         512  +
        &self.empty_string
         513  +
    }
         514  +
    #[allow(missing_docs)] // documentation missing in model
         515  +
    pub fn false_boolean(mut self, input: bool) -> Self {
         516  +
        self.false_boolean = ::std::option::Option::Some(input);
         517  +
        self
         518  +
    }
         519  +
    #[allow(missing_docs)] // documentation missing in model
         520  +
    pub fn set_false_boolean(mut self, input: ::std::option::Option<bool>) -> Self {
         521  +
        self.false_boolean = input;
         522  +
        self
         523  +
    }
         524  +
    #[allow(missing_docs)] // documentation missing in model
         525  +
    pub fn get_false_boolean(&self) -> &::std::option::Option<bool> {
         526  +
        &self.false_boolean
         527  +
    }
         528  +
    #[allow(missing_docs)] // documentation missing in model
         529  +
    pub fn empty_blob(mut self, input: ::aws_smithy_types::Blob) -> Self {
         530  +
        self.empty_blob = ::std::option::Option::Some(input);
         531  +
        self
         532  +
    }
         533  +
    #[allow(missing_docs)] // documentation missing in model
         534  +
    pub fn set_empty_blob(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
         535  +
        self.empty_blob = input;
         536  +
        self
         537  +
    }
         538  +
    #[allow(missing_docs)] // documentation missing in model
         539  +
    pub fn get_empty_blob(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
         540  +
        &self.empty_blob
         541  +
    }
         542  +
    #[allow(missing_docs)] // documentation missing in model
         543  +
    pub fn zero_byte(mut self, input: i8) -> Self {
         544  +
        self.zero_byte = ::std::option::Option::Some(input);
         545  +
        self
         546  +
    }
         547  +
    #[allow(missing_docs)] // documentation missing in model
         548  +
    pub fn set_zero_byte(mut self, input: ::std::option::Option<i8>) -> Self {
         549  +
        self.zero_byte = input;
         550  +
        self
         551  +
    }
         552  +
    #[allow(missing_docs)] // documentation missing in model
         553  +
    pub fn get_zero_byte(&self) -> &::std::option::Option<i8> {
         554  +
        &self.zero_byte
         555  +
    }
         556  +
    #[allow(missing_docs)] // documentation missing in model
         557  +
    pub fn zero_short(mut self, input: i16) -> Self {
         558  +
        self.zero_short = ::std::option::Option::Some(input);
         559  +
        self
         560  +
    }
         561  +
    #[allow(missing_docs)] // documentation missing in model
         562  +
    pub fn set_zero_short(mut self, input: ::std::option::Option<i16>) -> Self {
         563  +
        self.zero_short = input;
         564  +
        self
         565  +
    }
         566  +
    #[allow(missing_docs)] // documentation missing in model
         567  +
    pub fn get_zero_short(&self) -> &::std::option::Option<i16> {
         568  +
        &self.zero_short
         569  +
    }
         570  +
    #[allow(missing_docs)] // documentation missing in model
         571  +
    pub fn zero_integer(mut self, input: i32) -> Self {
         572  +
        self.zero_integer = ::std::option::Option::Some(input);
         573  +
        self
         574  +
    }
         575  +
    #[allow(missing_docs)] // documentation missing in model
         576  +
    pub fn set_zero_integer(mut self, input: ::std::option::Option<i32>) -> Self {
         577  +
        self.zero_integer = input;
         578  +
        self
         579  +
    }
         580  +
    #[allow(missing_docs)] // documentation missing in model
         581  +
    pub fn get_zero_integer(&self) -> &::std::option::Option<i32> {
         582  +
        &self.zero_integer
         583  +
    }
         584  +
    #[allow(missing_docs)] // documentation missing in model
         585  +
    pub fn zero_long(mut self, input: i64) -> Self {
         586  +
        self.zero_long = ::std::option::Option::Some(input);
         587  +
        self
         588  +
    }
         589  +
    #[allow(missing_docs)] // documentation missing in model
         590  +
    pub fn set_zero_long(mut self, input: ::std::option::Option<i64>) -> Self {
         591  +
        self.zero_long = input;
         592  +
        self
         593  +
    }
         594  +
    #[allow(missing_docs)] // documentation missing in model
         595  +
    pub fn get_zero_long(&self) -> &::std::option::Option<i64> {
         596  +
        &self.zero_long
         597  +
    }
         598  +
    #[allow(missing_docs)] // documentation missing in model
         599  +
    pub fn zero_float(mut self, input: f32) -> Self {
         600  +
        self.zero_float = ::std::option::Option::Some(input);
         601  +
        self
         602  +
    }
         603  +
    #[allow(missing_docs)] // documentation missing in model
         604  +
    pub fn set_zero_float(mut self, input: ::std::option::Option<f32>) -> Self {
         605  +
        self.zero_float = input;
         606  +
        self
         607  +
    }
         608  +
    #[allow(missing_docs)] // documentation missing in model
         609  +
    pub fn get_zero_float(&self) -> &::std::option::Option<f32> {
         610  +
        &self.zero_float
         611  +
    }
         612  +
    #[allow(missing_docs)] // documentation missing in model
         613  +
    pub fn zero_double(mut self, input: f64) -> Self {
         614  +
        self.zero_double = ::std::option::Option::Some(input);
         615  +
        self
         616  +
    }
         617  +
    #[allow(missing_docs)] // documentation missing in model
         618  +
    pub fn set_zero_double(mut self, input: ::std::option::Option<f64>) -> Self {
         619  +
        self.zero_double = input;
         620  +
        self
         621  +
    }
         622  +
    #[allow(missing_docs)] // documentation missing in model
         623  +
    pub fn get_zero_double(&self) -> &::std::option::Option<f64> {
         624  +
        &self.zero_double
         625  +
    }
         626  +
    /// Consumes the builder and constructs a [`OperationWithDefaultsOutput`](crate::operation::operation_with_defaults::OperationWithDefaultsOutput).
         627  +
    pub fn build(self) -> crate::operation::operation_with_defaults::OperationWithDefaultsOutput {
         628  +
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput {
         629  +
            default_string: self.default_string.unwrap_or_else(|| "hi".to_owned()),
         630  +
            default_boolean: self.default_boolean.unwrap_or(true),
         631  +
            default_list: self.default_list.unwrap_or_default(),
         632  +
            default_document_map: self.default_document_map.unwrap_or_else(|| {
         633  +
                let json_bytes = br#"{}"#;
         634  +
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
         635  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
         636  +
            }),
         637  +
            default_document_string: self.default_document_string.unwrap_or_else(|| {
         638  +
                let json_bytes = br#""hi""#;
         639  +
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
         640  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
         641  +
            }),
         642  +
            default_document_boolean: self.default_document_boolean.unwrap_or_else(|| {
         643  +
                let json_bytes = br#"true"#;
         644  +
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
         645  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
         646  +
            }),
         647  +
            default_document_list: self.default_document_list.unwrap_or_else(|| {
         648  +
                let json_bytes = br#"[]"#;
         649  +
                let mut tokens = ::aws_smithy_json::deserialize::json_token_iter(json_bytes).peekable();
         650  +
                ::aws_smithy_json::deserialize::token::expect_document(&mut tokens).expect("well formed json")
         651  +
            }),
         652  +
            default_null_document: self.default_null_document,
         653  +
            default_timestamp: self
         654  +
                .default_timestamp
         655  +
                .unwrap_or_else(|| ::aws_smithy_types::DateTime::from_fractional_secs(0, 0_f64)),
         656  +
            default_blob: self.default_blob.unwrap_or_else(|| ::aws_smithy_types::Blob::new("abc")),
         657  +
            default_byte: self.default_byte.unwrap_or(1),
         658  +
            default_short: self.default_short.unwrap_or(1),
         659  +
            default_integer: self.default_integer.unwrap_or(10),
         660  +
            default_long: self.default_long.unwrap_or(100),
         661  +
            default_float: self.default_float.unwrap_or(1.0_f32),
         662  +
            default_double: self.default_double.unwrap_or(1.0_f64),
         663  +
            default_map: self.default_map.unwrap_or_default(),
         664  +
            default_enum: self
         665  +
                .default_enum
         666  +
                .unwrap_or("FOO".parse::<crate::types::TestEnum>().expect("static value validated to member")),
         667  +
            default_int_enum: self.default_int_enum.unwrap_or(1),
         668  +
            empty_string: self.empty_string.unwrap_or_default(),
         669  +
            false_boolean: self.false_boolean.unwrap_or_default(),
         670  +
            empty_blob: self.empty_blob.unwrap_or_default(),
         671  +
            zero_byte: self.zero_byte.unwrap_or_default(),
         672  +
            zero_short: self.zero_short.unwrap_or_default(),
         673  +
            zero_integer: self.zero_integer.unwrap_or_default(),
         674  +
            zero_long: self.zero_long.unwrap_or_default(),
         675  +
            zero_float: self.zero_float.unwrap_or(0.0_f32),
         676  +
            zero_double: self.zero_double.unwrap_or(0.0_f64),
         677  +
        }
         678  +
    }
         679  +
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/operation_with_defaults/builders.rs

@@ -0,1 +0,166 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::operation_with_defaults::_operation_with_defaults_output::OperationWithDefaultsOutputBuilder;
           3  +
           4  +
pub use crate::operation::operation_with_defaults::_operation_with_defaults_input::OperationWithDefaultsInputBuilder;
           5  +
           6  +
impl crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder {
           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::operation_with_defaults::OperationWithDefaultsOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::operation_with_defaults::OperationWithDefaultsError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.operation_with_defaults();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `OperationWithDefaults`.
          24  +
///
          25  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          26  +
pub struct OperationWithDefaultsFluentBuilder {
          27  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          28  +
    inner: crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder,
          29  +
    config_override: ::std::option::Option<crate::config::Builder>,
          30  +
}
          31  +
impl
          32  +
    crate::client::customize::internal::CustomizableSend<
          33  +
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
          34  +
        crate::operation::operation_with_defaults::OperationWithDefaultsError,
          35  +
    > for OperationWithDefaultsFluentBuilder
          36  +
{
          37  +
    fn send(
          38  +
        self,
          39  +
        config_override: crate::config::Builder,
          40  +
    ) -> crate::client::customize::internal::BoxFuture<
          41  +
        crate::client::customize::internal::SendResult<
          42  +
            crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
          43  +
            crate::operation::operation_with_defaults::OperationWithDefaultsError,
          44  +
        >,
          45  +
    > {
          46  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          47  +
    }
          48  +
}
          49  +
impl OperationWithDefaultsFluentBuilder {
          50  +
    /// Creates a new `OperationWithDefaultsFluentBuilder`.
          51  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          52  +
        Self {
          53  +
            handle,
          54  +
            inner: ::std::default::Default::default(),
          55  +
            config_override: ::std::option::Option::None,
          56  +
        }
          57  +
    }
          58  +
    /// Access the OperationWithDefaults as a reference.
          59  +
    pub fn as_input(&self) -> &crate::operation::operation_with_defaults::builders::OperationWithDefaultsInputBuilder {
          60  +
        &self.inner
          61  +
    }
          62  +
    /// Sends the request and returns the response.
          63  +
    ///
          64  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          65  +
    /// can be matched against.
          66  +
    ///
          67  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          68  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          69  +
    /// set when configuring the client.
          70  +
    pub async fn send(
          71  +
        self,
          72  +
    ) -> ::std::result::Result<
          73  +
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
          74  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          75  +
            crate::operation::operation_with_defaults::OperationWithDefaultsError,
          76  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          77  +
        >,
          78  +
    > {
          79  +
        let input = self
          80  +
            .inner
          81  +
            .build()
          82  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          83  +
        let runtime_plugins = crate::operation::operation_with_defaults::OperationWithDefaults::operation_runtime_plugins(
          84  +
            self.handle.runtime_plugins.clone(),
          85  +
            &self.handle.conf,
          86  +
            self.config_override,
          87  +
        );
          88  +
        crate::operation::operation_with_defaults::OperationWithDefaults::orchestrate(&runtime_plugins, input).await
          89  +
    }
          90  +
          91  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          92  +
    pub fn customize(
          93  +
        self,
          94  +
    ) -> crate::client::customize::CustomizableOperation<
          95  +
        crate::operation::operation_with_defaults::OperationWithDefaultsOutput,
          96  +
        crate::operation::operation_with_defaults::OperationWithDefaultsError,
          97  +
        Self,
          98  +
    > {
          99  +
        crate::client::customize::CustomizableOperation::new(self)
         100  +
    }
         101  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         102  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         103  +
        self
         104  +
    }
         105  +
         106  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         107  +
        self.config_override = config_override;
         108  +
        self
         109  +
    }
         110  +
    #[allow(missing_docs)] // documentation missing in model
         111  +
    pub fn defaults(mut self, input: crate::types::Defaults) -> Self {
         112  +
        self.inner = self.inner.defaults(input);
         113  +
        self
         114  +
    }
         115  +
    #[allow(missing_docs)] // documentation missing in model
         116  +
    pub fn set_defaults(mut self, input: ::std::option::Option<crate::types::Defaults>) -> Self {
         117  +
        self.inner = self.inner.set_defaults(input);
         118  +
        self
         119  +
    }
         120  +
    #[allow(missing_docs)] // documentation missing in model
         121  +
    pub fn get_defaults(&self) -> &::std::option::Option<crate::types::Defaults> {
         122  +
        self.inner.get_defaults()
         123  +
    }
         124  +
    #[allow(missing_docs)] // documentation missing in model
         125  +
    pub fn client_optional_defaults(mut self, input: crate::types::ClientOptionalDefaults) -> Self {
         126  +
        self.inner = self.inner.client_optional_defaults(input);
         127  +
        self
         128  +
    }
         129  +
    #[allow(missing_docs)] // documentation missing in model
         130  +
    pub fn set_client_optional_defaults(mut self, input: ::std::option::Option<crate::types::ClientOptionalDefaults>) -> Self {
         131  +
        self.inner = self.inner.set_client_optional_defaults(input);
         132  +
        self
         133  +
    }
         134  +
    #[allow(missing_docs)] // documentation missing in model
         135  +
    pub fn get_client_optional_defaults(&self) -> &::std::option::Option<crate::types::ClientOptionalDefaults> {
         136  +
        self.inner.get_client_optional_defaults()
         137  +
    }
         138  +
    #[allow(missing_docs)] // documentation missing in model
         139  +
    pub fn top_level_default(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         140  +
        self.inner = self.inner.top_level_default(input.into());
         141  +
        self
         142  +
    }
         143  +
    #[allow(missing_docs)] // documentation missing in model
         144  +
    pub fn set_top_level_default(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         145  +
        self.inner = self.inner.set_top_level_default(input);
         146  +
        self
         147  +
    }
         148  +
    #[allow(missing_docs)] // documentation missing in model
         149  +
    pub fn get_top_level_default(&self) -> &::std::option::Option<::std::string::String> {
         150  +
        self.inner.get_top_level_default()
         151  +
    }
         152  +
    #[allow(missing_docs)] // documentation missing in model
         153  +
    pub fn other_top_level_default(mut self, input: i32) -> Self {
         154  +
        self.inner = self.inner.other_top_level_default(input);
         155  +
        self
         156  +
    }
         157  +
    #[allow(missing_docs)] // documentation missing in model
         158  +
    pub fn set_other_top_level_default(mut self, input: ::std::option::Option<i32>) -> Self {
         159  +
        self.inner = self.inner.set_other_top_level_default(input);
         160  +
        self
         161  +
    }
         162  +
    #[allow(missing_docs)] // documentation missing in model
         163  +
    pub fn get_other_top_level_default(&self) -> &::std::option::Option<i32> {
         164  +
        self.inner.get_other_top_level_default()
         165  +
    }
         166  +
}

tmp-codegen-diff/codegen-client-test/rest_json/rust-client-codegen/src/operation/operation_with_nested_structure.rs

@@ -0,1 +0,501 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `OperationWithNestedStructure`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct OperationWithNestedStructure;
           6  +
impl OperationWithNestedStructure {
           7  +
    /// Creates a new `OperationWithNestedStructure`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    pub(crate) async fn orchestrate(
          12  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          13  +
        input: crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
          14  +
    ) -> ::std::result::Result<
          15  +
        crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput,
          16  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          17  +
            crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
          18  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          19  +
        >,
          20  +
    > {
          21  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          22  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          23  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          24  +
        >| {
          25  +
            err.map_service_error(|err| {
          26  +
                err.downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureError>()
          27  +
                    .expect("correct error type")
          28  +
            })
          29  +
        };
          30  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          31  +
            .await
          32  +
            .map_err(map_err)?;
          33  +
        let output = context.finalize().map_err(map_err)?;
          34  +
        ::std::result::Result::Ok(
          35  +
            output
          36  +
                .downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput>()
          37  +
                .expect("correct output type"),
          38  +
        )
          39  +
    }
          40  +
          41  +
    pub(crate) async fn orchestrate_with_stop_point(
          42  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          43  +
        input: crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
          44  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          45  +
    ) -> ::std::result::Result<
          46  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          47  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          48  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          49  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          50  +
        >,
          51  +
    > {
          52  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          53  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
          54  +
            "restjsonprotocol",
          55  +
            "OperationWithNestedStructure",
          56  +
            input,
          57  +
            runtime_plugins,
          58  +
            stop_point,
          59  +
        )
          60  +
        .await
          61  +
    }
          62  +
          63  +
    pub(crate) fn operation_runtime_plugins(
          64  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          65  +
        client_config: &crate::config::Config,
          66  +
        config_override: ::std::option::Option<crate::config::Builder>,
          67  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          68  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          69  +
        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
          70  +
            ::aws_smithy_runtime::client::auth::no_auth::NO_AUTH_SCHEME_ID,
          71  +
        ]));
          72  +
        if let ::std::option::Option::Some(config_override) = config_override {
          73  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          74  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          75  +
            }
          76  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          77  +
                config_override,
          78  +
                client_config.config.clone(),
          79  +
                &client_config.runtime_components,
          80  +
            ));
          81  +
        }
          82  +
        runtime_plugins
          83  +
    }
          84  +
}
          85  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for OperationWithNestedStructure {
          86  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
          87  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("OperationWithNestedStructure");
          88  +
          89  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
          90  +
            OperationWithNestedStructureRequestSerializer,
          91  +
        ));
          92  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
          93  +
            OperationWithNestedStructureResponseDeserializer,
          94  +
        ));
          95  +
          96  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
          97  +
            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
          98  +
        ));
          99  +
         100  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
         101  +
            "OperationWithNestedStructure",
         102  +
            "restjsonprotocol",
         103  +
        ));
         104  +
         105  +
        ::std::option::Option::Some(cfg.freeze())
         106  +
    }
         107  +
         108  +
    fn runtime_components(
         109  +
        &self,
         110  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         111  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         112  +
        #[allow(unused_mut)]
         113  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("OperationWithNestedStructure")
         114  +
            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
         115  +
            .with_interceptor(OperationWithNestedStructureEndpointParamsInterceptor)
         116  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         117  +
                crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
         118  +
            >::new())
         119  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         120  +
                crate::operation::operation_with_nested_structure::OperationWithNestedStructureError,
         121  +
            >::new());
         122  +
         123  +
        ::std::borrow::Cow::Owned(rcb)
         124  +
    }
         125  +
}
         126  +
         127  +
#[derive(Debug)]
         128  +
struct OperationWithNestedStructureResponseDeserializer;
         129  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for OperationWithNestedStructureResponseDeserializer {
         130  +
    fn deserialize_nonstreaming(
         131  +
        &self,
         132  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         133  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         134  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         135  +
        let headers = response.headers();
         136  +
        let body = response.body().bytes().expect("body loaded");
         137  +
        #[allow(unused_mut)]
         138  +
        let mut force_error = false;
         139  +
         140  +
        let parse_result = if !success && status != 200 || force_error {
         141  +
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_error(status, headers, body)
         142  +
        } else {
         143  +
            crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure_http_response(status, headers, body)
         144  +
        };
         145  +
        crate::protocol_serde::type_erase_result(parse_result)
         146  +
    }
         147  +
}
         148  +
#[derive(Debug)]
         149  +
struct OperationWithNestedStructureRequestSerializer;
         150  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for OperationWithNestedStructureRequestSerializer {
         151  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         152  +
    fn serialize_input(
         153  +
        &self,
         154  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         155  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         156  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         157  +
        let input = input
         158  +
            .downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput>()
         159  +
            .expect("correct type");
         160  +
        let _header_serialization_settings = _cfg
         161  +
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
         162  +
            .cloned()
         163  +
            .unwrap_or_default();
         164  +
        let mut request_builder = {
         165  +
            fn uri_base(
         166  +
                _input: &crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
         167  +
                output: &mut ::std::string::String,
         168  +
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
         169  +
                use ::std::fmt::Write as _;
         170  +
                ::std::write!(output, "/OperationWithNestedStructure").expect("formatting should succeed");
         171  +
                ::std::result::Result::Ok(())
         172  +
            }
         173  +
            #[allow(clippy::unnecessary_wraps)]
         174  +
            fn update_http_builder(
         175  +
                input: &crate::operation::operation_with_nested_structure::OperationWithNestedStructureInput,
         176  +
                builder: ::http::request::Builder,
         177  +
            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
         178  +
                let mut uri = ::std::string::String::new();
         179  +
                uri_base(input, &mut uri)?;
         180  +
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
         181  +
            }
         182  +
            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
         183  +
            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json");
         184  +
            builder
         185  +
        };
         186  +
        let body = ::aws_smithy_types::body::SdkBody::from(
         187  +
            crate::protocol_serde::shape_operation_with_nested_structure::ser_operation_with_nested_structure_input(&input)?,
         188  +
        );
         189  +
        if let Some(content_length) = body.content_length() {
         190  +
            let content_length = content_length.to_string();
         191  +
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
         192  +
        }
         193  +
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         194  +
    }
         195  +
}
         196  +
#[derive(Debug)]
         197  +
struct OperationWithNestedStructureEndpointParamsInterceptor;
         198  +
         199  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithNestedStructureEndpointParamsInterceptor {
         200  +
    fn name(&self) -> &'static str {
         201  +
        "OperationWithNestedStructureEndpointParamsInterceptor"
         202  +
    }
         203  +
         204  +
    fn read_before_execution(
         205  +
        &self,
         206  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         207  +
            '_,
         208  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         209  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         210  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         211  +
        >,
         212  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         213  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         214  +
        let _input = context
         215  +
            .input()
         216  +
            .downcast_ref::<OperationWithNestedStructureInput>()
         217  +
            .ok_or("failed to downcast to OperationWithNestedStructureInput")?;
         218  +
         219  +
        let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
         220  +
            ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         221  +
        })?;
         222  +
        cfg.interceptor_state()
         223  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         224  +
        ::std::result::Result::Ok(())
         225  +
    }
         226  +
}
         227  +
#[allow(unreachable_code, unused_variables)]
         228  +
#[cfg(test)]
         229  +
mod operation_with_nested_structure_test {
         230  +
         231  +
    /// Client populates nested default values when missing.
         232  +
    /// Test ID: RestJsonClientPopulatesNestedDefaultValuesWhenMissing
         233  +
    #[::tokio::test]
         234  +
    #[::tracing_test::traced_test]
         235  +
    async fn rest_json_client_populates_nested_default_values_when_missing_request() {
         236  +
        let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
         237  +
        let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
         238  +
         239  +
        let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
         240  +
        let result = client
         241  +
            .operation_with_nested_structure()
         242  +
            .set_top_level(::std::option::Option::Some(
         243  +
                crate::types::TopLevel::builder()
         244  +
                    .set_dialog(::std::option::Option::Some(
         245  +
                        crate::types::Dialog::builder()
         246  +
                            .set_language(::std::option::Option::Some("en".to_owned()))
         247  +
                            .build(),
         248  +
                    ))
         249  +
                    .set_dialog_list(::std::option::Option::Some(vec![
         250  +
                        crate::types::Dialog::builder().build(),
         251  +
                        crate::types::Dialog::builder()
         252  +
                            .set_farewell(::std::option::Option::Some(crate::types::Farewell::builder().build()))
         253  +
                            .build(),
         254  +
                        crate::types::Dialog::builder()
         255  +
                            .set_language(::std::option::Option::Some("it".to_owned()))
         256  +
                            .set_greeting(::std::option::Option::Some("ciao".to_owned()))
         257  +
                            .set_farewell(::std::option::Option::Some(
         258  +
                                crate::types::Farewell::builder()
         259  +
                                    .set_phrase(::std::option::Option::Some("arrivederci".to_owned()))
         260  +
                                    .build(),
         261  +
                            ))
         262  +
                            .build(),
         263  +
                    ]))
         264  +
                    .set_dialog_map(::std::option::Option::Some({
         265  +
                        let mut ret = ::std::collections::HashMap::new();
         266  +
                        ret.insert("emptyDialog".to_owned(), crate::types::Dialog::builder().build());
         267  +
                        ret.insert(
         268  +
                            "partialEmptyDialog".to_owned(),
         269  +
                            crate::types::Dialog::builder()
         270  +
                                .set_language(::std::option::Option::Some("en".to_owned()))
         271  +
                                .set_farewell(::std::option::Option::Some(crate::types::Farewell::builder().build()))
         272  +
                                .build(),
         273  +
                        );
         274  +
                        ret.insert(
         275  +
                            "nonEmptyDialog".to_owned(),
         276  +
                            crate::types::Dialog::builder()
         277  +
                                .set_greeting(::std::option::Option::Some("konnichiwa".to_owned()))
         278  +
                                .set_farewell(::std::option::Option::Some(
         279  +
                                    crate::types::Farewell::builder()
         280  +
                                        .set_phrase(::std::option::Option::Some("sayonara".to_owned()))
         281  +
                                        .build(),
         282  +
                                ))
         283  +
                                .build(),
         284  +
                        );
         285  +
                        ret
         286  +
                    }))
         287  +
                    .build()
         288  +
                    .unwrap(),
         289  +
            ))
         290  +
            .send()
         291  +
            .await;
         292  +
        let _ = dbg!(result);
         293  +
        let http_request = request_receiver.expect_request();
         294  +
        let expected_headers = [("Content-Type", "application/json")];
         295  +
        ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
         296  +
        let body = http_request.body().bytes().expect("body should be strict");
         297  +
        ::aws_smithy_protocol_test::assert_ok(
         298  +
        ::aws_smithy_protocol_test::validate_body(body, "{\n    \"topLevel\": {\n        \"dialog\": {\n            \"language\": \"en\",\n            \"greeting\": \"hi\"\n        },\n        \"dialogList\": [\n            {\n                \"greeting\": \"hi\"\n            },\n            {\n                \"greeting\": \"hi\",\n                \"farewell\": {\n                    \"phrase\": \"bye\"\n                }\n            },\n            {\n                \"language\": \"it\",\n                \"greeting\": \"ciao\",\n                \"farewell\": {\n                    \"phrase\": \"arrivederci\"\n                }\n            }\n        ],\n        \"dialogMap\": {\n            \"emptyDialog\": {\n                \"greeting\": \"hi\"\n            },\n            \"partialEmptyDialog\": {\n                \"language\": \"en\",\n                \"greeting\": \"hi\",\n                \"farewell\": {\n                    \"phrase\": \"bye\"\n                }\n            },\n            \"nonEmptyDialog\": {\n                \"greeting\": \"konnichiwa\",\n                \"farewell\": {\n                    \"phrase\": \"sayonara\"\n                }\n            }\n        }\n    }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
         299  +
        );
         300  +
        let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
         301  +
        ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
         302  +
        ::pretty_assertions::assert_eq!(uri.path(), "/OperationWithNestedStructure", "path was incorrect");
         303  +
    }
         304  +
    /// Client populates nested default values when missing in response body.
         305  +
    /// Test ID: RestJsonClientPopulatesNestedDefaultsWhenMissingInResponseBody
         306  +
    #[::tokio::test]
         307  +
    #[::tracing_test::traced_test]
         308  +
    async fn rest_json_client_populates_nested_defaults_when_missing_in_response_body_response() {
         309  +
        let expected_output = crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput::builder()
         310  +
            .set_dialog(::std::option::Option::Some(
         311  +
                crate::types::Dialog::builder()
         312  +
                    .set_language(::std::option::Option::Some("en".to_owned()))
         313  +
                    .set_greeting(::std::option::Option::Some("hi".to_owned()))
         314  +
                    .build(),
         315  +
            ))
         316  +
            .set_dialog_list(::std::option::Option::Some(vec![
         317  +
                crate::types::Dialog::builder()
         318  +
                    .set_greeting(::std::option::Option::Some("hi".to_owned()))
         319  +
                    .build(),
         320  +
                crate::types::Dialog::builder()
         321  +
                    .set_greeting(::std::option::Option::Some("hi".to_owned()))
         322  +
                    .set_farewell(::std::option::Option::Some(
         323  +
                        crate::types::Farewell::builder()
         324  +
                            .set_phrase(::std::option::Option::Some("bye".to_owned()))
         325  +
                            .build(),
         326  +
                    ))
         327  +
                    .build(),
         328  +
                crate::types::Dialog::builder()
         329  +
                    .set_language(::std::option::Option::Some("it".to_owned()))
         330  +
                    .set_greeting(::std::option::Option::Some("ciao".to_owned()))
         331  +
                    .set_farewell(::std::option::Option::Some(
         332  +
                        crate::types::Farewell::builder()
         333  +
                            .set_phrase(::std::option::Option::Some("arrivederci".to_owned()))
         334  +
                            .build(),
         335  +
                    ))
         336  +
                    .build(),
         337  +
            ]))
         338  +
            .set_dialog_map(::std::option::Option::Some({
         339  +
                let mut ret = ::std::collections::HashMap::new();
         340  +
                ret.insert(
         341  +
                    "emptyDialog".to_owned(),
         342  +
                    crate::types::Dialog::builder()
         343  +
                        .set_greeting(::std::option::Option::Some("hi".to_owned()))
         344  +
                        .build(),
         345  +
                );
         346  +
                ret.insert(
         347  +
                    "partialEmptyDialog".to_owned(),
         348  +
                    crate::types::Dialog::builder()
         349  +
                        .set_language(::std::option::Option::Some("en".to_owned()))
         350  +
                        .set_greeting(::std::option::Option::Some("hi".to_owned()))
         351  +
                        .set_farewell(::std::option::Option::Some(
         352  +
                            crate::types::Farewell::builder()
         353  +
                                .set_phrase(::std::option::Option::Some("bye".to_owned()))
         354  +
                                .build(),
         355  +
                        ))
         356  +
                        .build(),
         357  +
                );
         358  +
                ret.insert(
         359  +
                    "nonEmptyDialog".to_owned(),
         360  +
                    crate::types::Dialog::builder()
         361  +
                        .set_greeting(::std::option::Option::Some("konnichiwa".to_owned()))
         362  +
                        .set_farewell(::std::option::Option::Some(
         363  +
                            crate::types::Farewell::builder()
         364  +
                                .set_phrase(::std::option::Option::Some("sayonara".to_owned()))
         365  +
                                .build(),
         366  +
                        ))
         367  +
                        .build(),
         368  +
                );
         369  +
                ret
         370  +
            }))
         371  +
            .build()
         372  +
            .unwrap();
         373  +
        let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
         374  +
        .header("Content-Type", "application/json")
         375  +
        .status(200)
         376  +
                    .body(::aws_smithy_types::body::SdkBody::from("{\n    \"dialog\": {\n        \"language\": \"en\"\n    },\n    \"dialogList\": [\n        {\n        },\n        {\n            \"farewell\": {}\n        },\n        {\n            \"language\": \"it\",\n            \"greeting\": \"ciao\",\n            \"farewell\": {\n                \"phrase\": \"arrivederci\"\n            }\n        }\n    ],\n    \"dialogMap\": {\n        \"emptyDialog\": {\n        },\n        \"partialEmptyDialog\": {\n            \"language\": \"en\",\n            \"farewell\": {}\n        },\n        \"nonEmptyDialog\": {\n            \"greeting\": \"konnichiwa\",\n            \"farewell\": {\n                \"phrase\": \"sayonara\"\n            }\n        }\n    }\n}"))
         377  +
                    .unwrap()
         378  +
                    ).unwrap();
         379  +
        use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
         380  +
        use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
         381  +
         382  +
        let op = crate::operation::operation_with_nested_structure::OperationWithNestedStructure::new();
         383  +
        let config = op.config().expect("the operation has config");
         384  +
        let de = config
         385  +
            .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
         386  +
            .expect("the config must have a deserializer");
         387  +
         388  +
        let parsed = de.deserialize_streaming(&mut http_response);
         389  +
        let parsed = parsed.unwrap_or_else(|| {
         390  +
            let http_response =
         391  +
                http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
         392  +
            de.deserialize_nonstreaming(&http_response)
         393  +
        });
         394  +
        let parsed = parsed
         395  +
            .expect("should be successful response")
         396  +
            .downcast::<crate::operation::operation_with_nested_structure::OperationWithNestedStructureOutput>()
         397  +
            .unwrap();
         398  +
        ::pretty_assertions::assert_eq!(parsed.dialog, expected_output.dialog, "Unexpected value for `dialog`");
         399  +
        ::pretty_assertions::assert_eq!(parsed.dialog_list, expected_output.dialog_list, "Unexpected value for `dialog_list`");
         400  +
        ::pretty_assertions::assert_eq!(parsed.dialog_map, expected_output.dialog_map, "Unexpected value for `dialog_map`");
         401  +
    }
         402  +
}
         403  +
         404  +
/// Error type for the `OperationWithNestedStructureError` operation.
         405  +
#[non_exhaustive]
         406  +
#[derive(::std::fmt::Debug)]
         407  +
pub enum OperationWithNestedStructureError {
         408  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         409  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         410  +
    variable wildcard pattern and check `.code()`:
         411  +
     \
         412  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         413  +
     \
         414  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-OperationWithNestedStructureError) for what information is available for the error.")]
         415  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         416  +
}
         417  +
impl OperationWithNestedStructureError {
         418  +
    /// Creates the `OperationWithNestedStructureError::Unhandled` variant from any error type.
         419  +
    pub fn unhandled(
         420  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         421  +
    ) -> Self {
         422  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         423  +
            source: err.into(),
         424  +
            meta: ::std::default::Default::default(),
         425  +
        })
         426  +
    }
         427  +
         428  +
    /// Creates the `OperationWithNestedStructureError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         429  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         430  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         431  +
            source: err.clone().into(),
         432  +
            meta: err,
         433  +
        })
         434  +
    }
         435  +
    ///
         436  +
    /// Returns error metadata, which includes the error code, message,
         437  +
    /// request ID, and potentially additional information.
         438  +
    ///
         439  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         440  +
        match self {
         441  +
            Self::Unhandled(e) => &e.meta,
         442  +
        }
         443  +
    }
         444  +
}
         445  +
impl ::std::error::Error for OperationWithNestedStructureError {
         446  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         447  +
        match self {
         448  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         449  +
        }
         450  +
    }
         451  +
}
         452  +
impl ::std::fmt::Display for OperationWithNestedStructureError {
         453  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         454  +
        match self {
         455  +
            Self::Unhandled(_inner) => {
         456  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         457  +
                    write!(f, "unhandled error ({code})")
         458  +
                } else {
         459  +
                    f.write_str("unhandled error")
         460  +
                }
         461  +
            }
         462  +
        }
         463  +
    }
         464  +
}
         465  +
impl ::aws_smithy_types::retry::ProvideErrorKind for OperationWithNestedStructureError {
         466  +
    fn code(&self) -> ::std::option::Option<&str> {
         467  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         468  +
    }
         469  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         470  +
        ::std::option::Option::None
         471  +
    }
         472  +
}
         473  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for OperationWithNestedStructureError {
         474  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         475  +
        match self {
         476  +
            Self::Unhandled(_inner) => &_inner.meta,
         477  +
        }
         478  +
    }
         479  +
}
         480  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for OperationWithNestedStructureError {
         481  +
    fn create_unhandled_error(
         482  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         483  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         484  +
    ) -> Self {
         485  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         486  +
            source,
         487  +
            meta: meta.unwrap_or_default(),
         488  +
        })
         489  +
    }
         490  +
}
         491  +
         492  +
pub use crate::operation::operation_with_nested_structure::_operation_with_nested_structure_output::OperationWithNestedStructureOutput;
         493  +
         494  +
pub use crate::operation::operation_with_nested_structure::_operation_with_nested_structure_input::OperationWithNestedStructureInput;
         495  +
         496  +
mod _operation_with_nested_structure_input;
         497  +
         498  +
mod _operation_with_nested_structure_output;
         499  +
         500  +
/// Builders
         501  +
pub mod builders;