@@ -370,6 +370,26 @@ import {
370
370
StreamingTraitsWithMediaTypeCommandInput ,
371
371
StreamingTraitsWithMediaTypeCommandOutput ,
372
372
} from "./commands/StreamingTraitsWithMediaTypeCommand" ;
373
+ import {
374
+ TestBodyStructureCommand ,
375
+ TestBodyStructureCommandInput ,
376
+ TestBodyStructureCommandOutput ,
377
+ } from "./commands/TestBodyStructureCommand" ;
378
+ import {
379
+ TestNoPayloadCommand ,
380
+ TestNoPayloadCommandInput ,
381
+ TestNoPayloadCommandOutput ,
382
+ } from "./commands/TestNoPayloadCommand" ;
383
+ import {
384
+ TestPayloadBlobCommand ,
385
+ TestPayloadBlobCommandInput ,
386
+ TestPayloadBlobCommandOutput ,
387
+ } from "./commands/TestPayloadBlobCommand" ;
388
+ import {
389
+ TestPayloadStructureCommand ,
390
+ TestPayloadStructureCommandInput ,
391
+ TestPayloadStructureCommandOutput ,
392
+ } from "./commands/TestPayloadStructureCommand" ;
373
393
import {
374
394
TimestampFormatHeadersCommand ,
375
395
TimestampFormatHeadersCommandInput ,
@@ -2762,6 +2782,155 @@ export class RestJsonProtocol extends RestJsonProtocolClient {
2762
2782
}
2763
2783
}
2764
2784
2785
+ /**
2786
+ * This example operation serializes a structure in the HTTP body.
2787
+ *
2788
+ * It should ensure Content-Type: application/json is
2789
+ * used in all requests and that an "empty" body is
2790
+ * an empty JSON document ({}).
2791
+ *
2792
+ */
2793
+ public testBodyStructure (
2794
+ args : TestBodyStructureCommandInput ,
2795
+ options ?: __HttpHandlerOptions
2796
+ ) : Promise < TestBodyStructureCommandOutput > ;
2797
+ public testBodyStructure (
2798
+ args : TestBodyStructureCommandInput ,
2799
+ cb : ( err : any , data ?: TestBodyStructureCommandOutput ) => void
2800
+ ) : void ;
2801
+ public testBodyStructure (
2802
+ args : TestBodyStructureCommandInput ,
2803
+ options : __HttpHandlerOptions ,
2804
+ cb : ( err : any , data ?: TestBodyStructureCommandOutput ) => void
2805
+ ) : void ;
2806
+ public testBodyStructure (
2807
+ args : TestBodyStructureCommandInput ,
2808
+ optionsOrCb ?: __HttpHandlerOptions | ( ( err : any , data ?: TestBodyStructureCommandOutput ) => void ) ,
2809
+ cb ?: ( err : any , data ?: TestBodyStructureCommandOutput ) => void
2810
+ ) : Promise < TestBodyStructureCommandOutput > | void {
2811
+ const command = new TestBodyStructureCommand ( args ) ;
2812
+ if ( typeof optionsOrCb === "function" ) {
2813
+ this . send ( command , optionsOrCb ) ;
2814
+ } else if ( typeof cb === "function" ) {
2815
+ if ( typeof optionsOrCb !== "object" ) throw new Error ( `Expect http options but get ${ typeof optionsOrCb } ` ) ;
2816
+ this . send ( command , optionsOrCb || { } , cb ) ;
2817
+ } else {
2818
+ return this . send ( command , optionsOrCb ) ;
2819
+ }
2820
+ }
2821
+
2822
+ /**
2823
+ * This example operation serializes a request without an HTTP body.
2824
+ *
2825
+ * These tests are to ensure we do not attach a body or related headers
2826
+ * (Content-Length, Content-Type) to operations that semantically
2827
+ * cannot produce an HTTP body.
2828
+ *
2829
+ */
2830
+ public testNoPayload (
2831
+ args : TestNoPayloadCommandInput ,
2832
+ options ?: __HttpHandlerOptions
2833
+ ) : Promise < TestNoPayloadCommandOutput > ;
2834
+ public testNoPayload (
2835
+ args : TestNoPayloadCommandInput ,
2836
+ cb : ( err : any , data ?: TestNoPayloadCommandOutput ) => void
2837
+ ) : void ;
2838
+ public testNoPayload (
2839
+ args : TestNoPayloadCommandInput ,
2840
+ options : __HttpHandlerOptions ,
2841
+ cb : ( err : any , data ?: TestNoPayloadCommandOutput ) => void
2842
+ ) : void ;
2843
+ public testNoPayload (
2844
+ args : TestNoPayloadCommandInput ,
2845
+ optionsOrCb ?: __HttpHandlerOptions | ( ( err : any , data ?: TestNoPayloadCommandOutput ) => void ) ,
2846
+ cb ?: ( err : any , data ?: TestNoPayloadCommandOutput ) => void
2847
+ ) : Promise < TestNoPayloadCommandOutput > | void {
2848
+ const command = new TestNoPayloadCommand ( args ) ;
2849
+ if ( typeof optionsOrCb === "function" ) {
2850
+ this . send ( command , optionsOrCb ) ;
2851
+ } else if ( typeof cb === "function" ) {
2852
+ if ( typeof optionsOrCb !== "object" ) throw new Error ( `Expect http options but get ${ typeof optionsOrCb } ` ) ;
2853
+ this . send ( command , optionsOrCb || { } , cb ) ;
2854
+ } else {
2855
+ return this . send ( command , optionsOrCb ) ;
2856
+ }
2857
+ }
2858
+
2859
+ /**
2860
+ * This example operation serializes a payload targeting a blob.
2861
+ *
2862
+ * The Blob shape is not structured content and we cannot
2863
+ * make assumptions about what data will be sent. This test ensures
2864
+ * only a generic "Content-Type: application/octet-stream" header
2865
+ * is used, and that we are not treating an empty body as an
2866
+ * empty JSON document.
2867
+ *
2868
+ */
2869
+ public testPayloadBlob (
2870
+ args : TestPayloadBlobCommandInput ,
2871
+ options ?: __HttpHandlerOptions
2872
+ ) : Promise < TestPayloadBlobCommandOutput > ;
2873
+ public testPayloadBlob (
2874
+ args : TestPayloadBlobCommandInput ,
2875
+ cb : ( err : any , data ?: TestPayloadBlobCommandOutput ) => void
2876
+ ) : void ;
2877
+ public testPayloadBlob (
2878
+ args : TestPayloadBlobCommandInput ,
2879
+ options : __HttpHandlerOptions ,
2880
+ cb : ( err : any , data ?: TestPayloadBlobCommandOutput ) => void
2881
+ ) : void ;
2882
+ public testPayloadBlob (
2883
+ args : TestPayloadBlobCommandInput ,
2884
+ optionsOrCb ?: __HttpHandlerOptions | ( ( err : any , data ?: TestPayloadBlobCommandOutput ) => void ) ,
2885
+ cb ?: ( err : any , data ?: TestPayloadBlobCommandOutput ) => void
2886
+ ) : Promise < TestPayloadBlobCommandOutput > | void {
2887
+ const command = new TestPayloadBlobCommand ( args ) ;
2888
+ if ( typeof optionsOrCb === "function" ) {
2889
+ this . send ( command , optionsOrCb ) ;
2890
+ } else if ( typeof cb === "function" ) {
2891
+ if ( typeof optionsOrCb !== "object" ) throw new Error ( `Expect http options but get ${ typeof optionsOrCb } ` ) ;
2892
+ this . send ( command , optionsOrCb || { } , cb ) ;
2893
+ } else {
2894
+ return this . send ( command , optionsOrCb ) ;
2895
+ }
2896
+ }
2897
+
2898
+ /**
2899
+ * This example operation serializes a payload targeting a structure.
2900
+ *
2901
+ * This enforces the same requirements as TestBodyStructure
2902
+ * but with the body specified by the @httpPayload trait.
2903
+ *
2904
+ */
2905
+ public testPayloadStructure (
2906
+ args : TestPayloadStructureCommandInput ,
2907
+ options ?: __HttpHandlerOptions
2908
+ ) : Promise < TestPayloadStructureCommandOutput > ;
2909
+ public testPayloadStructure (
2910
+ args : TestPayloadStructureCommandInput ,
2911
+ cb : ( err : any , data ?: TestPayloadStructureCommandOutput ) => void
2912
+ ) : void ;
2913
+ public testPayloadStructure (
2914
+ args : TestPayloadStructureCommandInput ,
2915
+ options : __HttpHandlerOptions ,
2916
+ cb : ( err : any , data ?: TestPayloadStructureCommandOutput ) => void
2917
+ ) : void ;
2918
+ public testPayloadStructure (
2919
+ args : TestPayloadStructureCommandInput ,
2920
+ optionsOrCb ?: __HttpHandlerOptions | ( ( err : any , data ?: TestPayloadStructureCommandOutput ) => void ) ,
2921
+ cb ?: ( err : any , data ?: TestPayloadStructureCommandOutput ) => void
2922
+ ) : Promise < TestPayloadStructureCommandOutput > | void {
2923
+ const command = new TestPayloadStructureCommand ( args ) ;
2924
+ if ( typeof optionsOrCb === "function" ) {
2925
+ this . send ( command , optionsOrCb ) ;
2926
+ } else if ( typeof cb === "function" ) {
2927
+ if ( typeof optionsOrCb !== "object" ) throw new Error ( `Expect http options but get ${ typeof optionsOrCb } ` ) ;
2928
+ this . send ( command , optionsOrCb || { } , cb ) ;
2929
+ } else {
2930
+ return this . send ( command , optionsOrCb ) ;
2931
+ }
2932
+ }
2933
+
2765
2934
/**
2766
2935
* This example tests how timestamp request and response headers are serialized.
2767
2936
*/
0 commit comments