createDataProductRevision method
Creates a data product revision.
Prerequisites:
- The original data product must exist in the given domain.
- User must have permissions on the data product.
- The domain must be valid and accessible.
- The new revision name must comply with naming constraints (if required).
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainIdentifier :
The ID of the domain where the data product revision is created.
Parameter identifier :
The ID of the data product revision.
Parameter name :
The name of the data product revision.
Parameter clientToken :
A unique, case-sensitive identifier that is provided to ensure the
idempotency of the request.
Parameter description :
The description of the data product revision.
Parameter formsInput :
The metadata forms of the data product revision.
Parameter glossaryTerms :
The glossary terms of the data product revision.
Parameter items :
The data assets of the data product revision.
Implementation
Future<CreateDataProductRevisionOutput> createDataProductRevision({
required String domainIdentifier,
required String identifier,
required String name,
String? clientToken,
String? description,
List<FormInput>? formsInput,
List<String>? glossaryTerms,
List<DataProductItem>? items,
}) async {
final $payload = <String, dynamic>{
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (formsInput != null) 'formsInput': formsInput,
if (glossaryTerms != null) 'glossaryTerms': glossaryTerms,
if (items != null) 'items': items,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-products/${Uri.encodeComponent(identifier)}/revisions',
exceptionFnMap: _exceptionFns,
);
return CreateDataProductRevisionOutput.fromJson(response);
}