createDataProduct method
Creates a data product.
A data product is a comprehensive package that combines data assets with their associated metadata, documentation, and access controls. It's designed to serve specific business needs or use cases, making it easier for users to find and consume data appropriately. Data products include important information about data quality, freshness, and usage guidelines, effectively bridging the gap between data producers and consumers while ensuring proper governance.
Prerequisites:
- The domain must exist and be accessible.
- The owning project must be valid and active.
- The name must be unique within the domain (no existing data product with the same name).
- User must have create permissions for data products in the project.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainIdentifier :
The ID of the domain where the data product is created.
Parameter name :
The name of the data product.
Parameter owningProjectIdentifier :
The ID of the owning project of the data product.
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.
Parameter formsInput :
The metadata forms of the data product.
Parameter glossaryTerms :
The glossary terms of the data product.
Parameter items :
The data assets of the data product.
Implementation
Future<CreateDataProductOutput> createDataProduct({
required String domainIdentifier,
required String name,
required String owningProjectIdentifier,
String? clientToken,
String? description,
List<FormInput>? formsInput,
List<String>? glossaryTerms,
List<DataProductItem>? items,
}) async {
final $payload = <String, dynamic>{
'name': name,
'owningProjectIdentifier': owningProjectIdentifier,
'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',
exceptionFnMap: _exceptionFns,
);
return CreateDataProductOutput.fromJson(response);
}