google-api-client 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/api_names.yaml +395 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +254 -254
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +65 -65
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +220 -220
- data/generated/google/apis/admin_directory_v1.rb +1 -1
- data/generated/google/apis/admin_directory_v1/classes.rb +106 -0
- data/generated/google/apis/admin_directory_v1/representations.rb +37 -0
- data/generated/google/apis/admin_reports_v1.rb +3 -3
- data/generated/google/apis/admin_reports_v1/service.rb +6 -6
- data/generated/google/apis/adsense_v1_4.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1.rb +1 -1
- data/generated/google/apis/analytics_v3.rb +1 -1
- data/generated/google/apis/analytics_v3/service.rb +39 -0
- data/generated/google/apis/analyticsreporting_v4/classes.rb +920 -920
- data/generated/google/apis/analyticsreporting_v4/representations.rb +197 -197
- data/generated/google/apis/analyticsreporting_v4/service.rb +4 -4
- data/generated/google/apis/androidenterprise_v1.rb +1 -1
- data/generated/google/apis/androidenterprise_v1/classes.rb +8 -13
- data/generated/google/apis/androidenterprise_v1/service.rb +3 -3
- data/generated/google/apis/appengine_v1beta5.rb +1 -1
- data/generated/google/apis/appengine_v1beta5/classes.rb +115 -5
- data/generated/google/apis/appengine_v1beta5/representations.rb +37 -0
- data/generated/google/apis/appengine_v1beta5/service.rb +12 -9
- 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 +32 -37
- data/generated/google/apis/bigquery_v2/service.rb +10 -2
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/calendar_v3/classes.rb +205 -0
- data/generated/google/apis/calendar_v3/representations.rb +97 -0
- data/generated/google/apis/classroom_v1.rb +22 -25
- data/generated/google/apis/classroom_v1/classes.rb +998 -907
- data/generated/google/apis/classroom_v1/representations.rb +240 -240
- data/generated/google/apis/classroom_v1/service.rb +1269 -1061
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +164 -163
- data/generated/google/apis/cloudbuild_v1/representations.rb +31 -31
- data/generated/google/apis/cloudbuild_v1/service.rb +114 -114
- data/generated/google/apis/clouddebugger_v2.rb +1 -1
- data/generated/google/apis/clouddebugger_v2/classes.rb +687 -687
- data/generated/google/apis/clouddebugger_v2/representations.rb +147 -147
- data/generated/google/apis/clouddebugger_v2/service.rb +132 -132
- data/generated/google/apis/cloudkms_v1.rb +1 -1
- data/generated/google/apis/cloudkms_v1/classes.rb +231 -248
- data/generated/google/apis/cloudkms_v1/representations.rb +74 -74
- data/generated/google/apis/cloudkms_v1/service.rb +228 -228
- 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 +738 -128
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +245 -23
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +1293 -249
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +4 -4
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +982 -372
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +293 -71
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +626 -277
- data/generated/google/apis/cloudtrace_v1.rb +1 -1
- data/generated/google/apis/cloudtrace_v1/classes.rb +19 -19
- data/generated/google/apis/cloudtrace_v1/representations.rb +2 -2
- data/generated/google/apis/cloudtrace_v1/service.rb +30 -30
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +116 -0
- data/generated/google/apis/compute_beta/representations.rb +48 -0
- data/generated/google/apis/compute_beta/service.rb +46 -1
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/dataflow_v1b3.rb +1 -1
- data/generated/google/apis/dataflow_v1b3/classes.rb +3276 -3320
- data/generated/google/apis/dataflow_v1b3/representations.rb +779 -781
- data/generated/google/apis/dataflow_v1b3/service.rb +225 -225
- data/generated/google/apis/dataproc_v1.rb +1 -1
- data/generated/google/apis/dataproc_v1/classes.rb +1221 -1207
- data/generated/google/apis/dataproc_v1/representations.rb +255 -253
- data/generated/google/apis/dataproc_v1/service.rb +100 -100
- data/generated/google/apis/deploymentmanager_v2.rb +1 -1
- data/generated/google/apis/deploymentmanager_v2/classes.rb +5 -5
- data/generated/google/apis/dns_v1.rb +1 -1
- data/generated/google/apis/dns_v2beta1.rb +1 -1
- 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 +3 -1
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/drive_v3/classes.rb +3 -1
- data/generated/google/apis/fusiontables_v2.rb +1 -1
- 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 +7 -7
- data/generated/google/apis/genomics_v1/classes.rb +959 -959
- data/generated/google/apis/genomics_v1/representations.rb +238 -238
- data/generated/google/apis/genomics_v1/service.rb +996 -996
- data/generated/google/apis/iam_v1.rb +1 -1
- data/generated/google/apis/iam_v1/classes.rb +440 -440
- data/generated/google/apis/iam_v1/representations.rb +94 -94
- data/generated/google/apis/iam_v1/service.rb +170 -173
- data/generated/google/apis/identitytoolkit_v3.rb +1 -1
- data/generated/google/apis/identitytoolkit_v3/classes.rb +55 -0
- data/generated/google/apis/identitytoolkit_v3/representations.rb +8 -0
- data/generated/google/apis/kgsearch_v1/service.rb +4 -4
- data/generated/google/apis/language_v1beta1.rb +1 -1
- data/generated/google/apis/language_v1beta1/classes.rb +427 -427
- data/generated/google/apis/language_v1beta1/representations.rb +113 -113
- data/generated/google/apis/language_v1beta1/service.rb +25 -24
- data/generated/google/apis/licensing_v1.rb +2 -2
- data/generated/google/apis/licensing_v1/classes.rb +14 -2
- data/generated/google/apis/licensing_v1/representations.rb +2 -0
- data/generated/google/apis/licensing_v1/service.rb +1 -1
- data/generated/google/apis/logging_v2beta1.rb +1 -1
- data/generated/google/apis/logging_v2beta1/classes.rb +864 -864
- data/generated/google/apis/logging_v2beta1/representations.rb +168 -168
- data/generated/google/apis/logging_v2beta1/service.rb +261 -261
- data/generated/google/apis/manufacturers_v1.rb +1 -1
- data/generated/google/apis/manufacturers_v1/classes.rb +452 -105
- data/generated/google/apis/manufacturers_v1/representations.rb +138 -18
- data/generated/google/apis/manufacturers_v1/service.rb +11 -11
- data/generated/google/apis/mirror_v1.rb +1 -1
- data/generated/google/apis/monitoring_v3.rb +7 -7
- data/generated/google/apis/monitoring_v3/classes.rb +668 -670
- data/generated/google/apis/monitoring_v3/representations.rb +140 -140
- data/generated/google/apis/monitoring_v3/service.rb +208 -208
- data/generated/google/apis/partners_v2.rb +1 -1
- data/generated/google/apis/partners_v2/classes.rb +505 -505
- data/generated/google/apis/partners_v2/representations.rb +118 -118
- data/generated/google/apis/partners_v2/service.rb +275 -275
- data/generated/google/apis/people_v1.rb +1 -1
- data/generated/google/apis/people_v1/classes.rb +1037 -1031
- data/generated/google/apis/people_v1/representations.rb +247 -246
- data/generated/google/apis/people_v1/service.rb +20 -20
- 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.rb +1 -1
- data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +392 -392
- data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +93 -93
- data/generated/google/apis/proximitybeacon_v1beta1/service.rb +381 -381
- data/generated/google/apis/pubsub_v1.rb +4 -4
- data/generated/google/apis/pubsub_v1/classes.rb +131 -132
- data/generated/google/apis/pubsub_v1/representations.rb +35 -35
- data/generated/google/apis/pubsub_v1/service.rb +399 -408
- data/generated/google/apis/reseller_v1.rb +1 -1
- data/generated/google/apis/reseller_v1/classes.rb +9 -0
- data/generated/google/apis/reseller_v1/representations.rb +1 -0
- data/generated/google/apis/script_v1.rb +9 -9
- data/generated/google/apis/script_v1/classes.rb +110 -110
- data/generated/google/apis/script_v1/representations.rb +26 -26
- data/generated/google/apis/sheets_v4.rb +4 -4
- data/generated/google/apis/sheets_v4/classes.rb +4329 -4329
- data/generated/google/apis/sheets_v4/representations.rb +856 -856
- data/generated/google/apis/sheets_v4/service.rb +106 -106
- data/generated/google/apis/slides_v1.rb +4 -4
- data/generated/google/apis/slides_v1/classes.rb +2923 -2841
- data/generated/google/apis/slides_v1/representations.rb +722 -691
- data/generated/google/apis/slides_v1/service.rb +58 -15
- data/generated/google/apis/speech_v1beta1.rb +1 -1
- data/generated/google/apis/speech_v1beta1/classes.rb +191 -191
- data/generated/google/apis/speech_v1beta1/representations.rb +57 -57
- data/generated/google/apis/speech_v1beta1/service.rb +70 -70
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +151 -0
- data/generated/google/apis/storage_v1/representations.rb +45 -0
- data/generated/google/apis/storage_v1/service.rb +248 -0
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +1227 -1221
- data/generated/google/apis/vision_v1/representations.rb +217 -215
- data/generated/google/apis/webmasters_v3.rb +1 -1
- 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 +78 -0
- data/generated/google/apis/youtube_partner_v1/representations.rb +34 -0
- data/generated/google/apis/youtube_partner_v1/service.rb +40 -0
- data/generated/google/apis/youtubereporting_v1.rb +4 -4
- data/generated/google/apis/youtubereporting_v1/classes.rb +65 -65
- data/generated/google/apis/youtubereporting_v1/representations.rb +18 -18
- data/generated/google/apis/youtubereporting_v1/service.rb +111 -111
- data/lib/google/apis/version.rb +1 -1
- metadata +2 -2
@@ -172,12 +172,30 @@ module Google
|
|
172
172
|
include Google::Apis::Core::JsonObjectSupport
|
173
173
|
end
|
174
174
|
|
175
|
+
class Policy
|
176
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
177
|
+
|
178
|
+
class Binding
|
179
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
180
|
+
|
181
|
+
include Google::Apis::Core::JsonObjectSupport
|
182
|
+
end
|
183
|
+
|
184
|
+
include Google::Apis::Core::JsonObjectSupport
|
185
|
+
end
|
186
|
+
|
175
187
|
class RewriteResponse
|
176
188
|
class Representation < Google::Apis::Core::JsonRepresentation; end
|
177
189
|
|
178
190
|
include Google::Apis::Core::JsonObjectSupport
|
179
191
|
end
|
180
192
|
|
193
|
+
class TestIamPermissionsResponse
|
194
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
195
|
+
|
196
|
+
include Google::Apis::Core::JsonObjectSupport
|
197
|
+
end
|
198
|
+
|
181
199
|
class Bucket
|
182
200
|
# @private
|
183
201
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -485,6 +503,25 @@ module Google
|
|
485
503
|
end
|
486
504
|
end
|
487
505
|
|
506
|
+
class Policy
|
507
|
+
# @private
|
508
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
509
|
+
collection :bindings, as: 'bindings', class: Google::Apis::StorageV1::Policy::Binding, decorator: Google::Apis::StorageV1::Policy::Binding::Representation
|
510
|
+
|
511
|
+
property :etag, :base64 => true, as: 'etag'
|
512
|
+
property :kind, as: 'kind'
|
513
|
+
property :resource_id, as: 'resourceId'
|
514
|
+
end
|
515
|
+
|
516
|
+
class Binding
|
517
|
+
# @private
|
518
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
519
|
+
collection :members, as: 'members'
|
520
|
+
property :role, as: 'role'
|
521
|
+
end
|
522
|
+
end
|
523
|
+
end
|
524
|
+
|
488
525
|
class RewriteResponse
|
489
526
|
# @private
|
490
527
|
class Representation < Google::Apis::Core::JsonRepresentation
|
@@ -497,6 +534,14 @@ module Google
|
|
497
534
|
property :total_bytes_rewritten, as: 'totalBytesRewritten'
|
498
535
|
end
|
499
536
|
end
|
537
|
+
|
538
|
+
class TestIamPermissionsResponse
|
539
|
+
# @private
|
540
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
541
|
+
property :kind, as: 'kind'
|
542
|
+
collection :permissions, as: 'permissions'
|
543
|
+
end
|
544
|
+
end
|
500
545
|
end
|
501
546
|
end
|
502
547
|
end
|
@@ -373,6 +373,41 @@ module Google
|
|
373
373
|
execute_or_queue_command(command, &block)
|
374
374
|
end
|
375
375
|
|
376
|
+
# Returns an IAM policy for the specified bucket.
|
377
|
+
# @param [String] bucket
|
378
|
+
# Name of a bucket.
|
379
|
+
# @param [String] fields
|
380
|
+
# Selector specifying which fields to include in a partial response.
|
381
|
+
# @param [String] quota_user
|
382
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
383
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
384
|
+
# Overrides userIp if both are provided.
|
385
|
+
# @param [String] user_ip
|
386
|
+
# IP address of the site where the request originates. Use this if you want to
|
387
|
+
# enforce per-user limits.
|
388
|
+
# @param [Google::Apis::RequestOptions] options
|
389
|
+
# Request-specific options
|
390
|
+
#
|
391
|
+
# @yield [result, err] Result & error if block supplied
|
392
|
+
# @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
|
393
|
+
# @yieldparam err [StandardError] error object if request failed
|
394
|
+
#
|
395
|
+
# @return [Google::Apis::StorageV1::Policy]
|
396
|
+
#
|
397
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
398
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
399
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
400
|
+
def get_bucket_iam_policy(bucket, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
401
|
+
command = make_simple_command(:get, 'b/{bucket}/iam', options)
|
402
|
+
command.response_representation = Google::Apis::StorageV1::Policy::Representation
|
403
|
+
command.response_class = Google::Apis::StorageV1::Policy
|
404
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
405
|
+
command.query['fields'] = fields unless fields.nil?
|
406
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
407
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
408
|
+
execute_or_queue_command(command, &block)
|
409
|
+
end
|
410
|
+
|
376
411
|
# Creates a new bucket.
|
377
412
|
# @param [String] project
|
378
413
|
# A valid API project identifier.
|
@@ -527,6 +562,83 @@ module Google
|
|
527
562
|
execute_or_queue_command(command, &block)
|
528
563
|
end
|
529
564
|
|
565
|
+
# Updates an IAM policy for the specified bucket.
|
566
|
+
# @param [String] bucket
|
567
|
+
# Name of a bucket.
|
568
|
+
# @param [Google::Apis::StorageV1::Policy] policy_object
|
569
|
+
# @param [String] fields
|
570
|
+
# Selector specifying which fields to include in a partial response.
|
571
|
+
# @param [String] quota_user
|
572
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
573
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
574
|
+
# Overrides userIp if both are provided.
|
575
|
+
# @param [String] user_ip
|
576
|
+
# IP address of the site where the request originates. Use this if you want to
|
577
|
+
# enforce per-user limits.
|
578
|
+
# @param [Google::Apis::RequestOptions] options
|
579
|
+
# Request-specific options
|
580
|
+
#
|
581
|
+
# @yield [result, err] Result & error if block supplied
|
582
|
+
# @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
|
583
|
+
# @yieldparam err [StandardError] error object if request failed
|
584
|
+
#
|
585
|
+
# @return [Google::Apis::StorageV1::Policy]
|
586
|
+
#
|
587
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
588
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
589
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
590
|
+
def set_bucket_iam_policy(bucket, policy_object = nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
591
|
+
command = make_simple_command(:put, 'b/{bucket}/iam', options)
|
592
|
+
command.request_representation = Google::Apis::StorageV1::Policy::Representation
|
593
|
+
command.request_object = policy_object
|
594
|
+
command.response_representation = Google::Apis::StorageV1::Policy::Representation
|
595
|
+
command.response_class = Google::Apis::StorageV1::Policy
|
596
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
597
|
+
command.query['fields'] = fields unless fields.nil?
|
598
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
599
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
600
|
+
execute_or_queue_command(command, &block)
|
601
|
+
end
|
602
|
+
|
603
|
+
# Tests a set of permissions on the given bucket to see which, if any, are held
|
604
|
+
# by the caller.
|
605
|
+
# @param [String] bucket
|
606
|
+
# Name of a bucket.
|
607
|
+
# @param [Array<String>, String] permissions
|
608
|
+
# Permissions to test.
|
609
|
+
# @param [String] fields
|
610
|
+
# Selector specifying which fields to include in a partial response.
|
611
|
+
# @param [String] quota_user
|
612
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
613
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
614
|
+
# Overrides userIp if both are provided.
|
615
|
+
# @param [String] user_ip
|
616
|
+
# IP address of the site where the request originates. Use this if you want to
|
617
|
+
# enforce per-user limits.
|
618
|
+
# @param [Google::Apis::RequestOptions] options
|
619
|
+
# Request-specific options
|
620
|
+
#
|
621
|
+
# @yield [result, err] Result & error if block supplied
|
622
|
+
# @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
|
623
|
+
# @yieldparam err [StandardError] error object if request failed
|
624
|
+
#
|
625
|
+
# @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
|
626
|
+
#
|
627
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
628
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
629
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
630
|
+
def test_bucket_iam_permissions(bucket, permissions, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
631
|
+
command = make_simple_command(:get, 'b/{bucket}/iam/testPermissions', options)
|
632
|
+
command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
|
633
|
+
command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
|
634
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
635
|
+
command.query['permissions'] = permissions unless permissions.nil?
|
636
|
+
command.query['fields'] = fields unless fields.nil?
|
637
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
638
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
639
|
+
execute_or_queue_command(command, &block)
|
640
|
+
end
|
641
|
+
|
530
642
|
# Updates a bucket. Changes to the bucket will be readable immediately after
|
531
643
|
# writing, but configuration changes may take time to propagate.
|
532
644
|
# @param [String] bucket
|
@@ -1431,6 +1543,49 @@ module Google
|
|
1431
1543
|
execute_or_queue_command(command, &block)
|
1432
1544
|
end
|
1433
1545
|
|
1546
|
+
# Returns an IAM policy for the specified object.
|
1547
|
+
# @param [String] bucket
|
1548
|
+
# Name of the bucket in which the object resides.
|
1549
|
+
# @param [String] object
|
1550
|
+
# Name of the object. For information about how to URL encode object names to be
|
1551
|
+
# path safe, see Encoding URI Path Parts.
|
1552
|
+
# @param [String] generation
|
1553
|
+
# If present, selects a specific revision of this object (as opposed to the
|
1554
|
+
# latest version, the default).
|
1555
|
+
# @param [String] fields
|
1556
|
+
# Selector specifying which fields to include in a partial response.
|
1557
|
+
# @param [String] quota_user
|
1558
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1559
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1560
|
+
# Overrides userIp if both are provided.
|
1561
|
+
# @param [String] user_ip
|
1562
|
+
# IP address of the site where the request originates. Use this if you want to
|
1563
|
+
# enforce per-user limits.
|
1564
|
+
# @param [Google::Apis::RequestOptions] options
|
1565
|
+
# Request-specific options
|
1566
|
+
#
|
1567
|
+
# @yield [result, err] Result & error if block supplied
|
1568
|
+
# @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
|
1569
|
+
# @yieldparam err [StandardError] error object if request failed
|
1570
|
+
#
|
1571
|
+
# @return [Google::Apis::StorageV1::Policy]
|
1572
|
+
#
|
1573
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1574
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1575
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1576
|
+
def get_object_iam_policy(bucket, object, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1577
|
+
command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam', options)
|
1578
|
+
command.response_representation = Google::Apis::StorageV1::Policy::Representation
|
1579
|
+
command.response_class = Google::Apis::StorageV1::Policy
|
1580
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
1581
|
+
command.params['object'] = object unless object.nil?
|
1582
|
+
command.query['generation'] = generation unless generation.nil?
|
1583
|
+
command.query['fields'] = fields unless fields.nil?
|
1584
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1585
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1586
|
+
execute_or_queue_command(command, &block)
|
1587
|
+
end
|
1588
|
+
|
1434
1589
|
# Stores a new object and metadata.
|
1435
1590
|
# @param [String] bucket
|
1436
1591
|
# Name of the bucket in which to store the new object. Overrides the provided
|
@@ -1756,6 +1911,99 @@ module Google
|
|
1756
1911
|
execute_or_queue_command(command, &block)
|
1757
1912
|
end
|
1758
1913
|
|
1914
|
+
# Updates an IAM policy for the specified object.
|
1915
|
+
# @param [String] bucket
|
1916
|
+
# Name of the bucket in which the object resides.
|
1917
|
+
# @param [String] object
|
1918
|
+
# Name of the object. For information about how to URL encode object names to be
|
1919
|
+
# path safe, see Encoding URI Path Parts.
|
1920
|
+
# @param [Google::Apis::StorageV1::Policy] policy_object
|
1921
|
+
# @param [String] generation
|
1922
|
+
# If present, selects a specific revision of this object (as opposed to the
|
1923
|
+
# latest version, the default).
|
1924
|
+
# @param [String] fields
|
1925
|
+
# Selector specifying which fields to include in a partial response.
|
1926
|
+
# @param [String] quota_user
|
1927
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1928
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1929
|
+
# Overrides userIp if both are provided.
|
1930
|
+
# @param [String] user_ip
|
1931
|
+
# IP address of the site where the request originates. Use this if you want to
|
1932
|
+
# enforce per-user limits.
|
1933
|
+
# @param [Google::Apis::RequestOptions] options
|
1934
|
+
# Request-specific options
|
1935
|
+
#
|
1936
|
+
# @yield [result, err] Result & error if block supplied
|
1937
|
+
# @yieldparam result [Google::Apis::StorageV1::Policy] parsed result object
|
1938
|
+
# @yieldparam err [StandardError] error object if request failed
|
1939
|
+
#
|
1940
|
+
# @return [Google::Apis::StorageV1::Policy]
|
1941
|
+
#
|
1942
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1943
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1944
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1945
|
+
def set_object_iam_policy(bucket, object, policy_object = nil, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1946
|
+
command = make_simple_command(:put, 'b/{bucket}/o/{object}/iam', options)
|
1947
|
+
command.request_representation = Google::Apis::StorageV1::Policy::Representation
|
1948
|
+
command.request_object = policy_object
|
1949
|
+
command.response_representation = Google::Apis::StorageV1::Policy::Representation
|
1950
|
+
command.response_class = Google::Apis::StorageV1::Policy
|
1951
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
1952
|
+
command.params['object'] = object unless object.nil?
|
1953
|
+
command.query['generation'] = generation unless generation.nil?
|
1954
|
+
command.query['fields'] = fields unless fields.nil?
|
1955
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
1956
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
1957
|
+
execute_or_queue_command(command, &block)
|
1958
|
+
end
|
1959
|
+
|
1960
|
+
# Tests a set of permissions on the given object to see which, if any, are held
|
1961
|
+
# by the caller.
|
1962
|
+
# @param [String] bucket
|
1963
|
+
# Name of the bucket in which the object resides.
|
1964
|
+
# @param [String] object
|
1965
|
+
# Name of the object. For information about how to URL encode object names to be
|
1966
|
+
# path safe, see Encoding URI Path Parts.
|
1967
|
+
# @param [Array<String>, String] permissions
|
1968
|
+
# Permissions to test.
|
1969
|
+
# @param [String] generation
|
1970
|
+
# If present, selects a specific revision of this object (as opposed to the
|
1971
|
+
# latest version, the default).
|
1972
|
+
# @param [String] fields
|
1973
|
+
# Selector specifying which fields to include in a partial response.
|
1974
|
+
# @param [String] quota_user
|
1975
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
1976
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
1977
|
+
# Overrides userIp if both are provided.
|
1978
|
+
# @param [String] user_ip
|
1979
|
+
# IP address of the site where the request originates. Use this if you want to
|
1980
|
+
# enforce per-user limits.
|
1981
|
+
# @param [Google::Apis::RequestOptions] options
|
1982
|
+
# Request-specific options
|
1983
|
+
#
|
1984
|
+
# @yield [result, err] Result & error if block supplied
|
1985
|
+
# @yieldparam result [Google::Apis::StorageV1::TestIamPermissionsResponse] parsed result object
|
1986
|
+
# @yieldparam err [StandardError] error object if request failed
|
1987
|
+
#
|
1988
|
+
# @return [Google::Apis::StorageV1::TestIamPermissionsResponse]
|
1989
|
+
#
|
1990
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
1991
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
1992
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
1993
|
+
def test_object_iam_permissions(bucket, object, permissions, generation: nil, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
|
1994
|
+
command = make_simple_command(:get, 'b/{bucket}/o/{object}/iam/testPermissions', options)
|
1995
|
+
command.response_representation = Google::Apis::StorageV1::TestIamPermissionsResponse::Representation
|
1996
|
+
command.response_class = Google::Apis::StorageV1::TestIamPermissionsResponse
|
1997
|
+
command.params['bucket'] = bucket unless bucket.nil?
|
1998
|
+
command.params['object'] = object unless object.nil?
|
1999
|
+
command.query['generation'] = generation unless generation.nil?
|
2000
|
+
command.query['permissions'] = permissions unless permissions.nil?
|
2001
|
+
command.query['fields'] = fields unless fields.nil?
|
2002
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
2003
|
+
command.query['userIp'] = user_ip unless user_ip.nil?
|
2004
|
+
execute_or_queue_command(command, &block)
|
2005
|
+
end
|
2006
|
+
|
1759
2007
|
# Updates an object's metadata.
|
1760
2008
|
# @param [String] bucket
|
1761
2009
|
# Name of the bucket in which the object resides.
|
@@ -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 = '20170321'
|
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'
|
@@ -22,25 +22,25 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module VisionV1
|
24
24
|
|
25
|
-
#
|
26
|
-
|
25
|
+
# Request for performing Google Cloud Vision API tasks over a user-provided
|
26
|
+
# image, with user-requested features.
|
27
|
+
class AnnotateImageRequest
|
27
28
|
include Google::Apis::Core::Hashable
|
28
29
|
|
29
|
-
#
|
30
|
-
# Corresponds to the JSON property `
|
31
|
-
# @return [
|
32
|
-
attr_accessor :
|
30
|
+
# Client image to perform Google Cloud Vision API tasks over.
|
31
|
+
# Corresponds to the JSON property `image`
|
32
|
+
# @return [Google::Apis::VisionV1::Image]
|
33
|
+
attr_accessor :image
|
33
34
|
|
34
|
-
#
|
35
|
-
# Corresponds to the JSON property `
|
36
|
-
# @return [
|
37
|
-
attr_accessor :
|
35
|
+
# Requested features.
|
36
|
+
# Corresponds to the JSON property `features`
|
37
|
+
# @return [Array<Google::Apis::VisionV1::Feature>]
|
38
|
+
attr_accessor :features
|
38
39
|
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
|
43
|
-
attr_accessor :score
|
40
|
+
# Image context and/or feature-specific parameters.
|
41
|
+
# Corresponds to the JSON property `imageContext`
|
42
|
+
# @return [Google::Apis::VisionV1::ImageContext]
|
43
|
+
attr_accessor :image_context
|
44
44
|
|
45
45
|
def initialize(**args)
|
46
46
|
update!(**args)
|
@@ -48,20 +48,71 @@ module Google
|
|
48
48
|
|
49
49
|
# Update properties of this object
|
50
50
|
def update!(**args)
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
51
|
+
@image = args[:image] if args.key?(:image)
|
52
|
+
@features = args[:features] if args.key?(:features)
|
53
|
+
@image_context = args[:image_context] if args.key?(:image_context)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
#
|
58
|
-
|
57
|
+
# The `Status` type defines a logical error model that is suitable for different
|
58
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
59
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
60
|
+
# - Simple to use and understand for most users
|
61
|
+
# - Flexible enough to meet unexpected needs
|
62
|
+
# # Overview
|
63
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
64
|
+
# and error details. The error code should be an enum value of
|
65
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
66
|
+
# error message should be a developer-facing English message that helps
|
67
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
68
|
+
# error message is needed, put the localized message in the error details or
|
69
|
+
# localize it in the client. The optional error details may contain arbitrary
|
70
|
+
# information about the error. There is a predefined set of error detail types
|
71
|
+
# in the package `google.rpc` which can be used for common error conditions.
|
72
|
+
# # Language mapping
|
73
|
+
# The `Status` message is the logical representation of the error model, but it
|
74
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
75
|
+
# exposed in different client libraries and different wire protocols, it can be
|
76
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
77
|
+
# in Java, but more likely mapped to some error codes in C.
|
78
|
+
# # Other uses
|
79
|
+
# The error model and the `Status` message can be used in a variety of
|
80
|
+
# environments, either with or without APIs, to provide a
|
81
|
+
# consistent developer experience across different environments.
|
82
|
+
# Example uses of this error model include:
|
83
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
84
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
85
|
+
# errors.
|
86
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
87
|
+
# have a `Status` message for error reporting purpose.
|
88
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
89
|
+
# `Status` message should be used directly inside batch response, one for
|
90
|
+
# each error sub-response.
|
91
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
92
|
+
# results in its response, the status of those operations should be
|
93
|
+
# represented directly using the `Status` message.
|
94
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
95
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
96
|
+
class Status
|
59
97
|
include Google::Apis::Core::Hashable
|
60
98
|
|
61
|
-
# The
|
62
|
-
# Corresponds to the JSON property `
|
63
|
-
# @return [
|
64
|
-
attr_accessor :
|
99
|
+
# The status code, which should be an enum value of google.rpc.Code.
|
100
|
+
# Corresponds to the JSON property `code`
|
101
|
+
# @return [Fixnum]
|
102
|
+
attr_accessor :code
|
103
|
+
|
104
|
+
# A developer-facing error message, which should be in English. Any
|
105
|
+
# user-facing error message should be localized and sent in the
|
106
|
+
# google.rpc.Status.details field, or localized by the client.
|
107
|
+
# Corresponds to the JSON property `message`
|
108
|
+
# @return [String]
|
109
|
+
attr_accessor :message
|
110
|
+
|
111
|
+
# A list of messages that carry the error details. There will be a
|
112
|
+
# common set of message types for APIs to use.
|
113
|
+
# Corresponds to the JSON property `details`
|
114
|
+
# @return [Array<Hash<String,Object>>]
|
115
|
+
attr_accessor :details
|
65
116
|
|
66
117
|
def initialize(**args)
|
67
118
|
update!(**args)
|
@@ -69,23 +120,97 @@ module Google
|
|
69
120
|
|
70
121
|
# Update properties of this object
|
71
122
|
def update!(**args)
|
72
|
-
@
|
123
|
+
@code = args[:code] if args.key?(:code)
|
124
|
+
@message = args[:message] if args.key?(:message)
|
125
|
+
@details = args[:details] if args.key?(:details)
|
73
126
|
end
|
74
127
|
end
|
75
128
|
|
76
|
-
#
|
77
|
-
class
|
129
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
130
|
+
class LatLongRect
|
78
131
|
include Google::Apis::Core::Hashable
|
79
132
|
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
|
133
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
134
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
135
|
+
# specified otherwise, this must conform to the
|
136
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
137
|
+
# standard</a>. Values must be within normalized ranges.
|
138
|
+
# Example of normalization code in Python:
|
139
|
+
# def NormalizeLongitude(longitude):
|
140
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
141
|
+
# q, r = divmod(longitude, 360.0)
|
142
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
143
|
+
# return r - 360.0
|
144
|
+
# return r
|
145
|
+
# def NormalizeLatLng(latitude, longitude):
|
146
|
+
# """Wraps decimal degrees latitude and longitude to
|
147
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
148
|
+
# r = latitude % 360.0
|
149
|
+
# if r <= 90.0:
|
150
|
+
# return r, NormalizeLongitude(longitude)
|
151
|
+
# elif r >= 270.0:
|
152
|
+
# return r - 360, NormalizeLongitude(longitude)
|
153
|
+
# else:
|
154
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
155
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
156
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
157
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
158
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
159
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
160
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
161
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
162
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
163
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
164
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
165
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
166
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
167
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
168
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
169
|
+
# as if it were annotated as ST_LOCATION.
|
170
|
+
# Corresponds to the JSON property `minLatLng`
|
171
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
172
|
+
attr_accessor :min_lat_lng
|
84
173
|
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
|
174
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
175
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
176
|
+
# specified otherwise, this must conform to the
|
177
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
178
|
+
# standard</a>. Values must be within normalized ranges.
|
179
|
+
# Example of normalization code in Python:
|
180
|
+
# def NormalizeLongitude(longitude):
|
181
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
182
|
+
# q, r = divmod(longitude, 360.0)
|
183
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
184
|
+
# return r - 360.0
|
185
|
+
# return r
|
186
|
+
# def NormalizeLatLng(latitude, longitude):
|
187
|
+
# """Wraps decimal degrees latitude and longitude to
|
188
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
189
|
+
# r = latitude % 360.0
|
190
|
+
# if r <= 90.0:
|
191
|
+
# return r, NormalizeLongitude(longitude)
|
192
|
+
# elif r >= 270.0:
|
193
|
+
# return r - 360, NormalizeLongitude(longitude)
|
194
|
+
# else:
|
195
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
196
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
197
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
198
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
199
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
200
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
201
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
202
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
203
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
204
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
205
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
206
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
207
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
208
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
209
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
210
|
+
# as if it were annotated as ST_LOCATION.
|
211
|
+
# Corresponds to the JSON property `maxLatLng`
|
212
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
213
|
+
attr_accessor :max_lat_lng
|
89
214
|
|
90
215
|
def initialize(**args)
|
91
216
|
update!(**args)
|
@@ -93,115 +218,50 @@ module Google
|
|
93
218
|
|
94
219
|
# Update properties of this object
|
95
220
|
def update!(**args)
|
96
|
-
@
|
97
|
-
@
|
221
|
+
@min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
|
222
|
+
@max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
|
98
223
|
end
|
99
224
|
end
|
100
225
|
|
101
|
-
#
|
102
|
-
class
|
226
|
+
# A single symbol representation.
|
227
|
+
class Symbol
|
103
228
|
include Google::Apis::Core::Hashable
|
104
229
|
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
|
109
|
-
# properties. Properties describe detected languages, breaks etc.. Please
|
110
|
-
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
111
|
-
# definition below for more detail.
|
112
|
-
# Corresponds to the JSON property `fullTextAnnotation`
|
113
|
-
# @return [Google::Apis::VisionV1::TextAnnotation]
|
114
|
-
attr_accessor :full_text_annotation
|
115
|
-
|
116
|
-
# If present, landmark detection has completed successfully.
|
117
|
-
# Corresponds to the JSON property `landmarkAnnotations`
|
118
|
-
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
119
|
-
attr_accessor :landmark_annotations
|
230
|
+
# The actual UTF-8 representation of the symbol.
|
231
|
+
# Corresponds to the JSON property `text`
|
232
|
+
# @return [String]
|
233
|
+
attr_accessor :text
|
120
234
|
|
121
|
-
#
|
122
|
-
# Corresponds to the JSON property `
|
123
|
-
# @return [
|
124
|
-
attr_accessor :
|
235
|
+
# Additional information detected on the structural component.
|
236
|
+
# Corresponds to the JSON property `property`
|
237
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
238
|
+
attr_accessor :property
|
125
239
|
|
126
|
-
#
|
127
|
-
# Corresponds to the JSON property `
|
128
|
-
# @return [
|
129
|
-
attr_accessor :
|
240
|
+
# A bounding polygon for the detected image annotation.
|
241
|
+
# Corresponds to the JSON property `boundingBox`
|
242
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
243
|
+
attr_accessor :bounding_box
|
130
244
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
attr_accessor :image_properties_annotation
|
245
|
+
def initialize(**args)
|
246
|
+
update!(**args)
|
247
|
+
end
|
135
248
|
|
136
|
-
#
|
137
|
-
|
138
|
-
|
139
|
-
|
249
|
+
# Update properties of this object
|
250
|
+
def update!(**args)
|
251
|
+
@text = args[:text] if args.key?(:text)
|
252
|
+
@property = args[:property] if args.key?(:property)
|
253
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
254
|
+
end
|
255
|
+
end
|
140
256
|
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
attr_accessor :web_detection
|
145
|
-
|
146
|
-
# Set of crop hints that are used to generate new crops when serving images.
|
147
|
-
# Corresponds to the JSON property `cropHintsAnnotation`
|
148
|
-
# @return [Google::Apis::VisionV1::CropHintsAnnotation]
|
149
|
-
attr_accessor :crop_hints_annotation
|
150
|
-
|
151
|
-
# Set of features pertaining to the image, computed by computer vision
|
152
|
-
# methods over safe-search verticals (for example, adult, spoof, medical,
|
153
|
-
# violence).
|
154
|
-
# Corresponds to the JSON property `safeSearchAnnotation`
|
155
|
-
# @return [Google::Apis::VisionV1::SafeSearchAnnotation]
|
156
|
-
attr_accessor :safe_search_annotation
|
157
|
-
|
158
|
-
# If present, label detection has completed successfully.
|
159
|
-
# Corresponds to the JSON property `labelAnnotations`
|
160
|
-
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
161
|
-
attr_accessor :label_annotations
|
257
|
+
# Set of crop hints that are used to generate new crops when serving images.
|
258
|
+
class CropHintsAnnotation
|
259
|
+
include Google::Apis::Core::Hashable
|
162
260
|
|
163
|
-
#
|
164
|
-
#
|
165
|
-
# [
|
166
|
-
|
167
|
-
# - Flexible enough to meet unexpected needs
|
168
|
-
# # Overview
|
169
|
-
# The `Status` message contains three pieces of data: error code, error message,
|
170
|
-
# and error details. The error code should be an enum value of
|
171
|
-
# google.rpc.Code, but it may accept additional error codes if needed. The
|
172
|
-
# error message should be a developer-facing English message that helps
|
173
|
-
# developers *understand* and *resolve* the error. If a localized user-facing
|
174
|
-
# error message is needed, put the localized message in the error details or
|
175
|
-
# localize it in the client. The optional error details may contain arbitrary
|
176
|
-
# information about the error. There is a predefined set of error detail types
|
177
|
-
# in the package `google.rpc` which can be used for common error conditions.
|
178
|
-
# # Language mapping
|
179
|
-
# The `Status` message is the logical representation of the error model, but it
|
180
|
-
# is not necessarily the actual wire format. When the `Status` message is
|
181
|
-
# exposed in different client libraries and different wire protocols, it can be
|
182
|
-
# mapped differently. For example, it will likely be mapped to some exceptions
|
183
|
-
# in Java, but more likely mapped to some error codes in C.
|
184
|
-
# # Other uses
|
185
|
-
# The error model and the `Status` message can be used in a variety of
|
186
|
-
# environments, either with or without APIs, to provide a
|
187
|
-
# consistent developer experience across different environments.
|
188
|
-
# Example uses of this error model include:
|
189
|
-
# - Partial errors. If a service needs to return partial errors to the client,
|
190
|
-
# it may embed the `Status` in the normal response to indicate the partial
|
191
|
-
# errors.
|
192
|
-
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
193
|
-
# have a `Status` message for error reporting purpose.
|
194
|
-
# - Batch operations. If a client uses batch request and batch response, the
|
195
|
-
# `Status` message should be used directly inside batch response, one for
|
196
|
-
# each error sub-response.
|
197
|
-
# - Asynchronous operations. If an API call embeds asynchronous operation
|
198
|
-
# results in its response, the status of those operations should be
|
199
|
-
# represented directly using the `Status` message.
|
200
|
-
# - Logging. If some API errors are stored in logs, the message `Status` could
|
201
|
-
# be used directly after any stripping needed for security/privacy reasons.
|
202
|
-
# Corresponds to the JSON property `error`
|
203
|
-
# @return [Google::Apis::VisionV1::Status]
|
204
|
-
attr_accessor :error
|
261
|
+
# Crop hint results.
|
262
|
+
# Corresponds to the JSON property `cropHints`
|
263
|
+
# @return [Array<Google::Apis::VisionV1::CropHint>]
|
264
|
+
attr_accessor :crop_hints
|
205
265
|
|
206
266
|
def initialize(**args)
|
207
267
|
update!(**args)
|
@@ -209,33 +269,59 @@ module Google
|
|
209
269
|
|
210
270
|
# Update properties of this object
|
211
271
|
def update!(**args)
|
212
|
-
@
|
213
|
-
@landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
|
214
|
-
@text_annotations = args[:text_annotations] if args.key?(:text_annotations)
|
215
|
-
@face_annotations = args[:face_annotations] if args.key?(:face_annotations)
|
216
|
-
@image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
|
217
|
-
@logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
|
218
|
-
@web_detection = args[:web_detection] if args.key?(:web_detection)
|
219
|
-
@crop_hints_annotation = args[:crop_hints_annotation] if args.key?(:crop_hints_annotation)
|
220
|
-
@safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
|
221
|
-
@label_annotations = args[:label_annotations] if args.key?(:label_annotations)
|
222
|
-
@error = args[:error] if args.key?(:error)
|
272
|
+
@crop_hints = args[:crop_hints] if args.key?(:crop_hints)
|
223
273
|
end
|
224
274
|
end
|
225
275
|
|
226
|
-
#
|
227
|
-
|
276
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
277
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
278
|
+
# specified otherwise, this must conform to the
|
279
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
280
|
+
# standard</a>. Values must be within normalized ranges.
|
281
|
+
# Example of normalization code in Python:
|
282
|
+
# def NormalizeLongitude(longitude):
|
283
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
284
|
+
# q, r = divmod(longitude, 360.0)
|
285
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
286
|
+
# return r - 360.0
|
287
|
+
# return r
|
288
|
+
# def NormalizeLatLng(latitude, longitude):
|
289
|
+
# """Wraps decimal degrees latitude and longitude to
|
290
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
291
|
+
# r = latitude % 360.0
|
292
|
+
# if r <= 90.0:
|
293
|
+
# return r, NormalizeLongitude(longitude)
|
294
|
+
# elif r >= 270.0:
|
295
|
+
# return r - 360, NormalizeLongitude(longitude)
|
296
|
+
# else:
|
297
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
298
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
299
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
300
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
301
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
302
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
303
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
304
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
305
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
306
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
307
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
308
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
309
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
310
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
311
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
312
|
+
# as if it were annotated as ST_LOCATION.
|
313
|
+
class LatLng
|
228
314
|
include Google::Apis::Core::Hashable
|
229
315
|
|
230
|
-
#
|
231
|
-
#
|
232
|
-
#
|
233
|
-
|
234
|
-
|
235
|
-
#
|
236
|
-
# Corresponds to the JSON property `
|
237
|
-
# @return [
|
238
|
-
attr_accessor :
|
316
|
+
# The latitude in degrees. It must be in the range [-90.0, +90.0].
|
317
|
+
# Corresponds to the JSON property `latitude`
|
318
|
+
# @return [Float]
|
319
|
+
attr_accessor :latitude
|
320
|
+
|
321
|
+
# The longitude in degrees. It must be in the range [-180.0, +180.0].
|
322
|
+
# Corresponds to the JSON property `longitude`
|
323
|
+
# @return [Float]
|
324
|
+
attr_accessor :longitude
|
239
325
|
|
240
326
|
def initialize(**args)
|
241
327
|
update!(**args)
|
@@ -243,33 +329,140 @@ module Google
|
|
243
329
|
|
244
330
|
# Update properties of this object
|
245
331
|
def update!(**args)
|
246
|
-
@
|
332
|
+
@latitude = args[:latitude] if args.key?(:latitude)
|
333
|
+
@longitude = args[:longitude] if args.key?(:longitude)
|
247
334
|
end
|
248
335
|
end
|
249
336
|
|
250
|
-
#
|
251
|
-
|
337
|
+
# Represents a color in the RGBA color space. This representation is designed
|
338
|
+
# for simplicity of conversion to/from color representations in various
|
339
|
+
# languages over compactness; for example, the fields of this representation
|
340
|
+
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
341
|
+
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
342
|
+
# method in iOS; and, with just a little work, it can be easily formatted into
|
343
|
+
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
344
|
+
# Example (Java):
|
345
|
+
# import com.google.type.Color;
|
346
|
+
# // ...
|
347
|
+
# public static java.awt.Color fromProto(Color protocolor) `
|
348
|
+
# float alpha = protocolor.hasAlpha()
|
349
|
+
# ? protocolor.getAlpha().getValue()
|
350
|
+
# : 1.0;
|
351
|
+
# return new java.awt.Color(
|
352
|
+
# protocolor.getRed(),
|
353
|
+
# protocolor.getGreen(),
|
354
|
+
# protocolor.getBlue(),
|
355
|
+
# alpha);
|
356
|
+
# `
|
357
|
+
# public static Color toProto(java.awt.Color color) `
|
358
|
+
# float red = (float) color.getRed();
|
359
|
+
# float green = (float) color.getGreen();
|
360
|
+
# float blue = (float) color.getBlue();
|
361
|
+
# float denominator = 255.0;
|
362
|
+
# Color.Builder resultBuilder =
|
363
|
+
# Color
|
364
|
+
# .newBuilder()
|
365
|
+
# .setRed(red / denominator)
|
366
|
+
# .setGreen(green / denominator)
|
367
|
+
# .setBlue(blue / denominator);
|
368
|
+
# int alpha = color.getAlpha();
|
369
|
+
# if (alpha != 255) `
|
370
|
+
# result.setAlpha(
|
371
|
+
# FloatValue
|
372
|
+
# .newBuilder()
|
373
|
+
# .setValue(((float) alpha) / denominator)
|
374
|
+
# .build());
|
375
|
+
# `
|
376
|
+
# return resultBuilder.build();
|
377
|
+
# `
|
378
|
+
# // ...
|
379
|
+
# Example (iOS / Obj-C):
|
380
|
+
# // ...
|
381
|
+
# static UIColor* fromProto(Color* protocolor) `
|
382
|
+
# float red = [protocolor red];
|
383
|
+
# float green = [protocolor green];
|
384
|
+
# float blue = [protocolor blue];
|
385
|
+
# FloatValue* alpha_wrapper = [protocolor alpha];
|
386
|
+
# float alpha = 1.0;
|
387
|
+
# if (alpha_wrapper != nil) `
|
388
|
+
# alpha = [alpha_wrapper value];
|
389
|
+
# `
|
390
|
+
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
391
|
+
# `
|
392
|
+
# static Color* toProto(UIColor* color) `
|
393
|
+
# CGFloat red, green, blue, alpha;
|
394
|
+
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
395
|
+
# return nil;
|
396
|
+
# `
|
397
|
+
# Color* result = [Color alloc] init];
|
398
|
+
# [result setRed:red];
|
399
|
+
# [result setGreen:green];
|
400
|
+
# [result setBlue:blue];
|
401
|
+
# if (alpha <= 0.9999) `
|
402
|
+
# [result setAlpha:floatWrapperWithValue(alpha)];
|
403
|
+
# `
|
404
|
+
# [result autorelease];
|
405
|
+
# return result;
|
406
|
+
# `
|
407
|
+
# // ...
|
408
|
+
# Example (JavaScript):
|
409
|
+
# // ...
|
410
|
+
# var protoToCssColor = function(rgb_color) `
|
411
|
+
# var redFrac = rgb_color.red || 0.0;
|
412
|
+
# var greenFrac = rgb_color.green || 0.0;
|
413
|
+
# var blueFrac = rgb_color.blue || 0.0;
|
414
|
+
# var red = Math.floor(redFrac * 255);
|
415
|
+
# var green = Math.floor(greenFrac * 255);
|
416
|
+
# var blue = Math.floor(blueFrac * 255);
|
417
|
+
# if (!('alpha' in rgb_color)) `
|
418
|
+
# return rgbToCssColor_(red, green, blue);
|
419
|
+
# `
|
420
|
+
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
421
|
+
# var rgbParams = [red, green, blue].join(',');
|
422
|
+
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
423
|
+
# `;
|
424
|
+
# var rgbToCssColor_ = function(red, green, blue) `
|
425
|
+
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
426
|
+
# var hexString = rgbNumber.toString(16);
|
427
|
+
# var missingZeros = 6 - hexString.length;
|
428
|
+
# var resultBuilder = ['#'];
|
429
|
+
# for (var i = 0; i < missingZeros; i++) `
|
430
|
+
# resultBuilder.push('0');
|
431
|
+
# `
|
432
|
+
# resultBuilder.push(hexString);
|
433
|
+
# return resultBuilder.join('');
|
434
|
+
# `;
|
435
|
+
# // ...
|
436
|
+
class Color
|
252
437
|
include Google::Apis::Core::Hashable
|
253
438
|
|
254
|
-
#
|
255
|
-
# Corresponds to the JSON property `
|
256
|
-
# @return [
|
257
|
-
attr_accessor :
|
439
|
+
# The amount of green in the color as a value in the interval [0, 1].
|
440
|
+
# Corresponds to the JSON property `green`
|
441
|
+
# @return [Float]
|
442
|
+
attr_accessor :green
|
258
443
|
|
259
|
-
#
|
260
|
-
# Corresponds to the JSON property `
|
261
|
-
# @return [
|
262
|
-
attr_accessor :
|
444
|
+
# The amount of blue in the color as a value in the interval [0, 1].
|
445
|
+
# Corresponds to the JSON property `blue`
|
446
|
+
# @return [Float]
|
447
|
+
attr_accessor :blue
|
263
448
|
|
264
|
-
#
|
265
|
-
#
|
266
|
-
#
|
267
|
-
|
449
|
+
# The fraction of this color that should be applied to the pixel. That is,
|
450
|
+
# the final pixel color is defined by the equation:
|
451
|
+
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
452
|
+
# This means that a value of 1.0 corresponds to a solid color, whereas
|
453
|
+
# a value of 0.0 corresponds to a completely transparent color. This
|
454
|
+
# uses a wrapper message rather than a simple float scalar so that it is
|
455
|
+
# possible to distinguish between a default value and the value being unset.
|
456
|
+
# If omitted, this color object is to be rendered as a solid color
|
457
|
+
# (as if the alpha value had been explicitly given with a value of 1.0).
|
458
|
+
# Corresponds to the JSON property `alpha`
|
459
|
+
# @return [Float]
|
460
|
+
attr_accessor :alpha
|
268
461
|
|
269
|
-
#
|
270
|
-
# Corresponds to the JSON property `
|
271
|
-
# @return [
|
272
|
-
attr_accessor :
|
462
|
+
# The amount of red in the color as a value in the interval [0, 1].
|
463
|
+
# Corresponds to the JSON property `red`
|
464
|
+
# @return [Float]
|
465
|
+
attr_accessor :red
|
273
466
|
|
274
467
|
def initialize(**args)
|
275
468
|
update!(**args)
|
@@ -277,57 +470,21 @@ module Google
|
|
277
470
|
|
278
471
|
# Update properties of this object
|
279
472
|
def update!(**args)
|
280
|
-
@
|
281
|
-
@
|
282
|
-
@
|
283
|
-
@
|
473
|
+
@green = args[:green] if args.key?(:green)
|
474
|
+
@blue = args[:blue] if args.key?(:blue)
|
475
|
+
@alpha = args[:alpha] if args.key?(:alpha)
|
476
|
+
@red = args[:red] if args.key?(:red)
|
284
477
|
end
|
285
478
|
end
|
286
479
|
|
287
|
-
#
|
288
|
-
class
|
480
|
+
# Stores image properties, such as dominant colors.
|
481
|
+
class ImageProperties
|
289
482
|
include Google::Apis::Core::Hashable
|
290
483
|
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
|
295
|
-
# standard</a>. Values must be within normalized ranges.
|
296
|
-
# Example of normalization code in Python:
|
297
|
-
# def NormalizeLongitude(longitude):
|
298
|
-
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
299
|
-
# q, r = divmod(longitude, 360.0)
|
300
|
-
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
301
|
-
# return r - 360.0
|
302
|
-
# return r
|
303
|
-
# def NormalizeLatLng(latitude, longitude):
|
304
|
-
# """Wraps decimal degrees latitude and longitude to
|
305
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
306
|
-
# r = latitude % 360.0
|
307
|
-
# if r <= 90.0:
|
308
|
-
# return r, NormalizeLongitude(longitude)
|
309
|
-
# elif r >= 270.0:
|
310
|
-
# return r - 360, NormalizeLongitude(longitude)
|
311
|
-
# else:
|
312
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
313
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
314
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
315
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
316
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
317
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
318
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
319
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
320
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
321
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
322
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
323
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
324
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
325
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
326
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
327
|
-
# as if it were annotated as ST_LOCATION.
|
328
|
-
# Corresponds to the JSON property `latLng`
|
329
|
-
# @return [Google::Apis::VisionV1::LatLng]
|
330
|
-
attr_accessor :lat_lng
|
484
|
+
# Set of dominant colors and their corresponding scores.
|
485
|
+
# Corresponds to the JSON property `dominantColors`
|
486
|
+
# @return [Google::Apis::VisionV1::DominantColorsAnnotation]
|
487
|
+
attr_accessor :dominant_colors
|
331
488
|
|
332
489
|
def initialize(**args)
|
333
490
|
update!(**args)
|
@@ -335,37 +492,26 @@ module Google
|
|
335
492
|
|
336
493
|
# Update properties of this object
|
337
494
|
def update!(**args)
|
338
|
-
@
|
495
|
+
@dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
|
339
496
|
end
|
340
497
|
end
|
341
498
|
|
342
|
-
#
|
343
|
-
|
499
|
+
# Users describe the type of Google Cloud Vision API tasks to perform over
|
500
|
+
# images by using *Feature*s. Each Feature indicates a type of image
|
501
|
+
# detection task to perform. Features encode the Cloud Vision API
|
502
|
+
# vertical to operate on and the number of top-scoring results to return.
|
503
|
+
class Feature
|
344
504
|
include Google::Apis::Core::Hashable
|
345
505
|
|
346
|
-
#
|
347
|
-
#
|
348
|
-
# `gs://bucket_name/object_name` (for details, see
|
349
|
-
# [Google Cloud Storage Request
|
350
|
-
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
351
|
-
# NOTE: Cloud Storage object versioning is not supported.
|
352
|
-
# Corresponds to the JSON property `gcsImageUri`
|
506
|
+
# The feature type.
|
507
|
+
# Corresponds to the JSON property `type`
|
353
508
|
# @return [String]
|
354
|
-
attr_accessor :
|
509
|
+
attr_accessor :type
|
355
510
|
|
356
|
-
#
|
357
|
-
#
|
358
|
-
#
|
359
|
-
|
360
|
-
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
361
|
-
# NOTE: Cloud Storage object versioning is not supported.
|
362
|
-
# 2) Publicly accessible image HTTP/HTTPS URL.
|
363
|
-
# This is preferred over the legacy `gcs_image_uri` above. When both
|
364
|
-
# `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
|
365
|
-
# precedence.
|
366
|
-
# Corresponds to the JSON property `imageUri`
|
367
|
-
# @return [String]
|
368
|
-
attr_accessor :image_uri
|
511
|
+
# Maximum number of results of this type.
|
512
|
+
# Corresponds to the JSON property `maxResults`
|
513
|
+
# @return [Fixnum]
|
514
|
+
attr_accessor :max_results
|
369
515
|
|
370
516
|
def initialize(**args)
|
371
517
|
update!(**args)
|
@@ -373,29 +519,38 @@ module Google
|
|
373
519
|
|
374
520
|
# Update properties of this object
|
375
521
|
def update!(**args)
|
376
|
-
@
|
377
|
-
@
|
522
|
+
@type = args[:type] if args.key?(:type)
|
523
|
+
@max_results = args[:max_results] if args.key?(:max_results)
|
378
524
|
end
|
379
525
|
end
|
380
526
|
|
381
|
-
#
|
382
|
-
|
527
|
+
# Set of features pertaining to the image, computed by computer vision
|
528
|
+
# methods over safe-search verticals (for example, adult, spoof, medical,
|
529
|
+
# violence).
|
530
|
+
class SafeSearchAnnotation
|
383
531
|
include Google::Apis::Core::Hashable
|
384
532
|
|
385
|
-
#
|
386
|
-
# Corresponds to the JSON property `
|
533
|
+
# Represents the adult content likelihood for the image.
|
534
|
+
# Corresponds to the JSON property `adult`
|
535
|
+
# @return [String]
|
536
|
+
attr_accessor :adult
|
537
|
+
|
538
|
+
# Spoof likelihood. The likelihood that an modification
|
539
|
+
# was made to the image's canonical version to make it appear
|
540
|
+
# funny or offensive.
|
541
|
+
# Corresponds to the JSON property `spoof`
|
387
542
|
# @return [String]
|
388
|
-
attr_accessor :
|
543
|
+
attr_accessor :spoof
|
389
544
|
|
390
|
-
#
|
391
|
-
# Corresponds to the JSON property `
|
545
|
+
# Likelihood that this is a medical image.
|
546
|
+
# Corresponds to the JSON property `medical`
|
392
547
|
# @return [String]
|
393
|
-
attr_accessor :
|
548
|
+
attr_accessor :medical
|
394
549
|
|
395
|
-
#
|
396
|
-
# Corresponds to the JSON property `
|
550
|
+
# Violence likelihood.
|
551
|
+
# Corresponds to the JSON property `violence`
|
397
552
|
# @return [String]
|
398
|
-
attr_accessor :
|
553
|
+
attr_accessor :violence
|
399
554
|
|
400
555
|
def initialize(**args)
|
401
556
|
update!(**args)
|
@@ -403,39 +558,21 @@ module Google
|
|
403
558
|
|
404
559
|
# Update properties of this object
|
405
560
|
def update!(**args)
|
406
|
-
@
|
407
|
-
@
|
408
|
-
@
|
561
|
+
@adult = args[:adult] if args.key?(:adult)
|
562
|
+
@spoof = args[:spoof] if args.key?(:spoof)
|
563
|
+
@medical = args[:medical] if args.key?(:medical)
|
564
|
+
@violence = args[:violence] if args.key?(:violence)
|
409
565
|
end
|
410
566
|
end
|
411
567
|
|
412
|
-
#
|
413
|
-
class
|
568
|
+
# Set of dominant colors and their corresponding scores.
|
569
|
+
class DominantColorsAnnotation
|
414
570
|
include Google::Apis::Core::Hashable
|
415
571
|
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
|
420
|
-
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
421
|
-
attr_accessor :partial_matching_images
|
422
|
-
|
423
|
-
# Fully matching images from the Internet.
|
424
|
-
# They're definite neardups and most often a copy of the query image with
|
425
|
-
# merely a size change.
|
426
|
-
# Corresponds to the JSON property `fullMatchingImages`
|
427
|
-
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
428
|
-
attr_accessor :full_matching_images
|
429
|
-
|
430
|
-
# Deduced entities from similar images on the Internet.
|
431
|
-
# Corresponds to the JSON property `webEntities`
|
432
|
-
# @return [Array<Google::Apis::VisionV1::WebEntity>]
|
433
|
-
attr_accessor :web_entities
|
434
|
-
|
435
|
-
# Web pages containing the matching images from the Internet.
|
436
|
-
# Corresponds to the JSON property `pagesWithMatchingImages`
|
437
|
-
# @return [Array<Google::Apis::VisionV1::WebPage>]
|
438
|
-
attr_accessor :pages_with_matching_images
|
572
|
+
# RGB color values with their score and pixel fraction.
|
573
|
+
# Corresponds to the JSON property `colors`
|
574
|
+
# @return [Array<Google::Apis::VisionV1::ColorInfo>]
|
575
|
+
attr_accessor :colors
|
439
576
|
|
440
577
|
def initialize(**args)
|
441
578
|
update!(**args)
|
@@ -443,21 +580,29 @@ module Google
|
|
443
580
|
|
444
581
|
# Update properties of this object
|
445
582
|
def update!(**args)
|
446
|
-
@
|
447
|
-
@full_matching_images = args[:full_matching_images] if args.key?(:full_matching_images)
|
448
|
-
@web_entities = args[:web_entities] if args.key?(:web_entities)
|
449
|
-
@pages_with_matching_images = args[:pages_with_matching_images] if args.key?(:pages_with_matching_images)
|
583
|
+
@colors = args[:colors] if args.key?(:colors)
|
450
584
|
end
|
451
585
|
end
|
452
586
|
|
453
|
-
#
|
454
|
-
|
587
|
+
# TextAnnotation contains a structured representation of OCR extracted text.
|
588
|
+
# The hierarchy of an OCR extracted text structure is like this:
|
589
|
+
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
590
|
+
# Each structural component, starting from Page, may further have their own
|
591
|
+
# properties. Properties describe detected languages, breaks etc.. Please
|
592
|
+
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
593
|
+
# definition below for more detail.
|
594
|
+
class TextAnnotation
|
455
595
|
include Google::Apis::Core::Hashable
|
456
596
|
|
457
|
-
#
|
458
|
-
# Corresponds to the JSON property `
|
459
|
-
# @return [Array<Google::Apis::VisionV1::
|
460
|
-
attr_accessor :
|
597
|
+
# List of pages detected by OCR.
|
598
|
+
# Corresponds to the JSON property `pages`
|
599
|
+
# @return [Array<Google::Apis::VisionV1::Page>]
|
600
|
+
attr_accessor :pages
|
601
|
+
|
602
|
+
# UTF-8 text detected on the pages.
|
603
|
+
# Corresponds to the JSON property `text`
|
604
|
+
# @return [String]
|
605
|
+
attr_accessor :text
|
461
606
|
|
462
607
|
def initialize(**args)
|
463
608
|
update!(**args)
|
@@ -465,30 +610,25 @@ module Google
|
|
465
610
|
|
466
611
|
# Update properties of this object
|
467
612
|
def update!(**args)
|
468
|
-
@
|
613
|
+
@pages = args[:pages] if args.key?(:pages)
|
614
|
+
@text = args[:text] if args.key?(:text)
|
469
615
|
end
|
470
616
|
end
|
471
617
|
|
472
|
-
# A
|
473
|
-
#
|
474
|
-
|
475
|
-
class Position
|
618
|
+
# A vertex represents a 2D point in the image.
|
619
|
+
# NOTE: the vertex coordinates are in the same scale as the original image.
|
620
|
+
class Vertex
|
476
621
|
include Google::Apis::Core::Hashable
|
477
622
|
|
478
|
-
# Y coordinate.
|
479
|
-
# Corresponds to the JSON property `y`
|
480
|
-
# @return [Float]
|
481
|
-
attr_accessor :y
|
482
|
-
|
483
623
|
# X coordinate.
|
484
624
|
# Corresponds to the JSON property `x`
|
485
|
-
# @return [
|
625
|
+
# @return [Fixnum]
|
486
626
|
attr_accessor :x
|
487
627
|
|
488
|
-
#
|
489
|
-
# Corresponds to the JSON property `
|
490
|
-
# @return [
|
491
|
-
attr_accessor :
|
628
|
+
# Y coordinate.
|
629
|
+
# Corresponds to the JSON property `y`
|
630
|
+
# @return [Fixnum]
|
631
|
+
attr_accessor :y
|
492
632
|
|
493
633
|
def initialize(**args)
|
494
634
|
update!(**args)
|
@@ -496,26 +636,26 @@ module Google
|
|
496
636
|
|
497
637
|
# Update properties of this object
|
498
638
|
def update!(**args)
|
499
|
-
@y = args[:y] if args.key?(:y)
|
500
639
|
@x = args[:x] if args.key?(:x)
|
501
|
-
@
|
640
|
+
@y = args[:y] if args.key?(:y)
|
502
641
|
end
|
503
642
|
end
|
504
643
|
|
505
|
-
#
|
506
|
-
class
|
644
|
+
# Detected language for a structural component.
|
645
|
+
class DetectedLanguage
|
507
646
|
include Google::Apis::Core::Hashable
|
508
647
|
|
509
|
-
#
|
510
|
-
# Corresponds to the JSON property `
|
511
|
-
# @return [String]
|
512
|
-
attr_accessor :url
|
513
|
-
|
514
|
-
# Overall relevancy score for the web page.
|
515
|
-
# Not normalized and not comparable across different image queries.
|
516
|
-
# Corresponds to the JSON property `score`
|
648
|
+
# Confidence of detected language. Range [0, 1].
|
649
|
+
# Corresponds to the JSON property `confidence`
|
517
650
|
# @return [Float]
|
518
|
-
attr_accessor :
|
651
|
+
attr_accessor :confidence
|
652
|
+
|
653
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
654
|
+
# information, see
|
655
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
656
|
+
# Corresponds to the JSON property `languageCode`
|
657
|
+
# @return [String]
|
658
|
+
attr_accessor :language_code
|
519
659
|
|
520
660
|
def initialize(**args)
|
521
661
|
update!(**args)
|
@@ -523,126 +663,27 @@ module Google
|
|
523
663
|
|
524
664
|
# Update properties of this object
|
525
665
|
def update!(**args)
|
526
|
-
@
|
527
|
-
@
|
666
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
667
|
+
@language_code = args[:language_code] if args.key?(:language_code)
|
528
668
|
end
|
529
669
|
end
|
530
670
|
|
531
|
-
#
|
532
|
-
|
533
|
-
class ColorInfo
|
671
|
+
# Entity deduced from similar images on the Internet.
|
672
|
+
class WebEntity
|
534
673
|
include Google::Apis::Core::Hashable
|
535
674
|
|
536
|
-
#
|
537
|
-
#
|
538
|
-
#
|
539
|
-
|
540
|
-
attr_accessor :pixel_fraction
|
675
|
+
# Opaque entity ID.
|
676
|
+
# Corresponds to the JSON property `entityId`
|
677
|
+
# @return [String]
|
678
|
+
attr_accessor :entity_id
|
541
679
|
|
542
|
-
#
|
543
|
-
#
|
544
|
-
#
|
545
|
-
|
546
|
-
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
547
|
-
# method in iOS; and, with just a little work, it can be easily formatted into
|
548
|
-
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
549
|
-
# Example (Java):
|
550
|
-
# import com.google.type.Color;
|
551
|
-
# // ...
|
552
|
-
# public static java.awt.Color fromProto(Color protocolor) `
|
553
|
-
# float alpha = protocolor.hasAlpha()
|
554
|
-
# ? protocolor.getAlpha().getValue()
|
555
|
-
# : 1.0;
|
556
|
-
# return new java.awt.Color(
|
557
|
-
# protocolor.getRed(),
|
558
|
-
# protocolor.getGreen(),
|
559
|
-
# protocolor.getBlue(),
|
560
|
-
# alpha);
|
561
|
-
# `
|
562
|
-
# public static Color toProto(java.awt.Color color) `
|
563
|
-
# float red = (float) color.getRed();
|
564
|
-
# float green = (float) color.getGreen();
|
565
|
-
# float blue = (float) color.getBlue();
|
566
|
-
# float denominator = 255.0;
|
567
|
-
# Color.Builder resultBuilder =
|
568
|
-
# Color
|
569
|
-
# .newBuilder()
|
570
|
-
# .setRed(red / denominator)
|
571
|
-
# .setGreen(green / denominator)
|
572
|
-
# .setBlue(blue / denominator);
|
573
|
-
# int alpha = color.getAlpha();
|
574
|
-
# if (alpha != 255) `
|
575
|
-
# result.setAlpha(
|
576
|
-
# FloatValue
|
577
|
-
# .newBuilder()
|
578
|
-
# .setValue(((float) alpha) / denominator)
|
579
|
-
# .build());
|
580
|
-
# `
|
581
|
-
# return resultBuilder.build();
|
582
|
-
# `
|
583
|
-
# // ...
|
584
|
-
# Example (iOS / Obj-C):
|
585
|
-
# // ...
|
586
|
-
# static UIColor* fromProto(Color* protocolor) `
|
587
|
-
# float red = [protocolor red];
|
588
|
-
# float green = [protocolor green];
|
589
|
-
# float blue = [protocolor blue];
|
590
|
-
# FloatValue* alpha_wrapper = [protocolor alpha];
|
591
|
-
# float alpha = 1.0;
|
592
|
-
# if (alpha_wrapper != nil) `
|
593
|
-
# alpha = [alpha_wrapper value];
|
594
|
-
# `
|
595
|
-
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
596
|
-
# `
|
597
|
-
# static Color* toProto(UIColor* color) `
|
598
|
-
# CGFloat red, green, blue, alpha;
|
599
|
-
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
600
|
-
# return nil;
|
601
|
-
# `
|
602
|
-
# Color* result = [Color alloc] init];
|
603
|
-
# [result setRed:red];
|
604
|
-
# [result setGreen:green];
|
605
|
-
# [result setBlue:blue];
|
606
|
-
# if (alpha <= 0.9999) `
|
607
|
-
# [result setAlpha:floatWrapperWithValue(alpha)];
|
608
|
-
# `
|
609
|
-
# [result autorelease];
|
610
|
-
# return result;
|
611
|
-
# `
|
612
|
-
# // ...
|
613
|
-
# Example (JavaScript):
|
614
|
-
# // ...
|
615
|
-
# var protoToCssColor = function(rgb_color) `
|
616
|
-
# var redFrac = rgb_color.red || 0.0;
|
617
|
-
# var greenFrac = rgb_color.green || 0.0;
|
618
|
-
# var blueFrac = rgb_color.blue || 0.0;
|
619
|
-
# var red = Math.floor(redFrac * 255);
|
620
|
-
# var green = Math.floor(greenFrac * 255);
|
621
|
-
# var blue = Math.floor(blueFrac * 255);
|
622
|
-
# if (!('alpha' in rgb_color)) `
|
623
|
-
# return rgbToCssColor_(red, green, blue);
|
624
|
-
# `
|
625
|
-
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
626
|
-
# var rgbParams = [red, green, blue].join(',');
|
627
|
-
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
628
|
-
# `;
|
629
|
-
# var rgbToCssColor_ = function(red, green, blue) `
|
630
|
-
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
631
|
-
# var hexString = rgbNumber.toString(16);
|
632
|
-
# var missingZeros = 6 - hexString.length;
|
633
|
-
# var resultBuilder = ['#'];
|
634
|
-
# for (var i = 0; i < missingZeros; i++) `
|
635
|
-
# resultBuilder.push('0');
|
636
|
-
# `
|
637
|
-
# resultBuilder.push(hexString);
|
638
|
-
# return resultBuilder.join('');
|
639
|
-
# `;
|
640
|
-
# // ...
|
641
|
-
# Corresponds to the JSON property `color`
|
642
|
-
# @return [Google::Apis::VisionV1::Color]
|
643
|
-
attr_accessor :color
|
680
|
+
# Canonical description of the entity, in English.
|
681
|
+
# Corresponds to the JSON property `description`
|
682
|
+
# @return [String]
|
683
|
+
attr_accessor :description
|
644
684
|
|
645
|
-
#
|
685
|
+
# Overall relevancy score for the entity.
|
686
|
+
# Not normalized and not comparable across different image queries.
|
646
687
|
# Corresponds to the JSON property `score`
|
647
688
|
# @return [Float]
|
648
689
|
attr_accessor :score
|
@@ -653,75 +694,25 @@ module Google
|
|
653
694
|
|
654
695
|
# Update properties of this object
|
655
696
|
def update!(**args)
|
656
|
-
@
|
657
|
-
@
|
697
|
+
@entity_id = args[:entity_id] if args.key?(:entity_id)
|
698
|
+
@description = args[:description] if args.key?(:description)
|
658
699
|
@score = args[:score] if args.key?(:score)
|
659
700
|
end
|
660
701
|
end
|
661
702
|
|
662
|
-
#
|
663
|
-
class
|
703
|
+
# Additional information detected on the structural component.
|
704
|
+
class TextProperty
|
664
705
|
include Google::Apis::Core::Hashable
|
665
706
|
|
666
|
-
#
|
667
|
-
#
|
668
|
-
#
|
669
|
-
|
670
|
-
attr_accessor :properties
|
671
|
-
|
672
|
-
# Overall score of the result. Range [0, 1].
|
673
|
-
# Corresponds to the JSON property `score`
|
674
|
-
# @return [Float]
|
675
|
-
attr_accessor :score
|
676
|
-
|
677
|
-
# The location information for the detected entity. Multiple
|
678
|
-
# `LocationInfo` elements can be present because one location may
|
679
|
-
# indicate the location of the scene in the image, and another location
|
680
|
-
# may indicate the location of the place where the image was taken.
|
681
|
-
# Location information is usually present for landmarks.
|
682
|
-
# Corresponds to the JSON property `locations`
|
683
|
-
# @return [Array<Google::Apis::VisionV1::LocationInfo>]
|
684
|
-
attr_accessor :locations
|
685
|
-
|
686
|
-
# Opaque entity ID. Some IDs may be available in
|
687
|
-
# [Google Knowledge Graph Search API](https://developers.google.com/knowledge-
|
688
|
-
# graph/).
|
689
|
-
# Corresponds to the JSON property `mid`
|
690
|
-
# @return [String]
|
691
|
-
attr_accessor :mid
|
692
|
-
|
693
|
-
# The accuracy of the entity detection in an image.
|
694
|
-
# For example, for an image in which the "Eiffel Tower" entity is detected,
|
695
|
-
# this field represents the confidence that there is a tower in the query
|
696
|
-
# image. Range [0, 1].
|
697
|
-
# Corresponds to the JSON property `confidence`
|
698
|
-
# @return [Float]
|
699
|
-
attr_accessor :confidence
|
700
|
-
|
701
|
-
# A bounding polygon for the detected image annotation.
|
702
|
-
# Corresponds to the JSON property `boundingPoly`
|
703
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
704
|
-
attr_accessor :bounding_poly
|
705
|
-
|
706
|
-
# The language code for the locale in which the entity textual
|
707
|
-
# `description` is expressed.
|
708
|
-
# Corresponds to the JSON property `locale`
|
709
|
-
# @return [String]
|
710
|
-
attr_accessor :locale
|
711
|
-
|
712
|
-
# Entity textual description, expressed in its `locale` language.
|
713
|
-
# Corresponds to the JSON property `description`
|
714
|
-
# @return [String]
|
715
|
-
attr_accessor :description
|
707
|
+
# Detected start or end of a structural component.
|
708
|
+
# Corresponds to the JSON property `detectedBreak`
|
709
|
+
# @return [Google::Apis::VisionV1::DetectedBreak]
|
710
|
+
attr_accessor :detected_break
|
716
711
|
|
717
|
-
#
|
718
|
-
#
|
719
|
-
#
|
720
|
-
|
721
|
-
# there is a tower in each image may be the same. Range [0, 1].
|
722
|
-
# Corresponds to the JSON property `topicality`
|
723
|
-
# @return [Float]
|
724
|
-
attr_accessor :topicality
|
712
|
+
# A list of detected languages together with confidence.
|
713
|
+
# Corresponds to the JSON property `detectedLanguages`
|
714
|
+
# @return [Array<Google::Apis::VisionV1::DetectedLanguage>]
|
715
|
+
attr_accessor :detected_languages
|
725
716
|
|
726
717
|
def initialize(**args)
|
727
718
|
update!(**args)
|
@@ -729,37 +720,19 @@ module Google
|
|
729
720
|
|
730
721
|
# Update properties of this object
|
731
722
|
def update!(**args)
|
732
|
-
@
|
733
|
-
@
|
734
|
-
@locations = args[:locations] if args.key?(:locations)
|
735
|
-
@mid = args[:mid] if args.key?(:mid)
|
736
|
-
@confidence = args[:confidence] if args.key?(:confidence)
|
737
|
-
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
738
|
-
@locale = args[:locale] if args.key?(:locale)
|
739
|
-
@description = args[:description] if args.key?(:description)
|
740
|
-
@topicality = args[:topicality] if args.key?(:topicality)
|
723
|
+
@detected_break = args[:detected_break] if args.key?(:detected_break)
|
724
|
+
@detected_languages = args[:detected_languages] if args.key?(:detected_languages)
|
741
725
|
end
|
742
726
|
end
|
743
727
|
|
744
|
-
#
|
745
|
-
class
|
728
|
+
# A bounding polygon for the detected image annotation.
|
729
|
+
class BoundingPoly
|
746
730
|
include Google::Apis::Core::Hashable
|
747
731
|
|
748
|
-
#
|
749
|
-
# Corresponds to the JSON property `
|
750
|
-
# @return [
|
751
|
-
attr_accessor :
|
752
|
-
|
753
|
-
# Fraction of importance of this salient region with respect to the original
|
754
|
-
# image.
|
755
|
-
# Corresponds to the JSON property `importanceFraction`
|
756
|
-
# @return [Float]
|
757
|
-
attr_accessor :importance_fraction
|
758
|
-
|
759
|
-
# A bounding polygon for the detected image annotation.
|
760
|
-
# Corresponds to the JSON property `boundingPoly`
|
761
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
762
|
-
attr_accessor :bounding_poly
|
732
|
+
# The bounding polygon vertices.
|
733
|
+
# Corresponds to the JSON property `vertices`
|
734
|
+
# @return [Array<Google::Apis::VisionV1::Vertex>]
|
735
|
+
attr_accessor :vertices
|
763
736
|
|
764
737
|
def initialize(**args)
|
765
738
|
update!(**args)
|
@@ -767,31 +740,114 @@ module Google
|
|
767
740
|
|
768
741
|
# Update properties of this object
|
769
742
|
def update!(**args)
|
770
|
-
@
|
771
|
-
@importance_fraction = args[:importance_fraction] if args.key?(:importance_fraction)
|
772
|
-
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
743
|
+
@vertices = args[:vertices] if args.key?(:vertices)
|
773
744
|
end
|
774
745
|
end
|
775
746
|
|
776
|
-
#
|
777
|
-
|
778
|
-
# if the face is near one or more edges of the image.
|
779
|
-
# Therefore it is NOT guaranteed that `0 <= x < width` or
|
780
|
-
# `0 <= y < height`.
|
781
|
-
class Landmark
|
747
|
+
# Response to an image annotation request.
|
748
|
+
class AnnotateImageResponse
|
782
749
|
include Google::Apis::Core::Hashable
|
783
750
|
|
784
|
-
#
|
785
|
-
#
|
786
|
-
# The
|
787
|
-
#
|
788
|
-
#
|
789
|
-
|
751
|
+
# The `Status` type defines a logical error model that is suitable for different
|
752
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
753
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
754
|
+
# - Simple to use and understand for most users
|
755
|
+
# - Flexible enough to meet unexpected needs
|
756
|
+
# # Overview
|
757
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
758
|
+
# and error details. The error code should be an enum value of
|
759
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
760
|
+
# error message should be a developer-facing English message that helps
|
761
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
762
|
+
# error message is needed, put the localized message in the error details or
|
763
|
+
# localize it in the client. The optional error details may contain arbitrary
|
764
|
+
# information about the error. There is a predefined set of error detail types
|
765
|
+
# in the package `google.rpc` which can be used for common error conditions.
|
766
|
+
# # Language mapping
|
767
|
+
# The `Status` message is the logical representation of the error model, but it
|
768
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
769
|
+
# exposed in different client libraries and different wire protocols, it can be
|
770
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
771
|
+
# in Java, but more likely mapped to some error codes in C.
|
772
|
+
# # Other uses
|
773
|
+
# The error model and the `Status` message can be used in a variety of
|
774
|
+
# environments, either with or without APIs, to provide a
|
775
|
+
# consistent developer experience across different environments.
|
776
|
+
# Example uses of this error model include:
|
777
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
778
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
779
|
+
# errors.
|
780
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
781
|
+
# have a `Status` message for error reporting purpose.
|
782
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
783
|
+
# `Status` message should be used directly inside batch response, one for
|
784
|
+
# each error sub-response.
|
785
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
786
|
+
# results in its response, the status of those operations should be
|
787
|
+
# represented directly using the `Status` message.
|
788
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
789
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
790
|
+
# Corresponds to the JSON property `error`
|
791
|
+
# @return [Google::Apis::VisionV1::Status]
|
792
|
+
attr_accessor :error
|
790
793
|
|
791
|
-
#
|
792
|
-
#
|
793
|
-
#
|
794
|
-
|
794
|
+
# TextAnnotation contains a structured representation of OCR extracted text.
|
795
|
+
# The hierarchy of an OCR extracted text structure is like this:
|
796
|
+
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
797
|
+
# Each structural component, starting from Page, may further have their own
|
798
|
+
# properties. Properties describe detected languages, breaks etc.. Please
|
799
|
+
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
800
|
+
# definition below for more detail.
|
801
|
+
# Corresponds to the JSON property `fullTextAnnotation`
|
802
|
+
# @return [Google::Apis::VisionV1::TextAnnotation]
|
803
|
+
attr_accessor :full_text_annotation
|
804
|
+
|
805
|
+
# If present, landmark detection has completed successfully.
|
806
|
+
# Corresponds to the JSON property `landmarkAnnotations`
|
807
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
808
|
+
attr_accessor :landmark_annotations
|
809
|
+
|
810
|
+
# If present, text (OCR) detection has completed successfully.
|
811
|
+
# Corresponds to the JSON property `textAnnotations`
|
812
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
813
|
+
attr_accessor :text_annotations
|
814
|
+
|
815
|
+
# If present, face detection has completed successfully.
|
816
|
+
# Corresponds to the JSON property `faceAnnotations`
|
817
|
+
# @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
|
818
|
+
attr_accessor :face_annotations
|
819
|
+
|
820
|
+
# Stores image properties, such as dominant colors.
|
821
|
+
# Corresponds to the JSON property `imagePropertiesAnnotation`
|
822
|
+
# @return [Google::Apis::VisionV1::ImageProperties]
|
823
|
+
attr_accessor :image_properties_annotation
|
824
|
+
|
825
|
+
# If present, logo detection has completed successfully.
|
826
|
+
# Corresponds to the JSON property `logoAnnotations`
|
827
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
828
|
+
attr_accessor :logo_annotations
|
829
|
+
|
830
|
+
# Relevant information for the image from the Internet.
|
831
|
+
# Corresponds to the JSON property `webDetection`
|
832
|
+
# @return [Google::Apis::VisionV1::WebDetection]
|
833
|
+
attr_accessor :web_detection
|
834
|
+
|
835
|
+
# Set of crop hints that are used to generate new crops when serving images.
|
836
|
+
# Corresponds to the JSON property `cropHintsAnnotation`
|
837
|
+
# @return [Google::Apis::VisionV1::CropHintsAnnotation]
|
838
|
+
attr_accessor :crop_hints_annotation
|
839
|
+
|
840
|
+
# Set of features pertaining to the image, computed by computer vision
|
841
|
+
# methods over safe-search verticals (for example, adult, spoof, medical,
|
842
|
+
# violence).
|
843
|
+
# Corresponds to the JSON property `safeSearchAnnotation`
|
844
|
+
# @return [Google::Apis::VisionV1::SafeSearchAnnotation]
|
845
|
+
attr_accessor :safe_search_annotation
|
846
|
+
|
847
|
+
# If present, label detection has completed successfully.
|
848
|
+
# Corresponds to the JSON property `labelAnnotations`
|
849
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
850
|
+
attr_accessor :label_annotations
|
795
851
|
|
796
852
|
def initialize(**args)
|
797
853
|
update!(**args)
|
@@ -799,25 +855,33 @@ module Google
|
|
799
855
|
|
800
856
|
# Update properties of this object
|
801
857
|
def update!(**args)
|
802
|
-
@
|
803
|
-
@
|
858
|
+
@error = args[:error] if args.key?(:error)
|
859
|
+
@full_text_annotation = args[:full_text_annotation] if args.key?(:full_text_annotation)
|
860
|
+
@landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
|
861
|
+
@text_annotations = args[:text_annotations] if args.key?(:text_annotations)
|
862
|
+
@face_annotations = args[:face_annotations] if args.key?(:face_annotations)
|
863
|
+
@image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
|
864
|
+
@logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
|
865
|
+
@web_detection = args[:web_detection] if args.key?(:web_detection)
|
866
|
+
@crop_hints_annotation = args[:crop_hints_annotation] if args.key?(:crop_hints_annotation)
|
867
|
+
@safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
|
868
|
+
@label_annotations = args[:label_annotations] if args.key?(:label_annotations)
|
804
869
|
end
|
805
870
|
end
|
806
871
|
|
807
|
-
#
|
808
|
-
class
|
809
|
-
include Google::Apis::Core::Hashable
|
810
|
-
|
811
|
-
# Overall relevancy score for the image.
|
812
|
-
# Not normalized and not comparable across different image queries.
|
813
|
-
# Corresponds to the JSON property `score`
|
814
|
-
# @return [Float]
|
815
|
-
attr_accessor :score
|
872
|
+
# Parameters for crop hints annotation request.
|
873
|
+
class CropHintsParams
|
874
|
+
include Google::Apis::Core::Hashable
|
816
875
|
|
817
|
-
#
|
818
|
-
#
|
819
|
-
#
|
820
|
-
|
876
|
+
# Aspect ratios in floats, representing the ratio of the width to the height
|
877
|
+
# of the image. For example, if the desired aspect ratio is 4/3, the
|
878
|
+
# corresponding float value should be 1.33333. If not specified, the
|
879
|
+
# best possible crop is returned. The number of provided aspect ratios is
|
880
|
+
# limited to a maximum of 16; any aspect ratios provided after the 16th are
|
881
|
+
# ignored.
|
882
|
+
# Corresponds to the JSON property `aspectRatios`
|
883
|
+
# @return [Array<Float>]
|
884
|
+
attr_accessor :aspect_ratios
|
821
885
|
|
822
886
|
def initialize(**args)
|
823
887
|
update!(**args)
|
@@ -825,13 +889,12 @@ module Google
|
|
825
889
|
|
826
890
|
# Update properties of this object
|
827
891
|
def update!(**args)
|
828
|
-
@
|
829
|
-
@url = args[:url] if args.key?(:url)
|
892
|
+
@aspect_ratios = args[:aspect_ratios] if args.key?(:aspect_ratios)
|
830
893
|
end
|
831
894
|
end
|
832
895
|
|
833
|
-
#
|
834
|
-
class
|
896
|
+
# Logical element on the page.
|
897
|
+
class Block
|
835
898
|
include Google::Apis::Core::Hashable
|
836
899
|
|
837
900
|
# Additional information detected on the structural component.
|
@@ -839,16 +902,20 @@ module Google
|
|
839
902
|
# @return [Google::Apis::VisionV1::TextProperty]
|
840
903
|
attr_accessor :property
|
841
904
|
|
905
|
+
# Detected block type (text, image etc) for this block.
|
906
|
+
# Corresponds to the JSON property `blockType`
|
907
|
+
# @return [String]
|
908
|
+
attr_accessor :block_type
|
909
|
+
|
842
910
|
# A bounding polygon for the detected image annotation.
|
843
911
|
# Corresponds to the JSON property `boundingBox`
|
844
912
|
# @return [Google::Apis::VisionV1::BoundingPoly]
|
845
913
|
attr_accessor :bounding_box
|
846
914
|
|
847
|
-
# List of
|
848
|
-
#
|
849
|
-
#
|
850
|
-
|
851
|
-
attr_accessor :symbols
|
915
|
+
# List of paragraphs in this block (if this blocks is of type text).
|
916
|
+
# Corresponds to the JSON property `paragraphs`
|
917
|
+
# @return [Array<Google::Apis::VisionV1::Paragraph>]
|
918
|
+
attr_accessor :paragraphs
|
852
919
|
|
853
920
|
def initialize(**args)
|
854
921
|
update!(**args)
|
@@ -857,29 +924,44 @@ module Google
|
|
857
924
|
# Update properties of this object
|
858
925
|
def update!(**args)
|
859
926
|
@property = args[:property] if args.key?(:property)
|
927
|
+
@block_type = args[:block_type] if args.key?(:block_type)
|
860
928
|
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
861
|
-
@
|
929
|
+
@paragraphs = args[:paragraphs] if args.key?(:paragraphs)
|
862
930
|
end
|
863
931
|
end
|
864
932
|
|
865
|
-
#
|
866
|
-
class
|
933
|
+
# Relevant information for the image from the Internet.
|
934
|
+
class WebDetection
|
867
935
|
include Google::Apis::Core::Hashable
|
868
936
|
|
869
|
-
#
|
870
|
-
#
|
871
|
-
#
|
872
|
-
|
937
|
+
# Fully matching images from the Internet.
|
938
|
+
# They're definite neardups and most often a copy of the query image with
|
939
|
+
# merely a size change.
|
940
|
+
# Corresponds to the JSON property `fullMatchingImages`
|
941
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
942
|
+
attr_accessor :full_matching_images
|
873
943
|
|
874
|
-
#
|
875
|
-
# Corresponds to the JSON property `
|
876
|
-
# @return [Google::Apis::VisionV1::
|
877
|
-
attr_accessor :
|
944
|
+
# Deduced entities from similar images on the Internet.
|
945
|
+
# Corresponds to the JSON property `webEntities`
|
946
|
+
# @return [Array<Google::Apis::VisionV1::WebEntity>]
|
947
|
+
attr_accessor :web_entities
|
878
948
|
|
879
|
-
#
|
880
|
-
# Corresponds to the JSON property `
|
881
|
-
# @return [Array<Google::Apis::VisionV1::
|
882
|
-
attr_accessor :
|
949
|
+
# Web pages containing the matching images from the Internet.
|
950
|
+
# Corresponds to the JSON property `pagesWithMatchingImages`
|
951
|
+
# @return [Array<Google::Apis::VisionV1::WebPage>]
|
952
|
+
attr_accessor :pages_with_matching_images
|
953
|
+
|
954
|
+
# Partial matching images from the Internet.
|
955
|
+
# Those images are similar enough to share some key-point features. For
|
956
|
+
# example an original image will likely have partial matching for its crops.
|
957
|
+
# Corresponds to the JSON property `partialMatchingImages`
|
958
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
959
|
+
attr_accessor :partial_matching_images
|
960
|
+
|
961
|
+
# The visually similar image results.
|
962
|
+
# Corresponds to the JSON property `visuallySimilarImages`
|
963
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
964
|
+
attr_accessor :visually_similar_images
|
883
965
|
|
884
966
|
def initialize(**args)
|
885
967
|
update!(**args)
|
@@ -887,27 +969,22 @@ module Google
|
|
887
969
|
|
888
970
|
# Update properties of this object
|
889
971
|
def update!(**args)
|
890
|
-
@
|
891
|
-
@
|
892
|
-
@
|
972
|
+
@full_matching_images = args[:full_matching_images] if args.key?(:full_matching_images)
|
973
|
+
@web_entities = args[:web_entities] if args.key?(:web_entities)
|
974
|
+
@pages_with_matching_images = args[:pages_with_matching_images] if args.key?(:pages_with_matching_images)
|
975
|
+
@partial_matching_images = args[:partial_matching_images] if args.key?(:partial_matching_images)
|
976
|
+
@visually_similar_images = args[:visually_similar_images] if args.key?(:visually_similar_images)
|
893
977
|
end
|
894
978
|
end
|
895
979
|
|
896
|
-
#
|
897
|
-
class
|
980
|
+
# Response to a batch image annotation request.
|
981
|
+
class BatchAnnotateImagesResponse
|
898
982
|
include Google::Apis::Core::Hashable
|
899
983
|
|
900
|
-
#
|
901
|
-
#
|
902
|
-
#
|
903
|
-
|
904
|
-
# @return [String]
|
905
|
-
attr_accessor :content
|
906
|
-
|
907
|
-
# External image source (Google Cloud Storage image location).
|
908
|
-
# Corresponds to the JSON property `source`
|
909
|
-
# @return [Google::Apis::VisionV1::ImageSource]
|
910
|
-
attr_accessor :source
|
984
|
+
# Individual responses to image annotation requests within the batch.
|
985
|
+
# Corresponds to the JSON property `responses`
|
986
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
|
987
|
+
attr_accessor :responses
|
911
988
|
|
912
989
|
def initialize(**args)
|
913
990
|
update!(**args)
|
@@ -915,94 +992,37 @@ module Google
|
|
915
992
|
|
916
993
|
# Update properties of this object
|
917
994
|
def update!(**args)
|
918
|
-
@
|
919
|
-
@source = args[:source] if args.key?(:source)
|
995
|
+
@responses = args[:responses] if args.key?(:responses)
|
920
996
|
end
|
921
997
|
end
|
922
998
|
|
923
|
-
#
|
924
|
-
class
|
999
|
+
# External image source (Google Cloud Storage image location).
|
1000
|
+
class ImageSource
|
925
1001
|
include Google::Apis::Core::Hashable
|
926
1002
|
|
927
|
-
#
|
928
|
-
#
|
929
|
-
#
|
930
|
-
|
931
|
-
|
932
|
-
#
|
933
|
-
#
|
934
|
-
#
|
935
|
-
#
|
936
|
-
#
|
937
|
-
|
938
|
-
|
939
|
-
# Detection confidence. Range [0, 1].
|
940
|
-
# Corresponds to the JSON property `detectionConfidence`
|
941
|
-
# @return [Float]
|
942
|
-
attr_accessor :detection_confidence
|
943
|
-
|
944
|
-
# Blurred likelihood.
|
945
|
-
# Corresponds to the JSON property `blurredLikelihood`
|
946
|
-
# @return [String]
|
947
|
-
attr_accessor :blurred_likelihood
|
948
|
-
|
949
|
-
# Headwear likelihood.
|
950
|
-
# Corresponds to the JSON property `headwearLikelihood`
|
951
|
-
# @return [String]
|
952
|
-
attr_accessor :headwear_likelihood
|
953
|
-
|
954
|
-
# A bounding polygon for the detected image annotation.
|
955
|
-
# Corresponds to the JSON property `boundingPoly`
|
956
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
957
|
-
attr_accessor :bounding_poly
|
958
|
-
|
959
|
-
# Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
|
960
|
-
# of the face relative to the image vertical about the axis perpendicular to
|
961
|
-
# the face. Range [-180,180].
|
962
|
-
# Corresponds to the JSON property `rollAngle`
|
963
|
-
# @return [Float]
|
964
|
-
attr_accessor :roll_angle
|
965
|
-
|
966
|
-
# Sorrow likelihood.
|
967
|
-
# Corresponds to the JSON property `sorrowLikelihood`
|
968
|
-
# @return [String]
|
969
|
-
attr_accessor :sorrow_likelihood
|
970
|
-
|
971
|
-
# Pitch angle, which indicates the upwards/downwards angle that the face is
|
972
|
-
# pointing relative to the image's horizontal plane. Range [-180,180].
|
973
|
-
# Corresponds to the JSON property `tiltAngle`
|
974
|
-
# @return [Float]
|
975
|
-
attr_accessor :tilt_angle
|
976
|
-
|
977
|
-
# A bounding polygon for the detected image annotation.
|
978
|
-
# Corresponds to the JSON property `fdBoundingPoly`
|
979
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
980
|
-
attr_accessor :fd_bounding_poly
|
981
|
-
|
982
|
-
# Anger likelihood.
|
983
|
-
# Corresponds to the JSON property `angerLikelihood`
|
984
|
-
# @return [String]
|
985
|
-
attr_accessor :anger_likelihood
|
986
|
-
|
987
|
-
# Detected face landmarks.
|
988
|
-
# Corresponds to the JSON property `landmarks`
|
989
|
-
# @return [Array<Google::Apis::VisionV1::Landmark>]
|
990
|
-
attr_accessor :landmarks
|
991
|
-
|
992
|
-
# Surprise likelihood.
|
993
|
-
# Corresponds to the JSON property `surpriseLikelihood`
|
1003
|
+
# Image URI which supports:
|
1004
|
+
# 1) Google Cloud Storage image URI, which must be in the following form:
|
1005
|
+
# `gs://bucket_name/object_name` (for details, see
|
1006
|
+
# [Google Cloud Storage Request
|
1007
|
+
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
1008
|
+
# NOTE: Cloud Storage object versioning is not supported.
|
1009
|
+
# 2) Publicly accessible image HTTP/HTTPS URL.
|
1010
|
+
# This is preferred over the legacy `gcs_image_uri` above. When both
|
1011
|
+
# `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
|
1012
|
+
# precedence.
|
1013
|
+
# Corresponds to the JSON property `imageUri`
|
994
1014
|
# @return [String]
|
995
|
-
attr_accessor :
|
1015
|
+
attr_accessor :image_uri
|
996
1016
|
|
997
|
-
#
|
998
|
-
#
|
1017
|
+
# NOTE: For new code `image_uri` below is preferred.
|
1018
|
+
# Google Cloud Storage image URI, which must be in the following form:
|
1019
|
+
# `gs://bucket_name/object_name` (for details, see
|
1020
|
+
# [Google Cloud Storage Request
|
1021
|
+
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
1022
|
+
# NOTE: Cloud Storage object versioning is not supported.
|
1023
|
+
# Corresponds to the JSON property `gcsImageUri`
|
999
1024
|
# @return [String]
|
1000
|
-
attr_accessor :
|
1001
|
-
|
1002
|
-
# Face landmarking confidence. Range [0, 1].
|
1003
|
-
# Corresponds to the JSON property `landmarkingConfidence`
|
1004
|
-
# @return [Float]
|
1005
|
-
attr_accessor :landmarking_confidence
|
1025
|
+
attr_accessor :gcs_image_uri
|
1006
1026
|
|
1007
1027
|
def initialize(**args)
|
1008
1028
|
update!(**args)
|
@@ -1010,32 +1030,55 @@ module Google
|
|
1010
1030
|
|
1011
1031
|
# Update properties of this object
|
1012
1032
|
def update!(**args)
|
1013
|
-
@
|
1014
|
-
@
|
1015
|
-
@detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
|
1016
|
-
@blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
|
1017
|
-
@headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
|
1018
|
-
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1019
|
-
@roll_angle = args[:roll_angle] if args.key?(:roll_angle)
|
1020
|
-
@sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
|
1021
|
-
@tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
|
1022
|
-
@fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
|
1023
|
-
@anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
|
1024
|
-
@landmarks = args[:landmarks] if args.key?(:landmarks)
|
1025
|
-
@surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
|
1026
|
-
@joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
|
1027
|
-
@landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
|
1033
|
+
@image_uri = args[:image_uri] if args.key?(:image_uri)
|
1034
|
+
@gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
|
1028
1035
|
end
|
1029
1036
|
end
|
1030
1037
|
|
1031
|
-
#
|
1032
|
-
class
|
1038
|
+
# Detected entity location information.
|
1039
|
+
class LocationInfo
|
1033
1040
|
include Google::Apis::Core::Hashable
|
1034
1041
|
|
1035
|
-
#
|
1036
|
-
#
|
1037
|
-
#
|
1038
|
-
|
1042
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1043
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1044
|
+
# specified otherwise, this must conform to the
|
1045
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1046
|
+
# standard</a>. Values must be within normalized ranges.
|
1047
|
+
# Example of normalization code in Python:
|
1048
|
+
# def NormalizeLongitude(longitude):
|
1049
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1050
|
+
# q, r = divmod(longitude, 360.0)
|
1051
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1052
|
+
# return r - 360.0
|
1053
|
+
# return r
|
1054
|
+
# def NormalizeLatLng(latitude, longitude):
|
1055
|
+
# """Wraps decimal degrees latitude and longitude to
|
1056
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1057
|
+
# r = latitude % 360.0
|
1058
|
+
# if r <= 90.0:
|
1059
|
+
# return r, NormalizeLongitude(longitude)
|
1060
|
+
# elif r >= 270.0:
|
1061
|
+
# return r - 360, NormalizeLongitude(longitude)
|
1062
|
+
# else:
|
1063
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1064
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
1065
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
1066
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
1067
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1068
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1069
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1070
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1071
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1072
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1073
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1074
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1075
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1076
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1077
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1078
|
+
# as if it were annotated as ST_LOCATION.
|
1079
|
+
# Corresponds to the JSON property `latLng`
|
1080
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
1081
|
+
attr_accessor :lat_lng
|
1039
1082
|
|
1040
1083
|
def initialize(**args)
|
1041
1084
|
update!(**args)
|
@@ -1043,24 +1086,28 @@ module Google
|
|
1043
1086
|
|
1044
1087
|
# Update properties of this object
|
1045
1088
|
def update!(**args)
|
1046
|
-
@
|
1089
|
+
@lat_lng = args[:lat_lng] if args.key?(:lat_lng)
|
1047
1090
|
end
|
1048
1091
|
end
|
1049
1092
|
|
1050
|
-
#
|
1051
|
-
class
|
1093
|
+
# A `Property` consists of a user-supplied name/value pair.
|
1094
|
+
class Property
|
1052
1095
|
include Google::Apis::Core::Hashable
|
1053
1096
|
|
1054
|
-
#
|
1055
|
-
# Corresponds to the JSON property `
|
1097
|
+
# Value of the property.
|
1098
|
+
# Corresponds to the JSON property `value`
|
1056
1099
|
# @return [String]
|
1057
|
-
attr_accessor :
|
1100
|
+
attr_accessor :value
|
1058
1101
|
|
1059
|
-
#
|
1060
|
-
# Corresponds to the JSON property `
|
1061
|
-
# @return [
|
1062
|
-
attr_accessor :
|
1063
|
-
|
1102
|
+
# Value of numeric properties.
|
1103
|
+
# Corresponds to the JSON property `uint64Value`
|
1104
|
+
# @return [String]
|
1105
|
+
attr_accessor :uint64_value
|
1106
|
+
|
1107
|
+
# Name of the property.
|
1108
|
+
# Corresponds to the JSON property `name`
|
1109
|
+
# @return [String]
|
1110
|
+
attr_accessor :name
|
1064
1111
|
|
1065
1112
|
def initialize(**args)
|
1066
1113
|
update!(**args)
|
@@ -1068,36 +1115,32 @@ module Google
|
|
1068
1115
|
|
1069
1116
|
# Update properties of this object
|
1070
1117
|
def update!(**args)
|
1071
|
-
@
|
1072
|
-
@
|
1118
|
+
@value = args[:value] if args.key?(:value)
|
1119
|
+
@uint64_value = args[:uint64_value] if args.key?(:uint64_value)
|
1120
|
+
@name = args[:name] if args.key?(:name)
|
1073
1121
|
end
|
1074
1122
|
end
|
1075
1123
|
|
1076
|
-
#
|
1077
|
-
|
1124
|
+
# A 3D position in the image, used primarily for Face detection landmarks.
|
1125
|
+
# A valid Position must have both x and y coordinates.
|
1126
|
+
# The position coordinates are in the same scale as the original image.
|
1127
|
+
class Position
|
1078
1128
|
include Google::Apis::Core::Hashable
|
1079
1129
|
|
1080
|
-
#
|
1081
|
-
#
|
1082
|
-
#
|
1083
|
-
|
1084
|
-
# setting a hint will help get better results (although it will be a
|
1085
|
-
# significant hindrance if the hint is wrong). Text detection returns an
|
1086
|
-
# error if one or more of the specified languages is not one of the
|
1087
|
-
# [supported languages](/vision/docs/languages).
|
1088
|
-
# Corresponds to the JSON property `languageHints`
|
1089
|
-
# @return [Array<String>]
|
1090
|
-
attr_accessor :language_hints
|
1130
|
+
# Y coordinate.
|
1131
|
+
# Corresponds to the JSON property `y`
|
1132
|
+
# @return [Float]
|
1133
|
+
attr_accessor :y
|
1091
1134
|
|
1092
|
-
#
|
1093
|
-
# Corresponds to the JSON property `
|
1094
|
-
# @return [
|
1095
|
-
attr_accessor :
|
1135
|
+
# X coordinate.
|
1136
|
+
# Corresponds to the JSON property `x`
|
1137
|
+
# @return [Float]
|
1138
|
+
attr_accessor :x
|
1096
1139
|
|
1097
|
-
#
|
1098
|
-
# Corresponds to the JSON property `
|
1099
|
-
# @return [
|
1100
|
-
attr_accessor :
|
1140
|
+
# Z coordinate (or depth).
|
1141
|
+
# Corresponds to the JSON property `z`
|
1142
|
+
# @return [Float]
|
1143
|
+
attr_accessor :z
|
1101
1144
|
|
1102
1145
|
def initialize(**args)
|
1103
1146
|
update!(**args)
|
@@ -1105,35 +1148,26 @@ module Google
|
|
1105
1148
|
|
1106
1149
|
# Update properties of this object
|
1107
1150
|
def update!(**args)
|
1108
|
-
@
|
1109
|
-
@
|
1110
|
-
@
|
1151
|
+
@y = args[:y] if args.key?(:y)
|
1152
|
+
@x = args[:x] if args.key?(:x)
|
1153
|
+
@z = args[:z] if args.key?(:z)
|
1111
1154
|
end
|
1112
1155
|
end
|
1113
1156
|
|
1114
|
-
#
|
1115
|
-
class
|
1157
|
+
# Metadata for web pages.
|
1158
|
+
class WebPage
|
1116
1159
|
include Google::Apis::Core::Hashable
|
1117
1160
|
|
1118
|
-
#
|
1119
|
-
#
|
1120
|
-
#
|
1121
|
-
|
1122
|
-
|
1123
|
-
# List of blocks of text, images etc on this page.
|
1124
|
-
# Corresponds to the JSON property `blocks`
|
1125
|
-
# @return [Array<Google::Apis::VisionV1::Block>]
|
1126
|
-
attr_accessor :blocks
|
1127
|
-
|
1128
|
-
# Additional information detected on the structural component.
|
1129
|
-
# Corresponds to the JSON property `property`
|
1130
|
-
# @return [Google::Apis::VisionV1::TextProperty]
|
1131
|
-
attr_accessor :property
|
1161
|
+
# Overall relevancy score for the web page.
|
1162
|
+
# Not normalized and not comparable across different image queries.
|
1163
|
+
# Corresponds to the JSON property `score`
|
1164
|
+
# @return [Float]
|
1165
|
+
attr_accessor :score
|
1132
1166
|
|
1133
|
-
#
|
1134
|
-
# Corresponds to the JSON property `
|
1135
|
-
# @return [
|
1136
|
-
attr_accessor :
|
1167
|
+
# The result web page URL.
|
1168
|
+
# Corresponds to the JSON property `url`
|
1169
|
+
# @return [String]
|
1170
|
+
attr_accessor :url
|
1137
1171
|
|
1138
1172
|
def initialize(**args)
|
1139
1173
|
update!(**args)
|
@@ -1141,32 +1175,129 @@ module Google
|
|
1141
1175
|
|
1142
1176
|
# Update properties of this object
|
1143
1177
|
def update!(**args)
|
1144
|
-
@
|
1145
|
-
@
|
1146
|
-
@property = args[:property] if args.key?(:property)
|
1147
|
-
@height = args[:height] if args.key?(:height)
|
1178
|
+
@score = args[:score] if args.key?(:score)
|
1179
|
+
@url = args[:url] if args.key?(:url)
|
1148
1180
|
end
|
1149
1181
|
end
|
1150
1182
|
|
1151
|
-
#
|
1152
|
-
# image
|
1153
|
-
class
|
1183
|
+
# Color information consists of RGB channels, score, and the fraction of
|
1184
|
+
# the image that the color occupies in the image.
|
1185
|
+
class ColorInfo
|
1154
1186
|
include Google::Apis::Core::Hashable
|
1155
1187
|
|
1156
|
-
#
|
1157
|
-
# Corresponds to the JSON property `
|
1158
|
-
# @return [
|
1159
|
-
attr_accessor :
|
1188
|
+
# Image-specific score for this color. Value in range [0, 1].
|
1189
|
+
# Corresponds to the JSON property `score`
|
1190
|
+
# @return [Float]
|
1191
|
+
attr_accessor :score
|
1160
1192
|
|
1161
|
-
#
|
1162
|
-
#
|
1163
|
-
#
|
1164
|
-
|
1193
|
+
# The fraction of pixels the color occupies in the image.
|
1194
|
+
# Value in range [0, 1].
|
1195
|
+
# Corresponds to the JSON property `pixelFraction`
|
1196
|
+
# @return [Float]
|
1197
|
+
attr_accessor :pixel_fraction
|
1165
1198
|
|
1166
|
-
#
|
1167
|
-
#
|
1168
|
-
#
|
1169
|
-
|
1199
|
+
# Represents a color in the RGBA color space. This representation is designed
|
1200
|
+
# for simplicity of conversion to/from color representations in various
|
1201
|
+
# languages over compactness; for example, the fields of this representation
|
1202
|
+
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
1203
|
+
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
1204
|
+
# method in iOS; and, with just a little work, it can be easily formatted into
|
1205
|
+
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
1206
|
+
# Example (Java):
|
1207
|
+
# import com.google.type.Color;
|
1208
|
+
# // ...
|
1209
|
+
# public static java.awt.Color fromProto(Color protocolor) `
|
1210
|
+
# float alpha = protocolor.hasAlpha()
|
1211
|
+
# ? protocolor.getAlpha().getValue()
|
1212
|
+
# : 1.0;
|
1213
|
+
# return new java.awt.Color(
|
1214
|
+
# protocolor.getRed(),
|
1215
|
+
# protocolor.getGreen(),
|
1216
|
+
# protocolor.getBlue(),
|
1217
|
+
# alpha);
|
1218
|
+
# `
|
1219
|
+
# public static Color toProto(java.awt.Color color) `
|
1220
|
+
# float red = (float) color.getRed();
|
1221
|
+
# float green = (float) color.getGreen();
|
1222
|
+
# float blue = (float) color.getBlue();
|
1223
|
+
# float denominator = 255.0;
|
1224
|
+
# Color.Builder resultBuilder =
|
1225
|
+
# Color
|
1226
|
+
# .newBuilder()
|
1227
|
+
# .setRed(red / denominator)
|
1228
|
+
# .setGreen(green / denominator)
|
1229
|
+
# .setBlue(blue / denominator);
|
1230
|
+
# int alpha = color.getAlpha();
|
1231
|
+
# if (alpha != 255) `
|
1232
|
+
# result.setAlpha(
|
1233
|
+
# FloatValue
|
1234
|
+
# .newBuilder()
|
1235
|
+
# .setValue(((float) alpha) / denominator)
|
1236
|
+
# .build());
|
1237
|
+
# `
|
1238
|
+
# return resultBuilder.build();
|
1239
|
+
# `
|
1240
|
+
# // ...
|
1241
|
+
# Example (iOS / Obj-C):
|
1242
|
+
# // ...
|
1243
|
+
# static UIColor* fromProto(Color* protocolor) `
|
1244
|
+
# float red = [protocolor red];
|
1245
|
+
# float green = [protocolor green];
|
1246
|
+
# float blue = [protocolor blue];
|
1247
|
+
# FloatValue* alpha_wrapper = [protocolor alpha];
|
1248
|
+
# float alpha = 1.0;
|
1249
|
+
# if (alpha_wrapper != nil) `
|
1250
|
+
# alpha = [alpha_wrapper value];
|
1251
|
+
# `
|
1252
|
+
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
1253
|
+
# `
|
1254
|
+
# static Color* toProto(UIColor* color) `
|
1255
|
+
# CGFloat red, green, blue, alpha;
|
1256
|
+
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
1257
|
+
# return nil;
|
1258
|
+
# `
|
1259
|
+
# Color* result = [Color alloc] init];
|
1260
|
+
# [result setRed:red];
|
1261
|
+
# [result setGreen:green];
|
1262
|
+
# [result setBlue:blue];
|
1263
|
+
# if (alpha <= 0.9999) `
|
1264
|
+
# [result setAlpha:floatWrapperWithValue(alpha)];
|
1265
|
+
# `
|
1266
|
+
# [result autorelease];
|
1267
|
+
# return result;
|
1268
|
+
# `
|
1269
|
+
# // ...
|
1270
|
+
# Example (JavaScript):
|
1271
|
+
# // ...
|
1272
|
+
# var protoToCssColor = function(rgb_color) `
|
1273
|
+
# var redFrac = rgb_color.red || 0.0;
|
1274
|
+
# var greenFrac = rgb_color.green || 0.0;
|
1275
|
+
# var blueFrac = rgb_color.blue || 0.0;
|
1276
|
+
# var red = Math.floor(redFrac * 255);
|
1277
|
+
# var green = Math.floor(greenFrac * 255);
|
1278
|
+
# var blue = Math.floor(blueFrac * 255);
|
1279
|
+
# if (!('alpha' in rgb_color)) `
|
1280
|
+
# return rgbToCssColor_(red, green, blue);
|
1281
|
+
# `
|
1282
|
+
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
1283
|
+
# var rgbParams = [red, green, blue].join(',');
|
1284
|
+
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
1285
|
+
# `;
|
1286
|
+
# var rgbToCssColor_ = function(red, green, blue) `
|
1287
|
+
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
1288
|
+
# var hexString = rgbNumber.toString(16);
|
1289
|
+
# var missingZeros = 6 - hexString.length;
|
1290
|
+
# var resultBuilder = ['#'];
|
1291
|
+
# for (var i = 0; i < missingZeros; i++) `
|
1292
|
+
# resultBuilder.push('0');
|
1293
|
+
# `
|
1294
|
+
# resultBuilder.push(hexString);
|
1295
|
+
# return resultBuilder.join('');
|
1296
|
+
# `;
|
1297
|
+
# // ...
|
1298
|
+
# Corresponds to the JSON property `color`
|
1299
|
+
# @return [Google::Apis::VisionV1::Color]
|
1300
|
+
attr_accessor :color
|
1170
1301
|
|
1171
1302
|
def initialize(**args)
|
1172
1303
|
update!(**args)
|
@@ -1174,102 +1305,75 @@ module Google
|
|
1174
1305
|
|
1175
1306
|
# Update properties of this object
|
1176
1307
|
def update!(**args)
|
1177
|
-
@
|
1178
|
-
@
|
1179
|
-
@
|
1308
|
+
@score = args[:score] if args.key?(:score)
|
1309
|
+
@pixel_fraction = args[:pixel_fraction] if args.key?(:pixel_fraction)
|
1310
|
+
@color = args[:color] if args.key?(:color)
|
1180
1311
|
end
|
1181
1312
|
end
|
1182
1313
|
|
1183
|
-
#
|
1184
|
-
|
1185
|
-
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
1186
|
-
# - Simple to use and understand for most users
|
1187
|
-
# - Flexible enough to meet unexpected needs
|
1188
|
-
# # Overview
|
1189
|
-
# The `Status` message contains three pieces of data: error code, error message,
|
1190
|
-
# and error details. The error code should be an enum value of
|
1191
|
-
# google.rpc.Code, but it may accept additional error codes if needed. The
|
1192
|
-
# error message should be a developer-facing English message that helps
|
1193
|
-
# developers *understand* and *resolve* the error. If a localized user-facing
|
1194
|
-
# error message is needed, put the localized message in the error details or
|
1195
|
-
# localize it in the client. The optional error details may contain arbitrary
|
1196
|
-
# information about the error. There is a predefined set of error detail types
|
1197
|
-
# in the package `google.rpc` which can be used for common error conditions.
|
1198
|
-
# # Language mapping
|
1199
|
-
# The `Status` message is the logical representation of the error model, but it
|
1200
|
-
# is not necessarily the actual wire format. When the `Status` message is
|
1201
|
-
# exposed in different client libraries and different wire protocols, it can be
|
1202
|
-
# mapped differently. For example, it will likely be mapped to some exceptions
|
1203
|
-
# in Java, but more likely mapped to some error codes in C.
|
1204
|
-
# # Other uses
|
1205
|
-
# The error model and the `Status` message can be used in a variety of
|
1206
|
-
# environments, either with or without APIs, to provide a
|
1207
|
-
# consistent developer experience across different environments.
|
1208
|
-
# Example uses of this error model include:
|
1209
|
-
# - Partial errors. If a service needs to return partial errors to the client,
|
1210
|
-
# it may embed the `Status` in the normal response to indicate the partial
|
1211
|
-
# errors.
|
1212
|
-
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
1213
|
-
# have a `Status` message for error reporting purpose.
|
1214
|
-
# - Batch operations. If a client uses batch request and batch response, the
|
1215
|
-
# `Status` message should be used directly inside batch response, one for
|
1216
|
-
# each error sub-response.
|
1217
|
-
# - Asynchronous operations. If an API call embeds asynchronous operation
|
1218
|
-
# results in its response, the status of those operations should be
|
1219
|
-
# represented directly using the `Status` message.
|
1220
|
-
# - Logging. If some API errors are stored in logs, the message `Status` could
|
1221
|
-
# be used directly after any stripping needed for security/privacy reasons.
|
1222
|
-
class Status
|
1314
|
+
# Set of detected entity features.
|
1315
|
+
class EntityAnnotation
|
1223
1316
|
include Google::Apis::Core::Hashable
|
1224
1317
|
|
1225
|
-
#
|
1226
|
-
#
|
1227
|
-
#
|
1228
|
-
# Corresponds to the JSON property `
|
1318
|
+
# Opaque entity ID. Some IDs may be available in
|
1319
|
+
# [Google Knowledge Graph Search API](https://developers.google.com/knowledge-
|
1320
|
+
# graph/).
|
1321
|
+
# Corresponds to the JSON property `mid`
|
1229
1322
|
# @return [String]
|
1230
|
-
attr_accessor :
|
1323
|
+
attr_accessor :mid
|
1231
1324
|
|
1232
|
-
#
|
1233
|
-
#
|
1234
|
-
#
|
1235
|
-
#
|
1236
|
-
|
1325
|
+
# The accuracy of the entity detection in an image.
|
1326
|
+
# For example, for an image in which the "Eiffel Tower" entity is detected,
|
1327
|
+
# this field represents the confidence that there is a tower in the query
|
1328
|
+
# image. Range [0, 1].
|
1329
|
+
# Corresponds to the JSON property `confidence`
|
1330
|
+
# @return [Float]
|
1331
|
+
attr_accessor :confidence
|
1237
1332
|
|
1238
|
-
# The
|
1239
|
-
#
|
1240
|
-
#
|
1241
|
-
|
1333
|
+
# The language code for the locale in which the entity textual
|
1334
|
+
# `description` is expressed.
|
1335
|
+
# Corresponds to the JSON property `locale`
|
1336
|
+
# @return [String]
|
1337
|
+
attr_accessor :locale
|
1242
1338
|
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1339
|
+
# A bounding polygon for the detected image annotation.
|
1340
|
+
# Corresponds to the JSON property `boundingPoly`
|
1341
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1342
|
+
attr_accessor :bounding_poly
|
1246
1343
|
|
1247
|
-
#
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
@code = args[:code] if args.key?(:code)
|
1252
|
-
end
|
1253
|
-
end
|
1344
|
+
# Entity textual description, expressed in its `locale` language.
|
1345
|
+
# Corresponds to the JSON property `description`
|
1346
|
+
# @return [String]
|
1347
|
+
attr_accessor :description
|
1254
1348
|
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1349
|
+
# The relevancy of the ICA (Image Content Annotation) label to the
|
1350
|
+
# image. For example, the relevancy of "tower" is likely higher to an image
|
1351
|
+
# containing the detected "Eiffel Tower" than to an image containing a
|
1352
|
+
# detected distant towering building, even though the confidence that
|
1353
|
+
# there is a tower in each image may be the same. Range [0, 1].
|
1354
|
+
# Corresponds to the JSON property `topicality`
|
1355
|
+
# @return [Float]
|
1356
|
+
attr_accessor :topicality
|
1258
1357
|
|
1259
|
-
#
|
1260
|
-
#
|
1261
|
-
#
|
1262
|
-
|
1358
|
+
# Some entities may have optional user-supplied `Property` (name/value)
|
1359
|
+
# fields, such a score or string that qualifies the entity.
|
1360
|
+
# Corresponds to the JSON property `properties`
|
1361
|
+
# @return [Array<Google::Apis::VisionV1::Property>]
|
1362
|
+
attr_accessor :properties
|
1263
1363
|
|
1264
|
-
#
|
1265
|
-
# Corresponds to the JSON property `
|
1266
|
-
# @return [
|
1267
|
-
attr_accessor :
|
1364
|
+
# Overall score of the result. Range [0, 1].
|
1365
|
+
# Corresponds to the JSON property `score`
|
1366
|
+
# @return [Float]
|
1367
|
+
attr_accessor :score
|
1268
1368
|
|
1269
|
-
# The
|
1270
|
-
#
|
1271
|
-
#
|
1272
|
-
|
1369
|
+
# The location information for the detected entity. Multiple
|
1370
|
+
# `LocationInfo` elements can be present because one location may
|
1371
|
+
# indicate the location of the scene in the image, and another location
|
1372
|
+
# may indicate the location of the place where the image was taken.
|
1373
|
+
# Location information is usually present for landmarks.
|
1374
|
+
# Corresponds to the JSON property `locations`
|
1375
|
+
# @return [Array<Google::Apis::VisionV1::LocationInfo>]
|
1376
|
+
attr_accessor :locations
|
1273
1377
|
|
1274
1378
|
def initialize(**args)
|
1275
1379
|
update!(**args)
|
@@ -1277,97 +1381,37 @@ module Google
|
|
1277
1381
|
|
1278
1382
|
# Update properties of this object
|
1279
1383
|
def update!(**args)
|
1280
|
-
@
|
1281
|
-
@
|
1282
|
-
@
|
1384
|
+
@mid = args[:mid] if args.key?(:mid)
|
1385
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
1386
|
+
@locale = args[:locale] if args.key?(:locale)
|
1387
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1388
|
+
@description = args[:description] if args.key?(:description)
|
1389
|
+
@topicality = args[:topicality] if args.key?(:topicality)
|
1390
|
+
@properties = args[:properties] if args.key?(:properties)
|
1391
|
+
@score = args[:score] if args.key?(:score)
|
1392
|
+
@locations = args[:locations] if args.key?(:locations)
|
1283
1393
|
end
|
1284
1394
|
end
|
1285
1395
|
|
1286
|
-
#
|
1287
|
-
class
|
1396
|
+
# Single crop hint that is used to generate a new crop when serving an image.
|
1397
|
+
class CropHint
|
1288
1398
|
include Google::Apis::Core::Hashable
|
1289
1399
|
|
1290
|
-
#
|
1291
|
-
#
|
1292
|
-
#
|
1293
|
-
|
1294
|
-
# standard</a>. Values must be within normalized ranges.
|
1295
|
-
# Example of normalization code in Python:
|
1296
|
-
# def NormalizeLongitude(longitude):
|
1297
|
-
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1298
|
-
# q, r = divmod(longitude, 360.0)
|
1299
|
-
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1300
|
-
# return r - 360.0
|
1301
|
-
# return r
|
1302
|
-
# def NormalizeLatLng(latitude, longitude):
|
1303
|
-
# """Wraps decimal degrees latitude and longitude to
|
1304
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1305
|
-
# r = latitude % 360.0
|
1306
|
-
# if r <= 90.0:
|
1307
|
-
# return r, NormalizeLongitude(longitude)
|
1308
|
-
# elif r >= 270.0:
|
1309
|
-
# return r - 360, NormalizeLongitude(longitude)
|
1310
|
-
# else:
|
1311
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1312
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
1313
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
1314
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
1315
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1316
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1317
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1318
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1319
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1320
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1321
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1322
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1323
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1324
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1325
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1326
|
-
# as if it were annotated as ST_LOCATION.
|
1327
|
-
# Corresponds to the JSON property `minLatLng`
|
1328
|
-
# @return [Google::Apis::VisionV1::LatLng]
|
1329
|
-
attr_accessor :min_lat_lng
|
1400
|
+
# Confidence of this being a salient region. Range [0, 1].
|
1401
|
+
# Corresponds to the JSON property `confidence`
|
1402
|
+
# @return [Float]
|
1403
|
+
attr_accessor :confidence
|
1330
1404
|
|
1331
|
-
#
|
1332
|
-
#
|
1333
|
-
#
|
1334
|
-
#
|
1335
|
-
|
1336
|
-
|
1337
|
-
#
|
1338
|
-
#
|
1339
|
-
#
|
1340
|
-
|
1341
|
-
# return r - 360.0
|
1342
|
-
# return r
|
1343
|
-
# def NormalizeLatLng(latitude, longitude):
|
1344
|
-
# """Wraps decimal degrees latitude and longitude to
|
1345
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1346
|
-
# r = latitude % 360.0
|
1347
|
-
# if r <= 90.0:
|
1348
|
-
# return r, NormalizeLongitude(longitude)
|
1349
|
-
# elif r >= 270.0:
|
1350
|
-
# return r - 360, NormalizeLongitude(longitude)
|
1351
|
-
# else:
|
1352
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1353
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
1354
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
1355
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
1356
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1357
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1358
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1359
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1360
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1361
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1362
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1363
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1364
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1365
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1366
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1367
|
-
# as if it were annotated as ST_LOCATION.
|
1368
|
-
# Corresponds to the JSON property `maxLatLng`
|
1369
|
-
# @return [Google::Apis::VisionV1::LatLng]
|
1370
|
-
attr_accessor :max_lat_lng
|
1405
|
+
# Fraction of importance of this salient region with respect to the original
|
1406
|
+
# image.
|
1407
|
+
# Corresponds to the JSON property `importanceFraction`
|
1408
|
+
# @return [Float]
|
1409
|
+
attr_accessor :importance_fraction
|
1410
|
+
|
1411
|
+
# A bounding polygon for the detected image annotation.
|
1412
|
+
# Corresponds to the JSON property `boundingPoly`
|
1413
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1414
|
+
attr_accessor :bounding_poly
|
1371
1415
|
|
1372
1416
|
def initialize(**args)
|
1373
1417
|
update!(**args)
|
@@ -1375,19 +1419,31 @@ module Google
|
|
1375
1419
|
|
1376
1420
|
# Update properties of this object
|
1377
1421
|
def update!(**args)
|
1378
|
-
@
|
1379
|
-
@
|
1422
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
1423
|
+
@importance_fraction = args[:importance_fraction] if args.key?(:importance_fraction)
|
1424
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1380
1425
|
end
|
1381
1426
|
end
|
1382
1427
|
|
1383
|
-
#
|
1384
|
-
|
1428
|
+
# A face-specific landmark (for example, a face feature).
|
1429
|
+
# Landmark positions may fall outside the bounds of the image
|
1430
|
+
# if the face is near one or more edges of the image.
|
1431
|
+
# Therefore it is NOT guaranteed that `0 <= x < width` or
|
1432
|
+
# `0 <= y < height`.
|
1433
|
+
class Landmark
|
1385
1434
|
include Google::Apis::Core::Hashable
|
1386
1435
|
|
1387
|
-
#
|
1388
|
-
#
|
1389
|
-
#
|
1390
|
-
|
1436
|
+
# A 3D position in the image, used primarily for Face detection landmarks.
|
1437
|
+
# A valid Position must have both x and y coordinates.
|
1438
|
+
# The position coordinates are in the same scale as the original image.
|
1439
|
+
# Corresponds to the JSON property `position`
|
1440
|
+
# @return [Google::Apis::VisionV1::Position]
|
1441
|
+
attr_accessor :position
|
1442
|
+
|
1443
|
+
# Face landmark type.
|
1444
|
+
# Corresponds to the JSON property `type`
|
1445
|
+
# @return [String]
|
1446
|
+
attr_accessor :type
|
1391
1447
|
|
1392
1448
|
def initialize(**args)
|
1393
1449
|
update!(**args)
|
@@ -1395,59 +1451,25 @@ module Google
|
|
1395
1451
|
|
1396
1452
|
# Update properties of this object
|
1397
1453
|
def update!(**args)
|
1398
|
-
@
|
1454
|
+
@position = args[:position] if args.key?(:position)
|
1455
|
+
@type = args[:type] if args.key?(:type)
|
1399
1456
|
end
|
1400
1457
|
end
|
1401
1458
|
|
1402
|
-
#
|
1403
|
-
|
1404
|
-
# specified otherwise, this must conform to the
|
1405
|
-
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1406
|
-
# standard</a>. Values must be within normalized ranges.
|
1407
|
-
# Example of normalization code in Python:
|
1408
|
-
# def NormalizeLongitude(longitude):
|
1409
|
-
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1410
|
-
# q, r = divmod(longitude, 360.0)
|
1411
|
-
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1412
|
-
# return r - 360.0
|
1413
|
-
# return r
|
1414
|
-
# def NormalizeLatLng(latitude, longitude):
|
1415
|
-
# """Wraps decimal degrees latitude and longitude to
|
1416
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1417
|
-
# r = latitude % 360.0
|
1418
|
-
# if r <= 90.0:
|
1419
|
-
# return r, NormalizeLongitude(longitude)
|
1420
|
-
# elif r >= 270.0:
|
1421
|
-
# return r - 360, NormalizeLongitude(longitude)
|
1422
|
-
# else:
|
1423
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1424
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
1425
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
1426
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
1427
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1428
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1429
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1430
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1431
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1432
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1433
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1434
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1435
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1436
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1437
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1438
|
-
# as if it were annotated as ST_LOCATION.
|
1439
|
-
class LatLng
|
1459
|
+
# Metadata for online images.
|
1460
|
+
class WebImage
|
1440
1461
|
include Google::Apis::Core::Hashable
|
1441
1462
|
|
1442
|
-
#
|
1443
|
-
#
|
1463
|
+
# Overall relevancy score for the image.
|
1464
|
+
# Not normalized and not comparable across different image queries.
|
1465
|
+
# Corresponds to the JSON property `score`
|
1444
1466
|
# @return [Float]
|
1445
|
-
attr_accessor :
|
1467
|
+
attr_accessor :score
|
1446
1468
|
|
1447
|
-
# The
|
1448
|
-
# Corresponds to the JSON property `
|
1449
|
-
# @return [
|
1450
|
-
attr_accessor :
|
1469
|
+
# The result image URL.
|
1470
|
+
# Corresponds to the JSON property `url`
|
1471
|
+
# @return [String]
|
1472
|
+
attr_accessor :url
|
1451
1473
|
|
1452
1474
|
def initialize(**args)
|
1453
1475
|
update!(**args)
|
@@ -1455,140 +1477,30 @@ module Google
|
|
1455
1477
|
|
1456
1478
|
# Update properties of this object
|
1457
1479
|
def update!(**args)
|
1458
|
-
@
|
1459
|
-
@
|
1480
|
+
@score = args[:score] if args.key?(:score)
|
1481
|
+
@url = args[:url] if args.key?(:url)
|
1460
1482
|
end
|
1461
1483
|
end
|
1462
1484
|
|
1463
|
-
#
|
1464
|
-
|
1465
|
-
# languages over compactness; for example, the fields of this representation
|
1466
|
-
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
1467
|
-
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
1468
|
-
# method in iOS; and, with just a little work, it can be easily formatted into
|
1469
|
-
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
1470
|
-
# Example (Java):
|
1471
|
-
# import com.google.type.Color;
|
1472
|
-
# // ...
|
1473
|
-
# public static java.awt.Color fromProto(Color protocolor) `
|
1474
|
-
# float alpha = protocolor.hasAlpha()
|
1475
|
-
# ? protocolor.getAlpha().getValue()
|
1476
|
-
# : 1.0;
|
1477
|
-
# return new java.awt.Color(
|
1478
|
-
# protocolor.getRed(),
|
1479
|
-
# protocolor.getGreen(),
|
1480
|
-
# protocolor.getBlue(),
|
1481
|
-
# alpha);
|
1482
|
-
# `
|
1483
|
-
# public static Color toProto(java.awt.Color color) `
|
1484
|
-
# float red = (float) color.getRed();
|
1485
|
-
# float green = (float) color.getGreen();
|
1486
|
-
# float blue = (float) color.getBlue();
|
1487
|
-
# float denominator = 255.0;
|
1488
|
-
# Color.Builder resultBuilder =
|
1489
|
-
# Color
|
1490
|
-
# .newBuilder()
|
1491
|
-
# .setRed(red / denominator)
|
1492
|
-
# .setGreen(green / denominator)
|
1493
|
-
# .setBlue(blue / denominator);
|
1494
|
-
# int alpha = color.getAlpha();
|
1495
|
-
# if (alpha != 255) `
|
1496
|
-
# result.setAlpha(
|
1497
|
-
# FloatValue
|
1498
|
-
# .newBuilder()
|
1499
|
-
# .setValue(((float) alpha) / denominator)
|
1500
|
-
# .build());
|
1501
|
-
# `
|
1502
|
-
# return resultBuilder.build();
|
1503
|
-
# `
|
1504
|
-
# // ...
|
1505
|
-
# Example (iOS / Obj-C):
|
1506
|
-
# // ...
|
1507
|
-
# static UIColor* fromProto(Color* protocolor) `
|
1508
|
-
# float red = [protocolor red];
|
1509
|
-
# float green = [protocolor green];
|
1510
|
-
# float blue = [protocolor blue];
|
1511
|
-
# FloatValue* alpha_wrapper = [protocolor alpha];
|
1512
|
-
# float alpha = 1.0;
|
1513
|
-
# if (alpha_wrapper != nil) `
|
1514
|
-
# alpha = [alpha_wrapper value];
|
1515
|
-
# `
|
1516
|
-
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
1517
|
-
# `
|
1518
|
-
# static Color* toProto(UIColor* color) `
|
1519
|
-
# CGFloat red, green, blue, alpha;
|
1520
|
-
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
1521
|
-
# return nil;
|
1522
|
-
# `
|
1523
|
-
# Color* result = [Color alloc] init];
|
1524
|
-
# [result setRed:red];
|
1525
|
-
# [result setGreen:green];
|
1526
|
-
# [result setBlue:blue];
|
1527
|
-
# if (alpha <= 0.9999) `
|
1528
|
-
# [result setAlpha:floatWrapperWithValue(alpha)];
|
1529
|
-
# `
|
1530
|
-
# [result autorelease];
|
1531
|
-
# return result;
|
1532
|
-
# `
|
1533
|
-
# // ...
|
1534
|
-
# Example (JavaScript):
|
1535
|
-
# // ...
|
1536
|
-
# var protoToCssColor = function(rgb_color) `
|
1537
|
-
# var redFrac = rgb_color.red || 0.0;
|
1538
|
-
# var greenFrac = rgb_color.green || 0.0;
|
1539
|
-
# var blueFrac = rgb_color.blue || 0.0;
|
1540
|
-
# var red = Math.floor(redFrac * 255);
|
1541
|
-
# var green = Math.floor(greenFrac * 255);
|
1542
|
-
# var blue = Math.floor(blueFrac * 255);
|
1543
|
-
# if (!('alpha' in rgb_color)) `
|
1544
|
-
# return rgbToCssColor_(red, green, blue);
|
1545
|
-
# `
|
1546
|
-
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
1547
|
-
# var rgbParams = [red, green, blue].join(',');
|
1548
|
-
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
1549
|
-
# `;
|
1550
|
-
# var rgbToCssColor_ = function(red, green, blue) `
|
1551
|
-
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
1552
|
-
# var hexString = rgbNumber.toString(16);
|
1553
|
-
# var missingZeros = 6 - hexString.length;
|
1554
|
-
# var resultBuilder = ['#'];
|
1555
|
-
# for (var i = 0; i < missingZeros; i++) `
|
1556
|
-
# resultBuilder.push('0');
|
1557
|
-
# `
|
1558
|
-
# resultBuilder.push(hexString);
|
1559
|
-
# return resultBuilder.join('');
|
1560
|
-
# `;
|
1561
|
-
# // ...
|
1562
|
-
class Color
|
1485
|
+
# A word representation.
|
1486
|
+
class Word
|
1563
1487
|
include Google::Apis::Core::Hashable
|
1564
1488
|
|
1565
|
-
#
|
1566
|
-
# Corresponds to the JSON property `
|
1567
|
-
# @return [
|
1568
|
-
attr_accessor :
|
1569
|
-
|
1570
|
-
# The amount of green in the color as a value in the interval [0, 1].
|
1571
|
-
# Corresponds to the JSON property `green`
|
1572
|
-
# @return [Float]
|
1573
|
-
attr_accessor :green
|
1489
|
+
# A bounding polygon for the detected image annotation.
|
1490
|
+
# Corresponds to the JSON property `boundingBox`
|
1491
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1492
|
+
attr_accessor :bounding_box
|
1574
1493
|
|
1575
|
-
#
|
1576
|
-
#
|
1577
|
-
#
|
1578
|
-
|
1494
|
+
# List of symbols in the word.
|
1495
|
+
# The order of the symbols follows the natural reading order.
|
1496
|
+
# Corresponds to the JSON property `symbols`
|
1497
|
+
# @return [Array<Google::Apis::VisionV1::Symbol>]
|
1498
|
+
attr_accessor :symbols
|
1579
1499
|
|
1580
|
-
#
|
1581
|
-
#
|
1582
|
-
#
|
1583
|
-
|
1584
|
-
# a value of 0.0 corresponds to a completely transparent color. This
|
1585
|
-
# uses a wrapper message rather than a simple float scalar so that it is
|
1586
|
-
# possible to distinguish between a default value and the value being unset.
|
1587
|
-
# If omitted, this color object is to be rendered as a solid color
|
1588
|
-
# (as if the alpha value had been explicitly given with a value of 1.0).
|
1589
|
-
# Corresponds to the JSON property `alpha`
|
1590
|
-
# @return [Float]
|
1591
|
-
attr_accessor :alpha
|
1500
|
+
# Additional information detected on the structural component.
|
1501
|
+
# Corresponds to the JSON property `property`
|
1502
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1503
|
+
attr_accessor :property
|
1592
1504
|
|
1593
1505
|
def initialize(**args)
|
1594
1506
|
update!(**args)
|
@@ -1596,29 +1508,30 @@ module Google
|
|
1596
1508
|
|
1597
1509
|
# Update properties of this object
|
1598
1510
|
def update!(**args)
|
1599
|
-
@
|
1600
|
-
@
|
1601
|
-
@
|
1602
|
-
@alpha = args[:alpha] if args.key?(:alpha)
|
1511
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
1512
|
+
@symbols = args[:symbols] if args.key?(:symbols)
|
1513
|
+
@property = args[:property] if args.key?(:property)
|
1603
1514
|
end
|
1604
1515
|
end
|
1605
1516
|
|
1606
|
-
#
|
1607
|
-
|
1608
|
-
# detection task to perform. Features encode the Cloud Vision API
|
1609
|
-
# vertical to operate on and the number of top-scoring results to return.
|
1610
|
-
class Feature
|
1517
|
+
# Structural unit of text representing a number of words in certain order.
|
1518
|
+
class Paragraph
|
1611
1519
|
include Google::Apis::Core::Hashable
|
1612
1520
|
|
1613
|
-
#
|
1614
|
-
# Corresponds to the JSON property `
|
1615
|
-
# @return [
|
1616
|
-
attr_accessor :
|
1521
|
+
# Additional information detected on the structural component.
|
1522
|
+
# Corresponds to the JSON property `property`
|
1523
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1524
|
+
attr_accessor :property
|
1617
1525
|
|
1618
|
-
#
|
1619
|
-
# Corresponds to the JSON property `
|
1620
|
-
# @return [
|
1621
|
-
attr_accessor :
|
1526
|
+
# A bounding polygon for the detected image annotation.
|
1527
|
+
# Corresponds to the JSON property `boundingBox`
|
1528
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1529
|
+
attr_accessor :bounding_box
|
1530
|
+
|
1531
|
+
# List of words in this paragraph.
|
1532
|
+
# Corresponds to the JSON property `words`
|
1533
|
+
# @return [Array<Google::Apis::VisionV1::Word>]
|
1534
|
+
attr_accessor :words
|
1622
1535
|
|
1623
1536
|
def initialize(**args)
|
1624
1537
|
update!(**args)
|
@@ -1626,19 +1539,27 @@ module Google
|
|
1626
1539
|
|
1627
1540
|
# Update properties of this object
|
1628
1541
|
def update!(**args)
|
1629
|
-
@
|
1630
|
-
@
|
1542
|
+
@property = args[:property] if args.key?(:property)
|
1543
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
1544
|
+
@words = args[:words] if args.key?(:words)
|
1631
1545
|
end
|
1632
1546
|
end
|
1633
1547
|
|
1634
|
-
#
|
1635
|
-
class
|
1548
|
+
# Client image to perform Google Cloud Vision API tasks over.
|
1549
|
+
class Image
|
1636
1550
|
include Google::Apis::Core::Hashable
|
1637
1551
|
|
1638
|
-
#
|
1639
|
-
#
|
1640
|
-
#
|
1641
|
-
|
1552
|
+
# Image content, represented as a stream of bytes.
|
1553
|
+
# Note: as with all `bytes` fields, protobuffers use a pure binary
|
1554
|
+
# representation, whereas JSON representations use base64.
|
1555
|
+
# Corresponds to the JSON property `content`
|
1556
|
+
# @return [String]
|
1557
|
+
attr_accessor :content
|
1558
|
+
|
1559
|
+
# External image source (Google Cloud Storage image location).
|
1560
|
+
# Corresponds to the JSON property `source`
|
1561
|
+
# @return [Google::Apis::VisionV1::ImageSource]
|
1562
|
+
attr_accessor :source
|
1642
1563
|
|
1643
1564
|
def initialize(**args)
|
1644
1565
|
update!(**args)
|
@@ -1646,37 +1567,94 @@ module Google
|
|
1646
1567
|
|
1647
1568
|
# Update properties of this object
|
1648
1569
|
def update!(**args)
|
1649
|
-
@
|
1570
|
+
@content = args[:content] if args.key?(:content)
|
1571
|
+
@source = args[:source] if args.key?(:source)
|
1650
1572
|
end
|
1651
1573
|
end
|
1652
1574
|
|
1653
|
-
#
|
1654
|
-
|
1655
|
-
# violence).
|
1656
|
-
class SafeSearchAnnotation
|
1575
|
+
# A face annotation object contains the results of face detection.
|
1576
|
+
class FaceAnnotation
|
1657
1577
|
include Google::Apis::Core::Hashable
|
1658
1578
|
|
1659
|
-
#
|
1660
|
-
#
|
1661
|
-
#
|
1662
|
-
#
|
1579
|
+
# Pitch angle, which indicates the upwards/downwards angle that the face is
|
1580
|
+
# pointing relative to the image's horizontal plane. Range [-180,180].
|
1581
|
+
# Corresponds to the JSON property `tiltAngle`
|
1582
|
+
# @return [Float]
|
1583
|
+
attr_accessor :tilt_angle
|
1584
|
+
|
1585
|
+
# A bounding polygon for the detected image annotation.
|
1586
|
+
# Corresponds to the JSON property `fdBoundingPoly`
|
1587
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1588
|
+
attr_accessor :fd_bounding_poly
|
1589
|
+
|
1590
|
+
# Anger likelihood.
|
1591
|
+
# Corresponds to the JSON property `angerLikelihood`
|
1663
1592
|
# @return [String]
|
1664
|
-
attr_accessor :
|
1593
|
+
attr_accessor :anger_likelihood
|
1665
1594
|
|
1666
|
-
#
|
1667
|
-
# Corresponds to the JSON property `
|
1595
|
+
# Detected face landmarks.
|
1596
|
+
# Corresponds to the JSON property `landmarks`
|
1597
|
+
# @return [Array<Google::Apis::VisionV1::Landmark>]
|
1598
|
+
attr_accessor :landmarks
|
1599
|
+
|
1600
|
+
# Surprise likelihood.
|
1601
|
+
# Corresponds to the JSON property `surpriseLikelihood`
|
1668
1602
|
# @return [String]
|
1669
|
-
attr_accessor :
|
1603
|
+
attr_accessor :surprise_likelihood
|
1670
1604
|
|
1671
|
-
#
|
1672
|
-
# Corresponds to the JSON property `
|
1605
|
+
# Face landmarking confidence. Range [0, 1].
|
1606
|
+
# Corresponds to the JSON property `landmarkingConfidence`
|
1607
|
+
# @return [Float]
|
1608
|
+
attr_accessor :landmarking_confidence
|
1609
|
+
|
1610
|
+
# Joy likelihood.
|
1611
|
+
# Corresponds to the JSON property `joyLikelihood`
|
1673
1612
|
# @return [String]
|
1674
|
-
attr_accessor :
|
1613
|
+
attr_accessor :joy_likelihood
|
1675
1614
|
|
1676
|
-
#
|
1677
|
-
# Corresponds to the JSON property `
|
1615
|
+
# Detection confidence. Range [0, 1].
|
1616
|
+
# Corresponds to the JSON property `detectionConfidence`
|
1617
|
+
# @return [Float]
|
1618
|
+
attr_accessor :detection_confidence
|
1619
|
+
|
1620
|
+
# Yaw angle, which indicates the leftward/rightward angle that the face is
|
1621
|
+
# pointing relative to the vertical plane perpendicular to the image. Range
|
1622
|
+
# [-180,180].
|
1623
|
+
# Corresponds to the JSON property `panAngle`
|
1624
|
+
# @return [Float]
|
1625
|
+
attr_accessor :pan_angle
|
1626
|
+
|
1627
|
+
# Under-exposed likelihood.
|
1628
|
+
# Corresponds to the JSON property `underExposedLikelihood`
|
1678
1629
|
# @return [String]
|
1679
|
-
attr_accessor :
|
1630
|
+
attr_accessor :under_exposed_likelihood
|
1631
|
+
|
1632
|
+
# Blurred likelihood.
|
1633
|
+
# Corresponds to the JSON property `blurredLikelihood`
|
1634
|
+
# @return [String]
|
1635
|
+
attr_accessor :blurred_likelihood
|
1636
|
+
|
1637
|
+
# Headwear likelihood.
|
1638
|
+
# Corresponds to the JSON property `headwearLikelihood`
|
1639
|
+
# @return [String]
|
1640
|
+
attr_accessor :headwear_likelihood
|
1641
|
+
|
1642
|
+
# A bounding polygon for the detected image annotation.
|
1643
|
+
# Corresponds to the JSON property `boundingPoly`
|
1644
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1645
|
+
attr_accessor :bounding_poly
|
1646
|
+
|
1647
|
+
# Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
|
1648
|
+
# of the face relative to the image vertical about the axis perpendicular to
|
1649
|
+
# the face. Range [-180,180].
|
1650
|
+
# Corresponds to the JSON property `rollAngle`
|
1651
|
+
# @return [Float]
|
1652
|
+
attr_accessor :roll_angle
|
1653
|
+
|
1654
|
+
# Sorrow likelihood.
|
1655
|
+
# Corresponds to the JSON property `sorrowLikelihood`
|
1656
|
+
# @return [String]
|
1657
|
+
attr_accessor :sorrow_likelihood
|
1680
1658
|
|
1681
1659
|
def initialize(**args)
|
1682
1660
|
update!(**args)
|
@@ -1684,21 +1662,32 @@ module Google
|
|
1684
1662
|
|
1685
1663
|
# Update properties of this object
|
1686
1664
|
def update!(**args)
|
1687
|
-
@
|
1688
|
-
@
|
1689
|
-
@
|
1690
|
-
@
|
1665
|
+
@tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
|
1666
|
+
@fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
|
1667
|
+
@anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
|
1668
|
+
@landmarks = args[:landmarks] if args.key?(:landmarks)
|
1669
|
+
@surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
|
1670
|
+
@landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
|
1671
|
+
@joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
|
1672
|
+
@detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
|
1673
|
+
@pan_angle = args[:pan_angle] if args.key?(:pan_angle)
|
1674
|
+
@under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
|
1675
|
+
@blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
|
1676
|
+
@headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
|
1677
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1678
|
+
@roll_angle = args[:roll_angle] if args.key?(:roll_angle)
|
1679
|
+
@sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
|
1691
1680
|
end
|
1692
1681
|
end
|
1693
1682
|
|
1694
|
-
#
|
1695
|
-
class
|
1683
|
+
# Multiple image annotation requests are batched into a single service call.
|
1684
|
+
class BatchAnnotateImagesRequest
|
1696
1685
|
include Google::Apis::Core::Hashable
|
1697
1686
|
|
1698
|
-
#
|
1699
|
-
# Corresponds to the JSON property `
|
1700
|
-
# @return [Array<Google::Apis::VisionV1::
|
1701
|
-
attr_accessor :
|
1687
|
+
# Individual image annotation requests for this batch.
|
1688
|
+
# Corresponds to the JSON property `requests`
|
1689
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
|
1690
|
+
attr_accessor :requests
|
1702
1691
|
|
1703
1692
|
def initialize(**args)
|
1704
1693
|
update!(**args)
|
@@ -1706,29 +1695,24 @@ module Google
|
|
1706
1695
|
|
1707
1696
|
# Update properties of this object
|
1708
1697
|
def update!(**args)
|
1709
|
-
@
|
1698
|
+
@requests = args[:requests] if args.key?(:requests)
|
1710
1699
|
end
|
1711
1700
|
end
|
1712
1701
|
|
1713
|
-
#
|
1714
|
-
|
1715
|
-
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
1716
|
-
# Each structural component, starting from Page, may further have their own
|
1717
|
-
# properties. Properties describe detected languages, breaks etc.. Please
|
1718
|
-
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
1719
|
-
# definition below for more detail.
|
1720
|
-
class TextAnnotation
|
1702
|
+
# Detected start or end of a structural component.
|
1703
|
+
class DetectedBreak
|
1721
1704
|
include Google::Apis::Core::Hashable
|
1722
1705
|
|
1723
|
-
#
|
1724
|
-
# Corresponds to the JSON property `
|
1725
|
-
# @return [Array<Google::Apis::VisionV1::Page>]
|
1726
|
-
attr_accessor :pages
|
1727
|
-
|
1728
|
-
# UTF-8 text detected on the pages.
|
1729
|
-
# Corresponds to the JSON property `text`
|
1706
|
+
# Detected break type.
|
1707
|
+
# Corresponds to the JSON property `type`
|
1730
1708
|
# @return [String]
|
1731
|
-
attr_accessor :
|
1709
|
+
attr_accessor :type
|
1710
|
+
|
1711
|
+
# True if break prepends the element.
|
1712
|
+
# Corresponds to the JSON property `isPrefix`
|
1713
|
+
# @return [Boolean]
|
1714
|
+
attr_accessor :is_prefix
|
1715
|
+
alias_method :is_prefix?, :is_prefix
|
1732
1716
|
|
1733
1717
|
def initialize(**args)
|
1734
1718
|
update!(**args)
|
@@ -1736,26 +1720,36 @@ module Google
|
|
1736
1720
|
|
1737
1721
|
# Update properties of this object
|
1738
1722
|
def update!(**args)
|
1739
|
-
@
|
1740
|
-
@
|
1723
|
+
@type = args[:type] if args.key?(:type)
|
1724
|
+
@is_prefix = args[:is_prefix] if args.key?(:is_prefix)
|
1741
1725
|
end
|
1742
1726
|
end
|
1743
1727
|
|
1744
|
-
#
|
1745
|
-
class
|
1728
|
+
# Image context and/or feature-specific parameters.
|
1729
|
+
class ImageContext
|
1746
1730
|
include Google::Apis::Core::Hashable
|
1747
1731
|
|
1748
|
-
#
|
1749
|
-
#
|
1750
|
-
#
|
1751
|
-
#
|
1752
|
-
#
|
1753
|
-
|
1732
|
+
# List of languages to use for TEXT_DETECTION. In most cases, an empty value
|
1733
|
+
# yields the best results since it enables automatic language detection. For
|
1734
|
+
# languages based on the Latin alphabet, setting `language_hints` is not
|
1735
|
+
# needed. In rare cases, when the language of the text in the image is known,
|
1736
|
+
# setting a hint will help get better results (although it will be a
|
1737
|
+
# significant hindrance if the hint is wrong). Text detection returns an
|
1738
|
+
# error if one or more of the specified languages is not one of the
|
1739
|
+
# [supported languages](/vision/docs/languages).
|
1740
|
+
# Corresponds to the JSON property `languageHints`
|
1741
|
+
# @return [Array<String>]
|
1742
|
+
attr_accessor :language_hints
|
1754
1743
|
|
1755
|
-
#
|
1756
|
-
# Corresponds to the JSON property `
|
1757
|
-
# @return [
|
1758
|
-
attr_accessor :
|
1744
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
1745
|
+
# Corresponds to the JSON property `latLongRect`
|
1746
|
+
# @return [Google::Apis::VisionV1::LatLongRect]
|
1747
|
+
attr_accessor :lat_long_rect
|
1748
|
+
|
1749
|
+
# Parameters for crop hints annotation request.
|
1750
|
+
# Corresponds to the JSON property `cropHintsParams`
|
1751
|
+
# @return [Google::Apis::VisionV1::CropHintsParams]
|
1752
|
+
attr_accessor :crop_hints_params
|
1759
1753
|
|
1760
1754
|
def initialize(**args)
|
1761
1755
|
update!(**args)
|
@@ -1763,25 +1757,35 @@ module Google
|
|
1763
1757
|
|
1764
1758
|
# Update properties of this object
|
1765
1759
|
def update!(**args)
|
1766
|
-
@
|
1767
|
-
@
|
1760
|
+
@language_hints = args[:language_hints] if args.key?(:language_hints)
|
1761
|
+
@lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
|
1762
|
+
@crop_hints_params = args[:crop_hints_params] if args.key?(:crop_hints_params)
|
1768
1763
|
end
|
1769
1764
|
end
|
1770
1765
|
|
1771
|
-
#
|
1772
|
-
|
1773
|
-
class Vertex
|
1766
|
+
# Detected page from OCR.
|
1767
|
+
class Page
|
1774
1768
|
include Google::Apis::Core::Hashable
|
1775
1769
|
|
1776
|
-
#
|
1777
|
-
# Corresponds to the JSON property `
|
1770
|
+
# Page width in pixels.
|
1771
|
+
# Corresponds to the JSON property `width`
|
1778
1772
|
# @return [Fixnum]
|
1779
|
-
attr_accessor :
|
1773
|
+
attr_accessor :width
|
1780
1774
|
|
1781
|
-
#
|
1782
|
-
# Corresponds to the JSON property `
|
1775
|
+
# List of blocks of text, images etc on this page.
|
1776
|
+
# Corresponds to the JSON property `blocks`
|
1777
|
+
# @return [Array<Google::Apis::VisionV1::Block>]
|
1778
|
+
attr_accessor :blocks
|
1779
|
+
|
1780
|
+
# Additional information detected on the structural component.
|
1781
|
+
# Corresponds to the JSON property `property`
|
1782
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1783
|
+
attr_accessor :property
|
1784
|
+
|
1785
|
+
# Page height in pixels.
|
1786
|
+
# Corresponds to the JSON property `height`
|
1783
1787
|
# @return [Fixnum]
|
1784
|
-
attr_accessor :
|
1788
|
+
attr_accessor :height
|
1785
1789
|
|
1786
1790
|
def initialize(**args)
|
1787
1791
|
update!(**args)
|
@@ -1789,8 +1793,10 @@ module Google
|
|
1789
1793
|
|
1790
1794
|
# Update properties of this object
|
1791
1795
|
def update!(**args)
|
1792
|
-
@
|
1793
|
-
@
|
1796
|
+
@width = args[:width] if args.key?(:width)
|
1797
|
+
@blocks = args[:blocks] if args.key?(:blocks)
|
1798
|
+
@property = args[:property] if args.key?(:property)
|
1799
|
+
@height = args[:height] if args.key?(:height)
|
1794
1800
|
end
|
1795
1801
|
end
|
1796
1802
|
end
|