Skip to content

create_preset async

create_preset(
    *,
    config_overrides: Optional[AsyncMediaConvertClientConfig] = None,
    category: Optional[__string] = None,
    description: Optional[__string] = None,
    name: Optional[__string] = None,
    settings: Optional[PresetSettings] = None,
    tags: Optional[__mapOf__string] = None,
) -> CreatePresetResponse

Create a new preset. For information about job templates see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html

Parameters:

  • category (Optional[__string], default: None ) –

    Optional. A category for the preset you are creating.

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

    Optional. A description of the preset you are creating.

  • name (Optional[__string], default: None ) –

    The name of the preset you are creating.

  • settings (Optional[PresetSettings], default: None ) –

    Settings for preset

  • tags (Optional[__mapOf__string], default: None ) –

    The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.

Raises:

  • BadRequestException –

    The service can't process your request because of a problem in the request. Please check your request form and syntax.

  • ConflictException –

    The service couldn't complete your request because there is a conflict with the current state of the resource.

  • ForbiddenException –

    You don't have permissions for this action with the credentials you sent.

  • InternalServerErrorException –

    The service encountered an unexpected condition and can't fulfill your request.

  • NotFoundException –

    The resource you requested doesn't exist.

  • ServiceQuotaExceededException –

    You attempted to create more resources than the service allows based on service quotas.

  • TooManyRequestsException –

    Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_mediaconvert/_services/async_media_convert.py
async def create_preset(
    self,
    *,
    config_overrides: Optional[AsyncMediaConvertClientConfig] = None,
    category: Optional["capo_mediaconvert.types.__string.__string"] = None,
    description: Optional["capo_mediaconvert.types.__string.__string"] = None,
    name: Optional["capo_mediaconvert.types.__string.__string"] = None,
    settings: Optional[
        "capo_mediaconvert.types.preset_settings.PresetSettings"
    ] = None,
    tags: Optional[
        "capo_mediaconvert.types.__map_of__string.__mapOf__string"
    ] = None,
) -> "capo_mediaconvert.types.create_preset_response.CreatePresetResponse":
    """Create a new preset. For information about job templates see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html

    Args:
        category: Optional. A category for the preset you are creating.
        description: Optional. A description of the preset you are creating.
        name: The name of the preset you are creating.
        settings: Settings for preset
        tags: The tags that you want to add to the resource. You can tag resources with a key-value pair or with only a key.

    Raises:
        capo_mediaconvert.errors.bad_request_exception.BadRequestException: The service can't process your request because of a problem in the request. Please check your request form and syntax.
        capo_mediaconvert.errors.conflict_exception.ConflictException: The service couldn't complete your request because there is a conflict with the current state of the resource.
        capo_mediaconvert.errors.forbidden_exception.ForbiddenException: You don't have permissions for this action with the credentials you sent.
        capo_mediaconvert.errors.internal_server_error_exception.InternalServerErrorException: The service encountered an unexpected condition and can't fulfill your request.
        capo_mediaconvert.errors.not_found_exception.NotFoundException: The resource you requested doesn't exist.
        capo_mediaconvert.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: You attempted to create more resources than the service allows based on service quotas.
        capo_mediaconvert.errors.too_many_requests_exception.TooManyRequestsException: Too many requests have been sent in too short of a time. The service limits the rate at which it will accept requests.
        capo_mediaconvert.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconvert.types.create_preset_request.CreatePresetRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconvert.types.create_preset_response.CreatePresetResponse"
    ]:
        import capo_mediaconvert._operations.media_convert.create_preset

        (
            output,
            http_response,
        ) = await capo_mediaconvert._operations.media_convert.create_preset.async_create_preset(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreatePreset")
    )
    input_: capo_mediaconvert.types.create_preset_request.CreatePresetRequest = {}
    if category is not None:
        input_["category"] = category
    if description is not None:
        input_["description"] = description
    if name is not None:
        input_["name"] = name
    if settings is not None:
        input_["settings"] = settings
    if tags is not None:
        input_["tags"] = tags

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