[
  {
    "description": "Basic XML serialization",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Name": {
            "shape": "StringType"
          },
          "Description": {
            "shape": "StringType"
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "Name": "foo",
          "Description": "bar"
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><Name>foo</Name><Description>bar</Description></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      },
      {
        "given": {
          "http": {
            "method": "PUT",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "Name": "foo",
          "Description": "bar"
        },
        "serialized": {
          "method": "PUT",
          "body": "<OperationRequest xmlns=\"https://foo/\"><Name>foo</Name><Description>bar</Description></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      },
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "name": "OperationName"
        },
        "params": {},
        "serialized": {
          "method": "GET",
          "body": "",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Serialize other scalar types",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "First": {
            "shape": "BoolType"
          },
          "Second": {
            "shape": "BoolType"
          },
          "Third": {
            "shape": "FloatType"
          },
          "Fourth": {
            "shape": "IntegerType"
          }
        }
      },
      "BoolType": {
        "type": "boolean"
      },
      "FloatType": {
        "type": "float"
      },
      "IntegerType": {
        "type": "integer"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "First": true,
          "Second": false,
          "Third": 1.2,
          "Fourth": 3
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><First>true</First><Second>false</Second><Third>1.2</Third><Fourth>3</Fourth></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Nested structures",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "SubStructure": {
            "shape": "SubStructure"
          },
          "Description": {
            "shape": "StringType"
          }
        }
      },
      "SubStructure": {
        "type": "structure",
        "members": {
          "Foo": {
            "shape": "StringType"
          },
          "Bar": {
            "shape": "StringType"
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "SubStructure": {
            "Foo": "a",
            "Bar": "b"
          },
          "Description": "baz"
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><SubStructure><Foo>a</Foo><Bar>b</Bar></SubStructure><Description>baz</Description></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      },
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "SubStructure": {
            "Foo": "a",
            "Bar": null
          },
          "Description": "baz"
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><SubStructure><Foo>a</Foo></SubStructure><Description>baz</Description></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Nested structures",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "SubStructure": {
            "shape": "SubStructure"
          },
          "Description": {
            "shape": "StringType"
          }
        }
      },
      "SubStructure": {
        "type": "structure",
        "members": {
          "Foo": {
            "shape": "StringType"
          },
          "Bar": {
            "shape": "StringType"
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "SubStructure": {},
          "Description": "baz"
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><SubStructure /><Description>baz</Description></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Non flattened lists",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "ListParam": {
            "shape": "ListShape"
          }
        }
      },
      "ListShape": {
        "type": "list",
        "member": {
          "shape": "StringType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "ListParam": [
            "one",
            "two",
            "three"
          ]
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><ListParam><member>one</member><member>two</member><member>three</member></ListParam></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Non flattened lists with locationName",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "ListParam": {
            "shape": "ListShape",
            "locationName": "AlternateName"
          }
        }
      },
      "ListShape": {
        "type": "list",
        "member": {
          "shape": "StringType",
          "locationName": "NotMember"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "ListParam": [
            "one",
            "two",
            "three"
          ]
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><AlternateName><NotMember>one</NotMember><NotMember>two</NotMember><NotMember>three</NotMember></AlternateName></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Flattened lists",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "ListParam": {
            "shape": "ListShape"
          }
        }
      },
      "ListShape": {
        "type": "list",
        "member": {
          "shape": "StringType"
        },
        "flattened": true
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "ListParam": [
            "one",
            "two",
            "three"
          ]
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><ListParam>one</ListParam><ListParam>two</ListParam><ListParam>three</ListParam></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Flattened lists with locationName",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "ListParam": {
            "shape": "ListShape",
            "locationName": "item"
          }
        }
      },
      "ListShape": {
        "type": "list",
        "member": {
          "shape": "StringType"
        },
        "flattened": true
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "ListParam": [
            "one",
            "two",
            "three"
          ]
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><item>one</item><item>two</item><item>three</item></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "List of structures",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "ListParam": {
            "shape": "ListShape",
            "locationName": "item"
          }
        }
      },
      "ListShape": {
        "type": "list",
        "member": {
          "shape": "SingleFieldStruct"
        },
        "flattened": true
      },
      "StringType": {
        "type": "string"
      },
      "SingleFieldStruct": {
        "type": "structure",
        "members": {
          "Element": {
            "shape": "StringType",
            "locationName": "value"
          }
        }
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "ListParam": [
            {
              "Element": "one"
            },
            {
              "Element": "two"
            },
            {
              "Element": "three"
            }
          ]
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><item><value>one</value></item><item><value>two</value></item><item><value>three</value></item></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Blob and timestamp shapes",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "StructureParam": {
            "shape": "StructureShape"
          }
        }
      },
      "StructureShape": {
        "type": "structure",
        "members": {
          "t": {
            "shape": "TShape"
          },
          "b": {
            "shape": "BShape"
          }
        }
      },
      "TShape": {
        "type": "timestamp"
      },
      "BShape": {
        "type": "blob"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/2014-01-01/hostedzone"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "StructureParam": {
            "t": 1422172800,
            "b": "foo"
          }
        },
        "serialized": {
          "method": "POST",
          "body": "<OperationRequest xmlns=\"https://foo/\"><StructureParam><t>2015-01-25T08:00:00Z</t><b>Zm9v</b></StructureParam></OperationRequest>",
          "uri": "/2014-01-01/hostedzone",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Header maps",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "FooShape"
          }
        }
      },
      "FooShape": {
        "type": "map",
        "location": "headers",
        "locationName": "x-foo-",
        "key": {
          "shape": "FooKeyValue"
        },
        "value": {
          "shape": "FooKeyValue"
        }
      },
      "FooKeyValue": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "name": "OperationName"
        },
        "params": {
          "foo": {
            "a": "b",
            "c": "d"
          }
        },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/",
          "headers": {
            "x-foo-a": "b",
            "x-foo-c": "d"
          }
        }
      }
    ]
  },
  {
    "description": "Querystring list of strings",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Items": {
            "shape": "StringList",
            "location": "querystring",
            "locationName": "item"
          }
        }
      },
      "StringList": {
        "type": "list",
        "member": {
          "shape": "String"
        }
      },
      "String": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/path"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "Items": ["value1", "value2"]
        },
        "serialized": {
          "body": "",
          "uri": "/path?item=value1&item=value2",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "String to string maps in querystring",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "PipelineId": {
            "shape": "StringType",
            "location": "uri"
          },
          "QueryDoc": {
            "shape": "MapStringStringType",
            "location": "querystring"
          }
        }
      },
      "MapStringStringType": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "StringType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/2014-01-01/jobsByPipeline/{PipelineId}"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "PipelineId": "foo",
          "QueryDoc": {
            "bar": "baz",
            "fizz": "buzz"
          }
        },
        "serialized": {
          "body": "",
          "uri": "/2014-01-01/jobsByPipeline/foo?bar=baz&fizz=buzz",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "String to string list maps in querystring",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "PipelineId": {
            "shape": "StringType",
            "location": "uri"
          },
          "QueryDoc": {
            "shape": "MapStringStringListType",
            "location": "querystring"
          }
        }
      },
      "MapStringStringListType": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "StringListType"
        }
      },
      "StringListType": {
        "type": "list",
        "member": {
          "shape": "StringType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/2014-01-01/jobsByPipeline/{PipelineId}"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "PipelineId": "id",
          "QueryDoc": {
            "foo": ["bar", "baz"],
            "fizz": ["buzz", "pop"]
          }
        },
        "serialized": {
          "body": "",
          "uri": "/2014-01-01/jobsByPipeline/id?foo=bar&foo=baz&fizz=buzz&fizz=pop",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "Boolean in querystring",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "BoolQuery": {
            "shape": "BoolType",
            "location": "querystring",
            "locationName": "bool-query"
          }
        }
      },
      "BoolType": {
        "type": "boolean"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/path"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "BoolQuery": true
        },
        "serialized": {
          "body": "",
          "uri": "/path?bool-query=true",
          "headers": {}
        }
      },
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/path"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "BoolQuery": false
        },
        "serialized": {
          "body": "",
          "uri": "/path?bool-query=false",
          "headers": {}
        }
      }
    ]
  },
  {
    "description": "String payload",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "FooShape"
          }
        },
        "payload": "foo"
      },
      "FooShape": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "foo": "bar"
        },
        "serialized": {
          "method": "POST",
          "body": "bar",
          "uri": "/"
        }
      }
    ]
  },
  {
    "description": "Blob payload",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "FooShape"
          }
        },
        "payload": "foo"
      },
      "FooShape": {
        "type": "blob"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "foo": "bar"
        },
        "serialized": {
          "method": "POST",
          "body": "bar",
          "uri": "/"
        }
      },
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
        },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/"
        }
      }
    ]
  },
  {
    "description": "Structure payload",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "foo": {
            "shape": "FooShape"
          }
        },
        "payload": "foo"
      },
      "FooShape": {
        "locationName": "foo",
        "type": "structure",
        "members": {
          "baz": {
            "shape": "BazShape"
          }
        }
      },
      "BazShape": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "foo": {
            "baz": "bar"
          }
        },
        "serialized": {
          "method": "POST",
          "body": "<foo><baz>bar</baz></foo>",
          "uri": "/"
        }
      },
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {},
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/"
        }
      },
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "foo": {}
        },
        "serialized": {
          "method": "POST",
          "body": "<foo />",
          "uri": "/"
        }
      },
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "foo": null
        },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/"
        }
      }
    ]
  },
  {
    "description": "XML Attribute",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Grant": {
            "shape": "Grant"
          }
        },
        "payload": "Grant"
      },
      "Grant": {
        "type": "structure",
        "locationName": "Grant",
        "members": {
          "Grantee": {
            "shape": "Grantee"
          }
        }
      },
      "Grantee": {
        "type": "structure",
        "members": {
          "Type": {
            "shape": "Type",
            "locationName": "xsi:type",
            "xmlAttribute": true
          },
          "EmailAddress": {
            "shape": "StringType"
          }
        },
        "xmlNamespace": {
          "prefix": "xsi",
          "uri":"http://www.w3.org/2001/XMLSchema-instance"
        }
      },
      "Type": {
        "type": "string"
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "POST",
            "requestUri": "/"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "Grant": {
            "Grantee": {
              "EmailAddress": "foo@example.com",
              "Type": "CanonicalUser"
            }
          }
        },
        "serialized": {
          "method": "POST",
          "body": "<Grant><Grantee xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"CanonicalUser\"><EmailAddress>foo@example.com</EmailAddress></Grantee></Grant>",
          "uri": "/"
        }
      }
    ]
  },
  {
    "description": "Greedy keys",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Bucket": {
            "shape": "BucketShape",
            "location": "uri"
          },
          "Key": {
            "shape": "KeyShape",
            "location": "uri"
          }
        }
      },
      "BucketShape": {
        "type": "string"
      },
      "KeyShape": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "http": {
            "method": "GET",
            "requestUri": "/{Bucket}/{Key+}"
          },
          "input": {
            "shape": "InputShape"
          },
          "name": "OperationName"
        },
        "params": {
          "Key": "testing /123",
          "Bucket": "my/bucket"
        },
        "serialized": {
          "method": "GET",
          "body": "",
          "uri": "/my%2Fbucket/testing%20/123"
        }
      }
    ]
  },
  {
    "description": "Omits null query params, but serializes empty strings",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "foo": {
            "location":"querystring",
            "locationName":"param-name",
            "shape": "Foo"
          }
        }
      },
      "Foo": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "name": "OperationName",
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "input": { "shape": "InputShape" }
        },
        "params": { "foo": null },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/path"
        }
      },
      {
        "given": {
          "name": "OperationName",
          "http": {
            "method": "POST",
            "requestUri": "/path?abc=mno"
          },
          "input": { "shape": "InputShape" }
        },
        "params": { "foo": "" },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/path?abc=mno&param-name="
        }
      }
    ]
  },
  {
    "description": "Recursive shapes",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "RecursiveStruct": {
            "shape": "RecursiveStructType"
          }
        }
      },
      "RecursiveStructType": {
        "type": "structure",
        "members": {
          "NoRecurse": {
            "shape": "StringType"
          },
          "RecursiveStruct": {
            "shape": "RecursiveStructType"
          },
          "RecursiveList": {
            "shape": "RecursiveListType"
          },
          "RecursiveMap": {
            "shape": "RecursiveMapType"
          }
        }
      },
      "RecursiveListType": {
        "type": "list",
        "member": {
          "shape": "RecursiveStructType"
        }
      },
      "RecursiveMapType": {
        "type": "map",
        "key": {
          "shape": "StringType"
        },
        "value": {
          "shape": "RecursiveStructType"
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "NoRecurse": "foo"
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><NoRecurse>foo</NoRecurse></RecursiveStruct></OperationRequest>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "RecursiveStruct": {
              "NoRecurse": "foo"
            }
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><RecursiveStruct><NoRecurse>foo</NoRecurse></RecursiveStruct></RecursiveStruct></OperationRequest>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "RecursiveStruct": {
              "RecursiveStruct": {
                "RecursiveStruct": {
                  "NoRecurse": "foo"
                }
              }
            }
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><RecursiveStruct><RecursiveStruct><RecursiveStruct><NoRecurse>foo</NoRecurse></RecursiveStruct></RecursiveStruct></RecursiveStruct></RecursiveStruct></OperationRequest>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "RecursiveList": [
              {
                "NoRecurse": "foo"
              },
              {
                "NoRecurse": "bar"
              }
            ]
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><RecursiveList><member><NoRecurse>foo</NoRecurse></member><member><NoRecurse>bar</NoRecurse></member></RecursiveList></RecursiveStruct></OperationRequest>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "RecursiveList": [
              {
                "NoRecurse": "foo"
              },
              {
                "RecursiveStruct": {
                  "NoRecurse": "bar"
                }
              }
            ]
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><RecursiveList><member><NoRecurse>foo</NoRecurse></member><member><RecursiveStruct><NoRecurse>bar</NoRecurse></RecursiveStruct></member></RecursiveList></RecursiveStruct></OperationRequest>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape",
            "locationName": "OperationRequest",
            "xmlNamespace": {"uri": "https://foo/"}
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "RecursiveStruct": {
            "RecursiveMap": {
              "foo": {
                "NoRecurse": "foo"
              },
              "bar": {
                "NoRecurse": "bar"
              }
            }
          }
        },
        "serialized": {
          "uri": "/path",
          "body": "<OperationRequest xmlns=\"https://foo/\"><RecursiveStruct><RecursiveMap><entry><key>foo</key><value><NoRecurse>foo</NoRecurse></value></entry><entry><key>bar</key><value><NoRecurse>bar</NoRecurse></value></entry></RecursiveMap></RecursiveStruct></OperationRequest>"
        }
      }
    ]
  },
  {
    "description": "Timestamp in header",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "TimeArgInHeader": {
            "shape": "TimestampType",
            "location": "header",
            "locationName": "x-amz-timearg"
          }
        }
      },
      "TimestampType": {
        "type": "timestamp"
      }
    },
    "cases": [
      {
        "given": {
          "input": {
            "shape": "InputShape"
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "TimeArgInHeader": 1422172800
        },
        "serialized": {
          "method": "POST",
          "body": "",
          "uri": "/path",
          "headers": {"x-amz-timearg": "Sun, 25 Jan 2015 08:00:00 GMT"}
        }
      }
    ]
  },
  {
    "description": "Idempotency token auto fill",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Token": {
            "shape": "StringType",
            "idempotencyToken": true
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "input": {
            "shape": "InputShape"
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "Token": "abc123"
        },
        "serialized": {
          "uri": "/path",
          "headers": {},
          "body": "<InputShape><Token>abc123</Token></InputShape>"
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape"
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
        },
        "serialized": {
          "uri": "/path",
          "headers": {},
          "body": "<InputShape><Token>00000000-0000-4000-8000-000000000000</Token></InputShape>"
        }
      }
    ]
  },
  {
    "description": "JSON value trait",
    "metadata": {
      "protocol": "rest-xml",
      "apiVersion": "2014-01-01"
    },
    "shapes": {
      "InputShape": {
        "type": "structure",
        "members": {
          "Attr": {
            "shape": "StringType",
            "jsonvalue": true,
            "location": "header",
            "locationName": "X-Amz-Foo"
          }
        }
      },
      "StringType": {
        "type": "string"
      }
    },
    "cases": [
      {
        "given": {
          "input": {
            "shape": "InputShape"
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
          "Attr": {"Foo":"Bar"}
        },
        "serialized": {
          "uri": "/path",
          "headers": {"X-Amz-Foo": "eyJGb28iOiJCYXIifQ=="},
          "body": ""
        }
      },
      {
        "given": {
          "input": {
            "shape": "InputShape"
          },
          "http": {
            "method": "POST",
            "requestUri": "/path"
          },
          "name": "OperationName"
        },
        "params": {
        },
        "serialized": {
          "uri": "/path",
          "headers": {},
          "body": ""
        }
      }
    ]
  }
]
