createAssetType method

Future<CreateAssetTypeOutput> createAssetType({
  1. required String domainIdentifier,
  2. required Map<String, FormEntryInput> formsInput,
  3. required String name,
  4. required String owningProjectIdentifier,
  5. String? description,
})

Creates a custom asset type.

Prerequisites:

  • The formsInput field is required, however, can be passed as empty (e.g. -forms-input {}).
  • You must have CreateAssetType permissions.
  • The domain-identifier and owning-project-identifier must be valid and active.
  • The name of the asset type must be unique within the domain — duplicate names will cause failure.
  • JSON input must be valid — incorrect formatting causes Invalid JSON errors.

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

Parameter domainIdentifier : The unique identifier of the Amazon DataZone domain where the custom asset type is being created.

Parameter formsInput : The metadata forms that are to be attached to the custom asset type.

Parameter name : The name of the custom asset type.

Parameter owningProjectIdentifier : The identifier of the Amazon DataZone project that is to own the custom asset type.

Parameter description : The descripton of the custom asset type.

Implementation

Future<CreateAssetTypeOutput> createAssetType({
  required String domainIdentifier,
  required Map<String, FormEntryInput> formsInput,
  required String name,
  required String owningProjectIdentifier,
  String? description,
}) async {
  final $payload = <String, dynamic>{
    'formsInput': formsInput,
    'name': name,
    'owningProjectIdentifier': owningProjectIdentifier,
    if (description != null) 'description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/asset-types',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAssetTypeOutput.fromJson(response);
}