createLicenseAssetRuleset method

Future<CreateLicenseAssetRulesetResponse> createLicenseAssetRuleset({
  1. required String clientToken,
  2. required String name,
  3. required List<LicenseAssetRule> rules,
  4. String? description,
  5. List<Tag>? tags,
})

Creates a license asset ruleset.

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

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

Parameter name : License asset ruleset name.

Parameter rules : License asset rules.

Parameter description : License asset ruleset description.

Parameter tags : Tags to add to the license asset ruleset.

Implementation

Future<CreateLicenseAssetRulesetResponse> createLicenseAssetRuleset({
  required String clientToken,
  required String name,
  required List<LicenseAssetRule> rules,
  String? description,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.CreateLicenseAssetRuleset'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClientToken': clientToken,
      'Name': name,
      'Rules': rules,
      if (description != null) 'Description': description,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateLicenseAssetRulesetResponse.fromJson(jsonResponse.body);
}