disableAddOn method

Future<DisableAddOnResult> disableAddOn({
  1. required AddOnType addOnType,
  2. required String resourceName,
})

Disables an add-on for an Amazon Lightsail resource. For more information, see the Lightsail Dev Guide.

May throw ServiceException. May throw InvalidInputException. May throw NotFoundException. May throw OperationFailureException. May throw AccessDeniedException. May throw UnauthenticatedException.

Parameter addOnType : The add-on type to disable.

Parameter resourceName : The name of the source resource for which to disable the add-on.

Implementation

Future<DisableAddOnResult> disableAddOn({
  required AddOnType addOnType,
  required String resourceName,
}) async {
  ArgumentError.checkNotNull(addOnType, 'addOnType');
  ArgumentError.checkNotNull(resourceName, 'resourceName');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Lightsail_20161128.DisableAddOn'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'addOnType': addOnType.toValue(),
      'resourceName': resourceName,
    },
  );

  return DisableAddOnResult.fromJson(jsonResponse.body);
}