updateProtectConfigurationCountryRuleSet method
Update a country rule set to ALLOW, BLOCK,
MONITOR, or FILTER messages to be sent to the
specified destination counties. You can update one or multiple countries
at a time. The updates are only applied to the specified NumberCapability
type.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter countryRuleSetUpdates :
A map of ProtectConfigurationCountryRuleSetInformation objects that
contain the details for the requested NumberCapability. The Key is the
two-letter ISO country code. For a list of supported ISO country codes,
see Supported
countries and regions (SMS channel) in the End User Messaging SMS User
Guide.
For example, to set the United States as allowed and Canada as blocked,
the CountryRuleSetUpdates would be formatted as:
"CountryRuleSetUpdates": { "US" : { "ProtectStatus": "ALLOW" } "CA"
: { "ProtectStatus": "BLOCK" } }
Parameter numberCapability :
The number capability to apply the CountryRuleSetUpdates updates to.
Parameter protectConfigurationId :
The unique identifier for the protect configuration.
Implementation
Future<UpdateProtectConfigurationCountryRuleSetResult>
updateProtectConfigurationCountryRuleSet({
required Map<String, ProtectConfigurationCountryRuleSetInformation>
countryRuleSetUpdates,
required NumberCapability numberCapability,
required String protectConfigurationId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target':
'PinpointSMSVoiceV2.UpdateProtectConfigurationCountryRuleSet'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'CountryRuleSetUpdates': countryRuleSetUpdates,
'NumberCapability': numberCapability.value,
'ProtectConfigurationId': protectConfigurationId,
},
);
return UpdateProtectConfigurationCountryRuleSetResult.fromJson(
jsonResponse.body);
}