Skip to content

update_question_set

update_question_set(
    id: QuestionSetId,
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    yes_no: Optional[YesNoQuestionList] = None,
    yes_no_per_option: Optional[YesNoPerOptionQuestionList] = None,
    choose_one: Optional[ChooseOneQuestionList] = None,
    name: Optional[ResourceName] = None,
) -> UpdateQuestionSetResponse

Updates the DRAFT version of the specified question set. UpdateQuestionSet doesn't create a version and doesn't change published versions. To publish the updated DRAFT as a new version, use CreateQuestionSetVersion.

UpdateQuestionSet replaces questions one type at a time. For each of yesNo, yesNoPerOption, and chooseOne: if you omit the array, DRAFT keeps its questions of that type. If you include the array, it replaces all the questions of that type in DRAFT. If you include an empty array, DRAFT no longer has questions of that type. The updated DRAFT must follow the same rules as in CreateQuestionSet, and Elemental Inference applies those rules to the questions that DRAFT keeps as well as to the questions in the request.

Feeds that reference the DRAFT version use the updated questions. To make sure that the questions for a feed don't change, reference a published version instead.

Parameters:

  • id (QuestionSetId) –

    The ID of the question set to update.

  • yes_no (Optional[YesNoQuestionList], default: None ) –

    An array of questions that Elemental Inference answers with yes or no, to replace all the yesNo questions in DRAFT. You can specify up to 50 yesNo questions. If not specified, the yesNo questions are not changed. To remove all the yesNo questions, specify an empty array.

  • yes_no_per_option (Optional[YesNoPerOptionQuestionList], default: None ) –

    An array of questions that you ask about each of their options, to replace all the yesNoPerOption questions in DRAFT. You can specify up to 10 yesNoPerOption questions. If not specified, the yesNoPerOption questions are not changed. To remove all the yesNoPerOption questions, specify an empty array.

  • choose_one (Optional[ChooseOneQuestionList], default: None ) –

    An array of questions that Elemental Inference answers by choosing one of their options, to replace all the chooseOne questions in DRAFT. You can specify up to 10 chooseOne questions. If not specified, the chooseOne questions are not changed. To remove all the chooseOne questions, specify an empty array.

  • name (Optional[ResourceName], default: None ) –

    A new name for the question set. If not specified, the name is not changed.

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.

  • 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/elemental_inference.py
def update_question_set(
    self,
    id: "capo_elementalinference.types.question_set_id.QuestionSetId",
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    yes_no: Optional[
        "capo_elementalinference.types.yes_no_question_list.YesNoQuestionList"
    ] = None,
    yes_no_per_option: Optional[
        "capo_elementalinference.types.yes_no_per_option_question_list.YesNoPerOptionQuestionList"
    ] = None,
    choose_one: Optional[
        "capo_elementalinference.types.choose_one_question_list.ChooseOneQuestionList"
    ] = None,
    name: Optional[
        "capo_elementalinference.types.resource_name.ResourceName"
    ] = None,
) -> "capo_elementalinference.types.update_question_set_response.UpdateQuestionSetResponse":
    """<p>Updates the DRAFT version of the specified question set. UpdateQuestionSet doesn't create a version and doesn't change published versions. To publish the updated DRAFT as a new version, use CreateQuestionSetVersion. </p> <p>UpdateQuestionSet replaces questions one type at a time. For each of yesNo, yesNoPerOption, and chooseOne: if you omit the array, DRAFT keeps its questions of that type. If you include the array, it replaces all the questions of that type in DRAFT. If you include an empty array, DRAFT no longer has questions of that type. The updated DRAFT must follow the same rules as in CreateQuestionSet, and Elemental Inference applies those rules to the questions that DRAFT keeps as well as to the questions in the request. </p> <p>Feeds that reference the DRAFT version use the updated questions. To make sure that the questions for a feed don't change, reference a published version instead. </p>

    Args:
        id: <p>The ID of the question set to update.</p>
        yes_no: <p>An array of questions that Elemental Inference answers with yes or no, to replace all the yesNo questions in DRAFT. You can specify up to 50 yesNo questions. If not specified, the yesNo questions are not changed. To remove all the yesNo questions, specify an empty array. </p>
        yes_no_per_option: <p>An array of questions that you ask about each of their options, to replace all the yesNoPerOption questions in DRAFT. You can specify up to 10 yesNoPerOption questions. If not specified, the yesNoPerOption questions are not changed. To remove all the yesNoPerOption questions, specify an empty array. </p>
        choose_one: <p>An array of questions that Elemental Inference answers by choosing one of their options, to replace all the chooseOne questions in DRAFT. You can specify up to 10 chooseOne questions. If not specified, the chooseOne questions are not changed. To remove all the chooseOne questions, specify an empty array. </p>
        name: <p>A new name for the question set. If not specified, the name is not changed.</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.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.
    """

    def _handler(
        req: "OperationRequest[capo_elementalinference.types.update_question_set_request.UpdateQuestionSetRequest]",
    ) -> OperationResponse[
        "capo_elementalinference.types.update_question_set_response.UpdateQuestionSetResponse"
    ]:
        import capo_elementalinference._operations.elemental_inference.update_question_set

        output, http_response = (
            capo_elementalinference._operations.elemental_inference.update_question_set.update_question_set(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateQuestionSet")
    )
    input_: capo_elementalinference.types.update_question_set_request.UpdateQuestionSetRequest = {
        "id": id
    }
    if yes_no is not None:
        input_["yes_no"] = yes_no
    if yes_no_per_option is not None:
        input_["yes_no_per_option"] = yes_no_per_option
    if choose_one is not None:
        input_["choose_one"] = choose_one
    if name is not None:
        input_["name"] = name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output