Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs/tests for API Gateway customizations #706

Merged
merged 1 commit into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
=================================
Amazon API Gateway Customizations
=================================

.. contents:: Table of contents
:depth: 1
:local:
:backlinks: none


--------------------------------
``Accept`` header
--------------------------------

A client for Amazon API Gateway MUST set the ``Accept`` header to the string
literal value of "application/json" for all requests.
11 changes: 11 additions & 0 deletions docs/source/1.0/spec/aws/customizations/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
==========================
AWS Service Customizations
==========================

.. rst-class:: large-toctree

.. toctree::
:maxdepth: 2

apigateway-customizations
glacier-customizations
4 changes: 2 additions & 2 deletions docs/source/1.0/spec/aws/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ AWS Service Customizations
.. rst-class:: large-toctree

.. toctree::
:maxdepth: 3
:maxdepth: 2

glacier-customizations
customizations/index
174 changes: 174 additions & 0 deletions smithy-aws-protocol-tests/model/restJson1/services/apigateway.smithy
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
$version: "1.0"

namespace com.amazonaws.apigateway

use aws.api#service
use aws.auth#sigv4
use aws.protocols#restJson1
use smithy.test#httpRequestTests

@service(
sdkId: "API Gateway",
arnNamespace: "apigateway",
cloudFormationName: "ApiGateway",
cloudTrailEventSource: "apigateway.amazonaws.com",
endpointPrefix: "apigateway"
)
@sigv4(
name: "apigateway",
)
@restJson1
@title("Amazon API Gateway")
service BackplaneControlService {
version: "2015-07-09",
operations: [
GetRestApis,
],
}


@httpRequestTests([
{
id: "ApiGatewayAccept",
documentation: "API Gateway requires that this Accept header is set on all requests.",
protocol: restJson1,
method: "GET",
uri: "/restapis",
headers: {
"Accept": "application/json",
},
body: "",
params: {},
}
])
@http(
method: "GET",
uri: "/restapis",
code: 200,
)
@paginated(
inputToken: "position",
outputToken: "position",
items: "items",
pageSize: "limit",
)
@readonly
operation GetRestApis {
input: GetRestApisRequest,
output: RestApis,
errors: [
BadRequestException,
TooManyRequestsException,
UnauthorizedException,
],
}

@error("client")
@httpError(400)
structure BadRequestException {
message: String,
}

structure EndpointConfiguration {
types: ListOfEndpointType,
vpcEndpointIds: ListOfString,
}

structure GetRestApisRequest {
@httpQuery("position")
position: String,

@httpQuery("limit")
limit: NullableInteger,
}

structure RestApi {
id: String,
name: String,
description: String,
createdDate: Timestamp,
version: String,
warnings: ListOfString,
binaryMediaTypes: ListOfString,
minimumCompressionSize: NullableInteger,
apiKeySource: ApiKeySourceType,
endpointConfiguration: EndpointConfiguration,
policy: String,
tags: MapOfStringToString,
disableExecuteApiEndpoint: Boolean,
}

structure RestApis {
@jsonName("item")
items: ListOfRestApi,

@httpQuery("position")
position: String,
}

@error("client")
@httpError(429)
structure TooManyRequestsException {
@httpHeader("Retry-After")
retryAfterSeconds: String,
message: String,
}

@error("client")
@httpError(401)
structure UnauthorizedException {
message: String,
}

list ListOfEndpointType {
member: EndpointType,
}

list ListOfString {
member: String,
}

list ListOfRestApi {
member: RestApi,
}

map MapOfStringToString {
key: String,
value: String,
}

@enum([
{
value: "HEADER",
name: "HEADER",
},
{
value: "AUTHORIZER",
name: "AUTHORIZER",
},
])
string ApiKeySourceType

boolean Boolean
@enum([
{
value: "REGIONAL",
name: "REGIONAL",
},
{
value: "EDGE",
name: "EDGE",
},
{
value: "PRIVATE",
name: "PRIVATE",
},
])
string EndpointType

@box
integer NullableInteger

string String

timestamp Timestamp