-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs/tests for API Gateway customizations
This adds documentation and protocol tests for the customizations required to generate an API Gateway client.
- Loading branch information
1 parent
fafbe88
commit 4bbe4f4
Showing
5 changed files
with
203 additions
and
2 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
docs/source/1.0/spec/aws/customizations/apigateway-customizations.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
174 changes: 174 additions & 0 deletions
174
smithy-aws-protocol-tests/model/restJson1/services/apigateway.smithy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |