Skip to content

create_app_instance async

create_app_instance(
    name: NonEmptyResourceName,
    client_request_token: ClientRequestToken,
    *,
    config_overrides: Optional[AsyncChimeSDKIdentityClientConfig] = None,
    metadata: Optional[Metadata] = None,
    tags: Optional[TagList] = None,
) -> CreateAppInstanceResponse

Creates an Amazon Chime SDK messaging AppInstance under an AWS account. Only SDK messaging customers use this API. CreateAppInstance supports idempotency behavior as described in the AWS API Standard.

identity

Parameters:

  • name (NonEmptyResourceName) –

    The name of the AppInstance.

  • metadata (Optional[Metadata], default: None ) –

    The metadata of the AppInstance. Limited to a 1KB string in UTF-8.

  • client_request_token (ClientRequestToken) –

    The unique ID of the request. Use different tokens to create different AppInstances.

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

    Tags assigned to the AppInstance.

Raises:

Source code in docs_src/capo_chime_sdk_identity/_services/async_chime_sdk_identity.py
async def create_app_instance(
    self,
    name: "capo_chime_sdk_identity.types.non_empty_resource_name.NonEmptyResourceName",
    client_request_token: "capo_chime_sdk_identity.types.client_request_token.ClientRequestToken",
    *,
    config_overrides: Optional[AsyncChimeSDKIdentityClientConfig] = None,
    metadata: Optional["capo_chime_sdk_identity.types.metadata.Metadata"] = None,
    tags: Optional["capo_chime_sdk_identity.types.tag_list.TagList"] = None,
) -> "capo_chime_sdk_identity.types.create_app_instance_response.CreateAppInstanceResponse":
    """<p>Creates an Amazon Chime SDK messaging <code>AppInstance</code> under an AWS account. Only SDK messaging customers use this API. <code>CreateAppInstance</code> supports idempotency behavior as described in the AWS API Standard.</p> <p>identity</p>

    Args:
        name: <p>The name of the <code>AppInstance</code>.</p>
        metadata: <p>The metadata of the <code>AppInstance</code>. Limited to a 1KB string in UTF-8.</p>
        client_request_token: <p>The unique ID of the request. Use different tokens to create different <code>AppInstances</code>.</p>
        tags: <p>Tags assigned to the <code>AppInstance</code>.</p>

    Raises:
        capo_chime_sdk_identity.errors.bad_request_exception.BadRequestException: <p>The input parameters don't match the service's restrictions.</p>
        capo_chime_sdk_identity.errors.conflict_exception.ConflictException: <p>The request could not be processed because of conflict in the current state of the resource.</p>
        capo_chime_sdk_identity.errors.forbidden_exception.ForbiddenException: <p>The client is permanently forbidden from making the request.</p>
        capo_chime_sdk_identity.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The request exceeds the resource limit.</p>
        capo_chime_sdk_identity.errors.service_failure_exception.ServiceFailureException: <p>The service encountered an unexpected error.</p>
        capo_chime_sdk_identity.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable.</p>
        capo_chime_sdk_identity.errors.throttled_client_exception.ThrottledClientException: <p>The client exceeded its request rate limit.</p>
        capo_chime_sdk_identity.errors.unauthorized_client_exception.UnauthorizedClientException: <p>The client is not currently authorized to make the request.</p>
        capo_chime_sdk_identity.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_chime_sdk_identity.types.create_app_instance_request.CreateAppInstanceRequest]",
    ) -> AsyncOperationResponse[
        "capo_chime_sdk_identity.types.create_app_instance_response.CreateAppInstanceResponse"
    ]:
        import capo_chime_sdk_identity._operations.chime_identity_service.create_app_instance

        (
            output,
            http_response,
        ) = await capo_chime_sdk_identity._operations.chime_identity_service.create_app_instance.async_create_app_instance(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_chime_sdk_identity.types.create_app_instance_request.CreateAppInstanceRequest",
    ) -> dict[str, Any]:
        import capo_chime_sdk_identity.types.create_app_instance_request

        return capo_chime_sdk_identity.types.create_app_instance_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateAppInstance", redact_input=_redact_input),
    )
    input_: capo_chime_sdk_identity.types.create_app_instance_request.CreateAppInstanceRequest = {
        "name": name,
        "client_request_token": client_request_token,
    }
    if metadata is not None:
        input_["metadata"] = metadata
    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