on develop help sign in
Generating new gogol-language library
375cbc1Brendan Hay
gogol-language/LICENSEnew file+367
@@ -0,0 +1,367 @@
1+Mozilla Public License Version 2.0
2+==================================
3+
4+1. Definitions
5+--------------
6+
7+1.1. "Contributor"
8+ means each individual or legal entity that creates, contributes to
9+ the creation of, or owns Covered Software.
10+
11+1.2. "Contributor Version"
12+ means the combination of the Contributions of others (if any) used
13+ by a Contributor and that particular Contributor's Contribution.
14+
15+1.3. "Contribution"
16+ means Covered Software of a particular Contributor.
17+
18+1.4. "Covered Software"
19+ means Source Code Form to which the initial Contributor has attached
20+ the notice in Exhibit A, the Executable Form of such Source Code
21+ Form, and Modifications of such Source Code Form, in each case
22+ including portions thereof.
23+
24+1.5. "Incompatible With Secondary Licenses"
25+ means
26+
27+ (a) that the initial Contributor has attached the notice described
28+ in Exhibit B to the Covered Software; or
29+
30+ (b) that the Covered Software was made available under the terms of
31+ version 1.1 or earlier of the License, but not also under the
32+ terms of a Secondary License.
33+
34+1.6. "Executable Form"
35+ means any form of the work other than Source Code Form.
36+
37+1.7. "Larger Work"
38+ means a work that combines Covered Software with other material, in
39+ a separate file or files, that is not Covered Software.
40+
41+1.8. "License"
42+ means this document.
43+
44+1.9. "Licensable"
45+ means having the right to grant, to the maximum extent possible,
46+ whether at the time of the initial grant or subsequently, any and
47+ all of the rights conveyed by this License.
48+
49+1.10. "Modifications"
50+ means any of the following:
51+
52+ (a) any file in Source Code Form that results from an addition to,
53+ deletion from, or modification of the contents of Covered
54+ Software; or
55+
56+ (b) any new file in Source Code Form that contains any Covered
57+ Software.
58+
59+1.11. "Patent Claims" of a Contributor
60+ means any patent claim(s), including without limitation, method,
61+ process, and apparatus claims, in any patent Licensable by such
62+ Contributor that would be infringed, but for the grant of the
63+ License, by the making, using, selling, offering for sale, having
64+ made, import, or transfer of either its Contributions or its
65+ Contributor Version.
66+
67+1.12. "Secondary License"
68+ means either the GNU General Public License, Version 2.0, the GNU
69+ Lesser General Public License, Version 2.1, the GNU Affero General
70+ Public License, Version 3.0, or any later versions of those
71+ licenses.
72+
73+1.13. "Source Code Form"
74+ means the form of the work preferred for making modifications.
75+
76+1.14. "You" (or "Your")
77+ means an individual or a legal entity exercising rights under this
78+ License. For legal entities, "You" includes any entity that
79+ controls, is controlled by, or is under common control with You. For
80+ purposes of this definition, "control" means (a) the power, direct
81+ or indirect, to cause the direction or management of such entity,
82+ whether by contract or otherwise, or (b) ownership of more than
83+ fifty percent (50%) of the outstanding shares or beneficial
84+ ownership of such entity.
85+
86+2. License Grants and Conditions
87+--------------------------------
88+
89+2.1. Grants
90+
91+Each Contributor hereby grants You a world-wide, royalty-free,
92+non-exclusive license:
93+
94+(a) under intellectual property rights (other than patent or trademark)
95+ Licensable by such Contributor to use, reproduce, make available,
96+ modify, display, perform, distribute, and otherwise exploit its
97+ Contributions, either on an unmodified basis, with Modifications, or
98+ as part of a Larger Work; and
99+
100+(b) under Patent Claims of such Contributor to make, use, sell, offer
101+ for sale, have made, import, and otherwise transfer either its
102+ Contributions or its Contributor Version.
103+
104+2.2. Effective Date
105+
106+The licenses granted in Section 2.1 with respect to any Contribution
107+become effective for each Contribution on the date the Contributor first
108+distributes such Contribution.
109+
110+2.3. Limitations on Grant Scope
111+
112+The licenses granted in this Section 2 are the only rights granted under
113+this License. No additional rights or licenses will be implied from the
114+distribution or licensing of Covered Software under this License.
115+Notwithstanding Section 2.1(b) above, no patent license is granted by a
116+Contributor:
117+
118+(a) for any code that a Contributor has removed from Covered Software;
119+ or
120+
121+(b) for infringements caused by: (i) Your and any other third party's
122+ modifications of Covered Software, or (ii) the combination of its
123+ Contributions with other software (except as part of its Contributor
124+ Version); or
125+
126+(c) under Patent Claims infringed by Covered Software in the absence of
127+ its Contributions.
128+
129+This License does not grant any rights in the trademarks, service marks,
130+or logos of any Contributor (except as may be necessary to comply with
131+the notice requirements in Section 3.4).
132+
133+2.4. Subsequent Licenses
134+
135+No Contributor makes additional grants as a result of Your choice to
136+distribute the Covered Software under a subsequent version of this
137+License (see Section 10.2) or under the terms of a Secondary License (if
138+permitted under the terms of Section 3.3).
139+
140+2.5. Representation
141+
142+Each Contributor represents that the Contributor believes its
143+Contributions are its original creation(s) or it has sufficient rights
144+to grant the rights to its Contributions conveyed by this License.
145+
146+2.6. Fair Use
147+
148+This License is not intended to limit any rights You have under
149+applicable copyright doctrines of fair use, fair dealing, or other
150+equivalents.
151+
152+2.7. Conditions
153+
154+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155+in Section 2.1.
156+
157+3. Responsibilities
158+-------------------
159+
160+3.1. Distribution of Source Form
161+
162+All distribution of Covered Software in Source Code Form, including any
163+Modifications that You create or to which You contribute, must be under
164+the terms of this License. You must inform recipients that the Source
165+Code Form of the Covered Software is governed by the terms of this
166+License, and how they can obtain a copy of this License. You may not
167+attempt to alter or restrict the recipients' rights in the Source Code
168+Form.
169+
170+3.2. Distribution of Executable Form
171+
172+If You distribute Covered Software in Executable Form then:
173+
174+(a) such Covered Software must also be made available in Source Code
175+ Form, as described in Section 3.1, and You must inform recipients of
176+ the Executable Form how they can obtain a copy of such Source Code
177+ Form by reasonable means in a timely manner, at a charge no more
178+ than the cost of distribution to the recipient; and
179+
180+(b) You may distribute such Executable Form under the terms of this
181+ License, or sublicense it under different terms, provided that the
182+ license for the Executable Form does not attempt to limit or alter
183+ the recipients' rights in the Source Code Form under this License.
184+
185+3.3. Distribution of a Larger Work
186+
187+You may create and distribute a Larger Work under terms of Your choice,
188+provided that You also comply with the requirements of this License for
189+the Covered Software. If the Larger Work is a combination of Covered
190+Software with a work governed by one or more Secondary Licenses, and the
191+Covered Software is not Incompatible With Secondary Licenses, this
192+License permits You to additionally distribute such Covered Software
193+under the terms of such Secondary License(s), so that the recipient of
194+the Larger Work may, at their option, further distribute the Covered
195+Software under the terms of either this License or such Secondary
196+License(s).
197+
198+3.4. Notices
199+
200+You may not remove or alter the substance of any license notices
201+(including copyright notices, patent notices, disclaimers of warranty,
202+or limitations of liability) contained within the Source Code Form of
203+the Covered Software, except that You may alter any license notices to
204+the extent required to remedy known factual inaccuracies.
205+
206+3.5. Application of Additional Terms
207+
208+You may choose to offer, and to charge a fee for, warranty, support,
209+indemnity or liability obligations to one or more recipients of Covered
210+Software. However, You may do so only on Your own behalf, and not on
211+behalf of any Contributor. You must make it absolutely clear that any
212+such warranty, support, indemnity, or liability obligation is offered by
213+You alone, and You hereby agree to indemnify every Contributor for any
214+liability incurred by such Contributor as a result of warranty, support,
215+indemnity or liability terms You offer. You may include additional
216+disclaimers of warranty and limitations of liability specific to any
217+jurisdiction.
218+
219+4. Inability to Comply Due to Statute or Regulation
220+---------------------------------------------------
221+
222+If it is impossible for You to comply with any of the terms of this
223+License with respect to some or all of the Covered Software due to
224+statute, judicial order, or regulation then You must: (a) comply with
225+the terms of this License to the maximum extent possible; and (b)
226+describe the limitations and the code they affect. Such description must
227+be placed in a text file included with all distributions of the Covered
228+Software under this License. Except to the extent prohibited by statute
229+or regulation, such description must be sufficiently detailed for a
230+recipient of ordinary skill to be able to understand it.
231+
232+5. Termination
233+--------------
234+
235+5.1. The rights granted under this License will terminate automatically
236+if You fail to comply with any of its terms. However, if You become
237+compliant, then the rights granted under this License from a particular
238+Contributor are reinstated (a) provisionally, unless and until such
239+Contributor explicitly and finally terminates Your grants, and (b) on an
240+ongoing basis, if such Contributor fails to notify You of the
241+non-compliance by some reasonable means prior to 60 days after You have
242+come back into compliance. Moreover, Your grants from a particular
243+Contributor are reinstated on an ongoing basis if such Contributor
244+notifies You of the non-compliance by some reasonable means, this is the
245+first time You have received notice of non-compliance with this License
246+from such Contributor, and You become compliant prior to 30 days after
247+Your receipt of the notice.
248+
249+5.2. If You initiate litigation against any entity by asserting a patent
250+infringement claim (excluding declaratory judgment actions,
251+counter-claims, and cross-claims) alleging that a Contributor Version
252+directly or indirectly infringes any patent, then the rights granted to
253+You by any and all Contributors for the Covered Software under Section
254+2.1 of this License shall terminate.
255+
256+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
257+end user license agreements (excluding distributors and resellers) which
258+have been validly granted by You or Your distributors under this License
259+prior to termination shall survive termination.
260+
261+************************************************************************
262+* *
263+* 6. Disclaimer of Warranty *
264+* ------------------------- *
265+* *
266+* Covered Software is provided under this License on an "as is" *
267+* basis, without warranty of any kind, either expressed, implied, or *
268+* statutory, including, without limitation, warranties that the *
269+* Covered Software is free of defects, merchantable, fit for a *
270+* particular purpose or non-infringing. The entire risk as to the *
271+* quality and performance of the Covered Software is with You. *
272+* Should any Covered Software prove defective in any respect, You *
273+* (not any Contributor) assume the cost of any necessary servicing, *
274+* repair, or correction. This disclaimer of warranty constitutes an *
275+* essential part of this License. No use of any Covered Software is *
276+* authorized under this License except under this disclaimer. *
277+* *
278+************************************************************************
279+
280+************************************************************************
281+* *
282+* 7. Limitation of Liability *
283+* -------------------------- *
284+* *
285+* Under no circumstances and under no legal theory, whether tort *
286+* (including negligence), contract, or otherwise, shall any *
287+* Contributor, or anyone who distributes Covered Software as *
288+* permitted above, be liable to You for any direct, indirect, *
289+* special, incidental, or consequential damages of any character *
290+* including, without limitation, damages for lost profits, loss of *
291+* goodwill, work stoppage, computer failure or malfunction, or any *
292+* and all other commercial damages or losses, even if such party *
293+* shall have been informed of the possibility of such damages. This *
294+* limitation of liability shall not apply to liability for death or *
295+* personal injury resulting from such party's negligence to the *
296+* extent applicable law prohibits such limitation. Some *
297+* jurisdictions do not allow the exclusion or limitation of *
298+* incidental or consequential damages, so this exclusion and *
299+* limitation may not apply to You. *
300+* *
301+************************************************************************
302+
303+8. Litigation
304+-------------
305+
306+Any litigation relating to this License may be brought only in the
307+courts of a jurisdiction where the defendant maintains its principal
308+place of business and such litigation shall be governed by laws of that
309+jurisdiction, without reference to its conflict-of-law provisions.
310+Nothing in this Section shall prevent a party's ability to bring
311+cross-claims or counter-claims.
312+
313+9. Miscellaneous
314+----------------
315+
316+This License represents the complete agreement concerning the subject
317+matter hereof. If any provision of this License is held to be
318+unenforceable, such provision shall be reformed only to the extent
319+necessary to make it enforceable. Any law or regulation which provides
320+that the language of a contract shall be construed against the drafter
321+shall not be used to construe this License against a Contributor.
322+
323+10. Versions of the License
324+---------------------------
325+
326+10.1. New Versions
327+
328+Mozilla Foundation is the license steward. Except as provided in Section
329+10.3, no one other than the license steward has the right to modify or
330+publish new versions of this License. Each version will be given a
331+distinguishing version number.
332+
333+10.2. Effect of New Versions
334+
335+You may distribute the Covered Software under the terms of the version
336+of the License under which You originally received the Covered Software,
337+or under the terms of any subsequent version published by the license
338+steward.
339+
340+10.3. Modified Versions
341+
342+If you create software not governed by this License, and you want to
343+create a new license for such software, you may create and use a
344+modified version of this License if you rename the license and remove
345+any references to the name of the license steward (except to note that
346+such modified license differs from this License).
347+
348+10.4. Distributing Source Code Form that is Incompatible With Secondary
349+Licenses
350+
351+If You choose to distribute Source Code Form that is Incompatible With
352+Secondary Licenses under the terms of this version of the License, the
353+notice described in Exhibit B of this License must be attached.
354+
355+Exhibit A - Source Code Form License Notice
356+-------------------------------------------
357+
358+ This Source Code Form is subject to the terms of the Mozilla Public
359+ License, v. 2.0. If a copy of the MPL was not distributed with this
360+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
361+
362+If it is not possible or desirable to put the notice in a particular
363+file, then You may include the notice in a location (such as a LICENSE
364+file in a relevant directory) where a recipient would be likely to look
365+for such a notice.
366+
367+You may add additional accurate notices of copyright ownership.
gogol-language/Makefilenew file+1
@@ -0,0 +1 @@
1+include ../share/library.mk
gogol-language/README.mdnew file+28
@@ -0,0 +1,28 @@
1+# gogol-language
2+
3+* [Version](#version)
4+* [Description](#description)
5+* [Contribute](#contribute)
6+* [Licence](#licence)
7+
8+
9+## Version
10+
11+`0.1.1`
12+
13+
14+## Description
15+
16+A client library for the Google Cloud Natural Language.
17+
18+
19+## Contribute
20+
21+For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues).
22+
23+> _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information.
24+
25+
26+## Licence
27+
28+`gogol-language` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
gogol-language/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
gogol-language/gen/Network/Google/Language.hsnew file+277
@@ -0,0 +1,277 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE NoImplicitPrelude #-}
3+{-# LANGUAGE TypeOperators #-}
4+
5+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
6+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
7+
8+-- |
9+-- Module : Network.Google.Language
10+-- Copyright : (c) 2015-2016 Brendan Hay
11+-- License : Mozilla Public License, v. 2.0.
12+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
13+-- Stability : auto-generated
14+-- Portability : non-portable (GHC extensions)
15+--
16+-- Google Cloud Natural Language API provides natural language
17+-- understanding technologies to developers. Examples include sentiment
18+-- analysis, entity recognition, and text annotations.
19+--
20+-- /See:/ <https://cloud.google.com/natural-language/ Google Cloud Natural Language API Reference>
21+module Network.Google.Language
22+ (
23+ -- * Service Configuration
24+ languageService
25+
26+ -- * OAuth Scopes
27+ , cloudPlatformScope
28+
29+ -- * API Declaration
30+ , LanguageAPI
31+
32+ -- * Resources
33+
34+ -- ** language.documents.analyzeEntities
35+ , module Network.Google.Resource.Language.Documents.AnalyzeEntities
36+
37+ -- ** language.documents.analyzeSentiment
38+ , module Network.Google.Resource.Language.Documents.AnalyzeSentiment
39+
40+ -- ** language.documents.analyzeSyntax
41+ , module Network.Google.Resource.Language.Documents.AnalyzeSyntax
42+
43+ -- ** language.documents.annotateText
44+ , module Network.Google.Resource.Language.Documents.AnnotateText
45+
46+ -- * Types
47+
48+ -- ** AnalyzeSyntaxRequest
49+ , AnalyzeSyntaxRequest
50+ , analyzeSyntaxRequest
51+ , asrEncodingType
52+ , asrDocument
53+
54+ -- ** DependencyEdge
55+ , DependencyEdge
56+ , dependencyEdge
57+ , deHeadTokenIndex
58+ , deLabel
59+
60+ -- ** Status
61+ , Status
62+ , status
63+ , sDetails
64+ , sCode
65+ , sMessage
66+
67+ -- ** PartOfSpeechProper
68+ , PartOfSpeechProper (..)
69+
70+ -- ** PartOfSpeechTag
71+ , PartOfSpeechTag (..)
72+
73+ -- ** Sentiment
74+ , Sentiment
75+ , sentiment
76+ , sScore
77+ , sMagnitude
78+
79+ -- ** DocumentType
80+ , DocumentType (..)
81+
82+ -- ** AnalyzeSyntaxRequestEncodingType
83+ , AnalyzeSyntaxRequestEncodingType (..)
84+
85+ -- ** DependencyEdgeLabel
86+ , DependencyEdgeLabel (..)
87+
88+ -- ** PartOfSpeechVoice
89+ , PartOfSpeechVoice (..)
90+
91+ -- ** PartOfSpeechForm
92+ , PartOfSpeechForm (..)
93+
94+ -- ** PartOfSpeechPerson
95+ , PartOfSpeechPerson (..)
96+
97+ -- ** Token
98+ , Token
99+ , token
100+ , tDependencyEdge
101+ , tText
102+ , tLemma
103+ , tPartOfSpeech
104+
105+ -- ** EntityType
106+ , EntityType (..)
107+
108+ -- ** StatusDetailsItem
109+ , StatusDetailsItem
110+ , statusDetailsItem
111+ , sdiAddtional
112+
113+ -- ** AnnotateTextRequest
114+ , AnnotateTextRequest
115+ , annotateTextRequest
116+ , atrEncodingType
117+ , atrFeatures
118+ , atrDocument
119+
120+ -- ** EntityMention
121+ , EntityMention
122+ , entityMention
123+ , emText
124+ , emType
125+
126+ -- ** TextSpan
127+ , TextSpan
128+ , textSpan
129+ , tsBeginOffSet
130+ , tsContent
131+
132+ -- ** AnnotateTextResponse
133+ , AnnotateTextResponse
134+ , annotateTextResponse
135+ , atrEntities
136+ , atrTokens
137+ , atrDocumentSentiment
138+ , atrSentences
139+ , atrLanguage
140+
141+ -- ** PartOfSpeechTense
142+ , PartOfSpeechTense (..)
143+
144+ -- ** Features
145+ , Features
146+ , features
147+ , fExtractSyntax
148+ , fExtractDocumentSentiment
149+ , fExtractEntities
150+
151+ -- ** Document
152+ , Document
153+ , document
154+ , dContent
155+ , dLanguage
156+ , dGcsContentURI
157+ , dType
158+
159+ -- ** PartOfSpeechMood
160+ , PartOfSpeechMood (..)
161+
162+ -- ** PartOfSpeechCase
163+ , PartOfSpeechCase (..)
164+
165+ -- ** AnalyzeSentimentRequest
166+ , AnalyzeSentimentRequest
167+ , analyzeSentimentRequest
168+ , aEncodingType
169+ , aDocument
170+
171+ -- ** Xgafv
172+ , Xgafv (..)
173+
174+ -- ** AnalyzeEntitiesResponse
175+ , AnalyzeEntitiesResponse
176+ , analyzeEntitiesResponse
177+ , aerEntities
178+ , aerLanguage
179+
180+ -- ** AnnotateTextRequestEncodingType
181+ , AnnotateTextRequestEncodingType (..)
182+
183+ -- ** PartOfSpeechNumber
184+ , PartOfSpeechNumber (..)
185+
186+ -- ** AnalyzeSentimentResponse
187+ , AnalyzeSentimentResponse
188+ , analyzeSentimentResponse
189+ , asrDocumentSentiment
190+ , asrSentences
191+ , asrLanguage
192+
193+ -- ** AnalyzeEntitiesRequest
194+ , AnalyzeEntitiesRequest
195+ , analyzeEntitiesRequest
196+ , aerEncodingType
197+ , aerDocument
198+
199+ -- ** AnalyzeEntitiesRequestEncodingType
200+ , AnalyzeEntitiesRequestEncodingType (..)
201+
202+ -- ** Entity
203+ , Entity
204+ , entity
205+ , eName
206+ , eSalience
207+ , eMetadata
208+ , eType
209+ , eMentions
210+
211+ -- ** AnalyzeSyntaxResponse
212+ , AnalyzeSyntaxResponse
213+ , analyzeSyntaxResponse
214+ , aTokens
215+ , aSentences
216+ , aLanguage
217+
218+ -- ** EntityMetadata
219+ , EntityMetadata
220+ , entityMetadata
221+ , emAddtional
222+
223+ -- ** PartOfSpeechAspect
224+ , PartOfSpeechAspect (..)
225+
226+ -- ** PartOfSpeech
227+ , PartOfSpeech
228+ , partOfSpeech
229+ , posProper
230+ , posTag
231+ , posPerson
232+ , posAspect
233+ , posCase
234+ , posGender
235+ , posReciprocity
236+ , posNumber
237+ , posVoice
238+ , posForm
239+ , posTense
240+ , posMood
241+
242+ -- ** PartOfSpeechReciprocity
243+ , PartOfSpeechReciprocity (..)
244+
245+ -- ** PartOfSpeechGender
246+ , PartOfSpeechGender (..)
247+
248+ -- ** AnalyzeSentimentRequestEncodingType
249+ , AnalyzeSentimentRequestEncodingType (..)
250+
251+ -- ** EntityMentionType
252+ , EntityMentionType (..)
253+
254+ -- ** Sentence
255+ , Sentence
256+ , sentence
257+ , sSentiment
258+ , sText
259+ ) where
260+
261+import Network.Google.Language.Types
262+import Network.Google.Prelude
263+import Network.Google.Resource.Language.Documents.AnalyzeEntities
264+import Network.Google.Resource.Language.Documents.AnalyzeSentiment
265+import Network.Google.Resource.Language.Documents.AnalyzeSyntax
266+import Network.Google.Resource.Language.Documents.AnnotateText
267+
268+{- $resources
269+TODO
270+-}
271+
272+-- | Represents the entirety of the methods and resources available for the Google Cloud Natural Language API service.
273+type LanguageAPI =
274+ DocumentsAnalyzeSyntaxResource :<|>
275+ DocumentsAnnotateTextResource
276+ :<|> DocumentsAnalyzeSentimentResource
277+ :<|> DocumentsAnalyzeEntitiesResource
gogol-language/gen/Network/Google/Language/Types.hsnew file+250
@@ -0,0 +1,250 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE NoImplicitPrelude #-}
5+{-# LANGUAGE OverloadedStrings #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
8+
9+-- |
10+-- Module : Network.Google.Language.Types
11+-- Copyright : (c) 2015-2016 Brendan Hay
12+-- License : Mozilla Public License, v. 2.0.
13+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
14+-- Stability : auto-generated
15+-- Portability : non-portable (GHC extensions)
16+--
17+module Network.Google.Language.Types
18+ (
19+ -- * Service Configuration
20+ languageService
21+
22+ -- * OAuth Scopes
23+ , cloudPlatformScope
24+
25+ -- * AnalyzeSyntaxRequest
26+ , AnalyzeSyntaxRequest
27+ , analyzeSyntaxRequest
28+ , asrEncodingType
29+ , asrDocument
30+
31+ -- * DependencyEdge
32+ , DependencyEdge
33+ , dependencyEdge
34+ , deHeadTokenIndex
35+ , deLabel
36+
37+ -- * Status
38+ , Status
39+ , status
40+ , sDetails
41+ , sCode
42+ , sMessage
43+
44+ -- * PartOfSpeechProper
45+ , PartOfSpeechProper (..)
46+
47+ -- * PartOfSpeechTag
48+ , PartOfSpeechTag (..)
49+
50+ -- * Sentiment
51+ , Sentiment
52+ , sentiment
53+ , sScore
54+ , sMagnitude
55+
56+ -- * DocumentType
57+ , DocumentType (..)
58+
59+ -- * AnalyzeSyntaxRequestEncodingType
60+ , AnalyzeSyntaxRequestEncodingType (..)
61+
62+ -- * DependencyEdgeLabel
63+ , DependencyEdgeLabel (..)
64+
65+ -- * PartOfSpeechVoice
66+ , PartOfSpeechVoice (..)
67+
68+ -- * PartOfSpeechForm
69+ , PartOfSpeechForm (..)
70+
71+ -- * PartOfSpeechPerson
72+ , PartOfSpeechPerson (..)
73+
74+ -- * Token
75+ , Token
76+ , token
77+ , tDependencyEdge
78+ , tText
79+ , tLemma
80+ , tPartOfSpeech
81+
82+ -- * EntityType
83+ , EntityType (..)
84+
85+ -- * StatusDetailsItem
86+ , StatusDetailsItem
87+ , statusDetailsItem
88+ , sdiAddtional
89+
90+ -- * AnnotateTextRequest
91+ , AnnotateTextRequest
92+ , annotateTextRequest
93+ , atrEncodingType
94+ , atrFeatures
95+ , atrDocument
96+
97+ -- * EntityMention
98+ , EntityMention
99+ , entityMention
100+ , emText
101+ , emType
102+
103+ -- * TextSpan
104+ , TextSpan
105+ , textSpan
106+ , tsBeginOffSet
107+ , tsContent
108+
109+ -- * AnnotateTextResponse
110+ , AnnotateTextResponse
111+ , annotateTextResponse
112+ , atrEntities
113+ , atrTokens
114+ , atrDocumentSentiment
115+ , atrSentences
116+ , atrLanguage
117+
118+ -- * PartOfSpeechTense
119+ , PartOfSpeechTense (..)
120+
121+ -- * Features
122+ , Features
123+ , features
124+ , fExtractSyntax
125+ , fExtractDocumentSentiment
126+ , fExtractEntities
127+
128+ -- * Document
129+ , Document
130+ , document
131+ , dContent
132+ , dLanguage
133+ , dGcsContentURI
134+ , dType
135+
136+ -- * PartOfSpeechMood
137+ , PartOfSpeechMood (..)
138+
139+ -- * PartOfSpeechCase
140+ , PartOfSpeechCase (..)
141+
142+ -- * AnalyzeSentimentRequest
143+ , AnalyzeSentimentRequest
144+ , analyzeSentimentRequest
145+ , aEncodingType
146+ , aDocument
147+
148+ -- * Xgafv
149+ , Xgafv (..)
150+
151+ -- * AnalyzeEntitiesResponse
152+ , AnalyzeEntitiesResponse
153+ , analyzeEntitiesResponse
154+ , aerEntities
155+ , aerLanguage
156+
157+ -- * AnnotateTextRequestEncodingType
158+ , AnnotateTextRequestEncodingType (..)
159+
160+ -- * PartOfSpeechNumber
161+ , PartOfSpeechNumber (..)
162+
163+ -- * AnalyzeSentimentResponse
164+ , AnalyzeSentimentResponse
165+ , analyzeSentimentResponse
166+ , asrDocumentSentiment
167+ , asrSentences
168+ , asrLanguage
169+
170+ -- * AnalyzeEntitiesRequest
171+ , AnalyzeEntitiesRequest
172+ , analyzeEntitiesRequest
173+ , aerEncodingType
174+ , aerDocument
175+
176+ -- * AnalyzeEntitiesRequestEncodingType
177+ , AnalyzeEntitiesRequestEncodingType (..)
178+
179+ -- * Entity
180+ , Entity
181+ , entity
182+ , eName
183+ , eSalience
184+ , eMetadata
185+ , eType
186+ , eMentions
187+
188+ -- * AnalyzeSyntaxResponse
189+ , AnalyzeSyntaxResponse
190+ , analyzeSyntaxResponse
191+ , aTokens
192+ , aSentences
193+ , aLanguage
194+
195+ -- * EntityMetadata
196+ , EntityMetadata
197+ , entityMetadata
198+ , emAddtional
199+
200+ -- * PartOfSpeechAspect
201+ , PartOfSpeechAspect (..)
202+
203+ -- * PartOfSpeech
204+ , PartOfSpeech
205+ , partOfSpeech
206+ , posProper
207+ , posTag
208+ , posPerson
209+ , posAspect
210+ , posCase
211+ , posGender
212+ , posReciprocity
213+ , posNumber
214+ , posVoice
215+ , posForm
216+ , posTense
217+ , posMood
218+
219+ -- * PartOfSpeechReciprocity
220+ , PartOfSpeechReciprocity (..)
221+
222+ -- * PartOfSpeechGender
223+ , PartOfSpeechGender (..)
224+
225+ -- * AnalyzeSentimentRequestEncodingType
226+ , AnalyzeSentimentRequestEncodingType (..)
227+
228+ -- * EntityMentionType
229+ , EntityMentionType (..)
230+
231+ -- * Sentence
232+ , Sentence
233+ , sentence
234+ , sSentiment
235+ , sText
236+ ) where
237+
238+import Network.Google.Language.Types.Product
239+import Network.Google.Language.Types.Sum
240+import Network.Google.Prelude
241+
242+-- | Default request referring to version 'v1' of the Google Cloud Natural Language API. This contains the host and root path used as a starting point for constructing service requests.
243+languageService :: ServiceConfig
244+languageService
245+ = defaultService (ServiceId "language:v1")
246+ "language.googleapis.com"
247+
248+-- | View and manage your data across Google Cloud Platform services
249+cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"]
250+cloudPlatformScope = Proxy;
gogol-language/gen/Network/Google/Language/Types/Product.hsnew file+1372
@@ -0,0 +1,1372 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9+
10+-- |
11+-- Module : Network.Google.Language.Types.Product
12+-- Copyright : (c) 2015-2016 Brendan Hay
13+-- License : Mozilla Public License, v. 2.0.
14+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
15+-- Stability : auto-generated
16+-- Portability : non-portable (GHC extensions)
17+--
18+module Network.Google.Language.Types.Product where
19+
20+import Network.Google.Language.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | The syntax analysis request message.
24+--
25+-- /See:/ 'analyzeSyntaxRequest' smart constructor.
26+data AnalyzeSyntaxRequest = AnalyzeSyntaxRequest'
27+ { _asrEncodingType :: !(Maybe AnalyzeSyntaxRequestEncodingType)
28+ , _asrDocument :: !(Maybe Document)
29+ } deriving (Eq,Show,Data,Typeable,Generic)
30+
31+-- | Creates a value of 'AnalyzeSyntaxRequest' with the minimum fields required to make a request.
32+--
33+-- Use one of the following lenses to modify other fields as desired:
34+--
35+-- * 'asrEncodingType'
36+--
37+-- * 'asrDocument'
38+analyzeSyntaxRequest
39+ :: AnalyzeSyntaxRequest
40+analyzeSyntaxRequest =
41+ AnalyzeSyntaxRequest'
42+ { _asrEncodingType = Nothing
43+ , _asrDocument = Nothing
44+ }
45+
46+-- | The encoding type used by the API to calculate offsets.
47+asrEncodingType :: Lens' AnalyzeSyntaxRequest (Maybe AnalyzeSyntaxRequestEncodingType)
48+asrEncodingType
49+ = lens _asrEncodingType
50+ (\ s a -> s{_asrEncodingType = a})
51+
52+-- | Input document.
53+asrDocument :: Lens' AnalyzeSyntaxRequest (Maybe Document)
54+asrDocument
55+ = lens _asrDocument (\ s a -> s{_asrDocument = a})
56+
57+instance FromJSON AnalyzeSyntaxRequest where
58+ parseJSON
59+ = withObject "AnalyzeSyntaxRequest"
60+ (\ o ->
61+ AnalyzeSyntaxRequest' <$>
62+ (o .:? "encodingType") <*> (o .:? "document"))
63+
64+instance ToJSON AnalyzeSyntaxRequest where
65+ toJSON AnalyzeSyntaxRequest'{..}
66+ = object
67+ (catMaybes
68+ [("encodingType" .=) <$> _asrEncodingType,
69+ ("document" .=) <$> _asrDocument])
70+
71+-- | Represents dependency parse tree information for a token. (For more
72+-- information on dependency labels, see
73+-- http:\/\/www.aclweb.org\/anthology\/P13-2017
74+--
75+-- /See:/ 'dependencyEdge' smart constructor.
76+data DependencyEdge = DependencyEdge'
77+ { _deHeadTokenIndex :: !(Maybe (Textual Int32))
78+ , _deLabel :: !(Maybe DependencyEdgeLabel)
79+ } deriving (Eq,Show,Data,Typeable,Generic)
80+
81+-- | Creates a value of 'DependencyEdge' with the minimum fields required to make a request.
82+--
83+-- Use one of the following lenses to modify other fields as desired:
84+--
85+-- * 'deHeadTokenIndex'
86+--
87+-- * 'deLabel'
88+dependencyEdge
89+ :: DependencyEdge
90+dependencyEdge =
91+ DependencyEdge'
92+ { _deHeadTokenIndex = Nothing
93+ , _deLabel = Nothing
94+ }
95+
96+-- | Represents the head of this token in the dependency tree. This is the
97+-- index of the token which has an arc going to this token. The index is
98+-- the position of the token in the array of tokens returned by the API
99+-- method. If this token is a root token, then the \`head_token_index\` is
100+-- its own index.
101+deHeadTokenIndex :: Lens' DependencyEdge (Maybe Int32)
102+deHeadTokenIndex
103+ = lens _deHeadTokenIndex
104+ (\ s a -> s{_deHeadTokenIndex = a})
105+ . mapping _Coerce
106+
107+-- | The parse label for the token.
108+deLabel :: Lens' DependencyEdge (Maybe DependencyEdgeLabel)
109+deLabel = lens _deLabel (\ s a -> s{_deLabel = a})
110+
111+instance FromJSON DependencyEdge where
112+ parseJSON
113+ = withObject "DependencyEdge"
114+ (\ o ->
115+ DependencyEdge' <$>
116+ (o .:? "headTokenIndex") <*> (o .:? "label"))
117+
118+instance ToJSON DependencyEdge where
119+ toJSON DependencyEdge'{..}
120+ = object
121+ (catMaybes
122+ [("headTokenIndex" .=) <$> _deHeadTokenIndex,
123+ ("label" .=) <$> _deLabel])
124+
125+-- | The \`Status\` type defines a logical error model that is suitable for
126+-- different programming environments, including REST APIs and RPC APIs. It
127+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
128+-- designed to be: - Simple to use and understand for most users - Flexible
129+-- enough to meet unexpected needs # Overview The \`Status\` message
130+-- contains three pieces of data: error code, error message, and error
131+-- details. The error code should be an enum value of google.rpc.Code, but
132+-- it may accept additional error codes if needed. The error message should
133+-- be a developer-facing English message that helps developers *understand*
134+-- and *resolve* the error. If a localized user-facing error message is
135+-- needed, put the localized message in the error details or localize it in
136+-- the client. The optional error details may contain arbitrary information
137+-- about the error. There is a predefined set of error detail types in the
138+-- package \`google.rpc\` which can be used for common error conditions. #
139+-- Language mapping The \`Status\` message is the logical representation of
140+-- the error model, but it is not necessarily the actual wire format. When
141+-- the \`Status\` message is exposed in different client libraries and
142+-- different wire protocols, it can be mapped differently. For example, it
143+-- will likely be mapped to some exceptions in Java, but more likely mapped
144+-- to some error codes in C. # Other uses The error model and the
145+-- \`Status\` message can be used in a variety of environments, either with
146+-- or without APIs, to provide a consistent developer experience across
147+-- different environments. Example uses of this error model include: -
148+-- Partial errors. If a service needs to return partial errors to the
149+-- client, it may embed the \`Status\` in the normal response to indicate
150+-- the partial errors. - Workflow errors. A typical workflow has multiple
151+-- steps. Each step may have a \`Status\` message for error reporting
152+-- purpose. - Batch operations. If a client uses batch request and batch
153+-- response, the \`Status\` message should be used directly inside batch
154+-- response, one for each error sub-response. - Asynchronous operations. If
155+-- an API call embeds asynchronous operation results in its response, the
156+-- status of those operations should be represented directly using the
157+-- \`Status\` message. - Logging. If some API errors are stored in logs,
158+-- the message \`Status\` could be used directly after any stripping needed
159+-- for security\/privacy reasons.
160+--
161+-- /See:/ 'status' smart constructor.
162+data Status = Status'
163+ { _sDetails :: !(Maybe [StatusDetailsItem])
164+ , _sCode :: !(Maybe (Textual Int32))
165+ , _sMessage :: !(Maybe Text)
166+ } deriving (Eq,Show,Data,Typeable,Generic)
167+
168+-- | Creates a value of 'Status' with the minimum fields required to make a request.
169+--
170+-- Use one of the following lenses to modify other fields as desired:
171+--
172+-- * 'sDetails'
173+--
174+-- * 'sCode'
175+--
176+-- * 'sMessage'
177+status
178+ :: Status
179+status =
180+ Status'
181+ { _sDetails = Nothing
182+ , _sCode = Nothing
183+ , _sMessage = Nothing
184+ }
185+
186+-- | A list of messages that carry the error details. There will be a common
187+-- set of message types for APIs to use.
188+sDetails :: Lens' Status [StatusDetailsItem]
189+sDetails
190+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
191+ _Default
192+ . _Coerce
193+
194+-- | The status code, which should be an enum value of google.rpc.Code.
195+sCode :: Lens' Status (Maybe Int32)
196+sCode
197+ = lens _sCode (\ s a -> s{_sCode = a}) .
198+ mapping _Coerce
199+
200+-- | A developer-facing error message, which should be in English. Any
201+-- user-facing error message should be localized and sent in the
202+-- google.rpc.Status.details field, or localized by the client.
203+sMessage :: Lens' Status (Maybe Text)
204+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
205+
206+instance FromJSON Status where
207+ parseJSON
208+ = withObject "Status"
209+ (\ o ->
210+ Status' <$>
211+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
212+ (o .:? "message"))
213+
214+instance ToJSON Status where
215+ toJSON Status'{..}
216+ = object
217+ (catMaybes
218+ [("details" .=) <$> _sDetails,
219+ ("code" .=) <$> _sCode,
220+ ("message" .=) <$> _sMessage])
221+
222+-- | Represents the feeling associated with the entire text or entities in
223+-- the text.
224+--
225+-- /See:/ 'sentiment' smart constructor.
226+data Sentiment = Sentiment'
227+ { _sScore :: !(Maybe (Textual Double))
228+ , _sMagnitude :: !(Maybe (Textual Double))
229+ } deriving (Eq,Show,Data,Typeable,Generic)
230+
231+-- | Creates a value of 'Sentiment' with the minimum fields required to make a request.
232+--
233+-- Use one of the following lenses to modify other fields as desired:
234+--
235+-- * 'sScore'
236+--
237+-- * 'sMagnitude'
238+sentiment
239+ :: Sentiment
240+sentiment =
241+ Sentiment'
242+ { _sScore = Nothing
243+ , _sMagnitude = Nothing
244+ }
245+
246+-- | Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
247+-- sentiment).
248+sScore :: Lens' Sentiment (Maybe Double)
249+sScore
250+ = lens _sScore (\ s a -> s{_sScore = a}) .
251+ mapping _Coerce
252+
253+-- | A non-negative number in the [0, +inf) range, which represents the
254+-- absolute magnitude of sentiment regardless of score (positive or
255+-- negative).
256+sMagnitude :: Lens' Sentiment (Maybe Double)
257+sMagnitude
258+ = lens _sMagnitude (\ s a -> s{_sMagnitude = a}) .
259+ mapping _Coerce
260+
261+instance FromJSON Sentiment where
262+ parseJSON
263+ = withObject "Sentiment"
264+ (\ o ->
265+ Sentiment' <$>
266+ (o .:? "score") <*> (o .:? "magnitude"))
267+
268+instance ToJSON Sentiment where
269+ toJSON Sentiment'{..}
270+ = object
271+ (catMaybes
272+ [("score" .=) <$> _sScore,
273+ ("magnitude" .=) <$> _sMagnitude])
274+
275+-- | Represents the smallest syntactic building block of the text.
276+--
277+-- /See:/ 'token' smart constructor.
278+data Token = Token'
279+ { _tDependencyEdge :: !(Maybe DependencyEdge)
280+ , _tText :: !(Maybe TextSpan)
281+ , _tLemma :: !(Maybe Text)
282+ , _tPartOfSpeech :: !(Maybe PartOfSpeech)
283+ } deriving (Eq,Show,Data,Typeable,Generic)
284+
285+-- | Creates a value of 'Token' with the minimum fields required to make a request.
286+--
287+-- Use one of the following lenses to modify other fields as desired:
288+--
289+-- * 'tDependencyEdge'
290+--
291+-- * 'tText'
292+--
293+-- * 'tLemma'
294+--
295+-- * 'tPartOfSpeech'
296+token
297+ :: Token
298+token =
299+ Token'
300+ { _tDependencyEdge = Nothing
301+ , _tText = Nothing
302+ , _tLemma = Nothing
303+ , _tPartOfSpeech = Nothing
304+ }
305+
306+-- | Dependency tree parse for this token.
307+tDependencyEdge :: Lens' Token (Maybe DependencyEdge)
308+tDependencyEdge
309+ = lens _tDependencyEdge
310+ (\ s a -> s{_tDependencyEdge = a})
311+
312+-- | The token text.
313+tText :: Lens' Token (Maybe TextSpan)
314+tText = lens _tText (\ s a -> s{_tText = a})
315+
316+-- | [Lemma](https:\/\/en.wikipedia.org\/wiki\/Lemma_%28morphology%29) of the
317+-- token.
318+tLemma :: Lens' Token (Maybe Text)
319+tLemma = lens _tLemma (\ s a -> s{_tLemma = a})
320+
321+-- | Parts of speech tag for this token.
322+tPartOfSpeech :: Lens' Token (Maybe PartOfSpeech)
323+tPartOfSpeech
324+ = lens _tPartOfSpeech
325+ (\ s a -> s{_tPartOfSpeech = a})
326+
327+instance FromJSON Token where
328+ parseJSON
329+ = withObject "Token"
330+ (\ o ->
331+ Token' <$>
332+ (o .:? "dependencyEdge") <*> (o .:? "text") <*>
333+ (o .:? "lemma")
334+ <*> (o .:? "partOfSpeech"))
335+
336+instance ToJSON Token where
337+ toJSON Token'{..}
338+ = object
339+ (catMaybes
340+ [("dependencyEdge" .=) <$> _tDependencyEdge,
341+ ("text" .=) <$> _tText, ("lemma" .=) <$> _tLemma,
342+ ("partOfSpeech" .=) <$> _tPartOfSpeech])
343+
344+--
345+-- /See:/ 'statusDetailsItem' smart constructor.
346+newtype StatusDetailsItem = StatusDetailsItem'
347+ { _sdiAddtional :: HashMap Text JSONValue
348+ } deriving (Eq,Show,Data,Typeable,Generic)
349+
350+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
351+--
352+-- Use one of the following lenses to modify other fields as desired:
353+--
354+-- * 'sdiAddtional'
355+statusDetailsItem
356+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
357+ -> StatusDetailsItem
358+statusDetailsItem pSdiAddtional_ =
359+ StatusDetailsItem'
360+ { _sdiAddtional = _Coerce # pSdiAddtional_
361+ }
362+
363+-- | Properties of the object. Contains field \'type with type URL.
364+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
365+sdiAddtional
366+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
367+ . _Coerce
368+
369+instance FromJSON StatusDetailsItem where
370+ parseJSON
371+ = withObject "StatusDetailsItem"
372+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
373+
374+instance ToJSON StatusDetailsItem where
375+ toJSON = toJSON . _sdiAddtional
376+
377+-- | The request message for the text annotation API, which can perform
378+-- multiple analysis types (sentiment, entities, and syntax) in one call.
379+--
380+-- /See:/ 'annotateTextRequest' smart constructor.
381+data AnnotateTextRequest = AnnotateTextRequest'
382+ { _atrEncodingType :: !(Maybe AnnotateTextRequestEncodingType)
383+ , _atrFeatures :: !(Maybe Features)
384+ , _atrDocument :: !(Maybe Document)
385+ } deriving (Eq,Show,Data,Typeable,Generic)
386+
387+-- | Creates a value of 'AnnotateTextRequest' with the minimum fields required to make a request.
388+--
389+-- Use one of the following lenses to modify other fields as desired:
390+--
391+-- * 'atrEncodingType'
392+--
393+-- * 'atrFeatures'
394+--
395+-- * 'atrDocument'
396+annotateTextRequest
397+ :: AnnotateTextRequest
398+annotateTextRequest =
399+ AnnotateTextRequest'
400+ { _atrEncodingType = Nothing
401+ , _atrFeatures = Nothing
402+ , _atrDocument = Nothing
403+ }
404+
405+-- | The encoding type used by the API to calculate offsets.
406+atrEncodingType :: Lens' AnnotateTextRequest (Maybe AnnotateTextRequestEncodingType)
407+atrEncodingType
408+ = lens _atrEncodingType
409+ (\ s a -> s{_atrEncodingType = a})
410+
411+-- | The enabled features.
412+atrFeatures :: Lens' AnnotateTextRequest (Maybe Features)
413+atrFeatures
414+ = lens _atrFeatures (\ s a -> s{_atrFeatures = a})
415+
416+-- | Input document.
417+atrDocument :: Lens' AnnotateTextRequest (Maybe Document)
418+atrDocument
419+ = lens _atrDocument (\ s a -> s{_atrDocument = a})
420+
421+instance FromJSON AnnotateTextRequest where
422+ parseJSON
423+ = withObject "AnnotateTextRequest"
424+ (\ o ->
425+ AnnotateTextRequest' <$>
426+ (o .:? "encodingType") <*> (o .:? "features") <*>
427+ (o .:? "document"))
428+
429+instance ToJSON AnnotateTextRequest where
430+ toJSON AnnotateTextRequest'{..}
431+ = object
432+ (catMaybes
433+ [("encodingType" .=) <$> _atrEncodingType,
434+ ("features" .=) <$> _atrFeatures,
435+ ("document" .=) <$> _atrDocument])
436+
437+-- | Represents a mention for an entity in the text. Currently, proper noun
438+-- mentions are supported.
439+--
440+-- /See:/ 'entityMention' smart constructor.
441+data EntityMention = EntityMention'
442+ { _emText :: !(Maybe TextSpan)
443+ , _emType :: !(Maybe EntityMentionType)
444+ } deriving (Eq,Show,Data,Typeable,Generic)
445+
446+-- | Creates a value of 'EntityMention' with the minimum fields required to make a request.
447+--
448+-- Use one of the following lenses to modify other fields as desired:
449+--
450+-- * 'emText'
451+--
452+-- * 'emType'
453+entityMention
454+ :: EntityMention
455+entityMention =
456+ EntityMention'
457+ { _emText = Nothing
458+ , _emType = Nothing
459+ }
460+
461+-- | The mention text.
462+emText :: Lens' EntityMention (Maybe TextSpan)
463+emText = lens _emText (\ s a -> s{_emText = a})
464+
465+-- | The type of the entity mention.
466+emType :: Lens' EntityMention (Maybe EntityMentionType)
467+emType = lens _emType (\ s a -> s{_emType = a})
468+
469+instance FromJSON EntityMention where
470+ parseJSON
471+ = withObject "EntityMention"
472+ (\ o ->
473+ EntityMention' <$> (o .:? "text") <*> (o .:? "type"))
474+
475+instance ToJSON EntityMention where
476+ toJSON EntityMention'{..}
477+ = object
478+ (catMaybes
479+ [("text" .=) <$> _emText, ("type" .=) <$> _emType])
480+
481+-- | Represents an output piece of text.
482+--
483+-- /See:/ 'textSpan' smart constructor.
484+data TextSpan = TextSpan'
485+ { _tsBeginOffSet :: !(Maybe (Textual Int32))
486+ , _tsContent :: !(Maybe Text)
487+ } deriving (Eq,Show,Data,Typeable,Generic)
488+
489+-- | Creates a value of 'TextSpan' with the minimum fields required to make a request.
490+--
491+-- Use one of the following lenses to modify other fields as desired:
492+--
493+-- * 'tsBeginOffSet'
494+--
495+-- * 'tsContent'
496+textSpan
497+ :: TextSpan
498+textSpan =
499+ TextSpan'
500+ { _tsBeginOffSet = Nothing
501+ , _tsContent = Nothing
502+ }
503+
504+-- | The API calculates the beginning offset of the content in the original
505+-- document according to the EncodingType specified in the API request.
506+tsBeginOffSet :: Lens' TextSpan (Maybe Int32)
507+tsBeginOffSet
508+ = lens _tsBeginOffSet
509+ (\ s a -> s{_tsBeginOffSet = a})
510+ . mapping _Coerce
511+
512+-- | The content of the output text.
513+tsContent :: Lens' TextSpan (Maybe Text)
514+tsContent
515+ = lens _tsContent (\ s a -> s{_tsContent = a})
516+
517+instance FromJSON TextSpan where
518+ parseJSON
519+ = withObject "TextSpan"
520+ (\ o ->
521+ TextSpan' <$>
522+ (o .:? "beginOffset") <*> (o .:? "content"))
523+
524+instance ToJSON TextSpan where
525+ toJSON TextSpan'{..}
526+ = object
527+ (catMaybes
528+ [("beginOffset" .=) <$> _tsBeginOffSet,
529+ ("content" .=) <$> _tsContent])
530+
531+-- | The text annotations response message.
532+--
533+-- /See:/ 'annotateTextResponse' smart constructor.
534+data AnnotateTextResponse = AnnotateTextResponse'
535+ { _atrEntities :: !(Maybe [Entity])
536+ , _atrTokens :: !(Maybe [Token])
537+ , _atrDocumentSentiment :: !(Maybe Sentiment)
538+ , _atrSentences :: !(Maybe [Sentence])
539+ , _atrLanguage :: !(Maybe Text)
540+ } deriving (Eq,Show,Data,Typeable,Generic)
541+
542+-- | Creates a value of 'AnnotateTextResponse' with the minimum fields required to make a request.
543+--
544+-- Use one of the following lenses to modify other fields as desired:
545+--
546+-- * 'atrEntities'
547+--
548+-- * 'atrTokens'
549+--
550+-- * 'atrDocumentSentiment'
551+--
552+-- * 'atrSentences'
553+--
554+-- * 'atrLanguage'
555+annotateTextResponse
556+ :: AnnotateTextResponse
557+annotateTextResponse =
558+ AnnotateTextResponse'
559+ { _atrEntities = Nothing
560+ , _atrTokens = Nothing
561+ , _atrDocumentSentiment = Nothing
562+ , _atrSentences = Nothing
563+ , _atrLanguage = Nothing
564+ }
565+
566+-- | Entities, along with their semantic information, in the input document.
567+-- Populated if the user enables
568+-- AnnotateTextRequest.Features.extract_entities.
569+atrEntities :: Lens' AnnotateTextResponse [Entity]
570+atrEntities
571+ = lens _atrEntities (\ s a -> s{_atrEntities = a}) .
572+ _Default
573+ . _Coerce
574+
575+-- | Tokens, along with their syntactic information, in the input document.
576+-- Populated if the user enables
577+-- AnnotateTextRequest.Features.extract_syntax.
578+atrTokens :: Lens' AnnotateTextResponse [Token]
579+atrTokens
580+ = lens _atrTokens (\ s a -> s{_atrTokens = a}) .
581+ _Default
582+ . _Coerce
583+
584+-- | The overall sentiment for the document. Populated if the user enables
585+-- AnnotateTextRequest.Features.extract_document_sentiment.
586+atrDocumentSentiment :: Lens' AnnotateTextResponse (Maybe Sentiment)
587+atrDocumentSentiment
588+ = lens _atrDocumentSentiment
589+ (\ s a -> s{_atrDocumentSentiment = a})
590+
591+-- | Sentences in the input document. Populated if the user enables
592+-- AnnotateTextRequest.Features.extract_syntax.
593+atrSentences :: Lens' AnnotateTextResponse [Sentence]
594+atrSentences
595+ = lens _atrSentences (\ s a -> s{_atrSentences = a})
596+ . _Default
597+ . _Coerce
598+
599+-- | The language of the text, which will be the same as the language
600+-- specified in the request or, if not specified, the
601+-- automatically-detected language. See \`Document.language\` field for
602+-- more details.
603+atrLanguage :: Lens' AnnotateTextResponse (Maybe Text)
604+atrLanguage
605+ = lens _atrLanguage (\ s a -> s{_atrLanguage = a})
606+
607+instance FromJSON AnnotateTextResponse where
608+ parseJSON
609+ = withObject "AnnotateTextResponse"
610+ (\ o ->
611+ AnnotateTextResponse' <$>
612+ (o .:? "entities" .!= mempty) <*>
613+ (o .:? "tokens" .!= mempty)
614+ <*> (o .:? "documentSentiment")
615+ <*> (o .:? "sentences" .!= mempty)
616+ <*> (o .:? "language"))
617+
618+instance ToJSON AnnotateTextResponse where
619+ toJSON AnnotateTextResponse'{..}
620+ = object
621+ (catMaybes
622+ [("entities" .=) <$> _atrEntities,
623+ ("tokens" .=) <$> _atrTokens,
624+ ("documentSentiment" .=) <$> _atrDocumentSentiment,
625+ ("sentences" .=) <$> _atrSentences,
626+ ("language" .=) <$> _atrLanguage])
627+
628+-- | All available features for sentiment, syntax, and semantic analysis.
629+-- Setting each one to true will enable that specific analysis for the
630+-- input.
631+--
632+-- /See:/ 'features' smart constructor.
633+data Features = Features'
634+ { _fExtractSyntax :: !(Maybe Bool)
635+ , _fExtractDocumentSentiment :: !(Maybe Bool)
636+ , _fExtractEntities :: !(Maybe Bool)
637+ } deriving (Eq,Show,Data,Typeable,Generic)
638+
639+-- | Creates a value of 'Features' with the minimum fields required to make a request.
640+--
641+-- Use one of the following lenses to modify other fields as desired:
642+--
643+-- * 'fExtractSyntax'
644+--
645+-- * 'fExtractDocumentSentiment'
646+--
647+-- * 'fExtractEntities'
648+features
649+ :: Features
650+features =
651+ Features'
652+ { _fExtractSyntax = Nothing
653+ , _fExtractDocumentSentiment = Nothing
654+ , _fExtractEntities = Nothing
655+ }
656+
657+-- | Extract syntax information.
658+fExtractSyntax :: Lens' Features (Maybe Bool)
659+fExtractSyntax
660+ = lens _fExtractSyntax
661+ (\ s a -> s{_fExtractSyntax = a})
662+
663+-- | Extract document-level sentiment.
664+fExtractDocumentSentiment :: Lens' Features (Maybe Bool)
665+fExtractDocumentSentiment
666+ = lens _fExtractDocumentSentiment
667+ (\ s a -> s{_fExtractDocumentSentiment = a})
668+
669+-- | Extract entities.
670+fExtractEntities :: Lens' Features (Maybe Bool)
671+fExtractEntities
672+ = lens _fExtractEntities
673+ (\ s a -> s{_fExtractEntities = a})
674+
675+instance FromJSON Features where
676+ parseJSON
677+ = withObject "Features"
678+ (\ o ->
679+ Features' <$>
680+ (o .:? "extractSyntax") <*>
681+ (o .:? "extractDocumentSentiment")
682+ <*> (o .:? "extractEntities"))
683+
684+instance ToJSON Features where
685+ toJSON Features'{..}
686+ = object
687+ (catMaybes
688+ [("extractSyntax" .=) <$> _fExtractSyntax,
689+ ("extractDocumentSentiment" .=) <$>
690+ _fExtractDocumentSentiment,
691+ ("extractEntities" .=) <$> _fExtractEntities])
692+
693+-- | ################################################################ #
694+-- Represents the input to API methods.
695+--
696+-- /See:/ 'document' smart constructor.
697+data Document = Document'
698+ { _dContent :: !(Maybe Text)
699+ , _dLanguage :: !(Maybe Text)
700+ , _dGcsContentURI :: !(Maybe Text)
701+ , _dType :: !(Maybe DocumentType)
702+ } deriving (Eq,Show,Data,Typeable,Generic)
703+
704+-- | Creates a value of 'Document' with the minimum fields required to make a request.
705+--
706+-- Use one of the following lenses to modify other fields as desired:
707+--
708+-- * 'dContent'
709+--
710+-- * 'dLanguage'
711+--
712+-- * 'dGcsContentURI'
713+--
714+-- * 'dType'
715+document
716+ :: Document
717+document =
718+ Document'
719+ { _dContent = Nothing
720+ , _dLanguage = Nothing
721+ , _dGcsContentURI = Nothing
722+ , _dType = Nothing
723+ }
724+
725+-- | The content of the input in string format.
726+dContent :: Lens' Document (Maybe Text)
727+dContent = lens _dContent (\ s a -> s{_dContent = a})
728+
729+-- | The language of the document (if not specified, the language is
730+-- automatically detected). Both ISO and BCP-47 language codes are
731+-- accepted.
732+-- **Current Language Restrictions:** * Only English, Spanish, and Japanese
733+-- textual content are supported. If the language (either specified by the
734+-- caller or automatically detected) is not supported by the called API
735+-- method, an \`INVALID_ARGUMENT\` error is returned.
736+dLanguage :: Lens' Document (Maybe Text)
737+dLanguage
738+ = lens _dLanguage (\ s a -> s{_dLanguage = a})
739+
740+-- | The Google Cloud Storage URI where the file content is located. This URI
741+-- must be of the form: gs:\/\/bucket_name\/object_name. For more details,
742+-- see https:\/\/cloud.google.com\/storage\/docs\/reference-uris. NOTE:
743+-- Cloud Storage object versioning is not supported.
744+dGcsContentURI :: Lens' Document (Maybe Text)
745+dGcsContentURI
746+ = lens _dGcsContentURI
747+ (\ s a -> s{_dGcsContentURI = a})
748+
749+-- | Required. If the type is not set or is \`TYPE_UNSPECIFIED\`, returns an
750+-- \`INVALID_ARGUMENT\` error.
751+dType :: Lens' Document (Maybe DocumentType)
752+dType = lens _dType (\ s a -> s{_dType = a})
753+
754+instance FromJSON Document where
755+ parseJSON
756+ = withObject "Document"
757+ (\ o ->
758+ Document' <$>
759+ (o .:? "content") <*> (o .:? "language") <*>
760+ (o .:? "gcsContentUri")
761+ <*> (o .:? "type"))
762+
763+instance ToJSON Document where
764+ toJSON Document'{..}
765+ = object
766+ (catMaybes
767+ [("content" .=) <$> _dContent,
768+ ("language" .=) <$> _dLanguage,
769+ ("gcsContentUri" .=) <$> _dGcsContentURI,
770+ ("type" .=) <$> _dType])
771+
772+-- | The sentiment analysis request message.
773+--
774+-- /See:/ 'analyzeSentimentRequest' smart constructor.
775+data AnalyzeSentimentRequest = AnalyzeSentimentRequest'
776+ { _aEncodingType :: !(Maybe AnalyzeSentimentRequestEncodingType)
777+ , _aDocument :: !(Maybe Document)
778+ } deriving (Eq,Show,Data,Typeable,Generic)
779+
780+-- | Creates a value of 'AnalyzeSentimentRequest' with the minimum fields required to make a request.
781+--
782+-- Use one of the following lenses to modify other fields as desired:
783+--
784+-- * 'aEncodingType'
785+--
786+-- * 'aDocument'
787+analyzeSentimentRequest
788+ :: AnalyzeSentimentRequest
789+analyzeSentimentRequest =
790+ AnalyzeSentimentRequest'
791+ { _aEncodingType = Nothing
792+ , _aDocument = Nothing
793+ }
794+
795+-- | The encoding type used by the API to calculate sentence offsets.
796+aEncodingType :: Lens' AnalyzeSentimentRequest (Maybe AnalyzeSentimentRequestEncodingType)
797+aEncodingType
798+ = lens _aEncodingType
799+ (\ s a -> s{_aEncodingType = a})
800+
801+-- | Input document. Currently, \`analyzeSentiment\` only supports English
802+-- text (Document.language=\"EN\").
803+aDocument :: Lens' AnalyzeSentimentRequest (Maybe Document)
804+aDocument
805+ = lens _aDocument (\ s a -> s{_aDocument = a})
806+
807+instance FromJSON AnalyzeSentimentRequest where
808+ parseJSON
809+ = withObject "AnalyzeSentimentRequest"
810+ (\ o ->
811+ AnalyzeSentimentRequest' <$>
812+ (o .:? "encodingType") <*> (o .:? "document"))
813+
814+instance ToJSON AnalyzeSentimentRequest where
815+ toJSON AnalyzeSentimentRequest'{..}
816+ = object
817+ (catMaybes
818+ [("encodingType" .=) <$> _aEncodingType,
819+ ("document" .=) <$> _aDocument])
820+
821+-- | The entity analysis response message.
822+--
823+-- /See:/ 'analyzeEntitiesResponse' smart constructor.
824+data AnalyzeEntitiesResponse = AnalyzeEntitiesResponse'
825+ { _aerEntities :: !(Maybe [Entity])
826+ , _aerLanguage :: !(Maybe Text)
827+ } deriving (Eq,Show,Data,Typeable,Generic)
828+
829+-- | Creates a value of 'AnalyzeEntitiesResponse' with the minimum fields required to make a request.
830+--
831+-- Use one of the following lenses to modify other fields as desired:
832+--
833+-- * 'aerEntities'
834+--
835+-- * 'aerLanguage'
836+analyzeEntitiesResponse
837+ :: AnalyzeEntitiesResponse
838+analyzeEntitiesResponse =
839+ AnalyzeEntitiesResponse'
840+ { _aerEntities = Nothing
841+ , _aerLanguage = Nothing
842+ }
843+
844+-- | The recognized entities in the input document.
845+aerEntities :: Lens' AnalyzeEntitiesResponse [Entity]
846+aerEntities
847+ = lens _aerEntities (\ s a -> s{_aerEntities = a}) .
848+ _Default
849+ . _Coerce
850+
851+-- | The language of the text, which will be the same as the language
852+-- specified in the request or, if not specified, the
853+-- automatically-detected language. See \`Document.language\` field for
854+-- more details.
855+aerLanguage :: Lens' AnalyzeEntitiesResponse (Maybe Text)
856+aerLanguage
857+ = lens _aerLanguage (\ s a -> s{_aerLanguage = a})
858+
859+instance FromJSON AnalyzeEntitiesResponse where
860+ parseJSON
861+ = withObject "AnalyzeEntitiesResponse"
862+ (\ o ->
863+ AnalyzeEntitiesResponse' <$>
864+ (o .:? "entities" .!= mempty) <*> (o .:? "language"))
865+
866+instance ToJSON AnalyzeEntitiesResponse where
867+ toJSON AnalyzeEntitiesResponse'{..}
868+ = object
869+ (catMaybes
870+ [("entities" .=) <$> _aerEntities,
871+ ("language" .=) <$> _aerLanguage])
872+
873+-- | The sentiment analysis response message.
874+--
875+-- /See:/ 'analyzeSentimentResponse' smart constructor.
876+data AnalyzeSentimentResponse = AnalyzeSentimentResponse'
877+ { _asrDocumentSentiment :: !(Maybe Sentiment)
878+ , _asrSentences :: !(Maybe [Sentence])
879+ , _asrLanguage :: !(Maybe Text)
880+ } deriving (Eq,Show,Data,Typeable,Generic)
881+
882+-- | Creates a value of 'AnalyzeSentimentResponse' with the minimum fields required to make a request.
883+--
884+-- Use one of the following lenses to modify other fields as desired:
885+--
886+-- * 'asrDocumentSentiment'
887+--
888+-- * 'asrSentences'
889+--
890+-- * 'asrLanguage'
891+analyzeSentimentResponse
892+ :: AnalyzeSentimentResponse
893+analyzeSentimentResponse =
894+ AnalyzeSentimentResponse'
895+ { _asrDocumentSentiment = Nothing
896+ , _asrSentences = Nothing
897+ , _asrLanguage = Nothing
898+ }
899+
900+-- | The overall sentiment of the input document.
901+asrDocumentSentiment :: Lens' AnalyzeSentimentResponse (Maybe Sentiment)
902+asrDocumentSentiment
903+ = lens _asrDocumentSentiment
904+ (\ s a -> s{_asrDocumentSentiment = a})
905+
906+-- | The sentiment for all the sentences in the document.
907+asrSentences :: Lens' AnalyzeSentimentResponse [Sentence]
908+asrSentences
909+ = lens _asrSentences (\ s a -> s{_asrSentences = a})
910+ . _Default
911+ . _Coerce
912+
913+-- | The language of the text, which will be the same as the language
914+-- specified in the request or, if not specified, the
915+-- automatically-detected language. See \`Document.language\` field for
916+-- more details.
917+asrLanguage :: Lens' AnalyzeSentimentResponse (Maybe Text)
918+asrLanguage
919+ = lens _asrLanguage (\ s a -> s{_asrLanguage = a})
920+
921+instance FromJSON AnalyzeSentimentResponse where
922+ parseJSON
923+ = withObject "AnalyzeSentimentResponse"
924+ (\ o ->
925+ AnalyzeSentimentResponse' <$>
926+ (o .:? "documentSentiment") <*>
927+ (o .:? "sentences" .!= mempty)
928+ <*> (o .:? "language"))
929+
930+instance ToJSON AnalyzeSentimentResponse where
931+ toJSON AnalyzeSentimentResponse'{..}
932+ = object
933+ (catMaybes
934+ [("documentSentiment" .=) <$> _asrDocumentSentiment,
935+ ("sentences" .=) <$> _asrSentences,
936+ ("language" .=) <$> _asrLanguage])
937+
938+-- | The entity analysis request message.
939+--
940+-- /See:/ 'analyzeEntitiesRequest' smart constructor.
941+data AnalyzeEntitiesRequest = AnalyzeEntitiesRequest'
942+ { _aerEncodingType :: !(Maybe AnalyzeEntitiesRequestEncodingType)
943+ , _aerDocument :: !(Maybe Document)
944+ } deriving (Eq,Show,Data,Typeable,Generic)
945+
946+-- | Creates a value of 'AnalyzeEntitiesRequest' with the minimum fields required to make a request.
947+--
948+-- Use one of the following lenses to modify other fields as desired:
949+--
950+-- * 'aerEncodingType'
951+--
952+-- * 'aerDocument'
953+analyzeEntitiesRequest
954+ :: AnalyzeEntitiesRequest
955+analyzeEntitiesRequest =
956+ AnalyzeEntitiesRequest'
957+ { _aerEncodingType = Nothing
958+ , _aerDocument = Nothing
959+ }
960+
961+-- | The encoding type used by the API to calculate offsets.
962+aerEncodingType :: Lens' AnalyzeEntitiesRequest (Maybe AnalyzeEntitiesRequestEncodingType)
963+aerEncodingType
964+ = lens _aerEncodingType
965+ (\ s a -> s{_aerEncodingType = a})
966+
967+-- | Input document.
968+aerDocument :: Lens' AnalyzeEntitiesRequest (Maybe Document)
969+aerDocument
970+ = lens _aerDocument (\ s a -> s{_aerDocument = a})
971+
972+instance FromJSON AnalyzeEntitiesRequest where
973+ parseJSON
974+ = withObject "AnalyzeEntitiesRequest"
975+ (\ o ->
976+ AnalyzeEntitiesRequest' <$>
977+ (o .:? "encodingType") <*> (o .:? "document"))
978+
979+instance ToJSON AnalyzeEntitiesRequest where
980+ toJSON AnalyzeEntitiesRequest'{..}
981+ = object
982+ (catMaybes
983+ [("encodingType" .=) <$> _aerEncodingType,
984+ ("document" .=) <$> _aerDocument])
985+
986+-- | Represents a phrase in the text that is a known entity, such as a
987+-- person, an organization, or location. The API associates information,
988+-- such as salience and mentions, with entities.
989+--
990+-- /See:/ 'entity' smart constructor.
991+data Entity = Entity'
992+ { _eName :: !(Maybe Text)
993+ , _eSalience :: !(Maybe (Textual Double))
994+ , _eMetadata :: !(Maybe EntityMetadata)
995+ , _eType :: !(Maybe EntityType)
996+ , _eMentions :: !(Maybe [EntityMention])
997+ } deriving (Eq,Show,Data,Typeable,Generic)
998+
999+-- | Creates a value of 'Entity' with the minimum fields required to make a request.
1000+--
1001+-- Use one of the following lenses to modify other fields as desired:
1002+--
1003+-- * 'eName'
1004+--
1005+-- * 'eSalience'
1006+--
1007+-- * 'eMetadata'
1008+--
1009+-- * 'eType'
1010+--
1011+-- * 'eMentions'
1012+entity
1013+ :: Entity
1014+entity =
1015+ Entity'
1016+ { _eName = Nothing
1017+ , _eSalience = Nothing
1018+ , _eMetadata = Nothing
1019+ , _eType = Nothing
1020+ , _eMentions = Nothing
1021+ }
1022+
1023+-- | The representative name for the entity.
1024+eName :: Lens' Entity (Maybe Text)
1025+eName = lens _eName (\ s a -> s{_eName = a})
1026+
1027+-- | The salience score associated with the entity in the [0, 1.0] range. The
1028+-- salience score for an entity provides information about the importance
1029+-- or centrality of that entity to the entire document text. Scores closer
1030+-- to 0 are less salient, while scores closer to 1.0 are highly salient.
1031+eSalience :: Lens' Entity (Maybe Double)
1032+eSalience
1033+ = lens _eSalience (\ s a -> s{_eSalience = a}) .
1034+ mapping _Coerce
1035+
1036+-- | Metadata associated with the entity. Currently, Wikipedia URLs and
1037+-- Knowledge Graph MIDs are provided, if available. The associated keys are
1038+-- \"wikipedia_url\" and \"mid\", respectively.
1039+eMetadata :: Lens' Entity (Maybe EntityMetadata)
1040+eMetadata
1041+ = lens _eMetadata (\ s a -> s{_eMetadata = a})
1042+
1043+-- | The entity type.
1044+eType :: Lens' Entity (Maybe EntityType)
1045+eType = lens _eType (\ s a -> s{_eType = a})
1046+
1047+-- | The mentions of this entity in the input document. The API currently
1048+-- supports proper noun mentions.
1049+eMentions :: Lens' Entity [EntityMention]
1050+eMentions
1051+ = lens _eMentions (\ s a -> s{_eMentions = a}) .
1052+ _Default
1053+ . _Coerce
1054+
1055+instance FromJSON Entity where
1056+ parseJSON
1057+ = withObject "Entity"
1058+ (\ o ->
1059+ Entity' <$>
1060+ (o .:? "name") <*> (o .:? "salience") <*>
1061+ (o .:? "metadata")
1062+ <*> (o .:? "type")
1063+ <*> (o .:? "mentions" .!= mempty))
1064+
1065+instance ToJSON Entity where
1066+ toJSON Entity'{..}
1067+ = object
1068+ (catMaybes
1069+ [("name" .=) <$> _eName,
1070+ ("salience" .=) <$> _eSalience,
1071+ ("metadata" .=) <$> _eMetadata,
1072+ ("type" .=) <$> _eType,
1073+ ("mentions" .=) <$> _eMentions])
1074+
1075+-- | The syntax analysis response message.
1076+--
1077+-- /See:/ 'analyzeSyntaxResponse' smart constructor.
1078+data AnalyzeSyntaxResponse = AnalyzeSyntaxResponse'
1079+ { _aTokens :: !(Maybe [Token])
1080+ , _aSentences :: !(Maybe [Sentence])
1081+ , _aLanguage :: !(Maybe Text)
1082+ } deriving (Eq,Show,Data,Typeable,Generic)
1083+
1084+-- | Creates a value of 'AnalyzeSyntaxResponse' with the minimum fields required to make a request.
1085+--
1086+-- Use one of the following lenses to modify other fields as desired:
1087+--
1088+-- * 'aTokens'
1089+--
1090+-- * 'aSentences'
1091+--
1092+-- * 'aLanguage'
1093+analyzeSyntaxResponse
1094+ :: AnalyzeSyntaxResponse
1095+analyzeSyntaxResponse =
1096+ AnalyzeSyntaxResponse'
1097+ { _aTokens = Nothing
1098+ , _aSentences = Nothing
1099+ , _aLanguage = Nothing
1100+ }
1101+
1102+-- | Tokens, along with their syntactic information, in the input document.
1103+aTokens :: Lens' AnalyzeSyntaxResponse [Token]
1104+aTokens
1105+ = lens _aTokens (\ s a -> s{_aTokens = a}) . _Default
1106+ . _Coerce
1107+
1108+-- | Sentences in the input document.
1109+aSentences :: Lens' AnalyzeSyntaxResponse [Sentence]
1110+aSentences
1111+ = lens _aSentences (\ s a -> s{_aSentences = a}) .
1112+ _Default
1113+ . _Coerce
1114+
1115+-- | The language of the text, which will be the same as the language
1116+-- specified in the request or, if not specified, the
1117+-- automatically-detected language. See \`Document.language\` field for
1118+-- more details.
1119+aLanguage :: Lens' AnalyzeSyntaxResponse (Maybe Text)
1120+aLanguage
1121+ = lens _aLanguage (\ s a -> s{_aLanguage = a})
1122+
1123+instance FromJSON AnalyzeSyntaxResponse where
1124+ parseJSON
1125+ = withObject "AnalyzeSyntaxResponse"
1126+ (\ o ->
1127+ AnalyzeSyntaxResponse' <$>
1128+ (o .:? "tokens" .!= mempty) <*>
1129+ (o .:? "sentences" .!= mempty)
1130+ <*> (o .:? "language"))
1131+
1132+instance ToJSON AnalyzeSyntaxResponse where
1133+ toJSON AnalyzeSyntaxResponse'{..}
1134+ = object
1135+ (catMaybes
1136+ [("tokens" .=) <$> _aTokens,
1137+ ("sentences" .=) <$> _aSentences,
1138+ ("language" .=) <$> _aLanguage])
1139+
1140+-- | Metadata associated with the entity. Currently, Wikipedia URLs and
1141+-- Knowledge Graph MIDs are provided, if available. The associated keys are
1142+-- \"wikipedia_url\" and \"mid\", respectively.
1143+--
1144+-- /See:/ 'entityMetadata' smart constructor.
1145+newtype EntityMetadata = EntityMetadata'
1146+ { _emAddtional :: HashMap Text Text
1147+ } deriving (Eq,Show,Data,Typeable,Generic)
1148+
1149+-- | Creates a value of 'EntityMetadata' with the minimum fields required to make a request.
1150+--
1151+-- Use one of the following lenses to modify other fields as desired:
1152+--
1153+-- * 'emAddtional'
1154+entityMetadata
1155+ :: HashMap Text Text -- ^ 'emAddtional'
1156+ -> EntityMetadata
1157+entityMetadata pEmAddtional_ =
1158+ EntityMetadata'
1159+ { _emAddtional = _Coerce # pEmAddtional_
1160+ }
1161+
1162+emAddtional :: Lens' EntityMetadata (HashMap Text Text)
1163+emAddtional
1164+ = lens _emAddtional (\ s a -> s{_emAddtional = a}) .
1165+ _Coerce
1166+
1167+instance FromJSON EntityMetadata where
1168+ parseJSON
1169+ = withObject "EntityMetadata"
1170+ (\ o -> EntityMetadata' <$> (parseJSONObject o))
1171+
1172+instance ToJSON EntityMetadata where
1173+ toJSON = toJSON . _emAddtional
1174+
1175+-- | Represents part of speech information for a token. Parts of speech are
1176+-- as defined in
1177+-- http:\/\/www.lrec-conf.org\/proceedings\/lrec2012\/pdf\/274_Paper.pdf
1178+--
1179+-- /See:/ 'partOfSpeech' smart constructor.
1180+data PartOfSpeech = PartOfSpeech'
1181+ { _posProper :: !(Maybe PartOfSpeechProper)
1182+ , _posTag :: !(Maybe PartOfSpeechTag)
1183+ , _posPerson :: !(Maybe PartOfSpeechPerson)
1184+ , _posAspect :: !(Maybe PartOfSpeechAspect)
1185+ , _posCase :: !(Maybe PartOfSpeechCase)
1186+ , _posGender :: !(Maybe PartOfSpeechGender)
1187+ , _posReciprocity :: !(Maybe PartOfSpeechReciprocity)
1188+ , _posNumber :: !(Maybe PartOfSpeechNumber)
1189+ , _posVoice :: !(Maybe PartOfSpeechVoice)
1190+ , _posForm :: !(Maybe PartOfSpeechForm)
1191+ , _posTense :: !(Maybe PartOfSpeechTense)
1192+ , _posMood :: !(Maybe PartOfSpeechMood)
1193+ } deriving (Eq,Show,Data,Typeable,Generic)
1194+
1195+-- | Creates a value of 'PartOfSpeech' with the minimum fields required to make a request.
1196+--
1197+-- Use one of the following lenses to modify other fields as desired:
1198+--
1199+-- * 'posProper'
1200+--
1201+-- * 'posTag'
1202+--
1203+-- * 'posPerson'
1204+--
1205+-- * 'posAspect'
1206+--
1207+-- * 'posCase'
1208+--
1209+-- * 'posGender'
1210+--
1211+-- * 'posReciprocity'
1212+--
1213+-- * 'posNumber'
1214+--
1215+-- * 'posVoice'
1216+--
1217+-- * 'posForm'
1218+--
1219+-- * 'posTense'
1220+--
1221+-- * 'posMood'
1222+partOfSpeech
1223+ :: PartOfSpeech
1224+partOfSpeech =
1225+ PartOfSpeech'
1226+ { _posProper = Nothing
1227+ , _posTag = Nothing
1228+ , _posPerson = Nothing
1229+ , _posAspect = Nothing
1230+ , _posCase = Nothing
1231+ , _posGender = Nothing
1232+ , _posReciprocity = Nothing
1233+ , _posNumber = Nothing
1234+ , _posVoice = Nothing
1235+ , _posForm = Nothing
1236+ , _posTense = Nothing
1237+ , _posMood = Nothing
1238+ }
1239+
1240+-- | The grammatical properness.
1241+posProper :: Lens' PartOfSpeech (Maybe PartOfSpeechProper)
1242+posProper
1243+ = lens _posProper (\ s a -> s{_posProper = a})
1244+
1245+-- | The part of speech tag.
1246+posTag :: Lens' PartOfSpeech (Maybe PartOfSpeechTag)
1247+posTag = lens _posTag (\ s a -> s{_posTag = a})
1248+
1249+-- | The grammatical person.
1250+posPerson :: Lens' PartOfSpeech (Maybe PartOfSpeechPerson)
1251+posPerson
1252+ = lens _posPerson (\ s a -> s{_posPerson = a})
1253+
1254+-- | The grammatical aspect.
1255+posAspect :: Lens' PartOfSpeech (Maybe PartOfSpeechAspect)
1256+posAspect
1257+ = lens _posAspect (\ s a -> s{_posAspect = a})
1258+
1259+-- | The grammatical case.
1260+posCase :: Lens' PartOfSpeech (Maybe PartOfSpeechCase)
1261+posCase = lens _posCase (\ s a -> s{_posCase = a})
1262+
1263+-- | The grammatical gender.
1264+posGender :: Lens' PartOfSpeech (Maybe PartOfSpeechGender)
1265+posGender
1266+ = lens _posGender (\ s a -> s{_posGender = a})
1267+
1268+-- | The grammatical reciprocity.
1269+posReciprocity :: Lens' PartOfSpeech (Maybe PartOfSpeechReciprocity)
1270+posReciprocity
1271+ = lens _posReciprocity
1272+ (\ s a -> s{_posReciprocity = a})
1273+
1274+-- | The grammatical number.
1275+posNumber :: Lens' PartOfSpeech (Maybe PartOfSpeechNumber)
1276+posNumber
1277+ = lens _posNumber (\ s a -> s{_posNumber = a})
1278+
1279+-- | The grammatical voice.
1280+posVoice :: Lens' PartOfSpeech (Maybe PartOfSpeechVoice)
1281+posVoice = lens _posVoice (\ s a -> s{_posVoice = a})
1282+
1283+-- | The grammatical form.
1284+posForm :: Lens' PartOfSpeech (Maybe PartOfSpeechForm)
1285+posForm = lens _posForm (\ s a -> s{_posForm = a})
1286+
1287+-- | The grammatical tense.
1288+posTense :: Lens' PartOfSpeech (Maybe PartOfSpeechTense)
1289+posTense = lens _posTense (\ s a -> s{_posTense = a})
1290+
1291+-- | The grammatical mood.
1292+posMood :: Lens' PartOfSpeech (Maybe PartOfSpeechMood)
1293+posMood = lens _posMood (\ s a -> s{_posMood = a})
1294+
1295+instance FromJSON PartOfSpeech where
1296+ parseJSON
1297+ = withObject "PartOfSpeech"
1298+ (\ o ->
1299+ PartOfSpeech' <$>
1300+ (o .:? "proper") <*> (o .:? "tag") <*>
1301+ (o .:? "person")
1302+ <*> (o .:? "aspect")
1303+ <*> (o .:? "case")
1304+ <*> (o .:? "gender")
1305+ <*> (o .:? "reciprocity")
1306+ <*> (o .:? "number")
1307+ <*> (o .:? "voice")
1308+ <*> (o .:? "form")
1309+ <*> (o .:? "tense")
1310+ <*> (o .:? "mood"))
1311+
1312+instance ToJSON PartOfSpeech where
1313+ toJSON PartOfSpeech'{..}
1314+ = object
1315+ (catMaybes
1316+ [("proper" .=) <$> _posProper,
1317+ ("tag" .=) <$> _posTag, ("person" .=) <$> _posPerson,
1318+ ("aspect" .=) <$> _posAspect,
1319+ ("case" .=) <$> _posCase,
1320+ ("gender" .=) <$> _posGender,
1321+ ("reciprocity" .=) <$> _posReciprocity,
1322+ ("number" .=) <$> _posNumber,
1323+ ("voice" .=) <$> _posVoice, ("form" .=) <$> _posForm,
1324+ ("tense" .=) <$> _posTense,
1325+ ("mood" .=) <$> _posMood])
1326+
1327+-- | Represents a sentence in the input document.
1328+--
1329+-- /See:/ 'sentence' smart constructor.
1330+data Sentence = Sentence'
1331+ { _sSentiment :: !(Maybe Sentiment)
1332+ , _sText :: !(Maybe TextSpan)
1333+ } deriving (Eq,Show,Data,Typeable,Generic)
1334+
1335+-- | Creates a value of 'Sentence' with the minimum fields required to make a request.
1336+--
1337+-- Use one of the following lenses to modify other fields as desired:
1338+--
1339+-- * 'sSentiment'
1340+--
1341+-- * 'sText'
1342+sentence
1343+ :: Sentence
1344+sentence =
1345+ Sentence'
1346+ { _sSentiment = Nothing
1347+ , _sText = Nothing
1348+ }
1349+
1350+-- | For calls to AnalyzeSentiment or if
1351+-- AnnotateTextRequest.Features.extract_document_sentiment is set to true,
1352+-- this field will contain the sentiment for the sentence.
1353+sSentiment :: Lens' Sentence (Maybe Sentiment)
1354+sSentiment
1355+ = lens _sSentiment (\ s a -> s{_sSentiment = a})
1356+
1357+-- | The sentence text.
1358+sText :: Lens' Sentence (Maybe TextSpan)
1359+sText = lens _sText (\ s a -> s{_sText = a})
1360+
1361+instance FromJSON Sentence where
1362+ parseJSON
1363+ = withObject "Sentence"
1364+ (\ o ->
1365+ Sentence' <$> (o .:? "sentiment") <*> (o .:? "text"))
1366+
1367+instance ToJSON Sentence where
1368+ toJSON Sentence'{..}
1369+ = object
1370+ (catMaybes
1371+ [("sentiment" .=) <$> _sSentiment,
1372+ ("text" .=) <$> _sText])
gogol-language/gen/Network/Google/Language/Types/Sum.hsnew file+1403
@@ -0,0 +1,1403 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE LambdaCase #-}
4+{-# LANGUAGE NoImplicitPrelude #-}
5+{-# LANGUAGE OverloadedStrings #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
8+
9+-- |
10+-- Module : Network.Google.Language.Types.Sum
11+-- Copyright : (c) 2015-2016 Brendan Hay
12+-- License : Mozilla Public License, v. 2.0.
13+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
14+-- Stability : auto-generated
15+-- Portability : non-portable (GHC extensions)
16+--
17+module Network.Google.Language.Types.Sum where
18+
19+import Network.Google.Prelude
20+
21+-- | The grammatical properness.
22+data PartOfSpeechProper
23+ = ProperUnknown
24+ -- ^ @PROPER_UNKNOWN@
25+ -- Proper is not applicable in the analyzed language or is not predicted.
26+ | Proper
27+ -- ^ @PROPER@
28+ -- Proper
29+ | NotProper
30+ -- ^ @NOT_PROPER@
31+ -- Not proper
32+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
33+
34+instance Hashable PartOfSpeechProper
35+
36+instance FromHttpApiData PartOfSpeechProper where
37+ parseQueryParam = \case
38+ "PROPER_UNKNOWN" -> Right ProperUnknown
39+ "PROPER" -> Right Proper
40+ "NOT_PROPER" -> Right NotProper
41+ x -> Left ("Unable to parse PartOfSpeechProper from: " <> x)
42+
43+instance ToHttpApiData PartOfSpeechProper where
44+ toQueryParam = \case
45+ ProperUnknown -> "PROPER_UNKNOWN"
46+ Proper -> "PROPER"
47+ NotProper -> "NOT_PROPER"
48+
49+instance FromJSON PartOfSpeechProper where
50+ parseJSON = parseJSONText "PartOfSpeechProper"
51+
52+instance ToJSON PartOfSpeechProper where
53+ toJSON = toJSONText
54+
55+-- | The part of speech tag.
56+data PartOfSpeechTag
57+ = Unknown
58+ -- ^ @UNKNOWN@
59+ -- Unknown
60+ | Adj
61+ -- ^ @ADJ@
62+ -- Adjective
63+ | Adp
64+ -- ^ @ADP@
65+ -- Adposition (preposition and postposition)
66+ | Adv
67+ -- ^ @ADV@
68+ -- Adverb
69+ | Conj
70+ -- ^ @CONJ@
71+ -- Conjunction
72+ | Det
73+ -- ^ @DET@
74+ -- Determiner
75+ | Noun
76+ -- ^ @NOUN@
77+ -- Noun (common and proper)
78+ | Num
79+ -- ^ @NUM@
80+ -- Cardinal number
81+ | Pron
82+ -- ^ @PRON@
83+ -- Pronoun
84+ | Prt
85+ -- ^ @PRT@
86+ -- Particle or other function word
87+ | Punct
88+ -- ^ @PUNCT@
89+ -- Punctuation
90+ | Verb
91+ -- ^ @VERB@
92+ -- Verb (all tenses and modes)
93+ | X
94+ -- ^ @X@
95+ -- Other: foreign words, typos, abbreviations
96+ | Affix
97+ -- ^ @AFFIX@
98+ -- Affix
99+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
100+
101+instance Hashable PartOfSpeechTag
102+
103+instance FromHttpApiData PartOfSpeechTag where
104+ parseQueryParam = \case
105+ "UNKNOWN" -> Right Unknown
106+ "ADJ" -> Right Adj
107+ "ADP" -> Right Adp
108+ "ADV" -> Right Adv
109+ "CONJ" -> Right Conj
110+ "DET" -> Right Det
111+ "NOUN" -> Right Noun
112+ "NUM" -> Right Num
113+ "PRON" -> Right Pron
114+ "PRT" -> Right Prt
115+ "PUNCT" -> Right Punct
116+ "VERB" -> Right Verb
117+ "X" -> Right X
118+ "AFFIX" -> Right Affix
119+ x -> Left ("Unable to parse PartOfSpeechTag from: " <> x)
120+
121+instance ToHttpApiData PartOfSpeechTag where
122+ toQueryParam = \case
123+ Unknown -> "UNKNOWN"
124+ Adj -> "ADJ"
125+ Adp -> "ADP"
126+ Adv -> "ADV"
127+ Conj -> "CONJ"
128+ Det -> "DET"
129+ Noun -> "NOUN"
130+ Num -> "NUM"
131+ Pron -> "PRON"
132+ Prt -> "PRT"
133+ Punct -> "PUNCT"
134+ Verb -> "VERB"
135+ X -> "X"
136+ Affix -> "AFFIX"
137+
138+instance FromJSON PartOfSpeechTag where
139+ parseJSON = parseJSONText "PartOfSpeechTag"
140+
141+instance ToJSON PartOfSpeechTag where
142+ toJSON = toJSONText
143+
144+-- | Required. If the type is not set or is \`TYPE_UNSPECIFIED\`, returns an
145+-- \`INVALID_ARGUMENT\` error.
146+data DocumentType
147+ = TypeUnspecified
148+ -- ^ @TYPE_UNSPECIFIED@
149+ -- The content type is not specified.
150+ | PlainText
151+ -- ^ @PLAIN_TEXT@
152+ -- Plain text
153+ | HTML
154+ -- ^ @HTML@
155+ -- HTML
156+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
157+
158+instance Hashable DocumentType
159+
160+instance FromHttpApiData DocumentType where
161+ parseQueryParam = \case
162+ "TYPE_UNSPECIFIED" -> Right TypeUnspecified
163+ "PLAIN_TEXT" -> Right PlainText
164+ "HTML" -> Right HTML
165+ x -> Left ("Unable to parse DocumentType from: " <> x)
166+
167+instance ToHttpApiData DocumentType where
168+ toQueryParam = \case
169+ TypeUnspecified -> "TYPE_UNSPECIFIED"
170+ PlainText -> "PLAIN_TEXT"
171+ HTML -> "HTML"
172+
173+instance FromJSON DocumentType where
174+ parseJSON = parseJSONText "DocumentType"
175+
176+instance ToJSON DocumentType where
177+ toJSON = toJSONText
178+
179+-- | The encoding type used by the API to calculate offsets.
180+data AnalyzeSyntaxRequestEncodingType
181+ = None
182+ -- ^ @NONE@
183+ -- If \`EncodingType\` is not specified, encoding-dependent information
184+ -- (such as \`begin_offset\`) will be set at \`-1\`.
185+ | UTF8
186+ -- ^ @UTF8@
187+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
188+ -- based on the UTF-8 encoding of the input. C++ and Go are examples of
189+ -- languages that use this encoding natively.
190+ | UTF16
191+ -- ^ @UTF16@
192+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
193+ -- based on the UTF-16 encoding of the input. Java and Javascript are
194+ -- examples of languages that use this encoding natively.
195+ | UTF32
196+ -- ^ @UTF32@
197+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
198+ -- based on the UTF-32 encoding of the input. Python is an example of a
199+ -- language that uses this encoding natively.
200+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
201+
202+instance Hashable AnalyzeSyntaxRequestEncodingType
203+
204+instance FromHttpApiData AnalyzeSyntaxRequestEncodingType where
205+ parseQueryParam = \case
206+ "NONE" -> Right None
207+ "UTF8" -> Right UTF8
208+ "UTF16" -> Right UTF16
209+ "UTF32" -> Right UTF32
210+ x -> Left ("Unable to parse AnalyzeSyntaxRequestEncodingType from: " <> x)
211+
212+instance ToHttpApiData AnalyzeSyntaxRequestEncodingType where
213+ toQueryParam = \case
214+ None -> "NONE"
215+ UTF8 -> "UTF8"
216+ UTF16 -> "UTF16"
217+ UTF32 -> "UTF32"
218+
219+instance FromJSON AnalyzeSyntaxRequestEncodingType where
220+ parseJSON = parseJSONText "AnalyzeSyntaxRequestEncodingType"
221+
222+instance ToJSON AnalyzeSyntaxRequestEncodingType where
223+ toJSON = toJSONText
224+
225+-- | The parse label for the token.
226+data DependencyEdgeLabel
227+ = DELUnknown
228+ -- ^ @UNKNOWN@
229+ -- Unknown
230+ | DELAbbrev
231+ -- ^ @ABBREV@
232+ -- Abbreviation modifier
233+ | DELAcomp
234+ -- ^ @ACOMP@
235+ -- Adjectival complement
236+ | DELAdvcl
237+ -- ^ @ADVCL@
238+ -- Adverbial clause modifier
239+ | DELAdvmod
240+ -- ^ @ADVMOD@
241+ -- Adverbial modifier
242+ | DELAmod
243+ -- ^ @AMOD@
244+ -- Adjectival modifier of an NP
245+ | DELAppos
246+ -- ^ @APPOS@
247+ -- Appositional modifier of an NP
248+ | DELAttr
249+ -- ^ @ATTR@
250+ -- Attribute dependent of a copular verb
251+ | DELAux
252+ -- ^ @AUX@
253+ -- Auxiliary (non-main) verb
254+ | DELAuxpass
255+ -- ^ @AUXPASS@
256+ -- Passive auxiliary
257+ | DELCC
258+ -- ^ @CC@
259+ -- Coordinating conjunction
260+ | DELCcomp
261+ -- ^ @CCOMP@
262+ -- Clausal complement of a verb or adjective
263+ | DELConj
264+ -- ^ @CONJ@
265+ -- Conjunct
266+ | DELCsubj
267+ -- ^ @CSUBJ@
268+ -- Clausal subject
269+ | DELCsubjpass
270+ -- ^ @CSUBJPASS@
271+ -- Clausal passive subject
272+ | DELDep
273+ -- ^ @DEP@
274+ -- Dependency (unable to determine)
275+ | DELDet
276+ -- ^ @DET@
277+ -- Determiner
278+ | DELDiscourse
279+ -- ^ @DISCOURSE@
280+ -- Discourse
281+ | DELDobj
282+ -- ^ @DOBJ@
283+ -- Direct object
284+ | DELExpl
285+ -- ^ @EXPL@
286+ -- Expletive
287+ | DELGoeswith
288+ -- ^ @GOESWITH@
289+ -- Goes with (part of a word in a text not well edited)
290+ | DELIobj
291+ -- ^ @IOBJ@
292+ -- Indirect object
293+ | DELMark
294+ -- ^ @MARK@
295+ -- Marker (word introducing a subordinate clause)
296+ | DELMwe
297+ -- ^ @MWE@
298+ -- Multi-word expression
299+ | DELMwv
300+ -- ^ @MWV@
301+ -- Multi-word verbal expression
302+ | DELNeg
303+ -- ^ @NEG@
304+ -- Negation modifier
305+ | DELNN
306+ -- ^ @NN@
307+ -- Noun compound modifier
308+ | DELNpadvmod
309+ -- ^ @NPADVMOD@
310+ -- Noun phrase used as an adverbial modifier
311+ | DELNsubj
312+ -- ^ @NSUBJ@
313+ -- Nominal subject
314+ | DELNsubjpass
315+ -- ^ @NSUBJPASS@
316+ -- Passive nominal subject
317+ | DELNum
318+ -- ^ @NUM@
319+ -- Numeric modifier of a noun
320+ | DELNumber
321+ -- ^ @NUMBER@
322+ -- Element of compound number
323+ | DELP
324+ -- ^ @P@
325+ -- Punctuation mark
326+ | DELParataxis
327+ -- ^ @PARATAXIS@
328+ -- Parataxis relation
329+ | DELPartmod
330+ -- ^ @PARTMOD@
331+ -- Participial modifier
332+ | DELPcomp
333+ -- ^ @PCOMP@
334+ -- The complement of a preposition is a clause
335+ | DELPobj
336+ -- ^ @POBJ@
337+ -- Object of a preposition
338+ | DELPoss
339+ -- ^ @POSS@
340+ -- Possession modifier
341+ | DELPostneg
342+ -- ^ @POSTNEG@
343+ -- Postverbal negative particle
344+ | DELPrecomp
345+ -- ^ @PRECOMP@
346+ -- Predicate complement
347+ | DELPreconj
348+ -- ^ @PRECONJ@
349+ -- Preconjunt
350+ | DELPredet
351+ -- ^ @PREDET@
352+ -- Predeterminer
353+ | DELPref
354+ -- ^ @PREF@
355+ -- Prefix
356+ | DELPrep
357+ -- ^ @PREP@
358+ -- Prepositional modifier
359+ | DELPronl
360+ -- ^ @PRONL@
361+ -- The relationship between a verb and verbal morpheme
362+ | DELPrt
363+ -- ^ @PRT@
364+ -- Particle
365+ | DELPS
366+ -- ^ @PS@
367+ -- Associative or possessive marker
368+ | DELQuantmod
369+ -- ^ @QUANTMOD@
370+ -- Quantifier phrase modifier
371+ | DELRcmod
372+ -- ^ @RCMOD@
373+ -- Relative clause modifier
374+ | DELRcmodrel
375+ -- ^ @RCMODREL@
376+ -- Complementizer in relative clause
377+ | DELRdrop
378+ -- ^ @RDROP@
379+ -- Ellipsis without a preceding predicate
380+ | DELRef
381+ -- ^ @REF@
382+ -- Referent
383+ | DELRemnant
384+ -- ^ @REMNANT@
385+ -- Remnant
386+ | DELReparandum
387+ -- ^ @REPARANDUM@
388+ -- Reparandum
389+ | DELRoot
390+ -- ^ @ROOT@
391+ -- Root
392+ | DELSnum
393+ -- ^ @SNUM@
394+ -- Suffix specifying a unit of number
395+ | DELSuff
396+ -- ^ @SUFF@
397+ -- Suffix
398+ | DELTmod
399+ -- ^ @TMOD@
400+ -- Temporal modifier
401+ | DELTopic
402+ -- ^ @TOPIC@
403+ -- Topic marker
404+ | DELVMod
405+ -- ^ @VMOD@
406+ -- Clause headed by an infinite form of the verb that modifies a noun
407+ | DELVocative
408+ -- ^ @VOCATIVE@
409+ -- Vocative
410+ | DELXcomp
411+ -- ^ @XCOMP@
412+ -- Open clausal complement
413+ | DELSuffix
414+ -- ^ @SUFFIX@
415+ -- Name suffix
416+ | DELTitle
417+ -- ^ @TITLE@
418+ -- Name title
419+ | DELAdvphmod
420+ -- ^ @ADVPHMOD@
421+ -- Adverbial phrase modifier
422+ | DELAuxcaus
423+ -- ^ @AUXCAUS@
424+ -- Causative auxiliary
425+ | DELAuxvv
426+ -- ^ @AUXVV@
427+ -- Helper auxiliary
428+ | DELDtmod
429+ -- ^ @DTMOD@
430+ -- Rentaishi (Prenominal modifier)
431+ | DELForeign
432+ -- ^ @FOREIGN@
433+ -- Foreign words
434+ | DELKW
435+ -- ^ @KW@
436+ -- Keyword
437+ | DELList
438+ -- ^ @LIST@
439+ -- List for chains of comparable items
440+ | DELNomc
441+ -- ^ @NOMC@
442+ -- Nominalized clause
443+ | DELNomcsubj
444+ -- ^ @NOMCSUBJ@
445+ -- Nominalized clausal subject
446+ | DELNomcsubjpass
447+ -- ^ @NOMCSUBJPASS@
448+ -- Nominalized clausal passive
449+ | DELNumc
450+ -- ^ @NUMC@
451+ -- Compound of numeric modifier
452+ | DELCop
453+ -- ^ @COP@
454+ -- Copula
455+ | DELDislocated
456+ -- ^ @DISLOCATED@
457+ -- Dislocated relation (for fronted\/topicalized elements)
458+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
459+
460+instance Hashable DependencyEdgeLabel
461+
462+instance FromHttpApiData DependencyEdgeLabel where
463+ parseQueryParam = \case
464+ "UNKNOWN" -> Right DELUnknown
465+ "ABBREV" -> Right DELAbbrev
466+ "ACOMP" -> Right DELAcomp
467+ "ADVCL" -> Right DELAdvcl
468+ "ADVMOD" -> Right DELAdvmod
469+ "AMOD" -> Right DELAmod
470+ "APPOS" -> Right DELAppos
471+ "ATTR" -> Right DELAttr
472+ "AUX" -> Right DELAux
473+ "AUXPASS" -> Right DELAuxpass
474+ "CC" -> Right DELCC
475+ "CCOMP" -> Right DELCcomp
476+ "CONJ" -> Right DELConj
477+ "CSUBJ" -> Right DELCsubj
478+ "CSUBJPASS" -> Right DELCsubjpass
479+ "DEP" -> Right DELDep
480+ "DET" -> Right DELDet
481+ "DISCOURSE" -> Right DELDiscourse
482+ "DOBJ" -> Right DELDobj
483+ "EXPL" -> Right DELExpl
484+ "GOESWITH" -> Right DELGoeswith
485+ "IOBJ" -> Right DELIobj
486+ "MARK" -> Right DELMark
487+ "MWE" -> Right DELMwe
488+ "MWV" -> Right DELMwv
489+ "NEG" -> Right DELNeg
490+ "NN" -> Right DELNN
491+ "NPADVMOD" -> Right DELNpadvmod
492+ "NSUBJ" -> Right DELNsubj
493+ "NSUBJPASS" -> Right DELNsubjpass
494+ "NUM" -> Right DELNum
495+ "NUMBER" -> Right DELNumber
496+ "P" -> Right DELP
497+ "PARATAXIS" -> Right DELParataxis
498+ "PARTMOD" -> Right DELPartmod
499+ "PCOMP" -> Right DELPcomp
500+ "POBJ" -> Right DELPobj
501+ "POSS" -> Right DELPoss
502+ "POSTNEG" -> Right DELPostneg
503+ "PRECOMP" -> Right DELPrecomp
504+ "PRECONJ" -> Right DELPreconj
505+ "PREDET" -> Right DELPredet
506+ "PREF" -> Right DELPref
507+ "PREP" -> Right DELPrep
508+ "PRONL" -> Right DELPronl
509+ "PRT" -> Right DELPrt
510+ "PS" -> Right DELPS
511+ "QUANTMOD" -> Right DELQuantmod
512+ "RCMOD" -> Right DELRcmod
513+ "RCMODREL" -> Right DELRcmodrel
514+ "RDROP" -> Right DELRdrop
515+ "REF" -> Right DELRef
516+ "REMNANT" -> Right DELRemnant
517+ "REPARANDUM" -> Right DELReparandum
518+ "ROOT" -> Right DELRoot
519+ "SNUM" -> Right DELSnum
520+ "SUFF" -> Right DELSuff
521+ "TMOD" -> Right DELTmod
522+ "TOPIC" -> Right DELTopic
523+ "VMOD" -> Right DELVMod
524+ "VOCATIVE" -> Right DELVocative
525+ "XCOMP" -> Right DELXcomp
526+ "SUFFIX" -> Right DELSuffix
527+ "TITLE" -> Right DELTitle
528+ "ADVPHMOD" -> Right DELAdvphmod
529+ "AUXCAUS" -> Right DELAuxcaus
530+ "AUXVV" -> Right DELAuxvv
531+ "DTMOD" -> Right DELDtmod
532+ "FOREIGN" -> Right DELForeign
533+ "KW" -> Right DELKW
534+ "LIST" -> Right DELList
535+ "NOMC" -> Right DELNomc
536+ "NOMCSUBJ" -> Right DELNomcsubj
537+ "NOMCSUBJPASS" -> Right DELNomcsubjpass
538+ "NUMC" -> Right DELNumc
539+ "COP" -> Right DELCop
540+ "DISLOCATED" -> Right DELDislocated
541+ x -> Left ("Unable to parse DependencyEdgeLabel from: " <> x)
542+
543+instance ToHttpApiData DependencyEdgeLabel where
544+ toQueryParam = \case
545+ DELUnknown -> "UNKNOWN"
546+ DELAbbrev -> "ABBREV"
547+ DELAcomp -> "ACOMP"
548+ DELAdvcl -> "ADVCL"
549+ DELAdvmod -> "ADVMOD"
550+ DELAmod -> "AMOD"
551+ DELAppos -> "APPOS"
552+ DELAttr -> "ATTR"
553+ DELAux -> "AUX"
554+ DELAuxpass -> "AUXPASS"
555+ DELCC -> "CC"
556+ DELCcomp -> "CCOMP"
557+ DELConj -> "CONJ"
558+ DELCsubj -> "CSUBJ"
559+ DELCsubjpass -> "CSUBJPASS"
560+ DELDep -> "DEP"
561+ DELDet -> "DET"
562+ DELDiscourse -> "DISCOURSE"
563+ DELDobj -> "DOBJ"
564+ DELExpl -> "EXPL"
565+ DELGoeswith -> "GOESWITH"
566+ DELIobj -> "IOBJ"
567+ DELMark -> "MARK"
568+ DELMwe -> "MWE"
569+ DELMwv -> "MWV"
570+ DELNeg -> "NEG"
571+ DELNN -> "NN"
572+ DELNpadvmod -> "NPADVMOD"
573+ DELNsubj -> "NSUBJ"
574+ DELNsubjpass -> "NSUBJPASS"
575+ DELNum -> "NUM"
576+ DELNumber -> "NUMBER"
577+ DELP -> "P"
578+ DELParataxis -> "PARATAXIS"
579+ DELPartmod -> "PARTMOD"
580+ DELPcomp -> "PCOMP"
581+ DELPobj -> "POBJ"
582+ DELPoss -> "POSS"
583+ DELPostneg -> "POSTNEG"
584+ DELPrecomp -> "PRECOMP"
585+ DELPreconj -> "PRECONJ"
586+ DELPredet -> "PREDET"
587+ DELPref -> "PREF"
588+ DELPrep -> "PREP"
589+ DELPronl -> "PRONL"
590+ DELPrt -> "PRT"
591+ DELPS -> "PS"
592+ DELQuantmod -> "QUANTMOD"
593+ DELRcmod -> "RCMOD"
594+ DELRcmodrel -> "RCMODREL"
595+ DELRdrop -> "RDROP"
596+ DELRef -> "REF"
597+ DELRemnant -> "REMNANT"
598+ DELReparandum -> "REPARANDUM"
599+ DELRoot -> "ROOT"
600+ DELSnum -> "SNUM"
601+ DELSuff -> "SUFF"
602+ DELTmod -> "TMOD"
603+ DELTopic -> "TOPIC"
604+ DELVMod -> "VMOD"
605+ DELVocative -> "VOCATIVE"
606+ DELXcomp -> "XCOMP"
607+ DELSuffix -> "SUFFIX"
608+ DELTitle -> "TITLE"
609+ DELAdvphmod -> "ADVPHMOD"
610+ DELAuxcaus -> "AUXCAUS"
611+ DELAuxvv -> "AUXVV"
612+ DELDtmod -> "DTMOD"
613+ DELForeign -> "FOREIGN"
614+ DELKW -> "KW"
615+ DELList -> "LIST"
616+ DELNomc -> "NOMC"
617+ DELNomcsubj -> "NOMCSUBJ"
618+ DELNomcsubjpass -> "NOMCSUBJPASS"
619+ DELNumc -> "NUMC"
620+ DELCop -> "COP"
621+ DELDislocated -> "DISLOCATED"
622+
623+instance FromJSON DependencyEdgeLabel where
624+ parseJSON = parseJSONText "DependencyEdgeLabel"
625+
626+instance ToJSON DependencyEdgeLabel where
627+ toJSON = toJSONText
628+
629+-- | The grammatical voice.
630+data PartOfSpeechVoice
631+ = VoiceUnknown
632+ -- ^ @VOICE_UNKNOWN@
633+ -- Voice is not applicable in the analyzed language or is not predicted.
634+ | Active
635+ -- ^ @ACTIVE@
636+ -- Active
637+ | Causative
638+ -- ^ @CAUSATIVE@
639+ -- Causative
640+ | Passive
641+ -- ^ @PASSIVE@
642+ -- Passive
643+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
644+
645+instance Hashable PartOfSpeechVoice
646+
647+instance FromHttpApiData PartOfSpeechVoice where
648+ parseQueryParam = \case
649+ "VOICE_UNKNOWN" -> Right VoiceUnknown
650+ "ACTIVE" -> Right Active
651+ "CAUSATIVE" -> Right Causative
652+ "PASSIVE" -> Right Passive
653+ x -> Left ("Unable to parse PartOfSpeechVoice from: " <> x)
654+
655+instance ToHttpApiData PartOfSpeechVoice where
656+ toQueryParam = \case
657+ VoiceUnknown -> "VOICE_UNKNOWN"
658+ Active -> "ACTIVE"
659+ Causative -> "CAUSATIVE"
660+ Passive -> "PASSIVE"
661+
662+instance FromJSON PartOfSpeechVoice where
663+ parseJSON = parseJSONText "PartOfSpeechVoice"
664+
665+instance ToJSON PartOfSpeechVoice where
666+ toJSON = toJSONText
667+
668+-- | The grammatical form.
669+data PartOfSpeechForm
670+ = FormUnknown
671+ -- ^ @FORM_UNKNOWN@
672+ -- Form is not applicable in the analyzed language or is not predicted.
673+ | Adnomial
674+ -- ^ @ADNOMIAL@
675+ -- Adnomial
676+ | Auxiliary
677+ -- ^ @AUXILIARY@
678+ -- Auxiliary
679+ | Complementizer
680+ -- ^ @COMPLEMENTIZER@
681+ -- Complementizer
682+ | FinalEnding
683+ -- ^ @FINAL_ENDING@
684+ -- Final ending
685+ | Gerund
686+ -- ^ @GERUND@
687+ -- Gerund
688+ | Realis
689+ -- ^ @REALIS@
690+ -- Realis
691+ | Irrealis
692+ -- ^ @IRREALIS@
693+ -- Irrealis
694+ | Short
695+ -- ^ @SHORT@
696+ -- Short form
697+ | Long
698+ -- ^ @LONG@
699+ -- Long form
700+ | Order
701+ -- ^ @ORDER@
702+ -- Order form
703+ | Specific
704+ -- ^ @SPECIFIC@
705+ -- Specific form
706+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
707+
708+instance Hashable PartOfSpeechForm
709+
710+instance FromHttpApiData PartOfSpeechForm where
711+ parseQueryParam = \case
712+ "FORM_UNKNOWN" -> Right FormUnknown
713+ "ADNOMIAL" -> Right Adnomial
714+ "AUXILIARY" -> Right Auxiliary
715+ "COMPLEMENTIZER" -> Right Complementizer
716+ "FINAL_ENDING" -> Right FinalEnding
717+ "GERUND" -> Right Gerund
718+ "REALIS" -> Right Realis
719+ "IRREALIS" -> Right Irrealis
720+ "SHORT" -> Right Short
721+ "LONG" -> Right Long
722+ "ORDER" -> Right Order
723+ "SPECIFIC" -> Right Specific
724+ x -> Left ("Unable to parse PartOfSpeechForm from: " <> x)
725+
726+instance ToHttpApiData PartOfSpeechForm where
727+ toQueryParam = \case
728+ FormUnknown -> "FORM_UNKNOWN"
729+ Adnomial -> "ADNOMIAL"
730+ Auxiliary -> "AUXILIARY"
731+ Complementizer -> "COMPLEMENTIZER"
732+ FinalEnding -> "FINAL_ENDING"
733+ Gerund -> "GERUND"
734+ Realis -> "REALIS"
735+ Irrealis -> "IRREALIS"
736+ Short -> "SHORT"
737+ Long -> "LONG"
738+ Order -> "ORDER"
739+ Specific -> "SPECIFIC"
740+
741+instance FromJSON PartOfSpeechForm where
742+ parseJSON = parseJSONText "PartOfSpeechForm"
743+
744+instance ToJSON PartOfSpeechForm where
745+ toJSON = toJSONText
746+
747+-- | The grammatical person.
748+data PartOfSpeechPerson
749+ = PersonUnknown
750+ -- ^ @PERSON_UNKNOWN@
751+ -- Person is not applicable in the analyzed language or is not predicted.
752+ | First
753+ -- ^ @FIRST@
754+ -- First
755+ | Second
756+ -- ^ @SECOND@
757+ -- Second
758+ | Third
759+ -- ^ @THIRD@
760+ -- Third
761+ | ReflexivePerson
762+ -- ^ @REFLEXIVE_PERSON@
763+ -- Reflexive
764+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
765+
766+instance Hashable PartOfSpeechPerson
767+
768+instance FromHttpApiData PartOfSpeechPerson where
769+ parseQueryParam = \case
770+ "PERSON_UNKNOWN" -> Right PersonUnknown
771+ "FIRST" -> Right First
772+ "SECOND" -> Right Second
773+ "THIRD" -> Right Third
774+ "REFLEXIVE_PERSON" -> Right ReflexivePerson
775+ x -> Left ("Unable to parse PartOfSpeechPerson from: " <> x)
776+
777+instance ToHttpApiData PartOfSpeechPerson where
778+ toQueryParam = \case
779+ PersonUnknown -> "PERSON_UNKNOWN"
780+ First -> "FIRST"
781+ Second -> "SECOND"
782+ Third -> "THIRD"
783+ ReflexivePerson -> "REFLEXIVE_PERSON"
784+
785+instance FromJSON PartOfSpeechPerson where
786+ parseJSON = parseJSONText "PartOfSpeechPerson"
787+
788+instance ToJSON PartOfSpeechPerson where
789+ toJSON = toJSONText
790+
791+-- | The entity type.
792+data EntityType
793+ = ETUnknown
794+ -- ^ @UNKNOWN@
795+ -- Unknown
796+ | ETPerson
797+ -- ^ @PERSON@
798+ -- Person
799+ | ETLocation
800+ -- ^ @LOCATION@
801+ -- Location
802+ | ETOrganization
803+ -- ^ @ORGANIZATION@
804+ -- Organization
805+ | ETEvent
806+ -- ^ @EVENT@
807+ -- Event
808+ | ETWorkOfArt
809+ -- ^ @WORK_OF_ART@
810+ -- Work of art
811+ | ETConsumerGood
812+ -- ^ @CONSUMER_GOOD@
813+ -- Consumer goods
814+ | ETOther
815+ -- ^ @OTHER@
816+ -- Other types
817+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
818+
819+instance Hashable EntityType
820+
821+instance FromHttpApiData EntityType where
822+ parseQueryParam = \case
823+ "UNKNOWN" -> Right ETUnknown
824+ "PERSON" -> Right ETPerson
825+ "LOCATION" -> Right ETLocation
826+ "ORGANIZATION" -> Right ETOrganization
827+ "EVENT" -> Right ETEvent
828+ "WORK_OF_ART" -> Right ETWorkOfArt
829+ "CONSUMER_GOOD" -> Right ETConsumerGood
830+ "OTHER" -> Right ETOther
831+ x -> Left ("Unable to parse EntityType from: " <> x)
832+
833+instance ToHttpApiData EntityType where
834+ toQueryParam = \case
835+ ETUnknown -> "UNKNOWN"
836+ ETPerson -> "PERSON"
837+ ETLocation -> "LOCATION"
838+ ETOrganization -> "ORGANIZATION"
839+ ETEvent -> "EVENT"
840+ ETWorkOfArt -> "WORK_OF_ART"
841+ ETConsumerGood -> "CONSUMER_GOOD"
842+ ETOther -> "OTHER"
843+
844+instance FromJSON EntityType where
845+ parseJSON = parseJSONText "EntityType"
846+
847+instance ToJSON EntityType where
848+ toJSON = toJSONText
849+
850+-- | The grammatical tense.
851+data PartOfSpeechTense
852+ = TenseUnknown
853+ -- ^ @TENSE_UNKNOWN@
854+ -- Tense is not applicable in the analyzed language or is not predicted.
855+ | ConditionalTense
856+ -- ^ @CONDITIONAL_TENSE@
857+ -- Conditional
858+ | Future
859+ -- ^ @FUTURE@
860+ -- Future
861+ | Past
862+ -- ^ @PAST@
863+ -- Past
864+ | Present
865+ -- ^ @PRESENT@
866+ -- Present
867+ | Imperfect
868+ -- ^ @IMPERFECT@
869+ -- Imperfect
870+ | Pluperfect
871+ -- ^ @PLUPERFECT@
872+ -- Pluperfect
873+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
874+
875+instance Hashable PartOfSpeechTense
876+
877+instance FromHttpApiData PartOfSpeechTense where
878+ parseQueryParam = \case
879+ "TENSE_UNKNOWN" -> Right TenseUnknown
880+ "CONDITIONAL_TENSE" -> Right ConditionalTense
881+ "FUTURE" -> Right Future
882+ "PAST" -> Right Past
883+ "PRESENT" -> Right Present
884+ "IMPERFECT" -> Right Imperfect
885+ "PLUPERFECT" -> Right Pluperfect
886+ x -> Left ("Unable to parse PartOfSpeechTense from: " <> x)
887+
888+instance ToHttpApiData PartOfSpeechTense where
889+ toQueryParam = \case
890+ TenseUnknown -> "TENSE_UNKNOWN"
891+ ConditionalTense -> "CONDITIONAL_TENSE"
892+ Future -> "FUTURE"
893+ Past -> "PAST"
894+ Present -> "PRESENT"
895+ Imperfect -> "IMPERFECT"
896+ Pluperfect -> "PLUPERFECT"
897+
898+instance FromJSON PartOfSpeechTense where
899+ parseJSON = parseJSONText "PartOfSpeechTense"
900+
901+instance ToJSON PartOfSpeechTense where
902+ toJSON = toJSONText
903+
904+-- | The grammatical mood.
905+data PartOfSpeechMood
906+ = MoodUnknown
907+ -- ^ @MOOD_UNKNOWN@
908+ -- Mood is not applicable in the analyzed language or is not predicted.
909+ | ConditionalMood
910+ -- ^ @CONDITIONAL_MOOD@
911+ -- Conditional
912+ | Imperative
913+ -- ^ @IMPERATIVE@
914+ -- Imperative
915+ | Indicative
916+ -- ^ @INDICATIVE@
917+ -- Indicative
918+ | Interrogative
919+ -- ^ @INTERROGATIVE@
920+ -- Interrogative
921+ | Jussive
922+ -- ^ @JUSSIVE@
923+ -- Jussive
924+ | Subjunctive
925+ -- ^ @SUBJUNCTIVE@
926+ -- Subjunctive
927+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
928+
929+instance Hashable PartOfSpeechMood
930+
931+instance FromHttpApiData PartOfSpeechMood where
932+ parseQueryParam = \case
933+ "MOOD_UNKNOWN" -> Right MoodUnknown
934+ "CONDITIONAL_MOOD" -> Right ConditionalMood
935+ "IMPERATIVE" -> Right Imperative
936+ "INDICATIVE" -> Right Indicative
937+ "INTERROGATIVE" -> Right Interrogative
938+ "JUSSIVE" -> Right Jussive
939+ "SUBJUNCTIVE" -> Right Subjunctive
940+ x -> Left ("Unable to parse PartOfSpeechMood from: " <> x)
941+
942+instance ToHttpApiData PartOfSpeechMood where
943+ toQueryParam = \case
944+ MoodUnknown -> "MOOD_UNKNOWN"
945+ ConditionalMood -> "CONDITIONAL_MOOD"
946+ Imperative -> "IMPERATIVE"
947+ Indicative -> "INDICATIVE"
948+ Interrogative -> "INTERROGATIVE"
949+ Jussive -> "JUSSIVE"
950+ Subjunctive -> "SUBJUNCTIVE"
951+
952+instance FromJSON PartOfSpeechMood where
953+ parseJSON = parseJSONText "PartOfSpeechMood"
954+
955+instance ToJSON PartOfSpeechMood where
956+ toJSON = toJSONText
957+
958+-- | The grammatical case.
959+data PartOfSpeechCase
960+ = CaseUnknown
961+ -- ^ @CASE_UNKNOWN@
962+ -- Case is not applicable in the analyzed language or is not predicted.
963+ | Accusative
964+ -- ^ @ACCUSATIVE@
965+ -- Accusative
966+ | Adverbial
967+ -- ^ @ADVERBIAL@
968+ -- Adverbial
969+ | Complementive
970+ -- ^ @COMPLEMENTIVE@
971+ -- Complementive
972+ | Dative
973+ -- ^ @DATIVE@
974+ -- Dative
975+ | Genitive
976+ -- ^ @GENITIVE@
977+ -- Genitive
978+ | Instrumental
979+ -- ^ @INSTRUMENTAL@
980+ -- Instrumental
981+ | Locative
982+ -- ^ @LOCATIVE@
983+ -- Locative
984+ | Nominative
985+ -- ^ @NOMINATIVE@
986+ -- Nominative
987+ | Oblique
988+ -- ^ @OBLIQUE@
989+ -- Oblique
990+ | Partitive
991+ -- ^ @PARTITIVE@
992+ -- Partitive
993+ | PrePositional
994+ -- ^ @PREPOSITIONAL@
995+ -- Prepositional
996+ | ReflexiveCase
997+ -- ^ @REFLEXIVE_CASE@
998+ -- Reflexive
999+ | RelativeCase
1000+ -- ^ @RELATIVE_CASE@
1001+ -- Relative
1002+ | Vocative
1003+ -- ^ @VOCATIVE@
1004+ -- Vocative
1005+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1006+
1007+instance Hashable PartOfSpeechCase
1008+
1009+instance FromHttpApiData PartOfSpeechCase where
1010+ parseQueryParam = \case
1011+ "CASE_UNKNOWN" -> Right CaseUnknown
1012+ "ACCUSATIVE" -> Right Accusative
1013+ "ADVERBIAL" -> Right Adverbial
1014+ "COMPLEMENTIVE" -> Right Complementive
1015+ "DATIVE" -> Right Dative
1016+ "GENITIVE" -> Right Genitive
1017+ "INSTRUMENTAL" -> Right Instrumental
1018+ "LOCATIVE" -> Right Locative
1019+ "NOMINATIVE" -> Right Nominative
1020+ "OBLIQUE" -> Right Oblique
1021+ "PARTITIVE" -> Right Partitive
1022+ "PREPOSITIONAL" -> Right PrePositional
1023+ "REFLEXIVE_CASE" -> Right ReflexiveCase
1024+ "RELATIVE_CASE" -> Right RelativeCase
1025+ "VOCATIVE" -> Right Vocative
1026+ x -> Left ("Unable to parse PartOfSpeechCase from: " <> x)
1027+
1028+instance ToHttpApiData PartOfSpeechCase where
1029+ toQueryParam = \case
1030+ CaseUnknown -> "CASE_UNKNOWN"
1031+ Accusative -> "ACCUSATIVE"
1032+ Adverbial -> "ADVERBIAL"
1033+ Complementive -> "COMPLEMENTIVE"
1034+ Dative -> "DATIVE"
1035+ Genitive -> "GENITIVE"
1036+ Instrumental -> "INSTRUMENTAL"
1037+ Locative -> "LOCATIVE"
1038+ Nominative -> "NOMINATIVE"
1039+ Oblique -> "OBLIQUE"
1040+ Partitive -> "PARTITIVE"
1041+ PrePositional -> "PREPOSITIONAL"
1042+ ReflexiveCase -> "REFLEXIVE_CASE"
1043+ RelativeCase -> "RELATIVE_CASE"
1044+ Vocative -> "VOCATIVE"
1045+
1046+instance FromJSON PartOfSpeechCase where
1047+ parseJSON = parseJSONText "PartOfSpeechCase"
1048+
1049+instance ToJSON PartOfSpeechCase where
1050+ toJSON = toJSONText
1051+
1052+-- | V1 error format.
1053+data Xgafv
1054+ = X1
1055+ -- ^ @1@
1056+ -- v1 error format
1057+ | X2
1058+ -- ^ @2@
1059+ -- v2 error format
1060+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1061+
1062+instance Hashable Xgafv
1063+
1064+instance FromHttpApiData Xgafv where
1065+ parseQueryParam = \case
1066+ "1" -> Right X1
1067+ "2" -> Right X2
1068+ x -> Left ("Unable to parse Xgafv from: " <> x)
1069+
1070+instance ToHttpApiData Xgafv where
1071+ toQueryParam = \case
1072+ X1 -> "1"
1073+ X2 -> "2"
1074+
1075+instance FromJSON Xgafv where
1076+ parseJSON = parseJSONText "Xgafv"
1077+
1078+instance ToJSON Xgafv where
1079+ toJSON = toJSONText
1080+
1081+-- | The encoding type used by the API to calculate offsets.
1082+data AnnotateTextRequestEncodingType
1083+ = ATRETNone
1084+ -- ^ @NONE@
1085+ -- If \`EncodingType\` is not specified, encoding-dependent information
1086+ -- (such as \`begin_offset\`) will be set at \`-1\`.
1087+ | ATRETUTF8
1088+ -- ^ @UTF8@
1089+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1090+ -- based on the UTF-8 encoding of the input. C++ and Go are examples of
1091+ -- languages that use this encoding natively.
1092+ | ATRETUTF16
1093+ -- ^ @UTF16@
1094+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1095+ -- based on the UTF-16 encoding of the input. Java and Javascript are
1096+ -- examples of languages that use this encoding natively.
1097+ | ATRETUTF32
1098+ -- ^ @UTF32@
1099+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1100+ -- based on the UTF-32 encoding of the input. Python is an example of a
1101+ -- language that uses this encoding natively.
1102+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1103+
1104+instance Hashable AnnotateTextRequestEncodingType
1105+
1106+instance FromHttpApiData AnnotateTextRequestEncodingType where
1107+ parseQueryParam = \case
1108+ "NONE" -> Right ATRETNone
1109+ "UTF8" -> Right ATRETUTF8
1110+ "UTF16" -> Right ATRETUTF16
1111+ "UTF32" -> Right ATRETUTF32
1112+ x -> Left ("Unable to parse AnnotateTextRequestEncodingType from: " <> x)
1113+
1114+instance ToHttpApiData AnnotateTextRequestEncodingType where
1115+ toQueryParam = \case
1116+ ATRETNone -> "NONE"
1117+ ATRETUTF8 -> "UTF8"
1118+ ATRETUTF16 -> "UTF16"
1119+ ATRETUTF32 -> "UTF32"
1120+
1121+instance FromJSON AnnotateTextRequestEncodingType where
1122+ parseJSON = parseJSONText "AnnotateTextRequestEncodingType"
1123+
1124+instance ToJSON AnnotateTextRequestEncodingType where
1125+ toJSON = toJSONText
1126+
1127+-- | The grammatical number.
1128+data PartOfSpeechNumber
1129+ = NumberUnknown
1130+ -- ^ @NUMBER_UNKNOWN@
1131+ -- Number is not applicable in the analyzed language or is not predicted.
1132+ | Singular
1133+ -- ^ @SINGULAR@
1134+ -- Singular
1135+ | Plural
1136+ -- ^ @PLURAL@
1137+ -- Plural
1138+ | Dual
1139+ -- ^ @DUAL@
1140+ -- Dual
1141+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1142+
1143+instance Hashable PartOfSpeechNumber
1144+
1145+instance FromHttpApiData PartOfSpeechNumber where
1146+ parseQueryParam = \case
1147+ "NUMBER_UNKNOWN" -> Right NumberUnknown
1148+ "SINGULAR" -> Right Singular
1149+ "PLURAL" -> Right Plural
1150+ "DUAL" -> Right Dual
1151+ x -> Left ("Unable to parse PartOfSpeechNumber from: " <> x)
1152+
1153+instance ToHttpApiData PartOfSpeechNumber where
1154+ toQueryParam = \case
1155+ NumberUnknown -> "NUMBER_UNKNOWN"
1156+ Singular -> "SINGULAR"
1157+ Plural -> "PLURAL"
1158+ Dual -> "DUAL"
1159+
1160+instance FromJSON PartOfSpeechNumber where
1161+ parseJSON = parseJSONText "PartOfSpeechNumber"
1162+
1163+instance ToJSON PartOfSpeechNumber where
1164+ toJSON = toJSONText
1165+
1166+-- | The encoding type used by the API to calculate offsets.
1167+data AnalyzeEntitiesRequestEncodingType
1168+ = AERETNone
1169+ -- ^ @NONE@
1170+ -- If \`EncodingType\` is not specified, encoding-dependent information
1171+ -- (such as \`begin_offset\`) will be set at \`-1\`.
1172+ | AERETUTF8
1173+ -- ^ @UTF8@
1174+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1175+ -- based on the UTF-8 encoding of the input. C++ and Go are examples of
1176+ -- languages that use this encoding natively.
1177+ | AERETUTF16
1178+ -- ^ @UTF16@
1179+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1180+ -- based on the UTF-16 encoding of the input. Java and Javascript are
1181+ -- examples of languages that use this encoding natively.
1182+ | AERETUTF32
1183+ -- ^ @UTF32@
1184+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1185+ -- based on the UTF-32 encoding of the input. Python is an example of a
1186+ -- language that uses this encoding natively.
1187+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1188+
1189+instance Hashable AnalyzeEntitiesRequestEncodingType
1190+
1191+instance FromHttpApiData AnalyzeEntitiesRequestEncodingType where
1192+ parseQueryParam = \case
1193+ "NONE" -> Right AERETNone
1194+ "UTF8" -> Right AERETUTF8
1195+ "UTF16" -> Right AERETUTF16
1196+ "UTF32" -> Right AERETUTF32
1197+ x -> Left ("Unable to parse AnalyzeEntitiesRequestEncodingType from: " <> x)
1198+
1199+instance ToHttpApiData AnalyzeEntitiesRequestEncodingType where
1200+ toQueryParam = \case
1201+ AERETNone -> "NONE"
1202+ AERETUTF8 -> "UTF8"
1203+ AERETUTF16 -> "UTF16"
1204+ AERETUTF32 -> "UTF32"
1205+
1206+instance FromJSON AnalyzeEntitiesRequestEncodingType where
1207+ parseJSON = parseJSONText "AnalyzeEntitiesRequestEncodingType"
1208+
1209+instance ToJSON AnalyzeEntitiesRequestEncodingType where
1210+ toJSON = toJSONText
1211+
1212+-- | The grammatical aspect.
1213+data PartOfSpeechAspect
1214+ = AspectUnknown
1215+ -- ^ @ASPECT_UNKNOWN@
1216+ -- Aspect is not applicable in the analyzed language or is not predicted.
1217+ | Perfective
1218+ -- ^ @PERFECTIVE@
1219+ -- Perfective
1220+ | Imperfective
1221+ -- ^ @IMPERFECTIVE@
1222+ -- Imperfective
1223+ | Progressive
1224+ -- ^ @PROGRESSIVE@
1225+ -- Progressive
1226+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1227+
1228+instance Hashable PartOfSpeechAspect
1229+
1230+instance FromHttpApiData PartOfSpeechAspect where
1231+ parseQueryParam = \case
1232+ "ASPECT_UNKNOWN" -> Right AspectUnknown
1233+ "PERFECTIVE" -> Right Perfective
1234+ "IMPERFECTIVE" -> Right Imperfective
1235+ "PROGRESSIVE" -> Right Progressive
1236+ x -> Left ("Unable to parse PartOfSpeechAspect from: " <> x)
1237+
1238+instance ToHttpApiData PartOfSpeechAspect where
1239+ toQueryParam = \case
1240+ AspectUnknown -> "ASPECT_UNKNOWN"
1241+ Perfective -> "PERFECTIVE"
1242+ Imperfective -> "IMPERFECTIVE"
1243+ Progressive -> "PROGRESSIVE"
1244+
1245+instance FromJSON PartOfSpeechAspect where
1246+ parseJSON = parseJSONText "PartOfSpeechAspect"
1247+
1248+instance ToJSON PartOfSpeechAspect where
1249+ toJSON = toJSONText
1250+
1251+-- | The grammatical reciprocity.
1252+data PartOfSpeechReciprocity
1253+ = ReciprocityUnknown
1254+ -- ^ @RECIPROCITY_UNKNOWN@
1255+ -- Reciprocity is not applicable in the analyzed language or is not
1256+ -- predicted.
1257+ | Reciprocal
1258+ -- ^ @RECIPROCAL@
1259+ -- Reciprocal
1260+ | NonReciprocal
1261+ -- ^ @NON_RECIPROCAL@
1262+ -- Non-reciprocal
1263+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1264+
1265+instance Hashable PartOfSpeechReciprocity
1266+
1267+instance FromHttpApiData PartOfSpeechReciprocity where
1268+ parseQueryParam = \case
1269+ "RECIPROCITY_UNKNOWN" -> Right ReciprocityUnknown
1270+ "RECIPROCAL" -> Right Reciprocal
1271+ "NON_RECIPROCAL" -> Right NonReciprocal
1272+ x -> Left ("Unable to parse PartOfSpeechReciprocity from: " <> x)
1273+
1274+instance ToHttpApiData PartOfSpeechReciprocity where
1275+ toQueryParam = \case
1276+ ReciprocityUnknown -> "RECIPROCITY_UNKNOWN"
1277+ Reciprocal -> "RECIPROCAL"
1278+ NonReciprocal -> "NON_RECIPROCAL"
1279+
1280+instance FromJSON PartOfSpeechReciprocity where
1281+ parseJSON = parseJSONText "PartOfSpeechReciprocity"
1282+
1283+instance ToJSON PartOfSpeechReciprocity where
1284+ toJSON = toJSONText
1285+
1286+-- | The grammatical gender.
1287+data PartOfSpeechGender
1288+ = GenderUnknown
1289+ -- ^ @GENDER_UNKNOWN@
1290+ -- Gender is not applicable in the analyzed language or is not predicted.
1291+ | Feminine
1292+ -- ^ @FEMININE@
1293+ -- Feminine
1294+ | Masculine
1295+ -- ^ @MASCULINE@
1296+ -- Masculine
1297+ | Neuter
1298+ -- ^ @NEUTER@
1299+ -- Neuter
1300+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1301+
1302+instance Hashable PartOfSpeechGender
1303+
1304+instance FromHttpApiData PartOfSpeechGender where
1305+ parseQueryParam = \case
1306+ "GENDER_UNKNOWN" -> Right GenderUnknown
1307+ "FEMININE" -> Right Feminine
1308+ "MASCULINE" -> Right Masculine
1309+ "NEUTER" -> Right Neuter
1310+ x -> Left ("Unable to parse PartOfSpeechGender from: " <> x)
1311+
1312+instance ToHttpApiData PartOfSpeechGender where
1313+ toQueryParam = \case
1314+ GenderUnknown -> "GENDER_UNKNOWN"
1315+ Feminine -> "FEMININE"
1316+ Masculine -> "MASCULINE"
1317+ Neuter -> "NEUTER"
1318+
1319+instance FromJSON PartOfSpeechGender where
1320+ parseJSON = parseJSONText "PartOfSpeechGender"
1321+
1322+instance ToJSON PartOfSpeechGender where
1323+ toJSON = toJSONText
1324+
1325+-- | The encoding type used by the API to calculate sentence offsets.
1326+data AnalyzeSentimentRequestEncodingType
1327+ = ASRETNone
1328+ -- ^ @NONE@
1329+ -- If \`EncodingType\` is not specified, encoding-dependent information
1330+ -- (such as \`begin_offset\`) will be set at \`-1\`.
1331+ | ASRETUTF8
1332+ -- ^ @UTF8@
1333+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1334+ -- based on the UTF-8 encoding of the input. C++ and Go are examples of
1335+ -- languages that use this encoding natively.
1336+ | ASRETUTF16
1337+ -- ^ @UTF16@
1338+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1339+ -- based on the UTF-16 encoding of the input. Java and Javascript are
1340+ -- examples of languages that use this encoding natively.
1341+ | ASRETUTF32
1342+ -- ^ @UTF32@
1343+ -- Encoding-dependent information (such as \`begin_offset\`) is calculated
1344+ -- based on the UTF-32 encoding of the input. Python is an example of a
1345+ -- language that uses this encoding natively.
1346+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1347+
1348+instance Hashable AnalyzeSentimentRequestEncodingType
1349+
1350+instance FromHttpApiData AnalyzeSentimentRequestEncodingType where
1351+ parseQueryParam = \case
1352+ "NONE" -> Right ASRETNone
1353+ "UTF8" -> Right ASRETUTF8
1354+ "UTF16" -> Right ASRETUTF16
1355+ "UTF32" -> Right ASRETUTF32
1356+ x -> Left ("Unable to parse AnalyzeSentimentRequestEncodingType from: " <> x)
1357+
1358+instance ToHttpApiData AnalyzeSentimentRequestEncodingType where
1359+ toQueryParam = \case
1360+ ASRETNone -> "NONE"
1361+ ASRETUTF8 -> "UTF8"
1362+ ASRETUTF16 -> "UTF16"
1363+ ASRETUTF32 -> "UTF32"
1364+
1365+instance FromJSON AnalyzeSentimentRequestEncodingType where
1366+ parseJSON = parseJSONText "AnalyzeSentimentRequestEncodingType"
1367+
1368+instance ToJSON AnalyzeSentimentRequestEncodingType where
1369+ toJSON = toJSONText
1370+
1371+-- | The type of the entity mention.
1372+data EntityMentionType
1373+ = EMTTypeUnknown
1374+ -- ^ @TYPE_UNKNOWN@
1375+ -- Unknown
1376+ | EMTProper
1377+ -- ^ @PROPER@
1378+ -- Proper name
1379+ | EMTCommon
1380+ -- ^ @COMMON@
1381+ -- Common noun (or noun compound)
1382+ deriving (Eq, Ord, Enum, Read, Show, Data, Typeable, Generic)
1383+
1384+instance Hashable EntityMentionType
1385+
1386+instance FromHttpApiData EntityMentionType where
1387+ parseQueryParam = \case
1388+ "TYPE_UNKNOWN" -> Right EMTTypeUnknown
1389+ "PROPER" -> Right EMTProper
1390+ "COMMON" -> Right EMTCommon
1391+ x -> Left ("Unable to parse EntityMentionType from: " <> x)
1392+
1393+instance ToHttpApiData EntityMentionType where
1394+ toQueryParam = \case
1395+ EMTTypeUnknown -> "TYPE_UNKNOWN"
1396+ EMTProper -> "PROPER"
1397+ EMTCommon -> "COMMON"
1398+
1399+instance FromJSON EntityMentionType where
1400+ parseJSON = parseJSONText "EntityMentionType"
1401+
1402+instance ToJSON EntityMentionType where
1403+ toJSON = toJSONText
gogol-language/gen/Network/Google/Resource/Language/Documents/AnalyzeEntities.hsnew file+174
@@ -0,0 +1,174 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Language.Documents.AnalyzeEntities
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Finds named entities (currently finds proper names) in the text, entity
24+-- types, salience, mentions for each entity, and other properties.
25+--
26+-- /See:/ <https://cloud.google.com/natural-language/ Google Cloud Natural Language API Reference> for @language.documents.analyzeEntities@.
27+module Network.Google.Resource.Language.Documents.AnalyzeEntities
28+ (
29+ -- * REST Resource
30+ DocumentsAnalyzeEntitiesResource
31+
32+ -- * Creating a Request
33+ , documentsAnalyzeEntities
34+ , DocumentsAnalyzeEntities
35+
36+ -- * Request Lenses
37+ , daeXgafv
38+ , daeUploadProtocol
39+ , daePp
40+ , daeAccessToken
41+ , daeUploadType
42+ , daePayload
43+ , daeBearerToken
44+ , daeCallback
45+ ) where
46+
47+import Network.Google.Language.Types
48+import Network.Google.Prelude
49+
50+-- | A resource alias for @language.documents.analyzeEntities@ method which the
51+-- 'DocumentsAnalyzeEntities' request conforms to.
52+type DocumentsAnalyzeEntitiesResource =
53+ "v1" :>
54+ "documents:analyzeEntities" :>
55+ QueryParam "$.xgafv" Xgafv :>
56+ QueryParam "upload_protocol" Text :>
57+ QueryParam "pp" Bool :>
58+ QueryParam "access_token" Text :>
59+ QueryParam "uploadType" Text :>
60+ QueryParam "bearer_token" Text :>
61+ QueryParam "callback" Text :>
62+ QueryParam "alt" AltJSON :>
63+ ReqBody '[JSON] AnalyzeEntitiesRequest :>
64+ Post '[JSON] AnalyzeEntitiesResponse
65+
66+-- | Finds named entities (currently finds proper names) in the text, entity
67+-- types, salience, mentions for each entity, and other properties.
68+--
69+-- /See:/ 'documentsAnalyzeEntities' smart constructor.
70+data DocumentsAnalyzeEntities = DocumentsAnalyzeEntities'
71+ { _daeXgafv :: !(Maybe Xgafv)
72+ , _daeUploadProtocol :: !(Maybe Text)
73+ , _daePp :: !Bool
74+ , _daeAccessToken :: !(Maybe Text)
75+ , _daeUploadType :: !(Maybe Text)
76+ , _daePayload :: !AnalyzeEntitiesRequest
77+ , _daeBearerToken :: !(Maybe Text)
78+ , _daeCallback :: !(Maybe Text)
79+ } deriving (Eq,Show,Data,Typeable,Generic)
80+
81+-- | Creates a value of 'DocumentsAnalyzeEntities' with the minimum fields required to make a request.
82+--
83+-- Use one of the following lenses to modify other fields as desired:
84+--
85+-- * 'daeXgafv'
86+--
87+-- * 'daeUploadProtocol'
88+--
89+-- * 'daePp'
90+--
91+-- * 'daeAccessToken'
92+--
93+-- * 'daeUploadType'
94+--
95+-- * 'daePayload'
96+--
97+-- * 'daeBearerToken'
98+--
99+-- * 'daeCallback'
100+documentsAnalyzeEntities
101+ :: AnalyzeEntitiesRequest -- ^ 'daePayload'
102+ -> DocumentsAnalyzeEntities
103+documentsAnalyzeEntities pDaePayload_ =
104+ DocumentsAnalyzeEntities'
105+ { _daeXgafv = Nothing
106+ , _daeUploadProtocol = Nothing
107+ , _daePp = True
108+ , _daeAccessToken = Nothing
109+ , _daeUploadType = Nothing
110+ , _daePayload = pDaePayload_
111+ , _daeBearerToken = Nothing
112+ , _daeCallback = Nothing
113+ }
114+
115+-- | V1 error format.
116+daeXgafv :: Lens' DocumentsAnalyzeEntities (Maybe Xgafv)
117+daeXgafv = lens _daeXgafv (\ s a -> s{_daeXgafv = a})
118+
119+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
120+daeUploadProtocol :: Lens' DocumentsAnalyzeEntities (Maybe Text)
121+daeUploadProtocol
122+ = lens _daeUploadProtocol
123+ (\ s a -> s{_daeUploadProtocol = a})
124+
125+-- | Pretty-print response.
126+daePp :: Lens' DocumentsAnalyzeEntities Bool
127+daePp = lens _daePp (\ s a -> s{_daePp = a})
128+
129+-- | OAuth access token.
130+daeAccessToken :: Lens' DocumentsAnalyzeEntities (Maybe Text)
131+daeAccessToken
132+ = lens _daeAccessToken
133+ (\ s a -> s{_daeAccessToken = a})
134+
135+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
136+daeUploadType :: Lens' DocumentsAnalyzeEntities (Maybe Text)
137+daeUploadType
138+ = lens _daeUploadType
139+ (\ s a -> s{_daeUploadType = a})
140+
141+-- | Multipart request metadata.
142+daePayload :: Lens' DocumentsAnalyzeEntities AnalyzeEntitiesRequest
143+daePayload
144+ = lens _daePayload (\ s a -> s{_daePayload = a})
145+
146+-- | OAuth bearer token.
147+daeBearerToken :: Lens' DocumentsAnalyzeEntities (Maybe Text)
148+daeBearerToken
149+ = lens _daeBearerToken
150+ (\ s a -> s{_daeBearerToken = a})
151+
152+-- | JSONP
153+daeCallback :: Lens' DocumentsAnalyzeEntities (Maybe Text)
154+daeCallback
155+ = lens _daeCallback (\ s a -> s{_daeCallback = a})
156+
157+instance GoogleRequest DocumentsAnalyzeEntities where
158+ type Rs DocumentsAnalyzeEntities =
159+ AnalyzeEntitiesResponse
160+ type Scopes DocumentsAnalyzeEntities =
161+ '["https://www.googleapis.com/auth/cloud-platform"]
162+ requestClient DocumentsAnalyzeEntities'{..}
163+ = go _daeXgafv _daeUploadProtocol (Just _daePp)
164+ _daeAccessToken
165+ _daeUploadType
166+ _daeBearerToken
167+ _daeCallback
168+ (Just AltJSON)
169+ _daePayload
170+ languageService
171+ where go
172+ = buildClient
173+ (Proxy :: Proxy DocumentsAnalyzeEntitiesResource)
174+ mempty
gogol-language/gen/Network/Google/Resource/Language/Documents/AnalyzeSentiment.hsnew file+173
@@ -0,0 +1,173 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Language.Documents.AnalyzeSentiment
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Analyzes the sentiment of the provided text.
24+--
25+-- /See:/ <https://cloud.google.com/natural-language/ Google Cloud Natural Language API Reference> for @language.documents.analyzeSentiment@.
26+module Network.Google.Resource.Language.Documents.AnalyzeSentiment
27+ (
28+ -- * REST Resource
29+ DocumentsAnalyzeSentimentResource
30+
31+ -- * Creating a Request
32+ , documentsAnalyzeSentiment
33+ , DocumentsAnalyzeSentiment
34+
35+ -- * Request Lenses
36+ , dasXgafv
37+ , dasUploadProtocol
38+ , dasPp
39+ , dasAccessToken
40+ , dasUploadType
41+ , dasPayload
42+ , dasBearerToken
43+ , dasCallback
44+ ) where
45+
46+import Network.Google.Language.Types
47+import Network.Google.Prelude
48+
49+-- | A resource alias for @language.documents.analyzeSentiment@ method which the
50+-- 'DocumentsAnalyzeSentiment' request conforms to.
51+type DocumentsAnalyzeSentimentResource =
52+ "v1" :>
53+ "documents:analyzeSentiment" :>
54+ QueryParam "$.xgafv" Xgafv :>
55+ QueryParam "upload_protocol" Text :>
56+ QueryParam "pp" Bool :>
57+ QueryParam "access_token" Text :>
58+ QueryParam "uploadType" Text :>
59+ QueryParam "bearer_token" Text :>
60+ QueryParam "callback" Text :>
61+ QueryParam "alt" AltJSON :>
62+ ReqBody '[JSON] AnalyzeSentimentRequest :>
63+ Post '[JSON] AnalyzeSentimentResponse
64+
65+-- | Analyzes the sentiment of the provided text.
66+--
67+-- /See:/ 'documentsAnalyzeSentiment' smart constructor.
68+data DocumentsAnalyzeSentiment = DocumentsAnalyzeSentiment'
69+ { _dasXgafv :: !(Maybe Xgafv)
70+ , _dasUploadProtocol :: !(Maybe Text)
71+ , _dasPp :: !Bool
72+ , _dasAccessToken :: !(Maybe Text)
73+ , _dasUploadType :: !(Maybe Text)
74+ , _dasPayload :: !AnalyzeSentimentRequest
75+ , _dasBearerToken :: !(Maybe Text)
76+ , _dasCallback :: !(Maybe Text)
77+ } deriving (Eq,Show,Data,Typeable,Generic)
78+
79+-- | Creates a value of 'DocumentsAnalyzeSentiment' with the minimum fields required to make a request.
80+--
81+-- Use one of the following lenses to modify other fields as desired:
82+--
83+-- * 'dasXgafv'
84+--
85+-- * 'dasUploadProtocol'
86+--
87+-- * 'dasPp'
88+--
89+-- * 'dasAccessToken'
90+--
91+-- * 'dasUploadType'
92+--
93+-- * 'dasPayload'
94+--
95+-- * 'dasBearerToken'
96+--
97+-- * 'dasCallback'
98+documentsAnalyzeSentiment
99+ :: AnalyzeSentimentRequest -- ^ 'dasPayload'
100+ -> DocumentsAnalyzeSentiment
101+documentsAnalyzeSentiment pDasPayload_ =
102+ DocumentsAnalyzeSentiment'
103+ { _dasXgafv = Nothing
104+ , _dasUploadProtocol = Nothing
105+ , _dasPp = True
106+ , _dasAccessToken = Nothing
107+ , _dasUploadType = Nothing
108+ , _dasPayload = pDasPayload_
109+ , _dasBearerToken = Nothing
110+ , _dasCallback = Nothing
111+ }
112+
113+-- | V1 error format.
114+dasXgafv :: Lens' DocumentsAnalyzeSentiment (Maybe Xgafv)
115+dasXgafv = lens _dasXgafv (\ s a -> s{_dasXgafv = a})
116+
117+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
118+dasUploadProtocol :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
119+dasUploadProtocol
120+ = lens _dasUploadProtocol
121+ (\ s a -> s{_dasUploadProtocol = a})
122+
123+-- | Pretty-print response.
124+dasPp :: Lens' DocumentsAnalyzeSentiment Bool
125+dasPp = lens _dasPp (\ s a -> s{_dasPp = a})
126+
127+-- | OAuth access token.
128+dasAccessToken :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
129+dasAccessToken
130+ = lens _dasAccessToken
131+ (\ s a -> s{_dasAccessToken = a})
132+
133+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
134+dasUploadType :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
135+dasUploadType
136+ = lens _dasUploadType
137+ (\ s a -> s{_dasUploadType = a})
138+
139+-- | Multipart request metadata.
140+dasPayload :: Lens' DocumentsAnalyzeSentiment AnalyzeSentimentRequest
141+dasPayload
142+ = lens _dasPayload (\ s a -> s{_dasPayload = a})
143+
144+-- | OAuth bearer token.
145+dasBearerToken :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
146+dasBearerToken
147+ = lens _dasBearerToken
148+ (\ s a -> s{_dasBearerToken = a})
149+
150+-- | JSONP
151+dasCallback :: Lens' DocumentsAnalyzeSentiment (Maybe Text)
152+dasCallback
153+ = lens _dasCallback (\ s a -> s{_dasCallback = a})
154+
155+instance GoogleRequest DocumentsAnalyzeSentiment
156+ where
157+ type Rs DocumentsAnalyzeSentiment =
158+ AnalyzeSentimentResponse
159+ type Scopes DocumentsAnalyzeSentiment =
160+ '["https://www.googleapis.com/auth/cloud-platform"]
161+ requestClient DocumentsAnalyzeSentiment'{..}
162+ = go _dasXgafv _dasUploadProtocol (Just _dasPp)
163+ _dasAccessToken
164+ _dasUploadType
165+ _dasBearerToken
166+ _dasCallback
167+ (Just AltJSON)
168+ _dasPayload
169+ languageService
170+ where go
171+ = buildClient
172+ (Proxy :: Proxy DocumentsAnalyzeSentimentResource)
173+ mempty
gogol-language/gen/Network/Google/Resource/Language/Documents/AnalyzeSyntax.hsnew file+172
@@ -0,0 +1,172 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Language.Documents.AnalyzeSyntax
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Analyzes the syntax of the text and provides sentence boundaries and
24+-- tokenization along with part of speech tags, dependency trees, and other
25+-- properties.
26+--
27+-- /See:/ <https://cloud.google.com/natural-language/ Google Cloud Natural Language API Reference> for @language.documents.analyzeSyntax@.
28+module Network.Google.Resource.Language.Documents.AnalyzeSyntax
29+ (
30+ -- * REST Resource
31+ DocumentsAnalyzeSyntaxResource
32+
33+ -- * Creating a Request
34+ , documentsAnalyzeSyntax
35+ , DocumentsAnalyzeSyntax
36+
37+ -- * Request Lenses
38+ , dXgafv
39+ , dUploadProtocol
40+ , dPp
41+ , dAccessToken
42+ , dUploadType
43+ , dPayload
44+ , dBearerToken
45+ , dCallback
46+ ) where
47+
48+import Network.Google.Language.Types
49+import Network.Google.Prelude
50+
51+-- | A resource alias for @language.documents.analyzeSyntax@ method which the
52+-- 'DocumentsAnalyzeSyntax' request conforms to.
53+type DocumentsAnalyzeSyntaxResource =
54+ "v1" :>
55+ "documents:analyzeSyntax" :>
56+ QueryParam "$.xgafv" Xgafv :>
57+ QueryParam "upload_protocol" Text :>
58+ QueryParam "pp" Bool :>
59+ QueryParam "access_token" Text :>
60+ QueryParam "uploadType" Text :>
61+ QueryParam "bearer_token" Text :>
62+ QueryParam "callback" Text :>
63+ QueryParam "alt" AltJSON :>
64+ ReqBody '[JSON] AnalyzeSyntaxRequest :>
65+ Post '[JSON] AnalyzeSyntaxResponse
66+
67+-- | Analyzes the syntax of the text and provides sentence boundaries and
68+-- tokenization along with part of speech tags, dependency trees, and other
69+-- properties.
70+--
71+-- /See:/ 'documentsAnalyzeSyntax' smart constructor.
72+data DocumentsAnalyzeSyntax = DocumentsAnalyzeSyntax'
73+ { _dXgafv :: !(Maybe Xgafv)
74+ , _dUploadProtocol :: !(Maybe Text)
75+ , _dPp :: !Bool
76+ , _dAccessToken :: !(Maybe Text)
77+ , _dUploadType :: !(Maybe Text)
78+ , _dPayload :: !AnalyzeSyntaxRequest
79+ , _dBearerToken :: !(Maybe Text)
80+ , _dCallback :: !(Maybe Text)
81+ } deriving (Eq,Show,Data,Typeable,Generic)
82+
83+-- | Creates a value of 'DocumentsAnalyzeSyntax' with the minimum fields required to make a request.
84+--
85+-- Use one of the following lenses to modify other fields as desired:
86+--
87+-- * 'dXgafv'
88+--
89+-- * 'dUploadProtocol'
90+--
91+-- * 'dPp'
92+--
93+-- * 'dAccessToken'
94+--
95+-- * 'dUploadType'
96+--
97+-- * 'dPayload'
98+--
99+-- * 'dBearerToken'
100+--
101+-- * 'dCallback'
102+documentsAnalyzeSyntax
103+ :: AnalyzeSyntaxRequest -- ^ 'dPayload'
104+ -> DocumentsAnalyzeSyntax
105+documentsAnalyzeSyntax pDPayload_ =
106+ DocumentsAnalyzeSyntax'
107+ { _dXgafv = Nothing
108+ , _dUploadProtocol = Nothing
109+ , _dPp = True
110+ , _dAccessToken = Nothing
111+ , _dUploadType = Nothing
112+ , _dPayload = pDPayload_
113+ , _dBearerToken = Nothing
114+ , _dCallback = Nothing
115+ }
116+
117+-- | V1 error format.
118+dXgafv :: Lens' DocumentsAnalyzeSyntax (Maybe Xgafv)
119+dXgafv = lens _dXgafv (\ s a -> s{_dXgafv = a})
120+
121+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
122+dUploadProtocol :: Lens' DocumentsAnalyzeSyntax (Maybe Text)
123+dUploadProtocol
124+ = lens _dUploadProtocol
125+ (\ s a -> s{_dUploadProtocol = a})
126+
127+-- | Pretty-print response.
128+dPp :: Lens' DocumentsAnalyzeSyntax Bool
129+dPp = lens _dPp (\ s a -> s{_dPp = a})
130+
131+-- | OAuth access token.
132+dAccessToken :: Lens' DocumentsAnalyzeSyntax (Maybe Text)
133+dAccessToken
134+ = lens _dAccessToken (\ s a -> s{_dAccessToken = a})
135+
136+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
137+dUploadType :: Lens' DocumentsAnalyzeSyntax (Maybe Text)
138+dUploadType
139+ = lens _dUploadType (\ s a -> s{_dUploadType = a})
140+
141+-- | Multipart request metadata.
142+dPayload :: Lens' DocumentsAnalyzeSyntax AnalyzeSyntaxRequest
143+dPayload = lens _dPayload (\ s a -> s{_dPayload = a})
144+
145+-- | OAuth bearer token.
146+dBearerToken :: Lens' DocumentsAnalyzeSyntax (Maybe Text)
147+dBearerToken
148+ = lens _dBearerToken (\ s a -> s{_dBearerToken = a})
149+
150+-- | JSONP
151+dCallback :: Lens' DocumentsAnalyzeSyntax (Maybe Text)
152+dCallback
153+ = lens _dCallback (\ s a -> s{_dCallback = a})
154+
155+instance GoogleRequest DocumentsAnalyzeSyntax where
156+ type Rs DocumentsAnalyzeSyntax =
157+ AnalyzeSyntaxResponse
158+ type Scopes DocumentsAnalyzeSyntax =
159+ '["https://www.googleapis.com/auth/cloud-platform"]
160+ requestClient DocumentsAnalyzeSyntax'{..}
161+ = go _dXgafv _dUploadProtocol (Just _dPp)
162+ _dAccessToken
163+ _dUploadType
164+ _dBearerToken
165+ _dCallback
166+ (Just AltJSON)
167+ _dPayload
168+ languageService
169+ where go
170+ = buildClient
171+ (Proxy :: Proxy DocumentsAnalyzeSyntaxResource)
172+ mempty
gogol-language/gen/Network/Google/Resource/Language/Documents/AnnotateText.hsnew file+175
@@ -0,0 +1,175 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Language.Documents.AnnotateText
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- A convenience method that provides all the features that
24+-- analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one
25+-- call.
26+--
27+-- /See:/ <https://cloud.google.com/natural-language/ Google Cloud Natural Language API Reference> for @language.documents.annotateText@.
28+module Network.Google.Resource.Language.Documents.AnnotateText
29+ (
30+ -- * REST Resource
31+ DocumentsAnnotateTextResource
32+
33+ -- * Creating a Request
34+ , documentsAnnotateText
35+ , DocumentsAnnotateText
36+
37+ -- * Request Lenses
38+ , datXgafv
39+ , datUploadProtocol
40+ , datPp
41+ , datAccessToken
42+ , datUploadType
43+ , datPayload
44+ , datBearerToken
45+ , datCallback
46+ ) where
47+
48+import Network.Google.Language.Types
49+import Network.Google.Prelude
50+
51+-- | A resource alias for @language.documents.annotateText@ method which the
52+-- 'DocumentsAnnotateText' request conforms to.
53+type DocumentsAnnotateTextResource =
54+ "v1" :>
55+ "documents:annotateText" :>
56+ QueryParam "$.xgafv" Xgafv :>
57+ QueryParam "upload_protocol" Text :>
58+ QueryParam "pp" Bool :>
59+ QueryParam "access_token" Text :>
60+ QueryParam "uploadType" Text :>
61+ QueryParam "bearer_token" Text :>
62+ QueryParam "callback" Text :>
63+ QueryParam "alt" AltJSON :>
64+ ReqBody '[JSON] AnnotateTextRequest :>
65+ Post '[JSON] AnnotateTextResponse
66+
67+-- | A convenience method that provides all the features that
68+-- analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one
69+-- call.
70+--
71+-- /See:/ 'documentsAnnotateText' smart constructor.
72+data DocumentsAnnotateText = DocumentsAnnotateText'
73+ { _datXgafv :: !(Maybe Xgafv)
74+ , _datUploadProtocol :: !(Maybe Text)
75+ , _datPp :: !Bool
76+ , _datAccessToken :: !(Maybe Text)
77+ , _datUploadType :: !(Maybe Text)
78+ , _datPayload :: !AnnotateTextRequest
79+ , _datBearerToken :: !(Maybe Text)
80+ , _datCallback :: !(Maybe Text)
81+ } deriving (Eq,Show,Data,Typeable,Generic)
82+
83+-- | Creates a value of 'DocumentsAnnotateText' with the minimum fields required to make a request.
84+--
85+-- Use one of the following lenses to modify other fields as desired:
86+--
87+-- * 'datXgafv'
88+--
89+-- * 'datUploadProtocol'
90+--
91+-- * 'datPp'
92+--
93+-- * 'datAccessToken'
94+--
95+-- * 'datUploadType'
96+--
97+-- * 'datPayload'
98+--
99+-- * 'datBearerToken'
100+--
101+-- * 'datCallback'
102+documentsAnnotateText
103+ :: AnnotateTextRequest -- ^ 'datPayload'
104+ -> DocumentsAnnotateText
105+documentsAnnotateText pDatPayload_ =
106+ DocumentsAnnotateText'
107+ { _datXgafv = Nothing
108+ , _datUploadProtocol = Nothing
109+ , _datPp = True
110+ , _datAccessToken = Nothing
111+ , _datUploadType = Nothing
112+ , _datPayload = pDatPayload_
113+ , _datBearerToken = Nothing
114+ , _datCallback = Nothing
115+ }
116+
117+-- | V1 error format.
118+datXgafv :: Lens' DocumentsAnnotateText (Maybe Xgafv)
119+datXgafv = lens _datXgafv (\ s a -> s{_datXgafv = a})
120+
121+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
122+datUploadProtocol :: Lens' DocumentsAnnotateText (Maybe Text)
123+datUploadProtocol
124+ = lens _datUploadProtocol
125+ (\ s a -> s{_datUploadProtocol = a})
126+
127+-- | Pretty-print response.
128+datPp :: Lens' DocumentsAnnotateText Bool
129+datPp = lens _datPp (\ s a -> s{_datPp = a})
130+
131+-- | OAuth access token.
132+datAccessToken :: Lens' DocumentsAnnotateText (Maybe Text)
133+datAccessToken
134+ = lens _datAccessToken
135+ (\ s a -> s{_datAccessToken = a})
136+
137+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
138+datUploadType :: Lens' DocumentsAnnotateText (Maybe Text)
139+datUploadType
140+ = lens _datUploadType
141+ (\ s a -> s{_datUploadType = a})
142+
143+-- | Multipart request metadata.
144+datPayload :: Lens' DocumentsAnnotateText AnnotateTextRequest
145+datPayload
146+ = lens _datPayload (\ s a -> s{_datPayload = a})
147+
148+-- | OAuth bearer token.
149+datBearerToken :: Lens' DocumentsAnnotateText (Maybe Text)
150+datBearerToken
151+ = lens _datBearerToken
152+ (\ s a -> s{_datBearerToken = a})
153+
154+-- | JSONP
155+datCallback :: Lens' DocumentsAnnotateText (Maybe Text)
156+datCallback
157+ = lens _datCallback (\ s a -> s{_datCallback = a})
158+
159+instance GoogleRequest DocumentsAnnotateText where
160+ type Rs DocumentsAnnotateText = AnnotateTextResponse
161+ type Scopes DocumentsAnnotateText =
162+ '["https://www.googleapis.com/auth/cloud-platform"]
163+ requestClient DocumentsAnnotateText'{..}
164+ = go _datXgafv _datUploadProtocol (Just _datPp)
165+ _datAccessToken
166+ _datUploadType
167+ _datBearerToken
168+ _datCallback
169+ (Just AltJSON)
170+ _datPayload
171+ languageService
172+ where go
173+ = buildClient
174+ (Proxy :: Proxy DocumentsAnnotateTextResource)
175+ mempty
gogol-language/gogol-language.cabalnew file+51
@@ -0,0 +1,51 @@
1+name: gogol-language
2+version: 0.1.1
3+synopsis: Google Cloud Natural Language SDK.
4+homepage: https://github.com/brendanhay/gogol
5+bug-reports: https://github.com/brendanhay/gogol/issues
6+license: OtherLicense
7+license-file: LICENSE
8+author: Brendan Hay
9+maintainer: Brendan Hay <brendan.g.hay@gmail.com>
10+copyright: Copyright (c) 2015-2016 Brendan Hay
11+category: Network, Google, Cloud
12+build-type: Simple
13+cabal-version: >= 1.10
14+extra-source-files: README.md src/.gitkeep
15+
16+description:
17+ Google Cloud Natural Language API provides natural language
18+ understanding technologies to developers. Examples include sentiment
19+ analysis, entity recognition, and text annotations.
20+ .
21+ /Warning:/ This is an experimental prototype/preview release which is still
22+ under exploratory development and not intended for public use, caveat emptor!
23+ .
24+ This library is compatible with version @v1@
25+ of the API.
26+
27+source-repository head
28+ type: git
29+ location: git://github.com/brendanhay/gogol.git
30+
31+library
32+ default-language: Haskell2010
33+ hs-source-dirs: src gen
34+
35+ ghc-options: -Wall
36+
37+ exposed-modules:
38+ Network.Google.Language
39+ , Network.Google.Language.Types
40+ , Network.Google.Resource.Language.Documents.AnalyzeEntities
41+ , Network.Google.Resource.Language.Documents.AnalyzeSentiment
42+ , Network.Google.Resource.Language.Documents.AnalyzeSyntax
43+ , Network.Google.Resource.Language.Documents.AnnotateText
44+
45+ other-modules:
46+ Network.Google.Language.Types.Product
47+ , Network.Google.Language.Types.Sum
48+
49+ build-depends:
50+ gogol-core == 0.1.1.*
51+ , base >= 4.7 && < 5
gogol-language/src/.gitkeepnew file

No changes to the content.