Skip to content

put_asset_type

put_asset_type(
    name: AssetTypeName,
    forms: AssetTypeFormsMap,
    *,
    config_overrides: Optional[GlueClientConfig] = 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/glue.py
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[GlueClientConfig] = 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.
    """

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

        output, http_response = (
            capo_glue._operations.aws_glue.put_asset_type.put_asset_type(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output