google-apis-language_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0a598dc1a55fb0b5893d925febffaec34620af6fc055e0b049d7d2855226c40b
4
+ data.tar.gz: 7f7a70bd0acc42aa0e053a9ce70bb38a12b4635aaa6b0f8133b63a9b700243c3
5
+ SHA512:
6
+ metadata.gz: 4b0296752285878cdd07b774d4227d751406df6819c37afa4a9f6eda513d4838871f2b630d5111ffdcbb0b1c99c92ebe71bb21ef67e53cca8314964d7eebc029
7
+ data.tar.gz: 946f47147d3c446530c3e35a6c5b4bdabe615b61428fb853355d9b818f860b8d0c8f5955b232209fb3caffc1e837b6c6c1e6c3206f36ba7e5983315a2d936872
@@ -0,0 +1,13 @@
1
+ --hide-void-return
2
+ --no-private
3
+ --verbose
4
+ --title=google-apis-language_v1
5
+ --markup-provider=redcarpet
6
+ --markup=markdown
7
+ --main OVERVIEW.md
8
+ lib/google/apis/language_v1/*.rb
9
+ lib/google/apis/language_v1.rb
10
+ -
11
+ OVERVIEW.md
12
+ CHANGELOG.md
13
+ LICENSE.md
@@ -0,0 +1,7 @@
1
+ # Release history for google-apis-language_v1
2
+
3
+ ### v0.1.0 (2021-01-07)
4
+
5
+ * Regenerated using generator version 0.1.1
6
+ * Regenerated from discovery document revision 20200801
7
+
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,96 @@
1
+ # Simple REST client for version V1 of the Cloud Natural Language API
2
+
3
+ This is a simple client library for version V1 of the Cloud Natural Language API. It provides:
4
+
5
+ * A client object that connects to the HTTP/JSON REST endpoint for the service.
6
+ * Ruby objects for data structures related to the service.
7
+ * Integration with the googleauth gem for authentication using OAuth, API keys, and service accounts.
8
+ * Control of retry, pagination, and timeouts.
9
+
10
+ Note that although this client library is supported and will continue to be updated to track changes to the service, it is otherwise considered complete and not under active development. Many Google services, especially Google Cloud Platform services, may provide a more modern client that is under more active development and improvement. See the section below titled *Which client should I use?* for more information.
11
+
12
+ ## Getting started
13
+
14
+ ### Before you begin
15
+
16
+ There are a few setup steps you need to complete before you can use this library:
17
+
18
+ 1. If you don't already have a Google account, [sign up](https://www.google.com/accounts).
19
+ 2. If you have never created a Google APIs Console project, read about [Managing Projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects) and create a project in the [Google API Console](https://console.cloud.google.com/).
20
+ 3. Most APIs need to be enabled for your project. [Enable it](https://console.cloud.google.com/apis/library/language.googleapis.com) in the console.
21
+
22
+ ### Installation
23
+
24
+ Add this line to your application's Gemfile:
25
+
26
+ ```ruby
27
+ gem 'google-apis-language_v1', '~> 0.1'
28
+ ```
29
+
30
+ And then execute:
31
+
32
+ ```
33
+ $ bundle
34
+ ```
35
+
36
+ Or install it yourself as:
37
+
38
+ ```
39
+ $ gem install google-apis-language_v1
40
+ ```
41
+
42
+ ### Creating a client object
43
+
44
+ Once the gem is installed, you can load the client code and instantiate a client.
45
+
46
+ ```ruby
47
+ # Load the client
48
+ require "google/apis/language_v1"
49
+
50
+ # Create a client object
51
+ client = Google::Apis::LanguageV1::CloudNaturalLanguageService.new
52
+
53
+ # Authenticate calls
54
+ client.authentication = # ... use the googleauth gem to create credentials
55
+ ```
56
+
57
+ See the class reference docs for information on the methods you can call from a client.
58
+
59
+ ## Documentation
60
+
61
+ More detailed descriptions of the Google simple REST clients are available in two documents.
62
+
63
+ * The [Usage Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/usage-guide.md) discusses how to make API calls, how to use the provided data structures, and how to work the various features of the client library, including media upload and download, error handling, retries, pagination, and logging.
64
+ * The [Auth Guide](https://github.com/googleapis/google-api-ruby-client/blob/master/docs/auth-guide.md) discusses authentication in the client libraries, including API keys, OAuth 2.0, service accounts, and environment variables.
65
+
66
+ (Note: the above documents are written for the simple REST clients in general, and their examples may not reflect the Language service in particular.)
67
+
68
+ For reference information on specific calls in the Cloud Natural Language API, see the {Google::Apis::LanguageV1::CloudNaturalLanguageService class reference docs}.
69
+
70
+ ## Which client should I use?
71
+
72
+ Google provides two types of Ruby API client libraries: **simple REST clients** and **modern clients**.
73
+
74
+ This library, `google-apis-language_v1`, is a simple REST client. You can identify these clients by their gem names, which are always in the form `google-apis-<servicename>_<serviceversion>`. The simple REST clients connect to HTTP/JSON REST endpoints and are automatically generated from service discovery documents. They support most API functionality, but their class interfaces are sometimes awkward.
75
+
76
+ Modern clients are produced by a modern code generator, sometimes combined with hand-crafted functionality. Most modern clients connect to high-performance gRPC endpoints, although a few are backed by REST services. Modern clients are available for many Google services, especially Google Cloud Platform services, but do not yet support all the services covered by the simple clients.
77
+
78
+ Gem names for modern clients are often of the form `google-cloud-<service_name>`. (For example, [google-cloud-pubsub](https://rubygems.org/gems/google-cloud-pubsub).) Note that most modern clients also have corresponding "versioned" gems with names like `google-cloud-<service_name>-<version>`. (For example, [google-cloud-pubsub-v1](https://rubygems.org/gems/google-cloud-pubsub-v1).) The "versioned" gems can be used directly, but often provide lower-level interfaces. In most cases, the main gem is recommended.
79
+
80
+ **For most users, we recommend the modern client, if one is available.** Compared with simple clients, modern clients are generally much easier to use and more Ruby-like, support more advanced features such as streaming and long-running operations, and often provide much better performance. You may consider using a simple client instead, if a modern client is not yet available for the service you want to use, or if you are not able to use gRPC on your infrastructure.
81
+
82
+ The [product documentation](https://cloud.google.com/natural-language/) may provide guidance regarding the preferred client library to use.
83
+
84
+ ## Supported Ruby versions
85
+
86
+ This library is supported on Ruby 2.5+.
87
+
88
+ Google provides official support for Ruby versions that are actively supported by Ruby Core -- that is, Ruby versions that are either in normal maintenance or in security maintenance, and not end of life. Currently, this means Ruby 2.5 and later. Older versions of Ruby _may_ still work, but are unsupported and not recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby support schedule.
89
+
90
+ ## License
91
+
92
+ This library is licensed under Apache 2.0. Full license text is available in the {file:LICENSE.md LICENSE}.
93
+
94
+ ## Support
95
+
96
+ Please [report bugs at the project on Github](https://github.com/google/google-api-ruby-client/issues). Don't hesitate to [ask questions](http://stackoverflow.com/questions/tagged/google-api-ruby-client) about the client or APIs on [StackOverflow](http://stackoverflow.com).
@@ -0,0 +1,15 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require "google/apis/language_v1"
@@ -0,0 +1,41 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/language_v1/service.rb'
16
+ require 'google/apis/language_v1/classes.rb'
17
+ require 'google/apis/language_v1/representations.rb'
18
+ require 'google/apis/language_v1/gem_version.rb'
19
+
20
+ module Google
21
+ module Apis
22
+ # Cloud Natural Language API
23
+ #
24
+ # Provides natural language understanding technologies, such as sentiment
25
+ # analysis, entity recognition, entity sentiment analysis, and other text
26
+ # annotations, to developers.
27
+ #
28
+ # @see https://cloud.google.com/natural-language/
29
+ module LanguageV1
30
+ # Version of the Cloud Natural Language API this client connects to.
31
+ # This is NOT the gem version.
32
+ VERSION = 'V1'
33
+
34
+ # Apply machine learning models to reveal the structure and meaning of text
35
+ AUTH_CLOUD_LANGUAGE = 'https://www.googleapis.com/auth/cloud-language'
36
+
37
+ # View and manage your data across Google Cloud Platform services
38
+ AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,861 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module LanguageV1
24
+
25
+ # The entity analysis request message.
26
+ class AnalyzeEntitiesRequest
27
+ include Google::Apis::Core::Hashable
28
+
29
+ # ################################################################ # Represents
30
+ # the input to API methods.
31
+ # Corresponds to the JSON property `document`
32
+ # @return [Google::Apis::LanguageV1::Document]
33
+ attr_accessor :document
34
+
35
+ # The encoding type used by the API to calculate offsets.
36
+ # Corresponds to the JSON property `encodingType`
37
+ # @return [String]
38
+ attr_accessor :encoding_type
39
+
40
+ def initialize(**args)
41
+ update!(**args)
42
+ end
43
+
44
+ # Update properties of this object
45
+ def update!(**args)
46
+ @document = args[:document] if args.key?(:document)
47
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
48
+ end
49
+ end
50
+
51
+ # The entity analysis response message.
52
+ class AnalyzeEntitiesResponse
53
+ include Google::Apis::Core::Hashable
54
+
55
+ # The recognized entities in the input document.
56
+ # Corresponds to the JSON property `entities`
57
+ # @return [Array<Google::Apis::LanguageV1::Entity>]
58
+ attr_accessor :entities
59
+
60
+ # The language of the text, which will be the same as the language specified in
61
+ # the request or, if not specified, the automatically-detected language. See
62
+ # Document.language field for more details.
63
+ # Corresponds to the JSON property `language`
64
+ # @return [String]
65
+ attr_accessor :language
66
+
67
+ def initialize(**args)
68
+ update!(**args)
69
+ end
70
+
71
+ # Update properties of this object
72
+ def update!(**args)
73
+ @entities = args[:entities] if args.key?(:entities)
74
+ @language = args[:language] if args.key?(:language)
75
+ end
76
+ end
77
+
78
+ # The entity-level sentiment analysis request message.
79
+ class AnalyzeEntitySentimentRequest
80
+ include Google::Apis::Core::Hashable
81
+
82
+ # ################################################################ # Represents
83
+ # the input to API methods.
84
+ # Corresponds to the JSON property `document`
85
+ # @return [Google::Apis::LanguageV1::Document]
86
+ attr_accessor :document
87
+
88
+ # The encoding type used by the API to calculate offsets.
89
+ # Corresponds to the JSON property `encodingType`
90
+ # @return [String]
91
+ attr_accessor :encoding_type
92
+
93
+ def initialize(**args)
94
+ update!(**args)
95
+ end
96
+
97
+ # Update properties of this object
98
+ def update!(**args)
99
+ @document = args[:document] if args.key?(:document)
100
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
101
+ end
102
+ end
103
+
104
+ # The entity-level sentiment analysis response message.
105
+ class AnalyzeEntitySentimentResponse
106
+ include Google::Apis::Core::Hashable
107
+
108
+ # The recognized entities in the input document with associated sentiments.
109
+ # Corresponds to the JSON property `entities`
110
+ # @return [Array<Google::Apis::LanguageV1::Entity>]
111
+ attr_accessor :entities
112
+
113
+ # The language of the text, which will be the same as the language specified in
114
+ # the request or, if not specified, the automatically-detected language. See
115
+ # Document.language field for more details.
116
+ # Corresponds to the JSON property `language`
117
+ # @return [String]
118
+ attr_accessor :language
119
+
120
+ def initialize(**args)
121
+ update!(**args)
122
+ end
123
+
124
+ # Update properties of this object
125
+ def update!(**args)
126
+ @entities = args[:entities] if args.key?(:entities)
127
+ @language = args[:language] if args.key?(:language)
128
+ end
129
+ end
130
+
131
+ # The sentiment analysis request message.
132
+ class AnalyzeSentimentRequest
133
+ include Google::Apis::Core::Hashable
134
+
135
+ # ################################################################ # Represents
136
+ # the input to API methods.
137
+ # Corresponds to the JSON property `document`
138
+ # @return [Google::Apis::LanguageV1::Document]
139
+ attr_accessor :document
140
+
141
+ # The encoding type used by the API to calculate sentence offsets.
142
+ # Corresponds to the JSON property `encodingType`
143
+ # @return [String]
144
+ attr_accessor :encoding_type
145
+
146
+ def initialize(**args)
147
+ update!(**args)
148
+ end
149
+
150
+ # Update properties of this object
151
+ def update!(**args)
152
+ @document = args[:document] if args.key?(:document)
153
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
154
+ end
155
+ end
156
+
157
+ # The sentiment analysis response message.
158
+ class AnalyzeSentimentResponse
159
+ include Google::Apis::Core::Hashable
160
+
161
+ # Represents the feeling associated with the entire text or entities in the text.
162
+ # Corresponds to the JSON property `documentSentiment`
163
+ # @return [Google::Apis::LanguageV1::Sentiment]
164
+ attr_accessor :document_sentiment
165
+
166
+ # The language of the text, which will be the same as the language specified in
167
+ # the request or, if not specified, the automatically-detected language. See
168
+ # Document.language field for more details.
169
+ # Corresponds to the JSON property `language`
170
+ # @return [String]
171
+ attr_accessor :language
172
+
173
+ # The sentiment for all the sentences in the document.
174
+ # Corresponds to the JSON property `sentences`
175
+ # @return [Array<Google::Apis::LanguageV1::Sentence>]
176
+ attr_accessor :sentences
177
+
178
+ def initialize(**args)
179
+ update!(**args)
180
+ end
181
+
182
+ # Update properties of this object
183
+ def update!(**args)
184
+ @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
185
+ @language = args[:language] if args.key?(:language)
186
+ @sentences = args[:sentences] if args.key?(:sentences)
187
+ end
188
+ end
189
+
190
+ # The syntax analysis request message.
191
+ class AnalyzeSyntaxRequest
192
+ include Google::Apis::Core::Hashable
193
+
194
+ # ################################################################ # Represents
195
+ # the input to API methods.
196
+ # Corresponds to the JSON property `document`
197
+ # @return [Google::Apis::LanguageV1::Document]
198
+ attr_accessor :document
199
+
200
+ # The encoding type used by the API to calculate offsets.
201
+ # Corresponds to the JSON property `encodingType`
202
+ # @return [String]
203
+ attr_accessor :encoding_type
204
+
205
+ def initialize(**args)
206
+ update!(**args)
207
+ end
208
+
209
+ # Update properties of this object
210
+ def update!(**args)
211
+ @document = args[:document] if args.key?(:document)
212
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
213
+ end
214
+ end
215
+
216
+ # The syntax analysis response message.
217
+ class AnalyzeSyntaxResponse
218
+ include Google::Apis::Core::Hashable
219
+
220
+ # The language of the text, which will be the same as the language specified in
221
+ # the request or, if not specified, the automatically-detected language. See
222
+ # Document.language field for more details.
223
+ # Corresponds to the JSON property `language`
224
+ # @return [String]
225
+ attr_accessor :language
226
+
227
+ # Sentences in the input document.
228
+ # Corresponds to the JSON property `sentences`
229
+ # @return [Array<Google::Apis::LanguageV1::Sentence>]
230
+ attr_accessor :sentences
231
+
232
+ # Tokens, along with their syntactic information, in the input document.
233
+ # Corresponds to the JSON property `tokens`
234
+ # @return [Array<Google::Apis::LanguageV1::Token>]
235
+ attr_accessor :tokens
236
+
237
+ def initialize(**args)
238
+ update!(**args)
239
+ end
240
+
241
+ # Update properties of this object
242
+ def update!(**args)
243
+ @language = args[:language] if args.key?(:language)
244
+ @sentences = args[:sentences] if args.key?(:sentences)
245
+ @tokens = args[:tokens] if args.key?(:tokens)
246
+ end
247
+ end
248
+
249
+ # The request message for the text annotation API, which can perform multiple
250
+ # analysis types (sentiment, entities, and syntax) in one call.
251
+ class AnnotateTextRequest
252
+ include Google::Apis::Core::Hashable
253
+
254
+ # ################################################################ # Represents
255
+ # the input to API methods.
256
+ # Corresponds to the JSON property `document`
257
+ # @return [Google::Apis::LanguageV1::Document]
258
+ attr_accessor :document
259
+
260
+ # The encoding type used by the API to calculate offsets.
261
+ # Corresponds to the JSON property `encodingType`
262
+ # @return [String]
263
+ attr_accessor :encoding_type
264
+
265
+ # All available features for sentiment, syntax, and semantic analysis. Setting
266
+ # each one to true will enable that specific analysis for the input.
267
+ # Corresponds to the JSON property `features`
268
+ # @return [Google::Apis::LanguageV1::Features]
269
+ attr_accessor :features
270
+
271
+ def initialize(**args)
272
+ update!(**args)
273
+ end
274
+
275
+ # Update properties of this object
276
+ def update!(**args)
277
+ @document = args[:document] if args.key?(:document)
278
+ @encoding_type = args[:encoding_type] if args.key?(:encoding_type)
279
+ @features = args[:features] if args.key?(:features)
280
+ end
281
+ end
282
+
283
+ # The text annotations response message.
284
+ class AnnotateTextResponse
285
+ include Google::Apis::Core::Hashable
286
+
287
+ # Categories identified in the input document.
288
+ # Corresponds to the JSON property `categories`
289
+ # @return [Array<Google::Apis::LanguageV1::ClassificationCategory>]
290
+ attr_accessor :categories
291
+
292
+ # Represents the feeling associated with the entire text or entities in the text.
293
+ # Corresponds to the JSON property `documentSentiment`
294
+ # @return [Google::Apis::LanguageV1::Sentiment]
295
+ attr_accessor :document_sentiment
296
+
297
+ # Entities, along with their semantic information, in the input document.
298
+ # Populated if the user enables AnnotateTextRequest.Features.extract_entities.
299
+ # Corresponds to the JSON property `entities`
300
+ # @return [Array<Google::Apis::LanguageV1::Entity>]
301
+ attr_accessor :entities
302
+
303
+ # The language of the text, which will be the same as the language specified in
304
+ # the request or, if not specified, the automatically-detected language. See
305
+ # Document.language field for more details.
306
+ # Corresponds to the JSON property `language`
307
+ # @return [String]
308
+ attr_accessor :language
309
+
310
+ # Sentences in the input document. Populated if the user enables
311
+ # AnnotateTextRequest.Features.extract_syntax.
312
+ # Corresponds to the JSON property `sentences`
313
+ # @return [Array<Google::Apis::LanguageV1::Sentence>]
314
+ attr_accessor :sentences
315
+
316
+ # Tokens, along with their syntactic information, in the input document.
317
+ # Populated if the user enables AnnotateTextRequest.Features.extract_syntax.
318
+ # Corresponds to the JSON property `tokens`
319
+ # @return [Array<Google::Apis::LanguageV1::Token>]
320
+ attr_accessor :tokens
321
+
322
+ def initialize(**args)
323
+ update!(**args)
324
+ end
325
+
326
+ # Update properties of this object
327
+ def update!(**args)
328
+ @categories = args[:categories] if args.key?(:categories)
329
+ @document_sentiment = args[:document_sentiment] if args.key?(:document_sentiment)
330
+ @entities = args[:entities] if args.key?(:entities)
331
+ @language = args[:language] if args.key?(:language)
332
+ @sentences = args[:sentences] if args.key?(:sentences)
333
+ @tokens = args[:tokens] if args.key?(:tokens)
334
+ end
335
+ end
336
+
337
+ # Represents a category returned from the text classifier.
338
+ class ClassificationCategory
339
+ include Google::Apis::Core::Hashable
340
+
341
+ # The classifier's confidence of the category. Number represents how certain the
342
+ # classifier is that this category represents the given text.
343
+ # Corresponds to the JSON property `confidence`
344
+ # @return [Float]
345
+ attr_accessor :confidence
346
+
347
+ # The name of the category representing the document, from the [predefined
348
+ # taxonomy](https://cloud.google.com/natural-language/docs/categories).
349
+ # Corresponds to the JSON property `name`
350
+ # @return [String]
351
+ attr_accessor :name
352
+
353
+ def initialize(**args)
354
+ update!(**args)
355
+ end
356
+
357
+ # Update properties of this object
358
+ def update!(**args)
359
+ @confidence = args[:confidence] if args.key?(:confidence)
360
+ @name = args[:name] if args.key?(:name)
361
+ end
362
+ end
363
+
364
+ # The document classification request message.
365
+ class ClassifyTextRequest
366
+ include Google::Apis::Core::Hashable
367
+
368
+ # ################################################################ # Represents
369
+ # the input to API methods.
370
+ # Corresponds to the JSON property `document`
371
+ # @return [Google::Apis::LanguageV1::Document]
372
+ attr_accessor :document
373
+
374
+ def initialize(**args)
375
+ update!(**args)
376
+ end
377
+
378
+ # Update properties of this object
379
+ def update!(**args)
380
+ @document = args[:document] if args.key?(:document)
381
+ end
382
+ end
383
+
384
+ # The document classification response message.
385
+ class ClassifyTextResponse
386
+ include Google::Apis::Core::Hashable
387
+
388
+ # Categories representing the input document.
389
+ # Corresponds to the JSON property `categories`
390
+ # @return [Array<Google::Apis::LanguageV1::ClassificationCategory>]
391
+ attr_accessor :categories
392
+
393
+ def initialize(**args)
394
+ update!(**args)
395
+ end
396
+
397
+ # Update properties of this object
398
+ def update!(**args)
399
+ @categories = args[:categories] if args.key?(:categories)
400
+ end
401
+ end
402
+
403
+ # Represents dependency parse tree information for a token. (For more
404
+ # information on dependency labels, see http://www.aclweb.org/anthology/P13-2017
405
+ class DependencyEdge
406
+ include Google::Apis::Core::Hashable
407
+
408
+ # Represents the head of this token in the dependency tree. This is the index of
409
+ # the token which has an arc going to this token. The index is the position of
410
+ # the token in the array of tokens returned by the API method. If this token is
411
+ # a root token, then the `head_token_index` is its own index.
412
+ # Corresponds to the JSON property `headTokenIndex`
413
+ # @return [Fixnum]
414
+ attr_accessor :head_token_index
415
+
416
+ # The parse label for the token.
417
+ # Corresponds to the JSON property `label`
418
+ # @return [String]
419
+ attr_accessor :label
420
+
421
+ def initialize(**args)
422
+ update!(**args)
423
+ end
424
+
425
+ # Update properties of this object
426
+ def update!(**args)
427
+ @head_token_index = args[:head_token_index] if args.key?(:head_token_index)
428
+ @label = args[:label] if args.key?(:label)
429
+ end
430
+ end
431
+
432
+ # ################################################################ # Represents
433
+ # the input to API methods.
434
+ class Document
435
+ include Google::Apis::Core::Hashable
436
+
437
+ # The content of the input in string format. Cloud audit logging exempt since it
438
+ # is based on user data.
439
+ # Corresponds to the JSON property `content`
440
+ # @return [String]
441
+ attr_accessor :content
442
+
443
+ # The Google Cloud Storage URI where the file content is located. This URI must
444
+ # be of the form: gs://bucket_name/object_name. For more details, see https://
445
+ # cloud.google.com/storage/docs/reference-uris. NOTE: Cloud Storage object
446
+ # versioning is not supported.
447
+ # Corresponds to the JSON property `gcsContentUri`
448
+ # @return [String]
449
+ attr_accessor :gcs_content_uri
450
+
451
+ # The language of the document (if not specified, the language is automatically
452
+ # detected). Both ISO and BCP-47 language codes are accepted. [Language Support](
453
+ # https://cloud.google.com/natural-language/docs/languages) lists currently
454
+ # supported languages for each API method. If the language (either specified by
455
+ # the caller or automatically detected) is not supported by the called API
456
+ # method, an `INVALID_ARGUMENT` error is returned.
457
+ # Corresponds to the JSON property `language`
458
+ # @return [String]
459
+ attr_accessor :language
460
+
461
+ # Required. If the type is not set or is `TYPE_UNSPECIFIED`, returns an `
462
+ # INVALID_ARGUMENT` error.
463
+ # Corresponds to the JSON property `type`
464
+ # @return [String]
465
+ attr_accessor :type
466
+
467
+ def initialize(**args)
468
+ update!(**args)
469
+ end
470
+
471
+ # Update properties of this object
472
+ def update!(**args)
473
+ @content = args[:content] if args.key?(:content)
474
+ @gcs_content_uri = args[:gcs_content_uri] if args.key?(:gcs_content_uri)
475
+ @language = args[:language] if args.key?(:language)
476
+ @type = args[:type] if args.key?(:type)
477
+ end
478
+ end
479
+
480
+ # Represents a phrase in the text that is a known entity, such as a person, an
481
+ # organization, or location. The API associates information, such as salience
482
+ # and mentions, with entities.
483
+ class Entity
484
+ include Google::Apis::Core::Hashable
485
+
486
+ # The mentions of this entity in the input document. The API currently supports
487
+ # proper noun mentions.
488
+ # Corresponds to the JSON property `mentions`
489
+ # @return [Array<Google::Apis::LanguageV1::EntityMention>]
490
+ attr_accessor :mentions
491
+
492
+ # Metadata associated with the entity. For most entity types, the metadata is a
493
+ # Wikipedia URL (`wikipedia_url`) and Knowledge Graph MID (`mid`), if they are
494
+ # available. For the metadata associated with other entity types, see the Type
495
+ # table below.
496
+ # Corresponds to the JSON property `metadata`
497
+ # @return [Hash<String,String>]
498
+ attr_accessor :metadata
499
+
500
+ # The representative name for the entity.
501
+ # Corresponds to the JSON property `name`
502
+ # @return [String]
503
+ attr_accessor :name
504
+
505
+ # The salience score associated with the entity in the [0, 1.0] range. The
506
+ # salience score for an entity provides information about the importance or
507
+ # centrality of that entity to the entire document text. Scores closer to 0 are
508
+ # less salient, while scores closer to 1.0 are highly salient.
509
+ # Corresponds to the JSON property `salience`
510
+ # @return [Float]
511
+ attr_accessor :salience
512
+
513
+ # Represents the feeling associated with the entire text or entities in the text.
514
+ # Corresponds to the JSON property `sentiment`
515
+ # @return [Google::Apis::LanguageV1::Sentiment]
516
+ attr_accessor :sentiment
517
+
518
+ # The entity type.
519
+ # Corresponds to the JSON property `type`
520
+ # @return [String]
521
+ attr_accessor :type
522
+
523
+ def initialize(**args)
524
+ update!(**args)
525
+ end
526
+
527
+ # Update properties of this object
528
+ def update!(**args)
529
+ @mentions = args[:mentions] if args.key?(:mentions)
530
+ @metadata = args[:metadata] if args.key?(:metadata)
531
+ @name = args[:name] if args.key?(:name)
532
+ @salience = args[:salience] if args.key?(:salience)
533
+ @sentiment = args[:sentiment] if args.key?(:sentiment)
534
+ @type = args[:type] if args.key?(:type)
535
+ end
536
+ end
537
+
538
+ # Represents a mention for an entity in the text. Currently, proper noun
539
+ # mentions are supported.
540
+ class EntityMention
541
+ include Google::Apis::Core::Hashable
542
+
543
+ # Represents the feeling associated with the entire text or entities in the text.
544
+ # Corresponds to the JSON property `sentiment`
545
+ # @return [Google::Apis::LanguageV1::Sentiment]
546
+ attr_accessor :sentiment
547
+
548
+ # Represents an output piece of text.
549
+ # Corresponds to the JSON property `text`
550
+ # @return [Google::Apis::LanguageV1::TextSpan]
551
+ attr_accessor :text
552
+
553
+ # The type of the entity mention.
554
+ # Corresponds to the JSON property `type`
555
+ # @return [String]
556
+ attr_accessor :type
557
+
558
+ def initialize(**args)
559
+ update!(**args)
560
+ end
561
+
562
+ # Update properties of this object
563
+ def update!(**args)
564
+ @sentiment = args[:sentiment] if args.key?(:sentiment)
565
+ @text = args[:text] if args.key?(:text)
566
+ @type = args[:type] if args.key?(:type)
567
+ end
568
+ end
569
+
570
+ # All available features for sentiment, syntax, and semantic analysis. Setting
571
+ # each one to true will enable that specific analysis for the input.
572
+ class Features
573
+ include Google::Apis::Core::Hashable
574
+
575
+ # Classify the full document into categories.
576
+ # Corresponds to the JSON property `classifyText`
577
+ # @return [Boolean]
578
+ attr_accessor :classify_text
579
+ alias_method :classify_text?, :classify_text
580
+
581
+ # Extract document-level sentiment.
582
+ # Corresponds to the JSON property `extractDocumentSentiment`
583
+ # @return [Boolean]
584
+ attr_accessor :extract_document_sentiment
585
+ alias_method :extract_document_sentiment?, :extract_document_sentiment
586
+
587
+ # Extract entities.
588
+ # Corresponds to the JSON property `extractEntities`
589
+ # @return [Boolean]
590
+ attr_accessor :extract_entities
591
+ alias_method :extract_entities?, :extract_entities
592
+
593
+ # Extract entities and their associated sentiment.
594
+ # Corresponds to the JSON property `extractEntitySentiment`
595
+ # @return [Boolean]
596
+ attr_accessor :extract_entity_sentiment
597
+ alias_method :extract_entity_sentiment?, :extract_entity_sentiment
598
+
599
+ # Extract syntax information.
600
+ # Corresponds to the JSON property `extractSyntax`
601
+ # @return [Boolean]
602
+ attr_accessor :extract_syntax
603
+ alias_method :extract_syntax?, :extract_syntax
604
+
605
+ def initialize(**args)
606
+ update!(**args)
607
+ end
608
+
609
+ # Update properties of this object
610
+ def update!(**args)
611
+ @classify_text = args[:classify_text] if args.key?(:classify_text)
612
+ @extract_document_sentiment = args[:extract_document_sentiment] if args.key?(:extract_document_sentiment)
613
+ @extract_entities = args[:extract_entities] if args.key?(:extract_entities)
614
+ @extract_entity_sentiment = args[:extract_entity_sentiment] if args.key?(:extract_entity_sentiment)
615
+ @extract_syntax = args[:extract_syntax] if args.key?(:extract_syntax)
616
+ end
617
+ end
618
+
619
+ # Represents part of speech information for a token. Parts of speech are as
620
+ # defined in http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
621
+ class PartOfSpeech
622
+ include Google::Apis::Core::Hashable
623
+
624
+ # The grammatical aspect.
625
+ # Corresponds to the JSON property `aspect`
626
+ # @return [String]
627
+ attr_accessor :aspect
628
+
629
+ # The grammatical case.
630
+ # Corresponds to the JSON property `case`
631
+ # @return [String]
632
+ attr_accessor :case
633
+
634
+ # The grammatical form.
635
+ # Corresponds to the JSON property `form`
636
+ # @return [String]
637
+ attr_accessor :form
638
+
639
+ # The grammatical gender.
640
+ # Corresponds to the JSON property `gender`
641
+ # @return [String]
642
+ attr_accessor :gender
643
+
644
+ # The grammatical mood.
645
+ # Corresponds to the JSON property `mood`
646
+ # @return [String]
647
+ attr_accessor :mood
648
+
649
+ # The grammatical number.
650
+ # Corresponds to the JSON property `number`
651
+ # @return [String]
652
+ attr_accessor :number
653
+
654
+ # The grammatical person.
655
+ # Corresponds to the JSON property `person`
656
+ # @return [String]
657
+ attr_accessor :person
658
+
659
+ # The grammatical properness.
660
+ # Corresponds to the JSON property `proper`
661
+ # @return [String]
662
+ attr_accessor :proper
663
+
664
+ # The grammatical reciprocity.
665
+ # Corresponds to the JSON property `reciprocity`
666
+ # @return [String]
667
+ attr_accessor :reciprocity
668
+
669
+ # The part of speech tag.
670
+ # Corresponds to the JSON property `tag`
671
+ # @return [String]
672
+ attr_accessor :tag
673
+
674
+ # The grammatical tense.
675
+ # Corresponds to the JSON property `tense`
676
+ # @return [String]
677
+ attr_accessor :tense
678
+
679
+ # The grammatical voice.
680
+ # Corresponds to the JSON property `voice`
681
+ # @return [String]
682
+ attr_accessor :voice
683
+
684
+ def initialize(**args)
685
+ update!(**args)
686
+ end
687
+
688
+ # Update properties of this object
689
+ def update!(**args)
690
+ @aspect = args[:aspect] if args.key?(:aspect)
691
+ @case = args[:case] if args.key?(:case)
692
+ @form = args[:form] if args.key?(:form)
693
+ @gender = args[:gender] if args.key?(:gender)
694
+ @mood = args[:mood] if args.key?(:mood)
695
+ @number = args[:number] if args.key?(:number)
696
+ @person = args[:person] if args.key?(:person)
697
+ @proper = args[:proper] if args.key?(:proper)
698
+ @reciprocity = args[:reciprocity] if args.key?(:reciprocity)
699
+ @tag = args[:tag] if args.key?(:tag)
700
+ @tense = args[:tense] if args.key?(:tense)
701
+ @voice = args[:voice] if args.key?(:voice)
702
+ end
703
+ end
704
+
705
+ # Represents a sentence in the input document.
706
+ class Sentence
707
+ include Google::Apis::Core::Hashable
708
+
709
+ # Represents the feeling associated with the entire text or entities in the text.
710
+ # Corresponds to the JSON property `sentiment`
711
+ # @return [Google::Apis::LanguageV1::Sentiment]
712
+ attr_accessor :sentiment
713
+
714
+ # Represents an output piece of text.
715
+ # Corresponds to the JSON property `text`
716
+ # @return [Google::Apis::LanguageV1::TextSpan]
717
+ attr_accessor :text
718
+
719
+ def initialize(**args)
720
+ update!(**args)
721
+ end
722
+
723
+ # Update properties of this object
724
+ def update!(**args)
725
+ @sentiment = args[:sentiment] if args.key?(:sentiment)
726
+ @text = args[:text] if args.key?(:text)
727
+ end
728
+ end
729
+
730
+ # Represents the feeling associated with the entire text or entities in the text.
731
+ class Sentiment
732
+ include Google::Apis::Core::Hashable
733
+
734
+ # A non-negative number in the [0, +inf) range, which represents the absolute
735
+ # magnitude of sentiment regardless of score (positive or negative).
736
+ # Corresponds to the JSON property `magnitude`
737
+ # @return [Float]
738
+ attr_accessor :magnitude
739
+
740
+ # Sentiment score between -1.0 (negative sentiment) and 1.0 (positive sentiment).
741
+ # Corresponds to the JSON property `score`
742
+ # @return [Float]
743
+ attr_accessor :score
744
+
745
+ def initialize(**args)
746
+ update!(**args)
747
+ end
748
+
749
+ # Update properties of this object
750
+ def update!(**args)
751
+ @magnitude = args[:magnitude] if args.key?(:magnitude)
752
+ @score = args[:score] if args.key?(:score)
753
+ end
754
+ end
755
+
756
+ # The `Status` type defines a logical error model that is suitable for different
757
+ # programming environments, including REST APIs and RPC APIs. It is used by [
758
+ # gRPC](https://github.com/grpc). Each `Status` message contains three pieces of
759
+ # data: error code, error message, and error details. You can find out more
760
+ # about this error model and how to work with it in the [API Design Guide](https:
761
+ # //cloud.google.com/apis/design/errors).
762
+ class Status
763
+ include Google::Apis::Core::Hashable
764
+
765
+ # The status code, which should be an enum value of google.rpc.Code.
766
+ # Corresponds to the JSON property `code`
767
+ # @return [Fixnum]
768
+ attr_accessor :code
769
+
770
+ # A list of messages that carry the error details. There is a common set of
771
+ # message types for APIs to use.
772
+ # Corresponds to the JSON property `details`
773
+ # @return [Array<Hash<String,Object>>]
774
+ attr_accessor :details
775
+
776
+ # A developer-facing error message, which should be in English. Any user-facing
777
+ # error message should be localized and sent in the google.rpc.Status.details
778
+ # field, or localized by the client.
779
+ # Corresponds to the JSON property `message`
780
+ # @return [String]
781
+ attr_accessor :message
782
+
783
+ def initialize(**args)
784
+ update!(**args)
785
+ end
786
+
787
+ # Update properties of this object
788
+ def update!(**args)
789
+ @code = args[:code] if args.key?(:code)
790
+ @details = args[:details] if args.key?(:details)
791
+ @message = args[:message] if args.key?(:message)
792
+ end
793
+ end
794
+
795
+ # Represents an output piece of text.
796
+ class TextSpan
797
+ include Google::Apis::Core::Hashable
798
+
799
+ # The API calculates the beginning offset of the content in the original
800
+ # document according to the EncodingType specified in the API request.
801
+ # Corresponds to the JSON property `beginOffset`
802
+ # @return [Fixnum]
803
+ attr_accessor :begin_offset
804
+
805
+ # The content of the output text.
806
+ # Corresponds to the JSON property `content`
807
+ # @return [String]
808
+ attr_accessor :content
809
+
810
+ def initialize(**args)
811
+ update!(**args)
812
+ end
813
+
814
+ # Update properties of this object
815
+ def update!(**args)
816
+ @begin_offset = args[:begin_offset] if args.key?(:begin_offset)
817
+ @content = args[:content] if args.key?(:content)
818
+ end
819
+ end
820
+
821
+ # Represents the smallest syntactic building block of the text.
822
+ class Token
823
+ include Google::Apis::Core::Hashable
824
+
825
+ # Represents dependency parse tree information for a token. (For more
826
+ # information on dependency labels, see http://www.aclweb.org/anthology/P13-2017
827
+ # Corresponds to the JSON property `dependencyEdge`
828
+ # @return [Google::Apis::LanguageV1::DependencyEdge]
829
+ attr_accessor :dependency_edge
830
+
831
+ # [Lemma](https://en.wikipedia.org/wiki/Lemma_%28morphology%29) of the token.
832
+ # Corresponds to the JSON property `lemma`
833
+ # @return [String]
834
+ attr_accessor :lemma
835
+
836
+ # Represents part of speech information for a token. Parts of speech are as
837
+ # defined in http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
838
+ # Corresponds to the JSON property `partOfSpeech`
839
+ # @return [Google::Apis::LanguageV1::PartOfSpeech]
840
+ attr_accessor :part_of_speech
841
+
842
+ # Represents an output piece of text.
843
+ # Corresponds to the JSON property `text`
844
+ # @return [Google::Apis::LanguageV1::TextSpan]
845
+ attr_accessor :text
846
+
847
+ def initialize(**args)
848
+ update!(**args)
849
+ end
850
+
851
+ # Update properties of this object
852
+ def update!(**args)
853
+ @dependency_edge = args[:dependency_edge] if args.key?(:dependency_edge)
854
+ @lemma = args[:lemma] if args.key?(:lemma)
855
+ @part_of_speech = args[:part_of_speech] if args.key?(:part_of_speech)
856
+ @text = args[:text] if args.key?(:text)
857
+ end
858
+ end
859
+ end
860
+ end
861
+ end