google-apis-forms_v1 0.1.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 +7 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +7 -0
- data/LICENSE.md +202 -0
- data/OVERVIEW.md +96 -0
- data/lib/google/apis/forms_v1/classes.rb +1821 -0
- data/lib/google/apis/forms_v1/gem_version.rb +28 -0
- data/lib/google/apis/forms_v1/representations.rb +954 -0
- data/lib/google/apis/forms_v1/service.rb +378 -0
- data/lib/google/apis/forms_v1.rb +42 -0
- data/lib/google-apis-forms_v1.rb +15 -0
- metadata +82 -0
|
@@ -0,0 +1,378 @@
|
|
|
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 'google/apis/core/base_service'
|
|
16
|
+
require 'google/apis/core/json_representation'
|
|
17
|
+
require 'google/apis/core/hashable'
|
|
18
|
+
require 'google/apis/errors'
|
|
19
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Apis
|
|
22
|
+
module FormsV1
|
|
23
|
+
# Google Forms API
|
|
24
|
+
#
|
|
25
|
+
# Reads and writes Google Forms and responses.
|
|
26
|
+
#
|
|
27
|
+
# @example
|
|
28
|
+
# require 'google/apis/forms_v1'
|
|
29
|
+
#
|
|
30
|
+
# Forms = Google::Apis::FormsV1 # Alias the module
|
|
31
|
+
# service = Forms::FormsService.new
|
|
32
|
+
#
|
|
33
|
+
# @see https://developers.google.com/forms/api
|
|
34
|
+
class FormsService < Google::Apis::Core::BaseService
|
|
35
|
+
# @return [String]
|
|
36
|
+
# API key. Your API key identifies your project and provides you with API access,
|
|
37
|
+
# quota, and reports. Required unless you provide an OAuth 2.0 token.
|
|
38
|
+
attr_accessor :key
|
|
39
|
+
|
|
40
|
+
# @return [String]
|
|
41
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
42
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
43
|
+
attr_accessor :quota_user
|
|
44
|
+
|
|
45
|
+
def initialize
|
|
46
|
+
super('https://forms.googleapis.com/', '',
|
|
47
|
+
client_name: 'google-apis-forms_v1',
|
|
48
|
+
client_version: Google::Apis::FormsV1::GEM_VERSION)
|
|
49
|
+
@batch_path = 'batch'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Change the form with a batch of updates.
|
|
53
|
+
# @param [String] form_id
|
|
54
|
+
# Required. The form ID.
|
|
55
|
+
# @param [Google::Apis::FormsV1::BatchUpdateFormRequest] batch_update_form_request_object
|
|
56
|
+
# @param [String] fields
|
|
57
|
+
# Selector specifying which fields to include in a partial response.
|
|
58
|
+
# @param [String] quota_user
|
|
59
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
60
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
61
|
+
# @param [Google::Apis::RequestOptions] options
|
|
62
|
+
# Request-specific options
|
|
63
|
+
#
|
|
64
|
+
# @yield [result, err] Result & error if block supplied
|
|
65
|
+
# @yieldparam result [Google::Apis::FormsV1::BatchUpdateFormResponse] parsed result object
|
|
66
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
67
|
+
#
|
|
68
|
+
# @return [Google::Apis::FormsV1::BatchUpdateFormResponse]
|
|
69
|
+
#
|
|
70
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
71
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
72
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
73
|
+
def batch_update_form(form_id, batch_update_form_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
74
|
+
command = make_simple_command(:post, 'v1/forms/{formId}:batchUpdate', options)
|
|
75
|
+
command.request_representation = Google::Apis::FormsV1::BatchUpdateFormRequest::Representation
|
|
76
|
+
command.request_object = batch_update_form_request_object
|
|
77
|
+
command.response_representation = Google::Apis::FormsV1::BatchUpdateFormResponse::Representation
|
|
78
|
+
command.response_class = Google::Apis::FormsV1::BatchUpdateFormResponse
|
|
79
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
80
|
+
command.query['fields'] = fields unless fields.nil?
|
|
81
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
82
|
+
execute_or_queue_command(command, &block)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Create a new form using the title given in the provided form message in the
|
|
86
|
+
# request. *Important:* Only the form.info.title and form.info.document_title
|
|
87
|
+
# fields are copied to the new form. All other fields including the form
|
|
88
|
+
# description, items and settings are disallowed. To create a new form and add
|
|
89
|
+
# items, you must first call forms.create to create an empty form with a title
|
|
90
|
+
# and (optional) document title, and then call forms.update to add the items.
|
|
91
|
+
# @param [Google::Apis::FormsV1::Form] form_object
|
|
92
|
+
# @param [String] fields
|
|
93
|
+
# Selector specifying which fields to include in a partial response.
|
|
94
|
+
# @param [String] quota_user
|
|
95
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
96
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
97
|
+
# @param [Google::Apis::RequestOptions] options
|
|
98
|
+
# Request-specific options
|
|
99
|
+
#
|
|
100
|
+
# @yield [result, err] Result & error if block supplied
|
|
101
|
+
# @yieldparam result [Google::Apis::FormsV1::Form] parsed result object
|
|
102
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
103
|
+
#
|
|
104
|
+
# @return [Google::Apis::FormsV1::Form]
|
|
105
|
+
#
|
|
106
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
107
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
108
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
109
|
+
def create_form(form_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
110
|
+
command = make_simple_command(:post, 'v1/forms', options)
|
|
111
|
+
command.request_representation = Google::Apis::FormsV1::Form::Representation
|
|
112
|
+
command.request_object = form_object
|
|
113
|
+
command.response_representation = Google::Apis::FormsV1::Form::Representation
|
|
114
|
+
command.response_class = Google::Apis::FormsV1::Form
|
|
115
|
+
command.query['fields'] = fields unless fields.nil?
|
|
116
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
117
|
+
execute_or_queue_command(command, &block)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# Get a form.
|
|
121
|
+
# @param [String] form_id
|
|
122
|
+
# Required. The form ID.
|
|
123
|
+
# @param [String] fields
|
|
124
|
+
# Selector specifying which fields to include in a partial response.
|
|
125
|
+
# @param [String] quota_user
|
|
126
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
127
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
128
|
+
# @param [Google::Apis::RequestOptions] options
|
|
129
|
+
# Request-specific options
|
|
130
|
+
#
|
|
131
|
+
# @yield [result, err] Result & error if block supplied
|
|
132
|
+
# @yieldparam result [Google::Apis::FormsV1::Form] parsed result object
|
|
133
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
134
|
+
#
|
|
135
|
+
# @return [Google::Apis::FormsV1::Form]
|
|
136
|
+
#
|
|
137
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
138
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
139
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
140
|
+
def get_form(form_id, fields: nil, quota_user: nil, options: nil, &block)
|
|
141
|
+
command = make_simple_command(:get, 'v1/forms/{formId}', options)
|
|
142
|
+
command.response_representation = Google::Apis::FormsV1::Form::Representation
|
|
143
|
+
command.response_class = Google::Apis::FormsV1::Form
|
|
144
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
145
|
+
command.query['fields'] = fields unless fields.nil?
|
|
146
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
147
|
+
execute_or_queue_command(command, &block)
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# Get one response from the form.
|
|
151
|
+
# @param [String] form_id
|
|
152
|
+
# Required. The form ID.
|
|
153
|
+
# @param [String] response_id
|
|
154
|
+
# Required. The response ID within the form.
|
|
155
|
+
# @param [String] fields
|
|
156
|
+
# Selector specifying which fields to include in a partial response.
|
|
157
|
+
# @param [String] quota_user
|
|
158
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
159
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
160
|
+
# @param [Google::Apis::RequestOptions] options
|
|
161
|
+
# Request-specific options
|
|
162
|
+
#
|
|
163
|
+
# @yield [result, err] Result & error if block supplied
|
|
164
|
+
# @yieldparam result [Google::Apis::FormsV1::FormResponse] parsed result object
|
|
165
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
166
|
+
#
|
|
167
|
+
# @return [Google::Apis::FormsV1::FormResponse]
|
|
168
|
+
#
|
|
169
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
170
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
171
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
172
|
+
def get_form_response(form_id, response_id, fields: nil, quota_user: nil, options: nil, &block)
|
|
173
|
+
command = make_simple_command(:get, 'v1/forms/{formId}/responses/{responseId}', options)
|
|
174
|
+
command.response_representation = Google::Apis::FormsV1::FormResponse::Representation
|
|
175
|
+
command.response_class = Google::Apis::FormsV1::FormResponse
|
|
176
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
177
|
+
command.params['responseId'] = response_id unless response_id.nil?
|
|
178
|
+
command.query['fields'] = fields unless fields.nil?
|
|
179
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
180
|
+
execute_or_queue_command(command, &block)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# List a form's responses.
|
|
184
|
+
# @param [String] form_id
|
|
185
|
+
# Required. ID of the Form whose responses to list.
|
|
186
|
+
# @param [String] filter
|
|
187
|
+
# Which form responses to return. Currently, the only supported filters are: *
|
|
188
|
+
# timestamp > *N* which means to get all form responses submitted after (but not
|
|
189
|
+
# at) timestamp *N*. * timestamp >= *N* which means to get all form responses
|
|
190
|
+
# submitted at and after timestamp *N*. For both supported filters, timestamp
|
|
191
|
+
# must be formatted in RFC3339 UTC "Zulu" format. Examples: "2014-10-02T15:01:
|
|
192
|
+
# 23Z" and "2014-10-02T15:01:23.045123456Z".
|
|
193
|
+
# @param [Fixnum] page_size
|
|
194
|
+
# The maximum number of responses to return. The service may return fewer than
|
|
195
|
+
# this value. If unspecified or zero, at most 5000 responses are returned.
|
|
196
|
+
# @param [String] page_token
|
|
197
|
+
# A page token returned by a previous list response. If this field is set, the
|
|
198
|
+
# form and the values of the filter must be the same as for the original request.
|
|
199
|
+
# @param [String] fields
|
|
200
|
+
# Selector specifying which fields to include in a partial response.
|
|
201
|
+
# @param [String] quota_user
|
|
202
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
203
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
204
|
+
# @param [Google::Apis::RequestOptions] options
|
|
205
|
+
# Request-specific options
|
|
206
|
+
#
|
|
207
|
+
# @yield [result, err] Result & error if block supplied
|
|
208
|
+
# @yieldparam result [Google::Apis::FormsV1::ListFormResponsesResponse] parsed result object
|
|
209
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
210
|
+
#
|
|
211
|
+
# @return [Google::Apis::FormsV1::ListFormResponsesResponse]
|
|
212
|
+
#
|
|
213
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
214
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
215
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
216
|
+
def list_form_responses(form_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
217
|
+
command = make_simple_command(:get, 'v1/forms/{formId}/responses', options)
|
|
218
|
+
command.response_representation = Google::Apis::FormsV1::ListFormResponsesResponse::Representation
|
|
219
|
+
command.response_class = Google::Apis::FormsV1::ListFormResponsesResponse
|
|
220
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
221
|
+
command.query['filter'] = filter unless filter.nil?
|
|
222
|
+
command.query['pageSize'] = page_size unless page_size.nil?
|
|
223
|
+
command.query['pageToken'] = page_token unless page_token.nil?
|
|
224
|
+
command.query['fields'] = fields unless fields.nil?
|
|
225
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
226
|
+
execute_or_queue_command(command, &block)
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
# Create a new watch. If a watch ID is provided, it must be unused. For each
|
|
230
|
+
# invoking project, the per form limit is one watch per Watch.EventType. A watch
|
|
231
|
+
# expires seven days after it is created (see Watch.expire_time).
|
|
232
|
+
# @param [String] form_id
|
|
233
|
+
# Required. ID of the Form to watch.
|
|
234
|
+
# @param [Google::Apis::FormsV1::CreateWatchRequest] create_watch_request_object
|
|
235
|
+
# @param [String] fields
|
|
236
|
+
# Selector specifying which fields to include in a partial response.
|
|
237
|
+
# @param [String] quota_user
|
|
238
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
239
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
240
|
+
# @param [Google::Apis::RequestOptions] options
|
|
241
|
+
# Request-specific options
|
|
242
|
+
#
|
|
243
|
+
# @yield [result, err] Result & error if block supplied
|
|
244
|
+
# @yieldparam result [Google::Apis::FormsV1::Watch] parsed result object
|
|
245
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
246
|
+
#
|
|
247
|
+
# @return [Google::Apis::FormsV1::Watch]
|
|
248
|
+
#
|
|
249
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
250
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
251
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
252
|
+
def create_watch(form_id, create_watch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
253
|
+
command = make_simple_command(:post, 'v1/forms/{formId}/watches', options)
|
|
254
|
+
command.request_representation = Google::Apis::FormsV1::CreateWatchRequest::Representation
|
|
255
|
+
command.request_object = create_watch_request_object
|
|
256
|
+
command.response_representation = Google::Apis::FormsV1::Watch::Representation
|
|
257
|
+
command.response_class = Google::Apis::FormsV1::Watch
|
|
258
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
259
|
+
command.query['fields'] = fields unless fields.nil?
|
|
260
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
261
|
+
execute_or_queue_command(command, &block)
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Delete a watch.
|
|
265
|
+
# @param [String] form_id
|
|
266
|
+
# Required. The ID of the Form.
|
|
267
|
+
# @param [String] watch_id
|
|
268
|
+
# Required. The ID of the Watch to delete.
|
|
269
|
+
# @param [String] fields
|
|
270
|
+
# Selector specifying which fields to include in a partial response.
|
|
271
|
+
# @param [String] quota_user
|
|
272
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
273
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
274
|
+
# @param [Google::Apis::RequestOptions] options
|
|
275
|
+
# Request-specific options
|
|
276
|
+
#
|
|
277
|
+
# @yield [result, err] Result & error if block supplied
|
|
278
|
+
# @yieldparam result [Google::Apis::FormsV1::Empty] parsed result object
|
|
279
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
280
|
+
#
|
|
281
|
+
# @return [Google::Apis::FormsV1::Empty]
|
|
282
|
+
#
|
|
283
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
284
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
285
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
286
|
+
def delete_form_watch(form_id, watch_id, fields: nil, quota_user: nil, options: nil, &block)
|
|
287
|
+
command = make_simple_command(:delete, 'v1/forms/{formId}/watches/{watchId}', options)
|
|
288
|
+
command.response_representation = Google::Apis::FormsV1::Empty::Representation
|
|
289
|
+
command.response_class = Google::Apis::FormsV1::Empty
|
|
290
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
291
|
+
command.params['watchId'] = watch_id unless watch_id.nil?
|
|
292
|
+
command.query['fields'] = fields unless fields.nil?
|
|
293
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
294
|
+
execute_or_queue_command(command, &block)
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
# Return a list of the watches owned by the invoking project. The maximum number
|
|
298
|
+
# of watches is two: For each invoker, the limit is one for each event type per
|
|
299
|
+
# form.
|
|
300
|
+
# @param [String] form_id
|
|
301
|
+
# Required. ID of the Form whose watches to list.
|
|
302
|
+
# @param [String] fields
|
|
303
|
+
# Selector specifying which fields to include in a partial response.
|
|
304
|
+
# @param [String] quota_user
|
|
305
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
306
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
307
|
+
# @param [Google::Apis::RequestOptions] options
|
|
308
|
+
# Request-specific options
|
|
309
|
+
#
|
|
310
|
+
# @yield [result, err] Result & error if block supplied
|
|
311
|
+
# @yieldparam result [Google::Apis::FormsV1::ListWatchesResponse] parsed result object
|
|
312
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
313
|
+
#
|
|
314
|
+
# @return [Google::Apis::FormsV1::ListWatchesResponse]
|
|
315
|
+
#
|
|
316
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
317
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
318
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
319
|
+
def list_form_watches(form_id, fields: nil, quota_user: nil, options: nil, &block)
|
|
320
|
+
command = make_simple_command(:get, 'v1/forms/{formId}/watches', options)
|
|
321
|
+
command.response_representation = Google::Apis::FormsV1::ListWatchesResponse::Representation
|
|
322
|
+
command.response_class = Google::Apis::FormsV1::ListWatchesResponse
|
|
323
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
324
|
+
command.query['fields'] = fields unless fields.nil?
|
|
325
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
326
|
+
execute_or_queue_command(command, &block)
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
# Renew an existing watch for seven days. The state of the watch after renewal
|
|
330
|
+
# is `ACTIVE`, and the `expire_time` is seven days from the renewal. Renewing a
|
|
331
|
+
# watch in an error state (e.g. `SUSPENDED`) succeeds if the error is no longer
|
|
332
|
+
# present, but fail otherwise. After a watch has expired, RenewWatch returns `
|
|
333
|
+
# NOT_FOUND`.
|
|
334
|
+
# @param [String] form_id
|
|
335
|
+
# Required. The ID of the Form.
|
|
336
|
+
# @param [String] watch_id
|
|
337
|
+
# Required. The ID of the Watch to renew.
|
|
338
|
+
# @param [Google::Apis::FormsV1::RenewWatchRequest] renew_watch_request_object
|
|
339
|
+
# @param [String] fields
|
|
340
|
+
# Selector specifying which fields to include in a partial response.
|
|
341
|
+
# @param [String] quota_user
|
|
342
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
343
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
344
|
+
# @param [Google::Apis::RequestOptions] options
|
|
345
|
+
# Request-specific options
|
|
346
|
+
#
|
|
347
|
+
# @yield [result, err] Result & error if block supplied
|
|
348
|
+
# @yieldparam result [Google::Apis::FormsV1::Watch] parsed result object
|
|
349
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
350
|
+
#
|
|
351
|
+
# @return [Google::Apis::FormsV1::Watch]
|
|
352
|
+
#
|
|
353
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
354
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
355
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
356
|
+
def renew_watch(form_id, watch_id, renew_watch_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
357
|
+
command = make_simple_command(:post, 'v1/forms/{formId}/watches/{watchId}:renew', options)
|
|
358
|
+
command.request_representation = Google::Apis::FormsV1::RenewWatchRequest::Representation
|
|
359
|
+
command.request_object = renew_watch_request_object
|
|
360
|
+
command.response_representation = Google::Apis::FormsV1::Watch::Representation
|
|
361
|
+
command.response_class = Google::Apis::FormsV1::Watch
|
|
362
|
+
command.params['formId'] = form_id unless form_id.nil?
|
|
363
|
+
command.params['watchId'] = watch_id unless watch_id.nil?
|
|
364
|
+
command.query['fields'] = fields unless fields.nil?
|
|
365
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
366
|
+
execute_or_queue_command(command, &block)
|
|
367
|
+
end
|
|
368
|
+
|
|
369
|
+
protected
|
|
370
|
+
|
|
371
|
+
def apply_command_defaults(command)
|
|
372
|
+
command.query['key'] = key unless key.nil?
|
|
373
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
374
|
+
end
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
end
|
|
378
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'google/apis/forms_v1/service.rb'
|
|
16
|
+
require 'google/apis/forms_v1/classes.rb'
|
|
17
|
+
require 'google/apis/forms_v1/representations.rb'
|
|
18
|
+
require 'google/apis/forms_v1/gem_version.rb'
|
|
19
|
+
|
|
20
|
+
module Google
|
|
21
|
+
module Apis
|
|
22
|
+
# Google Forms API
|
|
23
|
+
#
|
|
24
|
+
# Reads and writes Google Forms and responses.
|
|
25
|
+
#
|
|
26
|
+
# @see https://developers.google.com/forms/api
|
|
27
|
+
module FormsV1
|
|
28
|
+
# Version of the Google Forms API this client connects to.
|
|
29
|
+
# This is NOT the gem version.
|
|
30
|
+
VERSION = 'V1'
|
|
31
|
+
|
|
32
|
+
# See, edit, create, and delete all of your Google Drive files
|
|
33
|
+
AUTH_DRIVE = 'https://www.googleapis.com/auth/drive'
|
|
34
|
+
|
|
35
|
+
# See, edit, create, and delete only the specific Google Drive files you use with this app
|
|
36
|
+
AUTH_DRIVE_FILE = 'https://www.googleapis.com/auth/drive.file'
|
|
37
|
+
|
|
38
|
+
# See and download all your Google Drive files
|
|
39
|
+
AUTH_DRIVE_READONLY = 'https://www.googleapis.com/auth/drive.readonly'
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
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 "google/apis/forms_v1"
|
metadata
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: google-apis-forms_v1
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Google LLC
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: google-apis-core
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0.4'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 2.a
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - ">="
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: '0.4'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 2.a
|
|
33
|
+
description: This is the simple REST client for Google Forms API V1. Simple REST clients
|
|
34
|
+
are Ruby client libraries that provide access to Google services via their HTTP
|
|
35
|
+
REST API endpoints. These libraries are generated and updated automatically based
|
|
36
|
+
on the discovery documents published by the service, and they handle most concerns
|
|
37
|
+
such as authentication, pagination, retry, timeouts, and logging. You can use this
|
|
38
|
+
client to access the Google Forms API, but note that some services may provide a
|
|
39
|
+
separate modern client that is easier to use.
|
|
40
|
+
email: googleapis-packages@google.com
|
|
41
|
+
executables: []
|
|
42
|
+
extensions: []
|
|
43
|
+
extra_rdoc_files: []
|
|
44
|
+
files:
|
|
45
|
+
- ".yardopts"
|
|
46
|
+
- CHANGELOG.md
|
|
47
|
+
- LICENSE.md
|
|
48
|
+
- OVERVIEW.md
|
|
49
|
+
- lib/google-apis-forms_v1.rb
|
|
50
|
+
- lib/google/apis/forms_v1.rb
|
|
51
|
+
- lib/google/apis/forms_v1/classes.rb
|
|
52
|
+
- lib/google/apis/forms_v1/gem_version.rb
|
|
53
|
+
- lib/google/apis/forms_v1/representations.rb
|
|
54
|
+
- lib/google/apis/forms_v1/service.rb
|
|
55
|
+
homepage: https://github.com/google/google-api-ruby-client
|
|
56
|
+
licenses:
|
|
57
|
+
- Apache-2.0
|
|
58
|
+
metadata:
|
|
59
|
+
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
|
60
|
+
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.1.0
|
|
62
|
+
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-forms_v1
|
|
63
|
+
post_install_message:
|
|
64
|
+
rdoc_options: []
|
|
65
|
+
require_paths:
|
|
66
|
+
- lib
|
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
|
+
requirements:
|
|
69
|
+
- - ">="
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '2.5'
|
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
|
+
requirements:
|
|
74
|
+
- - ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: '0'
|
|
77
|
+
requirements: []
|
|
78
|
+
rubygems_version: 3.3.5
|
|
79
|
+
signing_key:
|
|
80
|
+
specification_version: 4
|
|
81
|
+
summary: Simple REST client for Google Forms API V1
|
|
82
|
+
test_files: []
|