Class: Google::Apis::FormsV1::Form

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/forms_v1/classes.rb,
lib/google/apis/forms_v1/representations.rb,
lib/google/apis/forms_v1/representations.rb

Overview

A Google Forms document. A form is created in Drive, and deleting a form or changing its access protections is done via the Drive API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Form

Returns a new instance of Form.



569
570
571
# File 'lib/google/apis/forms_v1/classes.rb', line 569

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#form_idString

Output only. The form ID. Corresponds to the JSON property formId

Returns:

  • (String)


526
527
528
# File 'lib/google/apis/forms_v1/classes.rb', line 526

def form_id
  @form_id
end

#infoGoogle::Apis::FormsV1::Info

The general information for a form. Corresponds to the JSON property info



531
532
533
# File 'lib/google/apis/forms_v1/classes.rb', line 531

def info
  @info
end

#itemsArray<Google::Apis::FormsV1::Item>

Required. A list of the form's items, which can include section headers, questions, embedded media, etc. Corresponds to the JSON property items

Returns:



537
538
539
# File 'lib/google/apis/forms_v1/classes.rb', line 537

def items
  @items
end

#linked_sheet_idString

Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists). Corresponds to the JSON property linkedSheetId

Returns:

  • (String)


543
544
545
# File 'lib/google/apis/forms_v1/classes.rb', line 543

def linked_sheet_id
  @linked_sheet_id
end

#responder_uriString

Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions. Corresponds to the JSON property responderUri

Returns:

  • (String)


549
550
551
# File 'lib/google/apis/forms_v1/classes.rb', line 549

def responder_uri
  @responder_uri
end

#revision_idString

Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes. Corresponds to the JSON property revisionId

Returns:

  • (String)


562
563
564
# File 'lib/google/apis/forms_v1/classes.rb', line 562

def revision_id
  @revision_id
end

#settingsGoogle::Apis::FormsV1::FormSettings

A form's settings. Corresponds to the JSON property settings



567
568
569
# File 'lib/google/apis/forms_v1/classes.rb', line 567

def settings
  @settings
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



574
575
576
577
578
579
580
581
582
# File 'lib/google/apis/forms_v1/classes.rb', line 574

def update!(**args)
  @form_id = args[:form_id] if args.key?(:form_id)
  @info = args[:info] if args.key?(:info)
  @items = args[:items] if args.key?(:items)
  @linked_sheet_id = args[:linked_sheet_id] if args.key?(:linked_sheet_id)
  @responder_uri = args[:responder_uri] if args.key?(:responder_uri)
  @revision_id = args[:revision_id] if args.key?(:revision_id)
  @settings = args[:settings] if args.key?(:settings)
end