Skip to content

update_slot_type async

update_slot_type(
    slot_type_id: Id,
    slot_type_name: Name,
    bot_id: Id,
    bot_version: DraftBotVersion,
    locale_id: LocaleId,
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    description: Optional[Description] = None,
    slot_type_values: Optional[SlotTypeValues] = None,
    value_selection_setting: Optional[SlotValueSelectionSetting] = None,
    parent_slot_type_signature: Optional[SlotTypeSignature] = None,
    external_source_setting: Optional[ExternalSourceSetting] = None,
    composite_slot_type_setting: Optional[CompositeSlotTypeSetting] = None,
) -> UpdateSlotTypeResponse

Updates the configuration of an existing slot type.

Parameters:

  • slot_type_id (Id) –

    The unique identifier of the slot type to update.

  • slot_type_name (Name) –

    The new name of the slot type.

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

    The new description of the slot type.

  • slot_type_values (Optional[SlotTypeValues], default: None ) –

    A new list of values and their optional synonyms that define the values that the slot type can take.

  • value_selection_setting (Optional[SlotValueSelectionSetting], default: None ) –

    The strategy that Amazon Lex should use when deciding on a value from the list of slot type values.

  • parent_slot_type_signature (Optional[SlotTypeSignature], default: None ) –

    The new built-in slot type that should be used as the parent of this slot type.

  • bot_id (Id) –

    The identifier of the bot that contains the slot type.

  • bot_version (DraftBotVersion) –

    The version of the bot that contains the slot type. Must be DRAFT.

  • locale_id (LocaleId) –

    The identifier of the language and locale that contains the slot type. The string must match one of the supported locales. For more information, see Supported languages.

  • composite_slot_type_setting (Optional[CompositeSlotTypeSetting], default: None ) –

    Specifications for a composite slot type.

Raises:

  • ConflictException –

    The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • PreconditionFailedException –

    Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.

  • ServiceQuotaExceededException –

    You have reached a quota for your bot.

  • ThrottlingException –

    Your request rate is too high. Reduce the frequency of requests.

  • ValidationException –

    One of the input parameters in your request isn't valid. Check the parameters and try your request again.

  • UnknownServiceError –

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

Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
async def update_slot_type(
    self,
    slot_type_id: "capo_lex_models_v2.types.id.Id",
    slot_type_name: "capo_lex_models_v2.types.name.Name",
    bot_id: "capo_lex_models_v2.types.id.Id",
    bot_version: "capo_lex_models_v2.types.draft_bot_version.DraftBotVersion",
    locale_id: "capo_lex_models_v2.types.locale_id.LocaleId",
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    description: Optional[
        "capo_lex_models_v2.types.description.Description"
    ] = None,
    slot_type_values: Optional[
        "capo_lex_models_v2.types.slot_type_values.SlotTypeValues"
    ] = None,
    value_selection_setting: Optional[
        "capo_lex_models_v2.types.slot_value_selection_setting.SlotValueSelectionSetting"
    ] = None,
    parent_slot_type_signature: Optional[
        "capo_lex_models_v2.types.slot_type_signature.SlotTypeSignature"
    ] = None,
    external_source_setting: Optional[
        "capo_lex_models_v2.types.external_source_setting.ExternalSourceSetting"
    ] = None,
    composite_slot_type_setting: Optional[
        "capo_lex_models_v2.types.composite_slot_type_setting.CompositeSlotTypeSetting"
    ] = None,
) -> "capo_lex_models_v2.types.update_slot_type_response.UpdateSlotTypeResponse":
    """<p>Updates the configuration of an existing slot type.</p>

    Args:
        slot_type_id: <p>The unique identifier of the slot type to update.</p>
        slot_type_name: <p>The new name of the slot type.</p>
        description: <p>The new description of the slot type.</p>
        slot_type_values: <p>A new list of values and their optional synonyms that define the values that the slot type can take.</p>
        value_selection_setting: <p>The strategy that Amazon Lex should use when deciding on a value from the list of slot type values.</p>
        parent_slot_type_signature: <p>The new built-in slot type that should be used as the parent of this slot type.</p>
        bot_id: <p>The identifier of the bot that contains the slot type.</p>
        bot_version: <p>The version of the bot that contains the slot type. Must be <code>DRAFT</code>.</p>
        locale_id: <p>The identifier of the language and locale that contains the slot type. The string must match one of the supported locales. For more information, see <a href="https://docs.aws.amazon.com/lexv2/latest/dg/how-languages.html">Supported languages</a>.</p>
        composite_slot_type_setting: <p>Specifications for a composite slot type.</p>

    Raises:
        capo_lex_models_v2.errors.conflict_exception.ConflictException: <p>The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again. </p>
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.precondition_failed_exception.PreconditionFailedException: <p>Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_models_v2.types.update_slot_type_request.UpdateSlotTypeRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_models_v2.types.update_slot_type_response.UpdateSlotTypeResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.update_slot_type

        (
            output,
            http_response,
        ) = await capo_lex_models_v2._operations.lex_model_building_service_v2.update_slot_type.async_update_slot_type(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateSlotType")
    )
    input_: capo_lex_models_v2.types.update_slot_type_request.UpdateSlotTypeRequest = {
        "slot_type_id": slot_type_id,
        "slot_type_name": slot_type_name,
        "bot_id": bot_id,
        "bot_version": bot_version,
        "locale_id": locale_id,
    }
    if description is not None:
        input_["description"] = description
    if slot_type_values is not None:
        input_["slot_type_values"] = slot_type_values
    if value_selection_setting is not None:
        input_["value_selection_setting"] = value_selection_setting
    if parent_slot_type_signature is not None:
        input_["parent_slot_type_signature"] = parent_slot_type_signature
    if external_source_setting is not None:
        input_["external_source_setting"] = external_source_setting
    if composite_slot_type_setting is not None:
        input_["composite_slot_type_setting"] = composite_slot_type_setting

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