Skip to content

Generated

Answer

Bases: BaseFormItem

The submitted answer for a question.

Source code in pygsuite/forms/generated/answer.py
class Answer(BaseFormItem):
    """
    The submitted answer for a question.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def file_upload_answers(self) -> "FileUploadAnswers":
        return FileUploadAnswers(object_info=self._info.get("fileUploadAnswers"))

    @property
    def grade(self) -> "Grade":
        return Grade(object_info=self._info.get("grade"))

    @property
    def question_id(self) -> str:
        return self._info.get("questionId")

    @property
    def text_answers(self) -> "TextAnswers":
        return TextAnswers(object_info=self._info.get("textAnswers"))

BatchUpdateFormRequest

Bases: BaseFormItem

A batch of updates to perform on a form. All the specified updates are made or none of them are.

Source code in pygsuite/forms/generated/batch_update_form_request.py
class BatchUpdateFormRequest(BaseFormItem):
    """
    A batch of updates to perform on a form. All the specified updates are made or none of them are.
    """

    def __init__(  # noqa: C901
        self,
        include_form_in_response: Optional[bool] = None,
        requests: Optional[List["Request"]] = None,
        write_control: Optional["WriteControl"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if include_form_in_response is not None:

            generated["includeFormInResponse"] = include_form_in_response
        if requests is not None:
            generated["requests"] = [v._info for v in requests]
        if write_control is not None:

            generated["writeControl"] = write_control._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def include_form_in_response(self) -> bool:
        return self._info.get("includeFormInResponse")

    @include_form_in_response.setter
    def include_form_in_response(self, value: bool):
        if self._info.get("includeFormInResponse", None) == value:
            return
        self._info["includeFormInResponse"] = value

    @property
    def requests(self) -> List["Request"]:
        return [Request(object_info=v) for v in self._info.get("requests", [])]

    @requests.setter
    def requests(self, value: List["Request"]):
        if self._info.get("requests", None) == value:
            return
        self._info["requests"] = value

    @property
    def write_control(self) -> "WriteControl":
        return WriteControl(object_info=self._info.get("writeControl"))

    @write_control.setter
    def write_control(self, value: "WriteControl"):
        if self._info.get("writeControl", None) == value:
            return
        self._info["writeControl"] = value

    @property
    def wire_format(self) -> dict:
        base = "BatchUpdateForm"
        base = base[0].lower() + base[1:]

        return {base: self._info}

BatchUpdateFormResponse

Bases: BaseFormItem

Response to a BatchUpdateFormRequest.

Source code in pygsuite/forms/generated/batch_update_form_response.py
class BatchUpdateFormResponse(BaseFormItem):
    """
    Response to a BatchUpdateFormRequest.
    """

    def __init__(  # noqa: C901
        self,
        form: Optional["Form"] = None,
        replies: Optional[List["Response"]] = None,
        write_control: Optional["WriteControl"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if form is not None:

            generated["form"] = form._info
        if replies is not None:
            generated["replies"] = [v._info for v in replies]
        if write_control is not None:

            generated["writeControl"] = write_control._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def form(self) -> "Form":
        return Form(object_info=self._info.get("form"))

    @form.setter
    def form(self, value: "Form"):
        if self._info.get("form", None) == value:
            return
        self._info["form"] = value

    @property
    def replies(self) -> List["Response"]:
        return [Response(object_info=v) for v in self._info.get("replies", [])]

    @replies.setter
    def replies(self, value: List["Response"]):
        if self._info.get("replies", None) == value:
            return
        self._info["replies"] = value

    @property
    def write_control(self) -> "WriteControl":
        return WriteControl(object_info=self._info.get("writeControl"))

    @write_control.setter
    def write_control(self, value: "WriteControl"):
        if self._info.get("writeControl", None) == value:
            return
        self._info["writeControl"] = value

ChoiceQuestion

Bases: BaseFormItem

A radio/checkbox/dropdown question.

Source code in pygsuite/forms/generated/choice_question.py
class ChoiceQuestion(BaseFormItem):
    """
    A radio/checkbox/dropdown question.
    """

    def __init__(  # noqa: C901
        self,
        options: Optional[List["Option"]] = None,
        shuffle: Optional[bool] = None,
        type: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if options is not None:
            generated["options"] = [v._info for v in options]
        if shuffle is not None:

            generated["shuffle"] = shuffle
        if type is not None:

            generated["type"] = type
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def options(self) -> List["Option"]:
        return [Option(object_info=v) for v in self._info.get("options", [])]

    @options.setter
    def options(self, value: List["Option"]):
        if self._info.get("options", None) == value:
            return
        self._info["options"] = value

    @property
    def shuffle(self) -> bool:
        return self._info.get("shuffle")

    @shuffle.setter
    def shuffle(self, value: bool):
        if self._info.get("shuffle", None) == value:
            return
        self._info["shuffle"] = value

    @property
    def type(self) -> str:
        return self._info.get("type")

    @type.setter
    def type(self, value: str):
        if self._info.get("type", None) == value:
            return
        self._info["type"] = value

CloudPubsubTopic

Bases: BaseFormItem

A Pub/Sub topic.

Source code in pygsuite/forms/generated/cloud_pubsub_topic.py
class CloudPubsubTopic(BaseFormItem):
    """
    A Pub/Sub topic.
    """

    def __init__(  # noqa: C901
        self, topic_name: Optional[str] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if topic_name is not None:

            generated["topicName"] = topic_name
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def topic_name(self) -> str:
        return self._info.get("topicName")

    @topic_name.setter
    def topic_name(self, value: str):
        if self._info.get("topicName", None) == value:
            return
        self._info["topicName"] = value

CorrectAnswer

Bases: BaseFormItem

A single correct answer for a question. For multiple-valued (CHECKBOX) questions, several CorrectAnswers may be needed to represent a single correct response option.

Source code in pygsuite/forms/generated/correct_answer.py
class CorrectAnswer(BaseFormItem):
    """
    A single correct answer for a question. For multiple-valued (`CHECKBOX`) questions, several `CorrectAnswer`s may be needed to represent a single correct response option.
    """

    def __init__(  # noqa: C901
        self, value: Optional[str] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if value is not None:

            generated["value"] = value
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def value(self) -> str:
        return self._info.get("value")

    @value.setter
    def value(self, value: str):
        if self._info.get("value", None) == value:
            return
        self._info["value"] = value

CorrectAnswers

Bases: BaseFormItem

The answer key for a question.

Source code in pygsuite/forms/generated/correct_answers.py
class CorrectAnswers(BaseFormItem):
    """
    The answer key for a question.
    """

    def __init__(  # noqa: C901
        self, answers: Optional[List["CorrectAnswer"]] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if answers is not None:
            generated["answers"] = [v._info for v in answers]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def answers(self) -> List["CorrectAnswer"]:
        return [CorrectAnswer(object_info=v) for v in self._info.get("answers", [])]

    @answers.setter
    def answers(self, value: List["CorrectAnswer"]):
        if self._info.get("answers", None) == value:
            return
        self._info["answers"] = value

CreateItemRequest

Bases: BaseFormItem

Create an item in a form.

Source code in pygsuite/forms/generated/create_item_request.py
class CreateItemRequest(BaseFormItem):
    """
    Create an item in a form.
    """

    def __init__(  # noqa: C901
        self,
        item: Optional["Item"] = None,
        location: Optional["Location"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if item is not None:

            generated["item"] = item._info
        if location is not None:

            generated["location"] = location._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def item(self) -> "Item":
        return Item(object_info=self._info.get("item"))

    @item.setter
    def item(self, value: "Item"):
        if self._info.get("item", None) == value:
            return
        self._info["item"] = value

    @property
    def location(self) -> "Location":
        return Location(object_info=self._info.get("location"))

    @location.setter
    def location(self, value: "Location"):
        if self._info.get("location", None) == value:
            return
        self._info["location"] = value

    @property
    def wire_format(self) -> dict:
        base = "CreateItem"
        base = base[0].lower() + base[1:]

        return {base: self._info}

CreateItemResponse

Bases: BaseFormItem

The result of creating an item.

Source code in pygsuite/forms/generated/create_item_response.py
class CreateItemResponse(BaseFormItem):
    """
    The result of creating an item.
    """

    def __init__(  # noqa: C901
        self,
        item_id: Optional[str] = None,
        question_id: Optional[List["str"]] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if item_id is not None:

            generated["itemId"] = item_id
        if question_id is not None:
            generated["questionId"] = [v for v in question_id]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def item_id(self) -> str:
        return self._info.get("itemId")

    @item_id.setter
    def item_id(self, value: str):
        if self._info.get("itemId", None) == value:
            return
        self._info["itemId"] = value

    @property
    def question_id(self) -> List["str"]:
        return [v for v in self._info.get("questionId", [])]

    @question_id.setter
    def question_id(self, value: List["str"]):
        if self._info.get("questionId", None) == value:
            return
        self._info["questionId"] = value

CreateWatchRequest

Bases: BaseFormItem

Create a new watch.

Source code in pygsuite/forms/generated/create_watch_request.py
class CreateWatchRequest(BaseFormItem):
    """
    Create a new watch.
    """

    def __init__(  # noqa: C901
        self,
        watch: Optional["Watch"] = None,
        watch_id: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if watch is not None:

            generated["watch"] = watch._info
        if watch_id is not None:

            generated["watchId"] = watch_id
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def watch(self) -> "Watch":
        return Watch(object_info=self._info.get("watch"))

    @watch.setter
    def watch(self, value: "Watch"):
        if self._info.get("watch", None) == value:
            return
        self._info["watch"] = value

    @property
    def watch_id(self) -> str:
        return self._info.get("watchId")

    @watch_id.setter
    def watch_id(self, value: str):
        if self._info.get("watchId", None) == value:
            return
        self._info["watchId"] = value

    @property
    def wire_format(self) -> dict:
        base = "CreateWatch"
        base = base[0].lower() + base[1:]

        return {base: self._info}

DateQuestion

Bases: BaseFormItem

A date question. Date questions default to just month + day.

Source code in pygsuite/forms/generated/date_question.py
class DateQuestion(BaseFormItem):
    """
    A date question. Date questions default to just month + day.
    """

    def __init__(  # noqa: C901
        self,
        include_time: Optional[bool] = None,
        include_year: Optional[bool] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if include_time is not None:

            generated["includeTime"] = include_time
        if include_year is not None:

            generated["includeYear"] = include_year
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def include_time(self) -> bool:
        return self._info.get("includeTime")

    @include_time.setter
    def include_time(self, value: bool):
        if self._info.get("includeTime", None) == value:
            return
        self._info["includeTime"] = value

    @property
    def include_year(self) -> bool:
        return self._info.get("includeYear")

    @include_year.setter
    def include_year(self, value: bool):
        if self._info.get("includeYear", None) == value:
            return
        self._info["includeYear"] = value

DeleteItemRequest

Bases: BaseFormItem

Delete an item in a form.

Source code in pygsuite/forms/generated/delete_item_request.py
class DeleteItemRequest(BaseFormItem):
    """
    Delete an item in a form.
    """

    def __init__(  # noqa: C901
        self, location: Optional["Location"] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if location is not None:

            generated["location"] = location._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def location(self) -> "Location":
        return Location(object_info=self._info.get("location"))

    @location.setter
    def location(self, value: "Location"):
        if self._info.get("location", None) == value:
            return
        self._info["location"] = value

    @property
    def wire_format(self) -> dict:
        base = "DeleteItem"
        base = base[0].lower() + base[1:]

        return {base: self._info}

Empty

Bases: BaseFormItem

A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }

Source code in pygsuite/forms/generated/empty.py
class Empty(BaseFormItem):
    """
    A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

ExtraMaterial

Bases: BaseFormItem

Supplementary material to the feedback.

Source code in pygsuite/forms/generated/extra_material.py
class ExtraMaterial(BaseFormItem):
    """
    Supplementary material to the feedback.
    """

    def __init__(  # noqa: C901
        self,
        link: Optional["TextLink"] = None,
        video: Optional["VideoLink"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if link is not None:

            generated["link"] = link._info
        if video is not None:

            generated["video"] = video._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def link(self) -> "TextLink":
        return TextLink(object_info=self._info.get("link"))

    @link.setter
    def link(self, value: "TextLink"):
        if self._info.get("link", None) == value:
            return
        self._info["link"] = value

    @property
    def video(self) -> "VideoLink":
        return VideoLink(object_info=self._info.get("video"))

    @video.setter
    def video(self, value: "VideoLink"):
        if self._info.get("video", None) == value:
            return
        self._info["video"] = value

Feedback

Bases: BaseFormItem

Feedback for a respondent about their response to a question.

Source code in pygsuite/forms/generated/feedback.py
class Feedback(BaseFormItem):
    """
    Feedback for a respondent about their response to a question.
    """

    def __init__(  # noqa: C901
        self,
        material: Optional[List["ExtraMaterial"]] = None,
        text: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if material is not None:
            generated["material"] = [v._info for v in material]
        if text is not None:

            generated["text"] = text
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def material(self) -> List["ExtraMaterial"]:
        return [ExtraMaterial(object_info=v) for v in self._info.get("material", [])]

    @material.setter
    def material(self, value: List["ExtraMaterial"]):
        if self._info.get("material", None) == value:
            return
        self._info["material"] = value

    @property
    def text(self) -> str:
        return self._info.get("text")

    @text.setter
    def text(self, value: str):
        if self._info.get("text", None) == value:
            return
        self._info["text"] = value

FileUploadAnswer

Bases: BaseFormItem

Info for a single file submitted to a file upload question.

Source code in pygsuite/forms/generated/file_upload_answer.py
class FileUploadAnswer(BaseFormItem):
    """
    Info for a single file submitted to a file upload question.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def file_id(self) -> str:
        return self._info.get("fileId")

    @property
    def file_name(self) -> str:
        return self._info.get("fileName")

    @property
    def mime_type(self) -> str:
        return self._info.get("mimeType")

FileUploadAnswers

Bases: BaseFormItem

All submitted files for a FileUpload question.

Source code in pygsuite/forms/generated/file_upload_answers.py
class FileUploadAnswers(BaseFormItem):
    """
    All submitted files for a FileUpload question.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def answers(self) -> List["FileUploadAnswer"]:
        return [FileUploadAnswer(object_info=v) for v in self._info.get("answers", [])]

FileUploadQuestion

Bases: BaseFormItem

A file upload question. The API currently does not support creating file upload questions.

Source code in pygsuite/forms/generated/file_upload_question.py
class FileUploadQuestion(BaseFormItem):
    """
    A file upload question. The API currently does not support creating file upload questions.
    """

    def __init__(  # noqa: C901
        self,
        folder_id: Optional[str] = None,
        max_file_size: Optional[str] = None,
        max_files: Optional[int] = None,
        types: Optional[List["str"]] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if folder_id is not None:

            generated["folderId"] = folder_id
        if max_file_size is not None:

            generated["maxFileSize"] = max_file_size
        if max_files is not None:

            generated["maxFiles"] = max_files
        if types is not None:
            generated["types"] = [v for v in types]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def folder_id(self) -> str:
        return self._info.get("folderId")

    @folder_id.setter
    def folder_id(self, value: str):
        if self._info.get("folderId", None) == value:
            return
        self._info["folderId"] = value

    @property
    def max_file_size(self) -> str:
        return self._info.get("maxFileSize")

    @max_file_size.setter
    def max_file_size(self, value: str):
        if self._info.get("maxFileSize", None) == value:
            return
        self._info["maxFileSize"] = value

    @property
    def max_files(self) -> int:
        return self._info.get("maxFiles")

    @max_files.setter
    def max_files(self, value: int):
        if self._info.get("maxFiles", None) == value:
            return
        self._info["maxFiles"] = value

    @property
    def types(self) -> List["str"]:
        return [v for v in self._info.get("types", [])]

    @types.setter
    def types(self, value: List["str"]):
        if self._info.get("types", None) == value:
            return
        self._info["types"] = value

FormResponse

Bases: BaseFormItem

A form response.

Source code in pygsuite/forms/generated/form_response.py
class FormResponse(BaseFormItem):
    """
    A form response.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def answers(self) -> object:
        return self._info.get("answers")

    @property
    def create_time(self) -> str:
        return self._info.get("createTime")

    @property
    def form_id(self) -> str:
        return self._info.get("formId")

    @property
    def last_submitted_time(self) -> str:
        return self._info.get("lastSubmittedTime")

    @property
    def respondent_email(self) -> str:
        return self._info.get("respondentEmail")

    @property
    def response_id(self) -> str:
        return self._info.get("responseId")

    @property
    def total_score(self) -> float:
        return self._info.get("totalScore")

FormSettings

Bases: BaseFormItem

A form's settings.

Source code in pygsuite/forms/generated/form_settings.py
class FormSettings(BaseFormItem):
    """
    A form's settings.
    """

    def __init__(  # noqa: C901
        self, quiz_settings: Optional["QuizSettings"] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if quiz_settings is not None:

            generated["quizSettings"] = quiz_settings._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def quiz_settings(self) -> "QuizSettings":
        return QuizSettings(object_info=self._info.get("quizSettings"))

    @quiz_settings.setter
    def quiz_settings(self, value: "QuizSettings"):
        if self._info.get("quizSettings", None) == value:
            return
        self._info["quizSettings"] = value

Grade

Bases: BaseFormItem

Grade information associated with a respondent's answer to a question.

Source code in pygsuite/forms/generated/grade.py
class Grade(BaseFormItem):
    """
    Grade information associated with a respondent's answer to a question.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def correct(self) -> bool:
        return self._info.get("correct")

    @property
    def feedback(self) -> "Feedback":
        return Feedback(object_info=self._info.get("feedback"))

    @property
    def score(self) -> float:
        return self._info.get("score")

Grading

Bases: BaseFormItem

Grading for a single question

Source code in pygsuite/forms/generated/grading.py
class Grading(BaseFormItem):
    """
    Grading for a single question
    """

    def __init__(  # noqa: C901
        self,
        correct_answers: Optional["CorrectAnswers"] = None,
        general_feedback: Optional["Feedback"] = None,
        point_value: Optional[int] = None,
        when_right: Optional["Feedback"] = None,
        when_wrong: Optional["Feedback"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if correct_answers is not None:

            generated["correctAnswers"] = correct_answers._info
        if general_feedback is not None:

            generated["generalFeedback"] = general_feedback._info
        if point_value is not None:

            generated["pointValue"] = point_value
        if when_right is not None:

            generated["whenRight"] = when_right._info
        if when_wrong is not None:

            generated["whenWrong"] = when_wrong._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def correct_answers(self) -> "CorrectAnswers":
        return CorrectAnswers(object_info=self._info.get("correctAnswers"))

    @correct_answers.setter
    def correct_answers(self, value: "CorrectAnswers"):
        if self._info.get("correctAnswers", None) == value:
            return
        self._info["correctAnswers"] = value

    @property
    def general_feedback(self) -> "Feedback":
        return Feedback(object_info=self._info.get("generalFeedback"))

    @general_feedback.setter
    def general_feedback(self, value: "Feedback"):
        if self._info.get("generalFeedback", None) == value:
            return
        self._info["generalFeedback"] = value

    @property
    def point_value(self) -> int:
        return self._info.get("pointValue")

    @point_value.setter
    def point_value(self, value: int):
        if self._info.get("pointValue", None) == value:
            return
        self._info["pointValue"] = value

    @property
    def when_right(self) -> "Feedback":
        return Feedback(object_info=self._info.get("whenRight"))

    @when_right.setter
    def when_right(self, value: "Feedback"):
        if self._info.get("whenRight", None) == value:
            return
        self._info["whenRight"] = value

    @property
    def when_wrong(self) -> "Feedback":
        return Feedback(object_info=self._info.get("whenWrong"))

    @when_wrong.setter
    def when_wrong(self, value: "Feedback"):
        if self._info.get("whenWrong", None) == value:
            return
        self._info["whenWrong"] = value

Grid

Bases: BaseFormItem

A grid of choices (radio or check boxes) with each row constituting a separate question. Each row has the same choices, which are shown as the columns.

Source code in pygsuite/forms/generated/grid.py
class Grid(BaseFormItem):
    """
    A grid of choices (radio or check boxes) with each row constituting a separate question. Each row has the same choices, which are shown as the columns.
    """

    def __init__(  # noqa: C901
        self,
        columns: Optional["ChoiceQuestion"] = None,
        shuffle_questions: Optional[bool] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if columns is not None:

            generated["columns"] = columns._info
        if shuffle_questions is not None:

            generated["shuffleQuestions"] = shuffle_questions
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def columns(self) -> "ChoiceQuestion":
        return ChoiceQuestion(object_info=self._info.get("columns"))

    @columns.setter
    def columns(self, value: "ChoiceQuestion"):
        if self._info.get("columns", None) == value:
            return
        self._info["columns"] = value

    @property
    def shuffle_questions(self) -> bool:
        return self._info.get("shuffleQuestions")

    @shuffle_questions.setter
    def shuffle_questions(self, value: bool):
        if self._info.get("shuffleQuestions", None) == value:
            return
        self._info["shuffleQuestions"] = value

Image

Bases: BaseFormItem

Data representing an image.

Source code in pygsuite/forms/generated/image.py
class Image(BaseFormItem):
    """
    Data representing an image.
    """

    def __init__(  # noqa: C901
        self,
        alt_text: Optional[str] = None,
        properties: Optional["MediaProperties"] = None,
        source_uri: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if alt_text is not None:

            generated["altText"] = alt_text
        if properties is not None:

            generated["properties"] = properties._info
        if source_uri is not None:

            generated["sourceUri"] = source_uri
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def alt_text(self) -> str:
        return self._info.get("altText")

    @alt_text.setter
    def alt_text(self, value: str):
        if self._info.get("altText", None) == value:
            return
        self._info["altText"] = value

    @property
    def content_uri(self) -> str:
        return self._info.get("contentUri")

    @property
    def properties(self) -> "MediaProperties":
        return MediaProperties(object_info=self._info.get("properties"))

    @properties.setter
    def properties(self, value: "MediaProperties"):
        if self._info.get("properties", None) == value:
            return
        self._info["properties"] = value

    @property
    def source_uri(self) -> str:
        return self._info.get("sourceUri")

    @source_uri.setter
    def source_uri(self, value: str):
        if self._info.get("sourceUri", None) == value:
            return
        self._info["sourceUri"] = value

ImageItem

Bases: BaseFormItem

An item containing an image.

Source code in pygsuite/forms/generated/image_item.py
class ImageItem(BaseFormItem):
    """
    An item containing an image.
    """

    def __init__(  # noqa: C901
        self, image: Optional["Image"] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if image is not None:

            generated["image"] = image._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def image(self) -> "Image":
        return Image(object_info=self._info.get("image"))

    @image.setter
    def image(self, value: "Image"):
        if self._info.get("image", None) == value:
            return
        self._info["image"] = value

Info

Bases: BaseFormItem

The general information for a form.

Source code in pygsuite/forms/generated/info.py
class Info(BaseFormItem):
    """
    The general information for a form.
    """

    def __init__(  # noqa: C901
        self,
        description: Optional[str] = None,
        title: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if description is not None:

            generated["description"] = description
        if title is not None:

            generated["title"] = title
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def description(self) -> str:
        return self._info.get("description")

    @description.setter
    def description(self, value: str):
        if self._info.get("description", None) == value:
            return
        self._info["description"] = value

    @property
    def document_title(self) -> str:
        return self._info.get("documentTitle")

    @property
    def title(self) -> str:
        return self._info.get("title")

    @title.setter
    def title(self, value: str):
        if self._info.get("title", None) == value:
            return
        self._info["title"] = value

Item

Bases: BaseFormItem

A single item of the form. kind defines which kind of item it is.

Source code in pygsuite/forms/generated/item.py
class Item(BaseFormItem):
    """
    A single item of the form. `kind` defines which kind of item it is.
    """

    def __init__(  # noqa: C901
        self,
        description: Optional[str] = None,
        image_item: Optional["ImageItem"] = None,
        item_id: Optional[str] = None,
        page_break_item: Optional["PageBreakItem"] = None,
        question_group_item: Optional["QuestionGroupItem"] = None,
        question_item: Optional["QuestionItem"] = None,
        text_item: Optional["TextItem"] = None,
        title: Optional[str] = None,
        video_item: Optional["VideoItem"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if description is not None:

            generated["description"] = description
        if image_item is not None:

            generated["imageItem"] = image_item._info
        if item_id is not None:

            generated["itemId"] = item_id
        if page_break_item is not None:

            generated["pageBreakItem"] = page_break_item._info
        if question_group_item is not None:

            generated["questionGroupItem"] = question_group_item._info
        if question_item is not None:

            generated["questionItem"] = question_item._info
        if text_item is not None:

            generated["textItem"] = text_item._info
        if title is not None:

            generated["title"] = title
        if video_item is not None:

            generated["videoItem"] = video_item._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def description(self) -> str:
        return self._info.get("description")

    @description.setter
    def description(self, value: str):
        if self._info.get("description", None) == value:
            return
        self._info["description"] = value

    @property
    def image_item(self) -> "ImageItem":
        return ImageItem(object_info=self._info.get("imageItem"))

    @image_item.setter
    def image_item(self, value: "ImageItem"):
        if self._info.get("imageItem", None) == value:
            return
        self._info["imageItem"] = value

    @property
    def item_id(self) -> str:
        return self._info.get("itemId")

    @item_id.setter
    def item_id(self, value: str):
        if self._info.get("itemId", None) == value:
            return
        self._info["itemId"] = value

    @property
    def page_break_item(self) -> "PageBreakItem":
        return PageBreakItem(object_info=self._info.get("pageBreakItem"))

    @page_break_item.setter
    def page_break_item(self, value: "PageBreakItem"):
        if self._info.get("pageBreakItem", None) == value:
            return
        self._info["pageBreakItem"] = value

    @property
    def question_group_item(self) -> "QuestionGroupItem":
        return QuestionGroupItem(object_info=self._info.get("questionGroupItem"))

    @question_group_item.setter
    def question_group_item(self, value: "QuestionGroupItem"):
        if self._info.get("questionGroupItem", None) == value:
            return
        self._info["questionGroupItem"] = value

    @property
    def question_item(self) -> "QuestionItem":
        return QuestionItem(object_info=self._info.get("questionItem"))

    @question_item.setter
    def question_item(self, value: "QuestionItem"):
        if self._info.get("questionItem", None) == value:
            return
        self._info["questionItem"] = value

    @property
    def text_item(self) -> "TextItem":
        return TextItem(object_info=self._info.get("textItem"))

    @text_item.setter
    def text_item(self, value: "TextItem"):
        if self._info.get("textItem", None) == value:
            return
        self._info["textItem"] = value

    @property
    def title(self) -> str:
        return self._info.get("title")

    @title.setter
    def title(self, value: str):
        if self._info.get("title", None) == value:
            return
        self._info["title"] = value

    @property
    def video_item(self) -> "VideoItem":
        return VideoItem(object_info=self._info.get("videoItem"))

    @video_item.setter
    def video_item(self, value: "VideoItem"):
        if self._info.get("videoItem", None) == value:
            return
        self._info["videoItem"] = value

ListFormResponsesResponse

Bases: BaseFormItem

Response to a ListFormResponsesRequest.

Source code in pygsuite/forms/generated/list_form_responses_response.py
class ListFormResponsesResponse(BaseFormItem):
    """
    Response to a ListFormResponsesRequest.
    """

    def __init__(  # noqa: C901
        self,
        next_page_token: Optional[str] = None,
        responses: Optional[List["FormResponse"]] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if next_page_token is not None:

            generated["nextPageToken"] = next_page_token
        if responses is not None:
            generated["responses"] = [v._info for v in responses]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def next_page_token(self) -> str:
        return self._info.get("nextPageToken")

    @next_page_token.setter
    def next_page_token(self, value: str):
        if self._info.get("nextPageToken", None) == value:
            return
        self._info["nextPageToken"] = value

    @property
    def responses(self) -> List["FormResponse"]:
        return [FormResponse(object_info=v) for v in self._info.get("responses", [])]

    @responses.setter
    def responses(self, value: List["FormResponse"]):
        if self._info.get("responses", None) == value:
            return
        self._info["responses"] = value

ListWatchesResponse

Bases: BaseFormItem

The response of a ListWatchesRequest.

Source code in pygsuite/forms/generated/list_watches_response.py
class ListWatchesResponse(BaseFormItem):
    """
    The response of a ListWatchesRequest.
    """

    def __init__(  # noqa: C901
        self, watches: Optional[List["Watch"]] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if watches is not None:
            generated["watches"] = [v._info for v in watches]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def watches(self) -> List["Watch"]:
        return [Watch(object_info=v) for v in self._info.get("watches", [])]

    @watches.setter
    def watches(self, value: List["Watch"]):
        if self._info.get("watches", None) == value:
            return
        self._info["watches"] = value

Location

Bases: BaseFormItem

A specific location in a form.

Source code in pygsuite/forms/generated/location.py
class Location(BaseFormItem):
    """
    A specific location in a form.
    """

    def __init__(  # noqa: C901
        self, index: Optional[int] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if index is not None:

            generated["index"] = index
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def index(self) -> int:
        return self._info.get("index")

    @index.setter
    def index(self, value: int):
        if self._info.get("index", None) == value:
            return
        self._info["index"] = value

MediaProperties

Bases: BaseFormItem

Properties of the media.

Source code in pygsuite/forms/generated/media_properties.py
class MediaProperties(BaseFormItem):
    """
    Properties of the media.
    """

    def __init__(  # noqa: C901
        self,
        alignment: Optional[str] = None,
        width: Optional[int] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if alignment is not None:

            generated["alignment"] = alignment
        if width is not None:

            generated["width"] = width
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def alignment(self) -> str:
        return self._info.get("alignment")

    @alignment.setter
    def alignment(self, value: str):
        if self._info.get("alignment", None) == value:
            return
        self._info["alignment"] = value

    @property
    def width(self) -> int:
        return self._info.get("width")

    @width.setter
    def width(self, value: int):
        if self._info.get("width", None) == value:
            return
        self._info["width"] = value

MoveItemRequest

Bases: BaseFormItem

Move an item in a form.

Source code in pygsuite/forms/generated/move_item_request.py
class MoveItemRequest(BaseFormItem):
    """
    Move an item in a form.
    """

    def __init__(  # noqa: C901
        self,
        new_location: Optional["Location"] = None,
        original_location: Optional["Location"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if new_location is not None:

            generated["newLocation"] = new_location._info
        if original_location is not None:

            generated["originalLocation"] = original_location._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def new_location(self) -> "Location":
        return Location(object_info=self._info.get("newLocation"))

    @new_location.setter
    def new_location(self, value: "Location"):
        if self._info.get("newLocation", None) == value:
            return
        self._info["newLocation"] = value

    @property
    def original_location(self) -> "Location":
        return Location(object_info=self._info.get("originalLocation"))

    @original_location.setter
    def original_location(self, value: "Location"):
        if self._info.get("originalLocation", None) == value:
            return
        self._info["originalLocation"] = value

    @property
    def wire_format(self) -> dict:
        base = "MoveItem"
        base = base[0].lower() + base[1:]

        return {base: self._info}

Option

Bases: BaseFormItem

An option for a Choice question.

Source code in pygsuite/forms/generated/option.py
class Option(BaseFormItem):
    """
    An option for a Choice question.
    """

    def __init__(  # noqa: C901
        self,
        go_to_action: Optional[str] = None,
        go_to_section_id: Optional[str] = None,
        image: Optional["Image"] = None,
        is_other: Optional[bool] = None,
        value: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if go_to_action is not None:

            generated["goToAction"] = go_to_action
        if go_to_section_id is not None:

            generated["goToSectionId"] = go_to_section_id
        if image is not None:

            generated["image"] = image._info
        if is_other is not None:

            generated["isOther"] = is_other
        if value is not None:

            generated["value"] = value
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def go_to_action(self) -> str:
        return self._info.get("goToAction")

    @go_to_action.setter
    def go_to_action(self, value: str):
        if self._info.get("goToAction", None) == value:
            return
        self._info["goToAction"] = value

    @property
    def go_to_section_id(self) -> str:
        return self._info.get("goToSectionId")

    @go_to_section_id.setter
    def go_to_section_id(self, value: str):
        if self._info.get("goToSectionId", None) == value:
            return
        self._info["goToSectionId"] = value

    @property
    def image(self) -> "Image":
        return Image(object_info=self._info.get("image"))

    @image.setter
    def image(self, value: "Image"):
        if self._info.get("image", None) == value:
            return
        self._info["image"] = value

    @property
    def is_other(self) -> bool:
        return self._info.get("isOther")

    @is_other.setter
    def is_other(self, value: bool):
        if self._info.get("isOther", None) == value:
            return
        self._info["isOther"] = value

    @property
    def value(self) -> str:
        return self._info.get("value")

    @value.setter
    def value(self, value: str):
        if self._info.get("value", None) == value:
            return
        self._info["value"] = value

PageBreakItem

Bases: BaseFormItem

A page break. The title and description of this item are shown at the top of the new page.

Source code in pygsuite/forms/generated/page_break_item.py
class PageBreakItem(BaseFormItem):
    """
    A page break. The title and description of this item are shown at the top of the new page.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

Question

Bases: BaseFormItem

Any question. The specific type of question is known by its kind.

Source code in pygsuite/forms/generated/question.py
class Question(BaseFormItem):
    """
    Any question. The specific type of question is known by its `kind`.
    """

    def __init__(  # noqa: C901
        self,
        choice_question: Optional["ChoiceQuestion"] = None,
        date_question: Optional["DateQuestion"] = None,
        file_upload_question: Optional["FileUploadQuestion"] = None,
        grading: Optional["Grading"] = None,
        question_id: Optional[str] = None,
        required: Optional[bool] = None,
        row_question: Optional["RowQuestion"] = None,
        scale_question: Optional["ScaleQuestion"] = None,
        text_question: Optional["TextQuestion"] = None,
        time_question: Optional["TimeQuestion"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if choice_question is not None:

            generated["choiceQuestion"] = choice_question._info
        if date_question is not None:

            generated["dateQuestion"] = date_question._info
        if file_upload_question is not None:

            generated["fileUploadQuestion"] = file_upload_question._info
        if grading is not None:

            generated["grading"] = grading._info
        if question_id is not None:

            generated["questionId"] = question_id
        if required is not None:

            generated["required"] = required
        if row_question is not None:

            generated["rowQuestion"] = row_question._info
        if scale_question is not None:

            generated["scaleQuestion"] = scale_question._info
        if text_question is not None:

            generated["textQuestion"] = text_question._info
        if time_question is not None:

            generated["timeQuestion"] = time_question._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def choice_question(self) -> "ChoiceQuestion":
        return ChoiceQuestion(object_info=self._info.get("choiceQuestion"))

    @choice_question.setter
    def choice_question(self, value: "ChoiceQuestion"):
        if self._info.get("choiceQuestion", None) == value:
            return
        self._info["choiceQuestion"] = value

    @property
    def date_question(self) -> "DateQuestion":
        return DateQuestion(object_info=self._info.get("dateQuestion"))

    @date_question.setter
    def date_question(self, value: "DateQuestion"):
        if self._info.get("dateQuestion", None) == value:
            return
        self._info["dateQuestion"] = value

    @property
    def file_upload_question(self) -> "FileUploadQuestion":
        return FileUploadQuestion(object_info=self._info.get("fileUploadQuestion"))

    @file_upload_question.setter
    def file_upload_question(self, value: "FileUploadQuestion"):
        if self._info.get("fileUploadQuestion", None) == value:
            return
        self._info["fileUploadQuestion"] = value

    @property
    def grading(self) -> "Grading":
        return Grading(object_info=self._info.get("grading"))

    @grading.setter
    def grading(self, value: "Grading"):
        if self._info.get("grading", None) == value:
            return
        self._info["grading"] = value

    @property
    def question_id(self) -> str:
        return self._info.get("questionId")

    @question_id.setter
    def question_id(self, value: str):
        if self._info.get("questionId", None) == value:
            return
        self._info["questionId"] = value

    @property
    def required(self) -> bool:
        return self._info.get("required")

    @required.setter
    def required(self, value: bool):
        if self._info.get("required", None) == value:
            return
        self._info["required"] = value

    @property
    def row_question(self) -> "RowQuestion":
        return RowQuestion(object_info=self._info.get("rowQuestion"))

    @row_question.setter
    def row_question(self, value: "RowQuestion"):
        if self._info.get("rowQuestion", None) == value:
            return
        self._info["rowQuestion"] = value

    @property
    def scale_question(self) -> "ScaleQuestion":
        return ScaleQuestion(object_info=self._info.get("scaleQuestion"))

    @scale_question.setter
    def scale_question(self, value: "ScaleQuestion"):
        if self._info.get("scaleQuestion", None) == value:
            return
        self._info["scaleQuestion"] = value

    @property
    def text_question(self) -> "TextQuestion":
        return TextQuestion(object_info=self._info.get("textQuestion"))

    @text_question.setter
    def text_question(self, value: "TextQuestion"):
        if self._info.get("textQuestion", None) == value:
            return
        self._info["textQuestion"] = value

    @property
    def time_question(self) -> "TimeQuestion":
        return TimeQuestion(object_info=self._info.get("timeQuestion"))

    @time_question.setter
    def time_question(self, value: "TimeQuestion"):
        if self._info.get("timeQuestion", None) == value:
            return
        self._info["timeQuestion"] = value

QuestionGroupItem

Bases: BaseFormItem

Defines a question that comprises multiple questions grouped together.

Source code in pygsuite/forms/generated/question_group_item.py
class QuestionGroupItem(BaseFormItem):
    """
    Defines a question that comprises multiple questions grouped together.
    """

    def __init__(  # noqa: C901
        self,
        grid: Optional["Grid"] = None,
        image: Optional["Image"] = None,
        questions: Optional[List["Question"]] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if grid is not None:

            generated["grid"] = grid._info
        if image is not None:

            generated["image"] = image._info
        if questions is not None:
            generated["questions"] = [v._info for v in questions]
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def grid(self) -> "Grid":
        return Grid(object_info=self._info.get("grid"))

    @grid.setter
    def grid(self, value: "Grid"):
        if self._info.get("grid", None) == value:
            return
        self._info["grid"] = value

    @property
    def image(self) -> "Image":
        return Image(object_info=self._info.get("image"))

    @image.setter
    def image(self, value: "Image"):
        if self._info.get("image", None) == value:
            return
        self._info["image"] = value

    @property
    def questions(self) -> List["Question"]:
        return [Question(object_info=v) for v in self._info.get("questions", [])]

    @questions.setter
    def questions(self, value: List["Question"]):
        if self._info.get("questions", None) == value:
            return
        self._info["questions"] = value

QuestionItem

Bases: BaseFormItem

A form item containing a single question.

Source code in pygsuite/forms/generated/question_item.py
class QuestionItem(BaseFormItem):
    """
    A form item containing a single question.
    """

    def __init__(  # noqa: C901
        self,
        image: Optional["Image"] = None,
        question: Optional["Question"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if image is not None:

            generated["image"] = image._info
        if question is not None:

            generated["question"] = question._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def image(self) -> "Image":
        return Image(object_info=self._info.get("image"))

    @image.setter
    def image(self, value: "Image"):
        if self._info.get("image", None) == value:
            return
        self._info["image"] = value

    @property
    def question(self) -> "Question":
        return Question(object_info=self._info.get("question"))

    @question.setter
    def question(self, value: "Question"):
        if self._info.get("question", None) == value:
            return
        self._info["question"] = value

QuizSettings

Bases: BaseFormItem

Settings related to quiz forms and grading. These must be updated with the UpdateSettingsRequest.

Source code in pygsuite/forms/generated/quiz_settings.py
class QuizSettings(BaseFormItem):
    """
    Settings related to quiz forms and grading. These must be updated with the UpdateSettingsRequest.
    """

    def __init__(  # noqa: C901
        self, is_quiz: Optional[bool] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if is_quiz is not None:

            generated["isQuiz"] = is_quiz
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def is_quiz(self) -> bool:
        return self._info.get("isQuiz")

    @is_quiz.setter
    def is_quiz(self, value: bool):
        if self._info.get("isQuiz", None) == value:
            return
        self._info["isQuiz"] = value

RenewWatchRequest

Bases: BaseFormItem

Renew an existing Watch for seven days.

Source code in pygsuite/forms/generated/renew_watch_request.py
class RenewWatchRequest(BaseFormItem):
    """
    Renew an existing Watch for seven days.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def wire_format(self) -> dict:
        base = "RenewWatch"
        base = base[0].lower() + base[1:]

        return {base: self._info}

Request

Bases: BaseFormItem

The kinds of update requests that can be made.

Source code in pygsuite/forms/generated/request.py
class Request(BaseFormItem):
    """
    The kinds of update requests that can be made.
    """

    def __init__(  # noqa: C901
        self,
        create_item: Optional["CreateItemRequest"] = None,
        delete_item: Optional["DeleteItemRequest"] = None,
        move_item: Optional["MoveItemRequest"] = None,
        update_form_info: Optional["UpdateFormInfoRequest"] = None,
        update_item: Optional["UpdateItemRequest"] = None,
        update_settings: Optional["UpdateSettingsRequest"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if create_item is not None:

            generated["createItem"] = create_item._info
        if delete_item is not None:

            generated["deleteItem"] = delete_item._info
        if move_item is not None:

            generated["moveItem"] = move_item._info
        if update_form_info is not None:

            generated["updateFormInfo"] = update_form_info._info
        if update_item is not None:

            generated["updateItem"] = update_item._info
        if update_settings is not None:

            generated["updateSettings"] = update_settings._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def create_item(self) -> "CreateItemRequest":
        return CreateItemRequest(object_info=self._info.get("createItem"))

    @create_item.setter
    def create_item(self, value: "CreateItemRequest"):
        if self._info.get("createItem", None) == value:
            return
        self._info["createItem"] = value

    @property
    def delete_item(self) -> "DeleteItemRequest":
        return DeleteItemRequest(object_info=self._info.get("deleteItem"))

    @delete_item.setter
    def delete_item(self, value: "DeleteItemRequest"):
        if self._info.get("deleteItem", None) == value:
            return
        self._info["deleteItem"] = value

    @property
    def move_item(self) -> "MoveItemRequest":
        return MoveItemRequest(object_info=self._info.get("moveItem"))

    @move_item.setter
    def move_item(self, value: "MoveItemRequest"):
        if self._info.get("moveItem", None) == value:
            return
        self._info["moveItem"] = value

    @property
    def update_form_info(self) -> "UpdateFormInfoRequest":
        return UpdateFormInfoRequest(object_info=self._info.get("updateFormInfo"))

    @update_form_info.setter
    def update_form_info(self, value: "UpdateFormInfoRequest"):
        if self._info.get("updateFormInfo", None) == value:
            return
        self._info["updateFormInfo"] = value

    @property
    def update_item(self) -> "UpdateItemRequest":
        return UpdateItemRequest(object_info=self._info.get("updateItem"))

    @update_item.setter
    def update_item(self, value: "UpdateItemRequest"):
        if self._info.get("updateItem", None) == value:
            return
        self._info["updateItem"] = value

    @property
    def update_settings(self) -> "UpdateSettingsRequest":
        return UpdateSettingsRequest(object_info=self._info.get("updateSettings"))

    @update_settings.setter
    def update_settings(self, value: "UpdateSettingsRequest"):
        if self._info.get("updateSettings", None) == value:
            return
        self._info["updateSettings"] = value

    @property
    def wire_format(self) -> dict:
        base = ""
        base = base[0].lower() + base[1:]

        return {base: self._info}

Response

Bases: BaseFormItem

A single response from an update.

Source code in pygsuite/forms/generated/response.py
class Response(BaseFormItem):
    """
    A single response from an update.
    """

    def __init__(  # noqa: C901
        self, create_item: Optional["CreateItemResponse"] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if create_item is not None:

            generated["createItem"] = create_item._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def create_item(self) -> "CreateItemResponse":
        return CreateItemResponse(object_info=self._info.get("createItem"))

    @create_item.setter
    def create_item(self, value: "CreateItemResponse"):
        if self._info.get("createItem", None) == value:
            return
        self._info["createItem"] = value

RowQuestion

Bases: BaseFormItem

Configuration for a question that is part of a question group.

Source code in pygsuite/forms/generated/row_question.py
class RowQuestion(BaseFormItem):
    """
    Configuration for a question that is part of a question group.
    """

    def __init__(  # noqa: C901
        self, title: Optional[str] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if title is not None:

            generated["title"] = title
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def title(self) -> str:
        return self._info.get("title")

    @title.setter
    def title(self, value: str):
        if self._info.get("title", None) == value:
            return
        self._info["title"] = value

ScaleQuestion

Bases: BaseFormItem

A scale question. The user has a range of numeric values to choose from.

Source code in pygsuite/forms/generated/scale_question.py
class ScaleQuestion(BaseFormItem):
    """
    A scale question. The user has a range of numeric values to choose from.
    """

    def __init__(  # noqa: C901
        self,
        high: Optional[int] = None,
        high_label: Optional[str] = None,
        low: Optional[int] = None,
        low_label: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if high is not None:

            generated["high"] = high
        if high_label is not None:

            generated["highLabel"] = high_label
        if low is not None:

            generated["low"] = low
        if low_label is not None:

            generated["lowLabel"] = low_label
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def high(self) -> int:
        return self._info.get("high")

    @high.setter
    def high(self, value: int):
        if self._info.get("high", None) == value:
            return
        self._info["high"] = value

    @property
    def high_label(self) -> str:
        return self._info.get("highLabel")

    @high_label.setter
    def high_label(self, value: str):
        if self._info.get("highLabel", None) == value:
            return
        self._info["highLabel"] = value

    @property
    def low(self) -> int:
        return self._info.get("low")

    @low.setter
    def low(self, value: int):
        if self._info.get("low", None) == value:
            return
        self._info["low"] = value

    @property
    def low_label(self) -> str:
        return self._info.get("lowLabel")

    @low_label.setter
    def low_label(self, value: str):
        if self._info.get("lowLabel", None) == value:
            return
        self._info["lowLabel"] = value

TextAnswer

Bases: BaseFormItem

An answer to a question represented as text.

Source code in pygsuite/forms/generated/text_answer.py
class TextAnswer(BaseFormItem):
    """
    An answer to a question represented as text.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def value(self) -> str:
        return self._info.get("value")

TextAnswers

Bases: BaseFormItem

A question's answers as text.

Source code in pygsuite/forms/generated/text_answers.py
class TextAnswers(BaseFormItem):
    """
    A question's answers as text.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def answers(self) -> List["TextAnswer"]:
        return [TextAnswer(object_info=v) for v in self._info.get("answers", [])]

TextItem

Bases: BaseFormItem

A text item.

Source code in pygsuite/forms/generated/text_item.py
class TextItem(BaseFormItem):
    """
    A text item.
    """

    def __init__(self, object_info: Optional[Dict] = None):  # noqa: C901
        generated: Dict = {}

        object_info = object_info or generated
        super().__init__(object_info=object_info)

Bases: BaseFormItem

Link for text.

Source code in pygsuite/forms/generated/text_link.py
class TextLink(BaseFormItem):
    """
    Link for text.
    """

    def __init__(  # noqa: C901
        self,
        display_text: Optional[str] = None,
        uri: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if display_text is not None:

            generated["displayText"] = display_text
        if uri is not None:

            generated["uri"] = uri
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def display_text(self) -> str:
        return self._info.get("displayText")

    @display_text.setter
    def display_text(self, value: str):
        if self._info.get("displayText", None) == value:
            return
        self._info["displayText"] = value

    @property
    def uri(self) -> str:
        return self._info.get("uri")

    @uri.setter
    def uri(self, value: str):
        if self._info.get("uri", None) == value:
            return
        self._info["uri"] = value

TextQuestion

Bases: BaseFormItem

A text-based question.

Source code in pygsuite/forms/generated/text_question.py
class TextQuestion(BaseFormItem):
    """
    A text-based question.
    """

    def __init__(  # noqa: C901
        self, paragraph: Optional[bool] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if paragraph is not None:

            generated["paragraph"] = paragraph
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def paragraph(self) -> bool:
        return self._info.get("paragraph")

    @paragraph.setter
    def paragraph(self, value: bool):
        if self._info.get("paragraph", None) == value:
            return
        self._info["paragraph"] = value

TimeQuestion

Bases: BaseFormItem

A time question.

Source code in pygsuite/forms/generated/time_question.py
class TimeQuestion(BaseFormItem):
    """
    A time question.
    """

    def __init__(  # noqa: C901
        self, duration: Optional[bool] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if duration is not None:

            generated["duration"] = duration
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def duration(self) -> bool:
        return self._info.get("duration")

    @duration.setter
    def duration(self, value: bool):
        if self._info.get("duration", None) == value:
            return
        self._info["duration"] = value

UpdateFormInfoRequest

Bases: BaseFormItem

Update Form's Info.

Source code in pygsuite/forms/generated/update_form_info_request.py
class UpdateFormInfoRequest(BaseFormItem):
    """
    Update Form's Info.
    """

    def __init__(  # noqa: C901
        self,
        info: Optional["Info"] = None,
        update_mask: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if info is not None:

            generated["info"] = info._info
        if update_mask is not None:

            generated["updateMask"] = update_mask
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def info(self) -> "Info":
        return Info(object_info=self._info.get("info"))

    @info.setter
    def info(self, value: "Info"):
        if self._info.get("info", None) == value:
            return
        self._info["info"] = value

    @property
    def update_mask(self) -> str:
        return self._info.get("updateMask")

    @update_mask.setter
    def update_mask(self, value: str):
        if self._info.get("updateMask", None) == value:
            return
        self._info["updateMask"] = value

    @property
    def wire_format(self) -> dict:
        base = "UpdateFormInfo"
        base = base[0].lower() + base[1:]

        request = self._info
        components = "update_form_info_request".split("_")
        # if it's an update, we *may* need to provide an update mask
        # generate this automatically to include all fields
        # can be optionally overridden when creating synchronization method
        if components[0] == "update":
            if not self.update_mask:
                target_field = [
                    field for field in request.keys() if field not in ["update_mask", "location"]
                ][0]
                self._info["updateMask"] = ",".join(request[target_field].keys())

        return {base: self._info}

UpdateItemRequest

Bases: BaseFormItem

Update an item in a form.

Source code in pygsuite/forms/generated/update_item_request.py
class UpdateItemRequest(BaseFormItem):
    """
    Update an item in a form.
    """

    def __init__(  # noqa: C901
        self,
        item: Optional["Item"] = None,
        location: Optional["Location"] = None,
        update_mask: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if item is not None:

            generated["item"] = item._info
        if location is not None:

            generated["location"] = location._info
        if update_mask is not None:

            generated["updateMask"] = update_mask
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def item(self) -> "Item":
        return Item(object_info=self._info.get("item"))

    @item.setter
    def item(self, value: "Item"):
        if self._info.get("item", None) == value:
            return
        self._info["item"] = value

    @property
    def location(self) -> "Location":
        return Location(object_info=self._info.get("location"))

    @location.setter
    def location(self, value: "Location"):
        if self._info.get("location", None) == value:
            return
        self._info["location"] = value

    @property
    def update_mask(self) -> str:
        return self._info.get("updateMask")

    @update_mask.setter
    def update_mask(self, value: str):
        if self._info.get("updateMask", None) == value:
            return
        self._info["updateMask"] = value

    @property
    def wire_format(self) -> dict:
        base = "UpdateItem"
        base = base[0].lower() + base[1:]

        request = self._info
        components = "update_item_request".split("_")
        # if it's an update, we *may* need to provide an update mask
        # generate this automatically to include all fields
        # can be optionally overridden when creating synchronization method
        if components[0] == "update":
            if not self.update_mask:
                target_field = [
                    field for field in request.keys() if field not in ["update_mask", "location"]
                ][0]
                self._info["updateMask"] = ",".join(request[target_field].keys())

        return {base: self._info}

UpdateSettingsRequest

Bases: BaseFormItem

Update Form's FormSettings.

Source code in pygsuite/forms/generated/update_settings_request.py
class UpdateSettingsRequest(BaseFormItem):
    """
    Update Form's FormSettings.
    """

    def __init__(  # noqa: C901
        self,
        settings: Optional["FormSettings"] = None,
        update_mask: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}
        if settings is not None:

            generated["settings"] = settings._info
        if update_mask is not None:

            generated["updateMask"] = update_mask
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def settings(self) -> "FormSettings":
        return FormSettings(object_info=self._info.get("settings"))

    @settings.setter
    def settings(self, value: "FormSettings"):
        if self._info.get("settings", None) == value:
            return
        self._info["settings"] = value

    @property
    def update_mask(self) -> str:
        return self._info.get("updateMask")

    @update_mask.setter
    def update_mask(self, value: str):
        if self._info.get("updateMask", None) == value:
            return
        self._info["updateMask"] = value

    @property
    def wire_format(self) -> dict:
        base = "UpdateSettings"
        base = base[0].lower() + base[1:]

        request = self._info
        components = "update_settings_request".split("_")
        # if it's an update, we *may* need to provide an update mask
        # generate this automatically to include all fields
        # can be optionally overridden when creating synchronization method
        if components[0] == "update":
            if not self.update_mask:
                target_field = [
                    field for field in request.keys() if field not in ["update_mask", "location"]
                ][0]
                self._info["updateMask"] = ",".join(request[target_field].keys())

        return {base: self._info}

Video

Bases: BaseFormItem

Data representing a video.

Source code in pygsuite/forms/generated/video.py
class Video(BaseFormItem):
    """
    Data representing a video.
    """

    def __init__(  # noqa: C901
        self,
        properties: Optional["MediaProperties"] = None,
        youtube_uri: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if properties is not None:

            generated["properties"] = properties._info
        if youtube_uri is not None:

            generated["youtubeUri"] = youtube_uri
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def properties(self) -> "MediaProperties":
        return MediaProperties(object_info=self._info.get("properties"))

    @properties.setter
    def properties(self, value: "MediaProperties"):
        if self._info.get("properties", None) == value:
            return
        self._info["properties"] = value

    @property
    def youtube_uri(self) -> str:
        return self._info.get("youtubeUri")

    @youtube_uri.setter
    def youtube_uri(self, value: str):
        if self._info.get("youtubeUri", None) == value:
            return
        self._info["youtubeUri"] = value

VideoItem

Bases: BaseFormItem

An item containing a video.

Source code in pygsuite/forms/generated/video_item.py
class VideoItem(BaseFormItem):
    """
    An item containing a video.
    """

    def __init__(  # noqa: C901
        self,
        caption: Optional[str] = None,
        video: Optional["Video"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if caption is not None:

            generated["caption"] = caption
        if video is not None:

            generated["video"] = video._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def caption(self) -> str:
        return self._info.get("caption")

    @caption.setter
    def caption(self, value: str):
        if self._info.get("caption", None) == value:
            return
        self._info["caption"] = value

    @property
    def video(self) -> "Video":
        return Video(object_info=self._info.get("video"))

    @video.setter
    def video(self, value: "Video"):
        if self._info.get("video", None) == value:
            return
        self._info["video"] = value

Bases: BaseFormItem

Link to a video.

Source code in pygsuite/forms/generated/video_link.py
class VideoLink(BaseFormItem):
    """
    Link to a video.
    """

    def __init__(  # noqa: C901
        self,
        display_text: Optional[str] = None,
        youtube_uri: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if display_text is not None:

            generated["displayText"] = display_text
        if youtube_uri is not None:

            generated["youtubeUri"] = youtube_uri
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def display_text(self) -> str:
        return self._info.get("displayText")

    @display_text.setter
    def display_text(self, value: str):
        if self._info.get("displayText", None) == value:
            return
        self._info["displayText"] = value

    @property
    def youtube_uri(self) -> str:
        return self._info.get("youtubeUri")

    @youtube_uri.setter
    def youtube_uri(self, value: str):
        if self._info.get("youtubeUri", None) == value:
            return
        self._info["youtubeUri"] = value

Watch

Bases: BaseFormItem

A watch for events for a form. When the designated event happens, a notification will be published to the specified target. The notification's attributes will include a formId key that has the ID of the watched form and an eventType key that has the string of the type. Messages are sent with at-least-once delivery and are only dropped in extraordinary circumstances. Typically all notifications should be reliably delivered within a few seconds; however, in some situations notifications may be delayed. A watch expires seven days after it is created unless it is renewed with watches.renew

Source code in pygsuite/forms/generated/watch.py
class Watch(BaseFormItem):
    """
    A watch for events for a form. When the designated event happens, a notification will be published to the specified target. The notification's attributes will include a `formId` key that has the ID of the watched form and an `eventType` key that has the string of the type. Messages are sent with at-least-once delivery and are only dropped in extraordinary circumstances. Typically all notifications should be reliably delivered within a few seconds; however, in some situations notifications may be delayed. A watch expires seven days after it is created unless it is renewed with watches.renew
    """

    def __init__(  # noqa: C901
        self,
        event_type: Optional[str] = None,
        target: Optional["WatchTarget"] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if event_type is not None:

            generated["eventType"] = event_type
        if target is not None:

            generated["target"] = target._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def create_time(self) -> str:
        return self._info.get("createTime")

    @property
    def error_type(self) -> str:
        return self._info.get("errorType")

    @property
    def event_type(self) -> str:
        return self._info.get("eventType")

    @event_type.setter
    def event_type(self, value: str):
        if self._info.get("eventType", None) == value:
            return
        self._info["eventType"] = value

    @property
    def expire_time(self) -> str:
        return self._info.get("expireTime")

    @property
    def id(self) -> str:
        return self._info.get("id")

    @property
    def state(self) -> str:
        return self._info.get("state")

    @property
    def target(self) -> "WatchTarget":
        return WatchTarget(object_info=self._info.get("target"))

    @target.setter
    def target(self, value: "WatchTarget"):
        if self._info.get("target", None) == value:
            return
        self._info["target"] = value

WatchTarget

Bases: BaseFormItem

The target for notification delivery.

Source code in pygsuite/forms/generated/watch_target.py
class WatchTarget(BaseFormItem):
    """
    The target for notification delivery.
    """

    def __init__(  # noqa: C901
        self, topic: Optional["CloudPubsubTopic"] = None, object_info: Optional[Dict] = None
    ):
        generated: Dict = {}

        if topic is not None:

            generated["topic"] = topic._info
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def topic(self) -> "CloudPubsubTopic":
        return CloudPubsubTopic(object_info=self._info.get("topic"))

    @topic.setter
    def topic(self, value: "CloudPubsubTopic"):
        if self._info.get("topic", None) == value:
            return
        self._info["topic"] = value

WriteControl

Bases: BaseFormItem

Provides control over how write requests are executed.

Source code in pygsuite/forms/generated/write_control.py
class WriteControl(BaseFormItem):
    """
    Provides control over how write requests are executed.
    """

    def __init__(  # noqa: C901
        self,
        required_revision_id: Optional[str] = None,
        target_revision_id: Optional[str] = None,
        object_info: Optional[Dict] = None,
    ):
        generated: Dict = {}

        if required_revision_id is not None:

            generated["requiredRevisionId"] = required_revision_id
        if target_revision_id is not None:

            generated["targetRevisionId"] = target_revision_id
        object_info = object_info or generated
        super().__init__(object_info=object_info)

    @property
    def required_revision_id(self) -> str:
        return self._info.get("requiredRevisionId")

    @required_revision_id.setter
    def required_revision_id(self, value: str):
        if self._info.get("requiredRevisionId", None) == value:
            return
        self._info["requiredRevisionId"] = value

    @property
    def target_revision_id(self) -> str:
        return self._info.get("targetRevisionId")

    @target_revision_id.setter
    def target_revision_id(self, value: str):
        if self._info.get("targetRevisionId", None) == value:
            return
        self._info["targetRevisionId"] = value