Skip to content

Commit

Permalink
feat(client-pinpoint-sms-voice-v2): AWS End User Messaging SMS-Voice …
Browse files Browse the repository at this point in the history
…V2 has added support for resource policies. Use the three new APIs to create, view, edit, and delete resource policies.
  • Loading branch information
awstools committed Sep 24, 2024
1 parent 8212995 commit b449c45
Show file tree
Hide file tree
Showing 14 changed files with 1,150 additions and 28 deletions.
24 changes: 24 additions & 0 deletions clients/client-pinpoint-sms-voice-v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,14 @@ DeleteRegistrationFieldValue

[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/)

</details>
<details>
<summary>
DeleteResourcePolicy
</summary>

[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/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -650,6 +658,14 @@ GetProtectConfigurationCountryRuleSet

[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/)

</details>
<details>
<summary>
GetResourcePolicy
</summary>

[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/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -698,6 +714,14 @@ PutRegistrationFieldValue

[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/)

</details>
<details>
<summary>
PutResourcePolicy
</summary>

[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/)

</details>
<details>
<summary>
Expand Down
69 changes: 69 additions & 0 deletions clients/client-pinpoint-sms-voice-v2/src/PinpointSMSVoiceV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ import {
DeleteRegistrationFieldValueCommandInput,
DeleteRegistrationFieldValueCommandOutput,
} from "./commands/DeleteRegistrationFieldValueCommand";
import {
DeleteResourcePolicyCommand,
DeleteResourcePolicyCommandInput,
DeleteResourcePolicyCommandOutput,
} from "./commands/DeleteResourcePolicyCommand";
import {
DeleteTextMessageSpendLimitOverrideCommand,
DeleteTextMessageSpendLimitOverrideCommandInput,
Expand Down Expand Up @@ -254,6 +259,11 @@ import {
GetProtectConfigurationCountryRuleSetCommandInput,
GetProtectConfigurationCountryRuleSetCommandOutput,
} from "./commands/GetProtectConfigurationCountryRuleSetCommand";
import {
GetResourcePolicyCommand,
GetResourcePolicyCommandInput,
GetResourcePolicyCommandOutput,
} from "./commands/GetResourcePolicyCommand";
import {
ListPoolOriginationIdentitiesCommand,
ListPoolOriginationIdentitiesCommandInput,
Expand All @@ -280,6 +290,11 @@ import {
PutRegistrationFieldValueCommandInput,
PutRegistrationFieldValueCommandOutput,
} from "./commands/PutRegistrationFieldValueCommand";
import {
PutResourcePolicyCommand,
PutResourcePolicyCommandInput,
PutResourcePolicyCommandOutput,
} from "./commands/PutResourcePolicyCommand";
import {
ReleasePhoneNumberCommand,
ReleasePhoneNumberCommandInput,
Expand Down Expand Up @@ -421,6 +436,7 @@ const commands = {
DeleteRegistrationCommand,
DeleteRegistrationAttachmentCommand,
DeleteRegistrationFieldValueCommand,
DeleteResourcePolicyCommand,
DeleteTextMessageSpendLimitOverrideCommand,
DeleteVerifiedDestinationNumberCommand,
DeleteVoiceMessageSpendLimitOverrideCommand,
Expand All @@ -447,12 +463,14 @@ const commands = {
DisassociateProtectConfigurationCommand,
DiscardRegistrationVersionCommand,
GetProtectConfigurationCountryRuleSetCommand,
GetResourcePolicyCommand,
ListPoolOriginationIdentitiesCommand,
ListRegistrationAssociationsCommand,
ListTagsForResourceCommand,
PutKeywordCommand,
PutOptedOutNumberCommand,
PutRegistrationFieldValueCommand,
PutResourcePolicyCommand,
ReleasePhoneNumberCommand,
ReleaseSenderIdCommand,
RequestPhoneNumberCommand,
Expand Down Expand Up @@ -908,6 +926,23 @@ export interface PinpointSMSVoiceV2 {
cb: (err: any, data?: DeleteRegistrationFieldValueCommandOutput) => void
): void;

/**
* @see {@link DeleteResourcePolicyCommand}
*/
deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteResourcePolicyCommandOutput>;
deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
): void;
deleteResourcePolicy(
args: DeleteResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteResourcePolicyCommandOutput) => void
): void;

/**
* @see {@link DeleteTextMessageSpendLimitOverrideCommand}
*/
Expand Down Expand Up @@ -1359,6 +1394,23 @@ export interface PinpointSMSVoiceV2 {
cb: (err: any, data?: GetProtectConfigurationCountryRuleSetCommandOutput) => void
): void;

/**
* @see {@link GetResourcePolicyCommand}
*/
getResourcePolicy(
args: GetResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<GetResourcePolicyCommandOutput>;
getResourcePolicy(
args: GetResourcePolicyCommandInput,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;
getResourcePolicy(
args: GetResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetResourcePolicyCommandOutput) => void
): void;

/**
* @see {@link ListPoolOriginationIdentitiesCommand}
*/
Expand Down Expand Up @@ -1455,6 +1507,23 @@ export interface PinpointSMSVoiceV2 {
cb: (err: any, data?: PutRegistrationFieldValueCommandOutput) => void
): void;

/**
* @see {@link PutResourcePolicyCommand}
*/
putResourcePolicy(
args: PutResourcePolicyCommandInput,
options?: __HttpHandlerOptions
): Promise<PutResourcePolicyCommandOutput>;
putResourcePolicy(
args: PutResourcePolicyCommandInput,
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
): void;
putResourcePolicy(
args: PutResourcePolicyCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutResourcePolicyCommandOutput) => void
): void;

/**
* @see {@link ReleasePhoneNumberCommand}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ import {
DeleteRegistrationFieldValueCommandInput,
DeleteRegistrationFieldValueCommandOutput,
} from "./commands/DeleteRegistrationFieldValueCommand";
import {
DeleteResourcePolicyCommandInput,
DeleteResourcePolicyCommandOutput,
} from "./commands/DeleteResourcePolicyCommand";
import {
DeleteTextMessageSpendLimitOverrideCommandInput,
DeleteTextMessageSpendLimitOverrideCommandOutput,
Expand Down Expand Up @@ -231,6 +235,7 @@ import {
GetProtectConfigurationCountryRuleSetCommandInput,
GetProtectConfigurationCountryRuleSetCommandOutput,
} from "./commands/GetProtectConfigurationCountryRuleSetCommand";
import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand";
import {
ListPoolOriginationIdentitiesCommandInput,
ListPoolOriginationIdentitiesCommandOutput,
Expand All @@ -249,6 +254,7 @@ import {
PutRegistrationFieldValueCommandInput,
PutRegistrationFieldValueCommandOutput,
} from "./commands/PutRegistrationFieldValueCommand";
import { PutResourcePolicyCommandInput, PutResourcePolicyCommandOutput } from "./commands/PutResourcePolicyCommand";
import { ReleasePhoneNumberCommandInput, ReleasePhoneNumberCommandOutput } from "./commands/ReleasePhoneNumberCommand";
import { ReleaseSenderIdCommandInput, ReleaseSenderIdCommandOutput } from "./commands/ReleaseSenderIdCommand";
import { RequestPhoneNumberCommandInput, RequestPhoneNumberCommandOutput } from "./commands/RequestPhoneNumberCommand";
Expand Down Expand Up @@ -347,6 +353,7 @@ export type ServiceInputTypes =
| DeleteRegistrationAttachmentCommandInput
| DeleteRegistrationCommandInput
| DeleteRegistrationFieldValueCommandInput
| DeleteResourcePolicyCommandInput
| DeleteTextMessageSpendLimitOverrideCommandInput
| DeleteVerifiedDestinationNumberCommandInput
| DeleteVoiceMessageSpendLimitOverrideCommandInput
Expand All @@ -373,12 +380,14 @@ export type ServiceInputTypes =
| DisassociateProtectConfigurationCommandInput
| DiscardRegistrationVersionCommandInput
| GetProtectConfigurationCountryRuleSetCommandInput
| GetResourcePolicyCommandInput
| ListPoolOriginationIdentitiesCommandInput
| ListRegistrationAssociationsCommandInput
| ListTagsForResourceCommandInput
| PutKeywordCommandInput
| PutOptedOutNumberCommandInput
| PutRegistrationFieldValueCommandInput
| PutResourcePolicyCommandInput
| ReleasePhoneNumberCommandInput
| ReleaseSenderIdCommandInput
| RequestPhoneNumberCommandInput
Expand Down Expand Up @@ -434,6 +443,7 @@ export type ServiceOutputTypes =
| DeleteRegistrationAttachmentCommandOutput
| DeleteRegistrationCommandOutput
| DeleteRegistrationFieldValueCommandOutput
| DeleteResourcePolicyCommandOutput
| DeleteTextMessageSpendLimitOverrideCommandOutput
| DeleteVerifiedDestinationNumberCommandOutput
| DeleteVoiceMessageSpendLimitOverrideCommandOutput
Expand All @@ -460,12 +470,14 @@ export type ServiceOutputTypes =
| DisassociateProtectConfigurationCommandOutput
| DiscardRegistrationVersionCommandOutput
| GetProtectConfigurationCountryRuleSetCommandOutput
| GetResourcePolicyCommandOutput
| ListPoolOriginationIdentitiesCommandOutput
| ListRegistrationAssociationsCommandOutput
| ListTagsForResourceCommandOutput
| PutKeywordCommandOutput
| PutOptedOutNumberCommandOutput
| PutRegistrationFieldValueCommandOutput
| PutResourcePolicyCommandOutput
| ReleasePhoneNumberCommandOutput
| ReleaseSenderIdCommandOutput
| RequestPhoneNumberCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { DeleteResourcePolicyRequest, DeleteResourcePolicyResult } from "../models/models_0";
import {
PinpointSMSVoiceV2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../PinpointSMSVoiceV2Client";
import { de_DeleteResourcePolicyCommand, se_DeleteResourcePolicyCommand } from "../protocols/Aws_json1_0";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link DeleteResourcePolicyCommand}.
*/
export interface DeleteResourcePolicyCommandInput extends DeleteResourcePolicyRequest {}
/**
* @public
*
* The output of {@link DeleteResourcePolicyCommand}.
*/
export interface DeleteResourcePolicyCommandOutput extends DeleteResourcePolicyResult, __MetadataBearer {}

/**
* <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>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { PinpointSMSVoiceV2Client, DeleteResourcePolicyCommand } from "@aws-sdk/client-pinpoint-sms-voice-v2"; // ES Modules import
* // const { PinpointSMSVoiceV2Client, DeleteResourcePolicyCommand } = require("@aws-sdk/client-pinpoint-sms-voice-v2"); // CommonJS import
* const client = new PinpointSMSVoiceV2Client(config);
* const input = { // DeleteResourcePolicyRequest
* ResourceArn: "STRING_VALUE", // required
* };
* const command = new DeleteResourcePolicyCommand(input);
* const response = await client.send(command);
* // { // DeleteResourcePolicyResult
* // ResourceArn: "STRING_VALUE",
* // Policy: "STRING_VALUE",
* // CreatedTimestamp: new Date("TIMESTAMP"),
* // };
*
* ```
*
* @param DeleteResourcePolicyCommandInput - {@link DeleteResourcePolicyCommandInput}
* @returns {@link DeleteResourcePolicyCommandOutput}
* @see {@link DeleteResourcePolicyCommandInput} for command's `input` shape.
* @see {@link DeleteResourcePolicyCommandOutput} for command's `response` shape.
* @see {@link PinpointSMSVoiceV2ClientResolvedConfig | config} for PinpointSMSVoiceV2Client's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>The request was denied because you don't have sufficient permissions to access the
* resource.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>The API encountered an unexpected error and couldn't complete the request. You might
* be able to successfully issue the request again in the future.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>A requested resource couldn't be found.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>An error that occurred because too many requests were sent during a certain amount of
* time.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>A validation exception for a field.</p>
*
* @throws {@link PinpointSMSVoiceV2ServiceException}
* <p>Base exception class for all service exceptions from PinpointSMSVoiceV2 service.</p>
*
* @public
*/
export class DeleteResourcePolicyCommand extends $Command
.classBuilder<
DeleteResourcePolicyCommandInput,
DeleteResourcePolicyCommandOutput,
PinpointSMSVoiceV2ClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: PinpointSMSVoiceV2ClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("PinpointSMSVoiceV2", "DeleteResourcePolicy", {})
.n("PinpointSMSVoiceV2Client", "DeleteResourcePolicyCommand")
.f(void 0, void 0)
.ser(se_DeleteResourcePolicyCommand)
.de(de_DeleteResourcePolicyCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: DeleteResourcePolicyRequest;
output: DeleteResourcePolicyResult;
};
sdk: {
input: DeleteResourcePolicyCommandInput;
output: DeleteResourcePolicyCommandOutput;
};
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface DescribeOptOutListsCommandOutput extends DescribeOptOutListsRes
* ],
* NextToken: "STRING_VALUE",
* MaxResults: Number("int"),
* Owner: "STRING_VALUE",
* };
* const command = new DescribeOptOutListsCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface DescribePhoneNumbersCommandOutput extends DescribePhoneNumbersR
* ],
* NextToken: "STRING_VALUE",
* MaxResults: Number("int"),
* Owner: "STRING_VALUE",
* };
* const command = new DescribePhoneNumbersCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface DescribePoolsCommandOutput extends DescribePoolsResult, __Metad
* ],
* NextToken: "STRING_VALUE",
* MaxResults: Number("int"),
* Owner: "STRING_VALUE",
* };
* const command = new DescribePoolsCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface DescribeSenderIdsCommandOutput extends DescribeSenderIdsResult,
* ],
* NextToken: "STRING_VALUE",
* MaxResults: Number("int"),
* Owner: "STRING_VALUE",
* };
* const command = new DescribeSenderIdsCommand(input);
* const response = await client.send(command);
Expand Down
Loading

0 comments on commit b449c45

Please sign in to comment.