createGrantVersion method

Future<CreateGrantVersionResponse> createGrantVersion({
  1. required String clientToken,
  2. required String grantArn,
  3. List<AllowedOperation>? allowedOperations,
  4. String? grantName,
  5. Options? options,
  6. String? sourceVersion,
  7. GrantStatus? status,
  8. String? statusReason,
})

Creates a new version of the specified grant. For more information, see Granted licenses in License Manager in the License Manager User Guide.

May throw AccessDeniedException. May throw AuthorizationException. May throw InvalidParameterValueException. May throw RateLimitExceededException. May throw ResourceLimitExceededException. May throw ServerInternalException. May throw ValidationException.

Parameter clientToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter grantArn : Amazon Resource Name (ARN) of the grant.

Parameter allowedOperations : Allowed operations for the grant.

Parameter grantName : Grant name.

Parameter options : The options specified for the grant.

Parameter sourceVersion : Current version of the grant.

Parameter status : Grant status.

Parameter statusReason : Grant status reason.

Implementation

Future<CreateGrantVersionResponse> createGrantVersion({
  required String clientToken,
  required String grantArn,
  List<AllowedOperation>? allowedOperations,
  String? grantName,
  Options? options,
  String? sourceVersion,
  GrantStatus? status,
  String? statusReason,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.CreateGrantVersion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClientToken': clientToken,
      'GrantArn': grantArn,
      if (allowedOperations != null)
        'AllowedOperations': allowedOperations.map((e) => e.value).toList(),
      if (grantName != null) 'GrantName': grantName,
      if (options != null) 'Options': options,
      if (sourceVersion != null) 'SourceVersion': sourceVersion,
      if (status != null) 'Status': status.value,
      if (statusReason != null) 'StatusReason': statusReason,
    },
  );

  return CreateGrantVersionResponse.fromJson(jsonResponse.body);
}