forms

package
v0.213.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 18 Imported by: 5

Documentation

Overview

Package forms provides access to the Google Forms API.

For product documentation, see: https://developers.google.com/forms/api

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/forms/v1"
...
ctx := context.Background()
formsService, err := forms.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

formsService, err := forms.NewService(ctx, option.WithScopes(forms.FormsResponsesReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

formsService, err := forms.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
formsService, err := forms.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (
	// See, edit, create, and delete all of your Google Drive files
	DriveScope = "https://www.googleapis.com/auth/drive"

	// See, edit, create, and delete only the specific Google Drive files you use
	// with this app
	DriveFileScope = "https://www.googleapis.com/auth/drive.file"

	// See and download all your Google Drive files
	DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"

	// See, edit, create, and delete all your Google Forms forms
	FormsBodyScope = "https://www.googleapis.com/auth/forms.body"

	// See all your Google Forms forms
	FormsBodyReadonlyScope = "https://www.googleapis.com/auth/forms.body.readonly"

	// See all responses to your Google Forms forms
	FormsResponsesReadonlyScope = "https://www.googleapis.com/auth/forms.responses.readonly"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	// FileUploadAnswers: Output only. The answers to a file upload question.
	FileUploadAnswers *FileUploadAnswers `json:"fileUploadAnswers,omitempty"`
	// Grade: Output only. The grade for the answer if the form was a quiz.
	Grade *Grade `json:"grade,omitempty"`
	// QuestionId: Output only. The question's ID. See also Question.question_id.
	QuestionId string `json:"questionId,omitempty"`
	// TextAnswers: Output only. The specific answers as text.
	TextAnswers *TextAnswers `json:"textAnswers,omitempty"`
	// ForceSendFields is a list of field names (e.g. "FileUploadAnswers") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FileUploadAnswers") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Answer: The submitted answer for a question.

func (Answer) MarshalJSON

func (s Answer) MarshalJSON() ([]byte, error)

type BatchUpdateFormRequest

type BatchUpdateFormRequest struct {
	// IncludeFormInResponse: Whether to return an updated version of the model in
	// the response.
	IncludeFormInResponse bool `json:"includeFormInResponse,omitempty"`
	// Requests: Required. The update requests of this batch.
	Requests []*Request `json:"requests,omitempty"`
	// WriteControl: Provides control over how write requests are executed.
	WriteControl *WriteControl `json:"writeControl,omitempty"`
	// ForceSendFields is a list of field names (e.g. "IncludeFormInResponse") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "IncludeFormInResponse") to
	// include in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (BatchUpdateFormRequest) MarshalJSON

func (s BatchUpdateFormRequest) MarshalJSON() ([]byte, error)

type BatchUpdateFormResponse

type BatchUpdateFormResponse struct {
	// Form: Based on the bool request field `include_form_in_response`, a form
	// with all applied mutations/updates is returned or not. This may be later
	// than the revision ID created by these changes.
	Form *Form `json:"form,omitempty"`
	// Replies: The reply of the updates. This maps 1:1 with the update requests,
	// although replies to some requests may be empty.
	Replies []*Response `json:"replies,omitempty"`
	// WriteControl: The updated write control after applying the request.
	WriteControl *WriteControl `json:"writeControl,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Form") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Form") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

BatchUpdateFormResponse: Response to a BatchUpdateFormRequest.

func (BatchUpdateFormResponse) MarshalJSON

func (s BatchUpdateFormResponse) MarshalJSON() ([]byte, error)

type ChoiceQuestion

type ChoiceQuestion struct {
	// Options: Required. List of options that a respondent must choose from.
	Options []*Option `json:"options,omitempty"`
	// Shuffle: Whether the options should be displayed in random order for
	// different instances of the quiz. This is often used to prevent cheating by
	// respondents who might be looking at another respondent's screen, or to
	// address bias in a survey that might be introduced by always putting the same
	// options first or last.
	Shuffle bool `json:"shuffle,omitempty"`
	// Type: Required. The type of choice question.
	//
	// Possible values:
	//   "CHOICE_TYPE_UNSPECIFIED" - Default value. Unused.
	//   "RADIO" - Radio buttons: All choices are shown to the user, who can only
	// pick one of them.
	//   "CHECKBOX" - Checkboxes: All choices are shown to the user, who can pick
	// any number of them.
	//   "DROP_DOWN" - Drop-down menu: The choices are only shown to the user on
	// demand, otherwise only the current choice is shown. Only one option can be
	// chosen.
	Type string `json:"type,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Options") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Options") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ChoiceQuestion: A radio/checkbox/dropdown question.

func (ChoiceQuestion) MarshalJSON

func (s ChoiceQuestion) MarshalJSON() ([]byte, error)

type CloudPubsubTopic

type CloudPubsubTopic struct {
	// TopicName: Required. A fully qualified Pub/Sub topic name to publish the
	// events to. This topic must be owned by the calling project and already exist
	// in Pub/Sub.
	TopicName string `json:"topicName,omitempty"`
	// ForceSendFields is a list of field names (e.g. "TopicName") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "TopicName") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CloudPubsubTopic: A Pub/Sub topic.

func (CloudPubsubTopic) MarshalJSON

func (s CloudPubsubTopic) MarshalJSON() ([]byte, error)

type CorrectAnswer

type CorrectAnswer struct {
	// Value: Required. The correct answer value. See the documentation for
	// TextAnswer.value for details on how various value types are formatted.
	Value string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Value") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Value") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CorrectAnswer: 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.

func (CorrectAnswer) MarshalJSON

func (s CorrectAnswer) MarshalJSON() ([]byte, error)

type CorrectAnswers

type CorrectAnswers struct {
	// Answers: A list of correct answers. A quiz response can be automatically
	// graded based on these answers. For single-valued questions, a response is
	// marked correct if it matches any value in this list (in other words,
	// multiple correct answers are possible). For multiple-valued (`CHECKBOX`)
	// questions, a response is marked correct if it contains exactly the values in
	// this list.
	Answers []*CorrectAnswer `json:"answers,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Answers") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Answers") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CorrectAnswers: The answer key for a question.

func (CorrectAnswers) MarshalJSON

func (s CorrectAnswers) MarshalJSON() ([]byte, error)

type CreateItemRequest

type CreateItemRequest struct {
	// Item: Required. The item to create.
	Item *Item `json:"item,omitempty"`
	// Location: Required. Where to place the new item.
	Location *Location `json:"location,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Item") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Item") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CreateItemRequest: Create an item in a form.

func (CreateItemRequest) MarshalJSON

func (s CreateItemRequest) MarshalJSON() ([]byte, error)

type CreateItemResponse

type CreateItemResponse struct {
	// ItemId: The ID of the created item.
	ItemId string `json:"itemId,omitempty"`
	// QuestionId: The ID of the question created as part of this item, for a
	// question group it lists IDs of all the questions created for this item.
	QuestionId []string `json:"questionId,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ItemId") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ItemId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CreateItemResponse: The result of creating an item.

func (CreateItemResponse) MarshalJSON

func (s CreateItemResponse) MarshalJSON() ([]byte, error)

type CreateWatchRequest

type CreateWatchRequest struct {
	// Watch: Required. The watch object. No ID should be set on this object; use
	// `watch_id` instead.
	Watch *Watch `json:"watch,omitempty"`
	// WatchId: The ID to use for the watch. If specified, the ID must not already
	// be in use. If not specified, an ID is generated. This value should be 4-63
	// characters, and valid characters are /a-z-/.
	WatchId string `json:"watchId,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Watch") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Watch") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

CreateWatchRequest: Create a new watch.

func (CreateWatchRequest) MarshalJSON

func (s CreateWatchRequest) MarshalJSON() ([]byte, error)

type DateQuestion

type DateQuestion struct {
	// IncludeTime: Whether to include the time as part of the question.
	IncludeTime bool `json:"includeTime,omitempty"`
	// IncludeYear: Whether to include the year as part of the question.
	IncludeYear bool `json:"includeYear,omitempty"`
	// ForceSendFields is a list of field names (e.g. "IncludeTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "IncludeTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (DateQuestion) MarshalJSON

func (s DateQuestion) MarshalJSON() ([]byte, error)

type DeleteItemRequest

type DeleteItemRequest struct {
	// Location: Required. The location of the item to delete.
	Location *Location `json:"location,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Location") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Location") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

DeleteItemRequest: Delete an item in a form.

func (DeleteItemRequest) MarshalJSON

func (s DeleteItemRequest) MarshalJSON() ([]byte, error)

type Empty

type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

Empty: 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); }

type ExtraMaterial

type ExtraMaterial struct {
	// Link: Text feedback.
	Link *TextLink `json:"link,omitempty"`
	// Video: Video feedback.
	Video *VideoLink `json:"video,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Link") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Link") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ExtraMaterial: Supplementary material to the feedback.

func (ExtraMaterial) MarshalJSON

func (s ExtraMaterial) MarshalJSON() ([]byte, error)

type Feedback

type Feedback struct {
	// Material: Additional information provided as part of the feedback, often
	// used to point the respondent to more reading and resources.
	Material []*ExtraMaterial `json:"material,omitempty"`
	// Text: Required. The main text of the feedback.
	Text string `json:"text,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Material") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Material") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Feedback: Feedback for a respondent about their response to a question.

func (Feedback) MarshalJSON

func (s Feedback) MarshalJSON() ([]byte, error)

type FileUploadAnswer

type FileUploadAnswer struct {
	// FileId: Output only. The ID of the Google Drive file.
	FileId string `json:"fileId,omitempty"`
	// FileName: Output only. The file name, as stored in Google Drive on upload.
	FileName string `json:"fileName,omitempty"`
	// MimeType: Output only. The MIME type of the file, as stored in Google Drive
	// on upload.
	MimeType string `json:"mimeType,omitempty"`
	// ForceSendFields is a list of field names (e.g. "FileId") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FileId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (FileUploadAnswer) MarshalJSON

func (s FileUploadAnswer) MarshalJSON() ([]byte, error)

type FileUploadAnswers

type FileUploadAnswers struct {
	// Answers: Output only. All submitted files for a FileUpload question.
	Answers []*FileUploadAnswer `json:"answers,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Answers") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Answers") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

FileUploadAnswers: All submitted files for a FileUpload question.

func (FileUploadAnswers) MarshalJSON

func (s FileUploadAnswers) MarshalJSON() ([]byte, error)

type FileUploadQuestion

type FileUploadQuestion struct {
	// FolderId: Required. The ID of the Drive folder where uploaded files are
	// stored.
	FolderId string `json:"folderId,omitempty"`
	// MaxFileSize: Maximum number of bytes allowed for any single file uploaded to
	// this question.
	MaxFileSize int64 `json:"maxFileSize,omitempty,string"`
	// MaxFiles: Maximum number of files that can be uploaded for this question in
	// a single response.
	MaxFiles int64 `json:"maxFiles,omitempty"`
	// Types: File types accepted by this question.
	//
	// Possible values:
	//   "FILE_TYPE_UNSPECIFIED" - Default value. Unused.
	//   "ANY" - No restrictions on type.
	//   "DOCUMENT" - A Google Docs document.
	//   "PRESENTATION" - A Google Slides presentation.
	//   "SPREADSHEET" - A Google Sheets spreadsheet.
	//   "DRAWING" - A drawing.
	//   "PDF" - A PDF.
	//   "IMAGE" - An image.
	//   "VIDEO" - A video.
	//   "AUDIO" - An audio file.
	Types []string `json:"types,omitempty"`
	// ForceSendFields is a list of field names (e.g. "FolderId") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FolderId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (FileUploadQuestion) MarshalJSON

func (s FileUploadQuestion) MarshalJSON() ([]byte, error)

type Form

type Form struct {
	// FormId: Output only. The form ID.
	FormId string `json:"formId,omitempty"`
	// Info: Required. The title and description of the form.
	Info *Info `json:"info,omitempty"`
	// Items: Required. A list of the form's items, which can include section
	// headers, questions, embedded media, etc.
	Items []*Item `json:"items,omitempty"`
	// LinkedSheetId: Output only. The ID of the linked Google Sheet which is
	// accumulating responses from this Form (if such a Sheet exists).
	LinkedSheetId string `json:"linkedSheetId,omitempty"`
	// ResponderUri: Output only. The form URI to share with responders. This opens
	// a page that allows the user to submit responses but not edit the questions.
	ResponderUri string `json:"responderUri,omitempty"`
	// RevisionId: Output only. The revision ID of the form. Used in the
	// WriteControl in update requests to identify the revision on which the
	// changes are based. The format of the revision ID may change over time, so it
	// should be treated opaquely. A returned revision ID is only guaranteed to be
	// valid for 24 hours after it has been returned and cannot be shared across
	// users. If the revision ID is unchanged between calls, then the form has not
	// changed. Conversely, a changed ID (for the same form and user) usually means
	// the form has been updated; however, a changed ID can also be due to internal
	// factors such as ID format changes.
	RevisionId string `json:"revisionId,omitempty"`
	// Settings: The form's settings. This must be updated with
	// UpdateSettingsRequest; it is ignored during `forms.create` and
	// UpdateFormInfoRequest.
	Settings *FormSettings `json:"settings,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "FormId") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FormId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Form: A Google Forms document. A form is created in Drive, and deleting a form or changing its access protections is done via the Drive API (https://developers.google.com/drive/api/v3/about-sdk).

func (Form) MarshalJSON

func (s Form) MarshalJSON() ([]byte, error)

type FormResponse

type FormResponse struct {
	// Answers: Output only. The actual answers to the questions, keyed by
	// question_id.
	Answers map[string]Answer `json:"answers,omitempty"`
	// CreateTime: Output only. Timestamp for the first time the response was
	// submitted.
	CreateTime string `json:"createTime,omitempty"`
	// FormId: Output only. The form ID.
	FormId string `json:"formId,omitempty"`
	// LastSubmittedTime: Output only. Timestamp for the most recent time the
	// response was submitted. Does not track changes to grades.
	LastSubmittedTime string `json:"lastSubmittedTime,omitempty"`
	// RespondentEmail: Output only. The email address (if collected) for the
	// respondent.
	RespondentEmail string `json:"respondentEmail,omitempty"`
	// ResponseId: Output only. The response ID.
	ResponseId string `json:"responseId,omitempty"`
	// TotalScore: Output only. The total number of points the respondent received
	// for their submission Only set if the form was a quiz and the response was
	// graded. This includes points automatically awarded via autograding adjusted
	// by any manual corrections entered by the form owner.
	TotalScore float64 `json:"totalScore,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Answers") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Answers") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

FormResponse: A form response.

func (FormResponse) MarshalJSON

func (s FormResponse) MarshalJSON() ([]byte, error)

func (*FormResponse) UnmarshalJSON

func (s *FormResponse) UnmarshalJSON(data []byte) error

type FormSettings

type FormSettings struct {
	// QuizSettings: Settings related to quiz forms and grading.
	QuizSettings *QuizSettings `json:"quizSettings,omitempty"`
	// ForceSendFields is a list of field names (e.g. "QuizSettings") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "QuizSettings") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

FormSettings: A form's settings.

func (FormSettings) MarshalJSON

func (s FormSettings) MarshalJSON() ([]byte, error)

type FormsBatchUpdateCall

type FormsBatchUpdateCall struct {
	// contains filtered or unexported fields
}

func (*FormsBatchUpdateCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsBatchUpdateCall) Do

Do executes the "forms.forms.batchUpdate" call. Any non-2xx status code is an error. Response headers are in either *BatchUpdateFormResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsBatchUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsBatchUpdateCall) Header

func (c *FormsBatchUpdateCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type FormsCreateCall

type FormsCreateCall struct {
	// contains filtered or unexported fields
}

func (*FormsCreateCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsCreateCall) Do

func (c *FormsCreateCall) Do(opts ...googleapi.CallOption) (*Form, error)

Do executes the "forms.forms.create" call. Any non-2xx status code is an error. Response headers are in either *Form.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsCreateCall) Header

func (c *FormsCreateCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type FormsGetCall

type FormsGetCall struct {
	// contains filtered or unexported fields
}

func (*FormsGetCall) Context

func (c *FormsGetCall) Context(ctx context.Context) *FormsGetCall

Context sets the context to be used in this call's Do method.

func (*FormsGetCall) Do

func (c *FormsGetCall) Do(opts ...googleapi.CallOption) (*Form, error)

Do executes the "forms.forms.get" call. Any non-2xx status code is an error. Response headers are in either *Form.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsGetCall) Fields

func (c *FormsGetCall) Fields(s ...googleapi.Field) *FormsGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsGetCall) Header

func (c *FormsGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*FormsGetCall) IfNoneMatch

func (c *FormsGetCall) IfNoneMatch(entityTag string) *FormsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type FormsResponsesGetCall

type FormsResponsesGetCall struct {
	// contains filtered or unexported fields
}

func (*FormsResponsesGetCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsResponsesGetCall) Do

Do executes the "forms.forms.responses.get" call. Any non-2xx status code is an error. Response headers are in either *FormResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsResponsesGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsResponsesGetCall) Header

func (c *FormsResponsesGetCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*FormsResponsesGetCall) IfNoneMatch

func (c *FormsResponsesGetCall) IfNoneMatch(entityTag string) *FormsResponsesGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type FormsResponsesListCall

type FormsResponsesListCall struct {
	// contains filtered or unexported fields
}

func (*FormsResponsesListCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsResponsesListCall) Do

Do executes the "forms.forms.responses.list" call. Any non-2xx status code is an error. Response headers are in either *ListFormResponsesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsResponsesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsResponsesListCall) Filter

Filter sets the optional parameter "filter": Which form responses to return. Currently, the only supported filters are: * timestamp > *N* which means to get all form responses submitted after (but not at) timestamp *N*. * timestamp >= *N* which means to get all form responses submitted at and after timestamp *N*. For both supported filters, timestamp must be formatted in RFC3339 UTC "Zulu" format. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

func (*FormsResponsesListCall) Header

func (c *FormsResponsesListCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*FormsResponsesListCall) IfNoneMatch

func (c *FormsResponsesListCall) IfNoneMatch(entityTag string) *FormsResponsesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

func (*FormsResponsesListCall) PageSize

func (c *FormsResponsesListCall) PageSize(pageSize int64) *FormsResponsesListCall

PageSize sets the optional parameter "pageSize": The maximum number of responses to return. The service may return fewer than this value. If unspecified or zero, at most 5000 responses are returned.

func (*FormsResponsesListCall) PageToken

func (c *FormsResponsesListCall) PageToken(pageToken string) *FormsResponsesListCall

PageToken sets the optional parameter "pageToken": A page token returned by a previous list response. If this field is set, the form and the values of the filter must be the same as for the original request.

func (*FormsResponsesListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type FormsResponsesService

type FormsResponsesService struct {
	// contains filtered or unexported fields
}

func NewFormsResponsesService

func NewFormsResponsesService(s *Service) *FormsResponsesService

func (*FormsResponsesService) Get

func (r *FormsResponsesService) Get(formId string, responseId string) *FormsResponsesGetCall

Get: Get one response from the form.

- formId: The form ID. - responseId: The response ID within the form.

func (*FormsResponsesService) List

List: List a form's responses.

- formId: ID of the Form whose responses to list.

type FormsService

type FormsService struct {
	Responses *FormsResponsesService

	Watches *FormsWatchesService
	// contains filtered or unexported fields
}

func NewFormsService

func NewFormsService(s *Service) *FormsService

func (*FormsService) BatchUpdate

func (r *FormsService) BatchUpdate(formId string, batchupdateformrequest *BatchUpdateFormRequest) *FormsBatchUpdateCall

BatchUpdate: Change the form with a batch of updates.

- formId: The form ID.

func (*FormsService) Create

func (r *FormsService) Create(form *Form) *FormsCreateCall

Create: Create a new form using the title given in the provided form message in the request. *Important:* Only the form.info.title and form.info.document_title fields are copied to the new form. All other fields including the form description, items and settings are disallowed. To create a new form and add items, you must first call forms.create to create an empty form with a title and (optional) document title, and then call forms.update to add the items.

func (*FormsService) Get

func (r *FormsService) Get(formId string) *FormsGetCall

Get: Get a form.

- formId: The form ID.

type FormsWatchesCreateCall

type FormsWatchesCreateCall struct {
	// contains filtered or unexported fields
}

func (*FormsWatchesCreateCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsWatchesCreateCall) Do

Do executes the "forms.forms.watches.create" call. Any non-2xx status code is an error. Response headers are in either *Watch.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsWatchesCreateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsWatchesCreateCall) Header

func (c *FormsWatchesCreateCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type FormsWatchesDeleteCall

type FormsWatchesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*FormsWatchesDeleteCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsWatchesDeleteCall) Do

Do executes the "forms.forms.watches.delete" call. Any non-2xx status code is an error. Response headers are in either *Empty.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsWatchesDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsWatchesDeleteCall) Header

func (c *FormsWatchesDeleteCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type FormsWatchesListCall

type FormsWatchesListCall struct {
	// contains filtered or unexported fields
}

func (*FormsWatchesListCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsWatchesListCall) Do

Do executes the "forms.forms.watches.list" call. Any non-2xx status code is an error. Response headers are in either *ListWatchesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsWatchesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsWatchesListCall) Header

func (c *FormsWatchesListCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

func (*FormsWatchesListCall) IfNoneMatch

func (c *FormsWatchesListCall) IfNoneMatch(entityTag string) *FormsWatchesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.

type FormsWatchesRenewCall

type FormsWatchesRenewCall struct {
	// contains filtered or unexported fields
}

func (*FormsWatchesRenewCall) Context

Context sets the context to be used in this call's Do method.

func (*FormsWatchesRenewCall) Do

Do executes the "forms.forms.watches.renew" call. Any non-2xx status code is an error. Response headers are in either *Watch.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*FormsWatchesRenewCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.

func (*FormsWatchesRenewCall) Header

func (c *FormsWatchesRenewCall) Header() http.Header

Header returns a http.Header that can be modified by the caller to add headers to the request.

type FormsWatchesService

type FormsWatchesService struct {
	// contains filtered or unexported fields
}

func NewFormsWatchesService

func NewFormsWatchesService(s *Service) *FormsWatchesService

func (*FormsWatchesService) Create

func (r *FormsWatchesService) Create(formId string, createwatchrequest *CreateWatchRequest) *FormsWatchesCreateCall

Create: Create a new watch. If a watch ID is provided, it must be unused. For each invoking project, the per form limit is one watch per Watch.EventType. A watch expires seven days after it is created (see Watch.expire_time).

- formId: ID of the Form to watch.

func (*FormsWatchesService) Delete

func (r *FormsWatchesService) Delete(formId string, watchId string) *FormsWatchesDeleteCall

Delete: Delete a watch.

- formId: The ID of the Form. - watchId: The ID of the Watch to delete.

func (*FormsWatchesService) List

List: Return a list of the watches owned by the invoking project. The maximum number of watches is two: For each invoker, the limit is one for each event type per form.

- formId: ID of the Form whose watches to list.

func (*FormsWatchesService) Renew

func (r *FormsWatchesService) Renew(formId string, watchId string, renewwatchrequest *RenewWatchRequest) *FormsWatchesRenewCall

Renew: Renew an existing watch for seven days. The state of the watch after renewal is `ACTIVE`, and the `expire_time` is seven days from the renewal. Renewing a watch in an error state (e.g. `SUSPENDED`) succeeds if the error is no longer present, but fail otherwise. After a watch has expired, RenewWatch returns `NOT_FOUND`.

- formId: The ID of the Form. - watchId: The ID of the Watch to renew.

type Grade

type Grade struct {
	// Correct: Output only. Whether the question was answered correctly or not. A
	// zero-point score is not enough to infer incorrectness, since a correctly
	// answered question could be worth zero points.
	Correct bool `json:"correct,omitempty"`
	// Feedback: Output only. Additional feedback given for an answer.
	Feedback *Feedback `json:"feedback,omitempty"`
	// Score: Output only. The numeric score awarded for the answer.
	Score float64 `json:"score,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Correct") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Correct") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (Grade) MarshalJSON

func (s Grade) MarshalJSON() ([]byte, error)

func (*Grade) UnmarshalJSON

func (s *Grade) UnmarshalJSON(data []byte) error

type Grading

type Grading struct {
	// CorrectAnswers: Required. The answer key for the question. Responses are
	// automatically graded based on this field.
	CorrectAnswers *CorrectAnswers `json:"correctAnswers,omitempty"`
	// GeneralFeedback: The feedback displayed for all answers. This is commonly
	// used for short answer questions when a quiz owner wants to quickly give
	// respondents some sense of whether they answered the question correctly
	// before they've had a chance to officially grade the response. General
	// feedback cannot be set for automatically graded multiple choice questions.
	GeneralFeedback *Feedback `json:"generalFeedback,omitempty"`
	// PointValue: Required. The maximum number of points a respondent can
	// automatically get for a correct answer. This must not be negative.
	PointValue int64 `json:"pointValue,omitempty"`
	// WhenRight: The feedback displayed for correct responses. This feedback can
	// only be set for multiple choice questions that have correct answers
	// provided.
	WhenRight *Feedback `json:"whenRight,omitempty"`
	// WhenWrong: The feedback displayed for incorrect responses. This feedback can
	// only be set for multiple choice questions that have correct answers
	// provided.
	WhenWrong *Feedback `json:"whenWrong,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CorrectAnswers") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CorrectAnswers") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Grading: Grading for a single question

func (Grading) MarshalJSON

func (s Grading) MarshalJSON() ([]byte, error)

type Grid

type Grid struct {
	// Columns: Required. The choices shared by each question in the grid. In other
	// words, the values of the columns. Only `CHECK_BOX` and `RADIO` choices are
	// allowed.
	Columns *ChoiceQuestion `json:"columns,omitempty"`
	// ShuffleQuestions: If `true`, the questions are randomly ordered. In other
	// words, the rows appear in a different order for every respondent.
	ShuffleQuestions bool `json:"shuffleQuestions,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Columns") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Columns") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Grid: 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.

func (Grid) MarshalJSON

func (s Grid) MarshalJSON() ([]byte, error)

type Image

type Image struct {
	// AltText: A description of the image that is shown on hover and read by
	// screenreaders.
	AltText string `json:"altText,omitempty"`
	// ContentUri: Output only. A URI from which you can download the image; this
	// is valid only for a limited time.
	ContentUri string `json:"contentUri,omitempty"`
	// Properties: Properties of an image.
	Properties *MediaProperties `json:"properties,omitempty"`
	// SourceUri: Input only. The source URI is the URI used to insert the image.
	// The source URI can be empty when fetched.
	SourceUri string `json:"sourceUri,omitempty"`
	// ForceSendFields is a list of field names (e.g. "AltText") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AltText") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Image: Data representing an image.

func (Image) MarshalJSON

func (s Image) MarshalJSON() ([]byte, error)

type ImageItem

type ImageItem struct {
	// Image: Required. The image displayed in the item.
	Image *Image `json:"image,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Image") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Image") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ImageItem: An item containing an image.

func (ImageItem) MarshalJSON

func (s ImageItem) MarshalJSON() ([]byte, error)

type Info

type Info struct {
	// Description: The description of the form.
	Description string `json:"description,omitempty"`
	// DocumentTitle: Output only. The title of the document which is visible in
	// Drive. If `Info.title` is empty, `document_title` may appear in its place in
	// the Google Forms UI and be visible to responders. `document_title` can be
	// set on create, but cannot be modified by a batchUpdate request. Please use
	// the Google Drive API
	// (https://developers.google.com/drive/api/v3/reference/files/update) if you
	// need to programmatically update `document_title`.
	DocumentTitle string `json:"documentTitle,omitempty"`
	// Title: Required. The title of the form which is visible to responders.
	Title string `json:"title,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Description") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Description") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Info: The general information for a form.

func (Info) MarshalJSON

func (s Info) MarshalJSON() ([]byte, error)

type Item

type Item struct {
	// Description: The description of the item.
	Description string `json:"description,omitempty"`
	// ImageItem: Displays an image on the page.
	ImageItem *ImageItem `json:"imageItem,omitempty"`
	// ItemId: The item ID. On creation, it can be provided but the ID must not be
	// already used in the form. If not provided, a new ID is assigned.
	ItemId string `json:"itemId,omitempty"`
	// PageBreakItem: Starts a new page with a title.
	PageBreakItem *PageBreakItem `json:"pageBreakItem,omitempty"`
	// QuestionGroupItem: Poses one or more questions to the user with a single
	// major prompt.
	QuestionGroupItem *QuestionGroupItem `json:"questionGroupItem,omitempty"`
	// QuestionItem: Poses a question to the user.
	QuestionItem *QuestionItem `json:"questionItem,omitempty"`
	// TextItem: Displays a title and description on the page.
	TextItem *TextItem `json:"textItem,omitempty"`
	// Title: The title of the item.
	Title string `json:"title,omitempty"`
	// VideoItem: Displays a video on the page.
	VideoItem *VideoItem `json:"videoItem,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Description") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Description") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (Item) MarshalJSON

func (s Item) MarshalJSON() ([]byte, error)

type ListFormResponsesResponse

type ListFormResponsesResponse struct {
	// NextPageToken: If set, there are more responses. To get the next page of
	// responses, provide this as `page_token` in a future request.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// Responses: The returned form responses. Note: The `formId` field is not
	// returned in the `FormResponse` object for list requests.
	Responses []*FormResponse `json:"responses,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListFormResponsesResponse: Response to a ListFormResponsesRequest.

func (ListFormResponsesResponse) MarshalJSON

func (s ListFormResponsesResponse) MarshalJSON() ([]byte, error)

type ListWatchesResponse

type ListWatchesResponse struct {
	// Watches: The returned watches.
	Watches []*Watch `json:"watches,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Watches") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Watches") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

ListWatchesResponse: The response of a ListWatchesRequest.

func (ListWatchesResponse) MarshalJSON

func (s ListWatchesResponse) MarshalJSON() ([]byte, error)

type Location

type Location struct {
	// Index: The index of an item in the form. This must be in the range [0..*N*),
	// where *N* is the number of items in the form.
	Index int64 `json:"index,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Index") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Index") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Location: A specific location in a form.

func (Location) MarshalJSON

func (s Location) MarshalJSON() ([]byte, error)

type MediaProperties

type MediaProperties struct {
	// Alignment: Position of the media.
	//
	// Possible values:
	//   "ALIGNMENT_UNSPECIFIED" - Default value. Unused.
	//   "LEFT" - Left align.
	//   "RIGHT" - Right align.
	//   "CENTER" - Center.
	Alignment string `json:"alignment,omitempty"`
	// Width: The width of the media in pixels. When the media is displayed, it is
	// scaled to the smaller of this value or the width of the displayed form. The
	// original aspect ratio of the media is preserved. If a width is not specified
	// when the media is added to the form, it is set to the width of the media
	// source. Width must be between 0 and 740, inclusive. Setting width to 0 or
	// unspecified is only permitted when updating the media source.
	Width int64 `json:"width,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Alignment") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Alignment") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

MediaProperties: Properties of the media.

func (MediaProperties) MarshalJSON

func (s MediaProperties) MarshalJSON() ([]byte, error)

type MoveItemRequest

type MoveItemRequest struct {
	// NewLocation: Required. The new location for the item.
	NewLocation *Location `json:"newLocation,omitempty"`
	// OriginalLocation: Required. The location of the item to move.
	OriginalLocation *Location `json:"originalLocation,omitempty"`
	// ForceSendFields is a list of field names (e.g. "NewLocation") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NewLocation") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

MoveItemRequest: Move an item in a form.

func (MoveItemRequest) MarshalJSON

func (s MoveItemRequest) MarshalJSON() ([]byte, error)

type Option

type Option struct {
	// GoToAction: Section navigation type.
	//
	// Possible values:
	//   "GO_TO_ACTION_UNSPECIFIED" - Default value. Unused.
	//   "NEXT_SECTION" - Go to the next section.
	//   "RESTART_FORM" - Go back to the beginning of the form.
	//   "SUBMIT_FORM" - Submit form immediately.
	GoToAction string `json:"goToAction,omitempty"`
	// GoToSectionId: Item ID of section header to go to.
	GoToSectionId string `json:"goToSectionId,omitempty"`
	// Image: Display image as an option.
	Image *Image `json:"image,omitempty"`
	// IsOther: Whether the option is "other". Currently only applies to `RADIO`
	// and `CHECKBOX` choice types, but is not allowed in a QuestionGroupItem.
	IsOther bool `json:"isOther,omitempty"`
	// Value: Required. The choice as presented to the user.
	Value string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "GoToAction") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "GoToAction") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Option: An option for a Choice question.

func (Option) MarshalJSON

func (s Option) MarshalJSON() ([]byte, error)

type PageBreakItem

type PageBreakItem struct {
}

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

type Question

type Question struct {
	// ChoiceQuestion: A respondent can choose from a pre-defined set of options.
	ChoiceQuestion *ChoiceQuestion `json:"choiceQuestion,omitempty"`
	// DateQuestion: A respondent can enter a date.
	DateQuestion *DateQuestion `json:"dateQuestion,omitempty"`
	// FileUploadQuestion: A respondent can upload one or more files.
	FileUploadQuestion *FileUploadQuestion `json:"fileUploadQuestion,omitempty"`
	// Grading: Grading setup for the question.
	Grading *Grading `json:"grading,omitempty"`
	// QuestionId: Read only. The question ID. On creation, it can be provided but
	// the ID must not be already used in the form. If not provided, a new ID is
	// assigned.
	QuestionId string `json:"questionId,omitempty"`
	// RatingQuestion: A respondent can choose a rating from a pre-defined set of
	// icons.
	RatingQuestion *RatingQuestion `json:"ratingQuestion,omitempty"`
	// Required: Whether the question must be answered in order for a respondent to
	// submit their response.
	Required bool `json:"required,omitempty"`
	// RowQuestion: A row of a QuestionGroupItem.
	RowQuestion *RowQuestion `json:"rowQuestion,omitempty"`
	// ScaleQuestion: A respondent can choose a number from a range.
	ScaleQuestion *ScaleQuestion `json:"scaleQuestion,omitempty"`
	// TextQuestion: A respondent can enter a free text response.
	TextQuestion *TextQuestion `json:"textQuestion,omitempty"`
	// TimeQuestion: A respondent can enter a time.
	TimeQuestion *TimeQuestion `json:"timeQuestion,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ChoiceQuestion") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ChoiceQuestion") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (Question) MarshalJSON

func (s Question) MarshalJSON() ([]byte, error)

type QuestionGroupItem

type QuestionGroupItem struct {
	// Grid: The question group is a grid with rows of multiple choice questions
	// that share the same options. When `grid` is set, all questions in the group
	// must be of kind `row`.
	Grid *Grid `json:"grid,omitempty"`
	// Image: The image displayed within the question group above the specific
	// questions.
	Image *Image `json:"image,omitempty"`
	// Questions: Required. A list of questions that belong in this question group.
	// A question must only belong to one group. The `kind` of the group may affect
	// what types of questions are allowed.
	Questions []*Question `json:"questions,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Grid") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Grid") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

QuestionGroupItem: Defines a question that comprises multiple questions grouped together.

func (QuestionGroupItem) MarshalJSON

func (s QuestionGroupItem) MarshalJSON() ([]byte, error)

type QuestionItem

type QuestionItem struct {
	// Image: The image displayed within the question.
	Image *Image `json:"image,omitempty"`
	// Question: Required. The displayed question.
	Question *Question `json:"question,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Image") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Image") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

QuestionItem: A form item containing a single question.

func (QuestionItem) MarshalJSON

func (s QuestionItem) MarshalJSON() ([]byte, error)

type QuizSettings

type QuizSettings struct {
	// IsQuiz: Whether this form is a quiz or not. When true, responses are graded
	// based on question Grading. Upon setting to false, all question Grading is
	// deleted.
	IsQuiz bool `json:"isQuiz,omitempty"`
	// ForceSendFields is a list of field names (e.g. "IsQuiz") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "IsQuiz") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (QuizSettings) MarshalJSON

func (s QuizSettings) MarshalJSON() ([]byte, error)

type RatingQuestion added in v0.208.0

type RatingQuestion struct {
	// IconType: Required. The icon type to use for the rating.
	//
	// Possible values:
	//   "RATING_ICON_TYPE_UNSPECIFIED" - Default value. Unused.
	//   "STAR" - A star icon.
	//   "HEART" - A heart icon.
	//   "THUMB_UP" - A thumbs down icon.
	IconType string `json:"iconType,omitempty"`
	// RatingScaleLevel: Required. The rating scale level of the rating question.
	RatingScaleLevel int64 `json:"ratingScaleLevel,omitempty"`
	// ForceSendFields is a list of field names (e.g. "IconType") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "IconType") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

RatingQuestion: A rating question. The user has a range of icons to choose from.

func (RatingQuestion) MarshalJSON added in v0.208.0

func (s RatingQuestion) MarshalJSON() ([]byte, error)

type RenewWatchRequest

type RenewWatchRequest struct {
}

RenewWatchRequest: Renew an existing Watch for seven days.

type Request

type Request struct {
	// CreateItem: Create a new item.
	CreateItem *CreateItemRequest `json:"createItem,omitempty"`
	// DeleteItem: Delete an item.
	DeleteItem *DeleteItemRequest `json:"deleteItem,omitempty"`
	// MoveItem: Move an item to a specified location.
	MoveItem *MoveItemRequest `json:"moveItem,omitempty"`
	// UpdateFormInfo: Update Form's Info.
	UpdateFormInfo *UpdateFormInfoRequest `json:"updateFormInfo,omitempty"`
	// UpdateItem: Update an item.
	UpdateItem *UpdateItemRequest `json:"updateItem,omitempty"`
	// UpdateSettings: Updates the Form's settings.
	UpdateSettings *UpdateSettingsRequest `json:"updateSettings,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CreateItem") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateItem") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Request: The kinds of update requests that can be made.

func (Request) MarshalJSON

func (s Request) MarshalJSON() ([]byte, error)

type Response

type Response struct {
	// CreateItem: The result of creating an item.
	CreateItem *CreateItemResponse `json:"createItem,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CreateItem") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateItem") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Response: A single response from an update.

func (Response) MarshalJSON

func (s Response) MarshalJSON() ([]byte, error)

type RowQuestion

type RowQuestion struct {
	// Title: Required. The title for the single row in the QuestionGroupItem.
	Title string `json:"title,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Title") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Title") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (RowQuestion) MarshalJSON

func (s RowQuestion) MarshalJSON() ([]byte, error)

type ScaleQuestion

type ScaleQuestion struct {
	// High: Required. The highest possible value for the scale.
	High int64 `json:"high,omitempty"`
	// HighLabel: The label to display describing the highest point on the scale.
	HighLabel string `json:"highLabel,omitempty"`
	// Low: Required. The lowest possible value for the scale.
	Low int64 `json:"low,omitempty"`
	// LowLabel: The label to display describing the lowest point on the scale.
	LowLabel string `json:"lowLabel,omitempty"`
	// ForceSendFields is a list of field names (e.g. "High") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "High") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

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

func (ScaleQuestion) MarshalJSON

func (s ScaleQuestion) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Forms *FormsService
	// contains filtered or unexported fields
}

func New deprecated

func New(client *http.Client) (*Service, error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

func NewService

func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)

NewService creates a new Service.

type TextAnswer

type TextAnswer struct {
	// Value: Output only. The answer value. Formatting used for different kinds of
	// question: * ChoiceQuestion * `RADIO` or `DROP_DOWN`: A single string
	// corresponding to the option that was selected. * `CHECKBOX`: Multiple
	// strings corresponding to each option that was selected. * TextQuestion: The
	// text that the user entered. * ScaleQuestion: A string containing the number
	// that was selected. * DateQuestion * Without time or year: MM-DD e.g. "05-19"
	// * With year: YYYY-MM-DD e.g. "1986-05-19" * With time: MM-DD HH:MM e.g.
	// "05-19 14:51" * With year and time: YYYY-MM-DD HH:MM e.g. "1986-05-19 14:51"
	// * TimeQuestion: String with time or duration in HH:MM format e.g. "14:51" *
	// RowQuestion within QuestionGroupItem: The answer for each row of a
	// QuestionGroupItem is represented as a separate Answer. Each will contain one
	// string for `RADIO`-type choices or multiple strings for `CHECKBOX` choices.
	Value string `json:"value,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Value") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Value") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TextAnswer: An answer to a question represented as text.

func (TextAnswer) MarshalJSON

func (s TextAnswer) MarshalJSON() ([]byte, error)

type TextAnswers

type TextAnswers struct {
	// Answers: Output only. Answers to a question. For multiple-value
	// ChoiceQuestions, each answer is a separate value.
	Answers []*TextAnswer `json:"answers,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Answers") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Answers") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TextAnswers: A question's answers as text.

func (TextAnswers) MarshalJSON

func (s TextAnswers) MarshalJSON() ([]byte, error)

type TextItem

type TextItem struct {
}

TextItem: A text item.

type TextLink struct {
	// DisplayText: Required. Display text for the URI.
	DisplayText string `json:"displayText,omitempty"`
	// Uri: Required. The URI.
	Uri string `json:"uri,omitempty"`
	// ForceSendFields is a list of field names (e.g. "DisplayText") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DisplayText") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TextLink: Link for text.

func (TextLink) MarshalJSON

func (s TextLink) MarshalJSON() ([]byte, error)

type TextQuestion

type TextQuestion struct {
	// Paragraph: Whether the question is a paragraph question or not. If not, the
	// question is a short text question.
	Paragraph bool `json:"paragraph,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Paragraph") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Paragraph") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TextQuestion: A text-based question.

func (TextQuestion) MarshalJSON

func (s TextQuestion) MarshalJSON() ([]byte, error)

type TimeQuestion

type TimeQuestion struct {
	// Duration: `true` if the question is about an elapsed time. Otherwise it is
	// about a time of day.
	Duration bool `json:"duration,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Duration") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Duration") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

TimeQuestion: A time question.

func (TimeQuestion) MarshalJSON

func (s TimeQuestion) MarshalJSON() ([]byte, error)

type UpdateFormInfoRequest

type UpdateFormInfoRequest struct {
	// Info: The info to update.
	Info *Info `json:"info,omitempty"`
	// UpdateMask: Required. Only values named in this mask are changed. At least
	// one field must be specified. The root `info` is implied and should not be
	// specified. A single "*" can be used as short-hand for updating every
	// field.
	UpdateMask string `json:"updateMask,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Info") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Info") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

UpdateFormInfoRequest: Update Form's Info.

func (UpdateFormInfoRequest) MarshalJSON

func (s UpdateFormInfoRequest) MarshalJSON() ([]byte, error)

type UpdateItemRequest

type UpdateItemRequest struct {
	// Item: Required. New values for the item. Note that item and question IDs are
	// used if they are provided (and are in the field mask). If an ID is blank
	// (and in the field mask) a new ID is generated. This means you can modify an
	// item by getting the form via forms.get, modifying your local copy of that
	// item to be how you want it, and using UpdateItemRequest to write it back,
	// with the IDs being the same (or not in the field mask).
	Item *Item `json:"item,omitempty"`
	// Location: Required. The location identifying the item to update.
	Location *Location `json:"location,omitempty"`
	// UpdateMask: Required. Only values named in this mask are changed.
	UpdateMask string `json:"updateMask,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Item") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Item") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

UpdateItemRequest: Update an item in a form.

func (UpdateItemRequest) MarshalJSON

func (s UpdateItemRequest) MarshalJSON() ([]byte, error)

type UpdateSettingsRequest

type UpdateSettingsRequest struct {
	// Settings: Required. The settings to update with.
	Settings *FormSettings `json:"settings,omitempty"`
	// UpdateMask: Required. Only values named in this mask are changed. At least
	// one field must be specified. The root `settings` is implied and should not
	// be specified. A single "*" can be used as short-hand for updating every
	// field.
	UpdateMask string `json:"updateMask,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Settings") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Settings") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

UpdateSettingsRequest: Update Form's FormSettings.

func (UpdateSettingsRequest) MarshalJSON

func (s UpdateSettingsRequest) MarshalJSON() ([]byte, error)

type Video

type Video struct {
	// Properties: Properties of a video.
	Properties *MediaProperties `json:"properties,omitempty"`
	// YoutubeUri: Required. A YouTube URI.
	YoutubeUri string `json:"youtubeUri,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Properties") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Properties") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Video: Data representing a video.

func (Video) MarshalJSON

func (s Video) MarshalJSON() ([]byte, error)

type VideoItem

type VideoItem struct {
	// Caption: The text displayed below the video.
	Caption string `json:"caption,omitempty"`
	// Video: Required. The video displayed in the item.
	Video *Video `json:"video,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Caption") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Caption") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

VideoItem: An item containing a video.

func (VideoItem) MarshalJSON

func (s VideoItem) MarshalJSON() ([]byte, error)
type VideoLink struct {
	// DisplayText: Required. The display text for the link.
	DisplayText string `json:"displayText,omitempty"`
	// YoutubeUri: The URI of a YouTube video.
	YoutubeUri string `json:"youtubeUri,omitempty"`
	// ForceSendFields is a list of field names (e.g. "DisplayText") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DisplayText") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

VideoLink: Link to a video.

func (VideoLink) MarshalJSON

func (s VideoLink) MarshalJSON() ([]byte, error)

type Watch

type Watch struct {
	// CreateTime: Output only. Timestamp of when this was created.
	CreateTime string `json:"createTime,omitempty"`
	// ErrorType: Output only. The most recent error type for an attempted
	// delivery. To begin watching the form again a call can be made to
	// watches.renew which also clears this error information.
	//
	// Possible values:
	//   "ERROR_TYPE_UNSPECIFIED" - Unspecified error type.
	//   "PROJECT_NOT_AUTHORIZED" - The cloud project does not have access to the
	// form being watched. This occurs if the user has revoked the authorization
	// for your project to access their form(s). Watches with this error will not
	// be retried. To attempt to begin watching the form again a call can be made
	// to watches.renew
	//   "NO_USER_ACCESS" - The user that granted access no longer has access to
	// the form being watched. Watches with this error will not be retried. To
	// attempt to begin watching the form again a call can be made to watches.renew
	//   "OTHER_ERRORS" - Another type of error has occurred. Whether notifications
	// will continue depends on the watch state.
	ErrorType string `json:"errorType,omitempty"`
	// EventType: Required. Which event type to watch for.
	//
	// Possible values:
	//   "EVENT_TYPE_UNSPECIFIED" - Unspecified event type. This value should not
	// be used.
	//   "SCHEMA" - The schema event type. A watch with this event type will be
	// notified about changes to form content and settings.
	//   "RESPONSES" - The responses event type. A watch with this event type will
	// be notified when form responses are submitted.
	EventType string `json:"eventType,omitempty"`
	// ExpireTime: Output only. Timestamp for when this will expire. Each
	// watches.renew call resets this to seven days in the future.
	ExpireTime string `json:"expireTime,omitempty"`
	// Id: Output only. The ID of this watch. See notes on
	// CreateWatchRequest.watch_id.
	Id string `json:"id,omitempty"`
	// State: Output only. The current state of the watch. Additional details about
	// suspended watches can be found by checking the `error_type`.
	//
	// Possible values:
	//   "STATE_UNSPECIFIED" - Unspecified state.
	//   "ACTIVE" - Watch is active.
	//   "SUSPENDED" - The watch is suspended due to an error that may be resolved.
	// The watch will continue to exist until it expires. To attempt to reactivate
	// the watch a call can be made to watches.renew
	State string `json:"state,omitempty"`
	// Target: Required. Where to send the notification.
	Target *WatchTarget `json:"target,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

Watch: 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

func (Watch) MarshalJSON

func (s Watch) MarshalJSON() ([]byte, error)

type WatchTarget

type WatchTarget struct {
	// Topic: A Pub/Sub topic. To receive notifications, the topic must grant
	// publish privileges to the Forms service account
	// `serviceAccount:forms-notifications@system.gserviceaccount.com`. Only the
	// project that owns a topic may create a watch with it. Pub/Sub delivery
	// guarantees should be considered.
	Topic *CloudPubsubTopic `json:"topic,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Topic") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Topic") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

WatchTarget: The target for notification delivery.

func (WatchTarget) MarshalJSON

func (s WatchTarget) MarshalJSON() ([]byte, error)

type WriteControl

type WriteControl struct {
	// RequiredRevisionId: The revision ID of the form that the write request is
	// applied to. If this is not the latest revision of the form, the request is
	// not processed and returns a 400 bad request error.
	RequiredRevisionId string `json:"requiredRevisionId,omitempty"`
	// TargetRevisionId: The target revision ID of the form that the write request
	// is applied to. If changes have occurred after this revision, the changes in
	// this update request are transformed against those changes. This results in a
	// new revision of the form that incorporates both the changes in the request
	// and the intervening changes, with the server resolving conflicting changes.
	// The target revision ID may only be used to write to recent versions of a
	// form. If the target revision is too far behind the latest revision, the
	// request is not processed and returns a 400 (Bad Request Error). The request
	// may be retried after reading the latest version of the form. In most cases a
	// target revision ID remains valid for several minutes after it is read, but
	// for frequently-edited forms this window may be shorter.
	TargetRevisionId string `json:"targetRevisionId,omitempty"`
	// ForceSendFields is a list of field names (e.g. "RequiredRevisionId") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "RequiredRevisionId") to include
	// in API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

WriteControl: Provides control over how write requests are executed.

func (WriteControl) MarshalJSON

func (s WriteControl) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL