Skip to content

put_portfolio_preferences async

put_portfolio_preferences(
    *,
    config_overrides: Optional[AsyncMigrationHubStrategyClientConfig] = None,
    prioritize_business_goals: Optional[PrioritizeBusinessGoals] = None,
    application_preferences: Optional[ApplicationPreferences] = None,
    database_preferences: Optional[DatabasePreferences] = None,
    application_mode: Optional[ApplicationMode] = None,
) -> PutPortfolioPreferencesResponse

Saves the specified migration and modernization preferences.

Parameters:

Raises:

  • AccessDeniedException –

    The user does not have permission to perform the action. Check the AWS Identity and Access Management (IAM) policy associated with this user.

  • ConflictException –

    Exception to indicate that there is an ongoing task when a new task is created. Return when once the existing tasks are complete.

  • InternalServerException –

    The server experienced an internal error. Try again.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The request body isn't valid.

  • UnknownServiceError –

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

Source code in docs_src/capo_migrationhubstrategy/_services/async_migration_hub_strategy.py
async def put_portfolio_preferences(
    self,
    *,
    config_overrides: Optional[AsyncMigrationHubStrategyClientConfig] = None,
    prioritize_business_goals: Optional[
        "capo_migrationhubstrategy.types.prioritize_business_goals.PrioritizeBusinessGoals"
    ] = None,
    application_preferences: Optional[
        "capo_migrationhubstrategy.types.application_preferences.ApplicationPreferences"
    ] = None,
    database_preferences: Optional[
        "capo_migrationhubstrategy.types.database_preferences.DatabasePreferences"
    ] = None,
    application_mode: Optional[
        "capo_migrationhubstrategy.types.application_mode.ApplicationMode"
    ] = None,
) -> "capo_migrationhubstrategy.types.put_portfolio_preferences_response.PutPortfolioPreferencesResponse":
    """<p> Saves the specified migration and modernization preferences. </p>

    Args:
        prioritize_business_goals: <p> The rank of the business goals based on priority. </p>
        application_preferences: <p> The transformation preferences for non-database applications. </p>
        database_preferences: <p> The transformation preferences for database applications. </p>
        application_mode: <p>The classification for application component types.</p>

    Raises:
        capo_migrationhubstrategy.errors.access_denied_exception.AccessDeniedException: <p> The user does not have permission to perform the action. Check the AWS Identity and Access Management (IAM) policy associated with this user.</p>
        capo_migrationhubstrategy.errors.conflict_exception.ConflictException: <p> Exception to indicate that there is an ongoing task when a new task is created. Return when once the existing tasks are complete. </p>
        capo_migrationhubstrategy.errors.internal_server_exception.InternalServerException: <p> The server experienced an internal error. Try again. </p>
        capo_migrationhubstrategy.errors.throttling_exception.ThrottlingException: <p> The request was denied due to request throttling. </p>
        capo_migrationhubstrategy.errors.validation_exception.ValidationException: <p> The request body isn't valid. </p>
        capo_migrationhubstrategy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_migrationhubstrategy.types.put_portfolio_preferences_request.PutPortfolioPreferencesRequest]",
    ) -> AsyncOperationResponse[
        "capo_migrationhubstrategy.types.put_portfolio_preferences_response.PutPortfolioPreferencesResponse"
    ]:
        import capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.put_portfolio_preferences

        (
            output,
            http_response,
        ) = await capo_migrationhubstrategy._operations.aws_migration_hub_strategy_recommendation.put_portfolio_preferences.async_put_portfolio_preferences(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutPortfolioPreferences")
    )
    input_: capo_migrationhubstrategy.types.put_portfolio_preferences_request.PutPortfolioPreferencesRequest = {}
    if prioritize_business_goals is not None:
        input_["prioritize_business_goals"] = prioritize_business_goals
    if application_preferences is not None:
        input_["application_preferences"] = application_preferences
    if database_preferences is not None:
        input_["database_preferences"] = database_preferences
    if application_mode is not None:
        input_["application_mode"] = application_mode

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