createCoreNetwork method
Creates a core network as part of your global network, and optionally, with a core network policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw CoreNetworkPolicyException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter globalNetworkId :
The ID of the global network that a core network will be a part of.
Parameter clientToken :
The client token associated with a core network request.
Parameter description :
The description of a core network.
Parameter policyDocument :
The policy document for creating a core network.
Parameter tags :
Key-value tags associated with a core network request.
Implementation
Future<CreateCoreNetworkResponse> createCoreNetwork({
required String globalNetworkId,
String? clientToken,
String? description,
String? policyDocument,
List<Tag>? tags,
}) async {
final $payload = <String, dynamic>{
'GlobalNetworkId': globalNetworkId,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (policyDocument != null) 'PolicyDocument': policyDocument,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/core-networks',
exceptionFnMap: _exceptionFns,
);
return CreateCoreNetworkResponse.fromJson(response);
}