updateCustomRoutingAccelerator method

Future<UpdateCustomRoutingAcceleratorResponse> updateCustomRoutingAccelerator({
  1. required String acceleratorArn,
  2. bool? enabled,
  3. IpAddressType? ipAddressType,
  4. List<String>? ipAddresses,
  5. String? name,
})

Update a custom routing accelerator.

May throw AcceleratorNotFoundException. May throw ConflictException. May throw InternalServiceErrorException. May throw InvalidArgumentException. May throw TransactionInProgressException.

Parameter acceleratorArn : The Amazon Resource Name (ARN) of the accelerator to update.

Parameter enabled : Indicates whether an accelerator is enabled. The value is true or false. The default value is true.

If the value is set to true, the accelerator cannot be deleted. If set to false, the accelerator can be deleted.

Parameter ipAddressType : The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.

Parameter ipAddresses : The IP addresses for an accelerator.

Parameter name : The name of the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.

Implementation

Future<UpdateCustomRoutingAcceleratorResponse>
    updateCustomRoutingAccelerator({
  required String acceleratorArn,
  bool? enabled,
  IpAddressType? ipAddressType,
  List<String>? ipAddresses,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'GlobalAccelerator_V20180706.UpdateCustomRoutingAccelerator'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AcceleratorArn': acceleratorArn,
      if (enabled != null) 'Enabled': enabled,
      if (ipAddressType != null) 'IpAddressType': ipAddressType.value,
      if (ipAddresses != null) 'IpAddresses': ipAddresses,
      if (name != null) 'Name': name,
    },
  );

  return UpdateCustomRoutingAcceleratorResponse.fromJson(jsonResponse.body);
}