updateProtectConfiguration method

Future<UpdateProtectConfigurationResult> updateProtectConfiguration({
  1. required String protectConfigurationId,
  2. bool? deletionProtectionEnabled,
})

Update the setting for an existing protect configuration.

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

Parameter protectConfigurationId : The unique identifier for the protect configuration.

Parameter deletionProtectionEnabled : When set to true deletion protection is enabled. By default this is set to false.

Implementation

Future<UpdateProtectConfigurationResult> updateProtectConfiguration({
  required String protectConfigurationId,
  bool? deletionProtectionEnabled,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PinpointSMSVoiceV2.UpdateProtectConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProtectConfigurationId': protectConfigurationId,
      if (deletionProtectionEnabled != null)
        'DeletionProtectionEnabled': deletionProtectionEnabled,
    },
  );

  return UpdateProtectConfigurationResult.fromJson(jsonResponse.body);
}