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.



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

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

Instance Attribute Details

#form_idString

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

Returns:

  • (String)


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

def form_id
  @form_id
end

#infoGoogle::Apis::FormsV1::Info

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



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

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:



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

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)


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

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)


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

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)


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

def revision_id
  @revision_id
end

#settingsGoogle::Apis::FormsV1::FormSettings

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



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

def settings
  @settings
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



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

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