github.com/aavshr/aws-sdk-go@v1.41.3/models/protocol_tests/output/rest-xml.json (about) 1 [ 2 { 3 "description": "Scalar members", 4 "metadata": { 5 "protocol": "rest-xml" 6 }, 7 "shapes": { 8 "OutputShape": { 9 "type": "structure", 10 "members": { 11 "ImaHeader": { 12 "shape": "HeaderShape" 13 }, 14 "ImaHeaderLocation": { 15 "shape": "HeaderShape", 16 "locationName": "X-Foo" 17 }, 18 "Str": { 19 "shape": "StringType" 20 }, 21 "Num": { 22 "shape": "IntegerType", 23 "locationName": "FooNum" 24 }, 25 "FalseBool": { 26 "shape": "BooleanType" 27 }, 28 "TrueBool": { 29 "shape": "BooleanType" 30 }, 31 "Float": { 32 "shape": "FloatType" 33 }, 34 "Double": { 35 "shape": "DoubleType" 36 }, 37 "Long": { 38 "shape": "LongType" 39 }, 40 "Char": { 41 "shape": "CharType" 42 }, 43 "Timestamp": { 44 "shape": "TimestampType" 45 }, 46 "BlobHeader": { 47 "shape": "BlobType", 48 "location": "header" 49 }, 50 "Blob": { 51 "shape": "BlobType" 52 } 53 } 54 }, 55 "StringType": { 56 "type": "string" 57 }, 58 "IntegerType": { 59 "type": "integer" 60 }, 61 "BooleanType": { 62 "type": "boolean" 63 }, 64 "FloatType": { 65 "type": "float" 66 }, 67 "DoubleType": { 68 "type": "double" 69 }, 70 "LongType": { 71 "type": "long" 72 }, 73 "CharType": { 74 "type": "character" 75 }, 76 "HeaderShape": { 77 "type": "string", 78 "location": "header" 79 }, 80 "StatusShape": { 81 "type": "integer", 82 "location": "statusCode" 83 }, 84 "TimestampType": { 85 "type": "timestamp" 86 }, 87 "BlobType": { 88 "type": "blob" 89 } 90 }, 91 "cases": [ 92 { 93 "given": { 94 "output": { 95 "shape": "OutputShape" 96 }, 97 "name": "OperationName" 98 }, 99 "result": { 100 "ImaHeader": "test", 101 "ImaHeaderLocation": "abc", 102 "Str": "myname", 103 "Num": 123, 104 "FalseBool": false, 105 "TrueBool": true, 106 "Float": 1.2, 107 "Double": 1.3, 108 "Long": 200, 109 "Char": "a", 110 "Timestamp": 1422172800, 111 "BlobHeader": "hello", 112 "Blob": "hello" 113 }, 114 "response": { 115 "status_code": 200, 116 "headers": { 117 "ImaHeader": "test", 118 "BlobHeader": "aGVsbG8=", 119 "X-Foo": "abc" 120 }, 121 "body": "<OperationNameResponse><Str>myname</Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp><Blob>aGVsbG8=</Blob></OperationNameResponse>" 122 } 123 }, 124 { 125 "given": { 126 "output": { 127 "shape": "OutputShape" 128 }, 129 "name": "OperationName" 130 }, 131 "result": { 132 "ImaHeader": "test", 133 "ImaHeaderLocation": "abc", 134 "Str": "", 135 "Num": 123, 136 "FalseBool": false, 137 "TrueBool": true, 138 "Float": 1.2, 139 "Double": 1.3, 140 "Long": 200, 141 "Char": "a", 142 "Timestamp": 1422172800 143 }, 144 "response": { 145 "status_code": 200, 146 "headers": { 147 "ImaHeader": "test", 148 "X-Foo": "abc" 149 }, 150 "body": "<OperationNameResponse><Str></Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp></OperationNameResponse>" 151 } 152 } 153 ] 154 }, 155 { 156 "description": "Blob", 157 "metadata": { 158 "protocol": "rest-xml" 159 }, 160 "shapes": { 161 "OutputShape": { 162 "type": "structure", 163 "members": { 164 "Blob": { 165 "shape": "BlobType" 166 } 167 } 168 }, 169 "BlobType": { 170 "type": "blob" 171 } 172 }, 173 "cases": [ 174 { 175 "given": { 176 "output": { 177 "shape": "OutputShape" 178 }, 179 "name": "OperationName" 180 }, 181 "result": { 182 "Blob": "value" 183 }, 184 "response": { 185 "status_code": 200, 186 "headers": {}, 187 "body": "<OperationNameResult><Blob>dmFsdWU=</Blob></OperationNameResult>" 188 } 189 } 190 ] 191 }, 192 { 193 "description": "Lists", 194 "metadata": { 195 "protocol": "rest-xml" 196 }, 197 "shapes": { 198 "OutputShape": { 199 "type": "structure", 200 "members": { 201 "ListMember": { 202 "shape": "ListShape" 203 } 204 } 205 }, 206 "ListShape": { 207 "type": "list", 208 "member": { 209 "shape": "StringType" 210 } 211 }, 212 "StringType": { 213 "type": "string" 214 } 215 }, 216 "cases": [ 217 { 218 "given": { 219 "output": { 220 "shape": "OutputShape" 221 }, 222 "name": "OperationName" 223 }, 224 "result": { 225 "ListMember": ["abc", "123"] 226 }, 227 "response": { 228 "status_code": 200, 229 "headers": {}, 230 "body": "<OperationNameResult><ListMember><member>abc</member><member>123</member></ListMember></OperationNameResult>" 231 } 232 } 233 ] 234 }, 235 { 236 "description": "List with custom member name", 237 "metadata": { 238 "protocol": "rest-xml" 239 }, 240 "shapes": { 241 "OutputShape": { 242 "type": "structure", 243 "members": { 244 "ListMember": { 245 "shape": "ListShape" 246 } 247 } 248 }, 249 "ListShape": { 250 "type": "list", 251 "member": { 252 "shape": "StringType", 253 "locationName": "item" 254 } 255 }, 256 "StringType": { 257 "type": "string" 258 } 259 }, 260 "cases": [ 261 { 262 "given": { 263 "output": { 264 "shape": "OutputShape" 265 }, 266 "name": "OperationName" 267 }, 268 "result": { 269 "ListMember": ["abc", "123"] 270 }, 271 "response": { 272 "status_code": 200, 273 "headers": {}, 274 "body": "<OperationNameResult><ListMember><item>abc</item><item>123</item></ListMember></OperationNameResult>" 275 } 276 } 277 ] 278 }, 279 { 280 "description": "Flattened List", 281 "metadata": { 282 "protocol": "rest-xml" 283 }, 284 "shapes": { 285 "OutputShape": { 286 "type": "structure", 287 "members": { 288 "ListMember": { 289 "shape": "StringList", 290 "flattened": true 291 } 292 } 293 }, 294 "StringList": { 295 "type": "list", 296 "member": { 297 "shape": "StringType" 298 } 299 }, 300 "StringType": { 301 "type": "string" 302 } 303 }, 304 "cases": [ 305 { 306 "given": { 307 "output": { 308 "shape": "OutputShape" 309 }, 310 "name": "OperationName" 311 }, 312 "result": { 313 "ListMember": ["abc", "123"] 314 }, 315 "response": { 316 "status_code": 200, 317 "headers": {}, 318 "body": "<OperationNameResult><ListMember>abc</ListMember><ListMember>123</ListMember></OperationNameResult>" 319 } 320 } 321 ] 322 }, 323 { 324 "description": "Normal map", 325 "metadata": { 326 "protocol": "rest-xml" 327 }, 328 "shapes": { 329 "OutputShape": { 330 "type": "structure", 331 "members": { 332 "Map": { 333 "shape": "StringMap" 334 } 335 } 336 }, 337 "StringMap": { 338 "type": "map", 339 "key": { 340 "shape": "StringType" 341 }, 342 "value": { 343 "shape": "SingleStructure" 344 } 345 }, 346 "SingleStructure": { 347 "type": "structure", 348 "members": { 349 "foo": { 350 "shape": "StringType" 351 } 352 } 353 }, 354 "StringType": { 355 "type": "string" 356 } 357 }, 358 "cases": [ 359 { 360 "given": { 361 "output": { 362 "shape": "OutputShape" 363 }, 364 "name": "OperationName" 365 }, 366 "result": { 367 "Map": { 368 "qux": { 369 "foo": "bar" 370 }, 371 "baz": { 372 "foo": "bam" 373 } 374 } 375 }, 376 "response": { 377 "status_code": 200, 378 "headers": {}, 379 "body": "<OperationNameResult><Map><entry><key>qux</key><value><foo>bar</foo></value></entry><entry><key>baz</key><value><foo>bam</foo></value></entry></Map></OperationNameResult>" 380 } 381 } 382 ] 383 }, 384 { 385 "description": "Flattened map", 386 "metadata": { 387 "protocol": "rest-xml" 388 }, 389 "shapes": { 390 "OutputShape": { 391 "type": "structure", 392 "members": { 393 "Map": { 394 "shape": "StringMap", 395 "flattened": true 396 } 397 } 398 }, 399 "StringMap": { 400 "type": "map", 401 "key": { 402 "shape": "StringType" 403 }, 404 "value": { 405 "shape": "StringType" 406 } 407 }, 408 "StringType": { 409 "type": "string" 410 } 411 }, 412 "cases": [ 413 { 414 "given": { 415 "output": { 416 "shape": "OutputShape" 417 }, 418 "name": "OperationName" 419 }, 420 "result": { 421 "Map": { 422 "qux": "bar", 423 "baz": "bam" 424 } 425 }, 426 "response": { 427 "status_code": 200, 428 "headers": {}, 429 "body": "<OperationNameResult><Map><key>qux</key><value>bar</value></Map><Map><key>baz</key><value>bam</value></Map></OperationNameResult>" 430 } 431 } 432 ] 433 }, 434 { 435 "description": "Named map", 436 "metadata": { 437 "protocol": "rest-xml" 438 }, 439 "shapes": { 440 "OutputShape": { 441 "type": "structure", 442 "members": { 443 "Map": { 444 "shape": "StringMap" 445 } 446 } 447 }, 448 "StringMap": { 449 "type": "map", 450 "key": { 451 "shape": "StringType", 452 "locationName": "foo" 453 }, 454 "value": { 455 "shape": "StringType", 456 "locationName": "bar" 457 } 458 }, 459 "StringType": { 460 "type": "string" 461 } 462 }, 463 "cases": [ 464 { 465 "given": { 466 "output": { 467 "shape": "OutputShape" 468 }, 469 "name": "OperationName" 470 }, 471 "result": { 472 "Map": { 473 "qux": "bar", 474 "baz": "bam" 475 } 476 }, 477 "response": { 478 "status_code": 200, 479 "headers": {}, 480 "body": "<OperationNameResult><Map><entry><foo>qux</foo><bar>bar</bar></entry><entry><foo>baz</foo><bar>bam</bar></entry></Map></OperationNameResult>" 481 } 482 } 483 ] 484 }, 485 { 486 "description": "XML payload", 487 "metadata": { 488 "protocol": "rest-xml" 489 }, 490 "shapes": { 491 "OutputShape": { 492 "type": "structure", 493 "payload": "Data", 494 "members": { 495 "Header": { 496 "shape": "StringType", 497 "location": "header", 498 "locationName": "X-Foo" 499 }, 500 "Data": { 501 "shape": "SingleStructure" 502 } 503 } 504 }, 505 "StringType": { 506 "type": "string" 507 }, 508 "SingleStructure": { 509 "type": "structure", 510 "members": { 511 "Foo": { 512 "shape": "StringType" 513 } 514 } 515 } 516 }, 517 "cases": [ 518 { 519 "given": { 520 "output": { 521 "shape": "OutputShape" 522 }, 523 "name": "OperationName" 524 }, 525 "result": { 526 "Header": "baz", 527 "Data": { 528 "Foo": "abc" 529 } 530 }, 531 "response": { 532 "status_code": 200, 533 "headers": { 534 "X-Foo": "baz" 535 }, 536 "body": "<OperationNameResponse><Foo>abc</Foo></OperationNameResponse>" 537 } 538 } 539 ] 540 }, 541 { 542 "description": "Streaming payload", 543 "metadata": { 544 "protocol": "rest-xml" 545 }, 546 "shapes": { 547 "OutputShape": { 548 "type": "structure", 549 "payload": "Stream", 550 "members": { 551 "Stream": { 552 "shape": "BlobStream" 553 } 554 } 555 }, 556 "BlobStream": { 557 "type": "blob" 558 } 559 }, 560 "cases": [ 561 { 562 "given": { 563 "output": { 564 "shape": "OutputShape" 565 }, 566 "name": "OperationName" 567 }, 568 "result": { 569 "Stream": "abc" 570 }, 571 "response": { 572 "status_code": 200, 573 "headers": {}, 574 "body": "abc" 575 } 576 } 577 ] 578 }, 579 { 580 "description": "Scalar members in headers", 581 "metadata": { 582 "protocol": "rest-xml" 583 }, 584 "shapes": { 585 "OutputShape": { 586 "type": "structure", 587 "members": { 588 "Str": { 589 "locationName": "x-str", 590 "shape": "StringHeaderType" 591 }, 592 "Integer": { 593 "locationName": "x-int", 594 "shape": "IntegerHeaderType" 595 }, 596 "TrueBool": { 597 "locationName": "x-true-bool", 598 "shape": "BooleanHeaderType" 599 }, 600 "FalseBool": { 601 "locationName": "x-false-bool", 602 "shape": "BooleanHeaderType" 603 }, 604 "Float": { 605 "locationName": "x-float", 606 "shape": "FloatHeaderType" 607 }, 608 "Double": { 609 "locationName": "x-double", 610 "shape": "DoubleHeaderType" 611 }, 612 "Long": { 613 "locationName": "x-long", 614 "shape": "LongHeaderType" 615 }, 616 "Char": { 617 "locationName": "x-char", 618 "shape": "CharHeaderType" 619 }, 620 "Timestamp": { 621 "locationName": "x-timestamp", 622 "shape": "TimestampHeaderType" 623 } 624 } 625 }, 626 "StringHeaderType": { 627 "location": "header", 628 "type": "string" 629 }, 630 "IntegerHeaderType": { 631 "location": "header", 632 "type": "integer" 633 }, 634 "BooleanHeaderType": { 635 "location": "header", 636 "type": "boolean" 637 }, 638 "FloatHeaderType": { 639 "location": "header", 640 "type": "float" 641 }, 642 "DoubleHeaderType": { 643 "location": "header", 644 "type": "double" 645 }, 646 "LongHeaderType": { 647 "location": "header", 648 "type": "long" 649 }, 650 "CharHeaderType": { 651 "location": "header", 652 "type": "character" 653 }, 654 "TimestampHeaderType": { 655 "location": "header", 656 "type": "timestamp" 657 } 658 }, 659 "cases": [ 660 { 661 "given": { 662 "output": { 663 "shape": "OutputShape" 664 }, 665 "name": "OperationName" 666 }, 667 "result": { 668 "Str": "string", 669 "Integer": 1, 670 "TrueBool": true, 671 "FalseBool": false, 672 "Float": 1.5, 673 "Double": 1.5, 674 "Long": 100, 675 "Char": "a", 676 "Timestamp": 1422172800 677 }, 678 "response": { 679 "status_code": 200, 680 "headers": { 681 "x-str": "string", 682 "x-int": "1", 683 "x-true-bool": "true", 684 "x-false-bool": "false", 685 "x-float": "1.5", 686 "x-double": "1.5", 687 "x-long": "100", 688 "x-char": "a", 689 "x-timestamp": "Sun, 25 Jan 2015 08:00:00 GMT" 690 }, 691 "body": "" 692 } 693 } 694 ] 695 }, 696 { 697 "description": "Empty string", 698 "metadata": { 699 "protocol": "rest-xml" 700 }, 701 "shapes": { 702 "OutputShape": { 703 "type": "structure", 704 "members": { 705 "Foo": { 706 "shape": "StringType" 707 } 708 } 709 }, 710 "StringType": { 711 "type": "string" 712 } 713 }, 714 "cases": [ 715 { 716 "given": { 717 "output": { 718 "shape": "OutputShape" 719 }, 720 "name": "OperationName" 721 }, 722 "result": { 723 "Foo": "" 724 }, 725 "response": { 726 "status_code": 200, 727 "headers": {}, 728 "body": "<OperationNameResponse><Foo/><RequestId>requestid</RequestId></OperationNameResponse>" 729 } 730 } 731 ] 732 }, 733 { 734 "description": "Timestamp members", 735 "metadata": { 736 "protocol": "rest-xml" 737 }, 738 "shapes": { 739 "OutputShape": { 740 "type": "structure", 741 "members": { 742 "TimeArg": { 743 "shape": "TimestampType" 744 }, 745 "TimeArgInHeader": { 746 "shape": "TimestampType", 747 "location": "header", 748 "locationName": "x-amz-timearg" 749 }, 750 "TimeCustom": { 751 "timestampFormat": "rfc822", 752 "shape": "TimestampType" 753 }, 754 "TimeCustomInHeader": { 755 "timestampFormat": "unixTimestamp", 756 "shape": "TimestampType", 757 "location": "header", 758 "locationName": "x-amz-timecustom" 759 }, 760 "TimeFormat": { 761 "shape": "TimestampFormatType" 762 }, 763 "TimeFormatInHeader": { 764 "shape": "TimestampFormatType", 765 "location": "header", 766 "locationName": "x-amz-timeformat" 767 }, 768 "StructMember": { 769 "shape": "TimeContainer" 770 } 771 } 772 }, 773 "TimeContainer": { 774 "type": "structure", 775 "members": { 776 "foo": { 777 "shape": "TimestampType" 778 }, 779 "bar": { 780 "shape": "TimestampFormatType" 781 } 782 } 783 }, 784 "TimestampFormatType": { 785 "timestampFormat": "unixTimestamp", 786 "type": "timestamp" 787 }, 788 "TimestampType": { 789 "type": "timestamp" 790 } 791 }, 792 "cases": [ 793 { 794 "given": { 795 "output": { 796 "shape": "OutputShape" 797 }, 798 "name": "OperationName" 799 }, 800 "result": { 801 "TimeArg": 1398796238, 802 "TimeArgInHeader": 1398796238, 803 "TimeCustom": 1398796238, 804 "TimeCustomInHeader": 1398796238, 805 "TimeFormat": 1398796238, 806 "TimeFormatInHeader": 1398796238, 807 "StructMember": { 808 "foo": 1398796238, 809 "bar": 1398796238 810 } 811 }, 812 "response": { 813 "status_code": 200, 814 "headers": { 815 "x-amz-timearg": "Tue, 29 Apr 2014 18:30:38 GMT", 816 "x-amz-timecustom": "1398796238", 817 "x-amz-timeformat": "1398796238" 818 }, 819 "body": "<OperationNameResponse><StructMember><foo>2014-04-29T18:30:38Z</foo><bar>1398796238</bar></StructMember><TimeArg>2014-04-29T18:30:38Z</TimeArg><TimeCustom>Tue, 29 Apr 2014 18:30:38 GMT</TimeCustom><TimeFormat>1398796238</TimeFormat><RequestId>requestid</RequestId></OperationNameResponse>" 820 } 821 } 822 ] 823 }, 824 { 825 "description": "Enum", 826 "metadata": { 827 "protocol": "rest-xml" 828 }, 829 "shapes": { 830 "OutputShape": { 831 "type": "structure", 832 "members": { 833 "HeaderEnum": { 834 "shape": "RESTJSONEnumType", 835 "location": "header", 836 "locationName": "x-amz-enum" 837 }, 838 "FooEnum": { 839 "shape": "RESTJSONEnumType" 840 }, 841 "ListEnums": { 842 "shape": "EnumList" 843 } 844 } 845 }, 846 "RESTJSONEnumType":{ 847 "type":"string", 848 "enum":[ 849 "foo", 850 "bar", 851 "0", 852 "1" 853 ] 854 }, 855 "EnumList":{ 856 "type":"list", 857 "member": {"shape": "RESTJSONEnumType"} 858 } 859 }, 860 "cases": [ 861 { 862 "given": { 863 "output": { 864 "shape": "OutputShape" 865 }, 866 "http": { 867 "method": "POST", 868 "requestUri": "/path" 869 }, 870 "name": "OperationName" 871 }, 872 "result": { 873 "HeaderEnum": "baz", 874 "FooEnum": "foo", 875 "ListEnums": ["0", "1"] 876 }, 877 "response": { 878 "status_code": 200, 879 "headers": {"x-amz-enum": "baz"}, 880 "body": "<OperationNameResponse><FooEnum>foo</FooEnum><ListEnums><member>0</member><member>1</member></ListEnums></OperationNameResponse>" 881 } 882 }, 883 { 884 "given": { 885 "input": { 886 "shape": "OutputShape" 887 }, 888 "http": { 889 "method": "POST", 890 "requestUri": "/path" 891 }, 892 "name": "OperationName" 893 }, 894 "result": { 895 }, 896 "response": { 897 "status_code": 200, 898 "headers": {} 899 } 900 } 901 ] 902 }, 903 { 904 "description": "XML Attributes", 905 "metadata": { 906 "protocol": "rest-xml" 907 }, 908 "shapes": { 909 "OutputShape":{ 910 "type":"structure", 911 "members":{ 912 "ListItems":{ 913 "shape":"ListItemsShape", 914 "locationName":"ItemsList" 915 } 916 } 917 }, 918 "ListItemsShape":{ 919 "type":"list", 920 "member":{ 921 "shape":"ItemShape", 922 "locationName":"Item" 923 } 924 }, 925 "ItemShape":{ 926 "type":"structure", 927 "members":{ 928 "ItemDetail":{"shape":"ItemDetailShape"} 929 } 930 }, 931 "ItemDetailShape":{ 932 "type":"structure", 933 "required":["Type"], 934 "members":{ 935 "ID":{"shape":"StringShape"}, 936 "Type":{ 937 "shape":"ItemType", 938 "locationName":"xsi:type", 939 "xmlAttribute":true 940 } 941 }, 942 "xmlNamespace":{ 943 "prefix":"xsi", 944 "uri":"http://www.w3.org/2001/XMLSchema-instance" 945 } 946 }, 947 "StringShape":{ 948 "type":"string" 949 }, 950 "ItemType":{ 951 "type":"string", 952 "enum":[ 953 "Type1", 954 "Type2", 955 "Type3" 956 ] 957 } 958 }, 959 "cases": [ 960 { 961 "given": { 962 "output": { 963 "shape": "OutputShape" 964 }, 965 "http": { 966 "method": "GET", 967 "requestUri": "/path" 968 }, 969 "name": "OperationName" 970 }, 971 "result": { 972 "ListItems": [ 973 {"ItemDetail": {"ID": "id1", "Type": "Type1"}}, 974 {"ItemDetail": {"ID": "id2", "Type": "Type2"}}, 975 {"ItemDetail": {"ID": "id3", "Type": "Type3"}} 976 ] 977 }, 978 "response": { 979 "status_code": 200, 980 "body": "<SomeOutputDoc xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><ItemsList><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type1\"><ID>id1</ID></ItemDetail></Item><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type2\"><ID>id2</ID></ItemDetail></Item><Item><ItemDetail xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"Type3\"><ID>id3</ID></ItemDetail></Item></ItemsList></SomeOutputDoc>" 981 } 982 } 983 ] 984 } 985 ]