google-apis-forms_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1821 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module FormsV1
24
+
25
+ # The submitted answer for a question.
26
+ class Answer
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # All submitted files for a FileUpload question.
30
+ # Corresponds to the JSON property `fileUploadAnswers`
31
+ # @return [Google::Apis::FormsV1::FileUploadAnswers]
32
+ attr_accessor :file_upload_answers
33
+
34
+ # Grade information associated with a respondent's answer to a question.
35
+ # Corresponds to the JSON property `grade`
36
+ # @return [Google::Apis::FormsV1::Grade]
37
+ attr_accessor :grade
38
+
39
+ # Output only. The question's ID. See also Question.question_id.
40
+ # Corresponds to the JSON property `questionId`
41
+ # @return [String]
42
+ attr_accessor :question_id
43
+
44
+ # A question's answers as text.
45
+ # Corresponds to the JSON property `textAnswers`
46
+ # @return [Google::Apis::FormsV1::TextAnswers]
47
+ attr_accessor :text_answers
48
+
49
+ def initialize(**args)
50
+ update!(**args)
51
+ end
52
+
53
+ # Update properties of this object
54
+ def update!(**args)
55
+ @file_upload_answers = args[:file_upload_answers] if args.key?(:file_upload_answers)
56
+ @grade = args[:grade] if args.key?(:grade)
57
+ @question_id = args[:question_id] if args.key?(:question_id)
58
+ @text_answers = args[:text_answers] if args.key?(:text_answers)
59
+ end
60
+ end
61
+
62
+ # A batch of updates to perform on a form. All the specified updates are made or
63
+ # none of them are.
64
+ class BatchUpdateFormRequest
65
+ include Google::Apis::Core::Hashable
66
+
67
+ # Whether to return an updated version of the model in the response.
68
+ # Corresponds to the JSON property `includeFormInResponse`
69
+ # @return [Boolean]
70
+ attr_accessor :include_form_in_response
71
+ alias_method :include_form_in_response?, :include_form_in_response
72
+
73
+ # Required. The update requests of this batch.
74
+ # Corresponds to the JSON property `requests`
75
+ # @return [Array<Google::Apis::FormsV1::Request>]
76
+ attr_accessor :requests
77
+
78
+ # Provides control over how write requests are executed.
79
+ # Corresponds to the JSON property `writeControl`
80
+ # @return [Google::Apis::FormsV1::WriteControl]
81
+ attr_accessor :write_control
82
+
83
+ def initialize(**args)
84
+ update!(**args)
85
+ end
86
+
87
+ # Update properties of this object
88
+ def update!(**args)
89
+ @include_form_in_response = args[:include_form_in_response] if args.key?(:include_form_in_response)
90
+ @requests = args[:requests] if args.key?(:requests)
91
+ @write_control = args[:write_control] if args.key?(:write_control)
92
+ end
93
+ end
94
+
95
+ # Response to a BatchUpdateFormRequest.
96
+ class BatchUpdateFormResponse
97
+ include Google::Apis::Core::Hashable
98
+
99
+ # A Google Forms document. A form is created in Drive, and deleting a form or
100
+ # changing its access protections is done via the [Drive API](https://developers.
101
+ # google.com/drive/api/v3/about-sdk).
102
+ # Corresponds to the JSON property `form`
103
+ # @return [Google::Apis::FormsV1::Form]
104
+ attr_accessor :form
105
+
106
+ # The reply of the updates. This maps 1:1 with the update requests, although
107
+ # replies to some requests may be empty.
108
+ # Corresponds to the JSON property `replies`
109
+ # @return [Array<Google::Apis::FormsV1::Response>]
110
+ attr_accessor :replies
111
+
112
+ # Provides control over how write requests are executed.
113
+ # Corresponds to the JSON property `writeControl`
114
+ # @return [Google::Apis::FormsV1::WriteControl]
115
+ attr_accessor :write_control
116
+
117
+ def initialize(**args)
118
+ update!(**args)
119
+ end
120
+
121
+ # Update properties of this object
122
+ def update!(**args)
123
+ @form = args[:form] if args.key?(:form)
124
+ @replies = args[:replies] if args.key?(:replies)
125
+ @write_control = args[:write_control] if args.key?(:write_control)
126
+ end
127
+ end
128
+
129
+ # A radio/checkbox/dropdown question.
130
+ class ChoiceQuestion
131
+ include Google::Apis::Core::Hashable
132
+
133
+ # Required. List of options that a respondent must choose from.
134
+ # Corresponds to the JSON property `options`
135
+ # @return [Array<Google::Apis::FormsV1::Option>]
136
+ attr_accessor :options
137
+
138
+ # Whether the options should be displayed in random order for different
139
+ # instances of the quiz. This is often used to prevent cheating by respondents
140
+ # who might be looking at another respondent's screen, or to address bias in a
141
+ # survey that might be introduced by always putting the same options first or
142
+ # last.
143
+ # Corresponds to the JSON property `shuffle`
144
+ # @return [Boolean]
145
+ attr_accessor :shuffle
146
+ alias_method :shuffle?, :shuffle
147
+
148
+ # Required. The type of choice question.
149
+ # Corresponds to the JSON property `type`
150
+ # @return [String]
151
+ attr_accessor :type
152
+
153
+ def initialize(**args)
154
+ update!(**args)
155
+ end
156
+
157
+ # Update properties of this object
158
+ def update!(**args)
159
+ @options = args[:options] if args.key?(:options)
160
+ @shuffle = args[:shuffle] if args.key?(:shuffle)
161
+ @type = args[:type] if args.key?(:type)
162
+ end
163
+ end
164
+
165
+ # A Pub/Sub topic.
166
+ class CloudPubsubTopic
167
+ include Google::Apis::Core::Hashable
168
+
169
+ # Required. A fully qualified Pub/Sub topic name to publish the events to. This
170
+ # topic must be owned by the calling project and already exist in Pub/Sub.
171
+ # Corresponds to the JSON property `topicName`
172
+ # @return [String]
173
+ attr_accessor :topic_name
174
+
175
+ def initialize(**args)
176
+ update!(**args)
177
+ end
178
+
179
+ # Update properties of this object
180
+ def update!(**args)
181
+ @topic_name = args[:topic_name] if args.key?(:topic_name)
182
+ end
183
+ end
184
+
185
+ # A single correct answer for a question. For multiple-valued (`CHECKBOX`)
186
+ # questions, several `CorrectAnswer`s may be needed to represent a single
187
+ # correct response option.
188
+ class CorrectAnswer
189
+ include Google::Apis::Core::Hashable
190
+
191
+ # Required. The correct answer value. See the documentation for TextAnswer.value
192
+ # for details on how various value types are formatted.
193
+ # Corresponds to the JSON property `value`
194
+ # @return [String]
195
+ attr_accessor :value
196
+
197
+ def initialize(**args)
198
+ update!(**args)
199
+ end
200
+
201
+ # Update properties of this object
202
+ def update!(**args)
203
+ @value = args[:value] if args.key?(:value)
204
+ end
205
+ end
206
+
207
+ # The answer key for a question.
208
+ class CorrectAnswers
209
+ include Google::Apis::Core::Hashable
210
+
211
+ # A list of correct answers. A quiz response can be automatically graded based
212
+ # on these answers. For single-valued questions, a response is marked correct if
213
+ # it matches any value in this list (in other words, multiple correct answers
214
+ # are possible). For multiple-valued (`CHECKBOX`) questions, a response is
215
+ # marked correct if it contains exactly the values in this list.
216
+ # Corresponds to the JSON property `answers`
217
+ # @return [Array<Google::Apis::FormsV1::CorrectAnswer>]
218
+ attr_accessor :answers
219
+
220
+ def initialize(**args)
221
+ update!(**args)
222
+ end
223
+
224
+ # Update properties of this object
225
+ def update!(**args)
226
+ @answers = args[:answers] if args.key?(:answers)
227
+ end
228
+ end
229
+
230
+ # Create an item in a form.
231
+ class CreateItemRequest
232
+ include Google::Apis::Core::Hashable
233
+
234
+ # A single item of the form. `kind` defines which kind of item it is.
235
+ # Corresponds to the JSON property `item`
236
+ # @return [Google::Apis::FormsV1::Item]
237
+ attr_accessor :item
238
+
239
+ # A specific location in a form.
240
+ # Corresponds to the JSON property `location`
241
+ # @return [Google::Apis::FormsV1::Location]
242
+ attr_accessor :location
243
+
244
+ def initialize(**args)
245
+ update!(**args)
246
+ end
247
+
248
+ # Update properties of this object
249
+ def update!(**args)
250
+ @item = args[:item] if args.key?(:item)
251
+ @location = args[:location] if args.key?(:location)
252
+ end
253
+ end
254
+
255
+ # The result of creating an item.
256
+ class CreateItemResponse
257
+ include Google::Apis::Core::Hashable
258
+
259
+ # The ID of the created item.
260
+ # Corresponds to the JSON property `itemId`
261
+ # @return [String]
262
+ attr_accessor :item_id
263
+
264
+ # The ID of the question created as part of this item, for a question group it
265
+ # lists IDs of all the questions created for this item.
266
+ # Corresponds to the JSON property `questionId`
267
+ # @return [Array<String>]
268
+ attr_accessor :question_id
269
+
270
+ def initialize(**args)
271
+ update!(**args)
272
+ end
273
+
274
+ # Update properties of this object
275
+ def update!(**args)
276
+ @item_id = args[:item_id] if args.key?(:item_id)
277
+ @question_id = args[:question_id] if args.key?(:question_id)
278
+ end
279
+ end
280
+
281
+ # Create a new watch.
282
+ class CreateWatchRequest
283
+ include Google::Apis::Core::Hashable
284
+
285
+ # A watch for events for a form. When the designated event happens, a
286
+ # notification will be published to the specified target. The notification's
287
+ # attributes will include a `formId` key that has the ID of the watched form and
288
+ # an `eventType` key that has the string of the type. Messages are sent with at-
289
+ # least-once delivery and are only dropped in extraordinary circumstances.
290
+ # Typically all notifications should be reliably delivered within a few seconds;
291
+ # however, in some situations notifications may be delayed. A watch expires
292
+ # seven days after it is created unless it is renewed with watches.renew
293
+ # Corresponds to the JSON property `watch`
294
+ # @return [Google::Apis::FormsV1::Watch]
295
+ attr_accessor :watch
296
+
297
+ # The ID to use for the watch. If specified, the ID must not already be in use.
298
+ # If not specified, an ID is generated. This value should be 4-63 characters,
299
+ # and valid characters are /a-z-/.
300
+ # Corresponds to the JSON property `watchId`
301
+ # @return [String]
302
+ attr_accessor :watch_id
303
+
304
+ def initialize(**args)
305
+ update!(**args)
306
+ end
307
+
308
+ # Update properties of this object
309
+ def update!(**args)
310
+ @watch = args[:watch] if args.key?(:watch)
311
+ @watch_id = args[:watch_id] if args.key?(:watch_id)
312
+ end
313
+ end
314
+
315
+ # A date question. Date questions default to just month + day.
316
+ class DateQuestion
317
+ include Google::Apis::Core::Hashable
318
+
319
+ # Whether to include the time as part of the question.
320
+ # Corresponds to the JSON property `includeTime`
321
+ # @return [Boolean]
322
+ attr_accessor :include_time
323
+ alias_method :include_time?, :include_time
324
+
325
+ # Whether to include the year as part of the question.
326
+ # Corresponds to the JSON property `includeYear`
327
+ # @return [Boolean]
328
+ attr_accessor :include_year
329
+ alias_method :include_year?, :include_year
330
+
331
+ def initialize(**args)
332
+ update!(**args)
333
+ end
334
+
335
+ # Update properties of this object
336
+ def update!(**args)
337
+ @include_time = args[:include_time] if args.key?(:include_time)
338
+ @include_year = args[:include_year] if args.key?(:include_year)
339
+ end
340
+ end
341
+
342
+ # Delete an item in a form.
343
+ class DeleteItemRequest
344
+ include Google::Apis::Core::Hashable
345
+
346
+ # A specific location in a form.
347
+ # Corresponds to the JSON property `location`
348
+ # @return [Google::Apis::FormsV1::Location]
349
+ attr_accessor :location
350
+
351
+ def initialize(**args)
352
+ update!(**args)
353
+ end
354
+
355
+ # Update properties of this object
356
+ def update!(**args)
357
+ @location = args[:location] if args.key?(:location)
358
+ end
359
+ end
360
+
361
+ # A generic empty message that you can re-use to avoid defining duplicated empty
362
+ # messages in your APIs. A typical example is to use it as the request or the
363
+ # response type of an API method. For instance: service Foo ` rpc Bar(google.
364
+ # protobuf.Empty) returns (google.protobuf.Empty); ` The JSON representation for
365
+ # `Empty` is empty JSON object ````.
366
+ class Empty
367
+ include Google::Apis::Core::Hashable
368
+
369
+ def initialize(**args)
370
+ update!(**args)
371
+ end
372
+
373
+ # Update properties of this object
374
+ def update!(**args)
375
+ end
376
+ end
377
+
378
+ # Supplementary material to the feedback.
379
+ class ExtraMaterial
380
+ include Google::Apis::Core::Hashable
381
+
382
+ # Link for text.
383
+ # Corresponds to the JSON property `link`
384
+ # @return [Google::Apis::FormsV1::TextLink]
385
+ attr_accessor :link
386
+
387
+ # Link to a video.
388
+ # Corresponds to the JSON property `video`
389
+ # @return [Google::Apis::FormsV1::VideoLink]
390
+ attr_accessor :video
391
+
392
+ def initialize(**args)
393
+ update!(**args)
394
+ end
395
+
396
+ # Update properties of this object
397
+ def update!(**args)
398
+ @link = args[:link] if args.key?(:link)
399
+ @video = args[:video] if args.key?(:video)
400
+ end
401
+ end
402
+
403
+ # Feedback for a respondent about their response to a question.
404
+ class Feedback
405
+ include Google::Apis::Core::Hashable
406
+
407
+ # Additional information provided as part of the feedback, often used to point
408
+ # the respondent to more reading and resources.
409
+ # Corresponds to the JSON property `material`
410
+ # @return [Array<Google::Apis::FormsV1::ExtraMaterial>]
411
+ attr_accessor :material
412
+
413
+ # Required. The main text of the feedback.
414
+ # Corresponds to the JSON property `text`
415
+ # @return [String]
416
+ attr_accessor :text
417
+
418
+ def initialize(**args)
419
+ update!(**args)
420
+ end
421
+
422
+ # Update properties of this object
423
+ def update!(**args)
424
+ @material = args[:material] if args.key?(:material)
425
+ @text = args[:text] if args.key?(:text)
426
+ end
427
+ end
428
+
429
+ # Info for a single file submitted to a file upload question.
430
+ class FileUploadAnswer
431
+ include Google::Apis::Core::Hashable
432
+
433
+ # Output only. The ID of the Google Drive file.
434
+ # Corresponds to the JSON property `fileId`
435
+ # @return [String]
436
+ attr_accessor :file_id
437
+
438
+ # Output only. The file name, as stored in Google Drive on upload.
439
+ # Corresponds to the JSON property `fileName`
440
+ # @return [String]
441
+ attr_accessor :file_name
442
+
443
+ # Output only. The MIME type of the file, as stored in Google Drive on upload.
444
+ # Corresponds to the JSON property `mimeType`
445
+ # @return [String]
446
+ attr_accessor :mime_type
447
+
448
+ def initialize(**args)
449
+ update!(**args)
450
+ end
451
+
452
+ # Update properties of this object
453
+ def update!(**args)
454
+ @file_id = args[:file_id] if args.key?(:file_id)
455
+ @file_name = args[:file_name] if args.key?(:file_name)
456
+ @mime_type = args[:mime_type] if args.key?(:mime_type)
457
+ end
458
+ end
459
+
460
+ # All submitted files for a FileUpload question.
461
+ class FileUploadAnswers
462
+ include Google::Apis::Core::Hashable
463
+
464
+ # Output only. All submitted files for a FileUpload question.
465
+ # Corresponds to the JSON property `answers`
466
+ # @return [Array<Google::Apis::FormsV1::FileUploadAnswer>]
467
+ attr_accessor :answers
468
+
469
+ def initialize(**args)
470
+ update!(**args)
471
+ end
472
+
473
+ # Update properties of this object
474
+ def update!(**args)
475
+ @answers = args[:answers] if args.key?(:answers)
476
+ end
477
+ end
478
+
479
+ # A file upload question. The API currently does not support creating file
480
+ # upload questions.
481
+ class FileUploadQuestion
482
+ include Google::Apis::Core::Hashable
483
+
484
+ # Required. The ID of the Drive folder where uploaded files are stored.
485
+ # Corresponds to the JSON property `folderId`
486
+ # @return [String]
487
+ attr_accessor :folder_id
488
+
489
+ # Maximum number of bytes allowed for any single file uploaded to this question.
490
+ # Corresponds to the JSON property `maxFileSize`
491
+ # @return [Fixnum]
492
+ attr_accessor :max_file_size
493
+
494
+ # Maximum number of files that can be uploaded for this question in a single
495
+ # response.
496
+ # Corresponds to the JSON property `maxFiles`
497
+ # @return [Fixnum]
498
+ attr_accessor :max_files
499
+
500
+ # File types accepted by this question.
501
+ # Corresponds to the JSON property `types`
502
+ # @return [Array<String>]
503
+ attr_accessor :types
504
+
505
+ def initialize(**args)
506
+ update!(**args)
507
+ end
508
+
509
+ # Update properties of this object
510
+ def update!(**args)
511
+ @folder_id = args[:folder_id] if args.key?(:folder_id)
512
+ @max_file_size = args[:max_file_size] if args.key?(:max_file_size)
513
+ @max_files = args[:max_files] if args.key?(:max_files)
514
+ @types = args[:types] if args.key?(:types)
515
+ end
516
+ end
517
+
518
+ # A Google Forms document. A form is created in Drive, and deleting a form or
519
+ # changing its access protections is done via the [Drive API](https://developers.
520
+ # google.com/drive/api/v3/about-sdk).
521
+ class Form
522
+ include Google::Apis::Core::Hashable
523
+
524
+ # Output only. The form ID.
525
+ # Corresponds to the JSON property `formId`
526
+ # @return [String]
527
+ attr_accessor :form_id
528
+
529
+ # The general information for a form.
530
+ # Corresponds to the JSON property `info`
531
+ # @return [Google::Apis::FormsV1::Info]
532
+ attr_accessor :info
533
+
534
+ # Required. A list of the form's items, which can include section headers,
535
+ # questions, embedded media, etc.
536
+ # Corresponds to the JSON property `items`
537
+ # @return [Array<Google::Apis::FormsV1::Item>]
538
+ attr_accessor :items
539
+
540
+ # Output only. The ID of the linked Google Sheet which is accumulating responses
541
+ # from this Form (if such a Sheet exists).
542
+ # Corresponds to the JSON property `linkedSheetId`
543
+ # @return [String]
544
+ attr_accessor :linked_sheet_id
545
+
546
+ # Output only. The form URI to share with responders. This opens a page that
547
+ # allows the user to submit responses but not edit the questions.
548
+ # Corresponds to the JSON property `responderUri`
549
+ # @return [String]
550
+ attr_accessor :responder_uri
551
+
552
+ # Output only. The revision ID of the form. Used in the WriteControl in update
553
+ # requests to identify the revision on which the changes are based. The format
554
+ # of the revision ID may change over time, so it should be treated opaquely. A
555
+ # returned revision ID is only guaranteed to be valid for 24 hours after it has
556
+ # been returned and cannot be shared across users. If the revision ID is
557
+ # unchanged between calls, then the form has not changed. Conversely, a changed
558
+ # ID (for the same form and user) usually means the form has been updated;
559
+ # however, a changed ID can also be due to internal factors such as ID format
560
+ # changes.
561
+ # Corresponds to the JSON property `revisionId`
562
+ # @return [String]
563
+ attr_accessor :revision_id
564
+
565
+ # A form's settings.
566
+ # Corresponds to the JSON property `settings`
567
+ # @return [Google::Apis::FormsV1::FormSettings]
568
+ attr_accessor :settings
569
+
570
+ def initialize(**args)
571
+ update!(**args)
572
+ end
573
+
574
+ # Update properties of this object
575
+ def update!(**args)
576
+ @form_id = args[:form_id] if args.key?(:form_id)
577
+ @info = args[:info] if args.key?(:info)
578
+ @items = args[:items] if args.key?(:items)
579
+ @linked_sheet_id = args[:linked_sheet_id] if args.key?(:linked_sheet_id)
580
+ @responder_uri = args[:responder_uri] if args.key?(:responder_uri)
581
+ @revision_id = args[:revision_id] if args.key?(:revision_id)
582
+ @settings = args[:settings] if args.key?(:settings)
583
+ end
584
+ end
585
+
586
+ # A form response.
587
+ class FormResponse
588
+ include Google::Apis::Core::Hashable
589
+
590
+ # Output only. The actual answers to the questions, keyed by question_id.
591
+ # Corresponds to the JSON property `answers`
592
+ # @return [Hash<String,Google::Apis::FormsV1::Answer>]
593
+ attr_accessor :answers
594
+
595
+ # Output only. Timestamp for the first time the response was submitted.
596
+ # Corresponds to the JSON property `createTime`
597
+ # @return [String]
598
+ attr_accessor :create_time
599
+
600
+ # Output only. The form ID.
601
+ # Corresponds to the JSON property `formId`
602
+ # @return [String]
603
+ attr_accessor :form_id
604
+
605
+ # Output only. Timestamp for the most recent time the response was submitted.
606
+ # Does not track changes to grades.
607
+ # Corresponds to the JSON property `lastSubmittedTime`
608
+ # @return [String]
609
+ attr_accessor :last_submitted_time
610
+
611
+ # Output only. The email address (if collected) for the respondent.
612
+ # Corresponds to the JSON property `respondentEmail`
613
+ # @return [String]
614
+ attr_accessor :respondent_email
615
+
616
+ # Output only. The response ID.
617
+ # Corresponds to the JSON property `responseId`
618
+ # @return [String]
619
+ attr_accessor :response_id
620
+
621
+ # Output only. The total number of points the respondent received for their
622
+ # submission Only set if the form was a quiz and the response was graded. This
623
+ # includes points automatically awarded via autograding adjusted by any manual
624
+ # corrections entered by the form owner.
625
+ # Corresponds to the JSON property `totalScore`
626
+ # @return [Float]
627
+ attr_accessor :total_score
628
+
629
+ def initialize(**args)
630
+ update!(**args)
631
+ end
632
+
633
+ # Update properties of this object
634
+ def update!(**args)
635
+ @answers = args[:answers] if args.key?(:answers)
636
+ @create_time = args[:create_time] if args.key?(:create_time)
637
+ @form_id = args[:form_id] if args.key?(:form_id)
638
+ @last_submitted_time = args[:last_submitted_time] if args.key?(:last_submitted_time)
639
+ @respondent_email = args[:respondent_email] if args.key?(:respondent_email)
640
+ @response_id = args[:response_id] if args.key?(:response_id)
641
+ @total_score = args[:total_score] if args.key?(:total_score)
642
+ end
643
+ end
644
+
645
+ # A form's settings.
646
+ class FormSettings
647
+ include Google::Apis::Core::Hashable
648
+
649
+ # Settings related to quiz forms and grading. These must be updated with the
650
+ # UpdateSettingsRequest.
651
+ # Corresponds to the JSON property `quizSettings`
652
+ # @return [Google::Apis::FormsV1::QuizSettings]
653
+ attr_accessor :quiz_settings
654
+
655
+ def initialize(**args)
656
+ update!(**args)
657
+ end
658
+
659
+ # Update properties of this object
660
+ def update!(**args)
661
+ @quiz_settings = args[:quiz_settings] if args.key?(:quiz_settings)
662
+ end
663
+ end
664
+
665
+ # Grade information associated with a respondent's answer to a question.
666
+ class Grade
667
+ include Google::Apis::Core::Hashable
668
+
669
+ # Output only. Whether the question was answered correctly or not. A zero-point
670
+ # score is not enough to infer incorrectness, since a correctly answered
671
+ # question could be worth zero points.
672
+ # Corresponds to the JSON property `correct`
673
+ # @return [Boolean]
674
+ attr_accessor :correct
675
+ alias_method :correct?, :correct
676
+
677
+ # Feedback for a respondent about their response to a question.
678
+ # Corresponds to the JSON property `feedback`
679
+ # @return [Google::Apis::FormsV1::Feedback]
680
+ attr_accessor :feedback
681
+
682
+ # Output only. The numeric score awarded for the answer.
683
+ # Corresponds to the JSON property `score`
684
+ # @return [Float]
685
+ attr_accessor :score
686
+
687
+ def initialize(**args)
688
+ update!(**args)
689
+ end
690
+
691
+ # Update properties of this object
692
+ def update!(**args)
693
+ @correct = args[:correct] if args.key?(:correct)
694
+ @feedback = args[:feedback] if args.key?(:feedback)
695
+ @score = args[:score] if args.key?(:score)
696
+ end
697
+ end
698
+
699
+ # Grading for a single question
700
+ class Grading
701
+ include Google::Apis::Core::Hashable
702
+
703
+ # The answer key for a question.
704
+ # Corresponds to the JSON property `correctAnswers`
705
+ # @return [Google::Apis::FormsV1::CorrectAnswers]
706
+ attr_accessor :correct_answers
707
+
708
+ # Feedback for a respondent about their response to a question.
709
+ # Corresponds to the JSON property `generalFeedback`
710
+ # @return [Google::Apis::FormsV1::Feedback]
711
+ attr_accessor :general_feedback
712
+
713
+ # Required. The maximum number of points a respondent can automatically get for
714
+ # a correct answer. This must not be negative.
715
+ # Corresponds to the JSON property `pointValue`
716
+ # @return [Fixnum]
717
+ attr_accessor :point_value
718
+
719
+ # Feedback for a respondent about their response to a question.
720
+ # Corresponds to the JSON property `whenRight`
721
+ # @return [Google::Apis::FormsV1::Feedback]
722
+ attr_accessor :when_right
723
+
724
+ # Feedback for a respondent about their response to a question.
725
+ # Corresponds to the JSON property `whenWrong`
726
+ # @return [Google::Apis::FormsV1::Feedback]
727
+ attr_accessor :when_wrong
728
+
729
+ def initialize(**args)
730
+ update!(**args)
731
+ end
732
+
733
+ # Update properties of this object
734
+ def update!(**args)
735
+ @correct_answers = args[:correct_answers] if args.key?(:correct_answers)
736
+ @general_feedback = args[:general_feedback] if args.key?(:general_feedback)
737
+ @point_value = args[:point_value] if args.key?(:point_value)
738
+ @when_right = args[:when_right] if args.key?(:when_right)
739
+ @when_wrong = args[:when_wrong] if args.key?(:when_wrong)
740
+ end
741
+ end
742
+
743
+ # A grid of choices (radio or check boxes) with each row constituting a separate
744
+ # question. Each row has the same choices, which are shown as the columns.
745
+ class Grid
746
+ include Google::Apis::Core::Hashable
747
+
748
+ # A radio/checkbox/dropdown question.
749
+ # Corresponds to the JSON property `columns`
750
+ # @return [Google::Apis::FormsV1::ChoiceQuestion]
751
+ attr_accessor :columns
752
+
753
+ # If `true`, the questions are randomly ordered. In other words, the rows appear
754
+ # in a different order for every respondent.
755
+ # Corresponds to the JSON property `shuffleQuestions`
756
+ # @return [Boolean]
757
+ attr_accessor :shuffle_questions
758
+ alias_method :shuffle_questions?, :shuffle_questions
759
+
760
+ def initialize(**args)
761
+ update!(**args)
762
+ end
763
+
764
+ # Update properties of this object
765
+ def update!(**args)
766
+ @columns = args[:columns] if args.key?(:columns)
767
+ @shuffle_questions = args[:shuffle_questions] if args.key?(:shuffle_questions)
768
+ end
769
+ end
770
+
771
+ # Data representing an image.
772
+ class Image
773
+ include Google::Apis::Core::Hashable
774
+
775
+ # A description of the image that is shown on hover and read by screenreaders.
776
+ # Corresponds to the JSON property `altText`
777
+ # @return [String]
778
+ attr_accessor :alt_text
779
+
780
+ # Output only. A URI from which you can download the image; this is valid only
781
+ # for a limited time.
782
+ # Corresponds to the JSON property `contentUri`
783
+ # @return [String]
784
+ attr_accessor :content_uri
785
+
786
+ # Properties of the media.
787
+ # Corresponds to the JSON property `properties`
788
+ # @return [Google::Apis::FormsV1::MediaProperties]
789
+ attr_accessor :properties
790
+
791
+ # Input only. The source URI is the URI used to insert the image. The source URI
792
+ # can be empty when fetched.
793
+ # Corresponds to the JSON property `sourceUri`
794
+ # @return [String]
795
+ attr_accessor :source_uri
796
+
797
+ def initialize(**args)
798
+ update!(**args)
799
+ end
800
+
801
+ # Update properties of this object
802
+ def update!(**args)
803
+ @alt_text = args[:alt_text] if args.key?(:alt_text)
804
+ @content_uri = args[:content_uri] if args.key?(:content_uri)
805
+ @properties = args[:properties] if args.key?(:properties)
806
+ @source_uri = args[:source_uri] if args.key?(:source_uri)
807
+ end
808
+ end
809
+
810
+ # An item containing an image.
811
+ class ImageItem
812
+ include Google::Apis::Core::Hashable
813
+
814
+ # Data representing an image.
815
+ # Corresponds to the JSON property `image`
816
+ # @return [Google::Apis::FormsV1::Image]
817
+ attr_accessor :image
818
+
819
+ def initialize(**args)
820
+ update!(**args)
821
+ end
822
+
823
+ # Update properties of this object
824
+ def update!(**args)
825
+ @image = args[:image] if args.key?(:image)
826
+ end
827
+ end
828
+
829
+ # The general information for a form.
830
+ class Info
831
+ include Google::Apis::Core::Hashable
832
+
833
+ # The description of the form.
834
+ # Corresponds to the JSON property `description`
835
+ # @return [String]
836
+ attr_accessor :description
837
+
838
+ # Output only. The title of the document which is visible in Drive. If `Info.
839
+ # title` is empty, `document_title` may appear in its place in the Google Forms
840
+ # UI and be visible to responders. `document_title` can be set on create, but
841
+ # cannot be modified by a batchUpdate request. Please use the [Google Drive API](
842
+ # https://developers.google.com/drive/api/v3/reference/files/update) if you need
843
+ # to programmatically update `document_title`.
844
+ # Corresponds to the JSON property `documentTitle`
845
+ # @return [String]
846
+ attr_accessor :document_title
847
+
848
+ # Required. The title of the form which is visible to responders.
849
+ # Corresponds to the JSON property `title`
850
+ # @return [String]
851
+ attr_accessor :title
852
+
853
+ def initialize(**args)
854
+ update!(**args)
855
+ end
856
+
857
+ # Update properties of this object
858
+ def update!(**args)
859
+ @description = args[:description] if args.key?(:description)
860
+ @document_title = args[:document_title] if args.key?(:document_title)
861
+ @title = args[:title] if args.key?(:title)
862
+ end
863
+ end
864
+
865
+ # A single item of the form. `kind` defines which kind of item it is.
866
+ class Item
867
+ include Google::Apis::Core::Hashable
868
+
869
+ # The description of the item.
870
+ # Corresponds to the JSON property `description`
871
+ # @return [String]
872
+ attr_accessor :description
873
+
874
+ # An item containing an image.
875
+ # Corresponds to the JSON property `imageItem`
876
+ # @return [Google::Apis::FormsV1::ImageItem]
877
+ attr_accessor :image_item
878
+
879
+ # The item ID. On creation, it can be provided but the ID must not be already
880
+ # used in the form. If not provided, a new ID is assigned.
881
+ # Corresponds to the JSON property `itemId`
882
+ # @return [String]
883
+ attr_accessor :item_id
884
+
885
+ # A page break. The title and description of this item are shown at the top of
886
+ # the new page.
887
+ # Corresponds to the JSON property `pageBreakItem`
888
+ # @return [Google::Apis::FormsV1::PageBreakItem]
889
+ attr_accessor :page_break_item
890
+
891
+ # Defines a question that comprises multiple questions grouped together.
892
+ # Corresponds to the JSON property `questionGroupItem`
893
+ # @return [Google::Apis::FormsV1::QuestionGroupItem]
894
+ attr_accessor :question_group_item
895
+
896
+ # A form item containing a single question.
897
+ # Corresponds to the JSON property `questionItem`
898
+ # @return [Google::Apis::FormsV1::QuestionItem]
899
+ attr_accessor :question_item
900
+
901
+ # A text item.
902
+ # Corresponds to the JSON property `textItem`
903
+ # @return [Google::Apis::FormsV1::TextItem]
904
+ attr_accessor :text_item
905
+
906
+ # The title of the item.
907
+ # Corresponds to the JSON property `title`
908
+ # @return [String]
909
+ attr_accessor :title
910
+
911
+ # An item containing a video.
912
+ # Corresponds to the JSON property `videoItem`
913
+ # @return [Google::Apis::FormsV1::VideoItem]
914
+ attr_accessor :video_item
915
+
916
+ def initialize(**args)
917
+ update!(**args)
918
+ end
919
+
920
+ # Update properties of this object
921
+ def update!(**args)
922
+ @description = args[:description] if args.key?(:description)
923
+ @image_item = args[:image_item] if args.key?(:image_item)
924
+ @item_id = args[:item_id] if args.key?(:item_id)
925
+ @page_break_item = args[:page_break_item] if args.key?(:page_break_item)
926
+ @question_group_item = args[:question_group_item] if args.key?(:question_group_item)
927
+ @question_item = args[:question_item] if args.key?(:question_item)
928
+ @text_item = args[:text_item] if args.key?(:text_item)
929
+ @title = args[:title] if args.key?(:title)
930
+ @video_item = args[:video_item] if args.key?(:video_item)
931
+ end
932
+ end
933
+
934
+ # Response to a ListFormResponsesRequest.
935
+ class ListFormResponsesResponse
936
+ include Google::Apis::Core::Hashable
937
+
938
+ # If set, there are more responses. To get the next page of responses, provide
939
+ # this as `page_token` in a future request.
940
+ # Corresponds to the JSON property `nextPageToken`
941
+ # @return [String]
942
+ attr_accessor :next_page_token
943
+
944
+ # The returned responses.
945
+ # Corresponds to the JSON property `responses`
946
+ # @return [Array<Google::Apis::FormsV1::FormResponse>]
947
+ attr_accessor :responses
948
+
949
+ def initialize(**args)
950
+ update!(**args)
951
+ end
952
+
953
+ # Update properties of this object
954
+ def update!(**args)
955
+ @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
956
+ @responses = args[:responses] if args.key?(:responses)
957
+ end
958
+ end
959
+
960
+ # The response of a ListWatchesRequest.
961
+ class ListWatchesResponse
962
+ include Google::Apis::Core::Hashable
963
+
964
+ # The returned watches.
965
+ # Corresponds to the JSON property `watches`
966
+ # @return [Array<Google::Apis::FormsV1::Watch>]
967
+ attr_accessor :watches
968
+
969
+ def initialize(**args)
970
+ update!(**args)
971
+ end
972
+
973
+ # Update properties of this object
974
+ def update!(**args)
975
+ @watches = args[:watches] if args.key?(:watches)
976
+ end
977
+ end
978
+
979
+ # A specific location in a form.
980
+ class Location
981
+ include Google::Apis::Core::Hashable
982
+
983
+ # The index of an item in the form. This must be in the range [0..*N*), where *N*
984
+ # is the number of items in the form.
985
+ # Corresponds to the JSON property `index`
986
+ # @return [Fixnum]
987
+ attr_accessor :index
988
+
989
+ def initialize(**args)
990
+ update!(**args)
991
+ end
992
+
993
+ # Update properties of this object
994
+ def update!(**args)
995
+ @index = args[:index] if args.key?(:index)
996
+ end
997
+ end
998
+
999
+ # Properties of the media.
1000
+ class MediaProperties
1001
+ include Google::Apis::Core::Hashable
1002
+
1003
+ # Position of the media.
1004
+ # Corresponds to the JSON property `alignment`
1005
+ # @return [String]
1006
+ attr_accessor :alignment
1007
+
1008
+ # The width of the media in pixels. When the media is displayed, it is scaled to
1009
+ # the smaller of this value or the width of the displayed form. The original
1010
+ # aspect ratio of the media is preserved. If a width is not specified when the
1011
+ # media is added to the form, it is set to the width of the media source. Width
1012
+ # must be between 0 and 740, inclusive. Setting width to 0 or unspecified is
1013
+ # only permitted when updating the media source.
1014
+ # Corresponds to the JSON property `width`
1015
+ # @return [Fixnum]
1016
+ attr_accessor :width
1017
+
1018
+ def initialize(**args)
1019
+ update!(**args)
1020
+ end
1021
+
1022
+ # Update properties of this object
1023
+ def update!(**args)
1024
+ @alignment = args[:alignment] if args.key?(:alignment)
1025
+ @width = args[:width] if args.key?(:width)
1026
+ end
1027
+ end
1028
+
1029
+ # Move an item in a form.
1030
+ class MoveItemRequest
1031
+ include Google::Apis::Core::Hashable
1032
+
1033
+ # A specific location in a form.
1034
+ # Corresponds to the JSON property `newLocation`
1035
+ # @return [Google::Apis::FormsV1::Location]
1036
+ attr_accessor :new_location
1037
+
1038
+ # A specific location in a form.
1039
+ # Corresponds to the JSON property `originalLocation`
1040
+ # @return [Google::Apis::FormsV1::Location]
1041
+ attr_accessor :original_location
1042
+
1043
+ def initialize(**args)
1044
+ update!(**args)
1045
+ end
1046
+
1047
+ # Update properties of this object
1048
+ def update!(**args)
1049
+ @new_location = args[:new_location] if args.key?(:new_location)
1050
+ @original_location = args[:original_location] if args.key?(:original_location)
1051
+ end
1052
+ end
1053
+
1054
+ # An option for a Choice question.
1055
+ class Option
1056
+ include Google::Apis::Core::Hashable
1057
+
1058
+ # Section navigation type.
1059
+ # Corresponds to the JSON property `goToAction`
1060
+ # @return [String]
1061
+ attr_accessor :go_to_action
1062
+
1063
+ # Item ID of section header to go to.
1064
+ # Corresponds to the JSON property `goToSectionId`
1065
+ # @return [String]
1066
+ attr_accessor :go_to_section_id
1067
+
1068
+ # Data representing an image.
1069
+ # Corresponds to the JSON property `image`
1070
+ # @return [Google::Apis::FormsV1::Image]
1071
+ attr_accessor :image
1072
+
1073
+ # Whether the option is "other". Currently only applies to `RADIO` and `CHECKBOX`
1074
+ # choice types, but is not allowed in a QuestionGroupItem.
1075
+ # Corresponds to the JSON property `isOther`
1076
+ # @return [Boolean]
1077
+ attr_accessor :is_other
1078
+ alias_method :is_other?, :is_other
1079
+
1080
+ # Required. The choice as presented to the user.
1081
+ # Corresponds to the JSON property `value`
1082
+ # @return [String]
1083
+ attr_accessor :value
1084
+
1085
+ def initialize(**args)
1086
+ update!(**args)
1087
+ end
1088
+
1089
+ # Update properties of this object
1090
+ def update!(**args)
1091
+ @go_to_action = args[:go_to_action] if args.key?(:go_to_action)
1092
+ @go_to_section_id = args[:go_to_section_id] if args.key?(:go_to_section_id)
1093
+ @image = args[:image] if args.key?(:image)
1094
+ @is_other = args[:is_other] if args.key?(:is_other)
1095
+ @value = args[:value] if args.key?(:value)
1096
+ end
1097
+ end
1098
+
1099
+ # A page break. The title and description of this item are shown at the top of
1100
+ # the new page.
1101
+ class PageBreakItem
1102
+ include Google::Apis::Core::Hashable
1103
+
1104
+ def initialize(**args)
1105
+ update!(**args)
1106
+ end
1107
+
1108
+ # Update properties of this object
1109
+ def update!(**args)
1110
+ end
1111
+ end
1112
+
1113
+ # Any question. The specific type of question is known by its `kind`.
1114
+ class Question
1115
+ include Google::Apis::Core::Hashable
1116
+
1117
+ # A radio/checkbox/dropdown question.
1118
+ # Corresponds to the JSON property `choiceQuestion`
1119
+ # @return [Google::Apis::FormsV1::ChoiceQuestion]
1120
+ attr_accessor :choice_question
1121
+
1122
+ # A date question. Date questions default to just month + day.
1123
+ # Corresponds to the JSON property `dateQuestion`
1124
+ # @return [Google::Apis::FormsV1::DateQuestion]
1125
+ attr_accessor :date_question
1126
+
1127
+ # A file upload question. The API currently does not support creating file
1128
+ # upload questions.
1129
+ # Corresponds to the JSON property `fileUploadQuestion`
1130
+ # @return [Google::Apis::FormsV1::FileUploadQuestion]
1131
+ attr_accessor :file_upload_question
1132
+
1133
+ # Grading for a single question
1134
+ # Corresponds to the JSON property `grading`
1135
+ # @return [Google::Apis::FormsV1::Grading]
1136
+ attr_accessor :grading
1137
+
1138
+ # Read only. The question ID. On creation, it can be provided but the ID must
1139
+ # not be already used in the form. If not provided, a new ID is assigned.
1140
+ # Corresponds to the JSON property `questionId`
1141
+ # @return [String]
1142
+ attr_accessor :question_id
1143
+
1144
+ # Whether the question must be answered in order for a respondent to submit
1145
+ # their response.
1146
+ # Corresponds to the JSON property `required`
1147
+ # @return [Boolean]
1148
+ attr_accessor :required
1149
+ alias_method :required?, :required
1150
+
1151
+ # Configuration for a question that is part of a question group.
1152
+ # Corresponds to the JSON property `rowQuestion`
1153
+ # @return [Google::Apis::FormsV1::RowQuestion]
1154
+ attr_accessor :row_question
1155
+
1156
+ # A scale question. The user has a range of numeric values to choose from.
1157
+ # Corresponds to the JSON property `scaleQuestion`
1158
+ # @return [Google::Apis::FormsV1::ScaleQuestion]
1159
+ attr_accessor :scale_question
1160
+
1161
+ # A text-based question.
1162
+ # Corresponds to the JSON property `textQuestion`
1163
+ # @return [Google::Apis::FormsV1::TextQuestion]
1164
+ attr_accessor :text_question
1165
+
1166
+ # A time question.
1167
+ # Corresponds to the JSON property `timeQuestion`
1168
+ # @return [Google::Apis::FormsV1::TimeQuestion]
1169
+ attr_accessor :time_question
1170
+
1171
+ def initialize(**args)
1172
+ update!(**args)
1173
+ end
1174
+
1175
+ # Update properties of this object
1176
+ def update!(**args)
1177
+ @choice_question = args[:choice_question] if args.key?(:choice_question)
1178
+ @date_question = args[:date_question] if args.key?(:date_question)
1179
+ @file_upload_question = args[:file_upload_question] if args.key?(:file_upload_question)
1180
+ @grading = args[:grading] if args.key?(:grading)
1181
+ @question_id = args[:question_id] if args.key?(:question_id)
1182
+ @required = args[:required] if args.key?(:required)
1183
+ @row_question = args[:row_question] if args.key?(:row_question)
1184
+ @scale_question = args[:scale_question] if args.key?(:scale_question)
1185
+ @text_question = args[:text_question] if args.key?(:text_question)
1186
+ @time_question = args[:time_question] if args.key?(:time_question)
1187
+ end
1188
+ end
1189
+
1190
+ # Defines a question that comprises multiple questions grouped together.
1191
+ class QuestionGroupItem
1192
+ include Google::Apis::Core::Hashable
1193
+
1194
+ # A grid of choices (radio or check boxes) with each row constituting a separate
1195
+ # question. Each row has the same choices, which are shown as the columns.
1196
+ # Corresponds to the JSON property `grid`
1197
+ # @return [Google::Apis::FormsV1::Grid]
1198
+ attr_accessor :grid
1199
+
1200
+ # Data representing an image.
1201
+ # Corresponds to the JSON property `image`
1202
+ # @return [Google::Apis::FormsV1::Image]
1203
+ attr_accessor :image
1204
+
1205
+ # Required. A list of questions that belong in this question group. A question
1206
+ # must only belong to one group. The `kind` of the group may affect what types
1207
+ # of questions are allowed.
1208
+ # Corresponds to the JSON property `questions`
1209
+ # @return [Array<Google::Apis::FormsV1::Question>]
1210
+ attr_accessor :questions
1211
+
1212
+ def initialize(**args)
1213
+ update!(**args)
1214
+ end
1215
+
1216
+ # Update properties of this object
1217
+ def update!(**args)
1218
+ @grid = args[:grid] if args.key?(:grid)
1219
+ @image = args[:image] if args.key?(:image)
1220
+ @questions = args[:questions] if args.key?(:questions)
1221
+ end
1222
+ end
1223
+
1224
+ # A form item containing a single question.
1225
+ class QuestionItem
1226
+ include Google::Apis::Core::Hashable
1227
+
1228
+ # Data representing an image.
1229
+ # Corresponds to the JSON property `image`
1230
+ # @return [Google::Apis::FormsV1::Image]
1231
+ attr_accessor :image
1232
+
1233
+ # Any question. The specific type of question is known by its `kind`.
1234
+ # Corresponds to the JSON property `question`
1235
+ # @return [Google::Apis::FormsV1::Question]
1236
+ attr_accessor :question
1237
+
1238
+ def initialize(**args)
1239
+ update!(**args)
1240
+ end
1241
+
1242
+ # Update properties of this object
1243
+ def update!(**args)
1244
+ @image = args[:image] if args.key?(:image)
1245
+ @question = args[:question] if args.key?(:question)
1246
+ end
1247
+ end
1248
+
1249
+ # Settings related to quiz forms and grading. These must be updated with the
1250
+ # UpdateSettingsRequest.
1251
+ class QuizSettings
1252
+ include Google::Apis::Core::Hashable
1253
+
1254
+ # Whether this form is a quiz or not. When true, responses are graded based on
1255
+ # question Grading. Upon setting to false, all question Grading is deleted.
1256
+ # Corresponds to the JSON property `isQuiz`
1257
+ # @return [Boolean]
1258
+ attr_accessor :is_quiz
1259
+ alias_method :is_quiz?, :is_quiz
1260
+
1261
+ def initialize(**args)
1262
+ update!(**args)
1263
+ end
1264
+
1265
+ # Update properties of this object
1266
+ def update!(**args)
1267
+ @is_quiz = args[:is_quiz] if args.key?(:is_quiz)
1268
+ end
1269
+ end
1270
+
1271
+ # Renew an existing Watch for seven days.
1272
+ class RenewWatchRequest
1273
+ include Google::Apis::Core::Hashable
1274
+
1275
+ def initialize(**args)
1276
+ update!(**args)
1277
+ end
1278
+
1279
+ # Update properties of this object
1280
+ def update!(**args)
1281
+ end
1282
+ end
1283
+
1284
+ # The kinds of update requests that can be made.
1285
+ class Request
1286
+ include Google::Apis::Core::Hashable
1287
+
1288
+ # Create an item in a form.
1289
+ # Corresponds to the JSON property `createItem`
1290
+ # @return [Google::Apis::FormsV1::CreateItemRequest]
1291
+ attr_accessor :create_item
1292
+
1293
+ # Delete an item in a form.
1294
+ # Corresponds to the JSON property `deleteItem`
1295
+ # @return [Google::Apis::FormsV1::DeleteItemRequest]
1296
+ attr_accessor :delete_item
1297
+
1298
+ # Move an item in a form.
1299
+ # Corresponds to the JSON property `moveItem`
1300
+ # @return [Google::Apis::FormsV1::MoveItemRequest]
1301
+ attr_accessor :move_item
1302
+
1303
+ # Update Form's Info.
1304
+ # Corresponds to the JSON property `updateFormInfo`
1305
+ # @return [Google::Apis::FormsV1::UpdateFormInfoRequest]
1306
+ attr_accessor :update_form_info
1307
+
1308
+ # Update an item in a form.
1309
+ # Corresponds to the JSON property `updateItem`
1310
+ # @return [Google::Apis::FormsV1::UpdateItemRequest]
1311
+ attr_accessor :update_item
1312
+
1313
+ # Update Form's FormSettings.
1314
+ # Corresponds to the JSON property `updateSettings`
1315
+ # @return [Google::Apis::FormsV1::UpdateSettingsRequest]
1316
+ attr_accessor :update_settings
1317
+
1318
+ def initialize(**args)
1319
+ update!(**args)
1320
+ end
1321
+
1322
+ # Update properties of this object
1323
+ def update!(**args)
1324
+ @create_item = args[:create_item] if args.key?(:create_item)
1325
+ @delete_item = args[:delete_item] if args.key?(:delete_item)
1326
+ @move_item = args[:move_item] if args.key?(:move_item)
1327
+ @update_form_info = args[:update_form_info] if args.key?(:update_form_info)
1328
+ @update_item = args[:update_item] if args.key?(:update_item)
1329
+ @update_settings = args[:update_settings] if args.key?(:update_settings)
1330
+ end
1331
+ end
1332
+
1333
+ # A single response from an update.
1334
+ class Response
1335
+ include Google::Apis::Core::Hashable
1336
+
1337
+ # The result of creating an item.
1338
+ # Corresponds to the JSON property `createItem`
1339
+ # @return [Google::Apis::FormsV1::CreateItemResponse]
1340
+ attr_accessor :create_item
1341
+
1342
+ def initialize(**args)
1343
+ update!(**args)
1344
+ end
1345
+
1346
+ # Update properties of this object
1347
+ def update!(**args)
1348
+ @create_item = args[:create_item] if args.key?(:create_item)
1349
+ end
1350
+ end
1351
+
1352
+ # Configuration for a question that is part of a question group.
1353
+ class RowQuestion
1354
+ include Google::Apis::Core::Hashable
1355
+
1356
+ # Required. The title for the single row in the QuestionGroupItem.
1357
+ # Corresponds to the JSON property `title`
1358
+ # @return [String]
1359
+ attr_accessor :title
1360
+
1361
+ def initialize(**args)
1362
+ update!(**args)
1363
+ end
1364
+
1365
+ # Update properties of this object
1366
+ def update!(**args)
1367
+ @title = args[:title] if args.key?(:title)
1368
+ end
1369
+ end
1370
+
1371
+ # A scale question. The user has a range of numeric values to choose from.
1372
+ class ScaleQuestion
1373
+ include Google::Apis::Core::Hashable
1374
+
1375
+ # Required. The highest possible value for the scale.
1376
+ # Corresponds to the JSON property `high`
1377
+ # @return [Fixnum]
1378
+ attr_accessor :high
1379
+
1380
+ # The label to display describing the highest point on the scale.
1381
+ # Corresponds to the JSON property `highLabel`
1382
+ # @return [String]
1383
+ attr_accessor :high_label
1384
+
1385
+ # Required. The lowest possible value for the scale.
1386
+ # Corresponds to the JSON property `low`
1387
+ # @return [Fixnum]
1388
+ attr_accessor :low
1389
+
1390
+ # The label to display describing the lowest point on the scale.
1391
+ # Corresponds to the JSON property `lowLabel`
1392
+ # @return [String]
1393
+ attr_accessor :low_label
1394
+
1395
+ def initialize(**args)
1396
+ update!(**args)
1397
+ end
1398
+
1399
+ # Update properties of this object
1400
+ def update!(**args)
1401
+ @high = args[:high] if args.key?(:high)
1402
+ @high_label = args[:high_label] if args.key?(:high_label)
1403
+ @low = args[:low] if args.key?(:low)
1404
+ @low_label = args[:low_label] if args.key?(:low_label)
1405
+ end
1406
+ end
1407
+
1408
+ # An answer to a question represented as text.
1409
+ class TextAnswer
1410
+ include Google::Apis::Core::Hashable
1411
+
1412
+ # Output only. The answer value. Formatting used for different kinds of question:
1413
+ # * ChoiceQuestion * `RADIO` or `DROP_DOWN`: A single string corresponding to
1414
+ # the option that was selected. * `CHECKBOX`: Multiple strings corresponding to
1415
+ # each option that was selected. * TextQuestion: The text that the user entered.
1416
+ # * ScaleQuestion: A string containing the number that was selected. *
1417
+ # DateQuestion * Without time or year: MM-DD e.g. "05-19" * With year: YYYY-MM-
1418
+ # DD e.g. "1986-05-19" * With time: MM-DD HH:MM e.g. "05-19 14:51" * With year
1419
+ # and time: YYYY-MM-DD HH:MM e.g. "1986-05-19 14:51" * TimeQuestion: String with
1420
+ # time or duration in HH:MM format e.g. "14:51" * RowQuestion within
1421
+ # QuestionGroupItem: The answer for each row of a QuestionGroupItem is
1422
+ # represented as a separate Answer. Each will contain one string for `RADIO`-
1423
+ # type choices or multiple strings for `CHECKBOX` choices.
1424
+ # Corresponds to the JSON property `value`
1425
+ # @return [String]
1426
+ attr_accessor :value
1427
+
1428
+ def initialize(**args)
1429
+ update!(**args)
1430
+ end
1431
+
1432
+ # Update properties of this object
1433
+ def update!(**args)
1434
+ @value = args[:value] if args.key?(:value)
1435
+ end
1436
+ end
1437
+
1438
+ # A question's answers as text.
1439
+ class TextAnswers
1440
+ include Google::Apis::Core::Hashable
1441
+
1442
+ # Output only. Answers to a question. For multiple-value ChoiceQuestions, each
1443
+ # answer is a separate value.
1444
+ # Corresponds to the JSON property `answers`
1445
+ # @return [Array<Google::Apis::FormsV1::TextAnswer>]
1446
+ attr_accessor :answers
1447
+
1448
+ def initialize(**args)
1449
+ update!(**args)
1450
+ end
1451
+
1452
+ # Update properties of this object
1453
+ def update!(**args)
1454
+ @answers = args[:answers] if args.key?(:answers)
1455
+ end
1456
+ end
1457
+
1458
+ # A text item.
1459
+ class TextItem
1460
+ include Google::Apis::Core::Hashable
1461
+
1462
+ def initialize(**args)
1463
+ update!(**args)
1464
+ end
1465
+
1466
+ # Update properties of this object
1467
+ def update!(**args)
1468
+ end
1469
+ end
1470
+
1471
+ # Link for text.
1472
+ class TextLink
1473
+ include Google::Apis::Core::Hashable
1474
+
1475
+ # Required. Display text for the URI.
1476
+ # Corresponds to the JSON property `displayText`
1477
+ # @return [String]
1478
+ attr_accessor :display_text
1479
+
1480
+ # Required. The URI.
1481
+ # Corresponds to the JSON property `uri`
1482
+ # @return [String]
1483
+ attr_accessor :uri
1484
+
1485
+ def initialize(**args)
1486
+ update!(**args)
1487
+ end
1488
+
1489
+ # Update properties of this object
1490
+ def update!(**args)
1491
+ @display_text = args[:display_text] if args.key?(:display_text)
1492
+ @uri = args[:uri] if args.key?(:uri)
1493
+ end
1494
+ end
1495
+
1496
+ # A text-based question.
1497
+ class TextQuestion
1498
+ include Google::Apis::Core::Hashable
1499
+
1500
+ # Whether the question is a paragraph question or not. If not, the question is a
1501
+ # short text question.
1502
+ # Corresponds to the JSON property `paragraph`
1503
+ # @return [Boolean]
1504
+ attr_accessor :paragraph
1505
+ alias_method :paragraph?, :paragraph
1506
+
1507
+ def initialize(**args)
1508
+ update!(**args)
1509
+ end
1510
+
1511
+ # Update properties of this object
1512
+ def update!(**args)
1513
+ @paragraph = args[:paragraph] if args.key?(:paragraph)
1514
+ end
1515
+ end
1516
+
1517
+ # A time question.
1518
+ class TimeQuestion
1519
+ include Google::Apis::Core::Hashable
1520
+
1521
+ # `true` if the question is about an elapsed time. Otherwise it is about a time
1522
+ # of day.
1523
+ # Corresponds to the JSON property `duration`
1524
+ # @return [Boolean]
1525
+ attr_accessor :duration
1526
+ alias_method :duration?, :duration
1527
+
1528
+ def initialize(**args)
1529
+ update!(**args)
1530
+ end
1531
+
1532
+ # Update properties of this object
1533
+ def update!(**args)
1534
+ @duration = args[:duration] if args.key?(:duration)
1535
+ end
1536
+ end
1537
+
1538
+ # Update Form's Info.
1539
+ class UpdateFormInfoRequest
1540
+ include Google::Apis::Core::Hashable
1541
+
1542
+ # The general information for a form.
1543
+ # Corresponds to the JSON property `info`
1544
+ # @return [Google::Apis::FormsV1::Info]
1545
+ attr_accessor :info
1546
+
1547
+ # Required. Only values named in this mask are changed. At least one field must
1548
+ # be specified. The root `info` is implied and should not be specified. A single
1549
+ # `"*"` can be used as short-hand for updating every field.
1550
+ # Corresponds to the JSON property `updateMask`
1551
+ # @return [String]
1552
+ attr_accessor :update_mask
1553
+
1554
+ def initialize(**args)
1555
+ update!(**args)
1556
+ end
1557
+
1558
+ # Update properties of this object
1559
+ def update!(**args)
1560
+ @info = args[:info] if args.key?(:info)
1561
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
1562
+ end
1563
+ end
1564
+
1565
+ # Update an item in a form.
1566
+ class UpdateItemRequest
1567
+ include Google::Apis::Core::Hashable
1568
+
1569
+ # A single item of the form. `kind` defines which kind of item it is.
1570
+ # Corresponds to the JSON property `item`
1571
+ # @return [Google::Apis::FormsV1::Item]
1572
+ attr_accessor :item
1573
+
1574
+ # A specific location in a form.
1575
+ # Corresponds to the JSON property `location`
1576
+ # @return [Google::Apis::FormsV1::Location]
1577
+ attr_accessor :location
1578
+
1579
+ # Required. Only values named in this mask are changed.
1580
+ # Corresponds to the JSON property `updateMask`
1581
+ # @return [String]
1582
+ attr_accessor :update_mask
1583
+
1584
+ def initialize(**args)
1585
+ update!(**args)
1586
+ end
1587
+
1588
+ # Update properties of this object
1589
+ def update!(**args)
1590
+ @item = args[:item] if args.key?(:item)
1591
+ @location = args[:location] if args.key?(:location)
1592
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
1593
+ end
1594
+ end
1595
+
1596
+ # Update Form's FormSettings.
1597
+ class UpdateSettingsRequest
1598
+ include Google::Apis::Core::Hashable
1599
+
1600
+ # A form's settings.
1601
+ # Corresponds to the JSON property `settings`
1602
+ # @return [Google::Apis::FormsV1::FormSettings]
1603
+ attr_accessor :settings
1604
+
1605
+ # Required. Only values named in this mask are changed. At least one field must
1606
+ # be specified. The root `settings` is implied and should not be specified. A
1607
+ # single `"*"` can be used as short-hand for updating every field.
1608
+ # Corresponds to the JSON property `updateMask`
1609
+ # @return [String]
1610
+ attr_accessor :update_mask
1611
+
1612
+ def initialize(**args)
1613
+ update!(**args)
1614
+ end
1615
+
1616
+ # Update properties of this object
1617
+ def update!(**args)
1618
+ @settings = args[:settings] if args.key?(:settings)
1619
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
1620
+ end
1621
+ end
1622
+
1623
+ # Data representing a video.
1624
+ class Video
1625
+ include Google::Apis::Core::Hashable
1626
+
1627
+ # Properties of the media.
1628
+ # Corresponds to the JSON property `properties`
1629
+ # @return [Google::Apis::FormsV1::MediaProperties]
1630
+ attr_accessor :properties
1631
+
1632
+ # Required. A YouTube URI.
1633
+ # Corresponds to the JSON property `youtubeUri`
1634
+ # @return [String]
1635
+ attr_accessor :youtube_uri
1636
+
1637
+ def initialize(**args)
1638
+ update!(**args)
1639
+ end
1640
+
1641
+ # Update properties of this object
1642
+ def update!(**args)
1643
+ @properties = args[:properties] if args.key?(:properties)
1644
+ @youtube_uri = args[:youtube_uri] if args.key?(:youtube_uri)
1645
+ end
1646
+ end
1647
+
1648
+ # An item containing a video.
1649
+ class VideoItem
1650
+ include Google::Apis::Core::Hashable
1651
+
1652
+ # The text displayed below the video.
1653
+ # Corresponds to the JSON property `caption`
1654
+ # @return [String]
1655
+ attr_accessor :caption
1656
+
1657
+ # Data representing a video.
1658
+ # Corresponds to the JSON property `video`
1659
+ # @return [Google::Apis::FormsV1::Video]
1660
+ attr_accessor :video
1661
+
1662
+ def initialize(**args)
1663
+ update!(**args)
1664
+ end
1665
+
1666
+ # Update properties of this object
1667
+ def update!(**args)
1668
+ @caption = args[:caption] if args.key?(:caption)
1669
+ @video = args[:video] if args.key?(:video)
1670
+ end
1671
+ end
1672
+
1673
+ # Link to a video.
1674
+ class VideoLink
1675
+ include Google::Apis::Core::Hashable
1676
+
1677
+ # Required. The display text for the link.
1678
+ # Corresponds to the JSON property `displayText`
1679
+ # @return [String]
1680
+ attr_accessor :display_text
1681
+
1682
+ # The URI of a YouTube video.
1683
+ # Corresponds to the JSON property `youtubeUri`
1684
+ # @return [String]
1685
+ attr_accessor :youtube_uri
1686
+
1687
+ def initialize(**args)
1688
+ update!(**args)
1689
+ end
1690
+
1691
+ # Update properties of this object
1692
+ def update!(**args)
1693
+ @display_text = args[:display_text] if args.key?(:display_text)
1694
+ @youtube_uri = args[:youtube_uri] if args.key?(:youtube_uri)
1695
+ end
1696
+ end
1697
+
1698
+ # A watch for events for a form. When the designated event happens, a
1699
+ # notification will be published to the specified target. The notification's
1700
+ # attributes will include a `formId` key that has the ID of the watched form and
1701
+ # an `eventType` key that has the string of the type. Messages are sent with at-
1702
+ # least-once delivery and are only dropped in extraordinary circumstances.
1703
+ # Typically all notifications should be reliably delivered within a few seconds;
1704
+ # however, in some situations notifications may be delayed. A watch expires
1705
+ # seven days after it is created unless it is renewed with watches.renew
1706
+ class Watch
1707
+ include Google::Apis::Core::Hashable
1708
+
1709
+ # Output only. Timestamp of when this was created.
1710
+ # Corresponds to the JSON property `createTime`
1711
+ # @return [String]
1712
+ attr_accessor :create_time
1713
+
1714
+ # Output only. The most recent error type for an attempted delivery. To begin
1715
+ # watching the form again a call can be made to watches.renew which also clears
1716
+ # this error information.
1717
+ # Corresponds to the JSON property `errorType`
1718
+ # @return [String]
1719
+ attr_accessor :error_type
1720
+
1721
+ # Required. Which event type to watch for.
1722
+ # Corresponds to the JSON property `eventType`
1723
+ # @return [String]
1724
+ attr_accessor :event_type
1725
+
1726
+ # Output only. Timestamp for when this will expire. Each watches.renew call
1727
+ # resets this to seven days in the future.
1728
+ # Corresponds to the JSON property `expireTime`
1729
+ # @return [String]
1730
+ attr_accessor :expire_time
1731
+
1732
+ # Output only. The ID of this watch. See notes on CreateWatchRequest.watch_id.
1733
+ # Corresponds to the JSON property `id`
1734
+ # @return [String]
1735
+ attr_accessor :id
1736
+
1737
+ # Output only. The current state of the watch. Additional details about
1738
+ # suspended watches can be found by checking the `error_type`.
1739
+ # Corresponds to the JSON property `state`
1740
+ # @return [String]
1741
+ attr_accessor :state
1742
+
1743
+ # The target for notification delivery.
1744
+ # Corresponds to the JSON property `target`
1745
+ # @return [Google::Apis::FormsV1::WatchTarget]
1746
+ attr_accessor :target
1747
+
1748
+ def initialize(**args)
1749
+ update!(**args)
1750
+ end
1751
+
1752
+ # Update properties of this object
1753
+ def update!(**args)
1754
+ @create_time = args[:create_time] if args.key?(:create_time)
1755
+ @error_type = args[:error_type] if args.key?(:error_type)
1756
+ @event_type = args[:event_type] if args.key?(:event_type)
1757
+ @expire_time = args[:expire_time] if args.key?(:expire_time)
1758
+ @id = args[:id] if args.key?(:id)
1759
+ @state = args[:state] if args.key?(:state)
1760
+ @target = args[:target] if args.key?(:target)
1761
+ end
1762
+ end
1763
+
1764
+ # The target for notification delivery.
1765
+ class WatchTarget
1766
+ include Google::Apis::Core::Hashable
1767
+
1768
+ # A Pub/Sub topic.
1769
+ # Corresponds to the JSON property `topic`
1770
+ # @return [Google::Apis::FormsV1::CloudPubsubTopic]
1771
+ attr_accessor :topic
1772
+
1773
+ def initialize(**args)
1774
+ update!(**args)
1775
+ end
1776
+
1777
+ # Update properties of this object
1778
+ def update!(**args)
1779
+ @topic = args[:topic] if args.key?(:topic)
1780
+ end
1781
+ end
1782
+
1783
+ # Provides control over how write requests are executed.
1784
+ class WriteControl
1785
+ include Google::Apis::Core::Hashable
1786
+
1787
+ # The revision ID of the form that the write request is applied to. If this is
1788
+ # not the latest revision of the form, the request is not processed and returns
1789
+ # a 400 bad request error.
1790
+ # Corresponds to the JSON property `requiredRevisionId`
1791
+ # @return [String]
1792
+ attr_accessor :required_revision_id
1793
+
1794
+ # The target revision ID of the form that the write request is applied to. If
1795
+ # changes have occurred after this revision, the changes in this update request
1796
+ # are transformed against those changes. This results in a new revision of the
1797
+ # form that incorporates both the changes in the request and the intervening
1798
+ # changes, with the server resolving conflicting changes. The target revision ID
1799
+ # may only be used to write to recent versions of a form. If the target revision
1800
+ # is too far behind the latest revision, the request is not processed and
1801
+ # returns a 400 (Bad Request Error). The request may be retried after reading
1802
+ # the latest version of the form. In most cases a target revision ID remains
1803
+ # valid for several minutes after it is read, but for frequently-edited forms
1804
+ # this window may be shorter.
1805
+ # Corresponds to the JSON property `targetRevisionId`
1806
+ # @return [String]
1807
+ attr_accessor :target_revision_id
1808
+
1809
+ def initialize(**args)
1810
+ update!(**args)
1811
+ end
1812
+
1813
+ # Update properties of this object
1814
+ def update!(**args)
1815
+ @required_revision_id = args[:required_revision_id] if args.key?(:required_revision_id)
1816
+ @target_revision_id = args[:target_revision_id] if args.key?(:target_revision_id)
1817
+ end
1818
+ end
1819
+ end
1820
+ end
1821
+ end