createListingChangeSet method

Future<CreateListingChangeSetOutput> createListingChangeSet({
  1. required ChangeAction action,
  2. required String domainIdentifier,
  3. required String entityIdentifier,
  4. required EntityType entityType,
  5. String? clientToken,
  6. String? entityRevision,
})

Publishes a listing (a record of an asset at a given time) or removes a listing from the catalog.

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

Parameter action : Specifies whether to publish or unpublish a listing.

Parameter domainIdentifier : The ID of the Amazon DataZone domain.

Parameter entityIdentifier : The ID of the asset.

Parameter entityType : The type of an entity.

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

Parameter entityRevision : The revision of an asset.

Implementation

Future<CreateListingChangeSetOutput> createListingChangeSet({
  required ChangeAction action,
  required String domainIdentifier,
  required String entityIdentifier,
  required EntityType entityType,
  String? clientToken,
  String? entityRevision,
}) async {
  final $payload = <String, dynamic>{
    'action': action.value,
    'entityIdentifier': entityIdentifier,
    'entityType': entityType.value,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (entityRevision != null) 'entityRevision': entityRevision,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/listings/change-set',
    exceptionFnMap: _exceptionFns,
  );
  return CreateListingChangeSetOutput.fromJson(response);
}