google-apis-forms_v1 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e9473a379aa5c3db66c7173b26550cdcafdcbf27147fd04ea28914631418512
4
- data.tar.gz: fc62b17bf3f11590c5db0998ceef58c2169f725082d38d0c2f07a14a013c0578
3
+ metadata.gz: 487f23bce83a2fd5121efe8a5f8bae24b28bf1dfca67b243ca54678367e61778
4
+ data.tar.gz: 7bd2cd4690982080f9af99ea6f670ae2b55cb9629b0be71737fd3dae748b4856
5
5
  SHA512:
6
- metadata.gz: c1654e46ed984a80b40d53a74259ad16a287e9d7a3df2cdb4bcd949094d6feff20fad67b29360a4de4af0f946f7071b2a1cde103e1c5d5f0f9335a6e496cabbc
7
- data.tar.gz: aca05c0ef2a97739bd6da13417a2d9dddef8056b45ca114633d3773bbaaf76cf3597f3827f944bee7df266ad7b3bd7c86e2f95179facc063e8499a5131697bf6
6
+ metadata.gz: 4c701ee4752827716b02343169b2c95066bea35e93487e835c8e607771ccd7f0d781305e439e217554d6fa294e3c0e3bfd159b458ae637569fe170641d985902
7
+ data.tar.gz: 5a8a6565d80f3e0d1cde94cdce7586c0fb17f765adef9f1f8b2a854ede178efdc8abf01bcd508dd934d54c9fd079eb47cae0715c3af7f961f29586b63bab65f7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Release history for google-apis-forms_v1
2
2
 
3
+ ### v0.16.0 (2025-03-16)
4
+
5
+ * Regenerated from discovery document revision 20250304
6
+
7
+ ### v0.15.0 (2025-02-26)
8
+
9
+ * Regenerated from discovery document revision 20250218
10
+ * Regenerated using generator version 0.16.0
11
+
3
12
  ### v0.14.0 (2024-11-24)
4
13
 
5
14
  * Regenerated from discovery document revision 20241112
data/OVERVIEW.md CHANGED
@@ -79,7 +79,7 @@ Gem names for modern clients are often of the form `google-cloud-<service_name>`
79
79
 
80
80
  **For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
81
81
 
82
- The [product documentation](https://developers.google.com/forms/api) may provide guidance regarding the preferred client library to use.
82
+ The [product documentation](https://developers.google.com/workspace/forms/api) may provide guidance regarding the preferred client library to use.
83
83
 
84
84
  ## Supported Ruby versions
85
85
 
@@ -542,6 +542,11 @@ module Google
542
542
  # @return [String]
543
543
  attr_accessor :linked_sheet_id
544
544
 
545
+ # The publishing settings of a form.
546
+ # Corresponds to the JSON property `publishSettings`
547
+ # @return [Google::Apis::FormsV1::PublishSettings]
548
+ attr_accessor :publish_settings
549
+
545
550
  # Output only. The form URI to share with responders. This opens a page that
546
551
  # allows the user to submit responses but not edit the questions.
547
552
  # Corresponds to the JSON property `responderUri`
@@ -576,6 +581,7 @@ module Google
576
581
  @info = args[:info] if args.key?(:info)
577
582
  @items = args[:items] if args.key?(:items)
578
583
  @linked_sheet_id = args[:linked_sheet_id] if args.key?(:linked_sheet_id)
584
+ @publish_settings = args[:publish_settings] if args.key?(:publish_settings)
579
585
  @responder_uri = args[:responder_uri] if args.key?(:responder_uri)
580
586
  @revision_id = args[:revision_id] if args.key?(:revision_id)
581
587
  @settings = args[:settings] if args.key?(:settings)
@@ -645,6 +651,12 @@ module Google
645
651
  class FormSettings
646
652
  include Google::Apis::Core::Hashable
647
653
 
654
+ # Optional. The setting that determines whether the form collects email
655
+ # addresses from respondents.
656
+ # Corresponds to the JSON property `emailCollectionType`
657
+ # @return [String]
658
+ attr_accessor :email_collection_type
659
+
648
660
  # Settings related to quiz forms and grading. These must be updated with the
649
661
  # UpdateSettingsRequest.
650
662
  # Corresponds to the JSON property `quizSettings`
@@ -657,6 +669,7 @@ module Google
657
669
 
658
670
  # Update properties of this object
659
671
  def update!(**args)
672
+ @email_collection_type = args[:email_collection_type] if args.key?(:email_collection_type)
660
673
  @quiz_settings = args[:quiz_settings] if args.key?(:quiz_settings)
661
674
  end
662
675
  end
@@ -1110,6 +1123,53 @@ module Google
1110
1123
  end
1111
1124
  end
1112
1125
 
1126
+ # The publishing settings of a form.
1127
+ class PublishSettings
1128
+ include Google::Apis::Core::Hashable
1129
+
1130
+ # The publishing state of a form.
1131
+ # Corresponds to the JSON property `publishState`
1132
+ # @return [Google::Apis::FormsV1::PublishState]
1133
+ attr_accessor :publish_state
1134
+
1135
+ def initialize(**args)
1136
+ update!(**args)
1137
+ end
1138
+
1139
+ # Update properties of this object
1140
+ def update!(**args)
1141
+ @publish_state = args[:publish_state] if args.key?(:publish_state)
1142
+ end
1143
+ end
1144
+
1145
+ # The publishing state of a form.
1146
+ class PublishState
1147
+ include Google::Apis::Core::Hashable
1148
+
1149
+ # Required. Whether the form accepts responses. If `is_published` is set to `
1150
+ # false`, this field is forced to `false`.
1151
+ # Corresponds to the JSON property `isAcceptingResponses`
1152
+ # @return [Boolean]
1153
+ attr_accessor :is_accepting_responses
1154
+ alias_method :is_accepting_responses?, :is_accepting_responses
1155
+
1156
+ # Required. Whether the form is published and visible to others.
1157
+ # Corresponds to the JSON property `isPublished`
1158
+ # @return [Boolean]
1159
+ attr_accessor :is_published
1160
+ alias_method :is_published?, :is_published
1161
+
1162
+ def initialize(**args)
1163
+ update!(**args)
1164
+ end
1165
+
1166
+ # Update properties of this object
1167
+ def update!(**args)
1168
+ @is_accepting_responses = args[:is_accepting_responses] if args.key?(:is_accepting_responses)
1169
+ @is_published = args[:is_published] if args.key?(:is_published)
1170
+ end
1171
+ end
1172
+
1113
1173
  # Any question. The specific type of question is known by its `kind`.
1114
1174
  class Question
1115
1175
  include Google::Apis::Core::Hashable
@@ -1436,6 +1496,58 @@ module Google
1436
1496
  end
1437
1497
  end
1438
1498
 
1499
+ # Updates the publish settings of a Form.
1500
+ class SetPublishSettingsRequest
1501
+ include Google::Apis::Core::Hashable
1502
+
1503
+ # The publishing settings of a form.
1504
+ # Corresponds to the JSON property `publishSettings`
1505
+ # @return [Google::Apis::FormsV1::PublishSettings]
1506
+ attr_accessor :publish_settings
1507
+
1508
+ # Optional. The `publish_settings` fields to update. This field mask accepts the
1509
+ # following values: * `publish_state`: Updates or replaces all `publish_state`
1510
+ # settings. * `"*"`: Updates or replaces all `publish_settings` fields.
1511
+ # Corresponds to the JSON property `updateMask`
1512
+ # @return [String]
1513
+ attr_accessor :update_mask
1514
+
1515
+ def initialize(**args)
1516
+ update!(**args)
1517
+ end
1518
+
1519
+ # Update properties of this object
1520
+ def update!(**args)
1521
+ @publish_settings = args[:publish_settings] if args.key?(:publish_settings)
1522
+ @update_mask = args[:update_mask] if args.key?(:update_mask)
1523
+ end
1524
+ end
1525
+
1526
+ # The response of a `SetPublishSettings` request.
1527
+ class SetPublishSettingsResponse
1528
+ include Google::Apis::Core::Hashable
1529
+
1530
+ # Required. The ID of the Form. This is same as the `Form.form_id` field.
1531
+ # Corresponds to the JSON property `formId`
1532
+ # @return [String]
1533
+ attr_accessor :form_id
1534
+
1535
+ # The publishing settings of a form.
1536
+ # Corresponds to the JSON property `publishSettings`
1537
+ # @return [Google::Apis::FormsV1::PublishSettings]
1538
+ attr_accessor :publish_settings
1539
+
1540
+ def initialize(**args)
1541
+ update!(**args)
1542
+ end
1543
+
1544
+ # Update properties of this object
1545
+ def update!(**args)
1546
+ @form_id = args[:form_id] if args.key?(:form_id)
1547
+ @publish_settings = args[:publish_settings] if args.key?(:publish_settings)
1548
+ end
1549
+ end
1550
+
1439
1551
  # An answer to a question represented as text.
1440
1552
  class TextAnswer
1441
1553
  include Google::Apis::Core::Hashable
@@ -16,13 +16,13 @@ module Google
16
16
  module Apis
17
17
  module FormsV1
18
18
  # Version of the google-apis-forms_v1 gem
19
- GEM_VERSION = "0.14.0"
19
+ GEM_VERSION = "0.16.0"
20
20
 
21
21
  # Version of the code generator used to generate this client
22
- GENERATOR_VERSION = "0.15.1"
22
+ GENERATOR_VERSION = "0.16.0"
23
23
 
24
24
  # Revision of the discovery document this client was generated from
25
- REVISION = "20241112"
25
+ REVISION = "20250304"
26
26
  end
27
27
  end
28
28
  end
@@ -232,6 +232,18 @@ module Google
232
232
  include Google::Apis::Core::JsonObjectSupport
233
233
  end
234
234
 
235
+ class PublishSettings
236
+ class Representation < Google::Apis::Core::JsonRepresentation; end
237
+
238
+ include Google::Apis::Core::JsonObjectSupport
239
+ end
240
+
241
+ class PublishState
242
+ class Representation < Google::Apis::Core::JsonRepresentation; end
243
+
244
+ include Google::Apis::Core::JsonObjectSupport
245
+ end
246
+
235
247
  class Question
236
248
  class Representation < Google::Apis::Core::JsonRepresentation; end
237
249
 
@@ -292,6 +304,18 @@ module Google
292
304
  include Google::Apis::Core::JsonObjectSupport
293
305
  end
294
306
 
307
+ class SetPublishSettingsRequest
308
+ class Representation < Google::Apis::Core::JsonRepresentation; end
309
+
310
+ include Google::Apis::Core::JsonObjectSupport
311
+ end
312
+
313
+ class SetPublishSettingsResponse
314
+ class Representation < Google::Apis::Core::JsonRepresentation; end
315
+
316
+ include Google::Apis::Core::JsonObjectSupport
317
+ end
318
+
295
319
  class TextAnswer
296
320
  class Representation < Google::Apis::Core::JsonRepresentation; end
297
321
 
@@ -554,6 +578,8 @@ module Google
554
578
  collection :items, as: 'items', class: Google::Apis::FormsV1::Item, decorator: Google::Apis::FormsV1::Item::Representation
555
579
 
556
580
  property :linked_sheet_id, as: 'linkedSheetId'
581
+ property :publish_settings, as: 'publishSettings', class: Google::Apis::FormsV1::PublishSettings, decorator: Google::Apis::FormsV1::PublishSettings::Representation
582
+
557
583
  property :responder_uri, as: 'responderUri'
558
584
  property :revision_id, as: 'revisionId'
559
585
  property :settings, as: 'settings', class: Google::Apis::FormsV1::FormSettings, decorator: Google::Apis::FormsV1::FormSettings::Representation
@@ -578,6 +604,7 @@ module Google
578
604
  class FormSettings
579
605
  # @private
580
606
  class Representation < Google::Apis::Core::JsonRepresentation
607
+ property :email_collection_type, as: 'emailCollectionType'
581
608
  property :quiz_settings, as: 'quizSettings', class: Google::Apis::FormsV1::QuizSettings, decorator: Google::Apis::FormsV1::QuizSettings::Representation
582
609
 
583
610
  end
@@ -726,6 +753,22 @@ module Google
726
753
  end
727
754
  end
728
755
 
756
+ class PublishSettings
757
+ # @private
758
+ class Representation < Google::Apis::Core::JsonRepresentation
759
+ property :publish_state, as: 'publishState', class: Google::Apis::FormsV1::PublishState, decorator: Google::Apis::FormsV1::PublishState::Representation
760
+
761
+ end
762
+ end
763
+
764
+ class PublishState
765
+ # @private
766
+ class Representation < Google::Apis::Core::JsonRepresentation
767
+ property :is_accepting_responses, as: 'isAcceptingResponses'
768
+ property :is_published, as: 'isPublished'
769
+ end
770
+ end
771
+
729
772
  class Question
730
773
  # @private
731
774
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -838,6 +881,24 @@ module Google
838
881
  end
839
882
  end
840
883
 
884
+ class SetPublishSettingsRequest
885
+ # @private
886
+ class Representation < Google::Apis::Core::JsonRepresentation
887
+ property :publish_settings, as: 'publishSettings', class: Google::Apis::FormsV1::PublishSettings, decorator: Google::Apis::FormsV1::PublishSettings::Representation
888
+
889
+ property :update_mask, as: 'updateMask'
890
+ end
891
+ end
892
+
893
+ class SetPublishSettingsResponse
894
+ # @private
895
+ class Representation < Google::Apis::Core::JsonRepresentation
896
+ property :form_id, as: 'formId'
897
+ property :publish_settings, as: 'publishSettings', class: Google::Apis::FormsV1::PublishSettings, decorator: Google::Apis::FormsV1::PublishSettings::Representation
898
+
899
+ end
900
+ end
901
+
841
902
  class TextAnswer
842
903
  # @private
843
904
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -30,7 +30,7 @@ module Google
30
30
  # Forms = Google::Apis::FormsV1 # Alias the module
31
31
  # service = Forms::FormsService.new
32
32
  #
33
- # @see https://developers.google.com/forms/api
33
+ # @see https://developers.google.com/workspace/forms/api
34
34
  class FormsService < Google::Apis::Core::BaseService
35
35
  DEFAULT_ENDPOINT_TEMPLATE = "https://forms.$UNIVERSE_DOMAIN$/"
36
36
 
@@ -91,6 +91,10 @@ module Google
91
91
  # items, you must first call forms.create to create an empty form with a title
92
92
  # and (optional) document title, and then call forms.update to add the items.
93
93
  # @param [Google::Apis::FormsV1::Form] form_object
94
+ # @param [Boolean] unpublished
95
+ # Optional. Whether the form is unpublished. If set to `true`, the form doesn't
96
+ # accept responses. If set to `false` or unset, the form is published and
97
+ # accepts responses.
94
98
  # @param [String] fields
95
99
  # Selector specifying which fields to include in a partial response.
96
100
  # @param [String] quota_user
@@ -108,12 +112,13 @@ module Google
108
112
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
109
113
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
110
114
  # @raise [Google::Apis::AuthorizationError] Authorization is required
111
- def create_form(form_object = nil, fields: nil, quota_user: nil, options: nil, &block)
115
+ def create_form(form_object = nil, unpublished: nil, fields: nil, quota_user: nil, options: nil, &block)
112
116
  command = make_simple_command(:post, 'v1/forms', options)
113
117
  command.request_representation = Google::Apis::FormsV1::Form::Representation
114
118
  command.request_object = form_object
115
119
  command.response_representation = Google::Apis::FormsV1::Form::Representation
116
120
  command.response_class = Google::Apis::FormsV1::Form
121
+ command.query['unpublished'] = unpublished unless unpublished.nil?
117
122
  command.query['fields'] = fields unless fields.nil?
118
123
  command.query['quotaUser'] = quota_user unless quota_user.nil?
119
124
  execute_or_queue_command(command, &block)
@@ -149,6 +154,40 @@ module Google
149
154
  execute_or_queue_command(command, &block)
150
155
  end
151
156
 
157
+ # Updates the publish settings of a form. Legacy forms aren't supported because
158
+ # they don't have the `publish_settings` field.
159
+ # @param [String] form_id
160
+ # Required. The ID of the form. You can get the id from `Form.form_id` field.
161
+ # @param [Google::Apis::FormsV1::SetPublishSettingsRequest] set_publish_settings_request_object
162
+ # @param [String] fields
163
+ # Selector specifying which fields to include in a partial response.
164
+ # @param [String] quota_user
165
+ # Available to use for quota purposes for server-side applications. Can be any
166
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
167
+ # @param [Google::Apis::RequestOptions] options
168
+ # Request-specific options
169
+ #
170
+ # @yield [result, err] Result & error if block supplied
171
+ # @yieldparam result [Google::Apis::FormsV1::SetPublishSettingsResponse] parsed result object
172
+ # @yieldparam err [StandardError] error object if request failed
173
+ #
174
+ # @return [Google::Apis::FormsV1::SetPublishSettingsResponse]
175
+ #
176
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
177
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
178
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
179
+ def set_form_publish_settings(form_id, set_publish_settings_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
180
+ command = make_simple_command(:post, 'v1/forms/{formId}:setPublishSettings', options)
181
+ command.request_representation = Google::Apis::FormsV1::SetPublishSettingsRequest::Representation
182
+ command.request_object = set_publish_settings_request_object
183
+ command.response_representation = Google::Apis::FormsV1::SetPublishSettingsResponse::Representation
184
+ command.response_class = Google::Apis::FormsV1::SetPublishSettingsResponse
185
+ command.params['formId'] = form_id unless form_id.nil?
186
+ command.query['fields'] = fields unless fields.nil?
187
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
188
+ execute_or_queue_command(command, &block)
189
+ end
190
+
152
191
  # Get one response from the form.
153
192
  # @param [String] form_id
154
193
  # Required. The form ID.
@@ -23,7 +23,7 @@ module Google
23
23
  #
24
24
  # Reads and writes Google Forms and responses.
25
25
  #
26
- # @see https://developers.google.com/forms/api
26
+ # @see https://developers.google.com/workspace/forms/api
27
27
  module FormsV1
28
28
  # Version of the Google Forms API this client connects to.
29
29
  # This is NOT the gem version.
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-apis-forms_v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-04 00:00:00.000000000 Z
10
+ date: 2025-03-16 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-apis-core
@@ -58,9 +57,8 @@ licenses:
58
57
  metadata:
59
58
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
60
59
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-forms_v1/CHANGELOG.md
61
- documentation_uri: https://googleapis.dev/ruby/google-apis-forms_v1/v0.14.0
60
+ documentation_uri: https://googleapis.dev/ruby/google-apis-forms_v1/v0.16.0
62
61
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-forms_v1
63
- post_install_message:
64
62
  rdoc_options: []
65
63
  require_paths:
66
64
  - lib
@@ -75,8 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
73
  - !ruby/object:Gem::Version
76
74
  version: '0'
77
75
  requirements: []
78
- rubygems_version: 3.5.22
79
- signing_key:
76
+ rubygems_version: 3.6.5
80
77
  specification_version: 4
81
78
  summary: Simple REST client for Google Forms API V1
82
79
  test_files: []