[
  {
    "description": "Scalar members",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "ImaHeader": {
            "shape": "HeaderShape"
          },
          "ImaHeaderLocation": {
            "shape": "HeaderShape",
            "locationName": "X-Foo"
          },
          "Status": {
            "shape": "StatusShape",
            "location": "statusCode"
          },
          "Str": {
            "shape": "StringType"
          },
          "Num": {
            "shape": "IntegerType"
          },
          "FalseBool": {
            "shape": "BooleanType"
          },
          "TrueBool": {
            "shape": "BooleanType"
          },
          "Float": {
            "shape": "FloatType"
          },
          "Double": {
            "shape": "DoubleType"
          },
          "Long": {
            "shape": "LongType"
          },
          "Char": {
            "shape": "CharType"
          }
        }
      },
      "HeaderShape": {
        "type": "string",
        "location": "header"
      },
      "StatusShape": {
        "type": "integer"
      },
      "StringType": {
        "type": "string"
      },
      "IntegerType": {
        "type": "integer"
      },
      "BooleanType": {
        "type": "boolean"
      },
      "FloatType": {
        "type": "float"
      },
      "DoubleType": {
        "type": "double"
      },
      "LongType": {
        "type": "long"
      },
      "CharType": {
        "type": "character"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "ImaHeader": "test",
          "ImaHeaderLocation": "abc",
          "Status": 200,
          "Str": "myname",
          "Num": 123,
          "FalseBool": false,
          "TrueBool": true,
          "Float": 1.2,
          "Double": 1.3,
          "Long": 200,
          "Char": "a"
        },
        "response": {
          "status_code": 200,
          "headers": {
            "ImaHeader": "test",
            "X-Foo": "abc"
          },
          "body": "{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}"
        }
      }
    ]
  },
  {
    "description": "Blob members",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "BlobMember": {
            "shape": "BlobType"
          },
          "StructMember": {
            "shape": "BlobContainer"
          }
        }
      },
      "BlobType": {
        "type": "blob"
      },
      "BlobContainer": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "BlobType"
          }
        }
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "BlobMember": "hi!",
          "StructMember": {
            "foo": "there!"
          }
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}"
        }
      }
    ]
  },
  {
    "description": "Timestamp members",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "TimeMember": {
            "shape": "TimeType"
          },
          "StructMember": {
            "shape": "TimeContainer"
          }
        }
      },
      "TimeType": {
        "type": "timestamp"
      },
      "TimeContainer": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "TimeType"
          }
        }
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "TimeMember": 1398796238,
          "StructMember": {
            "foo": 1398796238
          }
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}"
        }
      }
    ]
  },
  {
    "description": "Lists",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "ListMember": {
            "shape": "ListType"
          }
        }
      },
      "ListType": {
        "type": "list",
        "member": {
          "shape": "StringType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "ListMember": ["a", "b"]
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"ListMember\": [\"a\", \"b\"]}"
        }
      }
    ]
  },
  {
    "description": "Lists with structure member",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "ListMember": {
            "shape": "ListType"
          }
        }
      },
      "ListType": {
        "type": "list",
        "member": {
          "shape": "SingleStruct"
        }
      },
      "StringType": {
        "type": "string"
      },
      "SingleStruct": {
        "type": "structure",
        "members": {
            "Foo": {
              "shape": "StringType"
            }
        }
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "ListMember": [{"Foo": "a"}, {"Foo": "b"}]
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}"
        }
      }
    ]
  },
  {
    "description": "Maps",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "MapMember": {
            "shape": "MapType"
          }
        }
      },
      "MapType": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "ListType"
        }
      },
      "ListType": {
        "type": "list",
        "member": {
          "shape": "IntegerType"
        }
      },
      "StringType": {
        "type": "string"
      },
      "IntegerType": {
        "type": "integer"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "MapMember": {
            "a": [1, 2],
            "b": [3, 4]
          }
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}"
        }
      }
    ]
  },
  {
    "description": "Complex Map Values",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "MapMember": {
            "shape": "MapType"
          }
        }
      },
      "MapType": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "TimeType"
        }
      },
      "TimeType": {
        "type": "timestamp"
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "MapMember": {
            "a": 1398796238,
            "b": 1398796238
          }
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}"
        }
      }
    ]
  },
  {
    "description": "Ignores extra data",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "StrType": {
            "shape": "StrType"
          }
        }
      },
      "StrType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {},
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "{\"foo\": \"bar\"}"
        }
      }
    ]
  },
  {
    "description": "Supports header maps",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "members": {
          "AllHeaders": {
            "shape": "HeaderMap",
            "location": "headers"
          },
          "PrefixedHeaders": {
            "shape": "HeaderMap",
            "location": "headers",
            "locationName": "X-"
          }
        }
      },
      "HeaderMap": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "StringType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "AllHeaders": {
            "Content-Length": "10",
            "X-Foo": "bar",
            "X-Bam": "boo"
          },
          "PrefixedHeaders": {
            "Foo": "bar",
            "Bam": "boo"
          }
        },
        "response": {
          "status_code": 200,
          "headers": {
            "Content-Length": "10",
            "X-Foo": "bar",
            "X-Bam": "boo"
          },
          "body": "{}"
        }
      }
    ]
  },
  {
    "description": "JSON payload",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "payload": "Data",
        "members": {
          "Header": {
            "shape": "StringType",
            "location": "header",
            "locationName": "X-Foo"
          },
          "Data": {
            "shape": "BodyStructure"
          }
        }
      },
      "BodyStructure": {
        "type": "structure",
        "members": {
          "Foo": {
            "shape": "StringType"
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "Header": "baz",
          "Data": {
            "Foo": "abc"
          }
        },
        "response": {
          "status_code": 200,
          "headers": {
            "X-Foo": "baz"
          },
          "body": "{\"Foo\": \"abc\"}"
        }
      }
    ]
  },
  {
    "description": "Streaming payload",
    "metadata": {
      "protocol": "rest-json"
    },
    "shapes": {
      "OutputShape": {
        "type": "structure",
        "payload": "Stream",
        "members": {
          "Stream": {
            "shape": "Stream"
          }
        }
      },
      "Stream": {
        "type": "blob"
      }
    },
    "cases": [
      {
        "given": {
          "output": {
            "shape": "OutputShape"
          },
          "name": "OperationName"
        },
        "result": {
          "Stream": "abc"
        },
        "response": {
          "status_code": 200,
          "headers": {},
          "body": "abc"
        }
      }
    ]
  }
]
