Skip to content

Commit

Permalink
feat(client-sesv2): Fixes ListContacts and ListImportJobs APIs to use…
Browse files Browse the repository at this point in the history
… POST instead of GET.
  • Loading branch information
awstools committed May 1, 2024
1 parent 669a7de commit 56df20c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
20 changes: 8 additions & 12 deletions clients/client-sesv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1306,19 +1306,17 @@ export const se_ListContactsCommand = async (
const headers: any = {
"content-type": "application/json",
};
b.bp("/v2/email/contact-lists/{ContactListName}/contacts");
b.bp("/v2/email/contact-lists/{ContactListName}/contacts/list");
b.p("ContactListName", () => input.ContactListName!, "{ContactListName}", false);
const query: any = map({
[_PS]: [() => input.PageSize !== void 0, () => input[_PS]!.toString()],
[_NT]: [, input[_NT]!],
});
let body: any;
body = JSON.stringify(
take(input, {
Filter: (_) => _json(_),
NextToken: [],
PageSize: [],
})
);
b.m("GET").h(headers).q(query).b(body);
b.m("POST").h(headers).b(body);
return b.build();
};

Expand Down Expand Up @@ -1481,18 +1479,16 @@ export const se_ListImportJobsCommand = async (
const headers: any = {
"content-type": "application/json",
};
b.bp("/v2/email/import-jobs");
const query: any = map({
[_NT]: [, input[_NT]!],
[_PS]: [() => input.PageSize !== void 0, () => input[_PS]!.toString()],
});
b.bp("/v2/email/import-jobs/list");
let body: any;
body = JSON.stringify(
take(input, {
ImportDestinationType: [],
NextToken: [],
PageSize: [],
})
);
b.m("GET").h(headers).q(query).b(body);
b.m("POST").h(headers).b(body);
return b.build();
};

Expand Down
20 changes: 8 additions & 12 deletions codegen/sdk-codegen/aws-models/sesv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6276,8 +6276,8 @@
"traits": {
"smithy.api#documentation": "<p>Lists the contacts present in a specific contact list.</p>",
"smithy.api#http": {
"method": "GET",
"uri": "/v2/email/contact-lists/{ContactListName}/contacts",
"method": "POST",
"uri": "/v2/email/contact-lists/{ContactListName}/contacts/list",
"code": 200
},
"smithy.api#paginated": {
Expand Down Expand Up @@ -6327,15 +6327,13 @@
"PageSize": {
"target": "com.amazonaws.sesv2#MaxItems",
"traits": {
"smithy.api#documentation": "<p>The number of contacts that may be returned at once, which is dependent on if there\n are more or less contacts than the value of the PageSize. Use this parameter to paginate\n results. If additional contacts exist beyond the specified limit, the\n <code>NextToken</code> element is sent in the response. Use the\n <code>NextToken</code> value in subsequent requests to retrieve additional\n contacts.</p>",
"smithy.api#httpQuery": "PageSize"
"smithy.api#documentation": "<p>The number of contacts that may be returned at once, which is dependent on if there\n are more or less contacts than the value of the PageSize. Use this parameter to paginate\n results. If additional contacts exist beyond the specified limit, the\n <code>NextToken</code> element is sent in the response. Use the\n <code>NextToken</code> value in subsequent requests to retrieve additional\n contacts.</p>"
}
},
"NextToken": {
"target": "com.amazonaws.sesv2#NextToken",
"traits": {
"smithy.api#documentation": "<p>A string token indicating that there might be additional contacts available to be\n listed. Use the token provided in the Response to use in the subsequent call to\n ListContacts with the same parameters to retrieve the next page of contacts.</p>",
"smithy.api#httpQuery": "NextToken"
"smithy.api#documentation": "<p>A string token indicating that there might be additional contacts available to be\n listed. Use the token provided in the Response to use in the subsequent call to\n ListContacts with the same parameters to retrieve the next page of contacts.</p>"
}
}
},
Expand Down Expand Up @@ -6942,8 +6940,8 @@
"traits": {
"smithy.api#documentation": "<p>Lists all of the import jobs.</p>",
"smithy.api#http": {
"method": "GET",
"uri": "/v2/email/import-jobs",
"method": "POST",
"uri": "/v2/email/import-jobs/list",
"code": 200
},
"smithy.api#paginated": {
Expand All @@ -6965,15 +6963,13 @@
"NextToken": {
"target": "com.amazonaws.sesv2#NextToken",
"traits": {
"smithy.api#documentation": "<p>A string token indicating that there might be additional import jobs available to be\n listed. Copy this token to a subsequent call to <code>ListImportJobs</code> with the\n same parameters to retrieve the next page of import jobs.</p>",
"smithy.api#httpQuery": "NextToken"
"smithy.api#documentation": "<p>A string token indicating that there might be additional import jobs available to be\n listed. Copy this token to a subsequent call to <code>ListImportJobs</code> with the\n same parameters to retrieve the next page of import jobs.</p>"
}
},
"PageSize": {
"target": "com.amazonaws.sesv2#MaxItems",
"traits": {
"smithy.api#documentation": "<p>Maximum number of import jobs to return at once. Use this parameter to paginate\n results. If additional import jobs exist beyond the specified limit, the\n <code>NextToken</code> element is sent in the response. Use the\n <code>NextToken</code> value in subsequent requests to retrieve additional\n addresses.</p>",
"smithy.api#httpQuery": "PageSize"
"smithy.api#documentation": "<p>Maximum number of import jobs to return at once. Use this parameter to paginate\n results. If additional import jobs exist beyond the specified limit, the\n <code>NextToken</code> element is sent in the response. Use the\n <code>NextToken</code> value in subsequent requests to retrieve additional\n addresses.</p>"
}
}
},
Expand Down

0 comments on commit 56df20c

Please sign in to comment.