google-api-client 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/MIGRATING.md +22 -7
- data/README.md +4 -8
- data/api_names.yaml +1210 -37815
- data/generated/google/apis/acceleratedmobilepageurl_v1.rb +32 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +144 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +86 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +90 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +764 -764
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +180 -180
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +421 -421
- data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +1 -0
- data/generated/google/apis/admin_directory_v1/classes.rb +1 -0
- data/generated/google/apis/admin_reports_v1.rb +1 -1
- data/generated/google/apis/adsense_v1_4.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1.rb +1 -1
- data/generated/google/apis/analyticsreporting_v4/classes.rb +187 -187
- data/generated/google/apis/analyticsreporting_v4/representations.rb +42 -42
- data/generated/google/apis/appengine_v1.rb +40 -0
- data/generated/google/apis/appengine_v1/classes.rb +2251 -0
- data/generated/google/apis/appengine_v1/representations.rb +858 -0
- data/generated/google/apis/appengine_v1/service.rb +894 -0
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +11 -6
- data/generated/google/apis/books_v1.rb +1 -1
- data/generated/google/apis/books_v1/classes.rb +26 -0
- data/generated/google/apis/books_v1/representations.rb +15 -0
- data/generated/google/apis/books_v1/service.rb +4 -1
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/classroom_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +638 -637
- data/generated/google/apis/cloudbuild_v1/representations.rb +110 -110
- data/generated/google/apis/cloudbuild_v1/service.rb +139 -139
- data/generated/google/apis/clouddebugger_v2.rb +3 -3
- data/generated/google/apis/clouddebugger_v2/classes.rb +131 -131
- data/generated/google/apis/clouddebugger_v2/representations.rb +25 -25
- data/generated/google/apis/clouderrorreporting_v1beta1.rb +36 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +590 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +252 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +350 -0
- data/generated/google/apis/cloudfunctions_v1.rb +35 -0
- data/generated/google/apis/cloudfunctions_v1/classes.rb +98 -0
- data/generated/google/apis/cloudfunctions_v1/representations.rb +57 -0
- data/generated/google/apis/cloudfunctions_v1/service.rb +89 -0
- data/generated/google/apis/cloudkms_v1/classes.rb +277 -270
- data/generated/google/apis/cloudkms_v1/representations.rb +73 -73
- data/generated/google/apis/cloudkms_v1/service.rb +194 -194
- data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +1147 -1144
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +188 -188
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +513 -936
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +307 -916
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +63 -285
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +333 -681
- data/generated/google/apis/cloudtrace_v1/classes.rb +38 -38
- data/generated/google/apis/cloudtrace_v1/representations.rb +13 -13
- data/generated/google/apis/cloudtrace_v1/service.rb +16 -16
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +32 -7
- data/generated/google/apis/compute_beta/representations.rb +2 -0
- data/generated/google/apis/compute_beta/service.rb +11 -11
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/compute_v1/classes.rb +95 -2
- data/generated/google/apis/compute_v1/representations.rb +33 -0
- data/generated/google/apis/dataflow_v1b3/classes.rb +3333 -3333
- data/generated/google/apis/dataflow_v1b3/representations.rb +759 -759
- data/generated/google/apis/dataflow_v1b3/service.rb +154 -154
- data/generated/google/apis/dataproc_v1.rb +1 -1
- data/generated/google/apis/dataproc_v1/classes.rb +1097 -1097
- data/generated/google/apis/dataproc_v1/representations.rb +200 -200
- data/generated/google/apis/dataproc_v1/service.rb +356 -356
- data/generated/google/apis/datastore_v1.rb +4 -4
- data/generated/google/apis/datastore_v1/classes.rb +701 -690
- data/generated/google/apis/datastore_v1/representations.rb +160 -160
- data/generated/google/apis/datastore_v1/service.rb +52 -52
- data/generated/google/apis/deploymentmanager_v2/classes.rb +4 -0
- data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
- data/generated/google/apis/drive_v2.rb +1 -1
- data/generated/google/apis/drive_v2/classes.rb +158 -35
- data/generated/google/apis/drive_v2/representations.rb +39 -0
- data/generated/google/apis/drive_v2/service.rb +4 -4
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/drive_v3/classes.rb +162 -33
- data/generated/google/apis/drive_v3/representations.rb +39 -0
- data/generated/google/apis/drive_v3/service.rb +4 -4
- data/generated/google/apis/firebasedynamiclinks_v1.rb +35 -0
- data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +466 -0
- data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +222 -0
- data/generated/google/apis/firebasedynamiclinks_v1/service.rb +95 -0
- data/generated/google/apis/firebaserules_v1.rb +41 -0
- data/generated/google/apis/firebaserules_v1/classes.rb +425 -0
- data/generated/google/apis/firebaserules_v1/representations.rb +222 -0
- data/generated/google/apis/firebaserules_v1/service.rb +495 -0
- data/generated/google/apis/games_v1/classes.rb +4 -0
- data/generated/google/apis/genomics_v1.rb +7 -7
- data/generated/google/apis/genomics_v1/classes.rb +2336 -2335
- data/generated/google/apis/genomics_v1/representations.rb +387 -387
- data/generated/google/apis/genomics_v1/service.rb +1187 -1187
- data/generated/google/apis/gmail_v1/classes.rb +3 -0
- data/generated/google/apis/iam_v1.rb +1 -1
- data/generated/google/apis/iam_v1/classes.rb +123 -117
- data/generated/google/apis/iam_v1/representations.rb +33 -33
- data/generated/google/apis/iam_v1/service.rb +109 -109
- data/generated/google/apis/identitytoolkit_v3/classes.rb +5 -0
- data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
- data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
- data/generated/google/apis/kgsearch_v1/service.rb +4 -4
- data/generated/google/apis/language_v1.rb +36 -0
- data/generated/google/apis/language_v1/classes.rb +757 -0
- data/generated/google/apis/language_v1/representations.rb +338 -0
- data/generated/google/apis/language_v1/service.rb +185 -0
- data/generated/google/apis/language_v1beta1/classes.rb +407 -407
- data/generated/google/apis/language_v1beta1/representations.rb +103 -103
- data/generated/google/apis/language_v1beta1/service.rb +45 -45
- data/generated/google/apis/logging_v2.rb +46 -0
- data/generated/google/apis/logging_v2/classes.rb +1271 -0
- data/generated/google/apis/logging_v2/representations.rb +421 -0
- data/generated/google/apis/logging_v2/service.rb +1569 -0
- data/generated/google/apis/logging_v2beta1.rb +1 -1
- data/generated/google/apis/logging_v2beta1/classes.rb +886 -886
- data/generated/google/apis/logging_v2beta1/representations.rb +132 -132
- data/generated/google/apis/logging_v2beta1/service.rb +235 -235
- data/generated/google/apis/manufacturers_v1/classes.rb +147 -147
- data/generated/google/apis/manufacturers_v1/representations.rb +29 -29
- data/generated/google/apis/ml_v1.rb +34 -0
- data/generated/google/apis/ml_v1/classes.rb +1617 -0
- data/generated/google/apis/ml_v1/representations.rb +498 -0
- data/generated/google/apis/ml_v1/service.rb +769 -0
- data/generated/google/apis/monitoring_v3.rb +4 -4
- data/generated/google/apis/monitoring_v3/classes.rb +630 -630
- data/generated/google/apis/monitoring_v3/representations.rb +134 -134
- data/generated/google/apis/monitoring_v3/service.rb +240 -240
- data/generated/google/apis/pagespeedonline_v2/classes.rb +1 -0
- data/generated/google/apis/partners_v2.rb +1 -1
- data/generated/google/apis/partners_v2/classes.rb +639 -639
- data/generated/google/apis/partners_v2/representations.rb +168 -168
- data/generated/google/apis/partners_v2/service.rb +381 -381
- data/generated/google/apis/people_v1.rb +10 -10
- data/generated/google/apis/people_v1/classes.rb +524 -524
- data/generated/google/apis/people_v1/representations.rb +143 -143
- data/generated/google/apis/people_v1/service.rb +30 -30
- data/generated/google/apis/plus_domains_v1.rb +1 -1
- data/generated/google/apis/plus_v1.rb +1 -1
- data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +454 -444
- data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +90 -90
- data/generated/google/apis/proximitybeacon_v1beta1/service.rb +110 -110
- data/generated/google/apis/pubsub_v1/classes.rb +175 -173
- data/generated/google/apis/pubsub_v1/representations.rb +53 -53
- data/generated/google/apis/pubsub_v1/service.rb +210 -210
- data/generated/google/apis/replicapool_v1beta2/classes.rb +2 -0
- data/generated/google/apis/runtimeconfig_v1.rb +38 -0
- data/generated/google/apis/runtimeconfig_v1/classes.rb +252 -0
- data/generated/google/apis/runtimeconfig_v1/representations.rb +98 -0
- data/generated/google/apis/runtimeconfig_v1/service.rb +176 -0
- data/generated/google/apis/script_v1.rb +1 -1
- data/generated/google/apis/script_v1/classes.rb +6 -6
- data/generated/google/apis/script_v1/representations.rb +1 -1
- data/generated/google/apis/searchconsole_v1.rb +31 -0
- data/generated/google/apis/searchconsole_v1/classes.rb +205 -0
- data/generated/google/apis/searchconsole_v1/representations.rb +129 -0
- data/generated/google/apis/searchconsole_v1/service.rb +88 -0
- data/generated/google/apis/servicecontrol_v1.rb +38 -0
- data/generated/google/apis/servicecontrol_v1/classes.rb +1675 -0
- data/generated/google/apis/servicecontrol_v1/representations.rb +601 -0
- data/generated/google/apis/servicecontrol_v1/service.rb +337 -0
- data/generated/google/apis/servicemanagement_v1.rb +45 -0
- data/generated/google/apis/servicemanagement_v1/classes.rb +4934 -0
- data/generated/google/apis/servicemanagement_v1/representations.rb +1526 -0
- data/generated/google/apis/servicemanagement_v1/service.rb +860 -0
- data/generated/google/apis/serviceuser_v1.rb +42 -0
- data/generated/google/apis/serviceuser_v1/classes.rb +3746 -0
- data/generated/google/apis/serviceuser_v1/representations.rb +1041 -0
- data/generated/google/apis/serviceuser_v1/service.rb +214 -0
- data/generated/google/apis/sheets_v4.rb +3 -3
- data/generated/google/apis/sheets_v4/classes.rb +4390 -4390
- data/generated/google/apis/sheets_v4/representations.rb +381 -381
- data/generated/google/apis/sheets_v4/service.rb +48 -48
- data/generated/google/apis/slides_v1.rb +3 -3
- data/generated/google/apis/slides_v1/classes.rb +2860 -2860
- data/generated/google/apis/slides_v1/representations.rb +693 -693
- data/generated/google/apis/slides_v1/service.rb +30 -30
- data/generated/google/apis/sourcerepo_v1.rb +34 -0
- data/generated/google/apis/sourcerepo_v1/classes.rb +687 -0
- data/generated/google/apis/sourcerepo_v1/representations.rb +285 -0
- data/generated/google/apis/sourcerepo_v1/service.rb +291 -0
- data/generated/google/apis/spanner_v1.rb +35 -0
- data/generated/google/apis/spanner_v1/classes.rb +3294 -0
- data/generated/google/apis/spanner_v1/representations.rb +984 -0
- data/generated/google/apis/spanner_v1/service.rb +1504 -0
- data/generated/google/apis/speech_v1beta1.rb +1 -1
- data/generated/google/apis/speech_v1beta1/classes.rb +197 -196
- data/generated/google/apis/speech_v1beta1/representations.rb +53 -53
- data/generated/google/apis/speech_v1beta1/service.rb +27 -27
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +131 -0
- data/generated/google/apis/storage_v1/representations.rb +51 -0
- data/generated/google/apis/storage_v1/service.rb +182 -0
- data/generated/google/apis/storagetransfer_v1.rb +1 -1
- data/generated/google/apis/storagetransfer_v1/classes.rb +732 -661
- data/generated/google/apis/storagetransfer_v1/representations.rb +132 -132
- data/generated/google/apis/storagetransfer_v1/service.rb +174 -197
- data/generated/google/apis/surveys_v2.rb +40 -0
- data/generated/google/apis/surveys_v2/classes.rb +806 -0
- data/generated/google/apis/surveys_v2/representations.rb +347 -0
- data/generated/google/apis/surveys_v2/service.rb +477 -0
- data/generated/google/apis/tagmanager_v2.rb +52 -0
- data/generated/google/apis/tagmanager_v2/classes.rb +2435 -0
- data/generated/google/apis/tagmanager_v2/representations.rb +993 -0
- data/generated/google/apis/tagmanager_v2/service.rb +2865 -0
- data/generated/google/apis/toolresults_v1beta3.rb +34 -0
- data/generated/google/apis/toolresults_v1beta3/classes.rb +2160 -0
- data/generated/google/apis/toolresults_v1beta3/representations.rb +729 -0
- data/generated/google/apis/toolresults_v1beta3/service.rb +1236 -0
- data/generated/google/apis/tracing_v1.rb +40 -0
- data/generated/google/apis/tracing_v1/classes.rb +664 -0
- data/generated/google/apis/tracing_v1/representations.rb +279 -0
- data/generated/google/apis/tracing_v1/service.rb +225 -0
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +1223 -1222
- data/generated/google/apis/vision_v1/representations.rb +234 -234
- data/generated/google/apis/vision_v1/service.rb +10 -10
- data/generated/google/apis/webfonts_v1.rb +33 -0
- data/generated/google/apis/webfonts_v1/classes.rb +113 -0
- data/generated/google/apis/webfonts_v1/representations.rb +62 -0
- data/generated/google/apis/webfonts_v1/service.rb +102 -0
- data/generated/google/apis/youtube_analytics_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1/classes.rb +31 -0
- data/generated/google/apis/youtube_partner_v1/representations.rb +6 -0
- data/generated/google/apis/youtube_partner_v1/service.rb +41 -0
- data/generated/google/apis/youtube_v3/classes.rb +1 -0
- data/generated/google/apis/youtubereporting_v1.rb +4 -4
- data/generated/google/apis/youtubereporting_v1/classes.rb +76 -76
- data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
- data/generated/google/apis/youtubereporting_v1/service.rb +95 -95
- data/lib/google/apis/generator/annotator.rb +5 -4
- data/lib/google/apis/generator/templates/_class.tmpl +3 -0
- data/lib/google/apis/version.rb +1 -1
- data/samples/cli/lib/samples/adsense.rb +99 -0
- data/samples/cli/lib/samples/analytics.rb +18 -0
- data/samples/cli/lib/samples/gmail.rb +33 -0
- data/samples/cli/lib/samples/vision.rb +69 -0
- metadata +89 -4
- data/sync.rb +0 -71
data/sync.rb
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'google/apis/sheets_v4'
|
2
|
-
|
3
|
-
class Mapping
|
4
|
-
def initialize
|
5
|
-
@columns = []
|
6
|
-
@primary = nil
|
7
|
-
end
|
8
|
-
|
9
|
-
def add_column(name, property: nil, key: nil, getter: nil, setter: nil, hidden: false, primary: false)
|
10
|
-
getter_fn = getter if getter
|
11
|
-
getter_fn = Proc.new { |obj| obj.send(property) } if property
|
12
|
-
getter_fn = Proc.new { |obj| obj[key] } if key
|
13
|
-
setter_fn = setter if setter
|
14
|
-
setter_fn = Proc.new { |obj, val| obj.send(property + '=') } if property
|
15
|
-
setter_fn = Proc.new { |obj, val| obj[key]= val } if key
|
16
|
-
@columns.push({
|
17
|
-
name: name,
|
18
|
-
getter: getter_fn,
|
19
|
-
setter: setter_fn,
|
20
|
-
hidden: hidden
|
21
|
-
})
|
22
|
-
|
23
|
-
if primary
|
24
|
-
fail "Only one column can be the primary key" unless @primary.nil?
|
25
|
-
@primary = @columns.last
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def to_row(obj)
|
30
|
-
@columns.map { |column| column[:accessor].call(obj) }
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
class SheetSyncEngine
|
35
|
-
def initialize(mapping, sheet_id: nil)
|
36
|
-
@service = Google::Apis::SheetsV4::SheetsService.new
|
37
|
-
@sheet_id = sheet_id
|
38
|
-
@mapping = mapping
|
39
|
-
end
|
40
|
-
|
41
|
-
def credentials=(creds)
|
42
|
-
@service.authorization = creds
|
43
|
-
end
|
44
|
-
|
45
|
-
def append(items)
|
46
|
-
rows = items.map { |item| @mapping.to_row(item) }
|
47
|
-
puts rows
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
class Foo
|
52
|
-
attr_accessor :prop1
|
53
|
-
attr_accessor :prop2
|
54
|
-
|
55
|
-
def initialize(p1, p2)
|
56
|
-
@prop1 = p1
|
57
|
-
@prop2 = p2
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
mapping = Mapping.new
|
62
|
-
mapping.add_column('foo', property: :prop1)
|
63
|
-
mapping.add_column('bar', proc: Proc.new {|o| 'aaa' + o.prop2})
|
64
|
-
sync = SheetSyncEngine.new(mapping)
|
65
|
-
|
66
|
-
items = []
|
67
|
-
items.push(Foo.new('a', 'b'))
|
68
|
-
items.push(Foo.new('a1', 'b1'))
|
69
|
-
items.push(Foo.new('a2', 'b2'))
|
70
|
-
|
71
|
-
sync.append(items)
|