Skip to content

get_migrations async

get_migrations(
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    sort_by_attribute: Optional[MigrationSortAttribute] = None,
    sort_by_order: Optional[SortOrder] = None,
    v1_bot_name_contains: Optional[BotName] = None,
    migration_status_equals: Optional[MigrationStatus] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> GetMigrationsResponse

Gets a list of migrations between Amazon Lex V1 and Amazon Lex V2.

Parameters:

  • sort_by_attribute (Optional[MigrationSortAttribute], default: None ) –

    The field to sort the list of migrations by. You can sort by the Amazon Lex V1 bot name or the date and time that the migration was started.

  • sort_by_order (Optional[SortOrder], default: None ) –

    The order so sort the list.

  • v1_bot_name_contains (Optional[BotName], default: None ) –

    Filters the list to contain only bots whose name contains the specified string. The string is matched anywhere in bot name.

  • migration_status_equals (Optional[MigrationStatus], default: None ) –

    Filters the list to contain only migrations in the specified state.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of migrations to return in the response. The default is 10.

  • next_token (Optional[NextToken], default: None ) –

    A pagination token that fetches the next page of migrations. If the response to this operation is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of migrations, specify the pagination token in the request.

Raises:

  • BadRequestException –

    The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.

  • InternalFailureException –

    An internal Amazon Lex error occurred. Try your request again.

  • LimitExceededException –

    The request exceeded a limit. Try your request again.

  • UnknownServiceError –

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

Source code in docs_src/capo_lex_model_building_service/_services/async_lex_model_building_service.py
async def get_migrations(
    self,
    *,
    config_overrides: Optional[AsyncLexModelBuildingServiceClientConfig] = None,
    sort_by_attribute: Optional[
        "capo_lex_model_building_service.types.migration_sort_attribute.MigrationSortAttribute"
    ] = None,
    sort_by_order: Optional[
        "capo_lex_model_building_service.types.sort_order.SortOrder"
    ] = None,
    v1_bot_name_contains: Optional[
        "capo_lex_model_building_service.types.bot_name.BotName"
    ] = None,
    migration_status_equals: Optional[
        "capo_lex_model_building_service.types.migration_status.MigrationStatus"
    ] = None,
    max_results: Optional[
        "capo_lex_model_building_service.types.max_results.MaxResults"
    ] = None,
    next_token: Optional[
        "capo_lex_model_building_service.types.next_token.NextToken"
    ] = None,
) -> "capo_lex_model_building_service.types.get_migrations_response.GetMigrationsResponse":
    """<p>Gets a list of migrations between Amazon Lex V1 and Amazon Lex V2.</p>

    Args:
        sort_by_attribute: <p>The field to sort the list of migrations by. You can sort by the Amazon Lex V1 bot name or the date and time that the migration was started.</p>
        sort_by_order: <p>The order so sort the list.</p>
        v1_bot_name_contains: <p>Filters the list to contain only bots whose name contains the specified string. The string is matched anywhere in bot name.</p>
        migration_status_equals: <p>Filters the list to contain only migrations in the specified state.</p>
        max_results: <p>The maximum number of migrations to return in the response. The default is 10.</p>
        next_token: <p>A pagination token that fetches the next page of migrations. If the response to this operation is truncated, Amazon Lex returns a pagination token in the response. To fetch the next page of migrations, specify the pagination token in the request.</p>

    Raises:
        capo_lex_model_building_service.errors.bad_request_exception.BadRequestException: <p>The request is not well formed. For example, a value is invalid or a required field is missing. Check the field values, and try again.</p>
        capo_lex_model_building_service.errors.internal_failure_exception.InternalFailureException: <p>An internal Amazon Lex error occurred. Try your request again.</p>
        capo_lex_model_building_service.errors.limit_exceeded_exception.LimitExceededException: <p>The request exceeded a limit. Try your request again.</p>
        capo_lex_model_building_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_model_building_service.types.get_migrations_request.GetMigrationsRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_model_building_service.types.get_migrations_response.GetMigrationsResponse"
    ]:
        import capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_migrations

        (
            output,
            http_response,
        ) = await capo_lex_model_building_service._operations.aws_deep_sense_model_building_service.get_migrations.async_get_migrations(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetMigrations")
    )
    input_: capo_lex_model_building_service.types.get_migrations_request.GetMigrationsRequest = {}
    if sort_by_attribute is not None:
        input_["sort_by_attribute"] = sort_by_attribute
    if sort_by_order is not None:
        input_["sort_by_order"] = sort_by_order
    if v1_bot_name_contains is not None:
        input_["v1_bot_name_contains"] = v1_bot_name_contains
    if migration_status_equals is not None:
        input_["migration_status_equals"] = migration_status_equals
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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