Skip to content

Commit b449c45

Browse files
author
awstools
committed
feat(client-pinpoint-sms-voice-v2): AWS End User Messaging SMS-Voice V2 has added support for resource policies. Use the three new APIs to create, view, edit, and delete resource policies.
1 parent 8212995 commit b449c45

14 files changed

+1150
-28
lines changed

clients/client-pinpoint-sms-voice-v2/README.md

+24
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,14 @@ DeleteRegistrationFieldValue
442442

443443
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/DeleteRegistrationFieldValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/DeleteRegistrationFieldValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/DeleteRegistrationFieldValueCommandOutput/)
444444

445+
</details>
446+
<details>
447+
<summary>
448+
DeleteResourcePolicy
449+
</summary>
450+
451+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/DeleteResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/DeleteResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/DeleteResourcePolicyCommandOutput/)
452+
445453
</details>
446454
<details>
447455
<summary>
@@ -650,6 +658,14 @@ GetProtectConfigurationCountryRuleSet
650658

651659
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/GetProtectConfigurationCountryRuleSetCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/GetProtectConfigurationCountryRuleSetCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/GetProtectConfigurationCountryRuleSetCommandOutput/)
652660

661+
</details>
662+
<details>
663+
<summary>
664+
GetResourcePolicy
665+
</summary>
666+
667+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/GetResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/GetResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/GetResourcePolicyCommandOutput/)
668+
653669
</details>
654670
<details>
655671
<summary>
@@ -698,6 +714,14 @@ PutRegistrationFieldValue
698714

699715
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/PutRegistrationFieldValueCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/PutRegistrationFieldValueCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/PutRegistrationFieldValueCommandOutput/)
700716

717+
</details>
718+
<details>
719+
<summary>
720+
PutResourcePolicy
721+
</summary>
722+
723+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pinpoint-sms-voice-v2/command/PutResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/PutResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pinpoint-sms-voice-v2/Interface/PutResourcePolicyCommandOutput/)
724+
701725
</details>
702726
<details>
703727
<summary>

clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2.ts

+69
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ import {
124124
DeleteRegistrationFieldValueCommandInput,
125125
DeleteRegistrationFieldValueCommandOutput,
126126
} from "./commands/DeleteRegistrationFieldValueCommand";
127+
import {
128+
DeleteResourcePolicyCommand,
129+
DeleteResourcePolicyCommandInput,
130+
DeleteResourcePolicyCommandOutput,
131+
} from "./commands/DeleteResourcePolicyCommand";
127132
import {
128133
DeleteTextMessageSpendLimitOverrideCommand,
129134
DeleteTextMessageSpendLimitOverrideCommandInput,
@@ -254,6 +259,11 @@ import {
254259
GetProtectConfigurationCountryRuleSetCommandInput,
255260
GetProtectConfigurationCountryRuleSetCommandOutput,
256261
} from "./commands/GetProtectConfigurationCountryRuleSetCommand";
262+
import {
263+
GetResourcePolicyCommand,
264+
GetResourcePolicyCommandInput,
265+
GetResourcePolicyCommandOutput,
266+
} from "./commands/GetResourcePolicyCommand";
257267
import {
258268
ListPoolOriginationIdentitiesCommand,
259269
ListPoolOriginationIdentitiesCommandInput,
@@ -280,6 +290,11 @@ import {
280290
PutRegistrationFieldValueCommandInput,
281291
PutRegistrationFieldValueCommandOutput,
282292
} from "./commands/PutRegistrationFieldValueCommand";
293+
import {
294+
PutResourcePolicyCommand,
295+
PutResourcePolicyCommandInput,
296+
PutResourcePolicyCommandOutput,
297+
} from "./commands/PutResourcePolicyCommand";
283298
import {
284299
ReleasePhoneNumberCommand,
285300
ReleasePhoneNumberCommandInput,
@@ -421,6 +436,7 @@ const commands = {
421436
DeleteRegistrationCommand,
422437
DeleteRegistrationAttachmentCommand,
423438
DeleteRegistrationFieldValueCommand,
439+
DeleteResourcePolicyCommand,
424440
DeleteTextMessageSpendLimitOverrideCommand,
425441
DeleteVerifiedDestinationNumberCommand,
426442
DeleteVoiceMessageSpendLimitOverrideCommand,
@@ -447,12 +463,14 @@ const commands = {
447463
DisassociateProtectConfigurationCommand,
448464
DiscardRegistrationVersionCommand,
449465
GetProtectConfigurationCountryRuleSetCommand,
466+
GetResourcePolicyCommand,
450467
ListPoolOriginationIdentitiesCommand,
451468
ListRegistrationAssociationsCommand,
452469
ListTagsForResourceCommand,
453470
PutKeywordCommand,
454471
PutOptedOutNumberCommand,
455472
PutRegistrationFieldValueCommand,
473+
PutResourcePolicyCommand,
456474
ReleasePhoneNumberCommand,
457475
ReleaseSenderIdCommand,
458476
RequestPhoneNumberCommand,
@@ -908,6 +926,23 @@ export interface PinpointSMSVoiceV2 {
908926
cb: (err: any, data?: DeleteRegistrationFieldValueCommandOutput) => void
909927
): void;
910928

929+
/**
930+
* @see {@link DeleteResourcePolicyCommand}
931+
*/
932+
deleteResourcePolicy(
933+
args: DeleteResourcePolicyCommandInput,
934+
options?: __HttpHandlerOptions
935+
): Promise<DeleteResourcePolicyCommandOutput>;
936+
deleteResourcePolicy(
937+
args: DeleteResourcePolicyCommandInput,
938+
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
939+
): void;
940+
deleteResourcePolicy(
941+
args: DeleteResourcePolicyCommandInput,
942+
options: __HttpHandlerOptions,
943+
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
944+
): void;
945+
911946
/**
912947
* @see {@link DeleteTextMessageSpendLimitOverrideCommand}
913948
*/
@@ -1359,6 +1394,23 @@ export interface PinpointSMSVoiceV2 {
13591394
cb: (err: any, data?: GetProtectConfigurationCountryRuleSetCommandOutput) => void
13601395
): void;
13611396

1397+
/**
1398+
* @see {@link GetResourcePolicyCommand}
1399+
*/
1400+
getResourcePolicy(
1401+
args: GetResourcePolicyCommandInput,
1402+
options?: __HttpHandlerOptions
1403+
): Promise<GetResourcePolicyCommandOutput>;
1404+
getResourcePolicy(
1405+
args: GetResourcePolicyCommandInput,
1406+
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
1407+
): void;
1408+
getResourcePolicy(
1409+
args: GetResourcePolicyCommandInput,
1410+
options: __HttpHandlerOptions,
1411+
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
1412+
): void;
1413+
13621414
/**
13631415
* @see {@link ListPoolOriginationIdentitiesCommand}
13641416
*/
@@ -1455,6 +1507,23 @@ export interface PinpointSMSVoiceV2 {
14551507
cb: (err: any, data?: PutRegistrationFieldValueCommandOutput) => void
14561508
): void;
14571509

1510+
/**
1511+
* @see {@link PutResourcePolicyCommand}
1512+
*/
1513+
putResourcePolicy(
1514+
args: PutResourcePolicyCommandInput,
1515+
options?: __HttpHandlerOptions
1516+
): Promise<PutResourcePolicyCommandOutput>;
1517+
putResourcePolicy(
1518+
args: PutResourcePolicyCommandInput,
1519+
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
1520+
): void;
1521+
putResourcePolicy(
1522+
args: PutResourcePolicyCommandInput,
1523+
options: __HttpHandlerOptions,
1524+
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
1525+
): void;
1526+
14581527
/**
14591528
* @see {@link ReleasePhoneNumberCommand}
14601529
*/

clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2Client.ts

+12
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ import {
136136
DeleteRegistrationFieldValueCommandInput,
137137
DeleteRegistrationFieldValueCommandOutput,
138138
} from "./commands/DeleteRegistrationFieldValueCommand";
139+
import {
140+
DeleteResourcePolicyCommandInput,
141+
DeleteResourcePolicyCommandOutput,
142+
} from "./commands/DeleteResourcePolicyCommand";
139143
import {
140144
DeleteTextMessageSpendLimitOverrideCommandInput,
141145
DeleteTextMessageSpendLimitOverrideCommandOutput,
@@ -231,6 +235,7 @@ import {
231235
GetProtectConfigurationCountryRuleSetCommandInput,
232236
GetProtectConfigurationCountryRuleSetCommandOutput,
233237
} from "./commands/GetProtectConfigurationCountryRuleSetCommand";
238+
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
234239
import {
235240
ListPoolOriginationIdentitiesCommandInput,
236241
ListPoolOriginationIdentitiesCommandOutput,
@@ -249,6 +254,7 @@ import {
249254
PutRegistrationFieldValueCommandInput,
250255
PutRegistrationFieldValueCommandOutput,
251256
} from "./commands/PutRegistrationFieldValueCommand";
257+
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
252258
import { ReleasePhoneNumberCommandInput, ReleasePhoneNumberCommandOutput } from "./commands/ReleasePhoneNumberCommand";
253259
import { ReleaseSenderIdCommandInput, ReleaseSenderIdCommandOutput } from "./commands/ReleaseSenderIdCommand";
254260
import { RequestPhoneNumberCommandInput, RequestPhoneNumberCommandOutput } from "./commands/RequestPhoneNumberCommand";
@@ -347,6 +353,7 @@ export type ServiceInputTypes =
347353
| DeleteRegistrationAttachmentCommandInput
348354
| DeleteRegistrationCommandInput
349355
| DeleteRegistrationFieldValueCommandInput
356+
| DeleteResourcePolicyCommandInput
350357
| DeleteTextMessageSpendLimitOverrideCommandInput
351358
| DeleteVerifiedDestinationNumberCommandInput
352359
| DeleteVoiceMessageSpendLimitOverrideCommandInput
@@ -373,12 +380,14 @@ export type ServiceInputTypes =
373380
| DisassociateProtectConfigurationCommandInput
374381
| DiscardRegistrationVersionCommandInput
375382
| GetProtectConfigurationCountryRuleSetCommandInput
383+
| GetResourcePolicyCommandInput
376384
| ListPoolOriginationIdentitiesCommandInput
377385
| ListRegistrationAssociationsCommandInput
378386
| ListTagsForResourceCommandInput
379387
| PutKeywordCommandInput
380388
| PutOptedOutNumberCommandInput
381389
| PutRegistrationFieldValueCommandInput
390+
| PutResourcePolicyCommandInput
382391
| ReleasePhoneNumberCommandInput
383392
| ReleaseSenderIdCommandInput
384393
| RequestPhoneNumberCommandInput
@@ -434,6 +443,7 @@ export type ServiceOutputTypes =
434443
| DeleteRegistrationAttachmentCommandOutput
435444
| DeleteRegistrationCommandOutput
436445
| DeleteRegistrationFieldValueCommandOutput
446+
| DeleteResourcePolicyCommandOutput
437447
| DeleteTextMessageSpendLimitOverrideCommandOutput
438448
| DeleteVerifiedDestinationNumberCommandOutput
439449
| DeleteVoiceMessageSpendLimitOverrideCommandOutput
@@ -460,12 +470,14 @@ export type ServiceOutputTypes =
460470
| DisassociateProtectConfigurationCommandOutput
461471
| DiscardRegistrationVersionCommandOutput
462472
| GetProtectConfigurationCountryRuleSetCommandOutput
473+
| GetResourcePolicyCommandOutput
463474
| ListPoolOriginationIdentitiesCommandOutput
464475
| ListRegistrationAssociationsCommandOutput
465476
| ListTagsForResourceCommandOutput
466477
| PutKeywordCommandOutput
467478
| PutOptedOutNumberCommandOutput
468479
| PutRegistrationFieldValueCommandOutput
480+
| PutResourcePolicyCommandOutput
469481
| ReleasePhoneNumberCommandOutput
470482
| ReleaseSenderIdCommandOutput
471483
| RequestPhoneNumberCommandOutput
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { DeleteResourcePolicyRequest, DeleteResourcePolicyResult } from "../models/models_0";
9+
import {
10+
PinpointSMSVoiceV2ClientResolvedConfig,
11+
ServiceInputTypes,
12+
ServiceOutputTypes,
13+
} from "../PinpointSMSVoiceV2Client";
14+
import { de_DeleteResourcePolicyCommand, se_DeleteResourcePolicyCommand } from "../protocols/Aws_json1_0";
15+
16+
/**
17+
* @public
18+
*/
19+
export type { __MetadataBearer };
20+
export { $Command };
21+
/**
22+
* @public
23+
*
24+
* The input for {@link DeleteResourcePolicyCommand}.
25+
*/
26+
export interface DeleteResourcePolicyCommandInput extends DeleteResourcePolicyRequest {}
27+
/**
28+
* @public
29+
*
30+
* The output of {@link DeleteResourcePolicyCommand}.
31+
*/
32+
export interface DeleteResourcePolicyCommandOutput extends DeleteResourcePolicyResult, __MetadataBearer {}
33+
34+
/**
35+
* <p>Deletes the resource-based policy document attached to the AWS End User Messaging SMS and Voice resource. A shared resource can be a Pool, Opt-out list, Sender Id, or Phone number.</p>
36+
* @example
37+
* Use a bare-bones client and the command you need to make an API call.
38+
* ```javascript
39+
* import { PinpointSMSVoiceV2Client, DeleteResourcePolicyCommand } from "@aws-sdk/client-pinpoint-sms-voice-v2"; // ES Modules import
40+
* // const { PinpointSMSVoiceV2Client, DeleteResourcePolicyCommand } = require("@aws-sdk/client-pinpoint-sms-voice-v2"); // CommonJS import
41+
* const client = new PinpointSMSVoiceV2Client(config);
42+
* const input = { // DeleteResourcePolicyRequest
43+
* ResourceArn: "STRING_VALUE", // required
44+
* };
45+
* const command = new DeleteResourcePolicyCommand(input);
46+
* const response = await client.send(command);
47+
* // { // DeleteResourcePolicyResult
48+
* // ResourceArn: "STRING_VALUE",
49+
* // Policy: "STRING_VALUE",
50+
* // CreatedTimestamp: new Date("TIMESTAMP"),
51+
* // };
52+
*
53+
* ```
54+
*
55+
* @param DeleteResourcePolicyCommandInput - {@link DeleteResourcePolicyCommandInput}
56+
* @returns {@link DeleteResourcePolicyCommandOutput}
57+
* @see {@link DeleteResourcePolicyCommandInput} for command's `input` shape.
58+
* @see {@link DeleteResourcePolicyCommandOutput} for command's `response` shape.
59+
* @see {@link PinpointSMSVoiceV2ClientResolvedConfig | config} for PinpointSMSVoiceV2Client's `config` shape.
60+
*
61+
* @throws {@link AccessDeniedException} (client fault)
62+
* <p>The request was denied because you don't have sufficient permissions to access the
63+
* resource.</p>
64+
*
65+
* @throws {@link InternalServerException} (server fault)
66+
* <p>The API encountered an unexpected error and couldn't complete the request. You might
67+
* be able to successfully issue the request again in the future.</p>
68+
*
69+
* @throws {@link ResourceNotFoundException} (client fault)
70+
* <p>A requested resource couldn't be found.</p>
71+
*
72+
* @throws {@link ThrottlingException} (client fault)
73+
* <p>An error that occurred because too many requests were sent during a certain amount of
74+
* time.</p>
75+
*
76+
* @throws {@link ValidationException} (client fault)
77+
* <p>A validation exception for a field.</p>
78+
*
79+
* @throws {@link PinpointSMSVoiceV2ServiceException}
80+
* <p>Base exception class for all service exceptions from PinpointSMSVoiceV2 service.</p>
81+
*
82+
* @public
83+
*/
84+
export class DeleteResourcePolicyCommand extends $Command
85+
.classBuilder<
86+
DeleteResourcePolicyCommandInput,
87+
DeleteResourcePolicyCommandOutput,
88+
PinpointSMSVoiceV2ClientResolvedConfig,
89+
ServiceInputTypes,
90+
ServiceOutputTypes
91+
>()
92+
.ep(commonParams)
93+
.m(function (this: any, Command: any, cs: any, config: PinpointSMSVoiceV2ClientResolvedConfig, o: any) {
94+
return [
95+
getSerdePlugin(config, this.serialize, this.deserialize),
96+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
97+
];
98+
})
99+
.s("PinpointSMSVoiceV2", "DeleteResourcePolicy", {})
100+
.n("PinpointSMSVoiceV2Client", "DeleteResourcePolicyCommand")
101+
.f(void 0, void 0)
102+
.ser(se_DeleteResourcePolicyCommand)
103+
.de(de_DeleteResourcePolicyCommand)
104+
.build() {
105+
/** @internal type navigation helper, not in runtime. */
106+
protected declare static __types: {
107+
api: {
108+
input: DeleteResourcePolicyRequest;
109+
output: DeleteResourcePolicyResult;
110+
};
111+
sdk: {
112+
input: DeleteResourcePolicyCommandInput;
113+
output: DeleteResourcePolicyCommandOutput;
114+
};
115+
};
116+
}

clients/client-pinpoint-sms-voice-v2/src/commands/DescribeOptOutListsCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export interface DescribeOptOutListsCommandOutput extends DescribeOptOutListsRes
5050
* ],
5151
* NextToken: "STRING_VALUE",
5252
* MaxResults: Number("int"),
53+
* Owner: "STRING_VALUE",
5354
* };
5455
* const command = new DescribeOptOutListsCommand(input);
5556
* const response = await client.send(command);

clients/client-pinpoint-sms-voice-v2/src/commands/DescribePhoneNumbersCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export interface DescribePhoneNumbersCommandOutput extends DescribePhoneNumbersR
5959
* ],
6060
* NextToken: "STRING_VALUE",
6161
* MaxResults: Number("int"),
62+
* Owner: "STRING_VALUE",
6263
* };
6364
* const command = new DescribePhoneNumbersCommand(input);
6465
* const response = await client.send(command);

clients/client-pinpoint-sms-voice-v2/src/commands/DescribePoolsCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export interface DescribePoolsCommandOutput extends DescribePoolsResult, __Metad
6262
* ],
6363
* NextToken: "STRING_VALUE",
6464
* MaxResults: Number("int"),
65+
* Owner: "STRING_VALUE",
6566
* };
6667
* const command = new DescribePoolsCommand(input);
6768
* const response = await client.send(command);

clients/client-pinpoint-sms-voice-v2/src/commands/DescribeSenderIdsCommand.ts

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface DescribeSenderIdsCommandOutput extends DescribeSenderIdsResult,
6161
* ],
6262
* NextToken: "STRING_VALUE",
6363
* MaxResults: Number("int"),
64+
* Owner: "STRING_VALUE",
6465
* };
6566
* const command = new DescribeSenderIdsCommand(input);
6667
* const response = await client.send(command);

0 commit comments

Comments
 (0)