google-api-client 0.9.26 → 0.9.28

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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/api_names.yaml +36326 -36213
  5. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +155 -155
  7. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +32 -32
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +104 -104
  9. data/generated/google/apis/adsense_v1_4.rb +1 -1
  10. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  11. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  12. data/generated/google/apis/appstate_v1.rb +1 -1
  13. data/generated/google/apis/calendar_v3.rb +1 -1
  14. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  15. data/generated/google/apis/cloudbuild_v1/classes.rb +260 -248
  16. data/generated/google/apis/cloudbuild_v1/representations.rb +47 -45
  17. data/generated/google/apis/cloudbuild_v1/service.rb +167 -167
  18. data/generated/google/apis/clouddebugger_v2.rb +3 -3
  19. data/generated/google/apis/clouddebugger_v2/classes.rb +569 -569
  20. data/generated/google/apis/clouddebugger_v2/representations.rb +146 -146
  21. data/generated/google/apis/clouddebugger_v2/service.rb +145 -145
  22. data/generated/google/apis/cloudkms_v1beta1.rb +4 -3
  23. data/generated/google/apis/cloudkms_v1beta1/classes.rb +428 -428
  24. data/generated/google/apis/cloudkms_v1beta1/representations.rb +115 -115
  25. data/generated/google/apis/cloudkms_v1beta1/service.rb +161 -160
  26. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  27. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  28. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +583 -583
  29. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +100 -100
  30. data/generated/google/apis/cloudresourcemanager_v1/service.rb +116 -116
  31. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  32. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +195 -195
  33. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +58 -58
  34. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +316 -316
  35. data/generated/google/apis/content_v2.rb +1 -1
  36. data/generated/google/apis/content_v2/classes.rb +12 -0
  37. data/generated/google/apis/content_v2/representations.rb +2 -0
  38. data/generated/google/apis/dataflow_v1b3.rb +1 -1
  39. data/generated/google/apis/dataflow_v1b3/classes.rb +2833 -2694
  40. data/generated/google/apis/dataflow_v1b3/representations.rb +666 -666
  41. data/generated/google/apis/dataflow_v1b3/service.rb +351 -349
  42. data/generated/google/apis/datastore_v1.rb +1 -1
  43. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  44. data/generated/google/apis/deploymentmanager_v2/classes.rb +21 -12
  45. data/generated/google/apis/deploymentmanager_v2/representations.rb +1 -0
  46. data/generated/google/apis/deploymentmanager_v2/service.rb +5 -5
  47. data/generated/google/apis/dns_v1.rb +1 -1
  48. data/generated/google/apis/dns_v2beta1.rb +1 -1
  49. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  50. data/generated/google/apis/doubleclicksearch_v2/classes.rb +6 -4
  51. data/generated/google/apis/drive_v2.rb +1 -1
  52. data/generated/google/apis/drive_v2/classes.rb +26 -0
  53. data/generated/google/apis/drive_v2/representations.rb +14 -0
  54. data/generated/google/apis/drive_v2/service.rb +38 -2
  55. data/generated/google/apis/drive_v3.rb +1 -1
  56. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  57. data/generated/google/apis/games_management_v1management.rb +1 -1
  58. data/generated/google/apis/games_v1.rb +1 -1
  59. data/generated/google/apis/genomics_v1.rb +4 -4
  60. data/generated/google/apis/genomics_v1/classes.rb +2317 -2317
  61. data/generated/google/apis/genomics_v1/representations.rb +476 -476
  62. data/generated/google/apis/genomics_v1/service.rb +1038 -1038
  63. data/generated/google/apis/gmail_v1.rb +1 -1
  64. data/generated/google/apis/gmail_v1/classes.rb +82 -1
  65. data/generated/google/apis/gmail_v1/representations.rb +33 -0
  66. data/generated/google/apis/gmail_v1/service.rb +215 -5
  67. data/generated/google/apis/iam_v1.rb +1 -1
  68. data/generated/google/apis/iam_v1/classes.rb +446 -343
  69. data/generated/google/apis/iam_v1/representations.rb +112 -85
  70. data/generated/google/apis/iam_v1/service.rb +248 -192
  71. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  72. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  73. data/generated/google/apis/kgsearch_v1/service.rb +15 -15
  74. data/generated/google/apis/language_v1beta1.rb +1 -1
  75. data/generated/google/apis/language_v1beta1/classes.rb +396 -396
  76. data/generated/google/apis/language_v1beta1/representations.rb +97 -97
  77. data/generated/google/apis/language_v1beta1/service.rb +42 -42
  78. data/generated/google/apis/logging_v2beta1.rb +1 -1
  79. data/generated/google/apis/logging_v2beta1/classes.rb +855 -855
  80. data/generated/google/apis/logging_v2beta1/representations.rb +155 -155
  81. data/generated/google/apis/logging_v2beta1/service.rb +214 -214
  82. data/generated/google/apis/monitoring_v3.rb +4 -4
  83. data/generated/google/apis/monitoring_v3/classes.rb +551 -551
  84. data/generated/google/apis/monitoring_v3/representations.rb +123 -123
  85. data/generated/google/apis/monitoring_v3/service.rb +80 -80
  86. data/generated/google/apis/plus_domains_v1.rb +1 -1
  87. data/generated/google/apis/plus_v1.rb +1 -1
  88. data/generated/google/apis/pubsub_v1.rb +3 -3
  89. data/generated/google/apis/pubsub_v1/classes.rb +391 -391
  90. data/generated/google/apis/pubsub_v1/representations.rb +83 -83
  91. data/generated/google/apis/pubsub_v1/service.rb +257 -257
  92. data/generated/google/apis/sheets_v4.rb +1 -1
  93. data/generated/google/apis/sheets_v4/classes.rb +4334 -4334
  94. data/generated/google/apis/sheets_v4/representations.rb +861 -861
  95. data/generated/google/apis/sheets_v4/service.rb +191 -191
  96. data/generated/google/apis/slides_v1.rb +7 -7
  97. data/generated/google/apis/slides_v1/classes.rb +2726 -2555
  98. data/generated/google/apis/slides_v1/representations.rb +678 -607
  99. data/generated/google/apis/slides_v1/service.rb +16 -16
  100. data/generated/google/apis/speech_v1beta1.rb +1 -1
  101. data/generated/google/apis/speech_v1beta1/classes.rb +57 -59
  102. data/generated/google/apis/speech_v1beta1/representations.rb +9 -9
  103. data/generated/google/apis/speech_v1beta1/service.rb +63 -63
  104. data/generated/google/apis/storage_v1.rb +1 -1
  105. data/generated/google/apis/storage_v1/classes.rb +4 -3
  106. data/generated/google/apis/vision_v1/classes.rb +925 -925
  107. data/generated/google/apis/vision_v1/representations.rb +134 -134
  108. data/generated/google/apis/vision_v1/service.rb +4 -4
  109. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  110. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  111. data/generated/google/apis/youtube_v3.rb +1 -1
  112. data/generated/google/apis/youtube_v3/classes.rb +234 -1
  113. data/generated/google/apis/youtube_v3/representations.rb +83 -0
  114. data/generated/google/apis/youtube_v3/service.rb +55 -0
  115. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  116. data/generated/google/apis/youtubereporting_v1/classes.rb +105 -105
  117. data/generated/google/apis/youtubereporting_v1/representations.rb +31 -31
  118. data/generated/google/apis/youtubereporting_v1/service.rb +78 -78
  119. data/lib/google/apis/core/api_command.rb +11 -5
  120. data/lib/google/apis/core/base_service.rb +7 -5
  121. data/lib/google/apis/errors.rb +4 -0
  122. data/lib/google/apis/version.rb +1 -1
  123. metadata +28 -28
@@ -47,37 +47,42 @@ module Google
47
47
  super('https://youtubereporting.googleapis.com/', '')
48
48
  end
49
49
 
50
- # Creates a job and returns it.
51
- # @param [Google::Apis::YoutubereportingV1::Job] job_object
52
- # @param [String] on_behalf_of_content_owner
53
- # The content owner's external ID on which behalf the user is acting on. If
54
- # not set, the user is acting for himself (his own channel).
55
- # @param [String] fields
56
- # Selector specifying which fields to include in a partial response.
50
+ # Method for media download. Download is supported
51
+ # on the URI `/v1/media/`+name`?alt=media`.
52
+ # @param [String] resource_name
53
+ # Name of the media that is being downloaded. See
54
+ # ReadRequest.resource_name.
57
55
  # @param [String] quota_user
58
56
  # Available to use for quota purposes for server-side applications. Can be any
59
57
  # arbitrary string assigned to a user, but should not exceed 40 characters.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
60
+ # @param [IO, String] download_dest
61
+ # IO stream or filename to receive content download
60
62
  # @param [Google::Apis::RequestOptions] options
61
63
  # Request-specific options
62
64
  #
63
65
  # @yield [result, err] Result & error if block supplied
64
- # @yieldparam result [Google::Apis::YoutubereportingV1::Job] parsed result object
66
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Media] parsed result object
65
67
  # @yieldparam err [StandardError] error object if request failed
66
68
  #
67
- # @return [Google::Apis::YoutubereportingV1::Job]
69
+ # @return [Google::Apis::YoutubereportingV1::Media]
68
70
  #
69
71
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
70
72
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
71
73
  # @raise [Google::Apis::AuthorizationError] Authorization is required
72
- def create_job(job_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
73
- command = make_simple_command(:post, 'v1/jobs', options)
74
- command.request_representation = Google::Apis::YoutubereportingV1::Job::Representation
75
- command.request_object = job_object
76
- command.response_representation = Google::Apis::YoutubereportingV1::Job::Representation
77
- command.response_class = Google::Apis::YoutubereportingV1::Job
78
- command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
79
- command.query['fields'] = fields unless fields.nil?
74
+ def download_medium(resource_name, quota_user: nil, fields: nil, download_dest: nil, options: nil, &block)
75
+ if download_dest.nil?
76
+ command = make_simple_command(:get, 'v1/media/{+resourceName}', options)
77
+ else
78
+ command = make_download_command(:get, 'v1/media/{+resourceName}', options)
79
+ command.download_dest = download_dest
80
+ end
81
+ command.response_representation = Google::Apis::YoutubereportingV1::Media::Representation
82
+ command.response_class = Google::Apis::YoutubereportingV1::Media
83
+ command.params['resourceName'] = resource_name unless resource_name.nil?
80
84
  command.query['quotaUser'] = quota_user unless quota_user.nil?
85
+ command.query['fields'] = fields unless fields.nil?
81
86
  execute_or_queue_command(command, &block)
82
87
  end
83
88
 
@@ -87,11 +92,11 @@ module Google
87
92
  # @param [String] on_behalf_of_content_owner
88
93
  # The content owner's external ID on which behalf the user is acting on. If
89
94
  # not set, the user is acting for himself (his own channel).
90
- # @param [String] fields
91
- # Selector specifying which fields to include in a partial response.
92
95
  # @param [String] quota_user
93
96
  # Available to use for quota purposes for server-side applications. Can be any
94
97
  # arbitrary string assigned to a user, but should not exceed 40 characters.
98
+ # @param [String] fields
99
+ # Selector specifying which fields to include in a partial response.
95
100
  # @param [Google::Apis::RequestOptions] options
96
101
  # Request-specific options
97
102
  #
@@ -104,14 +109,14 @@ module Google
104
109
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
105
110
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
106
111
  # @raise [Google::Apis::AuthorizationError] Authorization is required
107
- def delete_job(job_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
112
+ def delete_job(job_id, on_behalf_of_content_owner: nil, quota_user: nil, fields: nil, options: nil, &block)
108
113
  command = make_simple_command(:delete, 'v1/jobs/{jobId}', options)
109
114
  command.response_representation = Google::Apis::YoutubereportingV1::Empty::Representation
110
115
  command.response_class = Google::Apis::YoutubereportingV1::Empty
111
116
  command.params['jobId'] = job_id unless job_id.nil?
112
117
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
113
- command.query['fields'] = fields unless fields.nil?
114
118
  command.query['quotaUser'] = quota_user unless quota_user.nil?
119
+ command.query['fields'] = fields unless fields.nil?
115
120
  execute_or_queue_command(command, &block)
116
121
  end
117
122
 
@@ -131,11 +136,11 @@ module Google
131
136
  # @param [String] on_behalf_of_content_owner
132
137
  # The content owner's external ID on which behalf the user is acting on. If
133
138
  # not set, the user is acting for himself (his own channel).
134
- # @param [String] fields
135
- # Selector specifying which fields to include in a partial response.
136
139
  # @param [String] quota_user
137
140
  # Available to use for quota purposes for server-side applications. Can be any
138
141
  # arbitrary string assigned to a user, but should not exceed 40 characters.
142
+ # @param [String] fields
143
+ # Selector specifying which fields to include in a partial response.
139
144
  # @param [Google::Apis::RequestOptions] options
140
145
  # Request-specific options
141
146
  #
@@ -148,7 +153,7 @@ module Google
148
153
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
149
154
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
150
155
  # @raise [Google::Apis::AuthorizationError] Authorization is required
151
- def list_jobs(page_token: nil, include_system_managed: nil, page_size: nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
156
+ def list_jobs(page_token: nil, include_system_managed: nil, page_size: nil, on_behalf_of_content_owner: nil, quota_user: nil, fields: nil, options: nil, &block)
152
157
  command = make_simple_command(:get, 'v1/jobs', options)
153
158
  command.response_representation = Google::Apis::YoutubereportingV1::ListJobsResponse::Representation
154
159
  command.response_class = Google::Apis::YoutubereportingV1::ListJobsResponse
@@ -156,8 +161,8 @@ module Google
156
161
  command.query['includeSystemManaged'] = include_system_managed unless include_system_managed.nil?
157
162
  command.query['pageSize'] = page_size unless page_size.nil?
158
163
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
159
- command.query['fields'] = fields unless fields.nil?
160
164
  command.query['quotaUser'] = quota_user unless quota_user.nil?
165
+ command.query['fields'] = fields unless fields.nil?
161
166
  execute_or_queue_command(command, &block)
162
167
  end
163
168
 
@@ -167,11 +172,11 @@ module Google
167
172
  # @param [String] on_behalf_of_content_owner
168
173
  # The content owner's external ID on which behalf the user is acting on. If
169
174
  # not set, the user is acting for himself (his own channel).
170
- # @param [String] fields
171
- # Selector specifying which fields to include in a partial response.
172
175
  # @param [String] quota_user
173
176
  # Available to use for quota purposes for server-side applications. Can be any
174
177
  # arbitrary string assigned to a user, but should not exceed 40 characters.
178
+ # @param [String] fields
179
+ # Selector specifying which fields to include in a partial response.
175
180
  # @param [Google::Apis::RequestOptions] options
176
181
  # Request-specific options
177
182
  #
@@ -184,14 +189,48 @@ module Google
184
189
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
185
190
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
186
191
  # @raise [Google::Apis::AuthorizationError] Authorization is required
187
- def get_job(job_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
192
+ def get_job(job_id, on_behalf_of_content_owner: nil, quota_user: nil, fields: nil, options: nil, &block)
188
193
  command = make_simple_command(:get, 'v1/jobs/{jobId}', options)
189
194
  command.response_representation = Google::Apis::YoutubereportingV1::Job::Representation
190
195
  command.response_class = Google::Apis::YoutubereportingV1::Job
191
196
  command.params['jobId'] = job_id unless job_id.nil?
192
197
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
198
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
193
199
  command.query['fields'] = fields unless fields.nil?
200
+ execute_or_queue_command(command, &block)
201
+ end
202
+
203
+ # Creates a job and returns it.
204
+ # @param [Google::Apis::YoutubereportingV1::Job] job_object
205
+ # @param [String] on_behalf_of_content_owner
206
+ # The content owner's external ID on which behalf the user is acting on. If
207
+ # not set, the user is acting for himself (his own channel).
208
+ # @param [String] quota_user
209
+ # Available to use for quota purposes for server-side applications. Can be any
210
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
211
+ # @param [String] fields
212
+ # Selector specifying which fields to include in a partial response.
213
+ # @param [Google::Apis::RequestOptions] options
214
+ # Request-specific options
215
+ #
216
+ # @yield [result, err] Result & error if block supplied
217
+ # @yieldparam result [Google::Apis::YoutubereportingV1::Job] parsed result object
218
+ # @yieldparam err [StandardError] error object if request failed
219
+ #
220
+ # @return [Google::Apis::YoutubereportingV1::Job]
221
+ #
222
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
223
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
224
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
225
+ def create_job(job_object = nil, on_behalf_of_content_owner: nil, quota_user: nil, fields: nil, options: nil, &block)
226
+ command = make_simple_command(:post, 'v1/jobs', options)
227
+ command.request_representation = Google::Apis::YoutubereportingV1::Job::Representation
228
+ command.request_object = job_object
229
+ command.response_representation = Google::Apis::YoutubereportingV1::Job::Representation
230
+ command.response_class = Google::Apis::YoutubereportingV1::Job
231
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
194
232
  command.query['quotaUser'] = quota_user unless quota_user.nil?
233
+ command.query['fields'] = fields unless fields.nil?
195
234
  execute_or_queue_command(command, &block)
196
235
  end
197
236
 
@@ -218,11 +257,11 @@ module Google
218
257
  # @param [String] start_time_before
219
258
  # If set, only reports whose start time is smaller than the specified
220
259
  # date/time are returned.
221
- # @param [String] fields
222
- # Selector specifying which fields to include in a partial response.
223
260
  # @param [String] quota_user
224
261
  # Available to use for quota purposes for server-side applications. Can be any
225
262
  # arbitrary string assigned to a user, but should not exceed 40 characters.
263
+ # @param [String] fields
264
+ # Selector specifying which fields to include in a partial response.
226
265
  # @param [Google::Apis::RequestOptions] options
227
266
  # Request-specific options
228
267
  #
@@ -235,7 +274,7 @@ module Google
235
274
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
236
275
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
237
276
  # @raise [Google::Apis::AuthorizationError] Authorization is required
238
- def list_job_reports(job_id, created_after: nil, start_time_at_or_after: nil, page_token: nil, page_size: nil, on_behalf_of_content_owner: nil, start_time_before: nil, fields: nil, quota_user: nil, options: nil, &block)
277
+ def list_job_reports(job_id, created_after: nil, start_time_at_or_after: nil, page_token: nil, page_size: nil, on_behalf_of_content_owner: nil, start_time_before: nil, quota_user: nil, fields: nil, options: nil, &block)
239
278
  command = make_simple_command(:get, 'v1/jobs/{jobId}/reports', options)
240
279
  command.response_representation = Google::Apis::YoutubereportingV1::ListReportsResponse::Representation
241
280
  command.response_class = Google::Apis::YoutubereportingV1::ListReportsResponse
@@ -246,8 +285,8 @@ module Google
246
285
  command.query['pageSize'] = page_size unless page_size.nil?
247
286
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
248
287
  command.query['startTimeBefore'] = start_time_before unless start_time_before.nil?
249
- command.query['fields'] = fields unless fields.nil?
250
288
  command.query['quotaUser'] = quota_user unless quota_user.nil?
289
+ command.query['fields'] = fields unless fields.nil?
251
290
  execute_or_queue_command(command, &block)
252
291
  end
253
292
 
@@ -259,11 +298,11 @@ module Google
259
298
  # @param [String] on_behalf_of_content_owner
260
299
  # The content owner's external ID on which behalf the user is acting on. If
261
300
  # not set, the user is acting for himself (his own channel).
262
- # @param [String] fields
263
- # Selector specifying which fields to include in a partial response.
264
301
  # @param [String] quota_user
265
302
  # Available to use for quota purposes for server-side applications. Can be any
266
303
  # arbitrary string assigned to a user, but should not exceed 40 characters.
304
+ # @param [String] fields
305
+ # Selector specifying which fields to include in a partial response.
267
306
  # @param [Google::Apis::RequestOptions] options
268
307
  # Request-specific options
269
308
  #
@@ -276,15 +315,15 @@ module Google
276
315
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
277
316
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
278
317
  # @raise [Google::Apis::AuthorizationError] Authorization is required
279
- def get_job_report(job_id, report_id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, options: nil, &block)
318
+ def get_job_report(job_id, report_id, on_behalf_of_content_owner: nil, quota_user: nil, fields: nil, options: nil, &block)
280
319
  command = make_simple_command(:get, 'v1/jobs/{jobId}/reports/{reportId}', options)
281
320
  command.response_representation = Google::Apis::YoutubereportingV1::Report::Representation
282
321
  command.response_class = Google::Apis::YoutubereportingV1::Report
283
322
  command.params['jobId'] = job_id unless job_id.nil?
284
323
  command.params['reportId'] = report_id unless report_id.nil?
285
324
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
286
- command.query['fields'] = fields unless fields.nil?
287
325
  command.query['quotaUser'] = quota_user unless quota_user.nil?
326
+ command.query['fields'] = fields unless fields.nil?
288
327
  execute_or_queue_command(command, &block)
289
328
  end
290
329
 
@@ -304,11 +343,11 @@ module Google
304
343
  # @param [Fixnum] page_size
305
344
  # Requested page size. Server may return fewer report types than requested.
306
345
  # If unspecified, server will pick an appropriate default.
307
- # @param [String] fields
308
- # Selector specifying which fields to include in a partial response.
309
346
  # @param [String] quota_user
310
347
  # Available to use for quota purposes for server-side applications. Can be any
311
348
  # arbitrary string assigned to a user, but should not exceed 40 characters.
349
+ # @param [String] fields
350
+ # Selector specifying which fields to include in a partial response.
312
351
  # @param [Google::Apis::RequestOptions] options
313
352
  # Request-specific options
314
353
  #
@@ -321,7 +360,7 @@ module Google
321
360
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
322
361
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
323
362
  # @raise [Google::Apis::AuthorizationError] Authorization is required
324
- def list_report_types(on_behalf_of_content_owner: nil, page_token: nil, include_system_managed: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
363
+ def list_report_types(on_behalf_of_content_owner: nil, page_token: nil, include_system_managed: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
325
364
  command = make_simple_command(:get, 'v1/reportTypes', options)
326
365
  command.response_representation = Google::Apis::YoutubereportingV1::ListReportTypesResponse::Representation
327
366
  command.response_class = Google::Apis::YoutubereportingV1::ListReportTypesResponse
@@ -329,47 +368,8 @@ module Google
329
368
  command.query['pageToken'] = page_token unless page_token.nil?
330
369
  command.query['includeSystemManaged'] = include_system_managed unless include_system_managed.nil?
331
370
  command.query['pageSize'] = page_size unless page_size.nil?
332
- command.query['fields'] = fields unless fields.nil?
333
371
  command.query['quotaUser'] = quota_user unless quota_user.nil?
334
- execute_or_queue_command(command, &block)
335
- end
336
-
337
- # Method for media download. Download is supported
338
- # on the URI `/v1/media/`+name`?alt=media`.
339
- # @param [String] resource_name
340
- # Name of the media that is being downloaded. See
341
- # ReadRequest.resource_name.
342
- # @param [String] fields
343
- # Selector specifying which fields to include in a partial response.
344
- # @param [String] quota_user
345
- # Available to use for quota purposes for server-side applications. Can be any
346
- # arbitrary string assigned to a user, but should not exceed 40 characters.
347
- # @param [IO, String] download_dest
348
- # IO stream or filename to receive content download
349
- # @param [Google::Apis::RequestOptions] options
350
- # Request-specific options
351
- #
352
- # @yield [result, err] Result & error if block supplied
353
- # @yieldparam result [Google::Apis::YoutubereportingV1::Media] parsed result object
354
- # @yieldparam err [StandardError] error object if request failed
355
- #
356
- # @return [Google::Apis::YoutubereportingV1::Media]
357
- #
358
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
359
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
360
- # @raise [Google::Apis::AuthorizationError] Authorization is required
361
- def download_medium(resource_name, fields: nil, quota_user: nil, download_dest: nil, options: nil, &block)
362
- if download_dest.nil?
363
- command = make_simple_command(:get, 'v1/media/{+resourceName}', options)
364
- else
365
- command = make_download_command(:get, 'v1/media/{+resourceName}', options)
366
- command.download_dest = download_dest
367
- end
368
- command.response_representation = Google::Apis::YoutubereportingV1::Media::Representation
369
- command.response_class = Google::Apis::YoutubereportingV1::Media
370
- command.params['resourceName'] = resource_name unless resource_name.nil?
371
372
  command.query['fields'] = fields unless fields.nil?
372
- command.query['quotaUser'] = quota_user unless quota_user.nil?
373
373
  execute_or_queue_command(command, &block)
374
374
  end
375
375
 
@@ -26,7 +26,11 @@ module Google
26
26
  class ApiCommand < HttpCommand
27
27
  JSON_CONTENT_TYPE = 'application/json'
28
28
  FIELDS_PARAM = 'fields'
29
- RATE_LIMIT_ERRORS = %w(rateLimitExceeded userRateLimitExceeded)
29
+ ERROR_REASON_MAPPING = {
30
+ 'rateLimitExceeded' => Google::Apis::RateLimitError,
31
+ 'userRateLimitExceeded' => Google::Apis::RateLimitError,
32
+ 'projectNotLinked' => Google::Apis::ProjectNotLinkedError
33
+ }
30
34
 
31
35
  # JSON serializer for request objects
32
36
  # @return [Google::Apis::Core::JsonRepresentation]
@@ -94,10 +98,12 @@ module Google
94
98
  error = parse_error(body)
95
99
  if error
96
100
  message = sprintf('%s: %s', error['reason'], error['message'])
97
- raise Google::Apis::RateLimitError.new(message,
98
- status_code: status,
99
- header: header,
100
- body: body) if RATE_LIMIT_ERRORS.include?(error['reason'])
101
+ raise ERROR_REASON_MAPPING[error['reason']].new(
102
+ message,
103
+ status_code: status,
104
+ header: header,
105
+ body: body
106
+ ) if ERROR_REASON_MAPPING.key?(error['reason'])
101
107
  end
102
108
  super(status, header, body, message)
103
109
  else
@@ -42,11 +42,12 @@ module Google
42
42
  # True (default) if results should be cached so multiple iterations can be used.
43
43
  # @param [Symbol] items
44
44
  # Name of the field in the result containing the items. Defaults to :items
45
- def initialize(service, max: nil, items: :items, cache: true, &block)
45
+ def initialize(service, max: nil, items: :items, cache: true, response_page_token: :next_page_token, &block)
46
46
  @service = service
47
47
  @block = block
48
48
  @max = max
49
49
  @items_field = items
50
+ @response_page_token_field = response_page_token
50
51
  if cache
51
52
  @result_cache = Hash.new do |h, k|
52
53
  h[k] = @block.call(k, @service)
@@ -75,8 +76,9 @@ module Google
75
76
  yield items
76
77
  end
77
78
  break if @max && item_count >= @max
78
- break if @last_result.next_page_token.nil? || @last_result.next_page_token == page_token
79
- page_token = @last_result.next_page_token
79
+ next_page_token = @last_result.send(@response_page_token_field)
80
+ break if next_page_token.nil? || next_page_token == page_token
81
+ page_token = next_page_token
80
82
  end
81
83
  end
82
84
  end
@@ -270,9 +272,9 @@ module Google
270
272
  # @example Retrieve all files,
271
273
  # file_list = service.fetch_all { |token, s| s.list_files(page_token: token) }
272
274
  # file_list.each { |f| ... }
273
- def fetch_all(max: nil, items: :items, cache: true, &block)
275
+ def fetch_all(max: nil, items: :items, cache: true, response_page_token: :next_page_token, &block)
274
276
  fail "fetch_all may not be used inside a batch" if batch?
275
- return PagedResults.new(self, max: max, items: items, cache: cache, &block)
277
+ return PagedResults.new(self, max: max, items: items, cache: cache, response_page_token: response_page_token, &block)
276
278
  end
277
279
 
278
280
  protected
@@ -61,6 +61,10 @@ module Google
61
61
  class RateLimitError < Error
62
62
  end
63
63
 
64
+ # A 403 HTTP error occurred.
65
+ class ProjectNotLinkedError < Error
66
+ end
67
+
64
68
  # A 401 HTTP error occurred.
65
69
  class AuthorizationError < Error
66
70
  end
@@ -15,7 +15,7 @@
15
15
  module Google
16
16
  module Apis
17
17
  # Client library version
18
- VERSION = '0.9.26'
18
+ VERSION = '0.9.28'
19
19
 
20
20
  # Current operating system
21
21
  # @private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.26
4
+ version: 0.9.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Bazyl
@@ -11,132 +11,132 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-01-28 00:00:00.000000000 Z
14
+ date: 2017-02-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: representable
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - ~>
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.3.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
29
  version: 2.3.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: retriable
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - ~>
34
+ - - "~>"
35
35
  - !ruby/object:Gem::Version
36
36
  version: '2.0'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ~>
41
+ - - "~>"
42
42
  - !ruby/object:Gem::Version
43
43
  version: '2.0'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: addressable
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - ~>
48
+ - - "~>"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '2.3'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ~>
55
+ - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '2.3'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mime-types
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - '>='
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '1.6'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '1.6'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: hurley
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - ~>
76
+ - - "~>"
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0.1'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - ~>
83
+ - - "~>"
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0.1'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: googleauth
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - ~>
90
+ - - "~>"
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0.5'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ~>
97
+ - - "~>"
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0.5'
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: httpclient
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - ~>
104
+ - - "~>"
105
105
  - !ruby/object:Gem::Version
106
106
  version: '2.7'
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ~>
111
+ - - "~>"
112
112
  - !ruby/object:Gem::Version
113
113
  version: '2.7'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: memoist
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - ~>
118
+ - - "~>"
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0.11'
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - ~>
125
+ - - "~>"
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0.11'
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: thor
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - ~>
132
+ - - "~>"
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0.19'
135
135
  type: :development
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - ~>
139
+ - - "~>"
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0.19'
142
142
  description:
@@ -147,12 +147,12 @@ executables:
147
147
  extensions: []
148
148
  extra_rdoc_files: []
149
149
  files:
150
- - .gitignore
151
- - .rspec
152
- - .rubocop.yml
153
- - .rubocop_todo.yml
154
- - .travis.yml
155
- - .yardopts
150
+ - ".gitignore"
151
+ - ".rspec"
152
+ - ".rubocop.yml"
153
+ - ".rubocop_todo.yml"
154
+ - ".travis.yml"
155
+ - ".yardopts"
156
156
  - CHANGELOG.md
157
157
  - CONTRIBUTING.md
158
158
  - Gemfile
@@ -712,12 +712,12 @@ require_paths:
712
712
  - third_party
713
713
  required_ruby_version: !ruby/object:Gem::Requirement
714
714
  requirements:
715
- - - ~>
715
+ - - "~>"
716
716
  - !ruby/object:Gem::Version
717
717
  version: '2.0'
718
718
  required_rubygems_version: !ruby/object:Gem::Requirement
719
719
  requirements:
720
- - - '>='
720
+ - - ">="
721
721
  - !ruby/object:Gem::Version
722
722
  version: '0'
723
723
  requirements: []