setSpendLimitAlertThresholdOverrides()

void setSpendLimitAlertThresholdOverrides(string usn, SubscriptionSpendLimitAlertThresholdOverrideRequest subscriptionSpendLimitAlertThresholdOverrideRequest)

This method sets new alert thresholds for a subscription spend limit. If you have previously changed the spend limit alert thresholds for a subscription, you can also use this method to revert the alert thresholds to their default value.

Parameters

usn
Format: string
Purpose: Specifies the USN of the subscription associated with the spend limit alert thresholds to change.
subscriptionSpendLimitAlertThresholdOverrideRequest
Format: SubscriptionSpendLimitAlertThresholdOverrideRequest XML
Purpose: Defines a SubscriptionSpendLimitAlertThresholdOverrideRequest XML document that specifies the ID of the spend limit and the new alert thresholds.
Smile removes any spend limit alert thresholds that are not specified in this document. If you do not specify any alert thresholds, Smile removes any existing overrides and reverts the alert thresholds to the service default.

Example: Override a spend limit alert threshold

This example changes the alert thresholds for the spend limit with an ID of 7. The new alert thresholds are at 50%, 85% and 100%.

<SubscriptionSpendLimitAlertThresholdOverrideRequest xmlns="http://xml.inomial.com/smile/2.xsd">
  <spendLimitId>7</spendLimitId>
  <AlertThresholdOverrides>
    <alertThreshold>50</alertThreshold>
    <alertThreshold>85</alertThreshold>
    <alertThreshold>100</alertThreshold>
  </AlertThresholdOverrides>
</SubscriptionSpendLimitAlertThresholdOverrideRequest>

Results

This method does not return any output, and changes the value of the spend limit alert thresholds.

There are no messages defined by this method. However, if the new alert thresholds cause a subscription spend limit to cross an alert threshold, Smile emits the SubscriptionSpendLimitStatusUpdated message after the pre-rating process runs.

Faults

NoSuchItemException

This fault is returned when the subscription does not exist.

InvalidRequestException

This fault is returned when the spend limit does not exist, the spend limit or rating period is not associated with the subscription, or an invalid value is provided for the new alert thresholds, for example, a negative number.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.SetSpendLimitAlertThresholdOverrides usn spendLimitId [threshold1 [threshold2...]]
usn
Purpose: Specifies the USN of the subscription associated with the spend limit alert thresholds to change.
spendLimitId
Purpose: Specifies the ID of the spend limit.
threshold1 threshold 2...
Purpose: (Optional) Specifies the space-separated list of new spend limit alert thresholds. Smile removes any alert thresholds that are not in this list. If you do not specify this parameter, Smile removes any existing overrides and reverts the alert thresholds to the service default.
Note: For more information about the Java client and the options it accepts, see Java client syntax.