github.com/aavshr/aws-sdk-go@v1.41.3/models/protocol_tests/output/rest-json.json (about) 1 [ 2 { 3 "description": "Scalar members", 4 "metadata": { 5 "protocol": "rest-json" 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 "Status": { 19 "shape": "StatusShape", 20 "location": "statusCode" 21 }, 22 "Str": { 23 "shape": "StringType" 24 }, 25 "Num": { 26 "shape": "IntegerType" 27 }, 28 "FalseBool": { 29 "shape": "BooleanType" 30 }, 31 "TrueBool": { 32 "shape": "BooleanType" 33 }, 34 "Float": { 35 "shape": "FloatType" 36 }, 37 "Double": { 38 "shape": "DoubleType" 39 }, 40 "Long": { 41 "shape": "LongType" 42 }, 43 "Char": { 44 "shape": "CharType" 45 }, 46 "Timestamp": { 47 "shape": "TimestampType" 48 }, 49 "BlobHeader": { 50 "shape": "BlobType", 51 "location": "header" 52 }, 53 "Blob": { 54 "shape": "BlobType" 55 } 56 } 57 }, 58 "HeaderShape": { 59 "type": "string", 60 "location": "header" 61 }, 62 "StatusShape": { 63 "type": "integer" 64 }, 65 "StringType": { 66 "type": "string" 67 }, 68 "IntegerType": { 69 "type": "integer" 70 }, 71 "BooleanType": { 72 "type": "boolean" 73 }, 74 "FloatType": { 75 "type": "float" 76 }, 77 "DoubleType": { 78 "type": "double" 79 }, 80 "LongType": { 81 "type": "long" 82 }, 83 "CharType": { 84 "type": "character" 85 }, 86 "TimestampType": { 87 "type": "timestamp" 88 }, 89 "BlobType": { 90 "type": "blob" 91 } 92 }, 93 "cases": [ 94 { 95 "given": { 96 "output": { 97 "shape": "OutputShape" 98 }, 99 "name": "OperationName" 100 }, 101 "result": { 102 "ImaHeader": "test", 103 "ImaHeaderLocation": "abc", 104 "Status": 200, 105 "Str": "myname", 106 "Num": 123, 107 "FalseBool": false, 108 "TrueBool": true, 109 "Float": 1.2, 110 "Double": 1.3, 111 "Long": 200, 112 "Char": "a", 113 "Timestamp": 1422172800, 114 "BlobHeader": "hello", 115 "Blob": "hello" 116 }, 117 "response": { 118 "status_code": 200, 119 "headers": { 120 "ImaHeader": "test", 121 "BlobHeader": "aGVsbG8=", 122 "X-Foo": "abc" 123 }, 124 "body": "{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\", \"Timestamp\": \"2015-01-25T08:00:00Z\", \"Blob\": \"aGVsbG8=\"}" 125 } 126 } 127 ] 128 }, 129 { 130 "description": "Blob members", 131 "metadata": { 132 "protocol": "rest-json" 133 }, 134 "shapes": { 135 "OutputShape": { 136 "type": "structure", 137 "members": { 138 "BlobMember": { 139 "shape": "BlobType" 140 }, 141 "StructMember": { 142 "shape": "BlobContainer" 143 } 144 } 145 }, 146 "BlobType": { 147 "type": "blob" 148 }, 149 "BlobContainer": { 150 "type": "structure", 151 "members": { 152 "foo": { 153 "shape": "BlobType" 154 } 155 } 156 } 157 }, 158 "cases": [ 159 { 160 "given": { 161 "output": { 162 "shape": "OutputShape" 163 }, 164 "name": "OperationName" 165 }, 166 "result": { 167 "BlobMember": "hi!", 168 "StructMember": { 169 "foo": "there!" 170 } 171 }, 172 "response": { 173 "status_code": 200, 174 "headers": {}, 175 "body": "{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}" 176 } 177 } 178 ] 179 }, 180 { 181 "description": "Timestamp members", 182 "metadata": { 183 "protocol": "rest-json" 184 }, 185 "shapes": { 186 "OutputShape": { 187 "type": "structure", 188 "members": { 189 "TimeArg": { 190 "shape": "TimestampType" 191 }, 192 "TimeArgInHeader": { 193 "shape": "TimestampType", 194 "location": "header", 195 "locationName": "x-amz-timearg" 196 }, 197 "TimeCustom": { 198 "timestampFormat": "rfc822", 199 "shape": "TimestampType" 200 }, 201 "TimeCustomInHeader": { 202 "timestampFormat": "unixTimestamp", 203 "shape": "TimestampType", 204 "location": "header", 205 "locationName": "x-amz-timecustom" 206 }, 207 "TimeFormat": { 208 "shape": "TimestampFormatType" 209 }, 210 "TimeFormatInHeader": { 211 "shape": "TimestampFormatType", 212 "location": "header", 213 "locationName": "x-amz-timeformat" 214 }, 215 "StructMember": { 216 "shape": "TimeContainer" 217 } 218 } 219 }, 220 "TimeContainer": { 221 "type": "structure", 222 "members": { 223 "foo": { 224 "shape": "TimestampType" 225 }, 226 "bar": { 227 "shape": "TimestampFormatType" 228 } 229 } 230 }, 231 "TimestampFormatType": { 232 "timestampFormat": "iso8601", 233 "type": "timestamp" 234 }, 235 "TimestampType": { 236 "type": "timestamp" 237 } 238 }, 239 "cases": [ 240 { 241 "given": { 242 "output": { 243 "shape": "OutputShape" 244 }, 245 "name": "OperationName" 246 }, 247 "result": { 248 "TimeArg": 1398796238, 249 "TimeArgInHeader": 1398796238, 250 "TimeCustom": 1398796238, 251 "TimeCustomInHeader": 1398796238, 252 "TimeFormat": 1398796238, 253 "TimeFormatInHeader": 1398796238, 254 "StructMember": { 255 "foo": 1398796238, 256 "bar": 1398796238 257 } 258 }, 259 "response": { 260 "status_code": 200, 261 "headers": { 262 "x-amz-timearg": "Tue, 29 Apr 2014 18:30:38 GMT", 263 "x-amz-timecustom": "1398796238", 264 "x-amz-timeformat": "2014-04-29T18:30:38Z" 265 }, 266 "body": "{\"TimeArg\": 1398796238, \"TimeCustom\": \"Tue, 29 Apr 2014 18:30:38 GMT\", \"TimeFormat\": \"2014-04-29T18:30:38Z\", \"StructMember\": {\"foo\": 1398796238, \"bar\": \"2014-04-29T18:30:38Z\"}}" 267 } 268 } 269 ] 270 }, 271 { 272 "description": "Lists", 273 "metadata": { 274 "protocol": "rest-json" 275 }, 276 "shapes": { 277 "OutputShape": { 278 "type": "structure", 279 "members": { 280 "ListMember": { 281 "shape": "ListType" 282 } 283 } 284 }, 285 "ListType": { 286 "type": "list", 287 "member": { 288 "shape": "StringType" 289 } 290 }, 291 "StringType": { 292 "type": "string" 293 } 294 }, 295 "cases": [ 296 { 297 "given": { 298 "output": { 299 "shape": "OutputShape" 300 }, 301 "name": "OperationName" 302 }, 303 "result": { 304 "ListMember": ["a", "b"] 305 }, 306 "response": { 307 "status_code": 200, 308 "headers": {}, 309 "body": "{\"ListMember\": [\"a\", \"b\"]}" 310 } 311 } 312 ] 313 }, 314 { 315 "description": "Lists with structure member", 316 "metadata": { 317 "protocol": "rest-json" 318 }, 319 "shapes": { 320 "OutputShape": { 321 "type": "structure", 322 "members": { 323 "ListMember": { 324 "shape": "ListType" 325 } 326 } 327 }, 328 "ListType": { 329 "type": "list", 330 "member": { 331 "shape": "SingleStruct" 332 } 333 }, 334 "StringType": { 335 "type": "string" 336 }, 337 "SingleStruct": { 338 "type": "structure", 339 "members": { 340 "Foo": { 341 "shape": "StringType" 342 } 343 } 344 } 345 }, 346 "cases": [ 347 { 348 "given": { 349 "output": { 350 "shape": "OutputShape" 351 }, 352 "name": "OperationName" 353 }, 354 "result": { 355 "ListMember": [{"Foo": "a"}, {"Foo": "b"}] 356 }, 357 "response": { 358 "status_code": 200, 359 "headers": {}, 360 "body": "{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}" 361 } 362 } 363 ] 364 }, 365 { 366 "description": "Maps", 367 "metadata": { 368 "protocol": "rest-json" 369 }, 370 "shapes": { 371 "OutputShape": { 372 "type": "structure", 373 "members": { 374 "MapMember": { 375 "shape": "MapType" 376 } 377 } 378 }, 379 "MapType": { 380 "type": "map", 381 "key": { 382 "shape": "StringType" 383 }, 384 "value": { 385 "shape": "ListType" 386 } 387 }, 388 "ListType": { 389 "type": "list", 390 "member": { 391 "shape": "IntegerType" 392 } 393 }, 394 "StringType": { 395 "type": "string" 396 }, 397 "IntegerType": { 398 "type": "integer" 399 } 400 }, 401 "cases": [ 402 { 403 "given": { 404 "output": { 405 "shape": "OutputShape" 406 }, 407 "name": "OperationName" 408 }, 409 "result": { 410 "MapMember": { 411 "a": [1, 2], 412 "b": [3, 4] 413 } 414 }, 415 "response": { 416 "status_code": 200, 417 "headers": {}, 418 "body": "{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}" 419 } 420 } 421 ] 422 }, 423 { 424 "description": "Complex Map Values", 425 "metadata": { 426 "protocol": "rest-json" 427 }, 428 "shapes": { 429 "OutputShape": { 430 "type": "structure", 431 "members": { 432 "MapMember": { 433 "shape": "MapType" 434 } 435 } 436 }, 437 "MapType": { 438 "type": "map", 439 "key": { 440 "shape": "StringType" 441 }, 442 "value": { 443 "shape": "TimeType" 444 } 445 }, 446 "TimeType": { 447 "type": "timestamp" 448 }, 449 "StringType": { 450 "type": "string" 451 } 452 }, 453 "cases": [ 454 { 455 "given": { 456 "output": { 457 "shape": "OutputShape" 458 }, 459 "name": "OperationName" 460 }, 461 "result": { 462 "MapMember": { 463 "a": 1398796238, 464 "b": 1398796238 465 } 466 }, 467 "response": { 468 "status_code": 200, 469 "headers": {}, 470 "body": "{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}" 471 } 472 } 473 ] 474 }, 475 { 476 "description": "Ignores extra data", 477 "metadata": { 478 "protocol": "rest-json" 479 }, 480 "shapes": { 481 "OutputShape": { 482 "type": "structure", 483 "members": { 484 "StrType": { 485 "shape": "StrType" 486 } 487 } 488 }, 489 "StrType": { 490 "type": "string" 491 } 492 }, 493 "cases": [ 494 { 495 "given": { 496 "output": { 497 "shape": "OutputShape" 498 }, 499 "name": "OperationName" 500 }, 501 "result": {}, 502 "response": { 503 "status_code": 200, 504 "headers": {}, 505 "body": "{\"foo\": \"bar\"}" 506 } 507 } 508 ] 509 }, 510 { 511 "description": "Ignores undefined output", 512 "metadata": { 513 "protocol": "rest-json" 514 }, 515 "shapes": {}, 516 "cases": [ 517 { 518 "given": { 519 "name": "OperationName" 520 }, 521 "result": {}, 522 "response": { 523 "status_code": 200, 524 "headers": {}, 525 "body": "OK" 526 } 527 } 528 ] 529 }, 530 { 531 "description": "Supports header maps", 532 "metadata": { 533 "protocol": "rest-json" 534 }, 535 "shapes": { 536 "OutputShape": { 537 "type": "structure", 538 "members": { 539 "AllHeaders": { 540 "shape": "HeaderMap", 541 "location": "headers" 542 }, 543 "PrefixedHeaders": { 544 "shape": "HeaderMap", 545 "location": "headers", 546 "locationName": "X-" 547 } 548 } 549 }, 550 "HeaderMap": { 551 "type": "map", 552 "key": { 553 "shape": "StringType" 554 }, 555 "value": { 556 "shape": "StringType" 557 } 558 }, 559 "StringType": { 560 "type": "string" 561 } 562 }, 563 "cases": [ 564 { 565 "given": { 566 "output": { 567 "shape": "OutputShape" 568 }, 569 "name": "OperationName" 570 }, 571 "result": { 572 "AllHeaders": { 573 "Content-Length": "10", 574 "X-Foo": "bar", 575 "X-Bam": "boo" 576 }, 577 "PrefixedHeaders": { 578 "Foo": "bar", 579 "Bam": "boo" 580 } 581 }, 582 "response": { 583 "status_code": 200, 584 "headers": { 585 "Content-Length": "10", 586 "X-Foo": "bar", 587 "X-Bam": "boo" 588 }, 589 "body": "{}" 590 } 591 } 592 ] 593 }, 594 { 595 "description": "JSON payload", 596 "metadata": { 597 "protocol": "rest-json" 598 }, 599 "shapes": { 600 "OutputShape": { 601 "type": "structure", 602 "payload": "Data", 603 "members": { 604 "Header": { 605 "shape": "StringType", 606 "location": "header", 607 "locationName": "X-Foo" 608 }, 609 "Data": { 610 "shape": "BodyStructure" 611 } 612 } 613 }, 614 "BodyStructure": { 615 "type": "structure", 616 "members": { 617 "Foo": { 618 "shape": "StringType" 619 } 620 } 621 }, 622 "StringType": { 623 "type": "string" 624 } 625 }, 626 "cases": [ 627 { 628 "given": { 629 "output": { 630 "shape": "OutputShape" 631 }, 632 "name": "OperationName" 633 }, 634 "result": { 635 "Header": "baz", 636 "Data": { 637 "Foo": "abc" 638 } 639 }, 640 "response": { 641 "status_code": 200, 642 "headers": { 643 "X-Foo": "baz" 644 }, 645 "body": "{\"Foo\": \"abc\"}" 646 } 647 } 648 ] 649 }, 650 { 651 "description": "Streaming payload", 652 "metadata": { 653 "protocol": "rest-json" 654 }, 655 "shapes": { 656 "OutputShape": { 657 "type": "structure", 658 "payload": "Stream", 659 "members": { 660 "Stream": { 661 "shape": "Stream" 662 } 663 } 664 }, 665 "Stream": { 666 "type": "blob" 667 } 668 }, 669 "cases": [ 670 { 671 "given": { 672 "output": { 673 "shape": "OutputShape" 674 }, 675 "name": "OperationName" 676 }, 677 "result": { 678 "Stream": "abc" 679 }, 680 "response": { 681 "status_code": 200, 682 "headers": {}, 683 "body": "abc" 684 } 685 } 686 ] 687 }, 688 { 689 "description": "JSON value trait", 690 "metadata": { 691 "protocol": "rest-json" 692 }, 693 "shapes": { 694 "OutputShape": { 695 "type": "structure", 696 "members": { 697 "HeaderField": { 698 "shape": "StringType", 699 "jsonvalue": true, 700 "location": "header", 701 "locationName": "X-Amz-Foo" 702 }, 703 "BodyField":{ 704 "shape": "StringType", 705 "jsonvalue": true 706 }, 707 "BodyListField": { 708 "shape": "ListType" 709 } 710 } 711 }, 712 "StringType": { 713 "type": "string" 714 }, 715 "ListType": { 716 "type": "list", 717 "member": { 718 "shape": "StringType", 719 "jsonvalue": true 720 } 721 } 722 }, 723 "cases": [ 724 { 725 "given": { 726 "output": { 727 "shape": "OutputShape" 728 }, 729 "name": "OperationName" 730 }, 731 "result": { 732 "HeaderField": {"Foo":"Bar"}, 733 "BodyField": {"Foo":"Bar"} 734 }, 735 "response": { 736 "status_code": 200, 737 "headers": {"X-Amz-Foo": "eyJGb28iOiJCYXIifQ=="}, 738 "body": "{\"BodyField\":\"{\\\"Foo\\\":\\\"Bar\\\"}\"}" 739 } 740 }, 741 { 742 "given": { 743 "output": { 744 "shape": "OutputShape" 745 }, 746 "name": "OperationName" 747 }, 748 "result": { 749 "BodyListField": [{"Foo":"Bar"}] 750 }, 751 "response": { 752 "status_code": 200, 753 "headers": {}, 754 "body": "{\"BodyListField\":[\"{\\\"Foo\\\":\\\"Bar\\\"}\"]}" 755 } 756 } 757 ] 758 }, 759 { 760 "description": "Enum", 761 "metadata": { 762 "protocol": "rest-json", 763 "apiVersion": "2014-01-01" 764 }, 765 "shapes": { 766 "OutputShape": { 767 "type": "structure", 768 "members": { 769 "HeaderEnum": { 770 "shape": "RESTJSONEnumType", 771 "location": "header", 772 "locationName": "x-amz-enum" 773 }, 774 "FooEnum": { 775 "shape": "RESTJSONEnumType" 776 }, 777 "ListEnums": { 778 "shape": "EnumList" 779 } 780 } 781 }, 782 "RESTJSONEnumType":{ 783 "type":"string", 784 "enum":[ 785 "foo", 786 "bar", 787 "0", 788 "1" 789 ] 790 }, 791 "EnumList":{ 792 "type":"list", 793 "member": {"shape": "RESTJSONEnumType"} 794 } 795 }, 796 "cases": [ 797 { 798 "given": { 799 "output": { 800 "shape": "OutputShape" 801 }, 802 "http": { 803 "method": "POST", 804 "requestUri": "/path" 805 }, 806 "name": "OperationName" 807 }, 808 "result": { 809 "HeaderEnum": "baz", 810 "FooEnum": "foo", 811 "ListEnums": ["foo", "bar"] 812 }, 813 "response": { 814 "status_code": 200, 815 "headers": {"x-amz-enum": "baz"}, 816 "body": "{\"FooEnum\": \"foo\", \"ListEnums\": [\"foo\", \"bar\"]}" 817 } 818 }, 819 { 820 "given": { 821 "input": { 822 "shape": "OutputShape" 823 }, 824 "http": { 825 "method": "POST", 826 "requestUri": "/path" 827 }, 828 "name": "OperationName" 829 }, 830 "result": { 831 }, 832 "response": { 833 "status_code": 200, 834 "headers": {} 835 } 836 } 837 ] 838 } 839 ]