Skip to content

create_asset_type async

create_asset_type(
    domain_identifier: DomainId,
    name: TypeName,
    forms_input: FormsInputMap,
    owning_project_identifier: ProjectId,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional[Description] = None,
) -> CreateAssetTypeOutput

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.

Parameters:

  • domain_identifier (DomainId) –

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

  • name (TypeName) –

    The name of the custom asset type.

  • description (Optional[Description], default: None ) –

    The descripton of the custom asset type.

  • forms_input (FormsInputMap) –

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

  • owning_project_identifier (ProjectId) –

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

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def create_asset_type(
    self,
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    name: "capo_datazone.types.type_name.TypeName",
    forms_input: "capo_datazone.types.forms_input_map.FormsInputMap",
    owning_project_identifier: "capo_datazone.types.project_id.ProjectId",
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
) -> "capo_datazone.types.create_asset_type_output.CreateAssetTypeOutput":
    """<p>Creates a custom asset type.</p> <p>Prerequisites:</p> <ul> <li> <p>The <code>formsInput</code> field is required, however, can be passed as empty (e.g. <code>-forms-input {})</code>. </p> </li> <li> <p>You must have <code>CreateAssetType</code> permissions.</p> </li> <li> <p>The domain-identifier and owning-project-identifier must be valid and active.</p> </li> <li> <p>The name of the asset type must be unique within the domain — duplicate names will cause failure.</p> </li> <li> <p>JSON input must be valid — incorrect formatting causes Invalid JSON errors.</p> </li> </ul>

    Args:
        domain_identifier: <p>The unique identifier of the Amazon DataZone domain where the custom asset type is being created.</p>
        name: <p>The name of the custom asset type.</p>
        description: <p>The descripton of the custom asset type.</p>
        forms_input: <p>The metadata forms that are to be attached to the custom asset type.</p>
        owning_project_identifier: <p>The identifier of the Amazon DataZone project that is to own the custom asset type.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.create_asset_type_input.CreateAssetTypeInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.create_asset_type_output.CreateAssetTypeOutput"
    ]:
        import capo_datazone._operations.data_zone.create_asset_type

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.create_asset_type.async_create_asset_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.create_asset_type_input.CreateAssetTypeInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_asset_type_input

        return capo_datazone.types.create_asset_type_input.redact_sensitive(input_)

    def _redact_output(
        output: "capo_datazone.types.create_asset_type_output.CreateAssetTypeOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_asset_type_output

        return capo_datazone.types.create_asset_type_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAssetType",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_asset_type_input.CreateAssetTypeInput = {
        "domain_identifier": domain_identifier,
        "name": name,
        "forms_input": forms_input,
        "owning_project_identifier": owning_project_identifier,
    }
    if description is not None:
        input_["description"] = description

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output