UpdateSubscriberCommand

Updates a subscriber.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { BudgetsClient, UpdateSubscriberCommand } from "@aws-sdk/client-budgets"; // ES Modules import
// const { BudgetsClient, UpdateSubscriberCommand } = require("@aws-sdk/client-budgets"); // CommonJS import
const client = new BudgetsClient(config);
const input = { // UpdateSubscriberRequest
  AccountId: "STRING_VALUE", // required
  BudgetName: "STRING_VALUE", // required
  Notification: { // Notification
    NotificationType: "ACTUAL" || "FORECASTED", // required
    ComparisonOperator: "GREATER_THAN" || "LESS_THAN" || "EQUAL_TO", // required
    Threshold: Number("double"), // required
    ThresholdType: "PERCENTAGE" || "ABSOLUTE_VALUE",
    NotificationState: "OK" || "ALARM",
  },
  OldSubscriber: { // Subscriber
    SubscriptionType: "SNS" || "EMAIL", // required
    Address: "STRING_VALUE", // required
  },
  NewSubscriber: {
    SubscriptionType: "SNS" || "EMAIL", // required
    Address: "STRING_VALUE", // required
  },
};
const command = new UpdateSubscriberCommand(input);
const response = await client.send(command);
// {};

UpdateSubscriberCommand Input

See UpdateSubscriberCommandInput for more details

Parameter
Type
Description
AccountId
Required
string | undefined

The accountId that is associated with the budget whose subscriber you want to update.

BudgetName
Required
string | undefined

The name of the budget whose subscriber you want to update.

NewSubscriber
Required
Subscriber | undefined

The updated subscriber that is associated with a budget notification.

Notification
Required
Notification | undefined

The notification whose subscriber you want to update.

OldSubscriber
Required
Subscriber | undefined

The previous subscriber that is associated with a budget notification.

UpdateSubscriberCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
AccessDeniedException
client

You are not authorized to use this operation with the given parameters.

DuplicateRecordException
client

The budget name already exists. Budget names must be unique within an account.

InternalErrorException
server

An error on the server occurred during the processing of your request. Try again later.

InvalidParameterException
client

An error on the client occurred. Typically, the cause is an invalid input value.

NotFoundException
client

We can’t locate the resource that you specified.

ThrottlingException
client

The number of API requests has exceeded the maximum allowed API request throttling limit for the account.

BudgetsServiceException
Base exception class for all service exceptions from Budgets service.