setDefaultSenderId method

Future<SetDefaultSenderIdResult> setDefaultSenderId({
  1. required String configurationSetName,
  2. required String senderId,
})

Sets default sender ID on a configuration set.

When sending a text message to a destination country that supports sender IDs, the default sender ID on the configuration set specified will be used if no dedicated origination phone numbers or registered sender IDs are available in your account.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter configurationSetName : The configuration set to updated with a new default SenderId. This field can be the ConsigurationSetName or ConfigurationSetArn.

Parameter senderId : The current sender ID for the configuration set. When sending a text message to a destination country which supports SenderIds, the default sender ID on the configuration set specified on SendTextMessage will be used if no dedicated origination phone numbers or registered SenderIds are available in your account, instead of a generic sender ID, such as 'NOTICE'.

Implementation

Future<SetDefaultSenderIdResult> setDefaultSenderId({
  required String configurationSetName,
  required String senderId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.SetDefaultSenderId'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigurationSetName': configurationSetName,
      'SenderId': senderId,
    },
  );

  return SetDefaultSenderIdResult.fromJson(jsonResponse.body);
}