google-api-client 0.9.8 → 0.9.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/Gemfile +9 -1
  4. data/README.md +10 -2
  5. data/api_names.yaml +63 -110
  6. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +35 -0
  7. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +298 -0
  8. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +122 -0
  9. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +458 -0
  10. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  11. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +260 -13
  12. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +81 -0
  13. data/generated/google/apis/adexchangebuyer_v1_4/service.rb +60 -8
  14. data/generated/google/apis/adexchangeseller_v2_0.rb +2 -3
  15. data/generated/google/apis/adexchangeseller_v2_0/service.rb +1 -2
  16. data/generated/google/apis/admin_directory_v1.rb +1 -1
  17. data/generated/google/apis/admin_directory_v1/classes.rb +86 -0
  18. data/generated/google/apis/admin_directory_v1/representations.rb +24 -0
  19. data/generated/google/apis/admin_directory_v1/service.rb +41 -2
  20. data/generated/google/apis/admin_reports_v1.rb +3 -3
  21. data/generated/google/apis/admin_reports_v1/service.rb +2 -2
  22. data/generated/google/apis/adsense_v1_4.rb +1 -1
  23. data/generated/google/apis/adsense_v1_4/classes.rb +1 -1
  24. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  25. data/generated/google/apis/adsensehost_v4_1/classes.rb +1 -2
  26. data/generated/google/apis/analytics_v3.rb +1 -1
  27. data/generated/google/apis/analytics_v3/classes.rb +379 -3
  28. data/generated/google/apis/analytics_v3/representations.rb +136 -0
  29. data/generated/google/apis/analytics_v3/service.rb +217 -0
  30. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  31. data/generated/google/apis/analyticsreporting_v4/classes.rb +50 -22
  32. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  33. data/generated/google/apis/androidenterprise_v1/classes.rb +813 -49
  34. data/generated/google/apis/androidenterprise_v1/representations.rb +336 -0
  35. data/generated/google/apis/androidenterprise_v1/service.rb +1234 -145
  36. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  37. data/generated/google/apis/androidpublisher_v2/classes.rb +47 -8
  38. data/generated/google/apis/androidpublisher_v2/representations.rb +27 -0
  39. data/generated/google/apis/androidpublisher_v2/service.rb +55 -0
  40. data/generated/google/apis/appengine_v1beta5.rb +7 -1
  41. data/generated/google/apis/appengine_v1beta5/classes.rb +516 -313
  42. data/generated/google/apis/appengine_v1beta5/representations.rb +115 -22
  43. data/generated/google/apis/appengine_v1beta5/service.rb +329 -33
  44. data/generated/google/apis/appsactivity_v1.rb +1 -1
  45. data/generated/google/apis/appsactivity_v1/classes.rb +7 -0
  46. data/generated/google/apis/appsactivity_v1/representations.rb +1 -0
  47. data/generated/google/apis/appstate_v1.rb +1 -1
  48. data/generated/google/apis/bigquery_v2.rb +1 -1
  49. data/generated/google/apis/bigquery_v2/classes.rb +277 -20
  50. data/generated/google/apis/bigquery_v2/representations.rb +86 -0
  51. data/generated/google/apis/bigquery_v2/service.rb +8 -2
  52. data/generated/google/apis/books_v1.rb +2 -2
  53. data/generated/google/apis/books_v1/classes.rb +79 -1
  54. data/generated/google/apis/books_v1/representations.rb +34 -0
  55. data/generated/google/apis/books_v1/service.rb +7 -3
  56. data/generated/google/apis/calendar_v3.rb +1 -1
  57. data/generated/google/apis/civicinfo_v2.rb +3 -2
  58. data/generated/google/apis/civicinfo_v2/classes.rb +377 -5
  59. data/generated/google/apis/civicinfo_v2/representations.rb +149 -0
  60. data/generated/google/apis/civicinfo_v2/service.rb +27 -6
  61. data/generated/google/apis/classroom_v1.rb +1 -1
  62. data/generated/google/apis/classroom_v1/classes.rb +183 -37
  63. data/generated/google/apis/classroom_v1/representations.rb +74 -9
  64. data/generated/google/apis/classroom_v1/service.rb +403 -38
  65. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  66. data/generated/google/apis/cloudbuild_v1/classes.rb +381 -17
  67. data/generated/google/apis/cloudbuild_v1/representations.rb +137 -2
  68. data/generated/google/apis/cloudbuild_v1/service.rb +174 -1
  69. data/generated/google/apis/clouddebugger_v2.rb +3 -6
  70. data/generated/google/apis/clouddebugger_v2/service.rb +4 -4
  71. data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
  72. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  73. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +502 -111
  74. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +162 -24
  75. data/generated/google/apis/cloudresourcemanager_v1/service.rb +274 -30
  76. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  77. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +121 -9
  78. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +46 -0
  79. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +71 -58
  80. data/generated/google/apis/compute_beta.rb +1 -1
  81. data/generated/google/apis/compute_beta/classes.rb +2299 -434
  82. data/generated/google/apis/compute_beta/representations.rb +752 -33
  83. data/generated/google/apis/compute_beta/service.rb +6067 -3153
  84. data/generated/google/apis/compute_v1.rb +1 -1
  85. data/generated/google/apis/compute_v1/classes.rb +1681 -207
  86. data/generated/google/apis/compute_v1/representations.rb +552 -0
  87. data/generated/google/apis/compute_v1/service.rb +2797 -1171
  88. data/generated/google/apis/content_v2.rb +1 -1
  89. data/generated/google/apis/content_v2/classes.rb +757 -1
  90. data/generated/google/apis/content_v2/representations.rb +337 -0
  91. data/generated/google/apis/content_v2/service.rb +244 -0
  92. data/generated/google/apis/dataflow_v1b3.rb +38 -0
  93. data/generated/google/apis/dataflow_v1b3/classes.rb +4053 -0
  94. data/generated/google/apis/dataflow_v1b3/representations.rb +1736 -0
  95. data/generated/google/apis/dataflow_v1b3/service.rb +875 -0
  96. data/generated/google/apis/dataproc_v1.rb +2 -2
  97. data/generated/google/apis/dataproc_v1/classes.rb +213 -68
  98. data/generated/google/apis/dataproc_v1/representations.rb +38 -0
  99. data/generated/google/apis/dataproc_v1/service.rb +78 -48
  100. data/generated/google/apis/datastore_v1.rb +38 -0
  101. data/generated/google/apis/datastore_v1/classes.rb +1284 -0
  102. data/generated/google/apis/datastore_v1/representations.rb +572 -0
  103. data/generated/google/apis/datastore_v1/service.rb +259 -0
  104. data/generated/google/apis/datastore_v1beta3.rb +38 -0
  105. data/generated/google/apis/datastore_v1beta3/classes.rb +1284 -0
  106. data/generated/google/apis/datastore_v1beta3/representations.rb +572 -0
  107. data/generated/google/apis/datastore_v1beta3/service.rb +259 -0
  108. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  109. data/generated/google/apis/deploymentmanager_v2/classes.rb +384 -2
  110. data/generated/google/apis/deploymentmanager_v2/representations.rb +161 -0
  111. data/generated/google/apis/deploymentmanager_v2/service.rb +217 -55
  112. data/generated/google/apis/dfareporting_v2_5.rb +40 -0
  113. data/generated/google/apis/dfareporting_v2_5/classes.rb +11225 -0
  114. data/generated/google/apis/dfareporting_v2_5/representations.rb +3982 -0
  115. data/generated/google/apis/dfareporting_v2_5/service.rb +8755 -0
  116. data/generated/google/apis/dfareporting_v2_6.rb +40 -0
  117. data/generated/google/apis/dfareporting_v2_6/classes.rb +11586 -0
  118. data/generated/google/apis/dfareporting_v2_6/representations.rb +4119 -0
  119. data/generated/google/apis/dfareporting_v2_6/service.rb +9025 -0
  120. data/generated/google/apis/dns_v1.rb +1 -1
  121. data/generated/google/apis/dns_v1/classes.rb +1 -1
  122. data/generated/google/apis/doubleclickbidmanager_v1.rb +1 -1
  123. data/generated/google/apis/doubleclickbidmanager_v1/classes.rb +79 -86
  124. data/generated/google/apis/doubleclickbidmanager_v1/representations.rb +25 -28
  125. data/generated/google/apis/doubleclickbidmanager_v1/service.rb +10 -8
  126. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  127. data/generated/google/apis/drive_v2.rb +1 -1
  128. data/generated/google/apis/drive_v2/classes.rb +27 -3
  129. data/generated/google/apis/drive_v2/representations.rb +4 -0
  130. data/generated/google/apis/drive_v2/service.rb +16 -3
  131. data/generated/google/apis/drive_v3.rb +1 -1
  132. data/generated/google/apis/drive_v3/classes.rb +50 -16
  133. data/generated/google/apis/drive_v3/representations.rb +4 -0
  134. data/generated/google/apis/drive_v3/service.rb +12 -2
  135. data/generated/google/apis/fitness_v1.rb +8 -2
  136. data/generated/google/apis/fitness_v1/classes.rb +64 -6
  137. data/generated/google/apis/fitness_v1/representations.rb +20 -0
  138. data/generated/google/apis/fitness_v1/service.rb +17 -18
  139. data/generated/google/apis/fusiontables_v2.rb +1 -1
  140. data/generated/google/apis/fusiontables_v2/classes.rb +4 -3
  141. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  142. data/generated/google/apis/games_management_v1management.rb +1 -1
  143. data/generated/google/apis/games_v1.rb +1 -1
  144. data/generated/google/apis/genomics_v1.rb +2 -4
  145. data/generated/google/apis/genomics_v1/classes.rb +143 -34
  146. data/generated/google/apis/genomics_v1/representations.rb +48 -11
  147. data/generated/google/apis/genomics_v1/service.rb +35 -37
  148. data/generated/google/apis/gmail_v1.rb +10 -1
  149. data/generated/google/apis/gmail_v1/classes.rb +542 -4
  150. data/generated/google/apis/gmail_v1/representations.rb +213 -0
  151. data/generated/google/apis/gmail_v1/service.rb +898 -1
  152. data/generated/google/apis/groupssettings_v1.rb +1 -1
  153. data/generated/google/apis/groupssettings_v1/classes.rb +12 -0
  154. data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
  155. data/generated/google/apis/iam_v1.rb +2 -2
  156. data/generated/google/apis/iam_v1/classes.rb +181 -206
  157. data/generated/google/apis/iam_v1/representations.rb +36 -45
  158. data/generated/google/apis/iam_v1/service.rb +101 -67
  159. data/generated/google/apis/identitytoolkit_v3.rb +4 -1
  160. data/generated/google/apis/identitytoolkit_v3/classes.rb +171 -1
  161. data/generated/google/apis/identitytoolkit_v3/representations.rb +26 -0
  162. data/generated/google/apis/language_v1beta1.rb +36 -0
  163. data/generated/google/apis/language_v1beta1/classes.rb +599 -0
  164. data/generated/google/apis/language_v1beta1/representations.rb +289 -0
  165. data/generated/google/apis/language_v1beta1/service.rb +152 -0
  166. data/generated/google/apis/logging_v2beta1.rb +6 -6
  167. data/generated/google/apis/logging_v2beta1/classes.rb +760 -731
  168. data/generated/google/apis/logging_v2beta1/representations.rb +136 -147
  169. data/generated/google/apis/logging_v2beta1/service.rb +290 -209
  170. data/generated/google/apis/mirror_v1.rb +2 -2
  171. data/generated/google/apis/mirror_v1/service.rb +1 -1
  172. data/generated/google/apis/monitoring_v3.rb +45 -0
  173. data/generated/google/apis/monitoring_v3/classes.rb +1337 -0
  174. data/generated/google/apis/monitoring_v3/representations.rb +516 -0
  175. data/generated/google/apis/monitoring_v3/service.rb +711 -0
  176. data/generated/google/apis/oauth2_v2.rb +1 -1
  177. data/generated/google/apis/pagespeedonline_v2.rb +1 -1
  178. data/generated/google/apis/plus_domains_v1.rb +1 -1
  179. data/generated/google/apis/plus_v1.rb +1 -1
  180. data/generated/google/apis/pubsub_v1.rb +1 -1
  181. data/generated/google/apis/pubsub_v1/classes.rb +10 -9
  182. data/generated/google/apis/pubsub_v1/service.rb +128 -27
  183. data/generated/google/apis/qpx_express_v1.rb +1 -1
  184. data/generated/google/apis/qpx_express_v1/classes.rb +6 -0
  185. data/generated/google/apis/qpx_express_v1/representations.rb +1 -0
  186. data/generated/google/apis/replicapool_v1beta2.rb +1 -1
  187. data/generated/google/apis/replicapoolupdater_v1beta1.rb +4 -2
  188. data/generated/google/apis/replicapoolupdater_v1beta1/service.rb +3 -1
  189. data/generated/google/apis/script_v1.rb +1 -1
  190. data/generated/google/apis/script_v1/classes.rb +6 -0
  191. data/generated/google/apis/script_v1/representations.rb +1 -0
  192. data/generated/google/apis/sheets_v4.rb +1 -1
  193. data/generated/google/apis/sheets_v4/classes.rb +910 -89
  194. data/generated/google/apis/sheets_v4/representations.rb +194 -10
  195. data/generated/google/apis/sheets_v4/service.rb +216 -49
  196. data/generated/google/apis/slides_v1.rb +49 -0
  197. data/generated/google/apis/slides_v1/classes.rb +3926 -0
  198. data/generated/google/apis/slides_v1/representations.rb +1722 -0
  199. data/generated/google/apis/slides_v1/service.rb +202 -0
  200. data/generated/google/apis/speech_v1beta1.rb +34 -0
  201. data/generated/google/apis/speech_v1beta1/classes.rb +511 -0
  202. data/generated/google/apis/speech_v1beta1/representations.rb +218 -0
  203. data/generated/google/apis/speech_v1beta1/service.rb +271 -0
  204. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  205. data/generated/google/apis/sqladmin_v1beta4/classes.rb +32 -8
  206. data/generated/google/apis/sqladmin_v1beta4/representations.rb +3 -0
  207. data/generated/google/apis/sqladmin_v1beta4/service.rb +42 -0
  208. data/generated/google/apis/storage_v1.rb +1 -1
  209. data/generated/google/apis/storage_v1/classes.rb +43 -18
  210. data/generated/google/apis/storage_v1/representations.rb +4 -1
  211. data/generated/google/apis/storage_v1/service.rb +5 -2
  212. data/generated/google/apis/translate_v2.rb +2 -2
  213. data/generated/google/apis/translate_v2/service.rb +1 -1
  214. data/generated/google/apis/vision_v1.rb +1 -1
  215. data/generated/google/apis/vision_v1/classes.rb +12 -11
  216. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  217. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  218. data/generated/google/apis/youtube_partner_v1/classes.rb +6 -0
  219. data/generated/google/apis/youtube_partner_v1/representations.rb +2 -0
  220. data/generated/google/apis/youtube_partner_v1/service.rb +15 -3
  221. data/generated/google/apis/youtube_v3.rb +1 -1
  222. data/generated/google/apis/youtube_v3/classes.rb +183 -21
  223. data/generated/google/apis/youtube_v3/representations.rb +85 -4
  224. data/generated/google/apis/youtube_v3/service.rb +41 -5
  225. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  226. data/google-api-client.gemspec +2 -1
  227. data/lib/google/apis/core/api_command.rb +4 -0
  228. data/lib/google/apis/core/base_service.rb +10 -4
  229. data/lib/google/apis/core/download.rb +7 -2
  230. data/lib/google/apis/core/http_command.rb +5 -1
  231. data/lib/google/apis/core/upload.rb +7 -1
  232. data/lib/google/apis/errors.rb +2 -2
  233. data/lib/google/apis/generator/annotator.rb +6 -0
  234. data/lib/google/apis/version.rb +1 -1
  235. data/samples/cli/lib/samples/bigquery.rb +101 -0
  236. data/samples/cli/lib/samples/sheets.rb +61 -0
  237. data/sync.rb +71 -0
  238. metadata +55 -13
@@ -2776,6 +2776,16 @@ module Google
2776
2776
  # The id parameter specifies the YouTube playlist item ID for the playlist item
2777
2777
  # that is being deleted. In a playlistItem resource, the id property specifies
2778
2778
  # the playlist item's ID.
2779
+ # @param [String] on_behalf_of_content_owner
2780
+ # Note: This parameter is intended exclusively for YouTube content partners.
2781
+ # The onBehalfOfContentOwner parameter indicates that the request's
2782
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2783
+ # of the content owner specified in the parameter value. This parameter is
2784
+ # intended for YouTube content partners that own and manage many different
2785
+ # YouTube channels. It allows content owners to authenticate once and get access
2786
+ # to all their video and channel data, without having to provide authentication
2787
+ # credentials for each individual channel. The CMS account that the user
2788
+ # authenticates with must be linked to the specified YouTube content owner.
2779
2789
  # @param [String] fields
2780
2790
  # Selector specifying which fields to include in a partial response.
2781
2791
  # @param [String] quota_user
@@ -2797,9 +2807,10 @@ module Google
2797
2807
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2798
2808
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2799
2809
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2800
- def delete_playlist_item(id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2810
+ def delete_playlist_item(id, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2801
2811
  command = make_simple_command(:delete, 'playlistItems', options)
2802
2812
  command.query['id'] = id unless id.nil?
2813
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2803
2814
  command.query['fields'] = fields unless fields.nil?
2804
2815
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2805
2816
  command.query['userIp'] = user_ip unless user_ip.nil?
@@ -2952,6 +2963,16 @@ module Google
2952
2963
  # specify values, the existing start and end times will be removed and replaced
2953
2964
  # with the default settings.
2954
2965
  # @param [Google::Apis::YoutubeV3::PlaylistItem] playlist_item_object
2966
+ # @param [String] on_behalf_of_content_owner
2967
+ # Note: This parameter is intended exclusively for YouTube content partners.
2968
+ # The onBehalfOfContentOwner parameter indicates that the request's
2969
+ # authorization credentials identify a YouTube CMS user who is acting on behalf
2970
+ # of the content owner specified in the parameter value. This parameter is
2971
+ # intended for YouTube content partners that own and manage many different
2972
+ # YouTube channels. It allows content owners to authenticate once and get access
2973
+ # to all their video and channel data, without having to provide authentication
2974
+ # credentials for each individual channel. The CMS account that the user
2975
+ # authenticates with must be linked to the specified YouTube content owner.
2955
2976
  # @param [String] fields
2956
2977
  # Selector specifying which fields to include in a partial response.
2957
2978
  # @param [String] quota_user
@@ -2973,12 +2994,13 @@ module Google
2973
2994
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2974
2995
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2975
2996
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2976
- def update_playlist_item(part, playlist_item_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2997
+ def update_playlist_item(part, playlist_item_object = nil, on_behalf_of_content_owner: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
2977
2998
  command = make_simple_command(:put, 'playlistItems', options)
2978
2999
  command.request_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2979
3000
  command.request_object = playlist_item_object
2980
3001
  command.response_representation = Google::Apis::YoutubeV3::PlaylistItem::Representation
2981
3002
  command.response_class = Google::Apis::YoutubeV3::PlaylistItem
3003
+ command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
2982
3004
  command.query['part'] = part unless part.nil?
2983
3005
  command.query['fields'] = fields unless fields.nil?
2984
3006
  command.query['quotaUser'] = quota_user unless quota_user.nil?
@@ -3622,9 +3644,12 @@ module Google
3622
3644
  # @param [Boolean] mine
3623
3645
  # Set this parameter's value to true to retrieve a feed of the authenticated
3624
3646
  # user's subscriptions.
3647
+ # @param [Boolean] my_recent_subscribers
3648
+ # Set this parameter's value to true to retrieve a feed of the subscribers of
3649
+ # the authenticated user in reverse chronological order (newest first).
3625
3650
  # @param [Boolean] my_subscribers
3626
3651
  # Set this parameter's value to true to retrieve a feed of the subscribers of
3627
- # the authenticated user.
3652
+ # the authenticated user in no particular order.
3628
3653
  # @param [String] on_behalf_of_content_owner
3629
3654
  # Note: This parameter is intended exclusively for YouTube content partners.
3630
3655
  # The onBehalfOfContentOwner parameter indicates that the request's
@@ -3679,7 +3704,7 @@ module Google
3679
3704
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3680
3705
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3681
3706
  # @raise [Google::Apis::AuthorizationError] Authorization is required
3682
- def list_subscriptions(part, channel_id: nil, for_channel_id: nil, id: nil, max_results: nil, mine: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, order: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
3707
+ def list_subscriptions(part, channel_id: nil, for_channel_id: nil, id: nil, max_results: nil, mine: nil, my_recent_subscribers: nil, my_subscribers: nil, on_behalf_of_content_owner: nil, on_behalf_of_content_owner_channel: nil, order: nil, page_token: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
3683
3708
  command = make_simple_command(:get, 'subscriptions', options)
3684
3709
  command.response_representation = Google::Apis::YoutubeV3::ListSubscriptionResponse::Representation
3685
3710
  command.response_class = Google::Apis::YoutubeV3::ListSubscriptionResponse
@@ -3688,6 +3713,7 @@ module Google
3688
3713
  command.query['id'] = id unless id.nil?
3689
3714
  command.query['maxResults'] = max_results unless max_results.nil?
3690
3715
  command.query['mine'] = mine unless mine.nil?
3716
+ command.query['myRecentSubscribers'] = my_recent_subscribers unless my_recent_subscribers.nil?
3691
3717
  command.query['mySubscribers'] = my_subscribers unless my_subscribers.nil?
3692
3718
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3693
3719
  command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
@@ -4065,12 +4091,20 @@ module Google
4065
4091
  # property specifies the video's ID.
4066
4092
  # @param [String] locale
4067
4093
  # DEPRECATED
4094
+ # @param [Fixnum] max_height
4095
+ # The maxHeight parameter specifies a maximum height of the embedded player. If
4096
+ # maxWidth is provided, maxHeight may not be reached in order to not violate the
4097
+ # width request.
4068
4098
  # @param [Fixnum] max_results
4069
4099
  # The maxResults parameter specifies the maximum number of items that should be
4070
4100
  # returned in the result set.
4071
4101
  # Note: This parameter is supported for use in conjunction with the myRating
4072
4102
  # parameter, but it is not supported for use in conjunction with the id
4073
4103
  # parameter.
4104
+ # @param [Fixnum] max_width
4105
+ # The maxWidth parameter specifies a maximum width of the embedded player. If
4106
+ # maxHeight is provided, maxWidth may not be reached in order to not violate the
4107
+ # height request.
4074
4108
  # @param [String] my_rating
4075
4109
  # Set this parameter's value to like or dislike to instruct the API to only
4076
4110
  # return videos liked or disliked by the authenticated user.
@@ -4121,7 +4155,7 @@ module Google
4121
4155
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
4122
4156
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
4123
4157
  # @raise [Google::Apis::AuthorizationError] Authorization is required
4124
- def list_videos(part, chart: nil, hl: nil, id: nil, locale: nil, max_results: nil, my_rating: nil, on_behalf_of_content_owner: nil, page_token: nil, region_code: nil, video_category_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
4158
+ def list_videos(part, chart: nil, hl: nil, id: nil, locale: nil, max_height: nil, max_results: nil, max_width: nil, my_rating: nil, on_behalf_of_content_owner: nil, page_token: nil, region_code: nil, video_category_id: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
4125
4159
  command = make_simple_command(:get, 'videos', options)
4126
4160
  command.response_representation = Google::Apis::YoutubeV3::ListVideosResponse::Representation
4127
4161
  command.response_class = Google::Apis::YoutubeV3::ListVideosResponse
@@ -4129,7 +4163,9 @@ module Google
4129
4163
  command.query['hl'] = hl unless hl.nil?
4130
4164
  command.query['id'] = id unless id.nil?
4131
4165
  command.query['locale'] = locale unless locale.nil?
4166
+ command.query['maxHeight'] = max_height unless max_height.nil?
4132
4167
  command.query['maxResults'] = max_results unless max_results.nil?
4168
+ command.query['maxWidth'] = max_width unless max_width.nil?
4133
4169
  command.query['myRating'] = my_rating unless my_rating.nil?
4134
4170
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
4135
4171
  command.query['pageToken'] = page_token unless page_token.nil?
@@ -26,7 +26,7 @@ module Google
26
26
  # @see https://developers.google.com/youtube/reporting/v1/reports/
27
27
  module YoutubereportingV1
28
28
  VERSION = 'V1'
29
- REVISION = '20160517'
29
+ REVISION = '20160719'
30
30
 
31
31
  # View monetary and non-monetary YouTube Analytics reports for your YouTube content
32
32
  AUTH_YT_ANALYTICS_MONETARY_READONLY = 'https://www.googleapis.com/auth/yt-analytics-monetary.readonly'
@@ -26,7 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.add_runtime_dependency 'mime-types', '>= 1.6'
27
27
  spec.add_runtime_dependency 'hurley', '~> 0.1'
28
28
  spec.add_runtime_dependency 'googleauth', '~> 0.5'
29
- spec.add_runtime_dependency 'thor', '~> 0.19'
30
29
  spec.add_runtime_dependency 'httpclient', '~> 2.7'
31
30
  spec.add_runtime_dependency 'memoist', '~> 0.11'
31
+
32
+ spec.add_development_dependency 'thor', '~> 0.19'
32
33
  end
@@ -105,6 +105,10 @@ module Google
105
105
  end
106
106
  end
107
107
 
108
+ def allow_form_encoding?
109
+ request_representation.nil? && super
110
+ end
111
+
108
112
  private
109
113
 
110
114
  # Attempt to parse a JSON error message, returning the first found error
@@ -63,10 +63,16 @@ module Google
63
63
  item_count = 0
64
64
  loop do
65
65
  @last_result = @fetch_proc.call(page_token)
66
- for item in @last_result.send(@items_field)
67
- item_count = item_count + 1
68
- break if @max && item_count > @max
69
- yield item
66
+ items = @last_result.send(@items_field)
67
+ if items.kind_of?(Array)
68
+ for item in items
69
+ item_count = item_count + 1
70
+ break if @max && item_count > @max
71
+ yield item
72
+ end
73
+ elsif items
74
+ # yield singular non-nil items (for genomics API)
75
+ yield items
70
76
  end
71
77
  break if @max && item_count >= @max
72
78
  break if @last_result.next_page_token.nil? || @last_result.next_page_token == page_token
@@ -23,6 +23,7 @@ module Google
23
23
  # Streaming/resumable media download support
24
24
  class DownloadCommand < ApiCommand
25
25
  RANGE_HEADER = 'range'
26
+ OK_STATUS = [200, 201, 206]
26
27
 
27
28
  # File or IO to write content to
28
29
  # @return [String, File, #write]
@@ -65,7 +66,7 @@ module Google
65
66
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
66
67
  # @raise [Google::Apis::AuthorizationError] Authorization is required
67
68
  def execute_once(client, &block)
68
- client.get(@download_url || url) do |req|
69
+ response = client.get(@download_url || url) do |req|
69
70
  apply_request_options(req)
70
71
  check_if_rewind_needed = false
71
72
  if @offset > 0
@@ -73,7 +74,7 @@ module Google
73
74
  req.header[RANGE_HEADER] = sprintf('bytes=%d-', @offset)
74
75
  check_if_rewind_needed = true
75
76
  end
76
- req.on_body(200, 201, 206) do |res, chunk|
77
+ req.on_body(*OK_STATUS) do |res, chunk|
77
78
  check_status(res.status_code, chunk) unless res.status_code.nil?
78
79
  if check_if_rewind_needed && res.status_code != 206
79
80
  # Oh no! Requested a chunk, but received the entire content
@@ -88,6 +89,10 @@ module Google
88
89
  @download_io.flush
89
90
  end
90
91
  end
92
+
93
+ # Since the on_body block only runs on success, check status again just in case it failed
94
+ check_status(response.status_code, response.body) unless OK_STATUS.include?(response.status_code.to_i)
95
+
91
96
  if @close_io_on_finish
92
97
  result = nil
93
98
  else
@@ -146,7 +146,7 @@ module Google
146
146
  self.url = url.expand(params) if url.is_a?(Addressable::Template)
147
147
  url.query_values = query.merge(url.query_values || {})
148
148
 
149
- if [:post, :put].include?(method) && body.nil?
149
+ if allow_form_encoding?
150
150
  @form_encoded = true
151
151
  self.body = Addressable::URI.form_encode(url.query_values(Array))
152
152
  self.header['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
@@ -306,6 +306,10 @@ module Google
306
306
  req.options.open_timeout = options.open_timeout_sec
307
307
  end
308
308
 
309
+ def allow_form_encoding?
310
+ [:post, :put].include?(method) && body.nil?
311
+ end
312
+
309
313
  private
310
314
 
311
315
  def form_encoded?
@@ -17,8 +17,14 @@ require 'google/apis/core/http_command'
17
17
  require 'google/apis/core/api_command'
18
18
  require 'google/apis/errors'
19
19
  require 'addressable/uri'
20
- require 'mime-types'
21
20
  require 'tempfile'
21
+ begin
22
+ require 'mime/types/columnar'
23
+ rescue LoadError
24
+ # Temporary until next major bump when we can tighten
25
+ # dependency to mime-types >-=3.0
26
+ require 'mime-types'
27
+ end
22
28
 
23
29
  module Google
24
30
  module Apis
@@ -19,7 +19,7 @@ module Google
19
19
  attr_reader :status_code
20
20
  attr_reader :header
21
21
  attr_reader :body
22
-
22
+
23
23
  def initialize(err, status_code: nil, header: nil, body: nil)
24
24
  @cause = nil
25
25
 
@@ -42,7 +42,7 @@ module Google
42
42
  end
43
43
  end
44
44
  end
45
-
45
+
46
46
  # An error which is raised when there is an unexpected response or other
47
47
  # transport error that prevents an operation from succeeding.
48
48
  class TransmissionError < Error
@@ -25,12 +25,18 @@ require 'addressable/uri'
25
25
 
26
26
  module Google
27
27
  module Apis
28
+
28
29
  # @private
29
30
  class Generator
31
+
30
32
  # Helper for picking names for methods, properties, types, etc. Performs various normaliations
31
33
  # as well as allows for overriding individual names from a configuration file for cases
32
34
  # where algorithmic approaches produce poor APIs.
33
35
  class Names
36
+ ActiveSupport::Inflector.inflections do |inflections|
37
+ u = inflections.uncountable('send_as', 'as')
38
+ end
39
+
34
40
  include Google::Apis::Core::Logging
35
41
  include NameHelpers
36
42
 
@@ -15,7 +15,7 @@
15
15
  module Google
16
16
  module Apis
17
17
  # Client library version
18
- VERSION = '0.9.8'
18
+ VERSION = '0.9.20'
19
19
 
20
20
  # Current operating system
21
21
  # @private
@@ -0,0 +1,101 @@
1
+ # Copyright 2016 Google Inc.
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/bigquery_v2'
16
+ require 'base_cli'
17
+
18
+
19
+ module Samples
20
+ # Examples for the Google BigQuery API
21
+ #
22
+ # Sample usage:
23
+ #
24
+ # $ ./google-api-samples bigquery list_datasets --project_id=publicdata
25
+ # $ ./google-api-samples bigquery list_tables --project_id=publicdata --dataset_id=samples
26
+ # $ ./google-api-samples bigquery list_table_data --project_id=publicdata --dataset_id=samples --table_id=wikipedia --max_results=10
27
+ class Bigquery < BaseCli
28
+ Bigquery = Google::Apis::BigqueryV2
29
+
30
+ desc 'list datasets', 'List datasets'
31
+ method_option :project_id, type: :string
32
+ def list_datasets
33
+ bigquery = Bigquery::BigqueryService.new
34
+ bigquery.authorization = user_credentials_for(Bigquery::AUTH_BIGQUERY)
35
+
36
+ begin
37
+ project_id = options[:project_id] || 'publicdata'
38
+ result = bigquery.list_datasets(project_id)
39
+ data = []
40
+ data << ['id','kind']
41
+ result.datasets.each do |dataset|
42
+ data << [
43
+ dataset.id,
44
+ dataset.kind,
45
+ ]
46
+ end
47
+ print_table(data)
48
+ end
49
+ end
50
+
51
+ desc 'list tables', 'List tables'
52
+ method_option :project_id, type: :string
53
+ method_option :dataset_id, type: :string
54
+ def list_tables
55
+ bigquery = Bigquery::BigqueryService.new
56
+ bigquery.authorization = user_credentials_for(Bigquery::AUTH_BIGQUERY)
57
+
58
+ begin
59
+ project_id = options[:project_id] || 'publicdata'
60
+ dataset_id = options[:dataset_id] || 'samples'
61
+ result = bigquery.list_tables(project_id, dataset_id)
62
+ data = []
63
+ data << ['id','kind']
64
+ result.tables.each do |table|
65
+ data << [
66
+ table.id,
67
+ table.kind,
68
+ ]
69
+ end
70
+ print_table(data)
71
+ end
72
+ end
73
+
74
+ desc 'list table data', 'List table data'
75
+ method_option :project_id, type: :string
76
+ method_option :dataset_id, type: :string
77
+ method_option :table_id, type: :string
78
+ def list_table_data
79
+ bigquery = Bigquery::BigqueryService.new
80
+ bigquery.authorization = user_credentials_for(Bigquery::AUTH_BIGQUERY)
81
+
82
+ begin
83
+ project_id = options[:project_id] || 'publicdata'
84
+ dataset_id = options[:dataset_id] || 'samples'
85
+ table_id = options[:table_id] || 'wikipedia'
86
+ max_results = options[:max_results] || 10
87
+ result = bigquery.list_table_data(project_id, dataset_id, table_id, max_results: max_results)
88
+
89
+ datas = []
90
+ result.rows.each do |row|
91
+ data = []
92
+ row.f.each do |field|
93
+ data << field.v
94
+ end
95
+ datas << data
96
+ end
97
+ print_table(datas)
98
+ end
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,61 @@
1
+ # Copyright 2016 Google Inc.
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/sheets_v4'
16
+ require 'base_cli'
17
+
18
+
19
+ module Samples
20
+ # Examples for the Google Sheets API
21
+ #
22
+ # Sample usage:
23
+ #
24
+ # $ ./google-api-samples sheets get_values --spreadsheet_key='1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms' --range='Class Data!A1:F'
25
+ #
26
+ # Student Name Gender Class Level Home State Major Extracurricular Activity
27
+ # Alexandra Female 4. Senior CA English Drama Club
28
+ # Andrew Male 1. Freshman SD Math Lacrosse
29
+ # Anna Female 1. Freshman NC English Basketball
30
+ # Becky Female 2. Sophomore SD Art Baseball
31
+ # Benjamin Male 4. Senior WI English Basketball
32
+ # Carl Male 3. Junior MD Art Debate
33
+ # Carrie Female 3. Junior NE English Track & Field
34
+ # Dorothy Female 4. Senior MD Math Lacrosse
35
+ # Dylan Male 1. Freshman MA Math Baseball
36
+ # Edward Male 3. Junior FL English Drama Club
37
+ # Ellen Female 1. Freshman WI Physics Drama Club
38
+ # Fiona Female 1. Freshman MA Art Debate
39
+ # John Male 3. Junior CA Physics Basketball
40
+ # Jonathan Male 2. Sophomore SC Math Debate
41
+ class Sheets < BaseCli
42
+ Sheets = Google::Apis::SheetsV4
43
+
44
+ desc 'get_values', 'Get values from Google Spreadseets '
45
+ method_option :spreadsheet_key, type: :string, required: true
46
+ method_option :range, type: :string, required: true
47
+ def get_values
48
+ sheets = Sheets::SheetsService.new
49
+ sheets.authorization = user_credentials_for(Sheets::AUTH_SPREADSHEETS_READONLY)
50
+ result = sheets.get_spreadsheet_values(options[:spreadsheet_key], options[:range])
51
+ data = []
52
+ rows = result.values.length
53
+ rows.times.each do |row|
54
+ data.push(result.values[row])
55
+ end
56
+ print_table(data)
57
+ end
58
+
59
+ default_task :get_values
60
+ end
61
+ end