createSubscriptionGrant method

Future<CreateSubscriptionGrantOutput> createSubscriptionGrant({
  1. required String domainIdentifier,
  2. required String environmentIdentifier,
  3. required GrantedEntityInput grantedEntity,
  4. List<AssetTargetNameMap>? assetTargetNames,
  5. String? clientToken,
  6. String? subscriptionTargetIdentifier,
})

Creates a subsscription grant in Amazon DataZone.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The ID of the Amazon DataZone domain in which the subscription grant is created.

Parameter environmentIdentifier : The ID of the environment in which the subscription grant is created.

Parameter grantedEntity : The entity to which the subscription is to be granted.

Parameter assetTargetNames : The names of the assets for which the subscription grant is created.

Parameter clientToken : A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

Parameter subscriptionTargetIdentifier : The ID of the subscription target for which the subscription grant is created.

Implementation

Future<CreateSubscriptionGrantOutput> createSubscriptionGrant({
  required String domainIdentifier,
  required String environmentIdentifier,
  required GrantedEntityInput grantedEntity,
  List<AssetTargetNameMap>? assetTargetNames,
  String? clientToken,
  String? subscriptionTargetIdentifier,
}) async {
  final $payload = <String, dynamic>{
    'environmentIdentifier': environmentIdentifier,
    'grantedEntity': grantedEntity,
    if (assetTargetNames != null) 'assetTargetNames': assetTargetNames,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (subscriptionTargetIdentifier != null)
      'subscriptionTargetIdentifier': subscriptionTargetIdentifier,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/subscription-grants',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSubscriptionGrantOutput.fromJson(response);
}