provisionByoipCidr method

Future<ProvisionByoipCidrResponse> provisionByoipCidr({
  1. required String cidr,
  2. required CidrAuthorizationContext cidrAuthorizationContext,
})

Provisions an IP address range to use with your AWS resources through bring your own IP addresses (BYOIP) and creates a corresponding address pool. After the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr.

For more information, see Bring Your Own IP Addresses (BYOIP) in the AWS Global Accelerator Developer Guide.

May throw InternalServiceErrorException. May throw InvalidArgumentException. May throw LimitExceededException. May throw AccessDeniedException. May throw IncorrectCidrStateException.

Parameter cidr : The public IPv4 address range, in CIDR notation. The most specific IP prefix that you can specify is /24. The address range cannot overlap with another address range that you've brought to this or another Region.

Parameter cidrAuthorizationContext : A signed document that proves that you are authorized to bring the specified IP address range to Amazon using BYOIP.

Implementation

Future<ProvisionByoipCidrResponse> provisionByoipCidr({
  required String cidr,
  required CidrAuthorizationContext cidrAuthorizationContext,
}) async {
  ArgumentError.checkNotNull(cidr, 'cidr');
  _s.validateStringLength(
    'cidr',
    cidr,
    0,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(
      cidrAuthorizationContext, 'cidrAuthorizationContext');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GlobalAccelerator_V20180706.ProvisionByoipCidr'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Cidr': cidr,
      'CidrAuthorizationContext': cidrAuthorizationContext,
    },
  );

  return ProvisionByoipCidrResponse.fromJson(jsonResponse.body);
}