Skip to content

create_identity_source async

create_identity_source(
    identity_source_parameters: IdentitySourceParameters,
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    client_token: Optional[Token] = None,
    tags: Optional[Tags] = None,
) -> CreateIdentitySourceResponse

Creates a new identity source. For more information, see Identity Source in the Multi-party approval User Guide.

Parameters:

  • identity_source_parameters (IdentitySourceParameters) –

    A IdentitySourceParameters object. Contains details for the resource that provides identities to the identity source. For example, an IAM Identity Center instance.

  • client_token (Optional[Token], default: None ) –

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.

    What is idempotency?

    When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.

    Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.

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

    Tag you want to attach to the identity source.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action. Check your permissions, and try again.

  • InternalServerException –

    The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.

  • ServiceQuotaExceededException –

    The request exceeds the service quota for your account. Request a quota increase or reduce your request size.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by an Amazon Web Services service.

  • UnknownServiceError –

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

Source code in docs_src/capo_mpa/_services/async_mpa.py
async def create_identity_source(
    self,
    identity_source_parameters: "capo_mpa.types.identity_source_parameters.IdentitySourceParameters",
    *,
    config_overrides: Optional[AsyncMPAClientConfig] = None,
    client_token: Optional["capo_mpa.types.token.Token"] = None,
    tags: Optional["capo_mpa.types.tags.Tags"] = None,
) -> "capo_mpa.types.create_identity_source_response.CreateIdentitySourceResponse":
    """<p>Creates a new identity source. For more information, see <a href="https://docs.aws.amazon.com/mpa/latest/userguide/mpa-concepts.html">Identity Source</a> in the <i>Multi-party approval User Guide</i>.</p>

    Args:
        identity_source_parameters: <p>A <code> IdentitySourceParameters</code> object. Contains details for the resource that provides identities to the identity source. For example, an IAM Identity Center instance.</p>
        client_token: <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services populates this field.</p> <note> <p> <b>What is idempotency?</b> </p> <p>When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.</p> <p> <i>Idempotency</i> ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.</p> </note>
        tags: <p>Tag you want to attach to the identity source.</p>

    Raises:
        capo_mpa.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action. Check your permissions, and try again.</p>
        capo_mpa.errors.internal_server_exception.InternalServerException: <p>The service encountered an internal error. Try your request again. If the problem persists, contact Amazon Web Services Support.</p>
        capo_mpa.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request exceeds the service quota for your account. Request a quota increase or reduce your request size.</p>
        capo_mpa.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_mpa.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_mpa.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mpa.types.create_identity_source_request.CreateIdentitySourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_mpa.types.create_identity_source_response.CreateIdentitySourceResponse"
    ]:
        import capo_mpa._operations.aws_fluffy_core_service.create_identity_source

        (
            output,
            http_response,
        ) = await capo_mpa._operations.aws_fluffy_core_service.create_identity_source.async_create_identity_source(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_mpa.types.create_identity_source_request.CreateIdentitySourceRequest",
    ) -> dict[str, Any]:
        import capo_mpa.types.create_identity_source_request

        return capo_mpa.types.create_identity_source_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateIdentitySource", redact_input=_redact_input),
    )
    input_: capo_mpa.types.create_identity_source_request.CreateIdentitySourceRequest = {
        "identity_source_parameters": identity_source_parameters
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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