updateNotifyConfiguration method

Future<UpdateNotifyConfigurationResult> updateNotifyConfiguration({
  1. required String notifyConfigurationId,
  2. String? defaultTemplateId,
  3. bool? deletionProtectionEnabled,
  4. List<NumberCapability>? enabledChannels,
  5. List<String>? enabledCountries,
  6. String? poolId,
})

Updates an existing notify configuration. You can update the default template, pool association, enabled channels, enabled countries, and deletion protection settings.

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

Parameter notifyConfigurationId : The identifier of the notify configuration to update. The NotifyConfigurationId can be found using the DescribeNotifyConfigurations operation.

Parameter defaultTemplateId : The default template identifier to associate with the notify configuration. If specified, this template is used when sending messages without an explicit template identifier. Pass the special value UNSET_DEFAULT_TEMPLATE to clear the current default template from the notify configuration.

Parameter deletionProtectionEnabled : When set to true the notify configuration can't be deleted.

Parameter enabledChannels : An array of channels to enable for the notify configuration. Supported values include SMS and VOICE.

Parameter enabledCountries : An array of two-character ISO country codes, in ISO 3166-1 alpha-2 format, that are enabled for the notify configuration.

Parameter poolId : The pool identifier or Amazon Resource Name (ARN) to associate with the notify configuration. Pass the special value UNSET_DEFAULT_POOL_FOR_NOTIFY to clear the current default pool from the notify configuration.

Implementation

Future<UpdateNotifyConfigurationResult> updateNotifyConfiguration({
  required String notifyConfigurationId,
  String? defaultTemplateId,
  bool? deletionProtectionEnabled,
  List<NumberCapability>? enabledChannels,
  List<String>? enabledCountries,
  String? poolId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.UpdateNotifyConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'NotifyConfigurationId': notifyConfigurationId,
      if (defaultTemplateId != null) 'DefaultTemplateId': defaultTemplateId,
      if (deletionProtectionEnabled != null)
        'DeletionProtectionEnabled': deletionProtectionEnabled,
      if (enabledChannels != null)
        'EnabledChannels': enabledChannels.map((e) => e.value).toList(),
      if (enabledCountries != null) 'EnabledCountries': enabledCountries,
      if (poolId != null) 'PoolId': poolId,
    },
  );

  return UpdateNotifyConfigurationResult.fromJson(jsonResponse.body);
}