google-api-client 0.9.20 → 0.9.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -4
  3. data/api_names.yaml +33179 -1058
  4. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  5. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  6. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +24 -6
  7. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +2 -0
  8. data/generated/google/apis/admin_directory_v1.rb +1 -1
  9. data/generated/google/apis/admin_directory_v1/classes.rb +14 -0
  10. data/generated/google/apis/admin_directory_v1/representations.rb +2 -0
  11. data/generated/google/apis/adsense_v1_4.rb +1 -1
  12. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  13. data/generated/google/apis/analyticsreporting_v4.rb +1 -1
  14. data/generated/google/apis/analyticsreporting_v4/classes.rb +7 -0
  15. data/generated/google/apis/analyticsreporting_v4/representations.rb +1 -0
  16. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  17. data/generated/google/apis/androidenterprise_v1/classes.rb +96 -156
  18. data/generated/google/apis/androidenterprise_v1/representations.rb +18 -47
  19. data/generated/google/apis/androidenterprise_v1/service.rb +15 -459
  20. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  21. data/generated/google/apis/androidpublisher_v2/classes.rb +176 -0
  22. data/generated/google/apis/androidpublisher_v2/representations.rb +62 -0
  23. data/generated/google/apis/androidpublisher_v2/service.rb +60 -2
  24. data/generated/google/apis/appengine_v1beta5.rb +1 -1
  25. data/generated/google/apis/appengine_v1beta5/classes.rb +300 -198
  26. data/generated/google/apis/appengine_v1beta5/representations.rb +36 -0
  27. data/generated/google/apis/appengine_v1beta5/service.rb +54 -49
  28. data/generated/google/apis/appsactivity_v1.rb +1 -1
  29. data/generated/google/apis/appstate_v1.rb +1 -1
  30. data/generated/google/apis/bigquery_v2.rb +1 -1
  31. data/generated/google/apis/bigquery_v2/classes.rb +50 -6
  32. data/generated/google/apis/bigquery_v2/representations.rb +5 -0
  33. data/generated/google/apis/books_v1.rb +1 -1
  34. data/generated/google/apis/books_v1/classes.rb +7 -2
  35. data/generated/google/apis/books_v1/representations.rb +1 -0
  36. data/generated/google/apis/calendar_v3.rb +1 -1
  37. data/generated/google/apis/classroom_v1.rb +1 -1
  38. data/generated/google/apis/classroom_v1/classes.rb +74 -74
  39. data/generated/google/apis/classroom_v1/representations.rb +29 -29
  40. data/generated/google/apis/classroom_v1/service.rb +132 -28
  41. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  42. data/generated/google/apis/cloudbuild_v1/classes.rb +47 -27
  43. data/generated/google/apis/cloudbuild_v1/representations.rb +20 -7
  44. data/generated/google/apis/cloudbuild_v1/service.rb +42 -0
  45. data/generated/google/apis/clouddebugger_v2.rb +1 -1
  46. data/generated/google/apis/clouddebugger_v2/classes.rb +648 -578
  47. data/generated/google/apis/clouddebugger_v2/representations.rb +140 -140
  48. data/generated/google/apis/clouddebugger_v2/service.rb +161 -155
  49. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  50. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +563 -423
  51. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +116 -76
  52. data/generated/google/apis/cloudresourcemanager_v1/service.rb +318 -249
  53. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  54. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +396 -331
  55. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +79 -79
  56. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +317 -281
  57. data/generated/google/apis/compute_beta.rb +1 -1
  58. data/generated/google/apis/compute_beta/classes.rb +352 -80
  59. data/generated/google/apis/compute_beta/representations.rb +132 -19
  60. data/generated/google/apis/compute_beta/service.rb +214 -0
  61. data/generated/google/apis/compute_v1.rb +1 -1
  62. data/generated/google/apis/compute_v1/classes.rb +673 -73
  63. data/generated/google/apis/compute_v1/representations.rb +274 -9
  64. data/generated/google/apis/compute_v1/service.rb +1574 -2
  65. data/generated/google/apis/content_v2.rb +1 -1
  66. data/generated/google/apis/content_v2/classes.rb +7 -8
  67. data/generated/google/apis/content_v2/service.rb +125 -54
  68. data/generated/google/apis/dataflow_v1b3.rb +2 -3
  69. data/generated/google/apis/dataflow_v1b3/classes.rb +286 -114
  70. data/generated/google/apis/dataflow_v1b3/representations.rb +73 -0
  71. data/generated/google/apis/dataflow_v1b3/service.rb +37 -38
  72. data/generated/google/apis/datastore_v1.rb +1 -1
  73. data/generated/google/apis/datastore_v1/classes.rb +5 -0
  74. data/generated/google/apis/deploymentmanager_v2.rb +1 -1
  75. data/generated/google/apis/deploymentmanager_v2/classes.rb +37 -5
  76. data/generated/google/apis/deploymentmanager_v2/representations.rb +16 -0
  77. data/generated/google/apis/deploymentmanager_v2/service.rb +4 -1
  78. data/generated/google/apis/dns_v1.rb +1 -1
  79. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  80. data/generated/google/apis/drive_v2.rb +1 -1
  81. data/generated/google/apis/drive_v2/classes.rb +55 -21
  82. data/generated/google/apis/drive_v2/representations.rb +2 -0
  83. data/generated/google/apis/drive_v3.rb +1 -1
  84. data/generated/google/apis/drive_v3/classes.rb +41 -12
  85. data/generated/google/apis/drive_v3/representations.rb +2 -0
  86. data/generated/google/apis/fitness_v1.rb +31 -1
  87. data/generated/google/apis/fitness_v1/classes.rb +1 -1
  88. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  89. data/generated/google/apis/games_management_v1management.rb +1 -1
  90. data/generated/google/apis/games_v1.rb +1 -1
  91. data/generated/google/apis/gmail_v1.rb +1 -1
  92. data/generated/google/apis/gmail_v1/classes.rb +32 -1
  93. data/generated/google/apis/gmail_v1/representations.rb +15 -0
  94. data/generated/google/apis/gmail_v1/service.rb +41 -2
  95. data/generated/google/apis/identitytoolkit_v3.rb +4 -1
  96. data/generated/google/apis/identitytoolkit_v3/classes.rb +7 -0
  97. data/generated/google/apis/identitytoolkit_v3/representations.rb +1 -0
  98. data/generated/google/apis/kgsearch_v1.rb +2 -3
  99. data/generated/google/apis/kgsearch_v1/classes.rb +10 -10
  100. data/generated/google/apis/kgsearch_v1/representations.rb +2 -2
  101. data/generated/google/apis/kgsearch_v1/service.rb +28 -26
  102. data/generated/google/apis/language_v1beta1.rb +1 -1
  103. data/generated/google/apis/language_v1beta1/classes.rb +166 -8
  104. data/generated/google/apis/language_v1beta1/representations.rb +50 -0
  105. data/generated/google/apis/language_v1beta1/service.rb +32 -0
  106. data/generated/google/apis/logging_v2beta1.rb +6 -6
  107. data/generated/google/apis/logging_v2beta1/classes.rb +868 -789
  108. data/generated/google/apis/logging_v2beta1/representations.rb +179 -147
  109. data/generated/google/apis/logging_v2beta1/service.rb +378 -211
  110. data/generated/google/apis/monitoring_v3.rb +1 -1
  111. data/generated/google/apis/monitoring_v3/classes.rb +110 -112
  112. data/generated/google/apis/monitoring_v3/service.rb +68 -73
  113. data/generated/google/apis/pagespeedonline_v2.rb +1 -1
  114. data/generated/google/apis/plus_domains_v1.rb +1 -1
  115. data/generated/google/apis/plus_v1.rb +1 -1
  116. data/generated/google/apis/pubsub_v1.rb +1 -1
  117. data/generated/google/apis/pubsub_v1/classes.rb +380 -327
  118. data/generated/google/apis/pubsub_v1/representations.rb +79 -79
  119. data/generated/google/apis/pubsub_v1/service.rb +424 -396
  120. data/generated/google/apis/sheets_v4.rb +1 -1
  121. data/generated/google/apis/sheets_v4/classes.rb +175 -53
  122. data/generated/google/apis/sheets_v4/representations.rb +48 -13
  123. data/generated/google/apis/site_verification_v1.rb +1 -1
  124. data/generated/google/apis/slides_v1.rb +1 -1
  125. data/generated/google/apis/slides_v1/classes.rb +149 -31
  126. data/generated/google/apis/slides_v1/representations.rb +52 -9
  127. data/generated/google/apis/slides_v1/service.rb +5 -5
  128. data/generated/google/apis/speech_v1beta1.rb +1 -1
  129. data/generated/google/apis/speech_v1beta1/service.rb +3 -1
  130. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  131. data/generated/google/apis/sqladmin_v1beta4/classes.rb +54 -2
  132. data/generated/google/apis/sqladmin_v1beta4/representations.rb +29 -0
  133. data/generated/google/apis/sqladmin_v1beta4/service.rb +41 -0
  134. data/generated/google/apis/storage_v1.rb +1 -1
  135. data/generated/google/apis/storage_v1/classes.rb +7 -0
  136. data/generated/google/apis/storage_v1/representations.rb +2 -0
  137. data/generated/google/apis/tagmanager_v1.rb +5 -5
  138. data/generated/google/apis/vision_v1.rb +1 -1
  139. data/generated/google/apis/vision_v1/classes.rb +63 -59
  140. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  141. data/generated/google/apis/youtube_analytics_v1/classes.rb +0 -209
  142. data/generated/google/apis/youtube_analytics_v1/representations.rb +0 -99
  143. data/generated/google/apis/youtube_analytics_v1/service.rb +0 -76
  144. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  145. data/generated/google/apis/youtube_partner_v1/classes.rb +71 -0
  146. data/generated/google/apis/youtube_partner_v1/representations.rb +33 -0
  147. data/generated/google/apis/youtube_partner_v1/service.rb +52 -0
  148. data/generated/google/apis/youtube_v3.rb +1 -1
  149. data/generated/google/apis/youtube_v3/classes.rb +15 -2
  150. data/generated/google/apis/youtube_v3/representations.rb +3 -0
  151. data/generated/google/apis/youtube_v3/service.rb +4 -4
  152. data/generated/google/apis/youtubereporting_v1.rb +4 -4
  153. data/generated/google/apis/youtubereporting_v1/classes.rb +146 -137
  154. data/generated/google/apis/youtubereporting_v1/representations.rb +33 -33
  155. data/generated/google/apis/youtubereporting_v1/service.rb +149 -145
  156. data/lib/google/apis/version.rb +1 -1
  157. data/samples/cli/lib/samples/calendar.rb +1 -1
  158. data/samples/cli/lib/samples/gmail.rb +74 -0
  159. metadata +29 -29
@@ -15,7 +15,7 @@
15
15
  module Google
16
16
  module Apis
17
17
  # Client library version
18
- VERSION = '0.9.20'
18
+ VERSION = '0.9.21'
19
19
 
20
20
  # Current operating system
21
21
  # @private
@@ -36,7 +36,7 @@ module Samples
36
36
 
37
37
  event = {
38
38
  summary: options[:summary],
39
- attendees: Array(options[:attenddes]).map { |email| { email: email } },
39
+ attendees: Array(options[:attendees]).map { |email| { email: email } },
40
40
  start: {
41
41
  date_time: DateTime.parse(options[:start])
42
42
  },
@@ -28,6 +28,33 @@ module Samples
28
28
  class Gmail < BaseCli
29
29
  Gmail = Google::Apis::GmailV1
30
30
 
31
+ desc 'get ID', 'Get a message for an id with the gmail API'
32
+ def get(id)
33
+ gmail = Gmail::GmailService.new
34
+ gmail.authorization = user_credentials_for(Gmail::AUTH_SCOPE)
35
+
36
+ result = gmail.get_user_message('me', id)
37
+ payload = result.payload
38
+ headers = payload.headers
39
+
40
+ date = headers.any? { |h| h.name == 'Date' } ? headers.find { |h| h.name == 'Date' }.value : ''
41
+ from = headers.any? { |h| h.name == 'From' } ? headers.find { |h| h.name == 'From' }.value : ''
42
+ to = headers.any? { |h| h.name == 'To' } ? headers.find { |h| h.name == 'To' }.value : ''
43
+ subject = headers.any? { |h| h.name == 'Subject' } ? headers.find { |h| h.name == 'Subject' }.value : ''
44
+
45
+ body = payload.body.data
46
+ if body.nil? && payload.parts.any?
47
+ body = payload.parts.map { |part| part.body.data }.join
48
+ end
49
+
50
+ puts "id: #{result.id}"
51
+ puts "date: #{date}"
52
+ puts "from: #{from}"
53
+ puts "to: #{to}"
54
+ puts "subject: #{subject}"
55
+ puts "body: #{body}"
56
+ end
57
+
31
58
  desc 'send TEXT', 'Send a message with the gmail API'
32
59
  method_option :to, type: :string, required: true
33
60
  method_option :from, type: :string, required: true
@@ -46,5 +73,52 @@ module Samples
46
73
  upload_source: StringIO.new(message.to_s),
47
74
  content_type: 'message/rfc822')
48
75
  end
76
+
77
+ desc 'list', 'list messages with the gmail API'
78
+ method_option :limit, type: :numeric, default: 100
79
+ def list
80
+ gmail = Gmail::GmailService.new
81
+ gmail.authorization = user_credentials_for(Gmail::AUTH_SCOPE)
82
+
83
+ messages = []
84
+ next_page = nil
85
+ begin
86
+ result = gmail.list_user_messages('me', max_results: [options[:limit], 500].min, page_token: next_page)
87
+ messages += result.messages
88
+ break if messages.size >= options[:limit]
89
+ next_page = result.next_page_token
90
+ end while next_page
91
+
92
+ puts "Found #{messages.size} messages"
93
+ end
94
+
95
+ desc 'search QUERY', 'Search messages matching the specified query with the gmail API'
96
+ method_option :limit, type: :numeric, default: 100
97
+ def search(query)
98
+ gmail = Gmail::GmailService.new
99
+ gmail.authorization = user_credentials_for(Gmail::AUTH_SCOPE)
100
+
101
+ ids =
102
+ gmail.fetch_all(max: options[:limit], items: :messages) do |token|
103
+ gmail.list_user_messages('me', max_results: [options[:limit], 500].min, q: query, page_token: token)
104
+ end.map(&:id)
105
+
106
+ callback = lambda do |result, err|
107
+ if err
108
+ puts "error: #{err.inspect}"
109
+ else
110
+ headers = result.payload.headers
111
+ date = headers.any? { |h| h.name == 'Date' } ? headers.find { |h| h.name == 'Date' }.value : ''
112
+ subject = headers.any? { |h| h.name == 'Subject' } ? headers.find { |h| h.name == 'Subject' }.value : ''
113
+ puts "#{result.id}, #{date}, #{subject}"
114
+ end
115
+ end
116
+
117
+ ids.each_slice(1000) do |ids_array|
118
+ gmail.batch do |gm|
119
+ ids_array.each { |id| gm.get_user_message('me', id, &callback) }
120
+ end
121
+ end
122
+ end
49
123
  end
50
124
  end
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.20
4
+ version: 0.9.21
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: 2016-11-08 00:00:00.000000000 Z
14
+ date: 2017-01-20 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
@@ -696,17 +696,17 @@ require_paths:
696
696
  - third_party
697
697
  required_ruby_version: !ruby/object:Gem::Requirement
698
698
  requirements:
699
- - - "~>"
699
+ - - ~>
700
700
  - !ruby/object:Gem::Version
701
701
  version: '2.0'
702
702
  required_rubygems_version: !ruby/object:Gem::Requirement
703
703
  requirements:
704
- - - ">="
704
+ - - '>='
705
705
  - !ruby/object:Gem::Version
706
706
  version: '0'
707
707
  requirements: []
708
708
  rubyforge_project:
709
- rubygems_version: 2.4.6
709
+ rubygems_version: 2.4.8
710
710
  signing_key:
711
711
  specification_version: 4
712
712
  summary: Client for accessing Google APIs