Skip to content

create_space async

create_space(
    name: SpaceName,
    subdomain: SpaceSubdomain,
    tier: TierLevel,
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
    description: Optional[SpaceDescription] = None,
    user_kms_key: Optional[KMSKey] = None,
    tags: Optional[Tags] = None,
    role_arn: Optional[Arn] = None,
    supported_email_domains: Optional[SupportedEmailDomainsParameters] = None,
) -> CreateSpaceOutput

Creates an AWS re:Post Private private re:Post.

Parameters:

  • name (SpaceName) –

    The name for the private re:Post. This must be unique in your account.

  • subdomain (SpaceSubdomain) –

    The subdomain that you use to access your AWS re:Post Private private re:Post. All custom subdomains must be approved by AWS before use. In addition to your custom subdomain, all private re:Posts are issued an AWS generated subdomain for immediate use.

  • tier (TierLevel) –

    The pricing tier for the private re:Post.

  • description (Optional[SpaceDescription], default: None ) –

    A description for the private re:Post. This is used only to help you identify this private re:Post.

  • user_kms_key (Optional[KMSKey], default: None ) –

    The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't provide a key, your data is encrypted by default with a key that AWS owns and manages for you.

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

    The list of tags associated with the private re:Post.

  • role_arn (Optional[Arn], default: None ) –

    The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.

  • supported_email_domains (Optional[SupportedEmailDomainsParameters], default: None ) –

Raises:

Source code in docs_src/capo_repostspace/_services/async_repostspace.py
async def create_space(
    self,
    name: "capo_repostspace.types.space_name.SpaceName",
    subdomain: "capo_repostspace.types.space_subdomain.SpaceSubdomain",
    tier: "capo_repostspace.types.tier_level.TierLevel",
    *,
    config_overrides: Optional[AsyncrepostspaceClientConfig] = None,
    description: Optional[
        "capo_repostspace.types.space_description.SpaceDescription"
    ] = None,
    user_kms_key: Optional["capo_repostspace.types.kms_key.KMSKey"] = None,
    tags: Optional["capo_repostspace.types.tags.Tags"] = None,
    role_arn: Optional["capo_repostspace.types.arn.Arn"] = None,
    supported_email_domains: Optional[
        "capo_repostspace.types.supported_email_domains_parameters.SupportedEmailDomainsParameters"
    ] = None,
) -> "capo_repostspace.types.create_space_output.CreateSpaceOutput":
    """<p>Creates an AWS re:Post Private private re:Post.</p>

    Args:
        name: <p>The name for the private re:Post. This must be unique in your account.</p>
        subdomain: <p>The subdomain that you use to access your AWS re:Post Private private re:Post. All custom subdomains must be approved by AWS before use. In addition to your custom subdomain, all private re:Posts are issued an AWS generated subdomain for immediate use.</p>
        tier: <p>The pricing tier for the private re:Post.</p>
        description: <p>A description for the private re:Post. This is used only to help you identify this private re:Post.</p>
        user_kms_key: <p>The AWS KMS key ARN that’s used for the AWS KMS encryption. If you don't provide a key, your data is encrypted by default with a key that AWS owns and manages for you.</p>
        tags: <p>The list of tags associated with the private re:Post.</p>
        role_arn: <p>The IAM role that grants permissions to the private re:Post to convert unanswered questions into AWS support tickets.</p>
        supported_email_domains: <p/>

    Raises:
        capo_repostspace.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_repostspace.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_repostspace.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_repostspace.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_repostspace.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_repostspace.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_repostspace.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_repostspace.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_repostspace.types.create_space_input.CreateSpaceInput]",
    ) -> AsyncOperationResponse[
        "capo_repostspace.types.create_space_output.CreateSpaceOutput"
    ]:
        import capo_repostspace._operations.repost_space.create_space

        (
            output,
            http_response,
        ) = await capo_repostspace._operations.repost_space.create_space.async_create_space(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_repostspace.types.create_space_input.CreateSpaceInput",
    ) -> dict[str, Any]:
        import capo_repostspace.types.create_space_input

        return capo_repostspace.types.create_space_input.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateSpace", redact_input=_redact_input),
    )
    input_: capo_repostspace.types.create_space_input.CreateSpaceInput = {
        "name": name,
        "subdomain": subdomain,
        "tier": tier,
    }
    if description is not None:
        input_["description"] = description
    if user_kms_key is not None:
        input_["user_kms_key"] = user_kms_key
    if tags is not None:
        input_["tags"] = tags
    if role_arn is not None:
        input_["role_arn"] = role_arn
    if supported_email_domains is not None:
        input_["supported_email_domains"] = supported_email_domains

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