

# UpdatePreferences


Updates a set of preferences for an account in order to add account-specific preferences into the service. These preferences impact how the savings associated with recommendations are presented.

## Request Syntax


```
{
   "memberAccountDiscountVisibility": "string",
   "preferredCommitment": { 
      "paymentOption": "string",
      "term": "string"
   },
   "savingsEstimationMode": "string"
}
```

## Request Parameters


For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [memberAccountDiscountVisibility](#API_CostOptimizationHub_UpdatePreferences_RequestSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-request-memberAccountDiscountVisibility"></a>
Sets the "member account discount visibility" preference.  
Type: String  
Valid Values: `All | None`   
Required: No

 ** [preferredCommitment](#API_CostOptimizationHub_UpdatePreferences_RequestSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-request-preferredCommitment"></a>
Sets the preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.  
Type: [PreferredCommitment](API_CostOptimizationHub_PreferredCommitment.md) object  
Required: No

 ** [savingsEstimationMode](#API_CostOptimizationHub_UpdatePreferences_RequestSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-request-savingsEstimationMode"></a>
Sets the "savings estimation mode" preference.  
Type: String  
Valid Values: `BeforeDiscounts | AfterDiscounts`   
Required: No

## Response Syntax


```
{
   "memberAccountDiscountVisibility": "string",
   "preferredCommitment": { 
      "paymentOption": "string",
      "term": "string"
   },
   "savingsEstimationMode": "string"
}
```

## Response Elements


If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [memberAccountDiscountVisibility](#API_CostOptimizationHub_UpdatePreferences_ResponseSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-response-memberAccountDiscountVisibility"></a>
Shows the status of the "member account discount visibility" preference.  
Type: String  
Valid Values: `All | None` 

 ** [preferredCommitment](#API_CostOptimizationHub_UpdatePreferences_ResponseSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-response-preferredCommitment"></a>
Shows the updated preferences for how Reserved Instances and Savings Plans cost-saving opportunities are prioritized in terms of payment option and term length.  
Type: [PreferredCommitment](API_CostOptimizationHub_PreferredCommitment.md) object

 ** [savingsEstimationMode](#API_CostOptimizationHub_UpdatePreferences_ResponseSyntax) **   <a name="awscostmanagement-CostOptimizationHub_UpdatePreferences-response-savingsEstimationMode"></a>
Shows the status of the "savings estimation mode" preference.  
Type: String  
Valid Values: `BeforeDiscounts | AfterDiscounts` 

## Errors


For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** AccessDeniedException **   
You are not authorized to use this operation with the given parameters.  
HTTP Status Code: 400

 ** InternalServerException **   
An error on the server occurred during the processing of your request. Try again later.  
HTTP Status Code: 500

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 400

 ** ValidationException **   
The input fails to satisfy the constraints specified by an AWS service.    
 ** fields **   
The list of fields that are invalid.  
 ** reason **   
The reason for the validation exception.
HTTP Status Code: 400

## See Also


For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/cost-optimization-hub-2022-07-26/UpdatePreferences) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/cost-optimization-hub-2022-07-26/UpdatePreferences) 