google-api-client 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  4. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +76 -1
  5. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +22 -0
  6. data/generated/google/apis/adsense_v1_4.rb +1 -1
  7. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  8. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  9. data/generated/google/apis/analyticsreporting_v4/classes.rb +32 -14
  10. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  11. data/generated/google/apis/androidenterprise_v1/classes.rb +1 -1
  12. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  13. data/generated/google/apis/appstate_v1.rb +1 -1
  14. data/generated/google/apis/bigquery_v2.rb +1 -1
  15. data/generated/google/apis/bigquery_v2/classes.rb +10 -0
  16. data/generated/google/apis/bigquery_v2/representations.rb +1 -0
  17. data/generated/google/apis/calendar_v3.rb +1 -1
  18. data/generated/google/apis/clouddebugger_v2.rb +1 -1
  19. data/generated/google/apis/clouddebugger_v2/service.rb +2 -2
  20. data/generated/google/apis/compute_beta.rb +1 -1
  21. data/generated/google/apis/compute_beta/classes.rb +28 -5
  22. data/generated/google/apis/compute_beta/representations.rb +3 -0
  23. data/generated/google/apis/compute_beta/service.rb +1 -2
  24. data/generated/google/apis/compute_v1.rb +1 -1
  25. data/generated/google/apis/compute_v1/classes.rb +680 -4
  26. data/generated/google/apis/compute_v1/representations.rb +274 -0
  27. data/generated/google/apis/compute_v1/service.rb +442 -2
  28. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  29. data/generated/google/apis/dns_v1.rb +1 -1
  30. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  31. data/generated/google/apis/drive_v2.rb +1 -1
  32. data/generated/google/apis/drive_v2/classes.rb +6 -0
  33. data/generated/google/apis/drive_v2/representations.rb +2 -0
  34. data/generated/google/apis/drive_v2/service.rb +8 -2
  35. data/generated/google/apis/drive_v3.rb +1 -1
  36. data/generated/google/apis/drive_v3/classes.rb +6 -0
  37. data/generated/google/apis/drive_v3/representations.rb +2 -0
  38. data/generated/google/apis/drive_v3/service.rb +4 -1
  39. data/generated/google/apis/fusiontables_v2.rb +1 -1
  40. data/generated/google/apis/fusiontables_v2/classes.rb +4 -3
  41. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  42. data/generated/google/apis/games_management_v1management.rb +1 -1
  43. data/generated/google/apis/games_v1.rb +1 -1
  44. data/generated/google/apis/genomics_v1.rb +1 -1
  45. data/generated/google/apis/genomics_v1/classes.rb +63 -0
  46. data/generated/google/apis/genomics_v1/representations.rb +31 -0
  47. data/generated/google/apis/gmail_v1.rb +1 -1
  48. data/generated/google/apis/groupssettings_v1.rb +1 -1
  49. data/generated/google/apis/groupssettings_v1/classes.rb +12 -0
  50. data/generated/google/apis/groupssettings_v1/representations.rb +2 -0
  51. data/generated/google/apis/identitytoolkit_v3.rb +1 -1
  52. data/generated/google/apis/identitytoolkit_v3/classes.rb +30 -0
  53. data/generated/google/apis/identitytoolkit_v3/representations.rb +5 -0
  54. data/generated/google/apis/monitoring_v3.rb +45 -0
  55. data/generated/google/apis/monitoring_v3/classes.rb +1404 -0
  56. data/generated/google/apis/monitoring_v3/representations.rb +533 -0
  57. data/generated/google/apis/monitoring_v3/service.rb +743 -0
  58. data/generated/google/apis/oauth2_v2.rb +1 -1
  59. data/generated/google/apis/plus_domains_v1.rb +1 -1
  60. data/generated/google/apis/plus_v1.rb +1 -1
  61. data/generated/google/apis/sheets_v4.rb +1 -1
  62. data/generated/google/apis/vision_v1.rb +1 -1
  63. data/generated/google/apis/vision_v1/classes.rb +10 -9
  64. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  65. data/generated/google/apis/youtube_v3.rb +1 -1
  66. data/generated/google/apis/youtube_v3/classes.rb +155 -0
  67. data/generated/google/apis/youtube_v3/representations.rb +81 -0
  68. data/generated/google/apis/youtube_v3/service.rb +6 -2
  69. data/lib/google/apis/errors.rb +2 -2
  70. data/lib/google/apis/version.rb +1 -1
  71. data/samples/cli/lib/samples/bigquery.rb +101 -0
  72. data/samples/cli/lib/samples/sheets.rb +61 -0
  73. metadata +8 -2
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/accounts/docs/OAuth2
26
26
  module Oauth2V2
27
27
  VERSION = 'V2'
28
- REVISION = '20160330'
28
+ REVISION = '20160602'
29
29
 
30
30
  # Know the list of people in your circles, your age range, and language
31
31
  AUTH_PLUS_LOGIN = 'https://www.googleapis.com/auth/plus.login'
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/+/domains/
26
26
  module PlusDomainsV1
27
27
  VERSION = 'V1'
28
- REVISION = '20160523'
28
+ REVISION = '20160607'
29
29
 
30
30
  # View your circles and the people and pages in them
31
31
  AUTH_PLUS_CIRCLES_READ = 'https://www.googleapis.com/auth/plus.circles.read'
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/+/api/
26
26
  module PlusV1
27
27
  VERSION = 'V1'
28
- REVISION = '20160523'
28
+ REVISION = '20160607'
29
29
 
30
30
  # Know the list of people in your circles, your age range, and language
31
31
  AUTH_PLUS_LOGIN = 'https://www.googleapis.com/auth/plus.login'
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/sheets/
26
26
  module SheetsV4
27
27
  VERSION = 'V4'
28
- REVISION = '20160519'
28
+ REVISION = '20160603'
29
29
 
30
30
  # View the files in your Google Drive
31
31
  AUTH_DRIVE_READONLY = 'https://www.googleapis.com/auth/drive.readonly'
@@ -27,7 +27,7 @@ module Google
27
27
  # @see https://cloud.google.com/vision/
28
28
  module VisionV1
29
29
  VERSION = 'V1'
30
- REVISION = '20160519'
30
+ REVISION = '20160606'
31
31
 
32
32
  # View and manage your data across Google Cloud Platform services
33
33
  AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
@@ -668,15 +668,14 @@ module Google
668
668
  attr_accessor :lat_long_rect
669
669
 
670
670
  # List of languages to use for TEXT_DETECTION. In most cases, an empty value
671
- # will yield the best results as it will allow text detection to
672
- # automatically detect the text language. For languages based on the latin
673
- # alphabet a hint is not needed. In rare cases, when the language of
674
- # the text in the image is known in advance, setting this hint will help get
675
- # better results (although it will hurt a great deal if the hint is wrong).
676
- # Text detection will return an error if one or more of the languages
677
- # specified here are not supported. The exact list of supported languages are
678
- # specified here:
679
- # https://cloud.google.com/translate/v2/using_rest#language-params
671
+ # yields the best results since it enables automatic language detection. For
672
+ # languages based on the Latin alphabet, setting `language_hints` is not
673
+ # needed. In rare cases, when the language of the text in the image is known,
674
+ # setting a hint will help get better results (although it will be a
675
+ # significant hindrance if the hint is wrong). Text detection returns an
676
+ # error if one or more of the specified languages is not one of the
677
+ # [supported
678
+ # languages](/translate/v2/translate-reference#supported_languages).
680
679
  # Corresponds to the JSON property `languageHints`
681
680
  # @return [Array<String>]
682
681
  attr_accessor :language_hints
@@ -1064,6 +1063,8 @@ module Google
1064
1063
  attr_accessor :source
1065
1064
 
1066
1065
  # Image content, represented as a stream of bytes.
1066
+ # Note: as with all `bytes` fields, protobuffers use a pure binary
1067
+ # representation, whereas JSON representations use base64.
1067
1068
  # Corresponds to the JSON property `content`
1068
1069
  # @return [String]
1069
1070
  attr_accessor :content
@@ -25,7 +25,7 @@ module Google
25
25
  # @see https://developers.google.com/youtube/partner/
26
26
  module YoutubePartnerV1
27
27
  VERSION = 'V1'
28
- REVISION = '20160510'
28
+ REVISION = '20160608'
29
29
 
30
30
  # View and manage your assets and associated content on YouTube
31
31
  AUTH_YOUTUBEPARTNER = 'https://www.googleapis.com/auth/youtubepartner'
@@ -26,7 +26,7 @@ module Google
26
26
  # @see https://developers.google.com/youtube/v3
27
27
  module YoutubeV3
28
28
  VERSION = 'V3'
29
- REVISION = '20160509'
29
+ REVISION = '20160606'
30
30
 
31
31
  # Manage your YouTube account
32
32
  AUTH_YOUTUBE = 'https://www.googleapis.com/auth/youtube'
@@ -4533,6 +4533,26 @@ module Google
4533
4533
  # @return [Google::Apis::YoutubeV3::LiveChatMessageRetractedDetails]
4534
4534
  attr_accessor :message_retracted_details
4535
4535
 
4536
+ #
4537
+ # Corresponds to the JSON property `pollClosedDetails`
4538
+ # @return [Google::Apis::YoutubeV3::LiveChatPollClosedDetails]
4539
+ attr_accessor :poll_closed_details
4540
+
4541
+ #
4542
+ # Corresponds to the JSON property `pollEditedDetails`
4543
+ # @return [Google::Apis::YoutubeV3::LiveChatPollEditedDetails]
4544
+ attr_accessor :poll_edited_details
4545
+
4546
+ #
4547
+ # Corresponds to the JSON property `pollOpenedDetails`
4548
+ # @return [Google::Apis::YoutubeV3::LiveChatPollOpenedDetails]
4549
+ attr_accessor :poll_opened_details
4550
+
4551
+ #
4552
+ # Corresponds to the JSON property `pollVotedDetails`
4553
+ # @return [Google::Apis::YoutubeV3::LiveChatPollVotedDetails]
4554
+ attr_accessor :poll_voted_details
4555
+
4536
4556
  # The date and time when the message was orignally published. The value is
4537
4557
  # specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
4538
4558
  # Corresponds to the JSON property `publishedAt`
@@ -4569,6 +4589,10 @@ module Google
4569
4589
  @live_chat_id = args[:live_chat_id] if args.key?(:live_chat_id)
4570
4590
  @message_deleted_details = args[:message_deleted_details] if args.key?(:message_deleted_details)
4571
4591
  @message_retracted_details = args[:message_retracted_details] if args.key?(:message_retracted_details)
4592
+ @poll_closed_details = args[:poll_closed_details] if args.key?(:poll_closed_details)
4593
+ @poll_edited_details = args[:poll_edited_details] if args.key?(:poll_edited_details)
4594
+ @poll_opened_details = args[:poll_opened_details] if args.key?(:poll_opened_details)
4595
+ @poll_voted_details = args[:poll_voted_details] if args.key?(:poll_voted_details)
4572
4596
  @published_at = args[:published_at] if args.key?(:published_at)
4573
4597
  @text_message_details = args[:text_message_details] if args.key?(:text_message_details)
4574
4598
  @type = args[:type] if args.key?(:type)
@@ -4712,6 +4736,137 @@ module Google
4712
4736
  end
4713
4737
  end
4714
4738
 
4739
+ #
4740
+ class LiveChatPollClosedDetails
4741
+ include Google::Apis::Core::Hashable
4742
+
4743
+ # The id of the poll that was closed.
4744
+ # Corresponds to the JSON property `pollId`
4745
+ # @return [String]
4746
+ attr_accessor :poll_id
4747
+
4748
+ def initialize(**args)
4749
+ update!(**args)
4750
+ end
4751
+
4752
+ # Update properties of this object
4753
+ def update!(**args)
4754
+ @poll_id = args[:poll_id] if args.key?(:poll_id)
4755
+ end
4756
+ end
4757
+
4758
+ #
4759
+ class LiveChatPollEditedDetails
4760
+ include Google::Apis::Core::Hashable
4761
+
4762
+ #
4763
+ # Corresponds to the JSON property `id`
4764
+ # @return [String]
4765
+ attr_accessor :id
4766
+
4767
+ #
4768
+ # Corresponds to the JSON property `items`
4769
+ # @return [Array<Google::Apis::YoutubeV3::LiveChatPollItem>]
4770
+ attr_accessor :items
4771
+
4772
+ #
4773
+ # Corresponds to the JSON property `prompt`
4774
+ # @return [String]
4775
+ attr_accessor :prompt
4776
+
4777
+ def initialize(**args)
4778
+ update!(**args)
4779
+ end
4780
+
4781
+ # Update properties of this object
4782
+ def update!(**args)
4783
+ @id = args[:id] if args.key?(:id)
4784
+ @items = args[:items] if args.key?(:items)
4785
+ @prompt = args[:prompt] if args.key?(:prompt)
4786
+ end
4787
+ end
4788
+
4789
+ #
4790
+ class LiveChatPollItem
4791
+ include Google::Apis::Core::Hashable
4792
+
4793
+ # Plain text description of the item.
4794
+ # Corresponds to the JSON property `description`
4795
+ # @return [String]
4796
+ attr_accessor :description
4797
+
4798
+ #
4799
+ # Corresponds to the JSON property `itemId`
4800
+ # @return [String]
4801
+ attr_accessor :item_id
4802
+
4803
+ def initialize(**args)
4804
+ update!(**args)
4805
+ end
4806
+
4807
+ # Update properties of this object
4808
+ def update!(**args)
4809
+ @description = args[:description] if args.key?(:description)
4810
+ @item_id = args[:item_id] if args.key?(:item_id)
4811
+ end
4812
+ end
4813
+
4814
+ #
4815
+ class LiveChatPollOpenedDetails
4816
+ include Google::Apis::Core::Hashable
4817
+
4818
+ #
4819
+ # Corresponds to the JSON property `id`
4820
+ # @return [String]
4821
+ attr_accessor :id
4822
+
4823
+ #
4824
+ # Corresponds to the JSON property `items`
4825
+ # @return [Array<Google::Apis::YoutubeV3::LiveChatPollItem>]
4826
+ attr_accessor :items
4827
+
4828
+ #
4829
+ # Corresponds to the JSON property `prompt`
4830
+ # @return [String]
4831
+ attr_accessor :prompt
4832
+
4833
+ def initialize(**args)
4834
+ update!(**args)
4835
+ end
4836
+
4837
+ # Update properties of this object
4838
+ def update!(**args)
4839
+ @id = args[:id] if args.key?(:id)
4840
+ @items = args[:items] if args.key?(:items)
4841
+ @prompt = args[:prompt] if args.key?(:prompt)
4842
+ end
4843
+ end
4844
+
4845
+ #
4846
+ class LiveChatPollVotedDetails
4847
+ include Google::Apis::Core::Hashable
4848
+
4849
+ # The poll item the user chose.
4850
+ # Corresponds to the JSON property `itemId`
4851
+ # @return [String]
4852
+ attr_accessor :item_id
4853
+
4854
+ # The poll the user voted on.
4855
+ # Corresponds to the JSON property `pollId`
4856
+ # @return [String]
4857
+ attr_accessor :poll_id
4858
+
4859
+ def initialize(**args)
4860
+ update!(**args)
4861
+ end
4862
+
4863
+ # Update properties of this object
4864
+ def update!(**args)
4865
+ @item_id = args[:item_id] if args.key?(:item_id)
4866
+ @poll_id = args[:poll_id] if args.key?(:poll_id)
4867
+ end
4868
+ end
4869
+
4715
4870
  #
4716
4871
  class LiveChatTextMessageDetails
4717
4872
  include Google::Apis::Core::Hashable
@@ -574,6 +574,36 @@ module Google
574
574
  include Google::Apis::Core::JsonObjectSupport
575
575
  end
576
576
 
577
+ class LiveChatPollClosedDetails
578
+ class Representation < Google::Apis::Core::JsonRepresentation; end
579
+
580
+ include Google::Apis::Core::JsonObjectSupport
581
+ end
582
+
583
+ class LiveChatPollEditedDetails
584
+ class Representation < Google::Apis::Core::JsonRepresentation; end
585
+
586
+ include Google::Apis::Core::JsonObjectSupport
587
+ end
588
+
589
+ class LiveChatPollItem
590
+ class Representation < Google::Apis::Core::JsonRepresentation; end
591
+
592
+ include Google::Apis::Core::JsonObjectSupport
593
+ end
594
+
595
+ class LiveChatPollOpenedDetails
596
+ class Representation < Google::Apis::Core::JsonRepresentation; end
597
+
598
+ include Google::Apis::Core::JsonObjectSupport
599
+ end
600
+
601
+ class LiveChatPollVotedDetails
602
+ class Representation < Google::Apis::Core::JsonRepresentation; end
603
+
604
+ include Google::Apis::Core::JsonObjectSupport
605
+ end
606
+
577
607
  class LiveChatTextMessageDetails
578
608
  class Representation < Google::Apis::Core::JsonRepresentation; end
579
609
 
@@ -2202,6 +2232,14 @@ module Google
2202
2232
 
2203
2233
  property :message_retracted_details, as: 'messageRetractedDetails', class: Google::Apis::YoutubeV3::LiveChatMessageRetractedDetails, decorator: Google::Apis::YoutubeV3::LiveChatMessageRetractedDetails::Representation
2204
2234
 
2235
+ property :poll_closed_details, as: 'pollClosedDetails', class: Google::Apis::YoutubeV3::LiveChatPollClosedDetails, decorator: Google::Apis::YoutubeV3::LiveChatPollClosedDetails::Representation
2236
+
2237
+ property :poll_edited_details, as: 'pollEditedDetails', class: Google::Apis::YoutubeV3::LiveChatPollEditedDetails, decorator: Google::Apis::YoutubeV3::LiveChatPollEditedDetails::Representation
2238
+
2239
+ property :poll_opened_details, as: 'pollOpenedDetails', class: Google::Apis::YoutubeV3::LiveChatPollOpenedDetails, decorator: Google::Apis::YoutubeV3::LiveChatPollOpenedDetails::Representation
2240
+
2241
+ property :poll_voted_details, as: 'pollVotedDetails', class: Google::Apis::YoutubeV3::LiveChatPollVotedDetails, decorator: Google::Apis::YoutubeV3::LiveChatPollVotedDetails::Representation
2242
+
2205
2243
  property :published_at, as: 'publishedAt', type: DateTime
2206
2244
 
2207
2245
  property :text_message_details, as: 'textMessageDetails', class: Google::Apis::YoutubeV3::LiveChatTextMessageDetails, decorator: Google::Apis::YoutubeV3::LiveChatTextMessageDetails::Representation
@@ -2250,6 +2288,49 @@ module Google
2250
2288
  end
2251
2289
  end
2252
2290
 
2291
+ class LiveChatPollClosedDetails
2292
+ # @private
2293
+ class Representation < Google::Apis::Core::JsonRepresentation
2294
+ property :poll_id, as: 'pollId'
2295
+ end
2296
+ end
2297
+
2298
+ class LiveChatPollEditedDetails
2299
+ # @private
2300
+ class Representation < Google::Apis::Core::JsonRepresentation
2301
+ property :id, as: 'id'
2302
+ collection :items, as: 'items', class: Google::Apis::YoutubeV3::LiveChatPollItem, decorator: Google::Apis::YoutubeV3::LiveChatPollItem::Representation
2303
+
2304
+ property :prompt, as: 'prompt'
2305
+ end
2306
+ end
2307
+
2308
+ class LiveChatPollItem
2309
+ # @private
2310
+ class Representation < Google::Apis::Core::JsonRepresentation
2311
+ property :description, as: 'description'
2312
+ property :item_id, as: 'itemId'
2313
+ end
2314
+ end
2315
+
2316
+ class LiveChatPollOpenedDetails
2317
+ # @private
2318
+ class Representation < Google::Apis::Core::JsonRepresentation
2319
+ property :id, as: 'id'
2320
+ collection :items, as: 'items', class: Google::Apis::YoutubeV3::LiveChatPollItem, decorator: Google::Apis::YoutubeV3::LiveChatPollItem::Representation
2321
+
2322
+ property :prompt, as: 'prompt'
2323
+ end
2324
+ end
2325
+
2326
+ class LiveChatPollVotedDetails
2327
+ # @private
2328
+ class Representation < Google::Apis::Core::JsonRepresentation
2329
+ property :item_id, as: 'itemId'
2330
+ property :poll_id, as: 'pollId'
2331
+ end
2332
+ end
2333
+
2253
2334
  class LiveChatTextMessageDetails
2254
2335
  # @private
2255
2336
  class Representation < Google::Apis::Core::JsonRepresentation
@@ -3622,9 +3622,12 @@ module Google
3622
3622
  # @param [Boolean] mine
3623
3623
  # Set this parameter's value to true to retrieve a feed of the authenticated
3624
3624
  # user's subscriptions.
3625
+ # @param [Boolean] my_recent_subscribers
3626
+ # Set this parameter's value to true to retrieve a feed of the subscribers of
3627
+ # the authenticated user in reverse chronological order (newest first).
3625
3628
  # @param [Boolean] my_subscribers
3626
3629
  # Set this parameter's value to true to retrieve a feed of the subscribers of
3627
- # the authenticated user.
3630
+ # the authenticated user in no particular order.
3628
3631
  # @param [String] on_behalf_of_content_owner
3629
3632
  # Note: This parameter is intended exclusively for YouTube content partners.
3630
3633
  # The onBehalfOfContentOwner parameter indicates that the request's
@@ -3679,7 +3682,7 @@ module Google
3679
3682
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3680
3683
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3681
3684
  # @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)
3685
+ 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
3686
  command = make_simple_command(:get, 'subscriptions', options)
3684
3687
  command.response_representation = Google::Apis::YoutubeV3::ListSubscriptionResponse::Representation
3685
3688
  command.response_class = Google::Apis::YoutubeV3::ListSubscriptionResponse
@@ -3688,6 +3691,7 @@ module Google
3688
3691
  command.query['id'] = id unless id.nil?
3689
3692
  command.query['maxResults'] = max_results unless max_results.nil?
3690
3693
  command.query['mine'] = mine unless mine.nil?
3694
+ command.query['myRecentSubscribers'] = my_recent_subscribers unless my_recent_subscribers.nil?
3691
3695
  command.query['mySubscribers'] = my_subscribers unless my_subscribers.nil?
3692
3696
  command.query['onBehalfOfContentOwner'] = on_behalf_of_content_owner unless on_behalf_of_content_owner.nil?
3693
3697
  command.query['onBehalfOfContentOwnerChannel'] = on_behalf_of_content_owner_channel unless on_behalf_of_content_owner_channel.nil?
@@ -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
@@ -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.9'
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