createCidrCollection method

Future<CreateCidrCollectionResponse> createCidrCollection({
  1. required String callerReference,
  2. required String name,
})

Creates a CIDR collection in the current Amazon Web Services account.

May throw CidrCollectionAlreadyExistsException. May throw ConcurrentModification. May throw InvalidInput. May throw LimitsExceeded.

Parameter callerReference : A client-specific token that allows requests to be securely retried so that the intended outcome will only occur once, retries receive a similar response, and there are no additional edge cases to handle.

Parameter name : A unique identifier for the account that can be used to reference the collection from other API calls.

Implementation

Future<CreateCidrCollectionResponse> createCidrCollection({
  required String callerReference,
  required String name,
}) async {
  final $result = await _protocol.sendRaw(
    method: 'POST',
    requestUri: '/2013-04-01/cidrcollection',
    payload: CreateCidrCollectionRequest(
            callerReference: callerReference, name: name)
        .toXml('CreateCidrCollectionRequest'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return CreateCidrCollectionResponse(
    collection:
        _s.extractXmlChild($elem, 'Collection')?.let(CidrCollection.fromXml),
    location: _s.extractHeaderStringValue($result.headers, 'Location'),
  );
}