Skip to content

import_backend_auth async

import_backend_auth(
    app_id: __string,
    backend_environment_name: __string,
    *,
    config_overrides: Optional[AsyncAmplifyBackendClientConfig] = None,
    identity_pool_id: Optional[__string] = None,
    native_client_id: Optional[__string] = None,
    user_pool_id: Optional[__string] = None,
    web_client_id: Optional[__string] = None,
) -> ImportBackendAuthResponse

Imports an existing backend authentication resource.

Parameters:

  • app_id (__string) –

    The app ID.

  • backend_environment_name (__string) –

    The name of the backend environment.

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

    The ID of the Amazon Cognito identity pool.

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

    The ID of the Amazon Cognito native client.

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

    The ID of the Amazon Cognito user pool.

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

    The ID of the Amazon Cognito web client.

Raises:

Source code in docs_src/capo_amplifybackend/_services/async_amplify_backend.py
async def import_backend_auth(
    self,
    app_id: "capo_amplifybackend.types.__string.__string",
    backend_environment_name: "capo_amplifybackend.types.__string.__string",
    *,
    config_overrides: Optional[AsyncAmplifyBackendClientConfig] = None,
    identity_pool_id: Optional[
        "capo_amplifybackend.types.__string.__string"
    ] = None,
    native_client_id: Optional[
        "capo_amplifybackend.types.__string.__string"
    ] = None,
    user_pool_id: Optional["capo_amplifybackend.types.__string.__string"] = None,
    web_client_id: Optional["capo_amplifybackend.types.__string.__string"] = None,
) -> "capo_amplifybackend.types.import_backend_auth_response.ImportBackendAuthResponse":
    """<p>Imports an existing backend authentication resource.</p>

    Args:
        app_id: <p>The app ID.</p>
        backend_environment_name: <p>The name of the backend environment.</p>
        identity_pool_id: <p>The ID of the Amazon Cognito identity pool.</p>
        native_client_id: <p>The ID of the Amazon Cognito native client.</p>
        user_pool_id: <p>The ID of the Amazon Cognito user pool.</p>
        web_client_id: <p>The ID of the Amazon Cognito web client.</p>

    Raises:
        capo_amplifybackend.errors.bad_request_exception.BadRequestException: <p>An error returned if a request is not formed properly.</p>
        capo_amplifybackend.errors.gateway_timeout_exception.GatewayTimeoutException: <p>An error returned if there's a temporary issue with the service.</p>
        capo_amplifybackend.errors.not_found_exception.NotFoundException: <p>An error returned when a specific resource type is not found.</p>
        capo_amplifybackend.errors.too_many_requests_exception.TooManyRequestsException: <p>An error that is returned when a limit of a specific type has been exceeded.</p>
        capo_amplifybackend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_amplifybackend.types.import_backend_auth_request.ImportBackendAuthRequest]",
    ) -> AsyncOperationResponse[
        "capo_amplifybackend.types.import_backend_auth_response.ImportBackendAuthResponse"
    ]:
        import capo_amplifybackend._operations.amplify_backend.import_backend_auth

        (
            output,
            http_response,
        ) = await capo_amplifybackend._operations.amplify_backend.import_backend_auth.async_import_backend_auth(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportBackendAuth")
    )
    input_: capo_amplifybackend.types.import_backend_auth_request.ImportBackendAuthRequest = {
        "app_id": app_id,
        "backend_environment_name": backend_environment_name,
    }
    if identity_pool_id is not None:
        input_["identity_pool_id"] = identity_pool_id
    if native_client_id is not None:
        input_["native_client_id"] = native_client_id
    if user_pool_id is not None:
        input_["user_pool_id"] = user_pool_id
    if web_client_id is not None:
        input_["web_client_id"] = web_client_id

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