google-api-client 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.md +6 -0
  4. data/api_names.yaml +1 -0
  5. data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +38 -38
  6. data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +13 -13
  7. data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +10 -10
  8. data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
  9. data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +201 -201
  10. data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +46 -46
  11. data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +119 -119
  12. data/generated/google/apis/adexchangebuyer_v1_4.rb +1 -1
  13. data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +52 -9
  14. data/generated/google/apis/adexchangebuyer_v1_4/representations.rb +9 -0
  15. data/generated/google/apis/adsense_v1_4.rb +1 -1
  16. data/generated/google/apis/adsensehost_v4_1.rb +1 -1
  17. data/generated/google/apis/analyticsreporting_v4/classes.rb +926 -926
  18. data/generated/google/apis/analyticsreporting_v4/representations.rb +149 -149
  19. data/generated/google/apis/androidenterprise_v1.rb +1 -1
  20. data/generated/google/apis/androidenterprise_v1/classes.rb +18 -11
  21. data/generated/google/apis/androidenterprise_v1/representations.rb +1 -0
  22. data/generated/google/apis/androidpublisher_v2.rb +1 -1
  23. data/generated/google/apis/appengine_v1.rb +1 -1
  24. data/generated/google/apis/appengine_v1/classes.rb +1487 -1487
  25. data/generated/google/apis/appengine_v1/representations.rb +229 -229
  26. data/generated/google/apis/appengine_v1/service.rb +188 -188
  27. data/generated/google/apis/appstate_v1.rb +1 -1
  28. data/generated/google/apis/bigquery_v2.rb +1 -1
  29. data/generated/google/apis/bigquery_v2/classes.rb +15 -10
  30. data/generated/google/apis/calendar_v3.rb +1 -1
  31. data/generated/google/apis/calendar_v3/service.rb +10 -4
  32. data/generated/google/apis/classroom_v1.rb +26 -17
  33. data/generated/google/apis/classroom_v1/classes.rb +990 -990
  34. data/generated/google/apis/classroom_v1/representations.rb +239 -239
  35. data/generated/google/apis/classroom_v1/service.rb +853 -853
  36. data/generated/google/apis/cloudbilling_v1.rb +1 -1
  37. data/generated/google/apis/cloudbuild_v1.rb +1 -1
  38. data/generated/google/apis/cloudbuild_v1/classes.rb +627 -627
  39. data/generated/google/apis/cloudbuild_v1/representations.rb +116 -116
  40. data/generated/google/apis/cloudbuild_v1/service.rb +162 -157
  41. data/generated/google/apis/clouddebugger_v2/classes.rb +258 -258
  42. data/generated/google/apis/clouddebugger_v2/representations.rb +80 -80
  43. data/generated/google/apis/clouddebugger_v2/service.rb +163 -163
  44. data/generated/google/apis/clouderrorreporting_v1beta1.rb +3 -4
  45. data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +202 -167
  46. data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +53 -37
  47. data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +50 -51
  48. data/generated/google/apis/cloudfunctions_v1.rb +1 -1
  49. data/generated/google/apis/cloudkms_v1.rb +1 -1
  50. data/generated/google/apis/cloudkms_v1/classes.rb +628 -622
  51. data/generated/google/apis/cloudkms_v1/representations.rb +134 -133
  52. data/generated/google/apis/cloudkms_v1/service.rb +190 -190
  53. data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
  54. data/generated/google/apis/cloudresourcemanager_v1/classes.rb +835 -835
  55. data/generated/google/apis/cloudresourcemanager_v1/representations.rb +138 -138
  56. data/generated/google/apis/cloudresourcemanager_v1/service.rb +474 -474
  57. data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
  58. data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +386 -386
  59. data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +75 -75
  60. data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +64 -64
  61. data/generated/google/apis/cloudtrace_v1.rb +4 -4
  62. data/generated/google/apis/cloudtrace_v1/classes.rb +114 -114
  63. data/generated/google/apis/cloudtrace_v1/representations.rb +23 -23
  64. data/generated/google/apis/cloudtrace_v1/service.rb +14 -14
  65. data/generated/google/apis/compute_beta.rb +1 -1
  66. data/generated/google/apis/compute_beta/classes.rb +66 -25
  67. data/generated/google/apis/compute_beta/representations.rb +16 -0
  68. data/generated/google/apis/compute_beta/service.rb +85 -3
  69. data/generated/google/apis/compute_v1.rb +1 -1
  70. data/generated/google/apis/compute_v1/classes.rb +375 -24
  71. data/generated/google/apis/compute_v1/representations.rb +155 -0
  72. data/generated/google/apis/compute_v1/service.rb +481 -3
  73. data/generated/google/apis/container_v1.rb +1 -1
  74. data/generated/google/apis/container_v1/classes.rb +301 -301
  75. data/generated/google/apis/container_v1/representations.rb +59 -59
  76. data/generated/google/apis/container_v1/service.rb +178 -178
  77. data/generated/google/apis/content_v2.rb +1 -1
  78. data/generated/google/apis/content_v2/classes.rb +37 -2
  79. data/generated/google/apis/content_v2/representations.rb +15 -0
  80. data/generated/google/apis/content_v2/service.rb +58 -3
  81. data/generated/google/apis/dataflow_v1b3.rb +4 -1
  82. data/generated/google/apis/dataflow_v1b3/classes.rb +3514 -3279
  83. data/generated/google/apis/dataflow_v1b3/representations.rb +530 -440
  84. data/generated/google/apis/dataflow_v1b3/service.rb +378 -137
  85. data/generated/google/apis/dataproc_v1.rb +1 -1
  86. data/generated/google/apis/dataproc_v1/classes.rb +446 -446
  87. data/generated/google/apis/dataproc_v1/representations.rb +96 -96
  88. data/generated/google/apis/dataproc_v1/service.rb +302 -302
  89. data/generated/google/apis/datastore_v1.rb +1 -1
  90. data/generated/google/apis/datastore_v1/classes.rb +370 -374
  91. data/generated/google/apis/datastore_v1/representations.rb +120 -120
  92. data/generated/google/apis/datastore_v1/service.rb +62 -62
  93. data/generated/google/apis/dns_v1.rb +1 -1
  94. data/generated/google/apis/dns_v2beta1.rb +1 -1
  95. data/generated/google/apis/doubleclickbidmanager_v1.rb +3 -0
  96. data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
  97. data/generated/google/apis/drive_v2.rb +1 -1
  98. data/generated/google/apis/drive_v2/classes.rb +24 -21
  99. data/generated/google/apis/drive_v3.rb +1 -1
  100. data/generated/google/apis/drive_v3/classes.rb +24 -22
  101. data/generated/google/apis/firebasedynamiclinks_v1.rb +1 -1
  102. data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +148 -149
  103. data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +42 -42
  104. data/generated/google/apis/firebaserules_v1/classes.rb +71 -71
  105. data/generated/google/apis/firebaserules_v1/representations.rb +22 -22
  106. data/generated/google/apis/firebaserules_v1/service.rb +68 -68
  107. data/generated/google/apis/games_configuration_v1configuration.rb +1 -1
  108. data/generated/google/apis/games_management_v1management.rb +1 -1
  109. data/generated/google/apis/games_v1.rb +1 -1
  110. data/generated/google/apis/genomics_v1.rb +1 -1
  111. data/generated/google/apis/genomics_v1/classes.rb +2348 -2348
  112. data/generated/google/apis/genomics_v1/representations.rb +430 -430
  113. data/generated/google/apis/genomics_v1/service.rb +1159 -1159
  114. data/generated/google/apis/gmail_v1.rb +1 -1
  115. data/generated/google/apis/gmail_v1/service.rb +2 -2
  116. data/generated/google/apis/iam_v1.rb +1 -1
  117. data/generated/google/apis/iam_v1/classes.rb +305 -298
  118. data/generated/google/apis/iam_v1/representations.rb +97 -96
  119. data/generated/google/apis/iam_v1/service.rb +86 -86
  120. data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
  121. data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
  122. data/generated/google/apis/kgsearch_v1/service.rb +10 -10
  123. data/generated/google/apis/language_v1.rb +4 -4
  124. data/generated/google/apis/language_v1/classes.rb +452 -452
  125. data/generated/google/apis/language_v1/representations.rb +93 -93
  126. data/generated/google/apis/language_v1/service.rb +48 -48
  127. data/generated/google/apis/language_v1beta1.rb +4 -4
  128. data/generated/google/apis/language_v1beta1/classes.rb +84 -84
  129. data/generated/google/apis/language_v1beta1/representations.rb +22 -22
  130. data/generated/google/apis/language_v1beta1/service.rb +3 -3
  131. data/generated/google/apis/logging_v2.rb +1 -1
  132. data/generated/google/apis/logging_v2/classes.rb +884 -873
  133. data/generated/google/apis/logging_v2/representations.rb +167 -166
  134. data/generated/google/apis/logging_v2/service.rb +430 -430
  135. data/generated/google/apis/logging_v2beta1.rb +1 -1
  136. data/generated/google/apis/logging_v2beta1/classes.rb +550 -539
  137. data/generated/google/apis/logging_v2beta1/representations.rb +124 -123
  138. data/generated/google/apis/logging_v2beta1/service.rb +292 -292
  139. data/generated/google/apis/manufacturers_v1/classes.rb +322 -322
  140. data/generated/google/apis/manufacturers_v1/representations.rb +66 -66
  141. data/generated/google/apis/ml_v1.rb +1 -1
  142. data/generated/google/apis/ml_v1/classes.rb +501 -494
  143. data/generated/google/apis/ml_v1/representations.rb +92 -91
  144. data/generated/google/apis/ml_v1/service.rb +190 -190
  145. data/generated/google/apis/monitoring_v3.rb +1 -1
  146. data/generated/google/apis/monitoring_v3/classes.rb +878 -878
  147. data/generated/google/apis/monitoring_v3/representations.rb +176 -176
  148. data/generated/google/apis/monitoring_v3/service.rb +223 -262
  149. data/generated/google/apis/oauth2_v2.rb +1 -1
  150. data/generated/google/apis/partners_v2.rb +1 -1
  151. data/generated/google/apis/partners_v2/classes.rb +1506 -1506
  152. data/generated/google/apis/partners_v2/representations.rb +370 -370
  153. data/generated/google/apis/partners_v2/service.rb +393 -393
  154. data/generated/google/apis/people_v1.rb +13 -13
  155. data/generated/google/apis/people_v1/classes.rb +597 -594
  156. data/generated/google/apis/people_v1/representations.rb +121 -121
  157. data/generated/google/apis/people_v1/service.rb +39 -48
  158. data/generated/google/apis/plus_domains_v1.rb +1 -1
  159. data/generated/google/apis/plus_v1.rb +1 -1
  160. data/generated/google/apis/proximitybeacon_v1beta1.rb +1 -1
  161. data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +323 -327
  162. data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +100 -100
  163. data/generated/google/apis/proximitybeacon_v1beta1/service.rb +184 -184
  164. data/generated/google/apis/pubsub_v1.rb +1 -1
  165. data/generated/google/apis/pubsub_v1/classes.rb +178 -178
  166. data/generated/google/apis/pubsub_v1/representations.rb +55 -55
  167. data/generated/google/apis/pubsub_v1/service.rb +357 -357
  168. data/generated/google/apis/runtimeconfig_v1.rb +1 -1
  169. data/generated/google/apis/runtimeconfig_v1/classes.rb +20 -20
  170. data/generated/google/apis/runtimeconfig_v1/representations.rb +2 -2
  171. data/generated/google/apis/runtimeconfig_v1/service.rb +12 -7
  172. data/generated/google/apis/script_v1.rb +16 -16
  173. data/generated/google/apis/script_v1/classes.rb +113 -113
  174. data/generated/google/apis/script_v1/representations.rb +28 -28
  175. data/generated/google/apis/script_v1/service.rb +4 -4
  176. data/generated/google/apis/searchconsole_v1.rb +1 -1
  177. data/generated/google/apis/searchconsole_v1/classes.rb +84 -84
  178. data/generated/google/apis/searchconsole_v1/representations.rb +32 -32
  179. data/generated/google/apis/searchconsole_v1/service.rb +6 -6
  180. data/generated/google/apis/servicecontrol_v1.rb +4 -4
  181. data/generated/google/apis/servicecontrol_v1/classes.rb +1146 -1145
  182. data/generated/google/apis/servicecontrol_v1/representations.rb +203 -203
  183. data/generated/google/apis/servicecontrol_v1/service.rb +57 -57
  184. data/generated/google/apis/servicemanagement_v1.rb +4 -4
  185. data/generated/google/apis/servicemanagement_v1/classes.rb +3486 -3360
  186. data/generated/google/apis/servicemanagement_v1/representations.rb +342 -329
  187. data/generated/google/apis/servicemanagement_v1/service.rb +260 -250
  188. data/generated/google/apis/serviceuser_v1.rb +1 -1
  189. data/generated/google/apis/serviceuser_v1/classes.rb +2716 -2596
  190. data/generated/google/apis/serviceuser_v1/representations.rb +391 -379
  191. data/generated/google/apis/serviceuser_v1/service.rb +16 -16
  192. data/generated/google/apis/sheets_v4.rb +1 -1
  193. data/generated/google/apis/sheets_v4/classes.rb +4255 -4252
  194. data/generated/google/apis/sheets_v4/representations.rb +548 -548
  195. data/generated/google/apis/sheets_v4/service.rb +170 -170
  196. data/generated/google/apis/slides_v1.rb +4 -4
  197. data/generated/google/apis/slides_v1/classes.rb +2945 -2916
  198. data/generated/google/apis/slides_v1/representations.rb +700 -697
  199. data/generated/google/apis/slides_v1/service.rb +44 -44
  200. data/generated/google/apis/sourcerepo_v1.rb +2 -2
  201. data/generated/google/apis/sourcerepo_v1/classes.rb +419 -410
  202. data/generated/google/apis/sourcerepo_v1/representations.rb +88 -87
  203. data/generated/google/apis/sourcerepo_v1/service.rb +67 -58
  204. data/generated/google/apis/spanner_v1/classes.rb +2187 -2187
  205. data/generated/google/apis/spanner_v1/representations.rb +323 -323
  206. data/generated/google/apis/spanner_v1/service.rb +383 -383
  207. data/generated/google/apis/speech_v1beta1.rb +1 -1
  208. data/generated/google/apis/speech_v1beta1/classes.rb +226 -226
  209. data/generated/google/apis/speech_v1beta1/representations.rb +44 -44
  210. data/generated/google/apis/speech_v1beta1/service.rb +37 -32
  211. data/generated/google/apis/sqladmin_v1beta4.rb +1 -1
  212. data/generated/google/apis/sqladmin_v1beta4/classes.rb +10 -28
  213. data/generated/google/apis/sqladmin_v1beta4/representations.rb +2 -16
  214. data/generated/google/apis/sqladmin_v1beta4/service.rb +1 -1
  215. data/generated/google/apis/storage_v1.rb +1 -1
  216. data/generated/google/apis/storage_v1/classes.rb +26 -0
  217. data/generated/google/apis/storage_v1/representations.rb +15 -0
  218. data/generated/google/apis/storage_v1/service.rb +168 -42
  219. data/generated/google/apis/storagetransfer_v1.rb +1 -1
  220. data/generated/google/apis/storagetransfer_v1/classes.rb +218 -218
  221. data/generated/google/apis/storagetransfer_v1/representations.rb +47 -47
  222. data/generated/google/apis/storagetransfer_v1/service.rb +68 -68
  223. data/generated/google/apis/toolresults_v1beta3.rb +1 -1
  224. data/generated/google/apis/toolresults_v1beta3/classes.rb +7 -4
  225. data/generated/google/apis/toolresults_v1beta3/service.rb +9 -8
  226. data/generated/google/apis/translate_v2.rb +11 -4
  227. data/generated/google/apis/translate_v2/classes.rb +140 -37
  228. data/generated/google/apis/translate_v2/representations.rb +62 -15
  229. data/generated/google/apis/translate_v2/service.rb +119 -66
  230. data/generated/google/apis/vision_v1.rb +1 -1
  231. data/generated/google/apis/vision_v1/classes.rb +1265 -1273
  232. data/generated/google/apis/vision_v1/representations.rb +202 -202
  233. data/generated/google/apis/vision_v1/service.rb +4 -4
  234. data/generated/google/apis/webmasters_v3.rb +1 -1
  235. data/generated/google/apis/youtube_analytics_v1.rb +1 -1
  236. data/generated/google/apis/youtube_partner_v1.rb +1 -1
  237. data/generated/google/apis/youtube_partner_v1/classes.rb +2 -1
  238. data/generated/google/apis/youtubereporting_v1.rb +1 -1
  239. data/generated/google/apis/youtubereporting_v1/classes.rb +91 -91
  240. data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
  241. data/generated/google/apis/youtubereporting_v1/service.rb +94 -94
  242. data/lib/google/apis/core/api_command.rb +43 -10
  243. data/lib/google/apis/core/json_representation.rb +1 -1
  244. data/lib/google/apis/options.rb +6 -2
  245. data/lib/google/apis/version.rb +1 -1
  246. metadata +3 -3
@@ -27,6 +27,11 @@ module Google
27
27
  class SearchResponse
28
28
  include Google::Apis::Core::Hashable
29
29
 
30
+ # The schema type of top-level JSON-LD object, e.g. ItemList.
31
+ # Corresponds to the JSON property `@type`
32
+ # @return [Object]
33
+ attr_accessor :_type
34
+
30
35
  # The local context applicable for the response. See more details at
31
36
  # http://www.w3.org/TR/json-ld/#context-definitions.
32
37
  # Corresponds to the JSON property `@context`
@@ -38,20 +43,15 @@ module Google
38
43
  # @return [Array<Object>]
39
44
  attr_accessor :item_list_element
40
45
 
41
- # The schema type of top-level JSON-LD object, e.g. ItemList.
42
- # Corresponds to the JSON property `@type`
43
- # @return [Object]
44
- attr_accessor :_type
45
-
46
46
  def initialize(**args)
47
47
  update!(**args)
48
48
  end
49
49
 
50
50
  # Update properties of this object
51
51
  def update!(**args)
52
+ @_type = args[:_type] if args.key?(:_type)
52
53
  @_context = args[:_context] if args.key?(:_context)
53
54
  @item_list_element = args[:item_list_element] if args.key?(:item_list_element)
54
- @_type = args[:_type] if args.key?(:_type)
55
55
  end
56
56
  end
57
57
  end
@@ -31,9 +31,9 @@ module Google
31
31
  class SearchResponse
32
32
  # @private
33
33
  class Representation < Google::Apis::Core::JsonRepresentation
34
+ property :_type, as: '@type'
34
35
  property :_context, as: '@context'
35
36
  collection :item_list_element, as: 'itemListElement'
36
- property :_type, as: '@type'
37
37
  end
38
38
  end
39
39
  end
@@ -50,12 +50,6 @@ module Google
50
50
  # Searches Knowledge Graph for entities that match the constraints.
51
51
  # A list of matched entities will be returned in response, which will be in
52
52
  # JSON-LD format and compatible with http://schema.org
53
- # @param [Fixnum] limit
54
- # Limits the number of entities to be returned.
55
- # @param [Boolean] prefix
56
- # Enables prefix match against names and aliases of entities
57
- # @param [String] query
58
- # The literal query string for search.
59
53
  # @param [Array<String>, String] types
60
54
  # Restricts returned entities with these types, e.g. Person
61
55
  # (as defined in http://schema.org/Person). If multiple types are specified,
@@ -69,6 +63,12 @@ module Google
69
63
  # The list of entity id to be used for search instead of query string.
70
64
  # To specify multiple ids in the HTTP request, repeat the parameter in the
71
65
  # URL as in ...?ids=A&ids=B
66
+ # @param [Fixnum] limit
67
+ # Limits the number of entities to be returned.
68
+ # @param [Boolean] prefix
69
+ # Enables prefix match against names and aliases of entities
70
+ # @param [String] query
71
+ # The literal query string for search.
72
72
  # @param [String] fields
73
73
  # Selector specifying which fields to include in a partial response.
74
74
  # @param [String] quota_user
@@ -86,17 +86,17 @@ module Google
86
86
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
87
87
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
88
88
  # @raise [Google::Apis::AuthorizationError] Authorization is required
89
- def search_entities(limit: nil, prefix: nil, query: nil, types: nil, indent: nil, languages: nil, ids: nil, fields: nil, quota_user: nil, options: nil, &block)
89
+ def search_entities(types: nil, indent: nil, languages: nil, ids: nil, limit: nil, prefix: nil, query: nil, fields: nil, quota_user: nil, options: nil, &block)
90
90
  command = make_simple_command(:get, 'v1/entities:search', options)
91
91
  command.response_representation = Google::Apis::KgsearchV1::SearchResponse::Representation
92
92
  command.response_class = Google::Apis::KgsearchV1::SearchResponse
93
- command.query['limit'] = limit unless limit.nil?
94
- command.query['prefix'] = prefix unless prefix.nil?
95
- command.query['query'] = query unless query.nil?
96
93
  command.query['types'] = types unless types.nil?
97
94
  command.query['indent'] = indent unless indent.nil?
98
95
  command.query['languages'] = languages unless languages.nil?
99
96
  command.query['ids'] = ids unless ids.nil?
97
+ command.query['limit'] = limit unless limit.nil?
98
+ command.query['prefix'] = prefix unless prefix.nil?
99
+ command.query['query'] = query unless query.nil?
100
100
  command.query['fields'] = fields unless fields.nil?
101
101
  command.query['quotaUser'] = quota_user unless quota_user.nil?
102
102
  execute_or_queue_command(command, &block)
@@ -20,14 +20,14 @@ module Google
20
20
  module Apis
21
21
  # Google Cloud Natural Language API
22
22
  #
23
- # Google Cloud Natural Language API provides natural language understanding
24
- # technologies to developers. Examples include sentiment analysis, entity
25
- # recognition, and text annotations.
23
+ # Provides natural language understanding technologies to developers. Examples
24
+ # include sentiment analysis, entity recognition, entity sentiment analysis, and
25
+ # text annotations.
26
26
  #
27
27
  # @see https://cloud.google.com/natural-language/
28
28
  module LanguageV1
29
29
  VERSION = 'V1'
30
- REVISION = '20170502'
30
+ REVISION = '20170525'
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,127 +22,71 @@ module Google
22
22
  module Apis
23
23
  module LanguageV1
24
24
 
25
- # The `Status` type defines a logical error model that is suitable for different
26
- # programming environments, including REST APIs and RPC APIs. It is used by
27
- # [gRPC](https://github.com/grpc). The error model is designed to be:
28
- # - Simple to use and understand for most users
29
- # - Flexible enough to meet unexpected needs
30
- # # Overview
31
- # The `Status` message contains three pieces of data: error code, error message,
32
- # and error details. The error code should be an enum value of
33
- # google.rpc.Code, but it may accept additional error codes if needed. The
34
- # error message should be a developer-facing English message that helps
35
- # developers *understand* and *resolve* the error. If a localized user-facing
36
- # error message is needed, put the localized message in the error details or
37
- # localize it in the client. The optional error details may contain arbitrary
38
- # information about the error. There is a predefined set of error detail types
39
- # in the package `google.rpc` which can be used for common error conditions.
40
- # # Language mapping
41
- # The `Status` message is the logical representation of the error model, but it
42
- # is not necessarily the actual wire format. When the `Status` message is
43
- # exposed in different client libraries and different wire protocols, it can be
44
- # mapped differently. For example, it will likely be mapped to some exceptions
45
- # in Java, but more likely mapped to some error codes in C.
46
- # # Other uses
47
- # The error model and the `Status` message can be used in a variety of
48
- # environments, either with or without APIs, to provide a
49
- # consistent developer experience across different environments.
50
- # Example uses of this error model include:
51
- # - Partial errors. If a service needs to return partial errors to the client,
52
- # it may embed the `Status` in the normal response to indicate the partial
53
- # errors.
54
- # - Workflow errors. A typical workflow has multiple steps. Each step may
55
- # have a `Status` message for error reporting purpose.
56
- # - Batch operations. If a client uses batch request and batch response, the
57
- # `Status` message should be used directly inside batch response, one for
58
- # each error sub-response.
59
- # - Asynchronous operations. If an API call embeds asynchronous operation
60
- # results in its response, the status of those operations should be
61
- # represented directly using the `Status` message.
62
- # - Logging. If some API errors are stored in logs, the message `Status` could
63
- # be used directly after any stripping needed for security/privacy reasons.
64
- class Status
25
+ # Represents part of speech information for a token. Parts of speech
26
+ # are as defined in
27
+ # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
28
+ class PartOfSpeech
65
29
  include Google::Apis::Core::Hashable
66
30
 
67
- # A list of messages that carry the error details. There will be a
68
- # common set of message types for APIs to use.
69
- # Corresponds to the JSON property `details`
70
- # @return [Array<Hash<String,Object>>]
71
- attr_accessor :details
72
-
73
- # The status code, which should be an enum value of google.rpc.Code.
74
- # Corresponds to the JSON property `code`
75
- # @return [Fixnum]
76
- attr_accessor :code
77
-
78
- # A developer-facing error message, which should be in English. Any
79
- # user-facing error message should be localized and sent in the
80
- # google.rpc.Status.details field, or localized by the client.
81
- # Corresponds to the JSON property `message`
31
+ # The grammatical form.
32
+ # Corresponds to the JSON property `form`
82
33
  # @return [String]
83
- attr_accessor :message
34
+ attr_accessor :form
84
35
 
85
- def initialize(**args)
86
- update!(**args)
87
- end
36
+ # The grammatical number.
37
+ # Corresponds to the JSON property `number`
38
+ # @return [String]
39
+ attr_accessor :number
88
40
 
89
- # Update properties of this object
90
- def update!(**args)
91
- @details = args[:details] if args.key?(:details)
92
- @code = args[:code] if args.key?(:code)
93
- @message = args[:message] if args.key?(:message)
94
- end
95
- end
41
+ # The grammatical voice.
42
+ # Corresponds to the JSON property `voice`
43
+ # @return [String]
44
+ attr_accessor :voice
96
45
 
97
- # All available features for sentiment, syntax, and semantic analysis.
98
- # Setting each one to true will enable that specific analysis for the input.
99
- class Features
100
- include Google::Apis::Core::Hashable
46
+ # The grammatical aspect.
47
+ # Corresponds to the JSON property `aspect`
48
+ # @return [String]
49
+ attr_accessor :aspect
101
50
 
102
- # Extract syntax information.
103
- # Corresponds to the JSON property `extractSyntax`
104
- # @return [Boolean]
105
- attr_accessor :extract_syntax
106
- alias_method :extract_syntax?, :extract_syntax
51
+ # The grammatical mood.
52
+ # Corresponds to the JSON property `mood`
53
+ # @return [String]
54
+ attr_accessor :mood
107
55
 
108
- # Extract document-level sentiment.
109
- # Corresponds to the JSON property `extractDocumentSentiment`
110
- # @return [Boolean]
111
- attr_accessor :extract_document_sentiment
112
- alias_method :extract_document_sentiment?, :extract_document_sentiment
56
+ # The part of speech tag.
57
+ # Corresponds to the JSON property `tag`
58
+ # @return [String]
59
+ attr_accessor :tag
113
60
 
114
- # Extract entities.
115
- # Corresponds to the JSON property `extractEntities`
116
- # @return [Boolean]
117
- attr_accessor :extract_entities
118
- alias_method :extract_entities?, :extract_entities
61
+ # The grammatical gender.
62
+ # Corresponds to the JSON property `gender`
63
+ # @return [String]
64
+ attr_accessor :gender
119
65
 
120
- def initialize(**args)
121
- update!(**args)
122
- end
66
+ # The grammatical person.
67
+ # Corresponds to the JSON property `person`
68
+ # @return [String]
69
+ attr_accessor :person
123
70
 
124
- # Update properties of this object
125
- def update!(**args)
126
- @extract_syntax = args[:extract_syntax] if args.key?(:extract_syntax)
127
- @extract_document_sentiment = args[:extract_document_sentiment] if args.key?(:extract_document_sentiment)
128
- @extract_entities = args[:extract_entities] if args.key?(:extract_entities)
129
- end
130
- end
71
+ # The grammatical properness.
72
+ # Corresponds to the JSON property `proper`
73
+ # @return [String]
74
+ attr_accessor :proper
131
75
 
132
- # Represents a mention for an entity in the text. Currently, proper noun
133
- # mentions are supported.
134
- class EntityMention
135
- include Google::Apis::Core::Hashable
76
+ # The grammatical case.
77
+ # Corresponds to the JSON property `case`
78
+ # @return [String]
79
+ attr_accessor :case
136
80
 
137
- # Represents an output piece of text.
138
- # Corresponds to the JSON property `text`
139
- # @return [Google::Apis::LanguageV1::TextSpan]
140
- attr_accessor :text
81
+ # The grammatical tense.
82
+ # Corresponds to the JSON property `tense`
83
+ # @return [String]
84
+ attr_accessor :tense
141
85
 
142
- # The type of the entity mention.
143
- # Corresponds to the JSON property `type`
86
+ # The grammatical reciprocity.
87
+ # Corresponds to the JSON property `reciprocity`
144
88
  # @return [String]
145
- attr_accessor :type
89
+ attr_accessor :reciprocity
146
90
 
147
91
  def initialize(**args)
148
92
  update!(**args)
@@ -150,46 +94,35 @@ module Google
150
94
 
151
95
  # Update properties of this object
152
96
  def update!(**args)
153
- @text = args[:text] if args.key?(:text)
154
- @type = args[:type] if args.key?(:type)
97
+ @form = args[:form] if args.key?(:form)
98
+ @number = args[:number] if args.key?(:number)
99
+ @voice = args[:voice] if args.key?(:voice)
100
+ @aspect = args[:aspect] if args.key?(:aspect)
101
+ @mood = args[:mood] if args.key?(:mood)
102
+ @tag = args[:tag] if args.key?(:tag)
103
+ @gender = args[:gender] if args.key?(:gender)
104
+ @person = args[:person] if args.key?(:person)
105
+ @proper = args[:proper] if args.key?(:proper)
106
+ @case = args[:case] if args.key?(:case)
107
+ @tense = args[:tense] if args.key?(:tense)
108
+ @reciprocity = args[:reciprocity] if args.key?(:reciprocity)
155
109
  end
156
110
  end
157
111
 
158
- # ################################################################ #
159
- # Represents the input to API methods.
160
- class Document
112
+ # The syntax analysis request message.
113
+ class AnalyzeSyntaxRequest
161
114
  include Google::Apis::Core::Hashable
162
115
 
163
- # The Google Cloud Storage URI where the file content is located.
164
- # This URI must be of the form: gs://bucket_name/object_name. For more
165
- # details, see https://cloud.google.com/storage/docs/reference-uris.
166
- # NOTE: Cloud Storage object versioning is not supported.
167
- # Corresponds to the JSON property `gcsContentUri`
168
- # @return [String]
169
- attr_accessor :gcs_content_uri
170
-
171
- # The language of the document (if not specified, the language is
172
- # automatically detected). Both ISO and BCP-47 language codes are
173
- # accepted.<br>
174
- # [Language Support](https://cloud.google.com/natural-language/docs/languages)
175
- # lists currently supported languages for each API method.
176
- # If the language (either specified by the caller or automatically detected)
177
- # is not supported by the called API method, an `INVALID_ARGUMENT` error
178
- # is returned.
179
- # Corresponds to the JSON property `language`
180
- # @return [String]
181
- attr_accessor :language
182
-
183
- # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
184
- # returns an `INVALID_ARGUMENT` error.
185
- # Corresponds to the JSON property `type`
116
+ # The encoding type used by the API to calculate offsets.
117
+ # Corresponds to the JSON property `encodingType`
186
118
  # @return [String]
187
- attr_accessor :type
119
+ attr_accessor :encoding_type
188
120
 
189
- # The content of the input in string format.
190
- # Corresponds to the JSON property `content`
191
- # @return [String]
192
- attr_accessor :content
121
+ # ################################################################ #
122
+ # Represents the input to API methods.
123
+ # Corresponds to the JSON property `document`
124
+ # @return [Google::Apis::LanguageV1::Document]
125
+ attr_accessor :document
193
126
 
194
127
  def initialize(**args)
195
128
  update!(**args)
@@ -197,27 +130,32 @@ module Google
197
130
 
198
131
  # Update properties of this object
199
132
  def update!(**args)
200
- @gcs_content_uri = args[:gcs_content_uri] if args.key?(:gcs_content_uri)
201
- @language = args[:language] if args.key?(:language)
202
- @type = args[:type] if args.key?(:type)
203
- @content = args[:content] if args.key?(:content)
133
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
134
+ @document = args[:document] if args.key?(:document)
204
135
  end
205
136
  end
206
137
 
207
- # Represents a sentence in the input document.
208
- class Sentence
138
+ # The sentiment analysis response message.
139
+ class AnalyzeSentimentResponse
209
140
  include Google::Apis::Core::Hashable
210
141
 
211
142
  # Represents the feeling associated with the entire text or entities in
212
143
  # the text.
213
- # Corresponds to the JSON property `sentiment`
144
+ # Corresponds to the JSON property `documentSentiment`
214
145
  # @return [Google::Apis::LanguageV1::Sentiment]
215
- attr_accessor :sentiment
146
+ attr_accessor :document_sentiment
216
147
 
217
- # Represents an output piece of text.
218
- # Corresponds to the JSON property `text`
219
- # @return [Google::Apis::LanguageV1::TextSpan]
220
- attr_accessor :text
148
+ # The language of the text, which will be the same as the language specified
149
+ # in the request or, if not specified, the automatically-detected language.
150
+ # See Document.language field for more details.
151
+ # Corresponds to the JSON property `language`
152
+ # @return [String]
153
+ attr_accessor :language
154
+
155
+ # The sentiment for all the sentences in the document.
156
+ # Corresponds to the JSON property `sentences`
157
+ # @return [Array<Google::Apis::LanguageV1::Sentence>]
158
+ attr_accessor :sentences
221
159
 
222
160
  def initialize(**args)
223
161
  update!(**args)
@@ -225,28 +163,27 @@ module Google
225
163
 
226
164
  # Update properties of this object
227
165
  def update!(**args)
228
- @sentiment = args[:sentiment] if args.key?(:sentiment)
229
- @text = args[:text] if args.key?(:text)
166
+ @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
167
+ @language = args[:language] if args.key?(:language)
168
+ @sentences = args[:sentences] if args.key?(:sentences)
230
169
  end
231
170
  end
232
171
 
233
- # Represents the feeling associated with the entire text or entities in
234
- # the text.
235
- class Sentiment
172
+ # The entity analysis response message.
173
+ class AnalyzeEntitiesResponse
236
174
  include Google::Apis::Core::Hashable
237
175
 
238
- # Sentiment score between -1.0 (negative sentiment) and 1.0
239
- # (positive sentiment).
240
- # Corresponds to the JSON property `score`
241
- # @return [Float]
242
- attr_accessor :score
176
+ # The language of the text, which will be the same as the language specified
177
+ # in the request or, if not specified, the automatically-detected language.
178
+ # See Document.language field for more details.
179
+ # Corresponds to the JSON property `language`
180
+ # @return [String]
181
+ attr_accessor :language
243
182
 
244
- # A non-negative number in the [0, +inf) range, which represents
245
- # the absolute magnitude of sentiment regardless of score (positive or
246
- # negative).
247
- # Corresponds to the JSON property `magnitude`
248
- # @return [Float]
249
- attr_accessor :magnitude
183
+ # The recognized entities in the input document.
184
+ # Corresponds to the JSON property `entities`
185
+ # @return [Array<Google::Apis::LanguageV1::Entity>]
186
+ attr_accessor :entities
250
187
 
251
188
  def initialize(**args)
252
189
  update!(**args)
@@ -254,25 +191,48 @@ module Google
254
191
 
255
192
  # Update properties of this object
256
193
  def update!(**args)
257
- @score = args[:score] if args.key?(:score)
258
- @magnitude = args[:magnitude] if args.key?(:magnitude)
194
+ @language = args[:language] if args.key?(:language)
195
+ @entities = args[:entities] if args.key?(:entities)
259
196
  end
260
197
  end
261
198
 
262
- # The entity analysis request message.
263
- class AnalyzeEntitiesRequest
199
+ # Represents a phrase in the text that is a known entity, such as
200
+ # a person, an organization, or location. The API associates information, such
201
+ # as salience and mentions, with entities.
202
+ class Entity
264
203
  include Google::Apis::Core::Hashable
265
204
 
266
- # The encoding type used by the API to calculate offsets.
267
- # Corresponds to the JSON property `encodingType`
205
+ # The mentions of this entity in the input document. The API currently
206
+ # supports proper noun mentions.
207
+ # Corresponds to the JSON property `mentions`
208
+ # @return [Array<Google::Apis::LanguageV1::EntityMention>]
209
+ attr_accessor :mentions
210
+
211
+ # The representative name for the entity.
212
+ # Corresponds to the JSON property `name`
268
213
  # @return [String]
269
- attr_accessor :encoding_type
214
+ attr_accessor :name
270
215
 
271
- # ################################################################ #
272
- # Represents the input to API methods.
273
- # Corresponds to the JSON property `document`
274
- # @return [Google::Apis::LanguageV1::Document]
275
- attr_accessor :document
216
+ # The entity type.
217
+ # Corresponds to the JSON property `type`
218
+ # @return [String]
219
+ attr_accessor :type
220
+
221
+ # Metadata associated with the entity.
222
+ # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
223
+ # available. The associated keys are "wikipedia_url" and "mid", respectively.
224
+ # Corresponds to the JSON property `metadata`
225
+ # @return [Hash<String,String>]
226
+ attr_accessor :metadata
227
+
228
+ # The salience score associated with the entity in the [0, 1.0] range.
229
+ # The salience score for an entity provides information about the
230
+ # importance or centrality of that entity to the entire document text.
231
+ # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
232
+ # salient.
233
+ # Corresponds to the JSON property `salience`
234
+ # @return [Float]
235
+ attr_accessor :salience
276
236
 
277
237
  def initialize(**args)
278
238
  update!(**args)
@@ -280,76 +240,34 @@ module Google
280
240
 
281
241
  # Update properties of this object
282
242
  def update!(**args)
283
- @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
284
- @document = args[:document] if args.key?(:document)
243
+ @mentions = args[:mentions] if args.key?(:mentions)
244
+ @name = args[:name] if args.key?(:name)
245
+ @type = args[:type] if args.key?(:type)
246
+ @metadata = args[:metadata] if args.key?(:metadata)
247
+ @salience = args[:salience] if args.key?(:salience)
285
248
  end
286
249
  end
287
250
 
288
- # Represents part of speech information for a token. Parts of speech
289
- # are as defined in
290
- # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
291
- class PartOfSpeech
251
+ # The syntax analysis response message.
252
+ class AnalyzeSyntaxResponse
292
253
  include Google::Apis::Core::Hashable
293
254
 
294
- # The grammatical case.
295
- # Corresponds to the JSON property `case`
296
- # @return [String]
297
- attr_accessor :case
298
-
299
- # The grammatical tense.
300
- # Corresponds to the JSON property `tense`
301
- # @return [String]
302
- attr_accessor :tense
303
-
304
- # The grammatical reciprocity.
305
- # Corresponds to the JSON property `reciprocity`
306
- # @return [String]
307
- attr_accessor :reciprocity
308
-
309
- # The grammatical form.
310
- # Corresponds to the JSON property `form`
311
- # @return [String]
312
- attr_accessor :form
313
-
314
- # The grammatical number.
315
- # Corresponds to the JSON property `number`
316
- # @return [String]
317
- attr_accessor :number
318
-
319
- # The grammatical voice.
320
- # Corresponds to the JSON property `voice`
321
- # @return [String]
322
- attr_accessor :voice
323
-
324
- # The grammatical aspect.
325
- # Corresponds to the JSON property `aspect`
326
- # @return [String]
327
- attr_accessor :aspect
328
-
329
- # The grammatical mood.
330
- # Corresponds to the JSON property `mood`
331
- # @return [String]
332
- attr_accessor :mood
333
-
334
- # The part of speech tag.
335
- # Corresponds to the JSON property `tag`
336
- # @return [String]
337
- attr_accessor :tag
338
-
339
- # The grammatical gender.
340
- # Corresponds to the JSON property `gender`
255
+ # The language of the text, which will be the same as the language specified
256
+ # in the request or, if not specified, the automatically-detected language.
257
+ # See Document.language field for more details.
258
+ # Corresponds to the JSON property `language`
341
259
  # @return [String]
342
- attr_accessor :gender
260
+ attr_accessor :language
343
261
 
344
- # The grammatical person.
345
- # Corresponds to the JSON property `person`
346
- # @return [String]
347
- attr_accessor :person
262
+ # Sentences in the input document.
263
+ # Corresponds to the JSON property `sentences`
264
+ # @return [Array<Google::Apis::LanguageV1::Sentence>]
265
+ attr_accessor :sentences
348
266
 
349
- # The grammatical properness.
350
- # Corresponds to the JSON property `proper`
351
- # @return [String]
352
- attr_accessor :proper
267
+ # Tokens, along with their syntactic information, in the input document.
268
+ # Corresponds to the JSON property `tokens`
269
+ # @return [Array<Google::Apis::LanguageV1::Token>]
270
+ attr_accessor :tokens
353
271
 
354
272
  def initialize(**args)
355
273
  update!(**args)
@@ -357,23 +275,15 @@ module Google
357
275
 
358
276
  # Update properties of this object
359
277
  def update!(**args)
360
- @case = args[:case] if args.key?(:case)
361
- @tense = args[:tense] if args.key?(:tense)
362
- @reciprocity = args[:reciprocity] if args.key?(:reciprocity)
363
- @form = args[:form] if args.key?(:form)
364
- @number = args[:number] if args.key?(:number)
365
- @voice = args[:voice] if args.key?(:voice)
366
- @aspect = args[:aspect] if args.key?(:aspect)
367
- @mood = args[:mood] if args.key?(:mood)
368
- @tag = args[:tag] if args.key?(:tag)
369
- @gender = args[:gender] if args.key?(:gender)
370
- @person = args[:person] if args.key?(:person)
371
- @proper = args[:proper] if args.key?(:proper)
278
+ @language = args[:language] if args.key?(:language)
279
+ @sentences = args[:sentences] if args.key?(:sentences)
280
+ @tokens = args[:tokens] if args.key?(:tokens)
372
281
  end
373
282
  end
374
283
 
375
- # The syntax analysis request message.
376
- class AnalyzeSyntaxRequest
284
+ # The request message for the text annotation API, which can perform multiple
285
+ # analysis types (sentiment, entities, and syntax) in one call.
286
+ class AnnotateTextRequest
377
287
  include Google::Apis::Core::Hashable
378
288
 
379
289
  # The encoding type used by the API to calculate offsets.
@@ -387,6 +297,12 @@ module Google
387
297
  # @return [Google::Apis::LanguageV1::Document]
388
298
  attr_accessor :document
389
299
 
300
+ # All available features for sentiment, syntax, and semantic analysis.
301
+ # Setting each one to true will enable that specific analysis for the input.
302
+ # Corresponds to the JSON property `features`
303
+ # @return [Google::Apis::LanguageV1::Features]
304
+ attr_accessor :features
305
+
390
306
  def initialize(**args)
391
307
  update!(**args)
392
308
  end
@@ -395,11 +311,12 @@ module Google
395
311
  def update!(**args)
396
312
  @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
397
313
  @document = args[:document] if args.key?(:document)
314
+ @features = args[:features] if args.key?(:features)
398
315
  end
399
316
  end
400
317
 
401
- # The sentiment analysis response message.
402
- class AnalyzeSentimentResponse
318
+ # The text annotations response message.
319
+ class AnnotateTextResponse
403
320
  include Google::Apis::Core::Hashable
404
321
 
405
322
  # Represents the feeling associated with the entire text or entities in
@@ -415,11 +332,26 @@ module Google
415
332
  # @return [String]
416
333
  attr_accessor :language
417
334
 
418
- # The sentiment for all the sentences in the document.
335
+ # Sentences in the input document. Populated if the user enables
336
+ # AnnotateTextRequest.Features.extract_syntax.
419
337
  # Corresponds to the JSON property `sentences`
420
338
  # @return [Array<Google::Apis::LanguageV1::Sentence>]
421
339
  attr_accessor :sentences
422
340
 
341
+ # Tokens, along with their syntactic information, in the input document.
342
+ # Populated if the user enables
343
+ # AnnotateTextRequest.Features.extract_syntax.
344
+ # Corresponds to the JSON property `tokens`
345
+ # @return [Array<Google::Apis::LanguageV1::Token>]
346
+ attr_accessor :tokens
347
+
348
+ # Entities, along with their semantic information, in the input document.
349
+ # Populated if the user enables
350
+ # AnnotateTextRequest.Features.extract_entities.
351
+ # Corresponds to the JSON property `entities`
352
+ # @return [Array<Google::Apis::LanguageV1::Entity>]
353
+ attr_accessor :entities
354
+
423
355
  def initialize(**args)
424
356
  update!(**args)
425
357
  end
@@ -429,24 +361,25 @@ module Google
429
361
  @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
430
362
  @language = args[:language] if args.key?(:language)
431
363
  @sentences = args[:sentences] if args.key?(:sentences)
364
+ @tokens = args[:tokens] if args.key?(:tokens)
365
+ @entities = args[:entities] if args.key?(:entities)
432
366
  end
433
367
  end
434
368
 
435
- # The entity analysis response message.
436
- class AnalyzeEntitiesResponse
369
+ # The sentiment analysis request message.
370
+ class AnalyzeSentimentRequest
437
371
  include Google::Apis::Core::Hashable
438
372
 
439
- # The language of the text, which will be the same as the language specified
440
- # in the request or, if not specified, the automatically-detected language.
441
- # See Document.language field for more details.
442
- # Corresponds to the JSON property `language`
373
+ # The encoding type used by the API to calculate sentence offsets.
374
+ # Corresponds to the JSON property `encodingType`
443
375
  # @return [String]
444
- attr_accessor :language
376
+ attr_accessor :encoding_type
445
377
 
446
- # The recognized entities in the input document.
447
- # Corresponds to the JSON property `entities`
448
- # @return [Array<Google::Apis::LanguageV1::Entity>]
449
- attr_accessor :entities
378
+ # ################################################################ #
379
+ # Represents the input to API methods.
380
+ # Corresponds to the JSON property `document`
381
+ # @return [Google::Apis::LanguageV1::Document]
382
+ attr_accessor :document
450
383
 
451
384
  def initialize(**args)
452
385
  update!(**args)
@@ -454,48 +387,69 @@ module Google
454
387
 
455
388
  # Update properties of this object
456
389
  def update!(**args)
457
- @language = args[:language] if args.key?(:language)
458
- @entities = args[:entities] if args.key?(:entities)
390
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
391
+ @document = args[:document] if args.key?(:document)
459
392
  end
460
393
  end
461
394
 
462
- # Represents a phrase in the text that is a known entity, such as
463
- # a person, an organization, or location. The API associates information, such
464
- # as salience and mentions, with entities.
465
- class Entity
395
+ # Represents dependency parse tree information for a token. (For more
396
+ # information on dependency labels, see
397
+ # http://www.aclweb.org/anthology/P13-2017
398
+ class DependencyEdge
466
399
  include Google::Apis::Core::Hashable
467
400
 
468
- # The mentions of this entity in the input document. The API currently
469
- # supports proper noun mentions.
470
- # Corresponds to the JSON property `mentions`
471
- # @return [Array<Google::Apis::LanguageV1::EntityMention>]
472
- attr_accessor :mentions
401
+ # Represents the head of this token in the dependency tree.
402
+ # This is the index of the token which has an arc going to this token.
403
+ # The index is the position of the token in the array of tokens returned
404
+ # by the API method. If this token is a root token, then the
405
+ # `head_token_index` is its own index.
406
+ # Corresponds to the JSON property `headTokenIndex`
407
+ # @return [Fixnum]
408
+ attr_accessor :head_token_index
473
409
 
474
- # The representative name for the entity.
475
- # Corresponds to the JSON property `name`
410
+ # The parse label for the token.
411
+ # Corresponds to the JSON property `label`
476
412
  # @return [String]
477
- attr_accessor :name
413
+ attr_accessor :label
478
414
 
479
- # The entity type.
480
- # Corresponds to the JSON property `type`
481
- # @return [String]
482
- attr_accessor :type
415
+ def initialize(**args)
416
+ update!(**args)
417
+ end
483
418
 
484
- # Metadata associated with the entity.
485
- # Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if
486
- # available. The associated keys are "wikipedia_url" and "mid", respectively.
487
- # Corresponds to the JSON property `metadata`
488
- # @return [Hash<String,String>]
489
- attr_accessor :metadata
419
+ # Update properties of this object
420
+ def update!(**args)
421
+ @head_token_index = args[:head_token_index] if args.key?(:head_token_index)
422
+ @label = args[:label] if args.key?(:label)
423
+ end
424
+ end
490
425
 
491
- # The salience score associated with the entity in the [0, 1.0] range.
492
- # The salience score for an entity provides information about the
493
- # importance or centrality of that entity to the entire document text.
494
- # Scores closer to 0 are less salient, while scores closer to 1.0 are highly
495
- # salient.
496
- # Corresponds to the JSON property `salience`
497
- # @return [Float]
498
- attr_accessor :salience
426
+ # Represents the smallest syntactic building block of the text.
427
+ class Token
428
+ include Google::Apis::Core::Hashable
429
+
430
+ # Represents an output piece of text.
431
+ # Corresponds to the JSON property `text`
432
+ # @return [Google::Apis::LanguageV1::TextSpan]
433
+ attr_accessor :text
434
+
435
+ # Represents dependency parse tree information for a token. (For more
436
+ # information on dependency labels, see
437
+ # http://www.aclweb.org/anthology/P13-2017
438
+ # Corresponds to the JSON property `dependencyEdge`
439
+ # @return [Google::Apis::LanguageV1::DependencyEdge]
440
+ attr_accessor :dependency_edge
441
+
442
+ # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
443
+ # Corresponds to the JSON property `lemma`
444
+ # @return [String]
445
+ attr_accessor :lemma
446
+
447
+ # Represents part of speech information for a token. Parts of speech
448
+ # are as defined in
449
+ # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
450
+ # Corresponds to the JSON property `partOfSpeech`
451
+ # @return [Google::Apis::LanguageV1::PartOfSpeech]
452
+ attr_accessor :part_of_speech
499
453
 
500
454
  def initialize(**args)
501
455
  update!(**args)
@@ -503,34 +457,98 @@ module Google
503
457
 
504
458
  # Update properties of this object
505
459
  def update!(**args)
506
- @mentions = args[:mentions] if args.key?(:mentions)
507
- @name = args[:name] if args.key?(:name)
508
- @type = args[:type] if args.key?(:type)
509
- @metadata = args[:metadata] if args.key?(:metadata)
510
- @salience = args[:salience] if args.key?(:salience)
460
+ @text = args[:text] if args.key?(:text)
461
+ @dependency_edge = args[:dependency_edge] if args.key?(:dependency_edge)
462
+ @lemma = args[:lemma] if args.key?(:lemma)
463
+ @part_of_speech = args[:part_of_speech] if args.key?(:part_of_speech)
511
464
  end
512
465
  end
513
466
 
514
- # The syntax analysis response message.
515
- class AnalyzeSyntaxResponse
467
+ # Represents an output piece of text.
468
+ class TextSpan
516
469
  include Google::Apis::Core::Hashable
517
470
 
518
- # The language of the text, which will be the same as the language specified
519
- # in the request or, if not specified, the automatically-detected language.
520
- # See Document.language field for more details.
521
- # Corresponds to the JSON property `language`
471
+ # The API calculates the beginning offset of the content in the original
472
+ # document according to the EncodingType specified in the API request.
473
+ # Corresponds to the JSON property `beginOffset`
474
+ # @return [Fixnum]
475
+ attr_accessor :begin_offset
476
+
477
+ # The content of the output text.
478
+ # Corresponds to the JSON property `content`
522
479
  # @return [String]
523
- attr_accessor :language
480
+ attr_accessor :content
524
481
 
525
- # Sentences in the input document.
526
- # Corresponds to the JSON property `sentences`
527
- # @return [Array<Google::Apis::LanguageV1::Sentence>]
528
- attr_accessor :sentences
482
+ def initialize(**args)
483
+ update!(**args)
484
+ end
485
+
486
+ # Update properties of this object
487
+ def update!(**args)
488
+ @begin_offset = args[:begin_offset] if args.key?(:begin_offset)
489
+ @content = args[:content] if args.key?(:content)
490
+ end
491
+ end
492
+
493
+ # The `Status` type defines a logical error model that is suitable for different
494
+ # programming environments, including REST APIs and RPC APIs. It is used by
495
+ # [gRPC](https://github.com/grpc). The error model is designed to be:
496
+ # - Simple to use and understand for most users
497
+ # - Flexible enough to meet unexpected needs
498
+ # # Overview
499
+ # The `Status` message contains three pieces of data: error code, error message,
500
+ # and error details. The error code should be an enum value of
501
+ # google.rpc.Code, but it may accept additional error codes if needed. The
502
+ # error message should be a developer-facing English message that helps
503
+ # developers *understand* and *resolve* the error. If a localized user-facing
504
+ # error message is needed, put the localized message in the error details or
505
+ # localize it in the client. The optional error details may contain arbitrary
506
+ # information about the error. There is a predefined set of error detail types
507
+ # in the package `google.rpc` that can be used for common error conditions.
508
+ # # Language mapping
509
+ # The `Status` message is the logical representation of the error model, but it
510
+ # is not necessarily the actual wire format. When the `Status` message is
511
+ # exposed in different client libraries and different wire protocols, it can be
512
+ # mapped differently. For example, it will likely be mapped to some exceptions
513
+ # in Java, but more likely mapped to some error codes in C.
514
+ # # Other uses
515
+ # The error model and the `Status` message can be used in a variety of
516
+ # environments, either with or without APIs, to provide a
517
+ # consistent developer experience across different environments.
518
+ # Example uses of this error model include:
519
+ # - Partial errors. If a service needs to return partial errors to the client,
520
+ # it may embed the `Status` in the normal response to indicate the partial
521
+ # errors.
522
+ # - Workflow errors. A typical workflow has multiple steps. Each step may
523
+ # have a `Status` message for error reporting.
524
+ # - Batch operations. If a client uses batch request and batch response, the
525
+ # `Status` message should be used directly inside batch response, one for
526
+ # each error sub-response.
527
+ # - Asynchronous operations. If an API call embeds asynchronous operation
528
+ # results in its response, the status of those operations should be
529
+ # represented directly using the `Status` message.
530
+ # - Logging. If some API errors are stored in logs, the message `Status` could
531
+ # be used directly after any stripping needed for security/privacy reasons.
532
+ class Status
533
+ include Google::Apis::Core::Hashable
534
+
535
+ # The status code, which should be an enum value of google.rpc.Code.
536
+ # Corresponds to the JSON property `code`
537
+ # @return [Fixnum]
538
+ attr_accessor :code
539
+
540
+ # A developer-facing error message, which should be in English. Any
541
+ # user-facing error message should be localized and sent in the
542
+ # google.rpc.Status.details field, or localized by the client.
543
+ # Corresponds to the JSON property `message`
544
+ # @return [String]
545
+ attr_accessor :message
529
546
 
530
- # Tokens, along with their syntactic information, in the input document.
531
- # Corresponds to the JSON property `tokens`
532
- # @return [Array<Google::Apis::LanguageV1::Token>]
533
- attr_accessor :tokens
547
+ # A list of messages that carry the error details. There will be a
548
+ # common set of message types for APIs to use.
549
+ # Corresponds to the JSON property `details`
550
+ # @return [Array<Hash<String,Object>>]
551
+ attr_accessor :details
534
552
 
535
553
  def initialize(**args)
536
554
  update!(**args)
@@ -538,33 +556,26 @@ module Google
538
556
 
539
557
  # Update properties of this object
540
558
  def update!(**args)
541
- @language = args[:language] if args.key?(:language)
542
- @sentences = args[:sentences] if args.key?(:sentences)
543
- @tokens = args[:tokens] if args.key?(:tokens)
559
+ @code = args[:code] if args.key?(:code)
560
+ @message = args[:message] if args.key?(:message)
561
+ @details = args[:details] if args.key?(:details)
544
562
  end
545
563
  end
546
564
 
547
- # The request message for the text annotation API, which can perform multiple
548
- # analysis types (sentiment, entities, and syntax) in one call.
549
- class AnnotateTextRequest
565
+ # Represents a mention for an entity in the text. Currently, proper noun
566
+ # mentions are supported.
567
+ class EntityMention
550
568
  include Google::Apis::Core::Hashable
551
569
 
552
- # The encoding type used by the API to calculate offsets.
553
- # Corresponds to the JSON property `encodingType`
554
- # @return [String]
555
- attr_accessor :encoding_type
556
-
557
- # ################################################################ #
558
- # Represents the input to API methods.
559
- # Corresponds to the JSON property `document`
560
- # @return [Google::Apis::LanguageV1::Document]
561
- attr_accessor :document
570
+ # Represents an output piece of text.
571
+ # Corresponds to the JSON property `text`
572
+ # @return [Google::Apis::LanguageV1::TextSpan]
573
+ attr_accessor :text
562
574
 
563
- # All available features for sentiment, syntax, and semantic analysis.
564
- # Setting each one to true will enable that specific analysis for the input.
565
- # Corresponds to the JSON property `features`
566
- # @return [Google::Apis::LanguageV1::Features]
567
- attr_accessor :features
575
+ # The type of the entity mention.
576
+ # Corresponds to the JSON property `type`
577
+ # @return [String]
578
+ attr_accessor :type
568
579
 
569
580
  def initialize(**args)
570
581
  update!(**args)
@@ -572,48 +583,33 @@ module Google
572
583
 
573
584
  # Update properties of this object
574
585
  def update!(**args)
575
- @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
576
- @document = args[:document] if args.key?(:document)
577
- @features = args[:features] if args.key?(:features)
586
+ @text = args[:text] if args.key?(:text)
587
+ @type = args[:type] if args.key?(:type)
578
588
  end
579
589
  end
580
590
 
581
- # The text annotations response message.
582
- class AnnotateTextResponse
591
+ # All available features for sentiment, syntax, and semantic analysis.
592
+ # Setting each one to true will enable that specific analysis for the input.
593
+ class Features
583
594
  include Google::Apis::Core::Hashable
584
595
 
585
- # Entities, along with their semantic information, in the input document.
586
- # Populated if the user enables
587
- # AnnotateTextRequest.Features.extract_entities.
588
- # Corresponds to the JSON property `entities`
589
- # @return [Array<Google::Apis::LanguageV1::Entity>]
590
- attr_accessor :entities
591
-
592
- # Represents the feeling associated with the entire text or entities in
593
- # the text.
594
- # Corresponds to the JSON property `documentSentiment`
595
- # @return [Google::Apis::LanguageV1::Sentiment]
596
- attr_accessor :document_sentiment
597
-
598
- # The language of the text, which will be the same as the language specified
599
- # in the request or, if not specified, the automatically-detected language.
600
- # See Document.language field for more details.
601
- # Corresponds to the JSON property `language`
602
- # @return [String]
603
- attr_accessor :language
596
+ # Extract syntax information.
597
+ # Corresponds to the JSON property `extractSyntax`
598
+ # @return [Boolean]
599
+ attr_accessor :extract_syntax
600
+ alias_method :extract_syntax?, :extract_syntax
604
601
 
605
- # Sentences in the input document. Populated if the user enables
606
- # AnnotateTextRequest.Features.extract_syntax.
607
- # Corresponds to the JSON property `sentences`
608
- # @return [Array<Google::Apis::LanguageV1::Sentence>]
609
- attr_accessor :sentences
602
+ # Extract document-level sentiment.
603
+ # Corresponds to the JSON property `extractDocumentSentiment`
604
+ # @return [Boolean]
605
+ attr_accessor :extract_document_sentiment
606
+ alias_method :extract_document_sentiment?, :extract_document_sentiment
610
607
 
611
- # Tokens, along with their syntactic information, in the input document.
612
- # Populated if the user enables
613
- # AnnotateTextRequest.Features.extract_syntax.
614
- # Corresponds to the JSON property `tokens`
615
- # @return [Array<Google::Apis::LanguageV1::Token>]
616
- attr_accessor :tokens
608
+ # Extract entities.
609
+ # Corresponds to the JSON property `extractEntities`
610
+ # @return [Boolean]
611
+ attr_accessor :extract_entities
612
+ alias_method :extract_entities?, :extract_entities
617
613
 
618
614
  def initialize(**args)
619
615
  update!(**args)
@@ -621,28 +617,47 @@ module Google
621
617
 
622
618
  # Update properties of this object
623
619
  def update!(**args)
624
- @entities = args[:entities] if args.key?(:entities)
625
- @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
626
- @language = args[:language] if args.key?(:language)
627
- @sentences = args[:sentences] if args.key?(:sentences)
628
- @tokens = args[:tokens] if args.key?(:tokens)
620
+ @extract_syntax = args[:extract_syntax] if args.key?(:extract_syntax)
621
+ @extract_document_sentiment = args[:extract_document_sentiment] if args.key?(:extract_document_sentiment)
622
+ @extract_entities = args[:extract_entities] if args.key?(:extract_entities)
629
623
  end
630
624
  end
631
625
 
632
- # The sentiment analysis request message.
633
- class AnalyzeSentimentRequest
626
+ # ################################################################ #
627
+ # Represents the input to API methods.
628
+ class Document
634
629
  include Google::Apis::Core::Hashable
635
630
 
636
- # The encoding type used by the API to calculate sentence offsets.
637
- # Corresponds to the JSON property `encodingType`
631
+ # Required. If the type is not set or is `TYPE_UNSPECIFIED`,
632
+ # returns an `INVALID_ARGUMENT` error.
633
+ # Corresponds to the JSON property `type`
638
634
  # @return [String]
639
- attr_accessor :encoding_type
635
+ attr_accessor :type
640
636
 
641
- # ################################################################ #
642
- # Represents the input to API methods.
643
- # Corresponds to the JSON property `document`
644
- # @return [Google::Apis::LanguageV1::Document]
645
- attr_accessor :document
637
+ # The content of the input in string format.
638
+ # Corresponds to the JSON property `content`
639
+ # @return [String]
640
+ attr_accessor :content
641
+
642
+ # The Google Cloud Storage URI where the file content is located.
643
+ # This URI must be of the form: gs://bucket_name/object_name. For more
644
+ # details, see https://cloud.google.com/storage/docs/reference-uris.
645
+ # NOTE: Cloud Storage object versioning is not supported.
646
+ # Corresponds to the JSON property `gcsContentUri`
647
+ # @return [String]
648
+ attr_accessor :gcs_content_uri
649
+
650
+ # The language of the document (if not specified, the language is
651
+ # automatically detected). Both ISO and BCP-47 language codes are
652
+ # accepted.<br>
653
+ # [Language Support](/natural-language/docs/languages)
654
+ # lists currently supported languages for each API method.
655
+ # If the language (either specified by the caller or automatically detected)
656
+ # is not supported by the called API method, an `INVALID_ARGUMENT` error
657
+ # is returned.
658
+ # Corresponds to the JSON property `language`
659
+ # @return [String]
660
+ attr_accessor :language
646
661
 
647
662
  def initialize(**args)
648
663
  update!(**args)
@@ -650,30 +665,27 @@ module Google
650
665
 
651
666
  # Update properties of this object
652
667
  def update!(**args)
653
- @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
654
- @document = args[:document] if args.key?(:document)
668
+ @type = args[:type] if args.key?(:type)
669
+ @content = args[:content] if args.key?(:content)
670
+ @gcs_content_uri = args[:gcs_content_uri] if args.key?(:gcs_content_uri)
671
+ @language = args[:language] if args.key?(:language)
655
672
  end
656
673
  end
657
674
 
658
- # Represents dependency parse tree information for a token. (For more
659
- # information on dependency labels, see
660
- # http://www.aclweb.org/anthology/P13-2017
661
- class DependencyEdge
675
+ # Represents a sentence in the input document.
676
+ class Sentence
662
677
  include Google::Apis::Core::Hashable
663
678
 
664
- # The parse label for the token.
665
- # Corresponds to the JSON property `label`
666
- # @return [String]
667
- attr_accessor :label
679
+ # Represents an output piece of text.
680
+ # Corresponds to the JSON property `text`
681
+ # @return [Google::Apis::LanguageV1::TextSpan]
682
+ attr_accessor :text
668
683
 
669
- # Represents the head of this token in the dependency tree.
670
- # This is the index of the token which has an arc going to this token.
671
- # The index is the position of the token in the array of tokens returned
672
- # by the API method. If this token is a root token, then the
673
- # `head_token_index` is its own index.
674
- # Corresponds to the JSON property `headTokenIndex`
675
- # @return [Fixnum]
676
- attr_accessor :head_token_index
684
+ # Represents the feeling associated with the entire text or entities in
685
+ # the text.
686
+ # Corresponds to the JSON property `sentiment`
687
+ # @return [Google::Apis::LanguageV1::Sentiment]
688
+ attr_accessor :sentiment
677
689
 
678
690
  def initialize(**args)
679
691
  update!(**args)
@@ -681,25 +693,25 @@ module Google
681
693
 
682
694
  # Update properties of this object
683
695
  def update!(**args)
684
- @label = args[:label] if args.key?(:label)
685
- @head_token_index = args[:head_token_index] if args.key?(:head_token_index)
696
+ @text = args[:text] if args.key?(:text)
697
+ @sentiment = args[:sentiment] if args.key?(:sentiment)
686
698
  end
687
699
  end
688
700
 
689
- # Represents an output piece of text.
690
- class TextSpan
701
+ # The entity analysis request message.
702
+ class AnalyzeEntitiesRequest
691
703
  include Google::Apis::Core::Hashable
692
704
 
693
- # The API calculates the beginning offset of the content in the original
694
- # document according to the EncodingType specified in the API request.
695
- # Corresponds to the JSON property `beginOffset`
696
- # @return [Fixnum]
697
- attr_accessor :begin_offset
705
+ # ################################################################ #
706
+ # Represents the input to API methods.
707
+ # Corresponds to the JSON property `document`
708
+ # @return [Google::Apis::LanguageV1::Document]
709
+ attr_accessor :document
698
710
 
699
- # The content of the output text.
700
- # Corresponds to the JSON property `content`
711
+ # The encoding type used by the API to calculate offsets.
712
+ # Corresponds to the JSON property `encodingType`
701
713
  # @return [String]
702
- attr_accessor :content
714
+ attr_accessor :encoding_type
703
715
 
704
716
  def initialize(**args)
705
717
  update!(**args)
@@ -707,38 +719,28 @@ module Google
707
719
 
708
720
  # Update properties of this object
709
721
  def update!(**args)
710
- @begin_offset = args[:begin_offset] if args.key?(:begin_offset)
711
- @content = args[:content] if args.key?(:content)
722
+ @document = args[:document] if args.key?(:document)
723
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
712
724
  end
713
725
  end
714
726
 
715
- # Represents the smallest syntactic building block of the text.
716
- class Token
727
+ # Represents the feeling associated with the entire text or entities in
728
+ # the text.
729
+ class Sentiment
717
730
  include Google::Apis::Core::Hashable
718
731
 
719
- # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
720
- # Corresponds to the JSON property `lemma`
721
- # @return [String]
722
- attr_accessor :lemma
723
-
724
- # Represents part of speech information for a token. Parts of speech
725
- # are as defined in
726
- # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
727
- # Corresponds to the JSON property `partOfSpeech`
728
- # @return [Google::Apis::LanguageV1::PartOfSpeech]
729
- attr_accessor :part_of_speech
730
-
731
- # Represents an output piece of text.
732
- # Corresponds to the JSON property `text`
733
- # @return [Google::Apis::LanguageV1::TextSpan]
734
- attr_accessor :text
732
+ # A non-negative number in the [0, +inf) range, which represents
733
+ # the absolute magnitude of sentiment regardless of score (positive or
734
+ # negative).
735
+ # Corresponds to the JSON property `magnitude`
736
+ # @return [Float]
737
+ attr_accessor :magnitude
735
738
 
736
- # Represents dependency parse tree information for a token. (For more
737
- # information on dependency labels, see
738
- # http://www.aclweb.org/anthology/P13-2017
739
- # Corresponds to the JSON property `dependencyEdge`
740
- # @return [Google::Apis::LanguageV1::DependencyEdge]
741
- attr_accessor :dependency_edge
739
+ # Sentiment score between -1.0 (negative sentiment) and 1.0
740
+ # (positive sentiment).
741
+ # Corresponds to the JSON property `score`
742
+ # @return [Float]
743
+ attr_accessor :score
742
744
 
743
745
  def initialize(**args)
744
746
  update!(**args)
@@ -746,10 +748,8 @@ module Google
746
748
 
747
749
  # Update properties of this object
748
750
  def update!(**args)
749
- @lemma = args[:lemma] if args.key?(:lemma)
750
- @part_of_speech = args[:part_of_speech] if args.key?(:part_of_speech)
751
- @text = args[:text] if args.key?(:text)
752
- @dependency_edge = args[:dependency_edge] if args.key?(:dependency_edge)
751
+ @magnitude = args[:magnitude] if args.key?(:magnitude)
752
+ @score = args[:score] if args.key?(:score)
753
753
  end
754
754
  end
755
755
  end