setTemporarySpendLimitOverride()
void setTemporarySpendLimitOverride(string usn, TemporarySubscriptionSpendLimitOverrideRequest temporarySubscriptionSpendLimitOverrideRequest)
This method overrides the value of a subscription spend limit for a specified rating period. Use this method to temporarily increase or decrease the value of a spend limit. If you have previously changed the value of a spend limit, you can also use this method to temporarily revert the spend limit to its default value.
Note that you cannot remove a spend limit from a subscription.
Parameters
- usn
- Format: string
- temporarySubscriptionSpendLimitOverrideRequest
- Format: TemporarySubscriptionSpendLimitOverrideRequest XML
Example: Set a temporary spend limit override
This example changes the value of the spend limit with an ID of 7 to $10 in the current rating period only.
<TemporarySubscriptionSpendLimitOverrideRequest xmlns="http://xml.inomial.com/smile/2.xsd">
<spendLimitId>7</spendLimitId>
<RatingPeriod>
<currentPeriod/>
</RatingPeriod>
<limitOverride>10.00</limitOverride>
</TemporarySubscriptionSpendLimitOverrideRequest>
Results
This method does not return any output, and changes the value of the specified spend limit.
There are no messages defined by this method. However, if the new spend limit value causes the subscription to cross an alert threshold, Smile emits the SubscriptionSpendLimitStatusUpdated message after the pre-rating process runs.
Faults
NoSuchItemExceptionThis fault is returned when the subscription does not exist.
InvalidRequestExceptionThis 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 spend limit, for example, a negative number.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.SetTemporarySpendLimitOverride usn filename
- usn
- Purpose: Specifies the USN of the subscription associated with the spend limit to change.
- filename
- Purpose: Defines the filename of the TemporarySubscriptionSpendLimitOverrideRequest XML document.