google-api-client 0.9.9 → 0.9.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile +8 -0
- data/api_names.yaml +62 -55
- 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.rb +1 -1
- data/generated/google/apis/androidenterprise_v1.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/classes.rb +534 -39
- data/generated/google/apis/androidenterprise_v1/representations.rb +222 -0
- data/generated/google/apis/androidenterprise_v1/service.rb +595 -10
- data/generated/google/apis/androidpublisher_v2.rb +1 -1
- data/generated/google/apis/appengine_v1beta5.rb +1 -1
- data/generated/google/apis/appengine_v1beta5/classes.rb +66 -6
- data/generated/google/apis/appengine_v1beta5/representations.rb +29 -0
- data/generated/google/apis/appengine_v1beta5/service.rb +15 -1
- data/generated/google/apis/appstate_v1.rb +1 -1
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +12 -4
- data/generated/google/apis/bigquery_v2/representations.rb +1 -0
- data/generated/google/apis/books_v1.rb +2 -2
- data/generated/google/apis/books_v1/classes.rb +77 -0
- data/generated/google/apis/books_v1/representations.rb +34 -0
- data/generated/google/apis/books_v1/service.rb +2 -2
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +110 -0
- data/generated/google/apis/cloudbuild_v1/representations.rb +60 -0
- data/generated/google/apis/cloudmonitoring_v2beta2.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +157 -3
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +33 -0
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +60 -21
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +22 -5
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +2 -0
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +61 -39
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +678 -17
- data/generated/google/apis/compute_beta/representations.rb +235 -0
- data/generated/google/apis/compute_beta/service.rb +1280 -600
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/compute_v1/classes.rb +34 -13
- data/generated/google/apis/compute_v1/representations.rb +14 -0
- data/generated/google/apis/compute_v1/service.rb +42 -0
- data/generated/google/apis/content_v2.rb +1 -1
- data/generated/google/apis/content_v2/classes.rb +14 -0
- data/generated/google/apis/content_v2/representations.rb +2 -0
- data/generated/google/apis/datastore_v1beta3.rb +38 -0
- data/generated/google/apis/datastore_v1beta3/classes.rb +1237 -0
- data/generated/google/apis/datastore_v1beta3/representations.rb +567 -0
- data/generated/google/apis/datastore_v1beta3/service.rb +259 -0
- data/generated/google/apis/deploymentmanager_v2.rb +1 -1
- data/generated/google/apis/deploymentmanager_v2/classes.rb +6 -0
- data/generated/google/apis/deploymentmanager_v2/representations.rb +2 -0
- data/generated/google/apis/deploymentmanager_v2/service.rb +40 -50
- data/generated/google/apis/dfareporting_v2_5.rb +40 -0
- data/generated/google/apis/dfareporting_v2_5/classes.rb +11225 -0
- data/generated/google/apis/dfareporting_v2_5/representations.rb +3982 -0
- data/generated/google/apis/dfareporting_v2_5/service.rb +8755 -0
- data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
- data/generated/google/apis/drive_v2.rb +1 -1
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/fitness_v1.rb +2 -2
- data/generated/google/apis/fitness_v1/classes.rb +48 -5
- data/generated/google/apis/fitness_v1/representations.rb +18 -0
- data/generated/google/apis/fitness_v1/service.rb +15 -16
- data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
- data/generated/google/apis/games_management_v1management.rb +1 -1
- data/generated/google/apis/games_v1.rb +1 -1
- data/generated/google/apis/genomics_v1.rb +2 -4
- data/generated/google/apis/genomics_v1/classes.rb +35 -7
- data/generated/google/apis/genomics_v1/representations.rb +7 -3
- data/generated/google/apis/genomics_v1/service.rb +1 -3
- data/generated/google/apis/gmail_v1.rb +7 -1
- data/generated/google/apis/gmail_v1/classes.rb +543 -0
- data/generated/google/apis/gmail_v1/representations.rb +213 -0
- data/generated/google/apis/gmail_v1/service.rb +898 -1
- data/generated/google/apis/identitytoolkit_v3.rb +1 -1
- data/generated/google/apis/mirror_v1.rb +2 -2
- data/generated/google/apis/mirror_v1/service.rb +1 -1
- data/generated/google/apis/monitoring_v3.rb +1 -1
- data/generated/google/apis/monitoring_v3/classes.rb +7 -6
- data/generated/google/apis/oauth2_v2.rb +1 -1
- data/generated/google/apis/pagespeedonline_v2.rb +1 -1
- data/generated/google/apis/plus_domains_v1.rb +1 -1
- data/generated/google/apis/plus_v1.rb +1 -1
- data/generated/google/apis/replicapool_v1beta2.rb +1 -1
- data/generated/google/apis/sheets_v4.rb +1 -1
- data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
- data/generated/google/apis/sqladmin_v1beta4/classes.rb +14 -8
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +17 -9
- data/generated/google/apis/translate_v2.rb +2 -2
- data/generated/google/apis/translate_v2/service.rb +1 -1
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/generated/google/apis/youtube_v3.rb +1 -1
- data/generated/google/apis/youtube_v3/classes.rb +8 -2
- data/generated/google/apis/youtube_v3/representations.rb +1 -0
- data/lib/google/apis/core/base_service.rb +3 -2
- data/lib/google/apis/core/upload.rb +7 -1
- data/lib/google/apis/version.rb +1 -1
- data/sync.rb +71 -0
- metadata +11 -2
@@ -20,12 +20,12 @@ module Google
|
|
20
20
|
module Apis
|
21
21
|
# Google Mirror API
|
22
22
|
#
|
23
|
-
#
|
23
|
+
# Interacts with Glass users via the timeline.
|
24
24
|
#
|
25
25
|
# @see https://developers.google.com/glass
|
26
26
|
module MirrorV1
|
27
27
|
VERSION = 'V1'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20160616'
|
29
29
|
|
30
30
|
# View your location
|
31
31
|
AUTH_GLASS_LOCATION = 'https://www.googleapis.com/auth/glass.location'
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# @see https://cloud.google.com/monitoring/api/
|
28
28
|
module MonitoringV3
|
29
29
|
VERSION = 'V3'
|
30
|
-
REVISION = '
|
30
|
+
REVISION = '20160620'
|
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'
|
@@ -312,7 +312,7 @@ module Google
|
|
312
312
|
# MonitoredResourceDescriptor for `"gce_instance"` has labels
|
313
313
|
# `"instance_id"` and `"zone"`:
|
314
314
|
# ` "type": "gce_instance",
|
315
|
-
# "labels": ` "instance_id": "
|
315
|
+
# "labels": ` "instance_id": "12345678901234",
|
316
316
|
# "zone": "us-central1-a" ``
|
317
317
|
# Corresponds to the JSON property `resource`
|
318
318
|
# @return [Google::Apis::MonitoringV3::MonitoredResource]
|
@@ -478,17 +478,17 @@ module Google
|
|
478
478
|
class Exponential
|
479
479
|
include Google::Apis::Core::Hashable
|
480
480
|
|
481
|
-
# Must be greater than 1
|
481
|
+
# Must be greater than 1.
|
482
482
|
# Corresponds to the JSON property `growthFactor`
|
483
483
|
# @return [Float]
|
484
484
|
attr_accessor :growth_factor
|
485
485
|
|
486
|
-
# Must be greater than 0
|
486
|
+
# Must be greater than 0.
|
487
487
|
# Corresponds to the JSON property `scale`
|
488
488
|
# @return [Float]
|
489
489
|
attr_accessor :scale
|
490
490
|
|
491
|
-
#
|
491
|
+
# Must be greater than 0.
|
492
492
|
# Corresponds to the JSON property `numFiniteBuckets`
|
493
493
|
# @return [Fixnum]
|
494
494
|
attr_accessor :num_finite_buckets
|
@@ -769,7 +769,7 @@ module Google
|
|
769
769
|
# MonitoredResourceDescriptor for `"gce_instance"` has labels
|
770
770
|
# `"instance_id"` and `"zone"`:
|
771
771
|
# ` "type": "gce_instance",
|
772
|
-
# "labels": ` "instance_id": "
|
772
|
+
# "labels": ` "instance_id": "12345678901234",
|
773
773
|
# "zone": "us-central1-a" ``
|
774
774
|
class MonitoredResource
|
775
775
|
include Google::Apis::Core::Hashable
|
@@ -862,6 +862,7 @@ module Google
|
|
862
862
|
|
863
863
|
# Required. The monitored resource type. For example, the type
|
864
864
|
# `"cloudsql_database"` represents databases in Google Cloud SQL.
|
865
|
+
# The maximum length of this value is 256 characters.
|
865
866
|
# Corresponds to the JSON property `type`
|
866
867
|
# @return [String]
|
867
868
|
attr_accessor :type
|
@@ -1260,7 +1261,7 @@ module Google
|
|
1260
1261
|
# MonitoredResourceDescriptor for `"gce_instance"` has labels
|
1261
1262
|
# `"instance_id"` and `"zone"`:
|
1262
1263
|
# ` "type": "gce_instance",
|
1263
|
-
# "labels": ` "instance_id": "
|
1264
|
+
# "labels": ` "instance_id": "12345678901234",
|
1264
1265
|
# "zone": "us-central1-a" ``
|
1265
1266
|
# Corresponds to the JSON property `resource`
|
1266
1267
|
# @return [Google::Apis::MonitoringV3::MonitoredResource]
|
@@ -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 = '
|
28
|
+
REVISION = '20160624'
|
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 = '
|
28
|
+
REVISION = '20160629'
|
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 = '
|
28
|
+
REVISION = '20160629'
|
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'
|
@@ -26,7 +26,7 @@ module Google
|
|
26
26
|
# @see https://developers.google.com/compute/docs/instance-groups/manager/v1beta2
|
27
27
|
module ReplicapoolV1beta2
|
28
28
|
VERSION = 'V1beta2'
|
29
|
-
REVISION = '
|
29
|
+
REVISION = '20160512'
|
30
30
|
|
31
31
|
# View and manage your data across Google Cloud Platform services
|
32
32
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @see https://developers.google.com/sheets/
|
26
26
|
module SheetsV4
|
27
27
|
VERSION = 'V4'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20160623'
|
29
29
|
|
30
30
|
# View the files in your Google Drive
|
31
31
|
AUTH_DRIVE_READONLY = 'https://www.googleapis.com/auth/drive.readonly'
|
@@ -26,7 +26,7 @@ module Google
|
|
26
26
|
# @see https://cloud.google.com/sql/docs/reference/latest
|
27
27
|
module SqladminV1beta4
|
28
28
|
VERSION = 'V1beta4'
|
29
|
-
REVISION = '
|
29
|
+
REVISION = '20160630'
|
30
30
|
|
31
31
|
# View and manage your data across Google Cloud Platform services
|
32
32
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
@@ -555,7 +555,9 @@ module Google
|
|
555
555
|
attr_accessor :available
|
556
556
|
alias_method :available?, :available
|
557
557
|
|
558
|
-
# The name of the failover replica.
|
558
|
+
# The name of the failover replica. If specified at instance creation, a
|
559
|
+
# failover replica is created for the instance. The name doesn't include the
|
560
|
+
# project ID. This property is applicable only to Second Generation instances.
|
559
561
|
# Corresponds to the JSON property `name`
|
560
562
|
# @return [String]
|
561
563
|
attr_accessor :name
|
@@ -1541,13 +1543,17 @@ module Google
|
|
1541
1543
|
class Settings
|
1542
1544
|
include Google::Apis::Core::Hashable
|
1543
1545
|
|
1544
|
-
# The activation policy
|
1545
|
-
#
|
1546
|
-
#
|
1547
|
-
#
|
1548
|
-
#
|
1549
|
-
#
|
1550
|
-
#
|
1546
|
+
# The activation policy specifies when the instance is activated; it is
|
1547
|
+
# applicable only when the instance state is RUNNABLE. The activation policy
|
1548
|
+
# cannot be updated together with other settings for Second Generation instances.
|
1549
|
+
# Valid values:
|
1550
|
+
# ALWAYS: The instance is on; it is not deactivated by inactivity.
|
1551
|
+
# NEVER: The instance is off; it is not activated, even if a connection request
|
1552
|
+
# arrives.
|
1553
|
+
# ON_DEMAND: The instance responds to incoming requests, and turns itself off
|
1554
|
+
# when not in use. Instances with PER_USE pricing turn off after 15 minutes of
|
1555
|
+
# inactivity. Instances with PER_PACKAGE pricing turn off after 12 hours of
|
1556
|
+
# inactivity.
|
1551
1557
|
# Corresponds to the JSON property `activationPolicy`
|
1552
1558
|
# @return [String]
|
1553
1559
|
attr_accessor :activation_policy
|
@@ -25,7 +25,7 @@ module Google
|
|
25
25
|
# @see https://developers.google.com/storage/docs/json_api/
|
26
26
|
module StorageV1
|
27
27
|
VERSION = 'V1'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20160622'
|
29
29
|
|
30
30
|
# View and manage your data across Google Cloud Platform services
|
31
31
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
@@ -123,7 +123,9 @@ module Google
|
|
123
123
|
# @return [Google::Apis::StorageV1::Bucket::Versioning]
|
124
124
|
attr_accessor :versioning
|
125
125
|
|
126
|
-
# The bucket's website configuration
|
126
|
+
# The bucket's website configuration, controlling how the service behaves when
|
127
|
+
# accessing bucket contents as a web site. See the Static Website Examples for
|
128
|
+
# more information.
|
127
129
|
# Corresponds to the JSON property `website`
|
128
130
|
# @return [Google::Apis::StorageV1::Bucket::Website]
|
129
131
|
attr_accessor :website
|
@@ -377,17 +379,23 @@ module Google
|
|
377
379
|
end
|
378
380
|
end
|
379
381
|
|
380
|
-
# The bucket's website configuration
|
382
|
+
# The bucket's website configuration, controlling how the service behaves when
|
383
|
+
# accessing bucket contents as a web site. See the Static Website Examples for
|
384
|
+
# more information.
|
381
385
|
class Website
|
382
386
|
include Google::Apis::Core::Hashable
|
383
387
|
|
384
|
-
#
|
385
|
-
#
|
388
|
+
# If the requested object path is missing, the service will ensure the path has
|
389
|
+
# a trailing '/', append this suffix, and attempt to retrieve the resulting
|
390
|
+
# object. This allows the creation of index.html objects to represent directory
|
391
|
+
# pages.
|
386
392
|
# Corresponds to the JSON property `mainPageSuffix`
|
387
393
|
# @return [String]
|
388
394
|
attr_accessor :main_page_suffix
|
389
395
|
|
390
|
-
#
|
396
|
+
# If the requested object path is missing, and any mainPageSuffix object is
|
397
|
+
# missing, if applicable, the service will return the named object from this
|
398
|
+
# bucket as the content for a 404 Not Found result.
|
391
399
|
# Corresponds to the JSON property `notFoundPage`
|
392
400
|
# @return [String]
|
393
401
|
attr_accessor :not_found_page
|
@@ -466,7 +474,7 @@ module Google
|
|
466
474
|
# @return [Google::Apis::StorageV1::BucketAccessControl::ProjectTeam]
|
467
475
|
attr_accessor :project_team
|
468
476
|
|
469
|
-
# The access permission for the entity.
|
477
|
+
# The access permission for the entity.
|
470
478
|
# Corresponds to the JSON property `role`
|
471
479
|
# @return [String]
|
472
480
|
attr_accessor :role
|
@@ -504,7 +512,7 @@ module Google
|
|
504
512
|
# @return [String]
|
505
513
|
attr_accessor :project_number
|
506
514
|
|
507
|
-
# The team.
|
515
|
+
# The team.
|
508
516
|
# Corresponds to the JSON property `team`
|
509
517
|
# @return [String]
|
510
518
|
attr_accessor :team
|
@@ -1043,7 +1051,7 @@ module Google
|
|
1043
1051
|
# @return [Google::Apis::StorageV1::ObjectAccessControl::ProjectTeam]
|
1044
1052
|
attr_accessor :project_team
|
1045
1053
|
|
1046
|
-
# The access permission for the entity.
|
1054
|
+
# The access permission for the entity.
|
1047
1055
|
# Corresponds to the JSON property `role`
|
1048
1056
|
# @return [String]
|
1049
1057
|
attr_accessor :role
|
@@ -1083,7 +1091,7 @@ module Google
|
|
1083
1091
|
# @return [String]
|
1084
1092
|
attr_accessor :project_number
|
1085
1093
|
|
1086
|
-
# The team.
|
1094
|
+
# The team.
|
1087
1095
|
# Corresponds to the JSON property `team`
|
1088
1096
|
# @return [String]
|
1089
1097
|
attr_accessor :team
|
@@ -20,12 +20,12 @@ module Google
|
|
20
20
|
module Apis
|
21
21
|
# Translate API
|
22
22
|
#
|
23
|
-
#
|
23
|
+
# Translates text from one language to another.
|
24
24
|
#
|
25
25
|
# @see https://developers.google.com/translate/v2/using_rest
|
26
26
|
module TranslateV2
|
27
27
|
VERSION = 'V2'
|
28
|
-
REVISION = '
|
28
|
+
REVISION = '20160627'
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# @see https://cloud.google.com/vision/
|
28
28
|
module VisionV1
|
29
29
|
VERSION = 'V1'
|
30
|
-
REVISION = '
|
30
|
+
REVISION = '20160703'
|
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'
|
@@ -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 = '
|
28
|
+
REVISION = '20160628'
|
29
29
|
|
30
30
|
# View and manage your assets and associated content on YouTube
|
31
31
|
AUTH_YOUTUBEPARTNER = 'https://www.googleapis.com/auth/youtubepartner'
|
@@ -2296,7 +2296,7 @@ module Google
|
|
2296
2296
|
end
|
2297
2297
|
|
2298
2298
|
# Ratings schemes. The country-specific ratings are mostly for movies and shows.
|
2299
|
-
# NEXT_ID:
|
2299
|
+
# NEXT_ID: 68
|
2300
2300
|
class ContentRating
|
2301
2301
|
include Google::Apis::Core::Hashable
|
2302
2302
|
|
@@ -2461,6 +2461,11 @@ module Google
|
|
2461
2461
|
# @return [String]
|
2462
2462
|
attr_accessor :fpb_rating
|
2463
2463
|
|
2464
|
+
# Reasons that explain why the video received its FPB (South Africa) rating.
|
2465
|
+
# Corresponds to the JSON property `fpbRatingReasons`
|
2466
|
+
# @return [Array<String>]
|
2467
|
+
attr_accessor :fpb_rating_reasons
|
2468
|
+
|
2464
2469
|
# The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - Germany)
|
2465
2470
|
# rating.
|
2466
2471
|
# Corresponds to the JSON property `fskRating`
|
@@ -2696,6 +2701,7 @@ module Google
|
|
2696
2701
|
@fco_rating = args[:fco_rating] if args.key?(:fco_rating)
|
2697
2702
|
@fmoc_rating = args[:fmoc_rating] if args.key?(:fmoc_rating)
|
2698
2703
|
@fpb_rating = args[:fpb_rating] if args.key?(:fpb_rating)
|
2704
|
+
@fpb_rating_reasons = args[:fpb_rating_reasons] if args.key?(:fpb_rating_reasons)
|
2699
2705
|
@fsk_rating = args[:fsk_rating] if args.key?(:fsk_rating)
|
2700
2706
|
@grfilm_rating = args[:grfilm_rating] if args.key?(:grfilm_rating)
|
2701
2707
|
@icaa_rating = args[:icaa_rating] if args.key?(:icaa_rating)
|
@@ -7274,7 +7280,7 @@ module Google
|
|
7274
7280
|
attr_accessor :caption
|
7275
7281
|
|
7276
7282
|
# Ratings schemes. The country-specific ratings are mostly for movies and shows.
|
7277
|
-
# NEXT_ID:
|
7283
|
+
# NEXT_ID: 68
|
7278
7284
|
# Corresponds to the JSON property `contentRating`
|
7279
7285
|
# @return [Google::Apis::YoutubeV3::ContentRating]
|
7280
7286
|
attr_accessor :content_rating
|
@@ -1719,6 +1719,7 @@ module Google
|
|
1719
1719
|
property :fco_rating, as: 'fcoRating'
|
1720
1720
|
property :fmoc_rating, as: 'fmocRating'
|
1721
1721
|
property :fpb_rating, as: 'fpbRating'
|
1722
|
+
collection :fpb_rating_reasons, as: 'fpbRatingReasons'
|
1722
1723
|
property :fsk_rating, as: 'fskRating'
|
1723
1724
|
property :grfilm_rating, as: 'grfilmRating'
|
1724
1725
|
property :icaa_rating, as: 'icaaRating'
|
@@ -63,11 +63,12 @@ module Google
|
|
63
63
|
item_count = 0
|
64
64
|
loop do
|
65
65
|
@last_result = @fetch_proc.call(page_token)
|
66
|
-
|
66
|
+
items = @last_result.send(@items_field)
|
67
|
+
for item in items
|
67
68
|
item_count = item_count + 1
|
68
69
|
break if @max && item_count > @max
|
69
70
|
yield item
|
70
|
-
end
|
71
|
+
end unless items.nil?
|
71
72
|
break if @max && item_count >= @max
|
72
73
|
break if @last_result.next_page_token.nil? || @last_result.next_page_token == page_token
|
73
74
|
page_token = @last_result.next_page_token
|
@@ -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
|
data/lib/google/apis/version.rb
CHANGED
data/sync.rb
ADDED
@@ -0,0 +1,71 @@
|
|
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)
|