Skip to content

put_asset_type async

put_asset_type(
    name: AssetTypeName,
    forms: AssetTypeFormsMap,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    client_token: Optional[HashString] = None,
) -> PutAssetTypeResponse

Creates or updates an asset type in Glue Data Catalog. An asset type defines the structure of assets by specifying which forms they include. If an asset type with the given name already exists, it is updated.

Parameters:

  • name (AssetTypeName) –

    The name of the asset type.

  • forms (AssetTypeFormsMap) –

    The forms that make up the asset type, keyed by form name. Each entry references the form type that defines the form's schema.

  • client_token (Optional[HashString], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def put_asset_type(
    self,
    name: "capo_glue.types.asset_type_name.AssetTypeName",
    forms: "capo_glue.types.asset_type_forms_map.AssetTypeFormsMap",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    client_token: Optional["capo_glue.types.hash_string.HashString"] = None,
) -> "capo_glue.types.put_asset_type_response.PutAssetTypeResponse":
    """<p>Creates or updates an asset type in Glue Data Catalog. An asset type defines the structure of assets by specifying which forms they include. If an asset type with the given name already exists, it is updated.</p>

    Args:
        name: <p>The name of the asset type.</p>
        forms: <p>The forms that make up the asset type, keyed by form name. Each entry references the form type that defines the form's schema.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        capo_glue.errors.access_denied_exception.AccessDeniedException: <p>Access to a resource was denied.</p>
        capo_glue.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Two processes are trying to modify a resource simultaneously.</p>
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.throttling_exception.ThrottlingException: <p>The throttling threshhold was exceeded.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.put_asset_type_request.PutAssetTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.put_asset_type_response.PutAssetTypeResponse"
    ]:
        import capo_glue._operations.aws_glue.put_asset_type

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.put_asset_type.async_put_asset_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutAssetType")
    )
    input_: capo_glue.types.put_asset_type_request.PutAssetTypeRequest = {
        "name": name,
        "forms": forms,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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