Skip to content

create_question_set_version async

create_question_set_version(
    id: QuestionSetId,
    *,
    config_overrides: Optional[AsyncElementalInferenceClientConfig] = None,
    sha256: Optional[QuestionSetSha256] = None,
    description: Optional[QuestionSetVersionDescription] = None,
) -> CreateQuestionSetVersionResponse

Publishes the DRAFT version of the specified question set as a new version. The new version has the same name and questions as DRAFT, and you can't change it. DRAFT doesn't change, so you can continue to update it.

Version numbers start at 1, and each new version has the next number. Elemental Inference never reuses a version number, even after you delete that version.

If DRAFT hasn't changed since the latest published version, Elemental Inference doesn't create a version. Instead, it returns the latest version. A change to the name of the question set counts as a change to DRAFT.

A question set can have a limited number of versions. If the question set already has the maximum number of versions, Elemental Inference returns ServiceQuotaExceededException. To free space for a new version, delete a version that you no longer need, or create a new question set.

Parameters:

  • id (QuestionSetId) –

    The ID of the question set whose DRAFT version you want to publish.

  • sha256 (Optional[QuestionSetSha256], default: None ) –

    The SHA-256 hash of the DRAFT version that you want to publish, as returned by GetQuestionSet or UpdateQuestionSet. If you specify this value, Elemental Inference publishes DRAFT only if its current hash matches. If it doesn't match, because DRAFT changed after you retrieved it, the request fails with ConflictException.

    If you don't specify this value, Elemental Inference publishes DRAFT as it is when it receives the request.

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

    A description of the new version. You can't change the description after Elemental Inference publishes the version. If DRAFT hasn't changed since the latest version, Elemental Inference ignores this value and returns the latest version with its existing description.

    The description can be up to 256 characters. It can contain the letters A-Z and a-z, the digits 0-9, underscores, spaces, and the following characters: - . ' , @ : ;.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict.

  • InternalServerErrorException –

    An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support.

  • ResourceNotFoundException –

    The resource specified in the action doesn't exist.

  • ServiceQuotaExceededException –

    The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase.

  • TooManyRequestException –

    The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying.

  • UnknownServiceError –

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

Source code in docs_src/capo_elementalinference/_services/async_elemental_inference.py
async def create_question_set_version(
    self,
    id: "capo_elementalinference.types.question_set_id.QuestionSetId",
    *,
    config_overrides: Optional[AsyncElementalInferenceClientConfig] = None,
    sha256: Optional[
        "capo_elementalinference.types.question_set_sha256.QuestionSetSha256"
    ] = None,
    description: Optional[
        "capo_elementalinference.types.question_set_version_description.QuestionSetVersionDescription"
    ] = None,
) -> "capo_elementalinference.types.create_question_set_version_response.CreateQuestionSetVersionResponse":
    """<p>Publishes the DRAFT version of the specified question set as a new version. The new version has the same name and questions as DRAFT, and you can't change it. DRAFT doesn't change, so you can continue to update it. </p> <p>Version numbers start at 1, and each new version has the next number. Elemental Inference never reuses a version number, even after you delete that version. </p> <p>If DRAFT hasn't changed since the latest published version, Elemental Inference doesn't create a version. Instead, it returns the latest version. A change to the name of the question set counts as a change to DRAFT. </p> <p>A question set can have a limited number of versions. If the question set already has the maximum number of versions, Elemental Inference returns ServiceQuotaExceededException. To free space for a new version, delete a version that you no longer need, or create a new question set. </p>

    Args:
        id: <p>The ID of the question set whose DRAFT version you want to publish.</p>
        sha256: <p>The SHA-256 hash of the DRAFT version that you want to publish, as returned by GetQuestionSet or UpdateQuestionSet. If you specify this value, Elemental Inference publishes DRAFT only if its current hash matches. If it doesn't match, because DRAFT changed after you retrieved it, the request fails with ConflictException. </p> <p>If you don't specify this value, Elemental Inference publishes DRAFT as it is when it receives the request. </p>
        description: <p>A description of the new version. You can't change the description after Elemental Inference publishes the version. If DRAFT hasn't changed since the latest version, Elemental Inference ignores this value and returns the latest version with its existing description. </p> <p>The description can be up to 256 characters. It can contain the letters A-Z and a-z, the digits 0-9, underscores, spaces, and the following characters: <code>- . ' , @ : ;</code>. </p>

    Raises:
        capo_elementalinference.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_elementalinference.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict.</p>
        capo_elementalinference.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support. </p>
        capo_elementalinference.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the action doesn't exist.</p>
        capo_elementalinference.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase. </p>
        capo_elementalinference.errors.too_many_request_exception.TooManyRequestException: <p>The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying. </p>
        capo_elementalinference.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying. </p>
        capo_elementalinference.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elementalinference.types.create_question_set_version_request.CreateQuestionSetVersionRequest]",
    ) -> AsyncOperationResponse[
        "capo_elementalinference.types.create_question_set_version_response.CreateQuestionSetVersionResponse"
    ]:
        import capo_elementalinference._operations.elemental_inference.create_question_set_version

        (
            output,
            http_response,
        ) = await capo_elementalinference._operations.elemental_inference.create_question_set_version.async_create_question_set_version(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateQuestionSetVersion")
    )
    input_: capo_elementalinference.types.create_question_set_version_request.CreateQuestionSetVersionRequest = {
        "id": id
    }
    if sha256 is not None:
        input_["sha256"] = sha256
    if description is not None:
        input_["description"] = description

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