Skip to content

chore(api-gateway): generate client with httpQueryParams #2249

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

Closed
wants to merge 3 commits into from
Closed
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
22 changes: 21 additions & 1 deletion clients/client-api-gateway/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ export interface QuotaSettings {
limit?: number;

/**
* <p>The number of requests subtracted from the given limit in the initial time period.</p>
* <p>The day that a time period starts. For example, with a time period of <code>WEEK</code>, an offset of <code>0</code> starts on Sunday, and an offset of <code>1</code> starts on Monday.</p>
*/
offset?: number;

Expand Down Expand Up @@ -5898,6 +5898,11 @@ export namespace VpcLinks {
* <p>The POST request to import API keys from an external source, such as a CSV-formatted file.</p>
*/
export interface ImportApiKeysRequest {
/**
* <p>The payload of the POST request to import API keys. For the payload format, see <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-key-file-format.html">API Key File Format</a>.</p>
*/
body: Uint8Array | undefined;

/**
* <p>A query parameter to specify the input format to imported API keys. Currently, only the <code>csv</code> format is supported.</p>
*/
Expand Down Expand Up @@ -5963,6 +5968,11 @@ export interface ImportDocumentationPartsRequest {
* <p>A query parameter to specify whether to rollback the documentation importation (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.</p>
*/
failOnWarnings?: boolean;

/**
* <p>[Required] Raw byte array representing the to-be-imported documentation parts. To import from an OpenAPI file, this is a JSON object.</p>
*/
body: Uint8Array | undefined;
}

export namespace ImportDocumentationPartsRequest {
Expand Down Expand Up @@ -5992,6 +6002,11 @@ export interface ImportRestApiRequest {
* <pre><code>aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'</code></pre>
*/
parameters?: { [key: string]: string };

/**
* <p>[Required] The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.</p>
*/
body: Uint8Array | undefined;
}

export namespace ImportRestApiRequest {
Expand Down Expand Up @@ -6334,6 +6349,11 @@ export interface PutRestApiRequest {
* <p>Custom header parameters as part of the request. For example, to exclude <a>DocumentationParts</a> from an imported API, set <code>ignore=documentation</code> as a <code>parameters</code> value, as in the AWS CLI command of <code>aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'</code>.</p>
*/
parameters?: { [key: string]: string };

/**
* <p>[Required] The PUT request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.</p>
*/
body: Uint8Array | undefined;
}

export namespace PutRestApiRequest {
Expand Down
63 changes: 31 additions & 32 deletions clients/client-api-gateway/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,6 @@ export const serializeAws_restJson1GetExportCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {
"content-type": "application/json",
...(isSerializableHeaderValue(input.accepts) && { accept: input.accepts! }),
};
let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/exports/{exportType}";
Expand Down Expand Up @@ -2339,13 +2338,10 @@ export const serializeAws_restJson1GetExportCommand = async (
} else {
throw new Error("No value provided for input HTTP label: exportType.");
}
const query: any = {
...(input.parameters !== undefined && input.parameters),
};
let body: any;
body = JSON.stringify({
...(input.parameters !== undefined &&
input.parameters !== null && {
parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context),
}),
});
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand All @@ -2354,6 +2350,7 @@ export const serializeAws_restJson1GetExportCommand = async (
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
Expand Down Expand Up @@ -2943,9 +2940,7 @@ export const serializeAws_restJson1GetSdkCommand = async (
input: GetSdkCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {
"content-type": "application/json",
};
const headers: any = {};
let resolvedPath = "/restapis/{restApiId}/stages/{stageName}/sdks/{sdkType}";
if (input.restApiId !== undefined) {
const labelValue: string = input.restApiId;
Expand Down Expand Up @@ -2974,13 +2969,10 @@ export const serializeAws_restJson1GetSdkCommand = async (
} else {
throw new Error("No value provided for input HTTP label: sdkType.");
}
const query: any = {
...(input.parameters !== undefined && input.parameters),
};
let body: any;
body = JSON.stringify({
...(input.parameters !== undefined &&
input.parameters !== null && {
parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context),
}),
});
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand All @@ -2989,6 +2981,7 @@ export const serializeAws_restJson1GetSdkCommand = async (
method: "GET",
headers,
path: resolvedPath,
query,
body,
});
};
Expand Down Expand Up @@ -3363,14 +3356,19 @@ export const serializeAws_restJson1ImportApiKeysCommand = async (
input: ImportApiKeysCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {};
const headers: any = {
"content-type": "application/octet-stream",
};
let resolvedPath = "/apikeys";
const query: any = {
mode: "import",
...(input.format !== undefined && { format: input.format }),
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
};
let body: any;
if (input.body !== undefined) {
body = input.body;
}
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand All @@ -3388,7 +3386,9 @@ export const serializeAws_restJson1ImportDocumentationPartsCommand = async (
input: ImportDocumentationPartsCommandInput,
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {};
const headers: any = {
"content-type": "application/octet-stream",
};
let resolvedPath = "/restapis/{restApiId}/documentation/parts";
if (input.restApiId !== undefined) {
const labelValue: string = input.restApiId;
Expand All @@ -3404,6 +3404,9 @@ export const serializeAws_restJson1ImportDocumentationPartsCommand = async (
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
};
let body: any;
if (input.body !== undefined) {
body = input.body;
}
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand All @@ -3422,20 +3425,18 @@ export const serializeAws_restJson1ImportRestApiCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {
"content-type": "application/json",
"content-type": "application/octet-stream",
};
let resolvedPath = "/restapis";
const query: any = {
mode: "import",
...(input.parameters !== undefined && input.parameters),
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
};
let body: any;
body = JSON.stringify({
...(input.parameters !== undefined &&
input.parameters !== null && {
parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context),
}),
});
if (input.body !== undefined) {
body = input.body;
}
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand Down Expand Up @@ -3793,7 +3794,7 @@ export const serializeAws_restJson1PutRestApiCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const headers: any = {
"content-type": "application/json",
"content-type": "application/octet-stream",
};
let resolvedPath = "/restapis/{restApiId}";
if (input.restApiId !== undefined) {
Expand All @@ -3806,16 +3807,14 @@ export const serializeAws_restJson1PutRestApiCommand = async (
throw new Error("No value provided for input HTTP label: restApiId.");
}
const query: any = {
...(input.parameters !== undefined && input.parameters),
...(input.mode !== undefined && { mode: input.mode }),
...(input.failOnWarnings !== undefined && { failonwarnings: input.failOnWarnings.toString() }),
};
let body: any;
body = JSON.stringify({
...(input.parameters !== undefined &&
input.parameters !== null && {
parameters: serializeAws_restJson1MapOfStringToString(input.parameters, context),
}),
});
if (input.body !== undefined) {
body = input.body;
}
const { hostname, protocol = "https", port } = await context.endpoint();
return new __HttpRequest({
protocol,
Expand Down
Loading