1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package forms provides access to the Google Forms API. 8 // 9 // For product documentation, see: https://developers.google.com/forms/api 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/forms/v1" 27 // ... 28 // ctx := context.Background() 29 // formsService, err := forms.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // By default, all available scopes (see "Constants") are used to authenticate. 38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 39 // 40 // formsService, err := forms.NewService(ctx, option.WithScopes(forms.FormsResponsesReadonlyScope)) 41 // 42 // To use an API key for authentication (note: some APIs do not support API 43 // keys), use [google.golang.org/api/option.WithAPIKey]: 44 // 45 // formsService, err := forms.NewService(ctx, option.WithAPIKey("AIza...")) 46 // 47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 48 // flow, use [google.golang.org/api/option.WithTokenSource]: 49 // 50 // config := &oauth2.Config{...} 51 // // ... 52 // token, err := config.Exchange(ctx, ...) 53 // formsService, err := forms.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 54 // 55 // See [google.golang.org/api/option.ClientOption] for details on options. 56 package forms // import "google.golang.org/api/forms/v1" 57 58 import ( 59 "bytes" 60 "context" 61 "encoding/json" 62 "errors" 63 "fmt" 64 "io" 65 "net/http" 66 "net/url" 67 "strconv" 68 "strings" 69 70 googleapi "google.golang.org/api/googleapi" 71 internal "google.golang.org/api/internal" 72 gensupport "google.golang.org/api/internal/gensupport" 73 option "google.golang.org/api/option" 74 internaloption "google.golang.org/api/option/internaloption" 75 htransport "google.golang.org/api/transport/http" 76 ) 77 78 // Always reference these packages, just in case the auto-generated code 79 // below doesn't. 80 var _ = bytes.NewBuffer 81 var _ = strconv.Itoa 82 var _ = fmt.Sprintf 83 var _ = json.NewDecoder 84 var _ = io.Copy 85 var _ = url.Parse 86 var _ = gensupport.MarshalJSON 87 var _ = googleapi.Version 88 var _ = errors.New 89 var _ = strings.Replace 90 var _ = context.Canceled 91 var _ = internaloption.WithDefaultEndpoint 92 var _ = internal.Version 93 94 const apiId = "forms:v1" 95 const apiName = "forms" 96 const apiVersion = "v1" 97 const basePath = "https://forms.googleapis.com/" 98 const basePathTemplate = "https://forms.UNIVERSE_DOMAIN/" 99 const mtlsBasePath = "https://forms.mtls.googleapis.com/" 100 101 // OAuth2 scopes used by this API. 102 const ( 103 // See, edit, create, and delete all of your Google Drive files 104 DriveScope = "https://www.googleapis.com/auth/drive" 105 106 // See, edit, create, and delete only the specific Google Drive files you use 107 // with this app 108 DriveFileScope = "https://www.googleapis.com/auth/drive.file" 109 110 // See and download all your Google Drive files 111 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" 112 113 // See, edit, create, and delete all your Google Forms forms 114 FormsBodyScope = "https://www.googleapis.com/auth/forms.body" 115 116 // See all your Google Forms forms 117 FormsBodyReadonlyScope = "https://www.googleapis.com/auth/forms.body.readonly" 118 119 // See all responses to your Google Forms forms 120 FormsResponsesReadonlyScope = "https://www.googleapis.com/auth/forms.responses.readonly" 121 ) 122 123 // NewService creates a new Service. 124 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 125 scopesOption := internaloption.WithDefaultScopes( 126 "https://www.googleapis.com/auth/drive", 127 "https://www.googleapis.com/auth/drive.file", 128 "https://www.googleapis.com/auth/drive.readonly", 129 "https://www.googleapis.com/auth/forms.body", 130 "https://www.googleapis.com/auth/forms.body.readonly", 131 "https://www.googleapis.com/auth/forms.responses.readonly", 132 ) 133 // NOTE: prepend, so we don't override user-specified scopes. 134 opts = append([]option.ClientOption{scopesOption}, opts...) 135 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 136 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 137 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 138 opts = append(opts, internaloption.EnableNewAuthLibrary()) 139 client, endpoint, err := htransport.NewClient(ctx, opts...) 140 if err != nil { 141 return nil, err 142 } 143 s, err := New(client) 144 if err != nil { 145 return nil, err 146 } 147 if endpoint != "" { 148 s.BasePath = endpoint 149 } 150 return s, nil 151 } 152 153 // New creates a new Service. It uses the provided http.Client for requests. 154 // 155 // Deprecated: please use NewService instead. 156 // To provide a custom HTTP client, use option.WithHTTPClient. 157 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 158 func New(client *http.Client) (*Service, error) { 159 if client == nil { 160 return nil, errors.New("client is nil") 161 } 162 s := &Service{client: client, BasePath: basePath} 163 s.Forms = NewFormsService(s) 164 return s, nil 165 } 166 167 type Service struct { 168 client *http.Client 169 BasePath string // API endpoint base URL 170 UserAgent string // optional additional User-Agent fragment 171 172 Forms *FormsService 173 } 174 175 func (s *Service) userAgent() string { 176 if s.UserAgent == "" { 177 return googleapi.UserAgent 178 } 179 return googleapi.UserAgent + " " + s.UserAgent 180 } 181 182 func NewFormsService(s *Service) *FormsService { 183 rs := &FormsService{s: s} 184 rs.Responses = NewFormsResponsesService(s) 185 rs.Watches = NewFormsWatchesService(s) 186 return rs 187 } 188 189 type FormsService struct { 190 s *Service 191 192 Responses *FormsResponsesService 193 194 Watches *FormsWatchesService 195 } 196 197 func NewFormsResponsesService(s *Service) *FormsResponsesService { 198 rs := &FormsResponsesService{s: s} 199 return rs 200 } 201 202 type FormsResponsesService struct { 203 s *Service 204 } 205 206 func NewFormsWatchesService(s *Service) *FormsWatchesService { 207 rs := &FormsWatchesService{s: s} 208 return rs 209 } 210 211 type FormsWatchesService struct { 212 s *Service 213 } 214 215 // Answer: The submitted answer for a question. 216 type Answer struct { 217 // FileUploadAnswers: Output only. The answers to a file upload question. 218 FileUploadAnswers *FileUploadAnswers `json:"fileUploadAnswers,omitempty"` 219 // Grade: Output only. The grade for the answer if the form was a quiz. 220 Grade *Grade `json:"grade,omitempty"` 221 // QuestionId: Output only. The question's ID. See also Question.question_id. 222 QuestionId string `json:"questionId,omitempty"` 223 // TextAnswers: Output only. The specific answers as text. 224 TextAnswers *TextAnswers `json:"textAnswers,omitempty"` 225 // ForceSendFields is a list of field names (e.g. "FileUploadAnswers") to 226 // unconditionally include in API requests. By default, fields with empty or 227 // default values are omitted from API requests. See 228 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 229 // details. 230 ForceSendFields []string `json:"-"` 231 // NullFields is a list of field names (e.g. "FileUploadAnswers") to include in 232 // API requests with the JSON null value. By default, fields with empty values 233 // are omitted from API requests. See 234 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 235 NullFields []string `json:"-"` 236 } 237 238 func (s *Answer) MarshalJSON() ([]byte, error) { 239 type NoMethod Answer 240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 241 } 242 243 // BatchUpdateFormRequest: A batch of updates to perform on a form. All the 244 // specified updates are made or none of them are. 245 type BatchUpdateFormRequest struct { 246 // IncludeFormInResponse: Whether to return an updated version of the model in 247 // the response. 248 IncludeFormInResponse bool `json:"includeFormInResponse,omitempty"` 249 // Requests: Required. The update requests of this batch. 250 Requests []*Request `json:"requests,omitempty"` 251 // WriteControl: Provides control over how write requests are executed. 252 WriteControl *WriteControl `json:"writeControl,omitempty"` 253 // ForceSendFields is a list of field names (e.g. "IncludeFormInResponse") to 254 // unconditionally include in API requests. By default, fields with empty or 255 // default values are omitted from API requests. See 256 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 257 // details. 258 ForceSendFields []string `json:"-"` 259 // NullFields is a list of field names (e.g. "IncludeFormInResponse") to 260 // include in API requests with the JSON null value. By default, fields with 261 // empty values are omitted from API requests. See 262 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 263 NullFields []string `json:"-"` 264 } 265 266 func (s *BatchUpdateFormRequest) MarshalJSON() ([]byte, error) { 267 type NoMethod BatchUpdateFormRequest 268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 269 } 270 271 // BatchUpdateFormResponse: Response to a BatchUpdateFormRequest. 272 type BatchUpdateFormResponse struct { 273 // Form: Based on the bool request field `include_form_in_response`, a form 274 // with all applied mutations/updates is returned or not. This may be later 275 // than the revision ID created by these changes. 276 Form *Form `json:"form,omitempty"` 277 // Replies: The reply of the updates. This maps 1:1 with the update requests, 278 // although replies to some requests may be empty. 279 Replies []*Response `json:"replies,omitempty"` 280 // WriteControl: The updated write control after applying the request. 281 WriteControl *WriteControl `json:"writeControl,omitempty"` 282 283 // ServerResponse contains the HTTP response code and headers from the server. 284 googleapi.ServerResponse `json:"-"` 285 // ForceSendFields is a list of field names (e.g. "Form") to unconditionally 286 // include in API requests. By default, fields with empty or default values are 287 // omitted from API requests. See 288 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 289 // details. 290 ForceSendFields []string `json:"-"` 291 // NullFields is a list of field names (e.g. "Form") to include in API requests 292 // with the JSON null value. By default, fields with empty values are omitted 293 // from API requests. See 294 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 295 NullFields []string `json:"-"` 296 } 297 298 func (s *BatchUpdateFormResponse) MarshalJSON() ([]byte, error) { 299 type NoMethod BatchUpdateFormResponse 300 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 301 } 302 303 // ChoiceQuestion: A radio/checkbox/dropdown question. 304 type ChoiceQuestion struct { 305 // Options: Required. List of options that a respondent must choose from. 306 Options []*Option `json:"options,omitempty"` 307 // Shuffle: Whether the options should be displayed in random order for 308 // different instances of the quiz. This is often used to prevent cheating by 309 // respondents who might be looking at another respondent's screen, or to 310 // address bias in a survey that might be introduced by always putting the same 311 // options first or last. 312 Shuffle bool `json:"shuffle,omitempty"` 313 // Type: Required. The type of choice question. 314 // 315 // Possible values: 316 // "CHOICE_TYPE_UNSPECIFIED" - Default value. Unused. 317 // "RADIO" - Radio buttons: All choices are shown to the user, who can only 318 // pick one of them. 319 // "CHECKBOX" - Checkboxes: All choices are shown to the user, who can pick 320 // any number of them. 321 // "DROP_DOWN" - Drop-down menu: The choices are only shown to the user on 322 // demand, otherwise only the current choice is shown. Only one option can be 323 // chosen. 324 Type string `json:"type,omitempty"` 325 // ForceSendFields is a list of field names (e.g. "Options") to unconditionally 326 // include in API requests. By default, fields with empty or default values are 327 // omitted from API requests. See 328 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 329 // details. 330 ForceSendFields []string `json:"-"` 331 // NullFields is a list of field names (e.g. "Options") to include in API 332 // requests with the JSON null value. By default, fields with empty values are 333 // omitted from API requests. See 334 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 335 NullFields []string `json:"-"` 336 } 337 338 func (s *ChoiceQuestion) MarshalJSON() ([]byte, error) { 339 type NoMethod ChoiceQuestion 340 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 341 } 342 343 // CloudPubsubTopic: A Pub/Sub topic. 344 type CloudPubsubTopic struct { 345 // TopicName: Required. A fully qualified Pub/Sub topic name to publish the 346 // events to. This topic must be owned by the calling project and already exist 347 // in Pub/Sub. 348 TopicName string `json:"topicName,omitempty"` 349 // ForceSendFields is a list of field names (e.g. "TopicName") to 350 // unconditionally include in API requests. By default, fields with empty or 351 // default values are omitted from API requests. See 352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 353 // details. 354 ForceSendFields []string `json:"-"` 355 // NullFields is a list of field names (e.g. "TopicName") to include in API 356 // requests with the JSON null value. By default, fields with empty values are 357 // omitted from API requests. See 358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 359 NullFields []string `json:"-"` 360 } 361 362 func (s *CloudPubsubTopic) MarshalJSON() ([]byte, error) { 363 type NoMethod CloudPubsubTopic 364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 365 } 366 367 // CorrectAnswer: A single correct answer for a question. For multiple-valued 368 // (`CHECKBOX`) questions, several `CorrectAnswer`s may be needed to represent 369 // a single correct response option. 370 type CorrectAnswer struct { 371 // Value: Required. The correct answer value. See the documentation for 372 // TextAnswer.value for details on how various value types are formatted. 373 Value string `json:"value,omitempty"` 374 // ForceSendFields is a list of field names (e.g. "Value") to unconditionally 375 // include in API requests. By default, fields with empty or default values are 376 // omitted from API requests. See 377 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 378 // details. 379 ForceSendFields []string `json:"-"` 380 // NullFields is a list of field names (e.g. "Value") to include in API 381 // requests with the JSON null value. By default, fields with empty values are 382 // omitted from API requests. See 383 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 384 NullFields []string `json:"-"` 385 } 386 387 func (s *CorrectAnswer) MarshalJSON() ([]byte, error) { 388 type NoMethod CorrectAnswer 389 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 390 } 391 392 // CorrectAnswers: The answer key for a question. 393 type CorrectAnswers struct { 394 // Answers: A list of correct answers. A quiz response can be automatically 395 // graded based on these answers. For single-valued questions, a response is 396 // marked correct if it matches any value in this list (in other words, 397 // multiple correct answers are possible). For multiple-valued (`CHECKBOX`) 398 // questions, a response is marked correct if it contains exactly the values in 399 // this list. 400 Answers []*CorrectAnswer `json:"answers,omitempty"` 401 // ForceSendFields is a list of field names (e.g. "Answers") to unconditionally 402 // include in API requests. By default, fields with empty or default values are 403 // omitted from API requests. See 404 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 405 // details. 406 ForceSendFields []string `json:"-"` 407 // NullFields is a list of field names (e.g. "Answers") to include in API 408 // requests with the JSON null value. By default, fields with empty values are 409 // omitted from API requests. See 410 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 411 NullFields []string `json:"-"` 412 } 413 414 func (s *CorrectAnswers) MarshalJSON() ([]byte, error) { 415 type NoMethod CorrectAnswers 416 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 417 } 418 419 // CreateItemRequest: Create an item in a form. 420 type CreateItemRequest struct { 421 // Item: Required. The item to create. 422 Item *Item `json:"item,omitempty"` 423 // Location: Required. Where to place the new item. 424 Location *Location `json:"location,omitempty"` 425 // ForceSendFields is a list of field names (e.g. "Item") to unconditionally 426 // include in API requests. By default, fields with empty or default values are 427 // omitted from API requests. See 428 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 429 // details. 430 ForceSendFields []string `json:"-"` 431 // NullFields is a list of field names (e.g. "Item") to include in API requests 432 // with the JSON null value. By default, fields with empty values are omitted 433 // from API requests. See 434 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 435 NullFields []string `json:"-"` 436 } 437 438 func (s *CreateItemRequest) MarshalJSON() ([]byte, error) { 439 type NoMethod CreateItemRequest 440 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 441 } 442 443 // CreateItemResponse: The result of creating an item. 444 type CreateItemResponse struct { 445 // ItemId: The ID of the created item. 446 ItemId string `json:"itemId,omitempty"` 447 // QuestionId: The ID of the question created as part of this item, for a 448 // question group it lists IDs of all the questions created for this item. 449 QuestionId []string `json:"questionId,omitempty"` 450 // ForceSendFields is a list of field names (e.g. "ItemId") to unconditionally 451 // include in API requests. By default, fields with empty or default values are 452 // omitted from API requests. See 453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 454 // details. 455 ForceSendFields []string `json:"-"` 456 // NullFields is a list of field names (e.g. "ItemId") to include in API 457 // requests with the JSON null value. By default, fields with empty values are 458 // omitted from API requests. See 459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 460 NullFields []string `json:"-"` 461 } 462 463 func (s *CreateItemResponse) MarshalJSON() ([]byte, error) { 464 type NoMethod CreateItemResponse 465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 466 } 467 468 // CreateWatchRequest: Create a new watch. 469 type CreateWatchRequest struct { 470 // Watch: Required. The watch object. No ID should be set on this object; use 471 // `watch_id` instead. 472 Watch *Watch `json:"watch,omitempty"` 473 // WatchId: The ID to use for the watch. If specified, the ID must not already 474 // be in use. If not specified, an ID is generated. This value should be 4-63 475 // characters, and valid characters are /a-z-/. 476 WatchId string `json:"watchId,omitempty"` 477 // ForceSendFields is a list of field names (e.g. "Watch") to unconditionally 478 // include in API requests. By default, fields with empty or default values are 479 // omitted from API requests. See 480 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 481 // details. 482 ForceSendFields []string `json:"-"` 483 // NullFields is a list of field names (e.g. "Watch") to include in API 484 // requests with the JSON null value. By default, fields with empty values are 485 // omitted from API requests. See 486 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 487 NullFields []string `json:"-"` 488 } 489 490 func (s *CreateWatchRequest) MarshalJSON() ([]byte, error) { 491 type NoMethod CreateWatchRequest 492 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 493 } 494 495 // DateQuestion: A date question. Date questions default to just month + day. 496 type DateQuestion struct { 497 // IncludeTime: Whether to include the time as part of the question. 498 IncludeTime bool `json:"includeTime,omitempty"` 499 // IncludeYear: Whether to include the year as part of the question. 500 IncludeYear bool `json:"includeYear,omitempty"` 501 // ForceSendFields is a list of field names (e.g. "IncludeTime") to 502 // unconditionally include in API requests. By default, fields with empty or 503 // default values are omitted from API requests. See 504 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 505 // details. 506 ForceSendFields []string `json:"-"` 507 // NullFields is a list of field names (e.g. "IncludeTime") to include in API 508 // requests with the JSON null value. By default, fields with empty values are 509 // omitted from API requests. See 510 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 511 NullFields []string `json:"-"` 512 } 513 514 func (s *DateQuestion) MarshalJSON() ([]byte, error) { 515 type NoMethod DateQuestion 516 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 517 } 518 519 // DeleteItemRequest: Delete an item in a form. 520 type DeleteItemRequest struct { 521 // Location: Required. The location of the item to delete. 522 Location *Location `json:"location,omitempty"` 523 // ForceSendFields is a list of field names (e.g. "Location") to 524 // unconditionally include in API requests. By default, fields with empty or 525 // default values are omitted from API requests. See 526 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 527 // details. 528 ForceSendFields []string `json:"-"` 529 // NullFields is a list of field names (e.g. "Location") to include in API 530 // requests with the JSON null value. By default, fields with empty values are 531 // omitted from API requests. See 532 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 533 NullFields []string `json:"-"` 534 } 535 536 func (s *DeleteItemRequest) MarshalJSON() ([]byte, error) { 537 type NoMethod DeleteItemRequest 538 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 539 } 540 541 // Empty: A generic empty message that you can re-use to avoid defining 542 // duplicated empty messages in your APIs. A typical example is to use it as 543 // the request or the response type of an API method. For instance: service Foo 544 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 545 type Empty struct { 546 // ServerResponse contains the HTTP response code and headers from the server. 547 googleapi.ServerResponse `json:"-"` 548 } 549 550 // ExtraMaterial: Supplementary material to the feedback. 551 type ExtraMaterial struct { 552 // Link: Text feedback. 553 Link *TextLink `json:"link,omitempty"` 554 // Video: Video feedback. 555 Video *VideoLink `json:"video,omitempty"` 556 // ForceSendFields is a list of field names (e.g. "Link") to unconditionally 557 // include in API requests. By default, fields with empty or default values are 558 // omitted from API requests. See 559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 560 // details. 561 ForceSendFields []string `json:"-"` 562 // NullFields is a list of field names (e.g. "Link") to include in API requests 563 // with the JSON null value. By default, fields with empty values are omitted 564 // from API requests. See 565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 566 NullFields []string `json:"-"` 567 } 568 569 func (s *ExtraMaterial) MarshalJSON() ([]byte, error) { 570 type NoMethod ExtraMaterial 571 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 572 } 573 574 // Feedback: Feedback for a respondent about their response to a question. 575 type Feedback struct { 576 // Material: Additional information provided as part of the feedback, often 577 // used to point the respondent to more reading and resources. 578 Material []*ExtraMaterial `json:"material,omitempty"` 579 // Text: Required. The main text of the feedback. 580 Text string `json:"text,omitempty"` 581 // ForceSendFields is a list of field names (e.g. "Material") to 582 // unconditionally include in API requests. By default, fields with empty or 583 // default values are omitted from API requests. See 584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 585 // details. 586 ForceSendFields []string `json:"-"` 587 // NullFields is a list of field names (e.g. "Material") to include in API 588 // requests with the JSON null value. By default, fields with empty values are 589 // omitted from API requests. See 590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 591 NullFields []string `json:"-"` 592 } 593 594 func (s *Feedback) MarshalJSON() ([]byte, error) { 595 type NoMethod Feedback 596 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 597 } 598 599 // FileUploadAnswer: Info for a single file submitted to a file upload 600 // question. 601 type FileUploadAnswer struct { 602 // FileId: Output only. The ID of the Google Drive file. 603 FileId string `json:"fileId,omitempty"` 604 // FileName: Output only. The file name, as stored in Google Drive on upload. 605 FileName string `json:"fileName,omitempty"` 606 // MimeType: Output only. The MIME type of the file, as stored in Google Drive 607 // on upload. 608 MimeType string `json:"mimeType,omitempty"` 609 // ForceSendFields is a list of field names (e.g. "FileId") to unconditionally 610 // include in API requests. By default, fields with empty or default values are 611 // omitted from API requests. See 612 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 613 // details. 614 ForceSendFields []string `json:"-"` 615 // NullFields is a list of field names (e.g. "FileId") to include in API 616 // requests with the JSON null value. By default, fields with empty values are 617 // omitted from API requests. See 618 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 619 NullFields []string `json:"-"` 620 } 621 622 func (s *FileUploadAnswer) MarshalJSON() ([]byte, error) { 623 type NoMethod FileUploadAnswer 624 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 625 } 626 627 // FileUploadAnswers: All submitted files for a FileUpload question. 628 type FileUploadAnswers struct { 629 // Answers: Output only. All submitted files for a FileUpload question. 630 Answers []*FileUploadAnswer `json:"answers,omitempty"` 631 // ForceSendFields is a list of field names (e.g. "Answers") to unconditionally 632 // include in API requests. By default, fields with empty or default values are 633 // omitted from API requests. See 634 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 635 // details. 636 ForceSendFields []string `json:"-"` 637 // NullFields is a list of field names (e.g. "Answers") to include in API 638 // requests with the JSON null value. By default, fields with empty values are 639 // omitted from API requests. See 640 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 641 NullFields []string `json:"-"` 642 } 643 644 func (s *FileUploadAnswers) MarshalJSON() ([]byte, error) { 645 type NoMethod FileUploadAnswers 646 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 647 } 648 649 // FileUploadQuestion: A file upload question. The API currently does not 650 // support creating file upload questions. 651 type FileUploadQuestion struct { 652 // FolderId: Required. The ID of the Drive folder where uploaded files are 653 // stored. 654 FolderId string `json:"folderId,omitempty"` 655 // MaxFileSize: Maximum number of bytes allowed for any single file uploaded to 656 // this question. 657 MaxFileSize int64 `json:"maxFileSize,omitempty,string"` 658 // MaxFiles: Maximum number of files that can be uploaded for this question in 659 // a single response. 660 MaxFiles int64 `json:"maxFiles,omitempty"` 661 // Types: File types accepted by this question. 662 // 663 // Possible values: 664 // "FILE_TYPE_UNSPECIFIED" - Default value. Unused. 665 // "ANY" - No restrictions on type. 666 // "DOCUMENT" - A Google Docs document. 667 // "PRESENTATION" - A Google Slides presentation. 668 // "SPREADSHEET" - A Google Sheets spreadsheet. 669 // "DRAWING" - A drawing. 670 // "PDF" - A PDF. 671 // "IMAGE" - An image. 672 // "VIDEO" - A video. 673 // "AUDIO" - An audio file. 674 Types []string `json:"types,omitempty"` 675 // ForceSendFields is a list of field names (e.g. "FolderId") to 676 // unconditionally include in API requests. By default, fields with empty or 677 // default values are omitted from API requests. See 678 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 679 // details. 680 ForceSendFields []string `json:"-"` 681 // NullFields is a list of field names (e.g. "FolderId") to include in API 682 // requests with the JSON null value. By default, fields with empty values are 683 // omitted from API requests. See 684 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 685 NullFields []string `json:"-"` 686 } 687 688 func (s *FileUploadQuestion) MarshalJSON() ([]byte, error) { 689 type NoMethod FileUploadQuestion 690 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 691 } 692 693 // Form: A Google Forms document. A form is created in Drive, and deleting a 694 // form or changing its access protections is done via the Drive API 695 // (https://developers.google.com/drive/api/v3/about-sdk). 696 type Form struct { 697 // FormId: Output only. The form ID. 698 FormId string `json:"formId,omitempty"` 699 // Info: Required. The title and description of the form. 700 Info *Info `json:"info,omitempty"` 701 // Items: Required. A list of the form's items, which can include section 702 // headers, questions, embedded media, etc. 703 Items []*Item `json:"items,omitempty"` 704 // LinkedSheetId: Output only. The ID of the linked Google Sheet which is 705 // accumulating responses from this Form (if such a Sheet exists). 706 LinkedSheetId string `json:"linkedSheetId,omitempty"` 707 // ResponderUri: Output only. The form URI to share with responders. This opens 708 // a page that allows the user to submit responses but not edit the questions. 709 ResponderUri string `json:"responderUri,omitempty"` 710 // RevisionId: Output only. The revision ID of the form. Used in the 711 // WriteControl in update requests to identify the revision on which the 712 // changes are based. The format of the revision ID may change over time, so it 713 // should be treated opaquely. A returned revision ID is only guaranteed to be 714 // valid for 24 hours after it has been returned and cannot be shared across 715 // users. If the revision ID is unchanged between calls, then the form has not 716 // changed. Conversely, a changed ID (for the same form and user) usually means 717 // the form has been updated; however, a changed ID can also be due to internal 718 // factors such as ID format changes. 719 RevisionId string `json:"revisionId,omitempty"` 720 // Settings: The form's settings. This must be updated with 721 // UpdateSettingsRequest; it is ignored during `forms.create` and 722 // UpdateFormInfoRequest. 723 Settings *FormSettings `json:"settings,omitempty"` 724 725 // ServerResponse contains the HTTP response code and headers from the server. 726 googleapi.ServerResponse `json:"-"` 727 // ForceSendFields is a list of field names (e.g. "FormId") to unconditionally 728 // include in API requests. By default, fields with empty or default values are 729 // omitted from API requests. See 730 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 731 // details. 732 ForceSendFields []string `json:"-"` 733 // NullFields is a list of field names (e.g. "FormId") to include in API 734 // requests with the JSON null value. By default, fields with empty values are 735 // omitted from API requests. See 736 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 737 NullFields []string `json:"-"` 738 } 739 740 func (s *Form) MarshalJSON() ([]byte, error) { 741 type NoMethod Form 742 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 743 } 744 745 // FormResponse: A form response. 746 type FormResponse struct { 747 // Answers: Output only. The actual answers to the questions, keyed by 748 // question_id. 749 Answers map[string]Answer `json:"answers,omitempty"` 750 // CreateTime: Output only. Timestamp for the first time the response was 751 // submitted. 752 CreateTime string `json:"createTime,omitempty"` 753 // FormId: Output only. The form ID. 754 FormId string `json:"formId,omitempty"` 755 // LastSubmittedTime: Output only. Timestamp for the most recent time the 756 // response was submitted. Does not track changes to grades. 757 LastSubmittedTime string `json:"lastSubmittedTime,omitempty"` 758 // RespondentEmail: Output only. The email address (if collected) for the 759 // respondent. 760 RespondentEmail string `json:"respondentEmail,omitempty"` 761 // ResponseId: Output only. The response ID. 762 ResponseId string `json:"responseId,omitempty"` 763 // TotalScore: Output only. The total number of points the respondent received 764 // for their submission Only set if the form was a quiz and the response was 765 // graded. This includes points automatically awarded via autograding adjusted 766 // by any manual corrections entered by the form owner. 767 TotalScore float64 `json:"totalScore,omitempty"` 768 769 // ServerResponse contains the HTTP response code and headers from the server. 770 googleapi.ServerResponse `json:"-"` 771 // ForceSendFields is a list of field names (e.g. "Answers") to unconditionally 772 // include in API requests. By default, fields with empty or default values are 773 // omitted from API requests. See 774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 775 // details. 776 ForceSendFields []string `json:"-"` 777 // NullFields is a list of field names (e.g. "Answers") to include in API 778 // requests with the JSON null value. By default, fields with empty values are 779 // omitted from API requests. See 780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 781 NullFields []string `json:"-"` 782 } 783 784 func (s *FormResponse) MarshalJSON() ([]byte, error) { 785 type NoMethod FormResponse 786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 787 } 788 789 func (s *FormResponse) UnmarshalJSON(data []byte) error { 790 type NoMethod FormResponse 791 var s1 struct { 792 TotalScore gensupport.JSONFloat64 `json:"totalScore"` 793 *NoMethod 794 } 795 s1.NoMethod = (*NoMethod)(s) 796 if err := json.Unmarshal(data, &s1); err != nil { 797 return err 798 } 799 s.TotalScore = float64(s1.TotalScore) 800 return nil 801 } 802 803 // FormSettings: A form's settings. 804 type FormSettings struct { 805 // QuizSettings: Settings related to quiz forms and grading. 806 QuizSettings *QuizSettings `json:"quizSettings,omitempty"` 807 // ForceSendFields is a list of field names (e.g. "QuizSettings") to 808 // unconditionally include in API requests. By default, fields with empty or 809 // default values are omitted from API requests. See 810 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 811 // details. 812 ForceSendFields []string `json:"-"` 813 // NullFields is a list of field names (e.g. "QuizSettings") to include in API 814 // requests with the JSON null value. By default, fields with empty values are 815 // omitted from API requests. See 816 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 817 NullFields []string `json:"-"` 818 } 819 820 func (s *FormSettings) MarshalJSON() ([]byte, error) { 821 type NoMethod FormSettings 822 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 823 } 824 825 // Grade: Grade information associated with a respondent's answer to a 826 // question. 827 type Grade struct { 828 // Correct: Output only. Whether the question was answered correctly or not. A 829 // zero-point score is not enough to infer incorrectness, since a correctly 830 // answered question could be worth zero points. 831 Correct bool `json:"correct,omitempty"` 832 // Feedback: Output only. Additional feedback given for an answer. 833 Feedback *Feedback `json:"feedback,omitempty"` 834 // Score: Output only. The numeric score awarded for the answer. 835 Score float64 `json:"score,omitempty"` 836 // ForceSendFields is a list of field names (e.g. "Correct") to unconditionally 837 // include in API requests. By default, fields with empty or default values are 838 // omitted from API requests. See 839 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 840 // details. 841 ForceSendFields []string `json:"-"` 842 // NullFields is a list of field names (e.g. "Correct") to include in API 843 // requests with the JSON null value. By default, fields with empty values are 844 // omitted from API requests. See 845 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 846 NullFields []string `json:"-"` 847 } 848 849 func (s *Grade) MarshalJSON() ([]byte, error) { 850 type NoMethod Grade 851 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 852 } 853 854 func (s *Grade) UnmarshalJSON(data []byte) error { 855 type NoMethod Grade 856 var s1 struct { 857 Score gensupport.JSONFloat64 `json:"score"` 858 *NoMethod 859 } 860 s1.NoMethod = (*NoMethod)(s) 861 if err := json.Unmarshal(data, &s1); err != nil { 862 return err 863 } 864 s.Score = float64(s1.Score) 865 return nil 866 } 867 868 // Grading: Grading for a single question 869 type Grading struct { 870 // CorrectAnswers: Required. The answer key for the question. Responses are 871 // automatically graded based on this field. 872 CorrectAnswers *CorrectAnswers `json:"correctAnswers,omitempty"` 873 // GeneralFeedback: The feedback displayed for all answers. This is commonly 874 // used for short answer questions when a quiz owner wants to quickly give 875 // respondents some sense of whether they answered the question correctly 876 // before they've had a chance to officially grade the response. General 877 // feedback cannot be set for automatically graded multiple choice questions. 878 GeneralFeedback *Feedback `json:"generalFeedback,omitempty"` 879 // PointValue: Required. The maximum number of points a respondent can 880 // automatically get for a correct answer. This must not be negative. 881 PointValue int64 `json:"pointValue,omitempty"` 882 // WhenRight: The feedback displayed for correct responses. This feedback can 883 // only be set for multiple choice questions that have correct answers 884 // provided. 885 WhenRight *Feedback `json:"whenRight,omitempty"` 886 // WhenWrong: The feedback displayed for incorrect responses. This feedback can 887 // only be set for multiple choice questions that have correct answers 888 // provided. 889 WhenWrong *Feedback `json:"whenWrong,omitempty"` 890 // ForceSendFields is a list of field names (e.g. "CorrectAnswers") to 891 // unconditionally include in API requests. By default, fields with empty or 892 // default values are omitted from API requests. See 893 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 894 // details. 895 ForceSendFields []string `json:"-"` 896 // NullFields is a list of field names (e.g. "CorrectAnswers") to include in 897 // API requests with the JSON null value. By default, fields with empty values 898 // are omitted from API requests. See 899 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 900 NullFields []string `json:"-"` 901 } 902 903 func (s *Grading) MarshalJSON() ([]byte, error) { 904 type NoMethod Grading 905 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 906 } 907 908 // Grid: A grid of choices (radio or check boxes) with each row constituting a 909 // separate question. Each row has the same choices, which are shown as the 910 // columns. 911 type Grid struct { 912 // Columns: Required. The choices shared by each question in the grid. In other 913 // words, the values of the columns. Only `CHECK_BOX` and `RADIO` choices are 914 // allowed. 915 Columns *ChoiceQuestion `json:"columns,omitempty"` 916 // ShuffleQuestions: If `true`, the questions are randomly ordered. In other 917 // words, the rows appear in a different order for every respondent. 918 ShuffleQuestions bool `json:"shuffleQuestions,omitempty"` 919 // ForceSendFields is a list of field names (e.g. "Columns") to unconditionally 920 // include in API requests. By default, fields with empty or default values are 921 // omitted from API requests. See 922 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 923 // details. 924 ForceSendFields []string `json:"-"` 925 // NullFields is a list of field names (e.g. "Columns") to include in API 926 // requests with the JSON null value. By default, fields with empty values are 927 // omitted from API requests. See 928 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 929 NullFields []string `json:"-"` 930 } 931 932 func (s *Grid) MarshalJSON() ([]byte, error) { 933 type NoMethod Grid 934 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 935 } 936 937 // Image: Data representing an image. 938 type Image struct { 939 // AltText: A description of the image that is shown on hover and read by 940 // screenreaders. 941 AltText string `json:"altText,omitempty"` 942 // ContentUri: Output only. A URI from which you can download the image; this 943 // is valid only for a limited time. 944 ContentUri string `json:"contentUri,omitempty"` 945 // Properties: Properties of an image. 946 Properties *MediaProperties `json:"properties,omitempty"` 947 // SourceUri: Input only. The source URI is the URI used to insert the image. 948 // The source URI can be empty when fetched. 949 SourceUri string `json:"sourceUri,omitempty"` 950 // ForceSendFields is a list of field names (e.g. "AltText") to unconditionally 951 // include in API requests. By default, fields with empty or default values are 952 // omitted from API requests. See 953 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 954 // details. 955 ForceSendFields []string `json:"-"` 956 // NullFields is a list of field names (e.g. "AltText") to include in API 957 // requests with the JSON null value. By default, fields with empty values are 958 // omitted from API requests. See 959 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 960 NullFields []string `json:"-"` 961 } 962 963 func (s *Image) MarshalJSON() ([]byte, error) { 964 type NoMethod Image 965 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 966 } 967 968 // ImageItem: An item containing an image. 969 type ImageItem struct { 970 // Image: Required. The image displayed in the item. 971 Image *Image `json:"image,omitempty"` 972 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 973 // include in API requests. By default, fields with empty or default values are 974 // omitted from API requests. See 975 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 976 // details. 977 ForceSendFields []string `json:"-"` 978 // NullFields is a list of field names (e.g. "Image") to include in API 979 // requests with the JSON null value. By default, fields with empty values are 980 // omitted from API requests. See 981 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 982 NullFields []string `json:"-"` 983 } 984 985 func (s *ImageItem) MarshalJSON() ([]byte, error) { 986 type NoMethod ImageItem 987 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 988 } 989 990 // Info: The general information for a form. 991 type Info struct { 992 // Description: The description of the form. 993 Description string `json:"description,omitempty"` 994 // DocumentTitle: Output only. The title of the document which is visible in 995 // Drive. If `Info.title` is empty, `document_title` may appear in its place in 996 // the Google Forms UI and be visible to responders. `document_title` can be 997 // set on create, but cannot be modified by a batchUpdate request. Please use 998 // the Google Drive API 999 // (https://developers.google.com/drive/api/v3/reference/files/update) if you 1000 // need to programmatically update `document_title`. 1001 DocumentTitle string `json:"documentTitle,omitempty"` 1002 // Title: Required. The title of the form which is visible to responders. 1003 Title string `json:"title,omitempty"` 1004 // ForceSendFields is a list of field names (e.g. "Description") to 1005 // unconditionally include in API requests. By default, fields with empty or 1006 // default values are omitted from API requests. See 1007 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1008 // details. 1009 ForceSendFields []string `json:"-"` 1010 // NullFields is a list of field names (e.g. "Description") to include in API 1011 // requests with the JSON null value. By default, fields with empty values are 1012 // omitted from API requests. See 1013 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1014 NullFields []string `json:"-"` 1015 } 1016 1017 func (s *Info) MarshalJSON() ([]byte, error) { 1018 type NoMethod Info 1019 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1020 } 1021 1022 // Item: A single item of the form. `kind` defines which kind of item it is. 1023 type Item struct { 1024 // Description: The description of the item. 1025 Description string `json:"description,omitempty"` 1026 // ImageItem: Displays an image on the page. 1027 ImageItem *ImageItem `json:"imageItem,omitempty"` 1028 // ItemId: The item ID. On creation, it can be provided but the ID must not be 1029 // already used in the form. If not provided, a new ID is assigned. 1030 ItemId string `json:"itemId,omitempty"` 1031 // PageBreakItem: Starts a new page with a title. 1032 PageBreakItem *PageBreakItem `json:"pageBreakItem,omitempty"` 1033 // QuestionGroupItem: Poses one or more questions to the user with a single 1034 // major prompt. 1035 QuestionGroupItem *QuestionGroupItem `json:"questionGroupItem,omitempty"` 1036 // QuestionItem: Poses a question to the user. 1037 QuestionItem *QuestionItem `json:"questionItem,omitempty"` 1038 // TextItem: Displays a title and description on the page. 1039 TextItem *TextItem `json:"textItem,omitempty"` 1040 // Title: The title of the item. 1041 Title string `json:"title,omitempty"` 1042 // VideoItem: Displays a video on the page. 1043 VideoItem *VideoItem `json:"videoItem,omitempty"` 1044 // ForceSendFields is a list of field names (e.g. "Description") to 1045 // unconditionally include in API requests. By default, fields with empty or 1046 // default values are omitted from API requests. See 1047 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1048 // details. 1049 ForceSendFields []string `json:"-"` 1050 // NullFields is a list of field names (e.g. "Description") to include in API 1051 // requests with the JSON null value. By default, fields with empty values are 1052 // omitted from API requests. See 1053 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1054 NullFields []string `json:"-"` 1055 } 1056 1057 func (s *Item) MarshalJSON() ([]byte, error) { 1058 type NoMethod Item 1059 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1060 } 1061 1062 // ListFormResponsesResponse: Response to a ListFormResponsesRequest. 1063 type ListFormResponsesResponse struct { 1064 // NextPageToken: If set, there are more responses. To get the next page of 1065 // responses, provide this as `page_token` in a future request. 1066 NextPageToken string `json:"nextPageToken,omitempty"` 1067 // Responses: The returned form responses. Note: The `formId` field is not 1068 // returned in the `FormResponse` object for list requests. 1069 Responses []*FormResponse `json:"responses,omitempty"` 1070 1071 // ServerResponse contains the HTTP response code and headers from the server. 1072 googleapi.ServerResponse `json:"-"` 1073 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1074 // unconditionally include in API requests. By default, fields with empty or 1075 // default values are omitted from API requests. See 1076 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1077 // details. 1078 ForceSendFields []string `json:"-"` 1079 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 1080 // requests with the JSON null value. By default, fields with empty values are 1081 // omitted from API requests. See 1082 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1083 NullFields []string `json:"-"` 1084 } 1085 1086 func (s *ListFormResponsesResponse) MarshalJSON() ([]byte, error) { 1087 type NoMethod ListFormResponsesResponse 1088 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1089 } 1090 1091 // ListWatchesResponse: The response of a ListWatchesRequest. 1092 type ListWatchesResponse struct { 1093 // Watches: The returned watches. 1094 Watches []*Watch `json:"watches,omitempty"` 1095 1096 // ServerResponse contains the HTTP response code and headers from the server. 1097 googleapi.ServerResponse `json:"-"` 1098 // ForceSendFields is a list of field names (e.g. "Watches") to unconditionally 1099 // include in API requests. By default, fields with empty or default values are 1100 // omitted from API requests. See 1101 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1102 // details. 1103 ForceSendFields []string `json:"-"` 1104 // NullFields is a list of field names (e.g. "Watches") to include in API 1105 // requests with the JSON null value. By default, fields with empty values are 1106 // omitted from API requests. See 1107 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1108 NullFields []string `json:"-"` 1109 } 1110 1111 func (s *ListWatchesResponse) MarshalJSON() ([]byte, error) { 1112 type NoMethod ListWatchesResponse 1113 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1114 } 1115 1116 // Location: A specific location in a form. 1117 type Location struct { 1118 // Index: The index of an item in the form. This must be in the range [0..*N*), 1119 // where *N* is the number of items in the form. 1120 Index int64 `json:"index,omitempty"` 1121 // ForceSendFields is a list of field names (e.g. "Index") to unconditionally 1122 // include in API requests. By default, fields with empty or default values are 1123 // omitted from API requests. See 1124 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1125 // details. 1126 ForceSendFields []string `json:"-"` 1127 // NullFields is a list of field names (e.g. "Index") to include in API 1128 // requests with the JSON null value. By default, fields with empty values are 1129 // omitted from API requests. See 1130 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1131 NullFields []string `json:"-"` 1132 } 1133 1134 func (s *Location) MarshalJSON() ([]byte, error) { 1135 type NoMethod Location 1136 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1137 } 1138 1139 // MediaProperties: Properties of the media. 1140 type MediaProperties struct { 1141 // Alignment: Position of the media. 1142 // 1143 // Possible values: 1144 // "ALIGNMENT_UNSPECIFIED" - Default value. Unused. 1145 // "LEFT" - Left align. 1146 // "RIGHT" - Right align. 1147 // "CENTER" - Center. 1148 Alignment string `json:"alignment,omitempty"` 1149 // Width: The width of the media in pixels. When the media is displayed, it is 1150 // scaled to the smaller of this value or the width of the displayed form. The 1151 // original aspect ratio of the media is preserved. If a width is not specified 1152 // when the media is added to the form, it is set to the width of the media 1153 // source. Width must be between 0 and 740, inclusive. Setting width to 0 or 1154 // unspecified is only permitted when updating the media source. 1155 Width int64 `json:"width,omitempty"` 1156 // ForceSendFields is a list of field names (e.g. "Alignment") to 1157 // unconditionally include in API requests. By default, fields with empty or 1158 // default values are omitted from API requests. See 1159 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1160 // details. 1161 ForceSendFields []string `json:"-"` 1162 // NullFields is a list of field names (e.g. "Alignment") to include in API 1163 // requests with the JSON null value. By default, fields with empty values are 1164 // omitted from API requests. See 1165 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1166 NullFields []string `json:"-"` 1167 } 1168 1169 func (s *MediaProperties) MarshalJSON() ([]byte, error) { 1170 type NoMethod MediaProperties 1171 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1172 } 1173 1174 // MoveItemRequest: Move an item in a form. 1175 type MoveItemRequest struct { 1176 // NewLocation: Required. The new location for the item. 1177 NewLocation *Location `json:"newLocation,omitempty"` 1178 // OriginalLocation: Required. The location of the item to move. 1179 OriginalLocation *Location `json:"originalLocation,omitempty"` 1180 // ForceSendFields is a list of field names (e.g. "NewLocation") to 1181 // unconditionally include in API requests. By default, fields with empty or 1182 // default values are omitted from API requests. See 1183 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1184 // details. 1185 ForceSendFields []string `json:"-"` 1186 // NullFields is a list of field names (e.g. "NewLocation") to include in API 1187 // requests with the JSON null value. By default, fields with empty values are 1188 // omitted from API requests. See 1189 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1190 NullFields []string `json:"-"` 1191 } 1192 1193 func (s *MoveItemRequest) MarshalJSON() ([]byte, error) { 1194 type NoMethod MoveItemRequest 1195 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1196 } 1197 1198 // Option: An option for a Choice question. 1199 type Option struct { 1200 // GoToAction: Section navigation type. 1201 // 1202 // Possible values: 1203 // "GO_TO_ACTION_UNSPECIFIED" - Default value. Unused. 1204 // "NEXT_SECTION" - Go to the next section. 1205 // "RESTART_FORM" - Go back to the beginning of the form. 1206 // "SUBMIT_FORM" - Submit form immediately. 1207 GoToAction string `json:"goToAction,omitempty"` 1208 // GoToSectionId: Item ID of section header to go to. 1209 GoToSectionId string `json:"goToSectionId,omitempty"` 1210 // Image: Display image as an option. 1211 Image *Image `json:"image,omitempty"` 1212 // IsOther: Whether the option is "other". Currently only applies to `RADIO` 1213 // and `CHECKBOX` choice types, but is not allowed in a QuestionGroupItem. 1214 IsOther bool `json:"isOther,omitempty"` 1215 // Value: Required. The choice as presented to the user. 1216 Value string `json:"value,omitempty"` 1217 // ForceSendFields is a list of field names (e.g. "GoToAction") to 1218 // unconditionally include in API requests. By default, fields with empty or 1219 // default values are omitted from API requests. See 1220 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1221 // details. 1222 ForceSendFields []string `json:"-"` 1223 // NullFields is a list of field names (e.g. "GoToAction") to include in API 1224 // requests with the JSON null value. By default, fields with empty values are 1225 // omitted from API requests. See 1226 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1227 NullFields []string `json:"-"` 1228 } 1229 1230 func (s *Option) MarshalJSON() ([]byte, error) { 1231 type NoMethod Option 1232 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1233 } 1234 1235 // PageBreakItem: A page break. The title and description of this item are 1236 // shown at the top of the new page. 1237 type PageBreakItem struct { 1238 } 1239 1240 // Question: Any question. The specific type of question is known by its 1241 // `kind`. 1242 type Question struct { 1243 // ChoiceQuestion: A respondent can choose from a pre-defined set of options. 1244 ChoiceQuestion *ChoiceQuestion `json:"choiceQuestion,omitempty"` 1245 // DateQuestion: A respondent can enter a date. 1246 DateQuestion *DateQuestion `json:"dateQuestion,omitempty"` 1247 // FileUploadQuestion: A respondent can upload one or more files. 1248 FileUploadQuestion *FileUploadQuestion `json:"fileUploadQuestion,omitempty"` 1249 // Grading: Grading setup for the question. 1250 Grading *Grading `json:"grading,omitempty"` 1251 // QuestionId: Read only. The question ID. On creation, it can be provided but 1252 // the ID must not be already used in the form. If not provided, a new ID is 1253 // assigned. 1254 QuestionId string `json:"questionId,omitempty"` 1255 // Required: Whether the question must be answered in order for a respondent to 1256 // submit their response. 1257 Required bool `json:"required,omitempty"` 1258 // RowQuestion: A row of a QuestionGroupItem. 1259 RowQuestion *RowQuestion `json:"rowQuestion,omitempty"` 1260 // ScaleQuestion: A respondent can choose a number from a range. 1261 ScaleQuestion *ScaleQuestion `json:"scaleQuestion,omitempty"` 1262 // TextQuestion: A respondent can enter a free text response. 1263 TextQuestion *TextQuestion `json:"textQuestion,omitempty"` 1264 // TimeQuestion: A respondent can enter a time. 1265 TimeQuestion *TimeQuestion `json:"timeQuestion,omitempty"` 1266 // ForceSendFields is a list of field names (e.g. "ChoiceQuestion") to 1267 // unconditionally include in API requests. By default, fields with empty or 1268 // default values are omitted from API requests. See 1269 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1270 // details. 1271 ForceSendFields []string `json:"-"` 1272 // NullFields is a list of field names (e.g. "ChoiceQuestion") to include in 1273 // API requests with the JSON null value. By default, fields with empty values 1274 // are omitted from API requests. See 1275 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1276 NullFields []string `json:"-"` 1277 } 1278 1279 func (s *Question) MarshalJSON() ([]byte, error) { 1280 type NoMethod Question 1281 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1282 } 1283 1284 // QuestionGroupItem: Defines a question that comprises multiple questions 1285 // grouped together. 1286 type QuestionGroupItem struct { 1287 // Grid: The question group is a grid with rows of multiple choice questions 1288 // that share the same options. When `grid` is set, all questions in the group 1289 // must be of kind `row`. 1290 Grid *Grid `json:"grid,omitempty"` 1291 // Image: The image displayed within the question group above the specific 1292 // questions. 1293 Image *Image `json:"image,omitempty"` 1294 // Questions: Required. A list of questions that belong in this question group. 1295 // A question must only belong to one group. The `kind` of the group may affect 1296 // what types of questions are allowed. 1297 Questions []*Question `json:"questions,omitempty"` 1298 // ForceSendFields is a list of field names (e.g. "Grid") to unconditionally 1299 // include in API requests. By default, fields with empty or default values are 1300 // omitted from API requests. See 1301 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1302 // details. 1303 ForceSendFields []string `json:"-"` 1304 // NullFields is a list of field names (e.g. "Grid") to include in API requests 1305 // with the JSON null value. By default, fields with empty values are omitted 1306 // from API requests. See 1307 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1308 NullFields []string `json:"-"` 1309 } 1310 1311 func (s *QuestionGroupItem) MarshalJSON() ([]byte, error) { 1312 type NoMethod QuestionGroupItem 1313 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1314 } 1315 1316 // QuestionItem: A form item containing a single question. 1317 type QuestionItem struct { 1318 // Image: The image displayed within the question. 1319 Image *Image `json:"image,omitempty"` 1320 // Question: Required. The displayed question. 1321 Question *Question `json:"question,omitempty"` 1322 // ForceSendFields is a list of field names (e.g. "Image") to unconditionally 1323 // include in API requests. By default, fields with empty or default values are 1324 // omitted from API requests. See 1325 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1326 // details. 1327 ForceSendFields []string `json:"-"` 1328 // NullFields is a list of field names (e.g. "Image") to include in API 1329 // requests with the JSON null value. By default, fields with empty values are 1330 // omitted from API requests. See 1331 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1332 NullFields []string `json:"-"` 1333 } 1334 1335 func (s *QuestionItem) MarshalJSON() ([]byte, error) { 1336 type NoMethod QuestionItem 1337 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1338 } 1339 1340 // QuizSettings: Settings related to quiz forms and grading. These must be 1341 // updated with the UpdateSettingsRequest. 1342 type QuizSettings struct { 1343 // IsQuiz: Whether this form is a quiz or not. When true, responses are graded 1344 // based on question Grading. Upon setting to false, all question Grading is 1345 // deleted. 1346 IsQuiz bool `json:"isQuiz,omitempty"` 1347 // ForceSendFields is a list of field names (e.g. "IsQuiz") to unconditionally 1348 // include in API requests. By default, fields with empty or default values are 1349 // omitted from API requests. See 1350 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1351 // details. 1352 ForceSendFields []string `json:"-"` 1353 // NullFields is a list of field names (e.g. "IsQuiz") to include in API 1354 // requests with the JSON null value. By default, fields with empty values are 1355 // omitted from API requests. See 1356 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1357 NullFields []string `json:"-"` 1358 } 1359 1360 func (s *QuizSettings) MarshalJSON() ([]byte, error) { 1361 type NoMethod QuizSettings 1362 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1363 } 1364 1365 // RenewWatchRequest: Renew an existing Watch for seven days. 1366 type RenewWatchRequest struct { 1367 } 1368 1369 // Request: The kinds of update requests that can be made. 1370 type Request struct { 1371 // CreateItem: Create a new item. 1372 CreateItem *CreateItemRequest `json:"createItem,omitempty"` 1373 // DeleteItem: Delete an item. 1374 DeleteItem *DeleteItemRequest `json:"deleteItem,omitempty"` 1375 // MoveItem: Move an item to a specified location. 1376 MoveItem *MoveItemRequest `json:"moveItem,omitempty"` 1377 // UpdateFormInfo: Update Form's Info. 1378 UpdateFormInfo *UpdateFormInfoRequest `json:"updateFormInfo,omitempty"` 1379 // UpdateItem: Update an item. 1380 UpdateItem *UpdateItemRequest `json:"updateItem,omitempty"` 1381 // UpdateSettings: Updates the Form's settings. 1382 UpdateSettings *UpdateSettingsRequest `json:"updateSettings,omitempty"` 1383 // ForceSendFields is a list of field names (e.g. "CreateItem") to 1384 // unconditionally include in API requests. By default, fields with empty or 1385 // default values are omitted from API requests. See 1386 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1387 // details. 1388 ForceSendFields []string `json:"-"` 1389 // NullFields is a list of field names (e.g. "CreateItem") to include in API 1390 // requests with the JSON null value. By default, fields with empty values are 1391 // omitted from API requests. See 1392 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1393 NullFields []string `json:"-"` 1394 } 1395 1396 func (s *Request) MarshalJSON() ([]byte, error) { 1397 type NoMethod Request 1398 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1399 } 1400 1401 // Response: A single response from an update. 1402 type Response struct { 1403 // CreateItem: The result of creating an item. 1404 CreateItem *CreateItemResponse `json:"createItem,omitempty"` 1405 // ForceSendFields is a list of field names (e.g. "CreateItem") to 1406 // unconditionally include in API requests. By default, fields with empty or 1407 // default values are omitted from API requests. See 1408 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1409 // details. 1410 ForceSendFields []string `json:"-"` 1411 // NullFields is a list of field names (e.g. "CreateItem") to include in API 1412 // requests with the JSON null value. By default, fields with empty values are 1413 // omitted from API requests. See 1414 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1415 NullFields []string `json:"-"` 1416 } 1417 1418 func (s *Response) MarshalJSON() ([]byte, error) { 1419 type NoMethod Response 1420 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1421 } 1422 1423 // RowQuestion: Configuration for a question that is part of a question group. 1424 type RowQuestion struct { 1425 // Title: Required. The title for the single row in the QuestionGroupItem. 1426 Title string `json:"title,omitempty"` 1427 // ForceSendFields is a list of field names (e.g. "Title") to unconditionally 1428 // include in API requests. By default, fields with empty or default values are 1429 // omitted from API requests. See 1430 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1431 // details. 1432 ForceSendFields []string `json:"-"` 1433 // NullFields is a list of field names (e.g. "Title") to include in API 1434 // requests with the JSON null value. By default, fields with empty values are 1435 // omitted from API requests. See 1436 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1437 NullFields []string `json:"-"` 1438 } 1439 1440 func (s *RowQuestion) MarshalJSON() ([]byte, error) { 1441 type NoMethod RowQuestion 1442 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1443 } 1444 1445 // ScaleQuestion: A scale question. The user has a range of numeric values to 1446 // choose from. 1447 type ScaleQuestion struct { 1448 // High: Required. The highest possible value for the scale. 1449 High int64 `json:"high,omitempty"` 1450 // HighLabel: The label to display describing the highest point on the scale. 1451 HighLabel string `json:"highLabel,omitempty"` 1452 // Low: Required. The lowest possible value for the scale. 1453 Low int64 `json:"low,omitempty"` 1454 // LowLabel: The label to display describing the lowest point on the scale. 1455 LowLabel string `json:"lowLabel,omitempty"` 1456 // ForceSendFields is a list of field names (e.g. "High") to unconditionally 1457 // include in API requests. By default, fields with empty or default values are 1458 // omitted from API requests. See 1459 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1460 // details. 1461 ForceSendFields []string `json:"-"` 1462 // NullFields is a list of field names (e.g. "High") to include in API requests 1463 // with the JSON null value. By default, fields with empty values are omitted 1464 // from API requests. See 1465 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1466 NullFields []string `json:"-"` 1467 } 1468 1469 func (s *ScaleQuestion) MarshalJSON() ([]byte, error) { 1470 type NoMethod ScaleQuestion 1471 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1472 } 1473 1474 // TextAnswer: An answer to a question represented as text. 1475 type TextAnswer struct { 1476 // Value: Output only. The answer value. Formatting used for different kinds of 1477 // question: * ChoiceQuestion * `RADIO` or `DROP_DOWN`: A single string 1478 // corresponding to the option that was selected. * `CHECKBOX`: Multiple 1479 // strings corresponding to each option that was selected. * TextQuestion: The 1480 // text that the user entered. * ScaleQuestion: A string containing the number 1481 // that was selected. * DateQuestion * Without time or year: MM-DD e.g. "05-19" 1482 // * With year: YYYY-MM-DD e.g. "1986-05-19" * With time: MM-DD HH:MM e.g. 1483 // "05-19 14:51" * With year and time: YYYY-MM-DD HH:MM e.g. "1986-05-19 14:51" 1484 // * TimeQuestion: String with time or duration in HH:MM format e.g. "14:51" * 1485 // RowQuestion within QuestionGroupItem: The answer for each row of a 1486 // QuestionGroupItem is represented as a separate Answer. Each will contain one 1487 // string for `RADIO`-type choices or multiple strings for `CHECKBOX` choices. 1488 Value string `json:"value,omitempty"` 1489 // ForceSendFields is a list of field names (e.g. "Value") to unconditionally 1490 // include in API requests. By default, fields with empty or default values are 1491 // omitted from API requests. See 1492 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1493 // details. 1494 ForceSendFields []string `json:"-"` 1495 // NullFields is a list of field names (e.g. "Value") to include in API 1496 // requests with the JSON null value. By default, fields with empty values are 1497 // omitted from API requests. See 1498 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1499 NullFields []string `json:"-"` 1500 } 1501 1502 func (s *TextAnswer) MarshalJSON() ([]byte, error) { 1503 type NoMethod TextAnswer 1504 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1505 } 1506 1507 // TextAnswers: A question's answers as text. 1508 type TextAnswers struct { 1509 // Answers: Output only. Answers to a question. For multiple-value 1510 // ChoiceQuestions, each answer is a separate value. 1511 Answers []*TextAnswer `json:"answers,omitempty"` 1512 // ForceSendFields is a list of field names (e.g. "Answers") to unconditionally 1513 // include in API requests. By default, fields with empty or default values are 1514 // omitted from API requests. See 1515 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1516 // details. 1517 ForceSendFields []string `json:"-"` 1518 // NullFields is a list of field names (e.g. "Answers") to include in API 1519 // requests with the JSON null value. By default, fields with empty values are 1520 // omitted from API requests. See 1521 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1522 NullFields []string `json:"-"` 1523 } 1524 1525 func (s *TextAnswers) MarshalJSON() ([]byte, error) { 1526 type NoMethod TextAnswers 1527 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1528 } 1529 1530 // TextItem: A text item. 1531 type TextItem struct { 1532 } 1533 1534 // TextLink: Link for text. 1535 type TextLink struct { 1536 // DisplayText: Required. Display text for the URI. 1537 DisplayText string `json:"displayText,omitempty"` 1538 // Uri: Required. The URI. 1539 Uri string `json:"uri,omitempty"` 1540 // ForceSendFields is a list of field names (e.g. "DisplayText") to 1541 // unconditionally include in API requests. By default, fields with empty or 1542 // default values are omitted from API requests. See 1543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1544 // details. 1545 ForceSendFields []string `json:"-"` 1546 // NullFields is a list of field names (e.g. "DisplayText") to include in API 1547 // requests with the JSON null value. By default, fields with empty values are 1548 // omitted from API requests. See 1549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1550 NullFields []string `json:"-"` 1551 } 1552 1553 func (s *TextLink) MarshalJSON() ([]byte, error) { 1554 type NoMethod TextLink 1555 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1556 } 1557 1558 // TextQuestion: A text-based question. 1559 type TextQuestion struct { 1560 // Paragraph: Whether the question is a paragraph question or not. If not, the 1561 // question is a short text question. 1562 Paragraph bool `json:"paragraph,omitempty"` 1563 // ForceSendFields is a list of field names (e.g. "Paragraph") to 1564 // unconditionally include in API requests. By default, fields with empty or 1565 // default values are omitted from API requests. See 1566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1567 // details. 1568 ForceSendFields []string `json:"-"` 1569 // NullFields is a list of field names (e.g. "Paragraph") to include in API 1570 // requests with the JSON null value. By default, fields with empty values are 1571 // omitted from API requests. See 1572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1573 NullFields []string `json:"-"` 1574 } 1575 1576 func (s *TextQuestion) MarshalJSON() ([]byte, error) { 1577 type NoMethod TextQuestion 1578 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1579 } 1580 1581 // TimeQuestion: A time question. 1582 type TimeQuestion struct { 1583 // Duration: `true` if the question is about an elapsed time. Otherwise it is 1584 // about a time of day. 1585 Duration bool `json:"duration,omitempty"` 1586 // ForceSendFields is a list of field names (e.g. "Duration") to 1587 // unconditionally include in API requests. By default, fields with empty or 1588 // default values are omitted from API requests. See 1589 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1590 // details. 1591 ForceSendFields []string `json:"-"` 1592 // NullFields is a list of field names (e.g. "Duration") to include in API 1593 // requests with the JSON null value. By default, fields with empty values are 1594 // omitted from API requests. See 1595 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1596 NullFields []string `json:"-"` 1597 } 1598 1599 func (s *TimeQuestion) MarshalJSON() ([]byte, error) { 1600 type NoMethod TimeQuestion 1601 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1602 } 1603 1604 // UpdateFormInfoRequest: Update Form's Info. 1605 type UpdateFormInfoRequest struct { 1606 // Info: The info to update. 1607 Info *Info `json:"info,omitempty"` 1608 // UpdateMask: Required. Only values named in this mask are changed. At least 1609 // one field must be specified. The root `info` is implied and should not be 1610 // specified. A single "*" can be used as short-hand for updating every 1611 // field. 1612 UpdateMask string `json:"updateMask,omitempty"` 1613 // ForceSendFields is a list of field names (e.g. "Info") to unconditionally 1614 // include in API requests. By default, fields with empty or default values are 1615 // omitted from API requests. See 1616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1617 // details. 1618 ForceSendFields []string `json:"-"` 1619 // NullFields is a list of field names (e.g. "Info") to include in API requests 1620 // with the JSON null value. By default, fields with empty values are omitted 1621 // from API requests. See 1622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1623 NullFields []string `json:"-"` 1624 } 1625 1626 func (s *UpdateFormInfoRequest) MarshalJSON() ([]byte, error) { 1627 type NoMethod UpdateFormInfoRequest 1628 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1629 } 1630 1631 // UpdateItemRequest: Update an item in a form. 1632 type UpdateItemRequest struct { 1633 // Item: Required. New values for the item. Note that item and question IDs are 1634 // used if they are provided (and are in the field mask). If an ID is blank 1635 // (and in the field mask) a new ID is generated. This means you can modify an 1636 // item by getting the form via forms.get, modifying your local copy of that 1637 // item to be how you want it, and using UpdateItemRequest to write it back, 1638 // with the IDs being the same (or not in the field mask). 1639 Item *Item `json:"item,omitempty"` 1640 // Location: Required. The location identifying the item to update. 1641 Location *Location `json:"location,omitempty"` 1642 // UpdateMask: Required. Only values named in this mask are changed. 1643 UpdateMask string `json:"updateMask,omitempty"` 1644 // ForceSendFields is a list of field names (e.g. "Item") to unconditionally 1645 // include in API requests. By default, fields with empty or default values are 1646 // omitted from API requests. See 1647 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1648 // details. 1649 ForceSendFields []string `json:"-"` 1650 // NullFields is a list of field names (e.g. "Item") to include in API requests 1651 // with the JSON null value. By default, fields with empty values are omitted 1652 // from API requests. See 1653 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1654 NullFields []string `json:"-"` 1655 } 1656 1657 func (s *UpdateItemRequest) MarshalJSON() ([]byte, error) { 1658 type NoMethod UpdateItemRequest 1659 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1660 } 1661 1662 // UpdateSettingsRequest: Update Form's FormSettings. 1663 type UpdateSettingsRequest struct { 1664 // Settings: Required. The settings to update with. 1665 Settings *FormSettings `json:"settings,omitempty"` 1666 // UpdateMask: Required. Only values named in this mask are changed. At least 1667 // one field must be specified. The root `settings` is implied and should not 1668 // be specified. A single "*" can be used as short-hand for updating every 1669 // field. 1670 UpdateMask string `json:"updateMask,omitempty"` 1671 // ForceSendFields is a list of field names (e.g. "Settings") to 1672 // unconditionally include in API requests. By default, fields with empty or 1673 // default values are omitted from API requests. See 1674 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1675 // details. 1676 ForceSendFields []string `json:"-"` 1677 // NullFields is a list of field names (e.g. "Settings") to include in API 1678 // requests with the JSON null value. By default, fields with empty values are 1679 // omitted from API requests. See 1680 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1681 NullFields []string `json:"-"` 1682 } 1683 1684 func (s *UpdateSettingsRequest) MarshalJSON() ([]byte, error) { 1685 type NoMethod UpdateSettingsRequest 1686 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1687 } 1688 1689 // Video: Data representing a video. 1690 type Video struct { 1691 // Properties: Properties of a video. 1692 Properties *MediaProperties `json:"properties,omitempty"` 1693 // YoutubeUri: Required. A YouTube URI. 1694 YoutubeUri string `json:"youtubeUri,omitempty"` 1695 // ForceSendFields is a list of field names (e.g. "Properties") to 1696 // unconditionally include in API requests. By default, fields with empty or 1697 // default values are omitted from API requests. See 1698 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1699 // details. 1700 ForceSendFields []string `json:"-"` 1701 // NullFields is a list of field names (e.g. "Properties") to include in API 1702 // requests with the JSON null value. By default, fields with empty values are 1703 // omitted from API requests. See 1704 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1705 NullFields []string `json:"-"` 1706 } 1707 1708 func (s *Video) MarshalJSON() ([]byte, error) { 1709 type NoMethod Video 1710 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1711 } 1712 1713 // VideoItem: An item containing a video. 1714 type VideoItem struct { 1715 // Caption: The text displayed below the video. 1716 Caption string `json:"caption,omitempty"` 1717 // Video: Required. The video displayed in the item. 1718 Video *Video `json:"video,omitempty"` 1719 // ForceSendFields is a list of field names (e.g. "Caption") to unconditionally 1720 // include in API requests. By default, fields with empty or default values are 1721 // omitted from API requests. See 1722 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1723 // details. 1724 ForceSendFields []string `json:"-"` 1725 // NullFields is a list of field names (e.g. "Caption") to include in API 1726 // requests with the JSON null value. By default, fields with empty values are 1727 // omitted from API requests. See 1728 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1729 NullFields []string `json:"-"` 1730 } 1731 1732 func (s *VideoItem) MarshalJSON() ([]byte, error) { 1733 type NoMethod VideoItem 1734 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1735 } 1736 1737 // VideoLink: Link to a video. 1738 type VideoLink struct { 1739 // DisplayText: Required. The display text for the link. 1740 DisplayText string `json:"displayText,omitempty"` 1741 // YoutubeUri: The URI of a YouTube video. 1742 YoutubeUri string `json:"youtubeUri,omitempty"` 1743 // ForceSendFields is a list of field names (e.g. "DisplayText") to 1744 // unconditionally include in API requests. By default, fields with empty or 1745 // default values are omitted from API requests. See 1746 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1747 // details. 1748 ForceSendFields []string `json:"-"` 1749 // NullFields is a list of field names (e.g. "DisplayText") to include in API 1750 // requests with the JSON null value. By default, fields with empty values are 1751 // omitted from API requests. See 1752 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1753 NullFields []string `json:"-"` 1754 } 1755 1756 func (s *VideoLink) MarshalJSON() ([]byte, error) { 1757 type NoMethod VideoLink 1758 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1759 } 1760 1761 // Watch: A watch for events for a form. When the designated event happens, a 1762 // notification will be published to the specified target. The notification's 1763 // attributes will include a `formId` key that has the ID of the watched form 1764 // and an `eventType` key that has the string of the type. Messages are sent 1765 // with at-least-once delivery and are only dropped in extraordinary 1766 // circumstances. Typically all notifications should be reliably delivered 1767 // within a few seconds; however, in some situations notifications may be 1768 // delayed. A watch expires seven days after it is created unless it is renewed 1769 // with watches.renew 1770 type Watch struct { 1771 // CreateTime: Output only. Timestamp of when this was created. 1772 CreateTime string `json:"createTime,omitempty"` 1773 // ErrorType: Output only. The most recent error type for an attempted 1774 // delivery. To begin watching the form again a call can be made to 1775 // watches.renew which also clears this error information. 1776 // 1777 // Possible values: 1778 // "ERROR_TYPE_UNSPECIFIED" - Unspecified error type. 1779 // "PROJECT_NOT_AUTHORIZED" - The cloud project does not have access to the 1780 // form being watched. This occurs if the user has revoked the authorization 1781 // for your project to access their form(s). Watches with this error will not 1782 // be retried. To attempt to begin watching the form again a call can be made 1783 // to watches.renew 1784 // "NO_USER_ACCESS" - The user that granted access no longer has access to 1785 // the form being watched. Watches with this error will not be retried. To 1786 // attempt to begin watching the form again a call can be made to watches.renew 1787 // "OTHER_ERRORS" - Another type of error has occurred. Whether notifications 1788 // will continue depends on the watch state. 1789 ErrorType string `json:"errorType,omitempty"` 1790 // EventType: Required. Which event type to watch for. 1791 // 1792 // Possible values: 1793 // "EVENT_TYPE_UNSPECIFIED" - Unspecified event type. This value should not 1794 // be used. 1795 // "SCHEMA" - The schema event type. A watch with this event type will be 1796 // notified about changes to form content and settings. 1797 // "RESPONSES" - The responses event type. A watch with this event type will 1798 // be notified when form responses are submitted. 1799 EventType string `json:"eventType,omitempty"` 1800 // ExpireTime: Output only. Timestamp for when this will expire. Each 1801 // watches.renew call resets this to seven days in the future. 1802 ExpireTime string `json:"expireTime,omitempty"` 1803 // Id: Output only. The ID of this watch. See notes on 1804 // CreateWatchRequest.watch_id. 1805 Id string `json:"id,omitempty"` 1806 // State: Output only. The current state of the watch. Additional details about 1807 // suspended watches can be found by checking the `error_type`. 1808 // 1809 // Possible values: 1810 // "STATE_UNSPECIFIED" - Unspecified state. 1811 // "ACTIVE" - Watch is active. 1812 // "SUSPENDED" - The watch is suspended due to an error that may be resolved. 1813 // The watch will continue to exist until it expires. To attempt to reactivate 1814 // the watch a call can be made to watches.renew 1815 State string `json:"state,omitempty"` 1816 // Target: Required. Where to send the notification. 1817 Target *WatchTarget `json:"target,omitempty"` 1818 1819 // ServerResponse contains the HTTP response code and headers from the server. 1820 googleapi.ServerResponse `json:"-"` 1821 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1822 // unconditionally include in API requests. By default, fields with empty or 1823 // default values are omitted from API requests. See 1824 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1825 // details. 1826 ForceSendFields []string `json:"-"` 1827 // NullFields is a list of field names (e.g. "CreateTime") to include in API 1828 // requests with the JSON null value. By default, fields with empty values are 1829 // omitted from API requests. See 1830 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1831 NullFields []string `json:"-"` 1832 } 1833 1834 func (s *Watch) MarshalJSON() ([]byte, error) { 1835 type NoMethod Watch 1836 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1837 } 1838 1839 // WatchTarget: The target for notification delivery. 1840 type WatchTarget struct { 1841 // Topic: A Pub/Sub topic. To receive notifications, the topic must grant 1842 // publish privileges to the Forms service account 1843 // `serviceAccount:forms-notifications@system.gserviceaccount.com`. Only the 1844 // project that owns a topic may create a watch with it. Pub/Sub delivery 1845 // guarantees should be considered. 1846 Topic *CloudPubsubTopic `json:"topic,omitempty"` 1847 // ForceSendFields is a list of field names (e.g. "Topic") to unconditionally 1848 // include in API requests. By default, fields with empty or default values are 1849 // omitted from API requests. See 1850 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1851 // details. 1852 ForceSendFields []string `json:"-"` 1853 // NullFields is a list of field names (e.g. "Topic") to include in API 1854 // requests with the JSON null value. By default, fields with empty values are 1855 // omitted from API requests. See 1856 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1857 NullFields []string `json:"-"` 1858 } 1859 1860 func (s *WatchTarget) MarshalJSON() ([]byte, error) { 1861 type NoMethod WatchTarget 1862 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1863 } 1864 1865 // WriteControl: Provides control over how write requests are executed. 1866 type WriteControl struct { 1867 // RequiredRevisionId: The revision ID of the form that the write request is 1868 // applied to. If this is not the latest revision of the form, the request is 1869 // not processed and returns a 400 bad request error. 1870 RequiredRevisionId string `json:"requiredRevisionId,omitempty"` 1871 // TargetRevisionId: The target revision ID of the form that the write request 1872 // is applied to. If changes have occurred after this revision, the changes in 1873 // this update request are transformed against those changes. This results in a 1874 // new revision of the form that incorporates both the changes in the request 1875 // and the intervening changes, with the server resolving conflicting changes. 1876 // The target revision ID may only be used to write to recent versions of a 1877 // form. If the target revision is too far behind the latest revision, the 1878 // request is not processed and returns a 400 (Bad Request Error). The request 1879 // may be retried after reading the latest version of the form. In most cases a 1880 // target revision ID remains valid for several minutes after it is read, but 1881 // for frequently-edited forms this window may be shorter. 1882 TargetRevisionId string `json:"targetRevisionId,omitempty"` 1883 // ForceSendFields is a list of field names (e.g. "RequiredRevisionId") to 1884 // unconditionally include in API requests. By default, fields with empty or 1885 // default values are omitted from API requests. See 1886 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1887 // details. 1888 ForceSendFields []string `json:"-"` 1889 // NullFields is a list of field names (e.g. "RequiredRevisionId") to include 1890 // in API requests with the JSON null value. By default, fields with empty 1891 // values are omitted from API requests. See 1892 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1893 NullFields []string `json:"-"` 1894 } 1895 1896 func (s *WriteControl) MarshalJSON() ([]byte, error) { 1897 type NoMethod WriteControl 1898 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1899 } 1900 1901 type FormsBatchUpdateCall struct { 1902 s *Service 1903 formId string 1904 batchupdateformrequest *BatchUpdateFormRequest 1905 urlParams_ gensupport.URLParams 1906 ctx_ context.Context 1907 header_ http.Header 1908 } 1909 1910 // BatchUpdate: Change the form with a batch of updates. 1911 // 1912 // - formId: The form ID. 1913 func (r *FormsService) BatchUpdate(formId string, batchupdateformrequest *BatchUpdateFormRequest) *FormsBatchUpdateCall { 1914 c := &FormsBatchUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1915 c.formId = formId 1916 c.batchupdateformrequest = batchupdateformrequest 1917 return c 1918 } 1919 1920 // Fields allows partial responses to be retrieved. See 1921 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1922 // details. 1923 func (c *FormsBatchUpdateCall) Fields(s ...googleapi.Field) *FormsBatchUpdateCall { 1924 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1925 return c 1926 } 1927 1928 // Context sets the context to be used in this call's Do method. 1929 func (c *FormsBatchUpdateCall) Context(ctx context.Context) *FormsBatchUpdateCall { 1930 c.ctx_ = ctx 1931 return c 1932 } 1933 1934 // Header returns a http.Header that can be modified by the caller to add 1935 // headers to the request. 1936 func (c *FormsBatchUpdateCall) Header() http.Header { 1937 if c.header_ == nil { 1938 c.header_ = make(http.Header) 1939 } 1940 return c.header_ 1941 } 1942 1943 func (c *FormsBatchUpdateCall) doRequest(alt string) (*http.Response, error) { 1944 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1945 var body io.Reader = nil 1946 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchupdateformrequest) 1947 if err != nil { 1948 return nil, err 1949 } 1950 c.urlParams_.Set("alt", alt) 1951 c.urlParams_.Set("prettyPrint", "false") 1952 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}:batchUpdate") 1953 urls += "?" + c.urlParams_.Encode() 1954 req, err := http.NewRequest("POST", urls, body) 1955 if err != nil { 1956 return nil, err 1957 } 1958 req.Header = reqHeaders 1959 googleapi.Expand(req.URL, map[string]string{ 1960 "formId": c.formId, 1961 }) 1962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1963 } 1964 1965 // Do executes the "forms.forms.batchUpdate" call. 1966 // Any non-2xx status code is an error. Response headers are in either 1967 // *BatchUpdateFormResponse.ServerResponse.Header or (if a response was 1968 // returned at all) in error.(*googleapi.Error).Header. Use 1969 // googleapi.IsNotModified to check whether the returned error was because 1970 // http.StatusNotModified was returned. 1971 func (c *FormsBatchUpdateCall) Do(opts ...googleapi.CallOption) (*BatchUpdateFormResponse, error) { 1972 gensupport.SetOptions(c.urlParams_, opts...) 1973 res, err := c.doRequest("json") 1974 if res != nil && res.StatusCode == http.StatusNotModified { 1975 if res.Body != nil { 1976 res.Body.Close() 1977 } 1978 return nil, gensupport.WrapError(&googleapi.Error{ 1979 Code: res.StatusCode, 1980 Header: res.Header, 1981 }) 1982 } 1983 if err != nil { 1984 return nil, err 1985 } 1986 defer googleapi.CloseBody(res) 1987 if err := googleapi.CheckResponse(res); err != nil { 1988 return nil, gensupport.WrapError(err) 1989 } 1990 ret := &BatchUpdateFormResponse{ 1991 ServerResponse: googleapi.ServerResponse{ 1992 Header: res.Header, 1993 HTTPStatusCode: res.StatusCode, 1994 }, 1995 } 1996 target := &ret 1997 if err := gensupport.DecodeResponse(target, res); err != nil { 1998 return nil, err 1999 } 2000 return ret, nil 2001 } 2002 2003 type FormsCreateCall struct { 2004 s *Service 2005 form *Form 2006 urlParams_ gensupport.URLParams 2007 ctx_ context.Context 2008 header_ http.Header 2009 } 2010 2011 // Create: Create a new form using the title given in the provided form message 2012 // in the request. *Important:* Only the form.info.title and 2013 // form.info.document_title fields are copied to the new form. All other fields 2014 // including the form description, items and settings are disallowed. To create 2015 // a new form and add items, you must first call forms.create to create an 2016 // empty form with a title and (optional) document title, and then call 2017 // forms.update to add the items. 2018 func (r *FormsService) Create(form *Form) *FormsCreateCall { 2019 c := &FormsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2020 c.form = form 2021 return c 2022 } 2023 2024 // Fields allows partial responses to be retrieved. See 2025 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2026 // details. 2027 func (c *FormsCreateCall) Fields(s ...googleapi.Field) *FormsCreateCall { 2028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2029 return c 2030 } 2031 2032 // Context sets the context to be used in this call's Do method. 2033 func (c *FormsCreateCall) Context(ctx context.Context) *FormsCreateCall { 2034 c.ctx_ = ctx 2035 return c 2036 } 2037 2038 // Header returns a http.Header that can be modified by the caller to add 2039 // headers to the request. 2040 func (c *FormsCreateCall) Header() http.Header { 2041 if c.header_ == nil { 2042 c.header_ = make(http.Header) 2043 } 2044 return c.header_ 2045 } 2046 2047 func (c *FormsCreateCall) doRequest(alt string) (*http.Response, error) { 2048 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2049 var body io.Reader = nil 2050 body, err := googleapi.WithoutDataWrapper.JSONReader(c.form) 2051 if err != nil { 2052 return nil, err 2053 } 2054 c.urlParams_.Set("alt", alt) 2055 c.urlParams_.Set("prettyPrint", "false") 2056 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms") 2057 urls += "?" + c.urlParams_.Encode() 2058 req, err := http.NewRequest("POST", urls, body) 2059 if err != nil { 2060 return nil, err 2061 } 2062 req.Header = reqHeaders 2063 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2064 } 2065 2066 // Do executes the "forms.forms.create" call. 2067 // Any non-2xx status code is an error. Response headers are in either 2068 // *Form.ServerResponse.Header or (if a response was returned at all) in 2069 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2070 // whether the returned error was because http.StatusNotModified was returned. 2071 func (c *FormsCreateCall) Do(opts ...googleapi.CallOption) (*Form, error) { 2072 gensupport.SetOptions(c.urlParams_, opts...) 2073 res, err := c.doRequest("json") 2074 if res != nil && res.StatusCode == http.StatusNotModified { 2075 if res.Body != nil { 2076 res.Body.Close() 2077 } 2078 return nil, gensupport.WrapError(&googleapi.Error{ 2079 Code: res.StatusCode, 2080 Header: res.Header, 2081 }) 2082 } 2083 if err != nil { 2084 return nil, err 2085 } 2086 defer googleapi.CloseBody(res) 2087 if err := googleapi.CheckResponse(res); err != nil { 2088 return nil, gensupport.WrapError(err) 2089 } 2090 ret := &Form{ 2091 ServerResponse: googleapi.ServerResponse{ 2092 Header: res.Header, 2093 HTTPStatusCode: res.StatusCode, 2094 }, 2095 } 2096 target := &ret 2097 if err := gensupport.DecodeResponse(target, res); err != nil { 2098 return nil, err 2099 } 2100 return ret, nil 2101 } 2102 2103 type FormsGetCall struct { 2104 s *Service 2105 formId string 2106 urlParams_ gensupport.URLParams 2107 ifNoneMatch_ string 2108 ctx_ context.Context 2109 header_ http.Header 2110 } 2111 2112 // Get: Get a form. 2113 // 2114 // - formId: The form ID. 2115 func (r *FormsService) Get(formId string) *FormsGetCall { 2116 c := &FormsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2117 c.formId = formId 2118 return c 2119 } 2120 2121 // Fields allows partial responses to be retrieved. See 2122 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2123 // details. 2124 func (c *FormsGetCall) Fields(s ...googleapi.Field) *FormsGetCall { 2125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2126 return c 2127 } 2128 2129 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2130 // object's ETag matches the given value. This is useful for getting updates 2131 // only after the object has changed since the last request. 2132 func (c *FormsGetCall) IfNoneMatch(entityTag string) *FormsGetCall { 2133 c.ifNoneMatch_ = entityTag 2134 return c 2135 } 2136 2137 // Context sets the context to be used in this call's Do method. 2138 func (c *FormsGetCall) Context(ctx context.Context) *FormsGetCall { 2139 c.ctx_ = ctx 2140 return c 2141 } 2142 2143 // Header returns a http.Header that can be modified by the caller to add 2144 // headers to the request. 2145 func (c *FormsGetCall) Header() http.Header { 2146 if c.header_ == nil { 2147 c.header_ = make(http.Header) 2148 } 2149 return c.header_ 2150 } 2151 2152 func (c *FormsGetCall) doRequest(alt string) (*http.Response, error) { 2153 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2154 if c.ifNoneMatch_ != "" { 2155 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2156 } 2157 var body io.Reader = nil 2158 c.urlParams_.Set("alt", alt) 2159 c.urlParams_.Set("prettyPrint", "false") 2160 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}") 2161 urls += "?" + c.urlParams_.Encode() 2162 req, err := http.NewRequest("GET", urls, body) 2163 if err != nil { 2164 return nil, err 2165 } 2166 req.Header = reqHeaders 2167 googleapi.Expand(req.URL, map[string]string{ 2168 "formId": c.formId, 2169 }) 2170 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2171 } 2172 2173 // Do executes the "forms.forms.get" call. 2174 // Any non-2xx status code is an error. Response headers are in either 2175 // *Form.ServerResponse.Header or (if a response was returned at all) in 2176 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2177 // whether the returned error was because http.StatusNotModified was returned. 2178 func (c *FormsGetCall) Do(opts ...googleapi.CallOption) (*Form, error) { 2179 gensupport.SetOptions(c.urlParams_, opts...) 2180 res, err := c.doRequest("json") 2181 if res != nil && res.StatusCode == http.StatusNotModified { 2182 if res.Body != nil { 2183 res.Body.Close() 2184 } 2185 return nil, gensupport.WrapError(&googleapi.Error{ 2186 Code: res.StatusCode, 2187 Header: res.Header, 2188 }) 2189 } 2190 if err != nil { 2191 return nil, err 2192 } 2193 defer googleapi.CloseBody(res) 2194 if err := googleapi.CheckResponse(res); err != nil { 2195 return nil, gensupport.WrapError(err) 2196 } 2197 ret := &Form{ 2198 ServerResponse: googleapi.ServerResponse{ 2199 Header: res.Header, 2200 HTTPStatusCode: res.StatusCode, 2201 }, 2202 } 2203 target := &ret 2204 if err := gensupport.DecodeResponse(target, res); err != nil { 2205 return nil, err 2206 } 2207 return ret, nil 2208 } 2209 2210 type FormsResponsesGetCall struct { 2211 s *Service 2212 formId string 2213 responseId string 2214 urlParams_ gensupport.URLParams 2215 ifNoneMatch_ string 2216 ctx_ context.Context 2217 header_ http.Header 2218 } 2219 2220 // Get: Get one response from the form. 2221 // 2222 // - formId: The form ID. 2223 // - responseId: The response ID within the form. 2224 func (r *FormsResponsesService) Get(formId string, responseId string) *FormsResponsesGetCall { 2225 c := &FormsResponsesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2226 c.formId = formId 2227 c.responseId = responseId 2228 return c 2229 } 2230 2231 // Fields allows partial responses to be retrieved. See 2232 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2233 // details. 2234 func (c *FormsResponsesGetCall) Fields(s ...googleapi.Field) *FormsResponsesGetCall { 2235 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2236 return c 2237 } 2238 2239 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2240 // object's ETag matches the given value. This is useful for getting updates 2241 // only after the object has changed since the last request. 2242 func (c *FormsResponsesGetCall) IfNoneMatch(entityTag string) *FormsResponsesGetCall { 2243 c.ifNoneMatch_ = entityTag 2244 return c 2245 } 2246 2247 // Context sets the context to be used in this call's Do method. 2248 func (c *FormsResponsesGetCall) Context(ctx context.Context) *FormsResponsesGetCall { 2249 c.ctx_ = ctx 2250 return c 2251 } 2252 2253 // Header returns a http.Header that can be modified by the caller to add 2254 // headers to the request. 2255 func (c *FormsResponsesGetCall) Header() http.Header { 2256 if c.header_ == nil { 2257 c.header_ = make(http.Header) 2258 } 2259 return c.header_ 2260 } 2261 2262 func (c *FormsResponsesGetCall) doRequest(alt string) (*http.Response, error) { 2263 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2264 if c.ifNoneMatch_ != "" { 2265 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2266 } 2267 var body io.Reader = nil 2268 c.urlParams_.Set("alt", alt) 2269 c.urlParams_.Set("prettyPrint", "false") 2270 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/responses/{responseId}") 2271 urls += "?" + c.urlParams_.Encode() 2272 req, err := http.NewRequest("GET", urls, body) 2273 if err != nil { 2274 return nil, err 2275 } 2276 req.Header = reqHeaders 2277 googleapi.Expand(req.URL, map[string]string{ 2278 "formId": c.formId, 2279 "responseId": c.responseId, 2280 }) 2281 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2282 } 2283 2284 // Do executes the "forms.forms.responses.get" call. 2285 // Any non-2xx status code is an error. Response headers are in either 2286 // *FormResponse.ServerResponse.Header or (if a response was returned at all) 2287 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2288 // whether the returned error was because http.StatusNotModified was returned. 2289 func (c *FormsResponsesGetCall) Do(opts ...googleapi.CallOption) (*FormResponse, error) { 2290 gensupport.SetOptions(c.urlParams_, opts...) 2291 res, err := c.doRequest("json") 2292 if res != nil && res.StatusCode == http.StatusNotModified { 2293 if res.Body != nil { 2294 res.Body.Close() 2295 } 2296 return nil, gensupport.WrapError(&googleapi.Error{ 2297 Code: res.StatusCode, 2298 Header: res.Header, 2299 }) 2300 } 2301 if err != nil { 2302 return nil, err 2303 } 2304 defer googleapi.CloseBody(res) 2305 if err := googleapi.CheckResponse(res); err != nil { 2306 return nil, gensupport.WrapError(err) 2307 } 2308 ret := &FormResponse{ 2309 ServerResponse: googleapi.ServerResponse{ 2310 Header: res.Header, 2311 HTTPStatusCode: res.StatusCode, 2312 }, 2313 } 2314 target := &ret 2315 if err := gensupport.DecodeResponse(target, res); err != nil { 2316 return nil, err 2317 } 2318 return ret, nil 2319 } 2320 2321 type FormsResponsesListCall struct { 2322 s *Service 2323 formId string 2324 urlParams_ gensupport.URLParams 2325 ifNoneMatch_ string 2326 ctx_ context.Context 2327 header_ http.Header 2328 } 2329 2330 // List: List a form's responses. 2331 // 2332 // - formId: ID of the Form whose responses to list. 2333 func (r *FormsResponsesService) List(formId string) *FormsResponsesListCall { 2334 c := &FormsResponsesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2335 c.formId = formId 2336 return c 2337 } 2338 2339 // Filter sets the optional parameter "filter": Which form responses to return. 2340 // Currently, the only supported filters are: * timestamp > *N* which means to 2341 // get all form responses submitted after (but not at) timestamp *N*. * 2342 // timestamp >= *N* which means to get all form responses submitted at and 2343 // after timestamp *N*. For both supported filters, timestamp must be formatted 2344 // in RFC3339 UTC "Zulu" format. Examples: "2014-10-02T15:01:23Z" and 2345 // "2014-10-02T15:01:23.045123456Z". 2346 func (c *FormsResponsesListCall) Filter(filter string) *FormsResponsesListCall { 2347 c.urlParams_.Set("filter", filter) 2348 return c 2349 } 2350 2351 // PageSize sets the optional parameter "pageSize": The maximum number of 2352 // responses to return. The service may return fewer than this value. If 2353 // unspecified or zero, at most 5000 responses are returned. 2354 func (c *FormsResponsesListCall) PageSize(pageSize int64) *FormsResponsesListCall { 2355 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2356 return c 2357 } 2358 2359 // PageToken sets the optional parameter "pageToken": A page token returned by 2360 // a previous list response. If this field is set, the form and the values of 2361 // the filter must be the same as for the original request. 2362 func (c *FormsResponsesListCall) PageToken(pageToken string) *FormsResponsesListCall { 2363 c.urlParams_.Set("pageToken", pageToken) 2364 return c 2365 } 2366 2367 // Fields allows partial responses to be retrieved. See 2368 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2369 // details. 2370 func (c *FormsResponsesListCall) Fields(s ...googleapi.Field) *FormsResponsesListCall { 2371 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2372 return c 2373 } 2374 2375 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2376 // object's ETag matches the given value. This is useful for getting updates 2377 // only after the object has changed since the last request. 2378 func (c *FormsResponsesListCall) IfNoneMatch(entityTag string) *FormsResponsesListCall { 2379 c.ifNoneMatch_ = entityTag 2380 return c 2381 } 2382 2383 // Context sets the context to be used in this call's Do method. 2384 func (c *FormsResponsesListCall) Context(ctx context.Context) *FormsResponsesListCall { 2385 c.ctx_ = ctx 2386 return c 2387 } 2388 2389 // Header returns a http.Header that can be modified by the caller to add 2390 // headers to the request. 2391 func (c *FormsResponsesListCall) Header() http.Header { 2392 if c.header_ == nil { 2393 c.header_ = make(http.Header) 2394 } 2395 return c.header_ 2396 } 2397 2398 func (c *FormsResponsesListCall) doRequest(alt string) (*http.Response, error) { 2399 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2400 if c.ifNoneMatch_ != "" { 2401 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2402 } 2403 var body io.Reader = nil 2404 c.urlParams_.Set("alt", alt) 2405 c.urlParams_.Set("prettyPrint", "false") 2406 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/responses") 2407 urls += "?" + c.urlParams_.Encode() 2408 req, err := http.NewRequest("GET", urls, body) 2409 if err != nil { 2410 return nil, err 2411 } 2412 req.Header = reqHeaders 2413 googleapi.Expand(req.URL, map[string]string{ 2414 "formId": c.formId, 2415 }) 2416 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2417 } 2418 2419 // Do executes the "forms.forms.responses.list" call. 2420 // Any non-2xx status code is an error. Response headers are in either 2421 // *ListFormResponsesResponse.ServerResponse.Header or (if a response was 2422 // returned at all) in error.(*googleapi.Error).Header. Use 2423 // googleapi.IsNotModified to check whether the returned error was because 2424 // http.StatusNotModified was returned. 2425 func (c *FormsResponsesListCall) Do(opts ...googleapi.CallOption) (*ListFormResponsesResponse, error) { 2426 gensupport.SetOptions(c.urlParams_, opts...) 2427 res, err := c.doRequest("json") 2428 if res != nil && res.StatusCode == http.StatusNotModified { 2429 if res.Body != nil { 2430 res.Body.Close() 2431 } 2432 return nil, gensupport.WrapError(&googleapi.Error{ 2433 Code: res.StatusCode, 2434 Header: res.Header, 2435 }) 2436 } 2437 if err != nil { 2438 return nil, err 2439 } 2440 defer googleapi.CloseBody(res) 2441 if err := googleapi.CheckResponse(res); err != nil { 2442 return nil, gensupport.WrapError(err) 2443 } 2444 ret := &ListFormResponsesResponse{ 2445 ServerResponse: googleapi.ServerResponse{ 2446 Header: res.Header, 2447 HTTPStatusCode: res.StatusCode, 2448 }, 2449 } 2450 target := &ret 2451 if err := gensupport.DecodeResponse(target, res); err != nil { 2452 return nil, err 2453 } 2454 return ret, nil 2455 } 2456 2457 // Pages invokes f for each page of results. 2458 // A non-nil error returned from f will halt the iteration. 2459 // The provided context supersedes any context provided to the Context method. 2460 func (c *FormsResponsesListCall) Pages(ctx context.Context, f func(*ListFormResponsesResponse) error) error { 2461 c.ctx_ = ctx 2462 defer c.PageToken(c.urlParams_.Get("pageToken")) 2463 for { 2464 x, err := c.Do() 2465 if err != nil { 2466 return err 2467 } 2468 if err := f(x); err != nil { 2469 return err 2470 } 2471 if x.NextPageToken == "" { 2472 return nil 2473 } 2474 c.PageToken(x.NextPageToken) 2475 } 2476 } 2477 2478 type FormsWatchesCreateCall struct { 2479 s *Service 2480 formId string 2481 createwatchrequest *CreateWatchRequest 2482 urlParams_ gensupport.URLParams 2483 ctx_ context.Context 2484 header_ http.Header 2485 } 2486 2487 // Create: Create a new watch. If a watch ID is provided, it must be unused. 2488 // For each invoking project, the per form limit is one watch per 2489 // Watch.EventType. A watch expires seven days after it is created (see 2490 // Watch.expire_time). 2491 // 2492 // - formId: ID of the Form to watch. 2493 func (r *FormsWatchesService) Create(formId string, createwatchrequest *CreateWatchRequest) *FormsWatchesCreateCall { 2494 c := &FormsWatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2495 c.formId = formId 2496 c.createwatchrequest = createwatchrequest 2497 return c 2498 } 2499 2500 // Fields allows partial responses to be retrieved. See 2501 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2502 // details. 2503 func (c *FormsWatchesCreateCall) Fields(s ...googleapi.Field) *FormsWatchesCreateCall { 2504 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2505 return c 2506 } 2507 2508 // Context sets the context to be used in this call's Do method. 2509 func (c *FormsWatchesCreateCall) Context(ctx context.Context) *FormsWatchesCreateCall { 2510 c.ctx_ = ctx 2511 return c 2512 } 2513 2514 // Header returns a http.Header that can be modified by the caller to add 2515 // headers to the request. 2516 func (c *FormsWatchesCreateCall) Header() http.Header { 2517 if c.header_ == nil { 2518 c.header_ = make(http.Header) 2519 } 2520 return c.header_ 2521 } 2522 2523 func (c *FormsWatchesCreateCall) doRequest(alt string) (*http.Response, error) { 2524 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2525 var body io.Reader = nil 2526 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createwatchrequest) 2527 if err != nil { 2528 return nil, err 2529 } 2530 c.urlParams_.Set("alt", alt) 2531 c.urlParams_.Set("prettyPrint", "false") 2532 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches") 2533 urls += "?" + c.urlParams_.Encode() 2534 req, err := http.NewRequest("POST", urls, body) 2535 if err != nil { 2536 return nil, err 2537 } 2538 req.Header = reqHeaders 2539 googleapi.Expand(req.URL, map[string]string{ 2540 "formId": c.formId, 2541 }) 2542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2543 } 2544 2545 // Do executes the "forms.forms.watches.create" call. 2546 // Any non-2xx status code is an error. Response headers are in either 2547 // *Watch.ServerResponse.Header or (if a response was returned at all) in 2548 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2549 // whether the returned error was because http.StatusNotModified was returned. 2550 func (c *FormsWatchesCreateCall) Do(opts ...googleapi.CallOption) (*Watch, error) { 2551 gensupport.SetOptions(c.urlParams_, opts...) 2552 res, err := c.doRequest("json") 2553 if res != nil && res.StatusCode == http.StatusNotModified { 2554 if res.Body != nil { 2555 res.Body.Close() 2556 } 2557 return nil, gensupport.WrapError(&googleapi.Error{ 2558 Code: res.StatusCode, 2559 Header: res.Header, 2560 }) 2561 } 2562 if err != nil { 2563 return nil, err 2564 } 2565 defer googleapi.CloseBody(res) 2566 if err := googleapi.CheckResponse(res); err != nil { 2567 return nil, gensupport.WrapError(err) 2568 } 2569 ret := &Watch{ 2570 ServerResponse: googleapi.ServerResponse{ 2571 Header: res.Header, 2572 HTTPStatusCode: res.StatusCode, 2573 }, 2574 } 2575 target := &ret 2576 if err := gensupport.DecodeResponse(target, res); err != nil { 2577 return nil, err 2578 } 2579 return ret, nil 2580 } 2581 2582 type FormsWatchesDeleteCall struct { 2583 s *Service 2584 formId string 2585 watchId string 2586 urlParams_ gensupport.URLParams 2587 ctx_ context.Context 2588 header_ http.Header 2589 } 2590 2591 // Delete: Delete a watch. 2592 // 2593 // - formId: The ID of the Form. 2594 // - watchId: The ID of the Watch to delete. 2595 func (r *FormsWatchesService) Delete(formId string, watchId string) *FormsWatchesDeleteCall { 2596 c := &FormsWatchesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2597 c.formId = formId 2598 c.watchId = watchId 2599 return c 2600 } 2601 2602 // Fields allows partial responses to be retrieved. See 2603 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2604 // details. 2605 func (c *FormsWatchesDeleteCall) Fields(s ...googleapi.Field) *FormsWatchesDeleteCall { 2606 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2607 return c 2608 } 2609 2610 // Context sets the context to be used in this call's Do method. 2611 func (c *FormsWatchesDeleteCall) Context(ctx context.Context) *FormsWatchesDeleteCall { 2612 c.ctx_ = ctx 2613 return c 2614 } 2615 2616 // Header returns a http.Header that can be modified by the caller to add 2617 // headers to the request. 2618 func (c *FormsWatchesDeleteCall) Header() http.Header { 2619 if c.header_ == nil { 2620 c.header_ = make(http.Header) 2621 } 2622 return c.header_ 2623 } 2624 2625 func (c *FormsWatchesDeleteCall) doRequest(alt string) (*http.Response, error) { 2626 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2627 var body io.Reader = nil 2628 c.urlParams_.Set("alt", alt) 2629 c.urlParams_.Set("prettyPrint", "false") 2630 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches/{watchId}") 2631 urls += "?" + c.urlParams_.Encode() 2632 req, err := http.NewRequest("DELETE", urls, body) 2633 if err != nil { 2634 return nil, err 2635 } 2636 req.Header = reqHeaders 2637 googleapi.Expand(req.URL, map[string]string{ 2638 "formId": c.formId, 2639 "watchId": c.watchId, 2640 }) 2641 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2642 } 2643 2644 // Do executes the "forms.forms.watches.delete" call. 2645 // Any non-2xx status code is an error. Response headers are in either 2646 // *Empty.ServerResponse.Header or (if a response was returned at all) in 2647 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2648 // whether the returned error was because http.StatusNotModified was returned. 2649 func (c *FormsWatchesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2650 gensupport.SetOptions(c.urlParams_, opts...) 2651 res, err := c.doRequest("json") 2652 if res != nil && res.StatusCode == http.StatusNotModified { 2653 if res.Body != nil { 2654 res.Body.Close() 2655 } 2656 return nil, gensupport.WrapError(&googleapi.Error{ 2657 Code: res.StatusCode, 2658 Header: res.Header, 2659 }) 2660 } 2661 if err != nil { 2662 return nil, err 2663 } 2664 defer googleapi.CloseBody(res) 2665 if err := googleapi.CheckResponse(res); err != nil { 2666 return nil, gensupport.WrapError(err) 2667 } 2668 ret := &Empty{ 2669 ServerResponse: googleapi.ServerResponse{ 2670 Header: res.Header, 2671 HTTPStatusCode: res.StatusCode, 2672 }, 2673 } 2674 target := &ret 2675 if err := gensupport.DecodeResponse(target, res); err != nil { 2676 return nil, err 2677 } 2678 return ret, nil 2679 } 2680 2681 type FormsWatchesListCall struct { 2682 s *Service 2683 formId string 2684 urlParams_ gensupport.URLParams 2685 ifNoneMatch_ string 2686 ctx_ context.Context 2687 header_ http.Header 2688 } 2689 2690 // List: Return a list of the watches owned by the invoking project. The 2691 // maximum number of watches is two: For each invoker, the limit is one for 2692 // each event type per form. 2693 // 2694 // - formId: ID of the Form whose watches to list. 2695 func (r *FormsWatchesService) List(formId string) *FormsWatchesListCall { 2696 c := &FormsWatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2697 c.formId = formId 2698 return c 2699 } 2700 2701 // Fields allows partial responses to be retrieved. See 2702 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2703 // details. 2704 func (c *FormsWatchesListCall) Fields(s ...googleapi.Field) *FormsWatchesListCall { 2705 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2706 return c 2707 } 2708 2709 // IfNoneMatch sets an optional parameter which makes the operation fail if the 2710 // object's ETag matches the given value. This is useful for getting updates 2711 // only after the object has changed since the last request. 2712 func (c *FormsWatchesListCall) IfNoneMatch(entityTag string) *FormsWatchesListCall { 2713 c.ifNoneMatch_ = entityTag 2714 return c 2715 } 2716 2717 // Context sets the context to be used in this call's Do method. 2718 func (c *FormsWatchesListCall) Context(ctx context.Context) *FormsWatchesListCall { 2719 c.ctx_ = ctx 2720 return c 2721 } 2722 2723 // Header returns a http.Header that can be modified by the caller to add 2724 // headers to the request. 2725 func (c *FormsWatchesListCall) Header() http.Header { 2726 if c.header_ == nil { 2727 c.header_ = make(http.Header) 2728 } 2729 return c.header_ 2730 } 2731 2732 func (c *FormsWatchesListCall) doRequest(alt string) (*http.Response, error) { 2733 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 2734 if c.ifNoneMatch_ != "" { 2735 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2736 } 2737 var body io.Reader = nil 2738 c.urlParams_.Set("alt", alt) 2739 c.urlParams_.Set("prettyPrint", "false") 2740 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches") 2741 urls += "?" + c.urlParams_.Encode() 2742 req, err := http.NewRequest("GET", urls, body) 2743 if err != nil { 2744 return nil, err 2745 } 2746 req.Header = reqHeaders 2747 googleapi.Expand(req.URL, map[string]string{ 2748 "formId": c.formId, 2749 }) 2750 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2751 } 2752 2753 // Do executes the "forms.forms.watches.list" call. 2754 // Any non-2xx status code is an error. Response headers are in either 2755 // *ListWatchesResponse.ServerResponse.Header or (if a response was returned at 2756 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2757 // check whether the returned error was because http.StatusNotModified was 2758 // returned. 2759 func (c *FormsWatchesListCall) Do(opts ...googleapi.CallOption) (*ListWatchesResponse, error) { 2760 gensupport.SetOptions(c.urlParams_, opts...) 2761 res, err := c.doRequest("json") 2762 if res != nil && res.StatusCode == http.StatusNotModified { 2763 if res.Body != nil { 2764 res.Body.Close() 2765 } 2766 return nil, gensupport.WrapError(&googleapi.Error{ 2767 Code: res.StatusCode, 2768 Header: res.Header, 2769 }) 2770 } 2771 if err != nil { 2772 return nil, err 2773 } 2774 defer googleapi.CloseBody(res) 2775 if err := googleapi.CheckResponse(res); err != nil { 2776 return nil, gensupport.WrapError(err) 2777 } 2778 ret := &ListWatchesResponse{ 2779 ServerResponse: googleapi.ServerResponse{ 2780 Header: res.Header, 2781 HTTPStatusCode: res.StatusCode, 2782 }, 2783 } 2784 target := &ret 2785 if err := gensupport.DecodeResponse(target, res); err != nil { 2786 return nil, err 2787 } 2788 return ret, nil 2789 } 2790 2791 type FormsWatchesRenewCall struct { 2792 s *Service 2793 formId string 2794 watchId string 2795 renewwatchrequest *RenewWatchRequest 2796 urlParams_ gensupport.URLParams 2797 ctx_ context.Context 2798 header_ http.Header 2799 } 2800 2801 // Renew: Renew an existing watch for seven days. The state of the watch after 2802 // renewal is `ACTIVE`, and the `expire_time` is seven days from the renewal. 2803 // Renewing a watch in an error state (e.g. `SUSPENDED`) succeeds if the error 2804 // is no longer present, but fail otherwise. After a watch has expired, 2805 // RenewWatch returns `NOT_FOUND`. 2806 // 2807 // - formId: The ID of the Form. 2808 // - watchId: The ID of the Watch to renew. 2809 func (r *FormsWatchesService) Renew(formId string, watchId string, renewwatchrequest *RenewWatchRequest) *FormsWatchesRenewCall { 2810 c := &FormsWatchesRenewCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2811 c.formId = formId 2812 c.watchId = watchId 2813 c.renewwatchrequest = renewwatchrequest 2814 return c 2815 } 2816 2817 // Fields allows partial responses to be retrieved. See 2818 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 2819 // details. 2820 func (c *FormsWatchesRenewCall) Fields(s ...googleapi.Field) *FormsWatchesRenewCall { 2821 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2822 return c 2823 } 2824 2825 // Context sets the context to be used in this call's Do method. 2826 func (c *FormsWatchesRenewCall) Context(ctx context.Context) *FormsWatchesRenewCall { 2827 c.ctx_ = ctx 2828 return c 2829 } 2830 2831 // Header returns a http.Header that can be modified by the caller to add 2832 // headers to the request. 2833 func (c *FormsWatchesRenewCall) Header() http.Header { 2834 if c.header_ == nil { 2835 c.header_ = make(http.Header) 2836 } 2837 return c.header_ 2838 } 2839 2840 func (c *FormsWatchesRenewCall) doRequest(alt string) (*http.Response, error) { 2841 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 2842 var body io.Reader = nil 2843 body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewwatchrequest) 2844 if err != nil { 2845 return nil, err 2846 } 2847 c.urlParams_.Set("alt", alt) 2848 c.urlParams_.Set("prettyPrint", "false") 2849 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/forms/{formId}/watches/{watchId}:renew") 2850 urls += "?" + c.urlParams_.Encode() 2851 req, err := http.NewRequest("POST", urls, body) 2852 if err != nil { 2853 return nil, err 2854 } 2855 req.Header = reqHeaders 2856 googleapi.Expand(req.URL, map[string]string{ 2857 "formId": c.formId, 2858 "watchId": c.watchId, 2859 }) 2860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2861 } 2862 2863 // Do executes the "forms.forms.watches.renew" call. 2864 // Any non-2xx status code is an error. Response headers are in either 2865 // *Watch.ServerResponse.Header or (if a response was returned at all) in 2866 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 2867 // whether the returned error was because http.StatusNotModified was returned. 2868 func (c *FormsWatchesRenewCall) Do(opts ...googleapi.CallOption) (*Watch, error) { 2869 gensupport.SetOptions(c.urlParams_, opts...) 2870 res, err := c.doRequest("json") 2871 if res != nil && res.StatusCode == http.StatusNotModified { 2872 if res.Body != nil { 2873 res.Body.Close() 2874 } 2875 return nil, gensupport.WrapError(&googleapi.Error{ 2876 Code: res.StatusCode, 2877 Header: res.Header, 2878 }) 2879 } 2880 if err != nil { 2881 return nil, err 2882 } 2883 defer googleapi.CloseBody(res) 2884 if err := googleapi.CheckResponse(res); err != nil { 2885 return nil, gensupport.WrapError(err) 2886 } 2887 ret := &Watch{ 2888 ServerResponse: googleapi.ServerResponse{ 2889 Header: res.Header, 2890 HTTPStatusCode: res.StatusCode, 2891 }, 2892 } 2893 target := &ret 2894 if err := gensupport.DecodeResponse(target, res); err != nil { 2895 return nil, err 2896 } 2897 return ret, nil 2898 } 2899