{
  "version":"2.0",
  "metadata":{
    "apiVersion":"2018-11-01",
    "endpointPrefix":"query.timestream",
    "jsonVersion":"1.0",
    "protocol":"json",
    "serviceAbbreviation":"Timestream Query",
    "serviceFullName":"Amazon Timestream Query",
    "serviceId":"Timestream Query",
    "signatureVersion":"v4",
    "signingName":"timestream",
    "targetPrefix":"Timestream_20181101",
    "uid":"timestream-query-2018-11-01"
  },
  "operations":{
    "CancelQuery":{
      "name":"CancelQuery",
      "http":{
        "method":"POST",
        "requestUri":"/"
      },
      "input":{"shape":"CancelQueryRequest"},
      "output":{"shape":"CancelQueryResponse"},
      "errors":[
        {"shape":"AccessDeniedException"},
        {"shape":"InternalServerException"},
        {"shape":"ThrottlingException"},
        {"shape":"ValidationException"},
        {"shape":"InvalidEndpointException"}
      ],
      "documentation":"<p> Cancels a query that has been issued. Cancellation is guaranteed only if the query has not completed execution before the cancellation request was issued. Because cancellation is an idempotent operation, subsequent cancellation requests will return a <code>CancellationMessage</code>, indicating that the query has already been canceled. </p>",
      "endpointdiscovery":{"required":true},
      "idempotent":true
    },
    "DescribeEndpoints":{
      "name":"DescribeEndpoints",
      "http":{
        "method":"POST",
        "requestUri":"/"
      },
      "input":{"shape":"DescribeEndpointsRequest"},
      "output":{"shape":"DescribeEndpointsResponse"},
      "errors":[
        {"shape":"InternalServerException"},
        {"shape":"ValidationException"},
        {"shape":"ThrottlingException"}
      ],
      "documentation":"<p>DescribeEndpoints returns a list of available endpoints to make Timestream API calls against. This API is available through both Write and Query.</p> <p>Because Timestream’s SDKs are designed to transparently work with the service’s architecture, including the management and mapping of the service endpoints, <i>it is not recommended that you use this API unless</i>:</p> <ul> <li> <p>Your application uses a programming language that does not yet have SDK support</p> </li> <li> <p>You require better control over the client-side implementation</p> </li> </ul> <p>For detailed information on how to use DescribeEndpoints, see <a href=\"https://docs.aws.amazon.com/timestream/latest/developerguide/Using-API.endpoint-discovery.html\">The Endpoint Discovery Pattern and REST APIs</a>.</p>",
      "endpointoperation":true
    },
    "Query":{
      "name":"Query",
      "http":{
        "method":"POST",
        "requestUri":"/"
      },
      "input":{"shape":"QueryRequest"},
      "output":{"shape":"QueryResponse"},
      "errors":[
        {"shape":"AccessDeniedException"},
        {"shape":"ConflictException"},
        {"shape":"InternalServerException"},
        {"shape":"QueryExecutionException"},
        {"shape":"ThrottlingException"},
        {"shape":"ValidationException"},
        {"shape":"InvalidEndpointException"}
      ],
      "documentation":"<p> Query is a synchronous operation that enables you to execute a query. Query will timeout after 60 seconds. You must update the default timeout in the SDK to support a timeout of 60 seconds. The result set will be truncated to 1MB. Service quotas apply. For more information, see Quotas in the Timestream Developer Guide. </p>",
      "endpointdiscovery":{"required":true},
      "idempotent":true
    }
  },
  "shapes":{
    "AccessDeniedException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ServiceErrorMessage"}
      },
      "documentation":"<p> You are not authorized to perform this action. </p>",
      "exception":true,
      "synthetic":true
    },
    "CancelQueryRequest":{
      "type":"structure",
      "required":["QueryId"],
      "members":{
        "QueryId":{
          "shape":"QueryId",
          "documentation":"<p> The id of the query that needs to be cancelled. <code>QueryID</code> is returned as part of QueryResult. </p>"
        }
      }
    },
    "CancelQueryResponse":{
      "type":"structure",
      "members":{
        "CancellationMessage":{
          "shape":"String",
          "documentation":"<p> A <code>CancellationMessage</code> is returned when a <code>CancelQuery</code> request for the query specified by <code>QueryId</code> has already been issued. </p>"
        }
      }
    },
    "ClientRequestToken":{
      "type":"string",
      "max":128,
      "min":32,
      "sensitive":true
    },
    "ColumnInfo":{
      "type":"structure",
      "required":["Type"],
      "members":{
        "Name":{
          "shape":"String",
          "documentation":"<p> The name of the result set column. The name of the result set is available for columns of all data types except for arrays. </p>"
        },
        "Type":{
          "shape":"Type",
          "documentation":"<p> The data type of the result set column. The data type can be a scalar or complex. Scalar data types are integers, strings, doubles, booleans, and others. Complex data types are types such as arrays, rows, and others. </p>"
        }
      },
      "documentation":"<p> Contains the meta data for query results such as the column names, data types, and other attributes. </p>"
    },
    "ColumnInfoList":{
      "type":"list",
      "member":{"shape":"ColumnInfo"}
    },
    "ConflictException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p> Unable to poll results for a cancelled query. </p>",
      "exception":true
    },
    "Datum":{
      "type":"structure",
      "members":{
        "ScalarValue":{
          "shape":"ScalarValue",
          "documentation":"<p> Indicates if the data point is a scalar value such as integer, string, double, or boolean. </p>"
        },
        "TimeSeriesValue":{
          "shape":"TimeSeriesDataPointList",
          "documentation":"<p> Indicates if the data point is of timeseries data type. </p>"
        },
        "ArrayValue":{
          "shape":"DatumList",
          "documentation":"<p> Indicates if the data point is an array. </p>"
        },
        "RowValue":{
          "shape":"Row",
          "documentation":"<p> Indicates if the data point is a row. </p>"
        },
        "NullValue":{
          "shape":"NullableBoolean",
          "documentation":"<p> Indicates if the data point is null. </p>"
        }
      },
      "documentation":"<p> Datum represents a single data point in a query result. </p>"
    },
    "DatumList":{
      "type":"list",
      "member":{"shape":"Datum"}
    },
    "DescribeEndpointsRequest":{
      "type":"structure",
      "members":{
      }
    },
    "DescribeEndpointsResponse":{
      "type":"structure",
      "required":["Endpoints"],
      "members":{
        "Endpoints":{
          "shape":"Endpoints",
          "documentation":"<p>An <code>Endpoints</code> object is returned when a <code>DescribeEndpoints</code> request is made.</p>"
        }
      }
    },
    "Double":{"type":"double"},
    "Endpoint":{
      "type":"structure",
      "required":[
        "Address",
        "CachePeriodInMinutes"
      ],
      "members":{
        "Address":{
          "shape":"String",
          "documentation":"<p>An endpoint address.</p>"
        },
        "CachePeriodInMinutes":{
          "shape":"Long",
          "documentation":"<p>The TTL for the endpoint, in minutes.</p>"
        }
      },
      "documentation":"<p>Represents an available endpoint against which to make API calls agaisnt, as well as the TTL for that endpoint.</p>"
    },
    "Endpoints":{
      "type":"list",
      "member":{"shape":"Endpoint"}
    },
    "ErrorMessage":{"type":"string"},
    "InternalServerException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p> Timestream was unable to fully process this request because of an internal server error. </p>",
      "exception":true
    },
    "InvalidEndpointException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p>The requested endpoint was invalid.</p>",
      "exception":true
    },
    "Long":{"type":"long"},
    "MaxQueryResults":{
      "type":"integer",
      "box":true,
      "max":1000,
      "min":1
    },
    "NullableBoolean":{
      "type":"boolean",
      "box":true
    },
    "QueryExecutionException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p> Timestream was unable to run the query successfully. </p>",
      "exception":true
    },
    "QueryId":{
      "type":"string",
      "max":64,
      "min":1,
      "pattern":"[a-zA-Z0-9]+"
    },
    "QueryRequest":{
      "type":"structure",
      "required":["QueryString"],
      "members":{
        "QueryString":{
          "shape":"QueryString",
          "documentation":"<p> The query to be executed by Timestream. </p>"
        },
        "ClientToken":{
          "shape":"ClientRequestToken",
          "documentation":"<p> Unique, case-sensitive string of up to 64 ASCII characters that you specify when you make a Query request. Providing a <code>ClientToken</code> makes the call to <code>Query</code> idempotent, meaning that multiple identical calls have the same effect as one single call. </p> <p>Your query request will fail in the following cases:</p> <ul> <li> <p> If you submit a request with the same client token outside the 5-minute idepotency window. </p> </li> <li> <p> If you submit a request with the same client token but a change in other parameters within the 5-minute idempotency window. </p> </li> </ul> <p> After 4 hours, any request with the same client token is treated as a new request. </p>",
          "idempotencyToken":true
        },
        "NextToken":{
          "shape":"String",
          "documentation":"<p> A pagination token passed to get a set of results. </p>"
        },
        "MaxRows":{
          "shape":"MaxQueryResults",
          "documentation":"<p> The total number of rows to return in the output. If the total number of rows available is more than the value specified, a NextToken is provided in the command's output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. </p>"
        }
      }
    },
    "QueryResponse":{
      "type":"structure",
      "required":[
        "QueryId",
        "Rows",
        "ColumnInfo"
      ],
      "members":{
        "QueryId":{
          "shape":"QueryId",
          "documentation":"<p> A unique ID for the given query. </p>"
        },
        "NextToken":{
          "shape":"String",
          "documentation":"<p> A pagination token that can be used again on a <code>Query</code> call to get the next set of results. </p>"
        },
        "Rows":{
          "shape":"RowList",
          "documentation":"<p> The result set rows returned by the query. </p>"
        },
        "ColumnInfo":{
          "shape":"ColumnInfoList",
          "documentation":"<p> The column data types of the returned result set. </p>"
        },
        "QueryStatus":{
          "shape":"QueryStatus",
          "documentation":"<p>Information about the status of the query, including progress and bytes scannned.</p>"
        }
      }
    },
    "QueryStatus":{
      "type":"structure",
      "members":{
        "ProgressPercentage":{
          "shape":"Double",
          "documentation":"<p>The progress of the query, expressed as a percentage.</p>"
        },
        "CumulativeBytesScanned":{
          "shape":"Long",
          "documentation":"<p>The amount of data scanned by the query in bytes. This is a cumulative sum and represents the total amount of bytes scanned since the query was started. </p>"
        },
        "CumulativeBytesMetered":{
          "shape":"Long",
          "documentation":"<p>The amount of data scanned by the query in bytes that you will be charged for. This is a cumulative sum and represents the total amount of data that you will be charged for since the query was started. The charge is applied only once and is either applied when the query completes execution or when the query is cancelled. </p>"
        }
      },
      "documentation":"<p>Information about the status of the query, including progress and bytes scannned.</p>"
    },
    "QueryString":{
      "type":"string",
      "sensitive":true
    },
    "Row":{
      "type":"structure",
      "required":["Data"],
      "members":{
        "Data":{
          "shape":"DatumList",
          "documentation":"<p>List of data points in a single row of the result set.</p>"
        }
      },
      "documentation":"<p>Represents a single row in the query results.</p>"
    },
    "RowList":{
      "type":"list",
      "member":{"shape":"Row"}
    },
    "ScalarType":{
      "type":"string",
      "enum":[
        "VARCHAR",
        "BOOLEAN",
        "BIGINT",
        "DOUBLE",
        "TIMESTAMP",
        "DATE",
        "TIME",
        "INTERVAL_DAY_TO_SECOND",
        "INTERVAL_YEAR_TO_MONTH",
        "UNKNOWN",
        "INTEGER"
      ]
    },
    "ScalarValue":{"type":"string"},
    "ServiceErrorMessage":{"type":"string"},
    "String":{"type":"string"},
    "ThrottlingException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p>The request was denied due to request throttling.</p>",
      "exception":true
    },
    "TimeSeriesDataPoint":{
      "type":"structure",
      "required":[
        "Time",
        "Value"
      ],
      "members":{
        "Time":{
          "shape":"Timestamp",
          "documentation":"<p>The timestamp when the measure value was collected.</p>"
        },
        "Value":{
          "shape":"Datum",
          "documentation":"<p>The measure value for the data point.</p>"
        }
      },
      "documentation":"<p>The timeseries datatype represents the values of a measure over time. A time series is an array of rows of timestamps and measure values, with rows sorted in ascending order of time. A TimeSeriesDataPoint is a single data point in the timeseries. It represents a tuple of (time, measure value) in a timeseries. </p>"
    },
    "TimeSeriesDataPointList":{
      "type":"list",
      "member":{"shape":"TimeSeriesDataPoint"}
    },
    "Timestamp":{"type":"string"},
    "Type":{
      "type":"structure",
      "members":{
        "ScalarType":{
          "shape":"ScalarType",
          "documentation":"<p>Indicates if the column is of type string, integer, boolean, double, timestamp, date, time. </p>"
        },
        "ArrayColumnInfo":{
          "shape":"ColumnInfo",
          "documentation":"<p>Indicates if the column is an array.</p>"
        },
        "TimeSeriesMeasureValueColumnInfo":{
          "shape":"ColumnInfo",
          "documentation":"<p>Indicates if the column is a timeseries data type.</p>"
        },
        "RowColumnInfo":{
          "shape":"ColumnInfoList",
          "documentation":"<p>Indicates if the column is a row.</p>"
        }
      },
      "documentation":"<p>Contains the data type of a column in a query result set. The data type can be scalar or complex. The supported scalar data types are integers, boolean, string, double, timestamp, date, time, and intervals. The supported complex data types are arrays, rows, and timeseries.</p>"
    },
    "ValidationException":{
      "type":"structure",
      "members":{
        "Message":{"shape":"ErrorMessage"}
      },
      "documentation":"<p> Invalid or malformed request. </p>",
      "exception":true
    }
  },
  "documentation":"<p> </p>"
}
