putCoreNetworkPolicy method
Creates a new, immutable version of a core network policy. A subsequent change set is created showing the differences between the LIVE policy and the submitted policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw CoreNetworkPolicyException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter coreNetworkId :
The ID of a core network.
Parameter policyDocument :
The policy document.
Parameter clientToken :
The client token associated with the request.
Parameter description :
a core network policy description.
Parameter latestVersionId :
The ID of a core network policy.
Implementation
Future<PutCoreNetworkPolicyResponse> putCoreNetworkPolicy({
required String coreNetworkId,
required Object policyDocument,
String? clientToken,
String? description,
int? latestVersionId,
}) async {
final $payload = <String, dynamic>{
'PolicyDocument': jsonEncode(policyDocument),
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'Description': description,
if (latestVersionId != null) 'LatestVersionId': latestVersionId,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/core-networks/${Uri.encodeComponent(coreNetworkId)}/core-network-policy',
exceptionFnMap: _exceptionFns,
);
return PutCoreNetworkPolicyResponse.fromJson(response);
}