on develop help sign in
Generating vision API library
commitbe37a15a79238cccfeb888ae7062f8d27ee27875 authorBrendan Hay <brendan.g.hay@gmail.com> dateFri 18 Mar 2016, 15:45 (11 years ago) parent4b46dc1
11 files changed+3676
gogol-vision/LICENSE+367 gogol-vision/Makefile+1 gogol-vision/README.md+28 gogol-vision/Setup.hs+2 gogol-vision/gen/Network/Google/Resource/Vision/Images/Annotate.hs+167 gogol-vision/gen/Network/Google/Vision.hs+268 gogol-vision/gen/Network/Google/Vision/Types.hs+255 gogol-vision/gen/Network/Google/Vision/Types/Product.hs+1696 gogol-vision/gen/Network/Google/Vision/Types/Sum.hs+843 gogol-vision/gogol-vision.cabal+49 gogol-vision/src/.gitkeep
gogol-vision/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-vision/Makefilenew file+1
@@ -0,0 +1 @@
1+include ../share/library.mk
gogol-vision/README.mdnew file+28
@@ -0,0 +1,28 @@
1+# gogol-vision
2+
3+* [Version](#version)
4+* [Description](#description)
5+* [Contribute](#contribute)
6+* [Licence](#licence)
7+
8+
9+## Version
10+
11+`0.0.1`
12+
13+
14+## Description
15+
16+A client library for the Google Cloud Vision.
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-vision` is released under the [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/).
gogol-vision/Setup.hsnew file+2
@@ -0,0 +1,2 @@
1+import Distribution.Simple
2+main = defaultMain
gogol-vision/gen/Network/Google/Resource/Vision/Images/Annotate.hsnew file+167
@@ -0,0 +1,167 @@
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.Vision.Images.Annotate
17+-- Copyright : (c) 2015 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+-- Run image detection and annotation for a batch of images.
24+--
25+-- /See:/ <https://cloud.google.com/vision/ Cloud Vision API Reference> for @vision.images.annotate@.
26+module Network.Google.Resource.Vision.Images.Annotate
27+ (
28+ -- * REST Resource
29+ ImagesAnnotateResource
30+
31+ -- * Creating a Request
32+ , imagesAnnotate
33+ , ImagesAnnotate
34+
35+ -- * Request Lenses
36+ , iaXgafv
37+ , iaUploadProtocol
38+ , iaPp
39+ , iaAccessToken
40+ , iaUploadType
41+ , iaPayload
42+ , iaBearerToken
43+ , iaCallback
44+ ) where
45+
46+import Network.Google.Prelude
47+import Network.Google.Vision.Types
48+
49+-- | A resource alias for @vision.images.annotate@ method which the
50+-- 'ImagesAnnotate' request conforms to.
51+type ImagesAnnotateResource =
52+ "v1" :>
53+ "images:annotate" :>
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] BatchAnnotateImagesRequest :>
63+ Post '[JSON] BatchAnnotateImagesResponse
64+
65+-- | Run image detection and annotation for a batch of images.
66+--
67+-- /See:/ 'imagesAnnotate' smart constructor.
68+data ImagesAnnotate = ImagesAnnotate
69+ { _iaXgafv :: !(Maybe $ Xgafv)
70+ , _iaUploadProtocol :: !(Maybe Text)
71+ , _iaPp :: !Bool
72+ , _iaAccessToken :: !(Maybe Text)
73+ , _iaUploadType :: !(Maybe Text)
74+ , _iaPayload :: !BatchAnnotateImagesRequest
75+ , _iaBearerToken :: !(Maybe Text)
76+ , _iaCallback :: !(Maybe Text)
77+ } deriving (Eq,Show,Data,Typeable,Generic)
78+
79+-- | Creates a value of 'ImagesAnnotate' 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+-- * 'iaXgafv'
84+--
85+-- * 'iaUploadProtocol'
86+--
87+-- * 'iaPp'
88+--
89+-- * 'iaAccessToken'
90+--
91+-- * 'iaUploadType'
92+--
93+-- * 'iaPayload'
94+--
95+-- * 'iaBearerToken'
96+--
97+-- * 'iaCallback'
98+imagesAnnotate
99+ :: BatchAnnotateImagesRequest -- ^ 'iaPayload'
100+ -> ImagesAnnotate
101+imagesAnnotate pIaPayload_ =
102+ ImagesAnnotate
103+ { _iaXgafv = Nothing
104+ , _iaUploadProtocol = Nothing
105+ , _iaPp = True
106+ , _iaAccessToken = Nothing
107+ , _iaUploadType = Nothing
108+ , _iaPayload = pIaPayload_
109+ , _iaBearerToken = Nothing
110+ , _iaCallback = Nothing
111+ }
112+
113+-- | V1 error format.
114+iaXgafv :: Lens' ImagesAnnotate (Maybe $Xgafv)
115+iaXgafv = lens _iaXgafv (\ s a -> s{_iaXgafv = a})
116+
117+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
118+iaUploadProtocol :: Lens' ImagesAnnotate (Maybe Text)
119+iaUploadProtocol
120+ = lens _iaUploadProtocol
121+ (\ s a -> s{_iaUploadProtocol = a})
122+
123+-- | Pretty-print response.
124+iaPp :: Lens' ImagesAnnotate Bool
125+iaPp = lens _iaPp (\ s a -> s{_iaPp = a})
126+
127+-- | OAuth access token.
128+iaAccessToken :: Lens' ImagesAnnotate (Maybe Text)
129+iaAccessToken
130+ = lens _iaAccessToken
131+ (\ s a -> s{_iaAccessToken = a})
132+
133+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
134+iaUploadType :: Lens' ImagesAnnotate (Maybe Text)
135+iaUploadType
136+ = lens _iaUploadType (\ s a -> s{_iaUploadType = a})
137+
138+-- | Multipart request metadata.
139+iaPayload :: Lens' ImagesAnnotate BatchAnnotateImagesRequest
140+iaPayload
141+ = lens _iaPayload (\ s a -> s{_iaPayload = a})
142+
143+-- | OAuth bearer token.
144+iaBearerToken :: Lens' ImagesAnnotate (Maybe Text)
145+iaBearerToken
146+ = lens _iaBearerToken
147+ (\ s a -> s{_iaBearerToken = a})
148+
149+-- | JSONP
150+iaCallback :: Lens' ImagesAnnotate (Maybe Text)
151+iaCallback
152+ = lens _iaCallback (\ s a -> s{_iaCallback = a})
153+
154+instance GoogleRequest ImagesAnnotate where
155+ type Rs ImagesAnnotate = BatchAnnotateImagesResponse
156+ requestClient ImagesAnnotate{..}
157+ = go _iaXgafv _iaUploadProtocol (Just _iaPp)
158+ _iaAccessToken
159+ _iaUploadType
160+ _iaBearerToken
161+ _iaCallback
162+ (Just AltJSON)
163+ _iaPayload
164+ visionService
165+ where go
166+ = buildClient (Proxy :: Proxy ImagesAnnotateResource)
167+ mempty
gogol-vision/gen/Network/Google/Vision.hsnew file+268
@@ -0,0 +1,268 @@
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.Vision
10+-- Copyright : (c) 2015 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+-- The Google Cloud Vision API allows developers to easily integrate Google
17+-- vision features, including image labeling, face, logo, and landmark
18+-- detection, optical character recognition (OCR), and detection of
19+-- explicit content, into applications.
20+--
21+-- /See:/ <https://cloud.google.com/vision/ Cloud Vision API Reference>
22+module Network.Google.Vision
23+ (
24+ -- * Service Configuration
25+ visionService
26+
27+ -- * OAuth Scopes
28+ , cloudPlatformScope
29+
30+ -- * API Declaration
31+ , VisionAPI
32+
33+ -- * Resources
34+
35+ -- ** vision.images.annotate
36+ , module Network.Google.Resource.Vision.Images.Annotate
37+
38+ -- * Types
39+
40+ -- ** LatLng
41+ , LatLng
42+ , latLng
43+ , llLatitude
44+ , llLongitude
45+
46+ -- ** FaceAnnotationUnderExposedLikelihood
47+ , FaceAnnotationUnderExposedLikelihood (..)
48+
49+ -- ** Feature
50+ , Feature
51+ , feature
52+ , fType
53+ , fMaxResults
54+
55+ -- ** Status
56+ , Status
57+ , status
58+ , sDetails
59+ , sCode
60+ , sMessage
61+
62+ -- ** Property
63+ , Property
64+ , property
65+ , pValue
66+ , pName
67+
68+ -- ** Image
69+ , Image
70+ , image
71+ , iContent
72+ , iSource
73+
74+ -- ** Landmark
75+ , Landmark
76+ , landmark
77+ , lType
78+ , lPosition
79+
80+ -- ** Color
81+ , Color
82+ , color
83+ , cRed
84+ , cAlpha
85+ , cGreen
86+ , cBlue
87+
88+ -- ** FaceAnnotationHeadwearLikelihood
89+ , FaceAnnotationHeadwearLikelihood (..)
90+
91+ -- ** BoundingPoly
92+ , BoundingPoly
93+ , boundingPoly
94+ , bpVertices
95+
96+ -- ** SafeSearchAnnotationAdult
97+ , SafeSearchAnnotationAdult (..)
98+
99+ -- ** Vertex
100+ , Vertex
101+ , vertex
102+ , vX
103+ , vY
104+
105+ -- ** FaceAnnotationAngerLikelihood
106+ , FaceAnnotationAngerLikelihood (..)
107+
108+ -- ** LocationInfo
109+ , LocationInfo
110+ , locationInfo
111+ , liLatLng
112+
113+ -- ** SafeSearchAnnotationMedical
114+ , SafeSearchAnnotationMedical (..)
115+
116+ -- ** StatusDetailsItem
117+ , StatusDetailsItem
118+ , statusDetailsItem
119+ , sdiAddtional
120+
121+ -- ** BatchAnnotateImagesRequest
122+ , BatchAnnotateImagesRequest
123+ , batchAnnotateImagesRequest
124+ , bairRequests
125+
126+ -- ** ColorInfo
127+ , ColorInfo
128+ , colorInfo
129+ , ciColor
130+ , ciScore
131+ , ciPixelFraction
132+
133+ -- ** FaceAnnotationBlurredLikelihood
134+ , FaceAnnotationBlurredLikelihood (..)
135+
136+ -- ** AnnotateImageResponse
137+ , AnnotateImageResponse
138+ , annotateImageResponse
139+ , airLogoAnnotations
140+ , airLabelAnnotations
141+ , airFaceAnnotations
142+ , airError
143+ , airSafeSearchAnnotation
144+ , airLandmarkAnnotations
145+ , airTextAnnotations
146+ , airImagePropertiesAnnotation
147+
148+ -- ** ImageProperties
149+ , ImageProperties
150+ , imageProperties
151+ , ipDominantColors
152+
153+ -- ** FaceAnnotation
154+ , FaceAnnotation
155+ , faceAnnotation
156+ , faTiltAngle
157+ , faBlurredLikelihood
158+ , faBoundingPoly
159+ , faSurpriseLikelihood
160+ , faLandmarkingConfidence
161+ , faPanAngle
162+ , faRollAngle
163+ , faUnderExposedLikelihood
164+ , faFdBoundingPoly
165+ , faAngerLikelihood
166+ , faDetectionConfidence
167+ , faHeadwearLikelihood
168+ , faSorrowLikelihood
169+ , faJoyLikelihood
170+ , faLandmarks
171+
172+ -- ** SafeSearchAnnotationViolence
173+ , SafeSearchAnnotationViolence (..)
174+
175+ -- ** EntityAnnotation
176+ , EntityAnnotation
177+ , entityAnnotation
178+ , eaScore
179+ , eaTopicality
180+ , eaLocale
181+ , eaBoundingPoly
182+ , eaConfidence
183+ , eaMid
184+ , eaLocations
185+ , eaDescription
186+ , eaProperties
187+
188+ -- ** FeatureType
189+ , FeatureType (..)
190+
191+ -- ** AnnotateImageRequest
192+ , AnnotateImageRequest
193+ , annotateImageRequest
194+ , airImage
195+ , airFeatures
196+ , airImageContext
197+
198+ -- ** LandmarkType
199+ , LandmarkType (..)
200+
201+ -- ** $Xgafv
202+ , $Xgafv (..)
203+
204+ -- ** ImageSource
205+ , ImageSource
206+ , imageSource
207+ , isGcsImageURI
208+
209+ -- ** SafeSearchAnnotationSpoof
210+ , SafeSearchAnnotationSpoof (..)
211+
212+ -- ** FaceAnnotationSurpriseLikelihood
213+ , FaceAnnotationSurpriseLikelihood (..)
214+
215+ -- ** SafeSearchAnnotation
216+ , SafeSearchAnnotation
217+ , safeSearchAnnotation
218+ , ssaSpoof
219+ , ssaAdult
220+ , ssaMedical
221+ , ssaViolence
222+
223+ -- ** FaceAnnotationSorrowLikelihood
224+ , FaceAnnotationSorrowLikelihood (..)
225+
226+ -- ** FaceAnnotationJoyLikelihood
227+ , FaceAnnotationJoyLikelihood (..)
228+
229+ -- ** ImageContext
230+ , ImageContext
231+ , imageContext
232+ , icLanguageHints
233+ , icLatLongRect
234+
235+ -- ** DominantColorsAnnotation
236+ , DominantColorsAnnotation
237+ , dominantColorsAnnotation
238+ , dcaColors
239+
240+ -- ** LatLongRect
241+ , LatLongRect
242+ , latLongRect
243+ , llrMaxLatLng
244+ , llrMinLatLng
245+
246+ -- ** BatchAnnotateImagesResponse
247+ , BatchAnnotateImagesResponse
248+ , batchAnnotateImagesResponse
249+ , bairResponses
250+
251+ -- ** Position
252+ , Position
253+ , position
254+ , pZ
255+ , pX
256+ , pY
257+ ) where
258+
259+import Network.Google.Prelude
260+import Network.Google.Resource.Vision.Images.Annotate
261+import Network.Google.Vision.Types
262+
263+{- $resources
264+TODO
265+-}
266+
267+-- | Represents the entirety of the methods and resources available for the Cloud Vision API service.
268+type VisionAPI = ImagesAnnotateResource
gogol-vision/gen/Network/Google/Vision/Types.hsnew file+255
@@ -0,0 +1,255 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+
6+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
7+
8+-- |
9+-- Module : Network.Google.Vision.Types
10+-- Copyright : (c) 2015 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+module Network.Google.Vision.Types
17+ (
18+ -- * Service Configuration
19+ visionService
20+
21+ -- * OAuth Scopes
22+ , cloudPlatformScope
23+
24+ -- * LatLng
25+ , LatLng
26+ , latLng
27+ , llLatitude
28+ , llLongitude
29+
30+ -- * FaceAnnotationUnderExposedLikelihood
31+ , FaceAnnotationUnderExposedLikelihood (..)
32+
33+ -- * Feature
34+ , Feature
35+ , feature
36+ , fType
37+ , fMaxResults
38+
39+ -- * Status
40+ , Status
41+ , status
42+ , sDetails
43+ , sCode
44+ , sMessage
45+
46+ -- * Property
47+ , Property
48+ , property
49+ , pValue
50+ , pName
51+
52+ -- * Image
53+ , Image
54+ , image
55+ , iContent
56+ , iSource
57+
58+ -- * Landmark
59+ , Landmark
60+ , landmark
61+ , lType
62+ , lPosition
63+
64+ -- * Color
65+ , Color
66+ , color
67+ , cRed
68+ , cAlpha
69+ , cGreen
70+ , cBlue
71+
72+ -- * FaceAnnotationHeadwearLikelihood
73+ , FaceAnnotationHeadwearLikelihood (..)
74+
75+ -- * BoundingPoly
76+ , BoundingPoly
77+ , boundingPoly
78+ , bpVertices
79+
80+ -- * SafeSearchAnnotationAdult
81+ , SafeSearchAnnotationAdult (..)
82+
83+ -- * Vertex
84+ , Vertex
85+ , vertex
86+ , vX
87+ , vY
88+
89+ -- * FaceAnnotationAngerLikelihood
90+ , FaceAnnotationAngerLikelihood (..)
91+
92+ -- * LocationInfo
93+ , LocationInfo
94+ , locationInfo
95+ , liLatLng
96+
97+ -- * SafeSearchAnnotationMedical
98+ , SafeSearchAnnotationMedical (..)
99+
100+ -- * StatusDetailsItem
101+ , StatusDetailsItem
102+ , statusDetailsItem
103+ , sdiAddtional
104+
105+ -- * BatchAnnotateImagesRequest
106+ , BatchAnnotateImagesRequest
107+ , batchAnnotateImagesRequest
108+ , bairRequests
109+
110+ -- * ColorInfo
111+ , ColorInfo
112+ , colorInfo
113+ , ciColor
114+ , ciScore
115+ , ciPixelFraction
116+
117+ -- * FaceAnnotationBlurredLikelihood
118+ , FaceAnnotationBlurredLikelihood (..)
119+
120+ -- * AnnotateImageResponse
121+ , AnnotateImageResponse
122+ , annotateImageResponse
123+ , airLogoAnnotations
124+ , airLabelAnnotations
125+ , airFaceAnnotations
126+ , airError
127+ , airSafeSearchAnnotation
128+ , airLandmarkAnnotations
129+ , airTextAnnotations
130+ , airImagePropertiesAnnotation
131+
132+ -- * ImageProperties
133+ , ImageProperties
134+ , imageProperties
135+ , ipDominantColors
136+
137+ -- * FaceAnnotation
138+ , FaceAnnotation
139+ , faceAnnotation
140+ , faTiltAngle
141+ , faBlurredLikelihood
142+ , faBoundingPoly
143+ , faSurpriseLikelihood
144+ , faLandmarkingConfidence
145+ , faPanAngle
146+ , faRollAngle
147+ , faUnderExposedLikelihood
148+ , faFdBoundingPoly
149+ , faAngerLikelihood
150+ , faDetectionConfidence
151+ , faHeadwearLikelihood
152+ , faSorrowLikelihood
153+ , faJoyLikelihood
154+ , faLandmarks
155+
156+ -- * SafeSearchAnnotationViolence
157+ , SafeSearchAnnotationViolence (..)
158+
159+ -- * EntityAnnotation
160+ , EntityAnnotation
161+ , entityAnnotation
162+ , eaScore
163+ , eaTopicality
164+ , eaLocale
165+ , eaBoundingPoly
166+ , eaConfidence
167+ , eaMid
168+ , eaLocations
169+ , eaDescription
170+ , eaProperties
171+
172+ -- * FeatureType
173+ , FeatureType (..)
174+
175+ -- * AnnotateImageRequest
176+ , AnnotateImageRequest
177+ , annotateImageRequest
178+ , airImage
179+ , airFeatures
180+ , airImageContext
181+
182+ -- * LandmarkType
183+ , LandmarkType (..)
184+
185+ -- * $Xgafv
186+ , $Xgafv (..)
187+
188+ -- * ImageSource
189+ , ImageSource
190+ , imageSource
191+ , isGcsImageURI
192+
193+ -- * SafeSearchAnnotationSpoof
194+ , SafeSearchAnnotationSpoof (..)
195+
196+ -- * FaceAnnotationSurpriseLikelihood
197+ , FaceAnnotationSurpriseLikelihood (..)
198+
199+ -- * SafeSearchAnnotation
200+ , SafeSearchAnnotation
201+ , safeSearchAnnotation
202+ , ssaSpoof
203+ , ssaAdult
204+ , ssaMedical
205+ , ssaViolence
206+
207+ -- * FaceAnnotationSorrowLikelihood
208+ , FaceAnnotationSorrowLikelihood (..)
209+
210+ -- * FaceAnnotationJoyLikelihood
211+ , FaceAnnotationJoyLikelihood (..)
212+
213+ -- * ImageContext
214+ , ImageContext
215+ , imageContext
216+ , icLanguageHints
217+ , icLatLongRect
218+
219+ -- * DominantColorsAnnotation
220+ , DominantColorsAnnotation
221+ , dominantColorsAnnotation
222+ , dcaColors
223+
224+ -- * LatLongRect
225+ , LatLongRect
226+ , latLongRect
227+ , llrMaxLatLng
228+ , llrMinLatLng
229+
230+ -- * BatchAnnotateImagesResponse
231+ , BatchAnnotateImagesResponse
232+ , batchAnnotateImagesResponse
233+ , bairResponses
234+
235+ -- * Position
236+ , Position
237+ , position
238+ , pZ
239+ , pX
240+ , pY
241+ ) where
242+
243+import Network.Google.Prelude
244+import Network.Google.Vision.Types.Product
245+import Network.Google.Vision.Types.Sum
246+
247+-- | Default request referring to version 'v1' of the Cloud Vision API. This contains the host and root path used as a starting point for constructing service requests.
248+visionService :: ServiceConfig
249+visionService
250+ = defaultService (ServiceId "vision:v1")
251+ "vision.googleapis.com"
252+
253+-- | View and manage your data across Google Cloud Platform services
254+cloudPlatformScope :: OAuthScope
255+cloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform";
gogol-vision/gen/Network/Google/Vision/Types/Product.hsnew file+1696
@@ -0,0 +1,1696 @@
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.Vision.Types.Product
12+-- Copyright : (c) 2015 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.Vision.Types.Product where
19+
20+import Network.Google.Prelude
21+import Network.Google.Vision.Types.Sum
22+
23+-- | An object representing a latitude\/longitude pair. This is expressed as
24+-- a pair of doubles representing degrees latitude and degrees longitude.
25+-- Unless specified otherwise, this must conform to the
26+-- <http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf WGS84 standard>.
27+-- Values must be within normalized ranges. Example of normalization code
28+-- in Python: def NormalizeLongitude(longitude): \"\"\"Wraps decimal
29+-- degrees longitude to [-180.0, 180.0].\"\"\" q, r = divmod(longitude,
30+-- 360.0) if r > 180.0 or (r == 180.0 and q \<= -1.0): return r - 360.0
31+-- return r def NormalizeLatLng(latitude, longitude): \"\"\"Wraps decimal
32+-- degrees latitude and longitude to [-180.0, 180.0] and [-90.0, 90.0],
33+-- respectively.\"\"\" r = latitude % 360.0 if r \<= 90.0: return r,
34+-- NormalizeLongitude(longitude) elif r >= 270.0: return r - 360,
35+-- NormalizeLongitude(longitude) else: return 180 - r,
36+-- NormalizeLongitude(longitude + 180.0) assert 180.0 ==
37+-- NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0)
38+-- assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) ==
39+-- NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0,
40+-- 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0,
41+-- -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) ==
42+-- NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) ==
43+-- NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) ==
44+-- NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) ==
45+-- NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) ==
46+-- NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) ==
47+-- NormalizeLatLng(-270.0, 10.0)
48+--
49+-- /See:/ 'latLng' smart constructor.
50+data LatLng = LatLng
51+ { _llLatitude :: !(Maybe (Textual Double))
52+ , _llLongitude :: !(Maybe (Textual Double))
53+ } deriving (Eq,Show,Data,Typeable,Generic)
54+
55+-- | Creates a value of 'LatLng' with the minimum fields required to make a request.
56+--
57+-- Use one of the following lenses to modify other fields as desired:
58+--
59+-- * 'llLatitude'
60+--
61+-- * 'llLongitude'
62+latLng
63+ :: LatLng
64+latLng =
65+ LatLng
66+ { _llLatitude = Nothing
67+ , _llLongitude = Nothing
68+ }
69+
70+-- | The latitude in degrees. It must be in the range [-90.0, +90.0].
71+llLatitude :: Lens' LatLng (Maybe Double)
72+llLatitude
73+ = lens _llLatitude (\ s a -> s{_llLatitude = a}) .
74+ mapping _Coerce
75+
76+-- | The longitude in degrees. It must be in the range [-180.0, +180.0].
77+llLongitude :: Lens' LatLng (Maybe Double)
78+llLongitude
79+ = lens _llLongitude (\ s a -> s{_llLongitude = a}) .
80+ mapping _Coerce
81+
82+instance FromJSON LatLng where
83+ parseJSON
84+ = withObject "LatLng"
85+ (\ o ->
86+ LatLng <$>
87+ (o .:? "latitude") <*> (o .:? "longitude"))
88+
89+instance ToJSON LatLng where
90+ toJSON LatLng{..}
91+ = object
92+ (catMaybes
93+ [("latitude" .=) <$> _llLatitude,
94+ ("longitude" .=) <$> _llLongitude])
95+
96+-- | The /Feature/ indicates what type of image detection task to perform.
97+-- Users describe the type of Vision tasks to perform over images by using
98+-- /Feature/s. Features encode the Vision vertical to operate on and the
99+-- number of top-scoring results to return.
100+--
101+-- /See:/ 'feature' smart constructor.
102+data Feature = Feature
103+ { _fType :: !(Maybe FeatureType)
104+ , _fMaxResults :: !(Maybe (Textual Int32))
105+ } deriving (Eq,Show,Data,Typeable,Generic)
106+
107+-- | Creates a value of 'Feature' with the minimum fields required to make a request.
108+--
109+-- Use one of the following lenses to modify other fields as desired:
110+--
111+-- * 'fType'
112+--
113+-- * 'fMaxResults'
114+feature
115+ :: Feature
116+feature =
117+ Feature
118+ { _fType = Nothing
119+ , _fMaxResults = Nothing
120+ }
121+
122+-- | The feature type.
123+fType :: Lens' Feature (Maybe FeatureType)
124+fType = lens _fType (\ s a -> s{_fType = a})
125+
126+-- | Maximum number of results of this type.
127+fMaxResults :: Lens' Feature (Maybe Int32)
128+fMaxResults
129+ = lens _fMaxResults (\ s a -> s{_fMaxResults = a}) .
130+ mapping _Coerce
131+
132+instance FromJSON Feature where
133+ parseJSON
134+ = withObject "Feature"
135+ (\ o ->
136+ Feature <$> (o .:? "type") <*> (o .:? "maxResults"))
137+
138+instance ToJSON Feature where
139+ toJSON Feature{..}
140+ = object
141+ (catMaybes
142+ [("type" .=) <$> _fType,
143+ ("maxResults" .=) <$> _fMaxResults])
144+
145+-- | The \`Status\` type defines a logical error model that is suitable for
146+-- different programming environments, including REST APIs and RPC APIs. It
147+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
148+-- designed to be: - Simple to use and understand for most users - Flexible
149+-- enough to meet unexpected needs # Overview The \`Status\` message
150+-- contains three pieces of data: error code, error message, and error
151+-- details. The error code should be an enum value of google.rpc.Code, but
152+-- it may accept additional error codes if needed. The error message should
153+-- be a developer-facing English message that helps developers *understand*
154+-- and *resolve* the error. If a localized user-facing error message is
155+-- needed, put the localized message in the error details or localize it in
156+-- the client. The optional error details may contain arbitrary information
157+-- about the error. There is a predefined set of error detail types in the
158+-- package \`google.rpc\` which can be used for common error conditions. #
159+-- Language mapping The \`Status\` message is the logical representation of
160+-- the error model, but it is not necessarily the actual wire format. When
161+-- the \`Status\` message is exposed in different client libraries and
162+-- different wire protocols, it can be mapped differently. For example, it
163+-- will likely be mapped to some exceptions in Java, but more likely mapped
164+-- to some error codes in C. # Other uses The error model and the
165+-- \`Status\` message can be used in a variety of environments, either with
166+-- or without APIs, to provide a consistent developer experience across
167+-- different environments. Example uses of this error model include: -
168+-- Partial errors. If a service needs to return partial errors to the
169+-- client, it may embed the \`Status\` in the normal response to indicate
170+-- the partial errors. - Workflow errors. A typical workflow has multiple
171+-- steps. Each step may have a \`Status\` message for error reporting
172+-- purpose. - Batch operations. If a client uses batch request and batch
173+-- response, the \`Status\` message should be used directly inside batch
174+-- response, one for each error sub-response. - Asynchronous operations. If
175+-- an API call embeds asynchronous operation results in its response, the
176+-- status of those operations should be represented directly using the
177+-- \`Status\` message. - Logging. If some API errors are stored in logs,
178+-- the message \`Status\` could be used directly after any stripping needed
179+-- for security\/privacy reasons.
180+--
181+-- /See:/ 'status' smart constructor.
182+data Status = Status
183+ { _sDetails :: !(Maybe [StatusDetailsItem])
184+ , _sCode :: !(Maybe (Textual Int32))
185+ , _sMessage :: !(Maybe Text)
186+ } deriving (Eq,Show,Data,Typeable,Generic)
187+
188+-- | Creates a value of 'Status' with the minimum fields required to make a request.
189+--
190+-- Use one of the following lenses to modify other fields as desired:
191+--
192+-- * 'sDetails'
193+--
194+-- * 'sCode'
195+--
196+-- * 'sMessage'
197+status
198+ :: Status
199+status =
200+ Status
201+ { _sDetails = Nothing
202+ , _sCode = Nothing
203+ , _sMessage = Nothing
204+ }
205+
206+-- | A list of messages that carry the error details. There will be a common
207+-- set of message types for APIs to use.
208+sDetails :: Lens' Status [StatusDetailsItem]
209+sDetails
210+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
211+ _Default
212+ . _Coerce
213+
214+-- | The status code, which should be an enum value of google.rpc.Code.
215+sCode :: Lens' Status (Maybe Int32)
216+sCode
217+ = lens _sCode (\ s a -> s{_sCode = a}) .
218+ mapping _Coerce
219+
220+-- | A developer-facing error message, which should be in English. Any
221+-- user-facing error message should be localized and sent in the
222+-- google.rpc.Status.details field, or localized by the client.
223+sMessage :: Lens' Status (Maybe Text)
224+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
225+
226+instance FromJSON Status where
227+ parseJSON
228+ = withObject "Status"
229+ (\ o ->
230+ Status <$>
231+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
232+ (o .:? "message"))
233+
234+instance ToJSON Status where
235+ toJSON Status{..}
236+ = object
237+ (catMaybes
238+ [("details" .=) <$> _sDetails,
239+ ("code" .=) <$> _sCode,
240+ ("message" .=) <$> _sMessage])
241+
242+-- | Arbitrary name\/value pair.
243+--
244+-- /See:/ 'property' smart constructor.
245+data Property = Property
246+ { _pValue :: !(Maybe Text)
247+ , _pName :: !(Maybe Text)
248+ } deriving (Eq,Show,Data,Typeable,Generic)
249+
250+-- | Creates a value of 'Property' with the minimum fields required to make a request.
251+--
252+-- Use one of the following lenses to modify other fields as desired:
253+--
254+-- * 'pValue'
255+--
256+-- * 'pName'
257+property
258+ :: Property
259+property =
260+ Property
261+ { _pValue = Nothing
262+ , _pName = Nothing
263+ }
264+
265+-- | Value of the property.
266+pValue :: Lens' Property (Maybe Text)
267+pValue = lens _pValue (\ s a -> s{_pValue = a})
268+
269+-- | Name of the property.
270+pName :: Lens' Property (Maybe Text)
271+pName = lens _pName (\ s a -> s{_pName = a})
272+
273+instance FromJSON Property where
274+ parseJSON
275+ = withObject "Property"
276+ (\ o ->
277+ Property <$> (o .:? "value") <*> (o .:? "name"))
278+
279+instance ToJSON Property where
280+ toJSON Property{..}
281+ = object
282+ (catMaybes
283+ [("value" .=) <$> _pValue, ("name" .=) <$> _pName])
284+
285+-- | Client image to perform Vision tasks over.
286+--
287+-- /See:/ 'image' smart constructor.
288+data Image = Image
289+ { _iContent :: !(Maybe (Textual Word8))
290+ , _iSource :: !(Maybe ImageSource)
291+ } deriving (Eq,Show,Data,Typeable,Generic)
292+
293+-- | Creates a value of 'Image' with the minimum fields required to make a request.
294+--
295+-- Use one of the following lenses to modify other fields as desired:
296+--
297+-- * 'iContent'
298+--
299+-- * 'iSource'
300+image
301+ :: Image
302+image =
303+ Image
304+ { _iContent = Nothing
305+ , _iSource = Nothing
306+ }
307+
308+-- | Image content, represented as a stream of bytes.
309+iContent :: Lens' Image (Maybe Word8)
310+iContent
311+ = lens _iContent (\ s a -> s{_iContent = a}) .
312+ mapping _Coerce
313+
314+-- | Google Cloud Storage image location. If both \'content\' and \'source\'
315+-- are filled for an image, \'content\' takes precedence and it will be
316+-- used for performing the image annotation request.
317+iSource :: Lens' Image (Maybe ImageSource)
318+iSource = lens _iSource (\ s a -> s{_iSource = a})
319+
320+instance FromJSON Image where
321+ parseJSON
322+ = withObject "Image"
323+ (\ o ->
324+ Image <$> (o .:? "content") <*> (o .:? "source"))
325+
326+instance ToJSON Image where
327+ toJSON Image{..}
328+ = object
329+ (catMaybes
330+ [("content" .=) <$> _iContent,
331+ ("source" .=) <$> _iSource])
332+
333+-- | A face-specific landmark (for example, a face feature). Landmark
334+-- positions may fall outside the bounds of the image when the face is near
335+-- one or more edges of the image. Therefore it is NOT guaranteed that 0
336+-- \<= x \< width or 0 \<= y \< height.
337+--
338+-- /See:/ 'landmark' smart constructor.
339+data Landmark = Landmark
340+ { _lType :: !(Maybe LandmarkType)
341+ , _lPosition :: !(Maybe Position)
342+ } deriving (Eq,Show,Data,Typeable,Generic)
343+
344+-- | Creates a value of 'Landmark' with the minimum fields required to make a request.
345+--
346+-- Use one of the following lenses to modify other fields as desired:
347+--
348+-- * 'lType'
349+--
350+-- * 'lPosition'
351+landmark
352+ :: Landmark
353+landmark =
354+ Landmark
355+ { _lType = Nothing
356+ , _lPosition = Nothing
357+ }
358+
359+-- | Face landmark type.
360+lType :: Lens' Landmark (Maybe LandmarkType)
361+lType = lens _lType (\ s a -> s{_lType = a})
362+
363+-- | Face landmark position.
364+lPosition :: Lens' Landmark (Maybe Position)
365+lPosition
366+ = lens _lPosition (\ s a -> s{_lPosition = a})
367+
368+instance FromJSON Landmark where
369+ parseJSON
370+ = withObject "Landmark"
371+ (\ o ->
372+ Landmark <$> (o .:? "type") <*> (o .:? "position"))
373+
374+instance ToJSON Landmark where
375+ toJSON Landmark{..}
376+ = object
377+ (catMaybes
378+ [("type" .=) <$> _lType,
379+ ("position" .=) <$> _lPosition])
380+
381+-- | Represents a color in the RGBA color space. This representation is
382+-- designed for simplicity of conversion to\/from color representations in
383+-- various languages over compactness; for example, the fields of this
384+-- representation can be trivially provided to the constructor of
385+-- \"java.awt.Color\" in Java; it can also be trivially provided to
386+-- UIColor\'s \"+colorWithRed:green:blue:alpha\" method in iOS; and, with
387+-- just a little work, it can be easily formatted into a CSS \"rgba()\"
388+-- string in JavaScript, as well. Here are some examples: Example (Java):
389+-- import com.google.type.Color; \/\/ ... public static java.awt.Color
390+-- fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ?
391+-- protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color(
392+-- protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(),
393+-- alpha); } public static Color toProto(java.awt.Color color) { float red
394+-- = (float) color.getRed(); float green = (float) color.getGreen(); float
395+-- blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder
396+-- resultBuilder = Color .newBuilder() .setRed(red \/ denominator)
397+-- .setGreen(green \/ denominator) .setBlue(blue \/ denominator); int alpha
398+-- = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue
399+-- .newBuilder() .setValue(((float) alpha) \/ denominator) .build()); }
400+-- return resultBuilder.build(); } \/\/ ... Example (iOS \/ Obj-C): \/\/
401+-- ... static UIColor* fromProto(Color* protocolor) { float red =
402+-- [protocolor red]; float green = [protocolor green]; float blue =
403+-- [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float
404+-- alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value];
405+-- } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; }
406+-- static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha;
407+-- if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return
408+-- nil; } Color* result = [Color alloc] init]; [result setRed:red]; [result
409+-- setGreen:green]; [result setBlue:blue]; if (alpha \<= 0.9999) { [result
410+-- setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return
411+-- result; } \/\/ ... Example (JavaScript): \/\/ ... var protoToCssColor =
412+-- function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac
413+-- = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red
414+-- = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255);
415+-- var blue = Math.floor(blueFrac * 255); if (!(\'alpha\' in rgb_color)) {
416+-- return rgbToCssColor_(red, green, blue); } var alphaFrac =
417+-- rgb_color.alpha.value || 0.0; var rgbParams = [red, green,
418+-- blue].join(\',\'); return [\'rgba(\', rgbParams, \',\', alphaFrac,
419+-- \')\'].join(\'\'); }; var rgbToCssColor_ = function(red, green, blue) {
420+-- var rgbNumber = new Number((red \<\< 16) | (green \<\< 8) | blue); var
421+-- hexString = rgbNumber.toString(16); var missingZeros = 6 -
422+-- hexString.length; var resultBuilder = [\'#\']; for (var i = 0; i \<
423+-- missingZeros; i++) { resultBuilder.push(\'0\'); }
424+-- resultBuilder.push(hexString); return resultBuilder.join(\'\'); }; \/\/
425+-- ...
426+--
427+-- /See:/ 'color' smart constructor.
428+data Color = Color
429+ { _cRed :: !(Maybe (Textual Double))
430+ , _cAlpha :: !(Maybe (Textual Double))
431+ , _cGreen :: !(Maybe (Textual Double))
432+ , _cBlue :: !(Maybe (Textual Double))
433+ } deriving (Eq,Show,Data,Typeable,Generic)
434+
435+-- | Creates a value of 'Color' with the minimum fields required to make a request.
436+--
437+-- Use one of the following lenses to modify other fields as desired:
438+--
439+-- * 'cRed'
440+--
441+-- * 'cAlpha'
442+--
443+-- * 'cGreen'
444+--
445+-- * 'cBlue'
446+color
447+ :: Color
448+color =
449+ Color
450+ { _cRed = Nothing
451+ , _cAlpha = Nothing
452+ , _cGreen = Nothing
453+ , _cBlue = Nothing
454+ }
455+
456+-- | The amount of red in the color as a value in the interval [0, 1].
457+cRed :: Lens' Color (Maybe Double)
458+cRed
459+ = lens _cRed (\ s a -> s{_cRed = a}) .
460+ mapping _Coerce
461+
462+-- | The fraction of this color that should be applied to the pixel. That is,
463+-- the final pixel color is defined by the equation: pixel color = alpha *
464+-- (this color) + (1.0 - alpha) * (background color) This means that a
465+-- value of 1.0 corresponds to a solid color, whereas a value of 0.0
466+-- corresponds to a completely transparent color. This uses a wrapper
467+-- message rather than a simple float scalar so that it is possible to
468+-- distinguish between a default value and the value being unset. If
469+-- omitted, this color object is to be rendered as a solid color (as if the
470+-- alpha value had been explicitly given with a value of 1.0).
471+cAlpha :: Lens' Color (Maybe Double)
472+cAlpha
473+ = lens _cAlpha (\ s a -> s{_cAlpha = a}) .
474+ mapping _Coerce
475+
476+-- | The amount of green in the color as a value in the interval [0, 1].
477+cGreen :: Lens' Color (Maybe Double)
478+cGreen
479+ = lens _cGreen (\ s a -> s{_cGreen = a}) .
480+ mapping _Coerce
481+
482+-- | The amount of blue in the color as a value in the interval [0, 1].
483+cBlue :: Lens' Color (Maybe Double)
484+cBlue
485+ = lens _cBlue (\ s a -> s{_cBlue = a}) .
486+ mapping _Coerce
487+
488+instance FromJSON Color where
489+ parseJSON
490+ = withObject "Color"
491+ (\ o ->
492+ Color <$>
493+ (o .:? "red") <*> (o .:? "alpha") <*> (o .:? "green")
494+ <*> (o .:? "blue"))
495+
496+instance ToJSON Color where
497+ toJSON Color{..}
498+ = object
499+ (catMaybes
500+ [("red" .=) <$> _cRed, ("alpha" .=) <$> _cAlpha,
501+ ("green" .=) <$> _cGreen, ("blue" .=) <$> _cBlue])
502+
503+-- | A bounding polygon for the detected image annotation.
504+--
505+-- /See:/ 'boundingPoly' smart constructor.
506+newtype BoundingPoly = BoundingPoly
507+ { _bpVertices :: Maybe [Vertex]
508+ } deriving (Eq,Show,Data,Typeable,Generic)
509+
510+-- | Creates a value of 'BoundingPoly' with the minimum fields required to make a request.
511+--
512+-- Use one of the following lenses to modify other fields as desired:
513+--
514+-- * 'bpVertices'
515+boundingPoly
516+ :: BoundingPoly
517+boundingPoly =
518+ BoundingPoly
519+ { _bpVertices = Nothing
520+ }
521+
522+-- | The bounding polygon vertices.
523+bpVertices :: Lens' BoundingPoly [Vertex]
524+bpVertices
525+ = lens _bpVertices (\ s a -> s{_bpVertices = a}) .
526+ _Default
527+ . _Coerce
528+
529+instance FromJSON BoundingPoly where
530+ parseJSON
531+ = withObject "BoundingPoly"
532+ (\ o ->
533+ BoundingPoly <$> (o .:? "vertices" .!= mempty))
534+
535+instance ToJSON BoundingPoly where
536+ toJSON BoundingPoly{..}
537+ = object
538+ (catMaybes [("vertices" .=) <$> _bpVertices])
539+
540+-- | A vertex represents a 2D point in the image. NOTE: the vertex
541+-- coordinates are in the same scale as the original image.
542+--
543+-- /See:/ 'vertex' smart constructor.
544+data Vertex = Vertex
545+ { _vX :: !(Maybe (Textual Int32))
546+ , _vY :: !(Maybe (Textual Int32))
547+ } deriving (Eq,Show,Data,Typeable,Generic)
548+
549+-- | Creates a value of 'Vertex' with the minimum fields required to make a request.
550+--
551+-- Use one of the following lenses to modify other fields as desired:
552+--
553+-- * 'vX'
554+--
555+-- * 'vY'
556+vertex
557+ :: Vertex
558+vertex =
559+ Vertex
560+ { _vX = Nothing
561+ , _vY = Nothing
562+ }
563+
564+-- | X coordinate.
565+vX :: Lens' Vertex (Maybe Int32)
566+vX = lens _vX (\ s a -> s{_vX = a}) . mapping _Coerce
567+
568+-- | Y coordinate.
569+vY :: Lens' Vertex (Maybe Int32)
570+vY = lens _vY (\ s a -> s{_vY = a}) . mapping _Coerce
571+
572+instance FromJSON Vertex where
573+ parseJSON
574+ = withObject "Vertex"
575+ (\ o -> Vertex <$> (o .:? "x") <*> (o .:? "y"))
576+
577+instance ToJSON Vertex where
578+ toJSON Vertex{..}
579+ = object
580+ (catMaybes [("x" .=) <$> _vX, ("y" .=) <$> _vY])
581+
582+-- | Detected entity location information.
583+--
584+-- /See:/ 'locationInfo' smart constructor.
585+newtype LocationInfo = LocationInfo
586+ { _liLatLng :: Maybe LatLng
587+ } deriving (Eq,Show,Data,Typeable,Generic)
588+
589+-- | Creates a value of 'LocationInfo' with the minimum fields required to make a request.
590+--
591+-- Use one of the following lenses to modify other fields as desired:
592+--
593+-- * 'liLatLng'
594+locationInfo
595+ :: LocationInfo
596+locationInfo =
597+ LocationInfo
598+ { _liLatLng = Nothing
599+ }
600+
601+-- | Lat - long location coordinates.
602+liLatLng :: Lens' LocationInfo (Maybe LatLng)
603+liLatLng = lens _liLatLng (\ s a -> s{_liLatLng = a})
604+
605+instance FromJSON LocationInfo where
606+ parseJSON
607+ = withObject "LocationInfo"
608+ (\ o -> LocationInfo <$> (o .:? "latLng"))
609+
610+instance ToJSON LocationInfo where
611+ toJSON LocationInfo{..}
612+ = object (catMaybes [("latLng" .=) <$> _liLatLng])
613+
614+--
615+-- /See:/ 'statusDetailsItem' smart constructor.
616+newtype StatusDetailsItem = StatusDetailsItem
617+ { _sdiAddtional :: HashMap Text JSONValue
618+ } deriving (Eq,Show,Data,Typeable,Generic)
619+
620+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
621+--
622+-- Use one of the following lenses to modify other fields as desired:
623+--
624+-- * 'sdiAddtional'
625+statusDetailsItem
626+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
627+ -> StatusDetailsItem
628+statusDetailsItem pSdiAddtional_ =
629+ StatusDetailsItem
630+ { _sdiAddtional = _Coerce # pSdiAddtional_
631+ }
632+
633+-- | Properties of the object. Contains field \'ype with type URL.
634+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
635+sdiAddtional
636+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
637+ . _Coerce
638+
639+instance FromJSON StatusDetailsItem where
640+ parseJSON
641+ = withObject "StatusDetailsItem"
642+ (\ o -> StatusDetailsItem <$> (parseJSONObject o))
643+
644+instance ToJSON StatusDetailsItem where
645+ toJSON = toJSON . _sdiAddtional
646+
647+-- | Multiple image annotation requests are batched into a single service
648+-- call.
649+--
650+-- /See:/ 'batchAnnotateImagesRequest' smart constructor.
651+newtype BatchAnnotateImagesRequest = BatchAnnotateImagesRequest
652+ { _bairRequests :: Maybe [AnnotateImageRequest]
653+ } deriving (Eq,Show,Data,Typeable,Generic)
654+
655+-- | Creates a value of 'BatchAnnotateImagesRequest' with the minimum fields required to make a request.
656+--
657+-- Use one of the following lenses to modify other fields as desired:
658+--
659+-- * 'bairRequests'
660+batchAnnotateImagesRequest
661+ :: BatchAnnotateImagesRequest
662+batchAnnotateImagesRequest =
663+ BatchAnnotateImagesRequest
664+ { _bairRequests = Nothing
665+ }
666+
667+-- | Individual image annotation requests for this batch.
668+bairRequests :: Lens' BatchAnnotateImagesRequest [AnnotateImageRequest]
669+bairRequests
670+ = lens _bairRequests (\ s a -> s{_bairRequests = a})
671+ . _Default
672+ . _Coerce
673+
674+instance FromJSON BatchAnnotateImagesRequest where
675+ parseJSON
676+ = withObject "BatchAnnotateImagesRequest"
677+ (\ o ->
678+ BatchAnnotateImagesRequest <$>
679+ (o .:? "requests" .!= mempty))
680+
681+instance ToJSON BatchAnnotateImagesRequest where
682+ toJSON BatchAnnotateImagesRequest{..}
683+ = object
684+ (catMaybes [("requests" .=) <$> _bairRequests])
685+
686+-- | Color information consists of RGB channels, score and fraction of image
687+-- the color occupies in the image.
688+--
689+-- /See:/ 'colorInfo' smart constructor.
690+data ColorInfo = ColorInfo
691+ { _ciColor :: !(Maybe Color)
692+ , _ciScore :: !(Maybe (Textual Double))
693+ , _ciPixelFraction :: !(Maybe (Textual Double))
694+ } deriving (Eq,Show,Data,Typeable,Generic)
695+
696+-- | Creates a value of 'ColorInfo' with the minimum fields required to make a request.
697+--
698+-- Use one of the following lenses to modify other fields as desired:
699+--
700+-- * 'ciColor'
701+--
702+-- * 'ciScore'
703+--
704+-- * 'ciPixelFraction'
705+colorInfo
706+ :: ColorInfo
707+colorInfo =
708+ ColorInfo
709+ { _ciColor = Nothing
710+ , _ciScore = Nothing
711+ , _ciPixelFraction = Nothing
712+ }
713+
714+-- | RGB components of the color.
715+ciColor :: Lens' ColorInfo (Maybe Color)
716+ciColor = lens _ciColor (\ s a -> s{_ciColor = a})
717+
718+-- | Image-specific score for this color. Value in range [0, 1].
719+ciScore :: Lens' ColorInfo (Maybe Double)
720+ciScore
721+ = lens _ciScore (\ s a -> s{_ciScore = a}) .
722+ mapping _Coerce
723+
724+-- | Stores the fraction of pixels the color occupies in the image. Value in
725+-- range [0, 1].
726+ciPixelFraction :: Lens' ColorInfo (Maybe Double)
727+ciPixelFraction
728+ = lens _ciPixelFraction
729+ (\ s a -> s{_ciPixelFraction = a})
730+ . mapping _Coerce
731+
732+instance FromJSON ColorInfo where
733+ parseJSON
734+ = withObject "ColorInfo"
735+ (\ o ->
736+ ColorInfo <$>
737+ (o .:? "color") <*> (o .:? "score") <*>
738+ (o .:? "pixelFraction"))
739+
740+instance ToJSON ColorInfo where
741+ toJSON ColorInfo{..}
742+ = object
743+ (catMaybes
744+ [("color" .=) <$> _ciColor,
745+ ("score" .=) <$> _ciScore,
746+ ("pixelFraction" .=) <$> _ciPixelFraction])
747+
748+-- | Response to an image annotation request.
749+--
750+-- /See:/ 'annotateImageResponse' smart constructor.
751+data AnnotateImageResponse = AnnotateImageResponse
752+ { _airLogoAnnotations :: !(Maybe [EntityAnnotation])
753+ , _airLabelAnnotations :: !(Maybe [EntityAnnotation])
754+ , _airFaceAnnotations :: !(Maybe [FaceAnnotation])
755+ , _airError :: !(Maybe Status)
756+ , _airSafeSearchAnnotation :: !(Maybe SafeSearchAnnotation)
757+ , _airLandmarkAnnotations :: !(Maybe [EntityAnnotation])
758+ , _airTextAnnotations :: !(Maybe [EntityAnnotation])
759+ , _airImagePropertiesAnnotation :: !(Maybe ImageProperties)
760+ } deriving (Eq,Show,Data,Typeable,Generic)
761+
762+-- | Creates a value of 'AnnotateImageResponse' with the minimum fields required to make a request.
763+--
764+-- Use one of the following lenses to modify other fields as desired:
765+--
766+-- * 'airLogoAnnotations'
767+--
768+-- * 'airLabelAnnotations'
769+--
770+-- * 'airFaceAnnotations'
771+--
772+-- * 'airError'
773+--
774+-- * 'airSafeSearchAnnotation'
775+--
776+-- * 'airLandmarkAnnotations'
777+--
778+-- * 'airTextAnnotations'
779+--
780+-- * 'airImagePropertiesAnnotation'
781+annotateImageResponse
782+ :: AnnotateImageResponse
783+annotateImageResponse =
784+ AnnotateImageResponse
785+ { _airLogoAnnotations = Nothing
786+ , _airLabelAnnotations = Nothing
787+ , _airFaceAnnotations = Nothing
788+ , _airError = Nothing
789+ , _airSafeSearchAnnotation = Nothing
790+ , _airLandmarkAnnotations = Nothing
791+ , _airTextAnnotations = Nothing
792+ , _airImagePropertiesAnnotation = Nothing
793+ }
794+
795+-- | If present, logo detection completed successfully.
796+airLogoAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
797+airLogoAnnotations
798+ = lens _airLogoAnnotations
799+ (\ s a -> s{_airLogoAnnotations = a})
800+ . _Default
801+ . _Coerce
802+
803+-- | If present, label detection completed successfully.
804+airLabelAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
805+airLabelAnnotations
806+ = lens _airLabelAnnotations
807+ (\ s a -> s{_airLabelAnnotations = a})
808+ . _Default
809+ . _Coerce
810+
811+-- | If present, face detection completed successfully.
812+airFaceAnnotations :: Lens' AnnotateImageResponse [FaceAnnotation]
813+airFaceAnnotations
814+ = lens _airFaceAnnotations
815+ (\ s a -> s{_airFaceAnnotations = a})
816+ . _Default
817+ . _Coerce
818+
819+-- | If set, represents the error message for the operation. Note that
820+-- filled-in mage annotations are guaranteed to be correct, even when
821+-- 'error' is non-empty.
822+airError :: Lens' AnnotateImageResponse (Maybe Status)
823+airError = lens _airError (\ s a -> s{_airError = a})
824+
825+-- | If present, safe-search annotation completed successfully.
826+airSafeSearchAnnotation :: Lens' AnnotateImageResponse (Maybe SafeSearchAnnotation)
827+airSafeSearchAnnotation
828+ = lens _airSafeSearchAnnotation
829+ (\ s a -> s{_airSafeSearchAnnotation = a})
830+
831+-- | If present, landmark detection completed successfully.
832+airLandmarkAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
833+airLandmarkAnnotations
834+ = lens _airLandmarkAnnotations
835+ (\ s a -> s{_airLandmarkAnnotations = a})
836+ . _Default
837+ . _Coerce
838+
839+-- | If present, text (OCR) detection completed successfully.
840+airTextAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
841+airTextAnnotations
842+ = lens _airTextAnnotations
843+ (\ s a -> s{_airTextAnnotations = a})
844+ . _Default
845+ . _Coerce
846+
847+-- | If present, image properties were extracted successfully.
848+airImagePropertiesAnnotation :: Lens' AnnotateImageResponse (Maybe ImageProperties)
849+airImagePropertiesAnnotation
850+ = lens _airImagePropertiesAnnotation
851+ (\ s a -> s{_airImagePropertiesAnnotation = a})
852+
853+instance FromJSON AnnotateImageResponse where
854+ parseJSON
855+ = withObject "AnnotateImageResponse"
856+ (\ o ->
857+ AnnotateImageResponse <$>
858+ (o .:? "logoAnnotations" .!= mempty) <*>
859+ (o .:? "labelAnnotations" .!= mempty)
860+ <*> (o .:? "faceAnnotations" .!= mempty)
861+ <*> (o .:? "error")
862+ <*> (o .:? "safeSearchAnnotation")
863+ <*> (o .:? "landmarkAnnotations" .!= mempty)
864+ <*> (o .:? "textAnnotations" .!= mempty)
865+ <*> (o .:? "imagePropertiesAnnotation"))
866+
867+instance ToJSON AnnotateImageResponse where
868+ toJSON AnnotateImageResponse{..}
869+ = object
870+ (catMaybes
871+ [("logoAnnotations" .=) <$> _airLogoAnnotations,
872+ ("labelAnnotations" .=) <$> _airLabelAnnotations,
873+ ("faceAnnotations" .=) <$> _airFaceAnnotations,
874+ ("error" .=) <$> _airError,
875+ ("safeSearchAnnotation" .=) <$>
876+ _airSafeSearchAnnotation,
877+ ("landmarkAnnotations" .=) <$>
878+ _airLandmarkAnnotations,
879+ ("textAnnotations" .=) <$> _airTextAnnotations,
880+ ("imagePropertiesAnnotation" .=) <$>
881+ _airImagePropertiesAnnotation])
882+
883+-- | Stores image properties (e.g. dominant colors).
884+--
885+-- /See:/ 'imageProperties' smart constructor.
886+newtype ImageProperties = ImageProperties
887+ { _ipDominantColors :: Maybe DominantColorsAnnotation
888+ } deriving (Eq,Show,Data,Typeable,Generic)
889+
890+-- | Creates a value of 'ImageProperties' with the minimum fields required to make a request.
891+--
892+-- Use one of the following lenses to modify other fields as desired:
893+--
894+-- * 'ipDominantColors'
895+imageProperties
896+ :: ImageProperties
897+imageProperties =
898+ ImageProperties
899+ { _ipDominantColors = Nothing
900+ }
901+
902+-- | If present, dominant colors completed successfully.
903+ipDominantColors :: Lens' ImageProperties (Maybe DominantColorsAnnotation)
904+ipDominantColors
905+ = lens _ipDominantColors
906+ (\ s a -> s{_ipDominantColors = a})
907+
908+instance FromJSON ImageProperties where
909+ parseJSON
910+ = withObject "ImageProperties"
911+ (\ o -> ImageProperties <$> (o .:? "dominantColors"))
912+
913+instance ToJSON ImageProperties where
914+ toJSON ImageProperties{..}
915+ = object
916+ (catMaybes
917+ [("dominantColors" .=) <$> _ipDominantColors])
918+
919+-- | A face annotation contains the results of face detection.
920+--
921+-- /See:/ 'faceAnnotation' smart constructor.
922+data FaceAnnotation = FaceAnnotation
923+ { _faTiltAngle :: !(Maybe (Textual Double))
924+ , _faBlurredLikelihood :: !(Maybe FaceAnnotationBlurredLikelihood)
925+ , _faBoundingPoly :: !(Maybe BoundingPoly)
926+ , _faSurpriseLikelihood :: !(Maybe FaceAnnotationSurpriseLikelihood)
927+ , _faLandmarkingConfidence :: !(Maybe (Textual Double))
928+ , _faPanAngle :: !(Maybe (Textual Double))
929+ , _faRollAngle :: !(Maybe (Textual Double))
930+ , _faUnderExposedLikelihood :: !(Maybe FaceAnnotationUnderExposedLikelihood)
931+ , _faFdBoundingPoly :: !(Maybe BoundingPoly)
932+ , _faAngerLikelihood :: !(Maybe FaceAnnotationAngerLikelihood)
933+ , _faDetectionConfidence :: !(Maybe (Textual Double))
934+ , _faHeadwearLikelihood :: !(Maybe FaceAnnotationHeadwearLikelihood)
935+ , _faSorrowLikelihood :: !(Maybe FaceAnnotationSorrowLikelihood)
936+ , _faJoyLikelihood :: !(Maybe FaceAnnotationJoyLikelihood)
937+ , _faLandmarks :: !(Maybe [Landmark])
938+ } deriving (Eq,Show,Data,Typeable,Generic)
939+
940+-- | Creates a value of 'FaceAnnotation' with the minimum fields required to make a request.
941+--
942+-- Use one of the following lenses to modify other fields as desired:
943+--
944+-- * 'faTiltAngle'
945+--
946+-- * 'faBlurredLikelihood'
947+--
948+-- * 'faBoundingPoly'
949+--
950+-- * 'faSurpriseLikelihood'
951+--
952+-- * 'faLandmarkingConfidence'
953+--
954+-- * 'faPanAngle'
955+--
956+-- * 'faRollAngle'
957+--
958+-- * 'faUnderExposedLikelihood'
959+--
960+-- * 'faFdBoundingPoly'
961+--
962+-- * 'faAngerLikelihood'
963+--
964+-- * 'faDetectionConfidence'
965+--
966+-- * 'faHeadwearLikelihood'
967+--
968+-- * 'faSorrowLikelihood'
969+--
970+-- * 'faJoyLikelihood'
971+--
972+-- * 'faLandmarks'
973+faceAnnotation
974+ :: FaceAnnotation
975+faceAnnotation =
976+ FaceAnnotation
977+ { _faTiltAngle = Nothing
978+ , _faBlurredLikelihood = Nothing
979+ , _faBoundingPoly = Nothing
980+ , _faSurpriseLikelihood = Nothing
981+ , _faLandmarkingConfidence = Nothing
982+ , _faPanAngle = Nothing
983+ , _faRollAngle = Nothing
984+ , _faUnderExposedLikelihood = Nothing
985+ , _faFdBoundingPoly = Nothing
986+ , _faAngerLikelihood = Nothing
987+ , _faDetectionConfidence = Nothing
988+ , _faHeadwearLikelihood = Nothing
989+ , _faSorrowLikelihood = Nothing
990+ , _faJoyLikelihood = Nothing
991+ , _faLandmarks = Nothing
992+ }
993+
994+-- | Pitch angle. Indicates the upwards\/downwards angle that the face is
995+-- pointing relative to the image\'s horizontal plane. Range [-180,180].
996+faTiltAngle :: Lens' FaceAnnotation (Maybe Double)
997+faTiltAngle
998+ = lens _faTiltAngle (\ s a -> s{_faTiltAngle = a}) .
999+ mapping _Coerce
1000+
1001+-- | Blurred likelihood.
1002+faBlurredLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationBlurredLikelihood)
1003+faBlurredLikelihood
1004+ = lens _faBlurredLikelihood
1005+ (\ s a -> s{_faBlurredLikelihood = a})
1006+
1007+-- | The bounding polygon around the face. The coordinates of the bounding
1008+-- box are in the original image\'s scale, as returned in ImageParams. The
1009+-- bounding box is computed to \"frame\" the face in accordance with human
1010+-- expectations. It is based on the landmarker results. Note that one or
1011+-- more x and\/or y coordinates may not be generated in the BoundingPoly
1012+-- (the polygon will be unbounded) if only a partial face appears in the
1013+-- image to be annotated.
1014+faBoundingPoly :: Lens' FaceAnnotation (Maybe BoundingPoly)
1015+faBoundingPoly
1016+ = lens _faBoundingPoly
1017+ (\ s a -> s{_faBoundingPoly = a})
1018+
1019+-- | Surprise likelihood.
1020+faSurpriseLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationSurpriseLikelihood)
1021+faSurpriseLikelihood
1022+ = lens _faSurpriseLikelihood
1023+ (\ s a -> s{_faSurpriseLikelihood = a})
1024+
1025+-- | Face landmarking confidence. Range [0, 1].
1026+faLandmarkingConfidence :: Lens' FaceAnnotation (Maybe Double)
1027+faLandmarkingConfidence
1028+ = lens _faLandmarkingConfidence
1029+ (\ s a -> s{_faLandmarkingConfidence = a})
1030+ . mapping _Coerce
1031+
1032+-- | Yaw angle. Indicates the leftward\/rightward angle that the face is
1033+-- pointing, relative to the vertical plane perpendicular to the image.
1034+-- Range [-180,180].
1035+faPanAngle :: Lens' FaceAnnotation (Maybe Double)
1036+faPanAngle
1037+ = lens _faPanAngle (\ s a -> s{_faPanAngle = a}) .
1038+ mapping _Coerce
1039+
1040+-- | Roll angle. Indicates the amount of clockwise\/anti-clockwise rotation
1041+-- of the face relative to the image vertical, about the axis perpendicular
1042+-- to the face. Range [-180,180].
1043+faRollAngle :: Lens' FaceAnnotation (Maybe Double)
1044+faRollAngle
1045+ = lens _faRollAngle (\ s a -> s{_faRollAngle = a}) .
1046+ mapping _Coerce
1047+
1048+-- | Under-exposed likelihood.
1049+faUnderExposedLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationUnderExposedLikelihood)
1050+faUnderExposedLikelihood
1051+ = lens _faUnderExposedLikelihood
1052+ (\ s a -> s{_faUnderExposedLikelihood = a})
1053+
1054+-- | This bounding polygon is tighter than the previous 'boundingPoly', and
1055+-- encloses only the skin part of the face. Typically, it is used to
1056+-- eliminate the face from any image analysis that detects the \"amount of
1057+-- skin\" visible in an image. It is not based on the landmarker results,
1058+-- only on the initial face detection, hence the 'fd' (face detection)
1059+-- prefix.
1060+faFdBoundingPoly :: Lens' FaceAnnotation (Maybe BoundingPoly)
1061+faFdBoundingPoly
1062+ = lens _faFdBoundingPoly
1063+ (\ s a -> s{_faFdBoundingPoly = a})
1064+
1065+-- | Anger likelihood.
1066+faAngerLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationAngerLikelihood)
1067+faAngerLikelihood
1068+ = lens _faAngerLikelihood
1069+ (\ s a -> s{_faAngerLikelihood = a})
1070+
1071+-- | Detection confidence. Range [0, 1].
1072+faDetectionConfidence :: Lens' FaceAnnotation (Maybe Double)
1073+faDetectionConfidence
1074+ = lens _faDetectionConfidence
1075+ (\ s a -> s{_faDetectionConfidence = a})
1076+ . mapping _Coerce
1077+
1078+-- | Headwear likelihood.
1079+faHeadwearLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationHeadwearLikelihood)
1080+faHeadwearLikelihood
1081+ = lens _faHeadwearLikelihood
1082+ (\ s a -> s{_faHeadwearLikelihood = a})
1083+
1084+-- | Sorrow likelihood.
1085+faSorrowLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationSorrowLikelihood)
1086+faSorrowLikelihood
1087+ = lens _faSorrowLikelihood
1088+ (\ s a -> s{_faSorrowLikelihood = a})
1089+
1090+-- | Joy likelihood.
1091+faJoyLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationJoyLikelihood)
1092+faJoyLikelihood
1093+ = lens _faJoyLikelihood
1094+ (\ s a -> s{_faJoyLikelihood = a})
1095+
1096+-- | Detected face landmarks.
1097+faLandmarks :: Lens' FaceAnnotation [Landmark]
1098+faLandmarks
1099+ = lens _faLandmarks (\ s a -> s{_faLandmarks = a}) .
1100+ _Default
1101+ . _Coerce
1102+
1103+instance FromJSON FaceAnnotation where
1104+ parseJSON
1105+ = withObject "FaceAnnotation"
1106+ (\ o ->
1107+ FaceAnnotation <$>
1108+ (o .:? "tiltAngle") <*> (o .:? "blurredLikelihood")
1109+ <*> (o .:? "boundingPoly")
1110+ <*> (o .:? "surpriseLikelihood")
1111+ <*> (o .:? "landmarkingConfidence")
1112+ <*> (o .:? "panAngle")
1113+ <*> (o .:? "rollAngle")
1114+ <*> (o .:? "underExposedLikelihood")
1115+ <*> (o .:? "fdBoundingPoly")
1116+ <*> (o .:? "angerLikelihood")
1117+ <*> (o .:? "detectionConfidence")
1118+ <*> (o .:? "headwearLikelihood")
1119+ <*> (o .:? "sorrowLikelihood")
1120+ <*> (o .:? "joyLikelihood")
1121+ <*> (o .:? "landmarks" .!= mempty))
1122+
1123+instance ToJSON FaceAnnotation where
1124+ toJSON FaceAnnotation{..}
1125+ = object
1126+ (catMaybes
1127+ [("tiltAngle" .=) <$> _faTiltAngle,
1128+ ("blurredLikelihood" .=) <$> _faBlurredLikelihood,
1129+ ("boundingPoly" .=) <$> _faBoundingPoly,
1130+ ("surpriseLikelihood" .=) <$> _faSurpriseLikelihood,
1131+ ("landmarkingConfidence" .=) <$>
1132+ _faLandmarkingConfidence,
1133+ ("panAngle" .=) <$> _faPanAngle,
1134+ ("rollAngle" .=) <$> _faRollAngle,
1135+ ("underExposedLikelihood" .=) <$>
1136+ _faUnderExposedLikelihood,
1137+ ("fdBoundingPoly" .=) <$> _faFdBoundingPoly,
1138+ ("angerLikelihood" .=) <$> _faAngerLikelihood,
1139+ ("detectionConfidence" .=) <$>
1140+ _faDetectionConfidence,
1141+ ("headwearLikelihood" .=) <$> _faHeadwearLikelihood,
1142+ ("sorrowLikelihood" .=) <$> _faSorrowLikelihood,
1143+ ("joyLikelihood" .=) <$> _faJoyLikelihood,
1144+ ("landmarks" .=) <$> _faLandmarks])
1145+
1146+-- | Set of detected entity features.
1147+--
1148+-- /See:/ 'entityAnnotation' smart constructor.
1149+data EntityAnnotation = EntityAnnotation
1150+ { _eaScore :: !(Maybe (Textual Double))
1151+ , _eaTopicality :: !(Maybe (Textual Double))
1152+ , _eaLocale :: !(Maybe Text)
1153+ , _eaBoundingPoly :: !(Maybe BoundingPoly)
1154+ , _eaConfidence :: !(Maybe (Textual Double))
1155+ , _eaMid :: !(Maybe Text)
1156+ , _eaLocations :: !(Maybe [LocationInfo])
1157+ , _eaDescription :: !(Maybe Text)
1158+ , _eaProperties :: !(Maybe [Property])
1159+ } deriving (Eq,Show,Data,Typeable,Generic)
1160+
1161+-- | Creates a value of 'EntityAnnotation' with the minimum fields required to make a request.
1162+--
1163+-- Use one of the following lenses to modify other fields as desired:
1164+--
1165+-- * 'eaScore'
1166+--
1167+-- * 'eaTopicality'
1168+--
1169+-- * 'eaLocale'
1170+--
1171+-- * 'eaBoundingPoly'
1172+--
1173+-- * 'eaConfidence'
1174+--
1175+-- * 'eaMid'
1176+--
1177+-- * 'eaLocations'
1178+--
1179+-- * 'eaDescription'
1180+--
1181+-- * 'eaProperties'
1182+entityAnnotation
1183+ :: EntityAnnotation
1184+entityAnnotation =
1185+ EntityAnnotation
1186+ { _eaScore = Nothing
1187+ , _eaTopicality = Nothing
1188+ , _eaLocale = Nothing
1189+ , _eaBoundingPoly = Nothing
1190+ , _eaConfidence = Nothing
1191+ , _eaMid = Nothing
1192+ , _eaLocations = Nothing
1193+ , _eaDescription = Nothing
1194+ , _eaProperties = Nothing
1195+ }
1196+
1197+-- | Overall score of the result. Range [0, 1].
1198+eaScore :: Lens' EntityAnnotation (Maybe Double)
1199+eaScore
1200+ = lens _eaScore (\ s a -> s{_eaScore = a}) .
1201+ mapping _Coerce
1202+
1203+-- | The relevancy of the ICA (Image Content Annotation) label to the image.
1204+-- For example, the relevancy of \'tower\' to an image containing \'Eiffel
1205+-- Tower\' is likely higher than an image containing a distant towering
1206+-- building, though the confidence that there is a tower may be the same.
1207+-- Range [0, 1].
1208+eaTopicality :: Lens' EntityAnnotation (Maybe Double)
1209+eaTopicality
1210+ = lens _eaTopicality (\ s a -> s{_eaTopicality = a})
1211+ . mapping _Coerce
1212+
1213+-- | The language code for the locale in which the entity textual
1214+-- 'description' (next field) is expressed.
1215+eaLocale :: Lens' EntityAnnotation (Maybe Text)
1216+eaLocale = lens _eaLocale (\ s a -> s{_eaLocale = a})
1217+
1218+-- | Image region to which this entity belongs.
1219+eaBoundingPoly :: Lens' EntityAnnotation (Maybe BoundingPoly)
1220+eaBoundingPoly
1221+ = lens _eaBoundingPoly
1222+ (\ s a -> s{_eaBoundingPoly = a})
1223+
1224+-- | The accuracy of the entity detection in an image. For example, for an
1225+-- image containing \'Eiffel Tower,\' this field represents the confidence
1226+-- that there is a tower in the query image. Range [0, 1].
1227+eaConfidence :: Lens' EntityAnnotation (Maybe Double)
1228+eaConfidence
1229+ = lens _eaConfidence (\ s a -> s{_eaConfidence = a})
1230+ . mapping _Coerce
1231+
1232+-- | Knowledge Graph entity ID. Maps to a freebase entity ID. (for example,
1233+-- \"Google\" maps to: mid \/m\/045c7b).
1234+eaMid :: Lens' EntityAnnotation (Maybe Text)
1235+eaMid = lens _eaMid (\ s a -> s{_eaMid = a})
1236+
1237+-- | The location information for the detected entity. Multiple
1238+-- 'LocationInfo' elements can be present since one location may indicate
1239+-- the location of the scene in the query image, and another the location
1240+-- of the place where the query image was taken. Location information is
1241+-- usually present for landmarks.
1242+eaLocations :: Lens' EntityAnnotation [LocationInfo]
1243+eaLocations
1244+ = lens _eaLocations (\ s a -> s{_eaLocations = a}) .
1245+ _Default
1246+ . _Coerce
1247+
1248+-- | Entity textual description, expressed in its 'locale' language.
1249+eaDescription :: Lens' EntityAnnotation (Maybe Text)
1250+eaDescription
1251+ = lens _eaDescription
1252+ (\ s a -> s{_eaDescription = a})
1253+
1254+-- | Some entities can have additional optional 'Property' fields. For
1255+-- example a different kind of score or string that qualifies the entity.
1256+eaProperties :: Lens' EntityAnnotation [Property]
1257+eaProperties
1258+ = lens _eaProperties (\ s a -> s{_eaProperties = a})
1259+ . _Default
1260+ . _Coerce
1261+
1262+instance FromJSON EntityAnnotation where
1263+ parseJSON
1264+ = withObject "EntityAnnotation"
1265+ (\ o ->
1266+ EntityAnnotation <$>
1267+ (o .:? "score") <*> (o .:? "topicality") <*>
1268+ (o .:? "locale")
1269+ <*> (o .:? "boundingPoly")
1270+ <*> (o .:? "confidence")
1271+ <*> (o .:? "mid")
1272+ <*> (o .:? "locations" .!= mempty)
1273+ <*> (o .:? "description")
1274+ <*> (o .:? "properties" .!= mempty))
1275+
1276+instance ToJSON EntityAnnotation where
1277+ toJSON EntityAnnotation{..}
1278+ = object
1279+ (catMaybes
1280+ [("score" .=) <$> _eaScore,
1281+ ("topicality" .=) <$> _eaTopicality,
1282+ ("locale" .=) <$> _eaLocale,
1283+ ("boundingPoly" .=) <$> _eaBoundingPoly,
1284+ ("confidence" .=) <$> _eaConfidence,
1285+ ("mid" .=) <$> _eaMid,
1286+ ("locations" .=) <$> _eaLocations,
1287+ ("description" .=) <$> _eaDescription,
1288+ ("properties" .=) <$> _eaProperties])
1289+
1290+-- | Request for performing Vision tasks over a user-provided image, with
1291+-- user-requested features.
1292+--
1293+-- /See:/ 'annotateImageRequest' smart constructor.
1294+data AnnotateImageRequest = AnnotateImageRequest
1295+ { _airImage :: !(Maybe Image)
1296+ , _airFeatures :: !(Maybe [Feature])
1297+ , _airImageContext :: !(Maybe ImageContext)
1298+ } deriving (Eq,Show,Data,Typeable,Generic)
1299+
1300+-- | Creates a value of 'AnnotateImageRequest' with the minimum fields required to make a request.
1301+--
1302+-- Use one of the following lenses to modify other fields as desired:
1303+--
1304+-- * 'airImage'
1305+--
1306+-- * 'airFeatures'
1307+--
1308+-- * 'airImageContext'
1309+annotateImageRequest
1310+ :: AnnotateImageRequest
1311+annotateImageRequest =
1312+ AnnotateImageRequest
1313+ { _airImage = Nothing
1314+ , _airFeatures = Nothing
1315+ , _airImageContext = Nothing
1316+ }
1317+
1318+-- | The image to be processed.
1319+airImage :: Lens' AnnotateImageRequest (Maybe Image)
1320+airImage = lens _airImage (\ s a -> s{_airImage = a})
1321+
1322+-- | Requested features.
1323+airFeatures :: Lens' AnnotateImageRequest [Feature]
1324+airFeatures
1325+ = lens _airFeatures (\ s a -> s{_airFeatures = a}) .
1326+ _Default
1327+ . _Coerce
1328+
1329+-- | Additional context that may accompany the image.
1330+airImageContext :: Lens' AnnotateImageRequest (Maybe ImageContext)
1331+airImageContext
1332+ = lens _airImageContext
1333+ (\ s a -> s{_airImageContext = a})
1334+
1335+instance FromJSON AnnotateImageRequest where
1336+ parseJSON
1337+ = withObject "AnnotateImageRequest"
1338+ (\ o ->
1339+ AnnotateImageRequest <$>
1340+ (o .:? "image") <*> (o .:? "features" .!= mempty) <*>
1341+ (o .:? "imageContext"))
1342+
1343+instance ToJSON AnnotateImageRequest where
1344+ toJSON AnnotateImageRequest{..}
1345+ = object
1346+ (catMaybes
1347+ [("image" .=) <$> _airImage,
1348+ ("features" .=) <$> _airFeatures,
1349+ ("imageContext" .=) <$> _airImageContext])
1350+
1351+-- | External image source (i.e. Google Cloud Storage image location).
1352+--
1353+-- /See:/ 'imageSource' smart constructor.
1354+newtype ImageSource = ImageSource
1355+ { _isGcsImageURI :: Maybe Text
1356+ } deriving (Eq,Show,Data,Typeable,Generic)
1357+
1358+-- | Creates a value of 'ImageSource' with the minimum fields required to make a request.
1359+--
1360+-- Use one of the following lenses to modify other fields as desired:
1361+--
1362+-- * 'isGcsImageURI'
1363+imageSource
1364+ :: ImageSource
1365+imageSource =
1366+ ImageSource
1367+ { _isGcsImageURI = Nothing
1368+ }
1369+
1370+-- | Google Cloud Storage image URI. It must be in the following form:
1371+-- \"gs:\/\/bucket_name\/object_name\". For more details, please see:
1372+-- https:\/\/cloud.google.com\/storage\/docs\/reference-uris. NOTE: Cloud
1373+-- Storage object versioning is not supported!
1374+isGcsImageURI :: Lens' ImageSource (Maybe Text)
1375+isGcsImageURI
1376+ = lens _isGcsImageURI
1377+ (\ s a -> s{_isGcsImageURI = a})
1378+
1379+instance FromJSON ImageSource where
1380+ parseJSON
1381+ = withObject "ImageSource"
1382+ (\ o -> ImageSource <$> (o .:? "gcsImageUri"))
1383+
1384+instance ToJSON ImageSource where
1385+ toJSON ImageSource{..}
1386+ = object
1387+ (catMaybes [("gcsImageUri" .=) <$> _isGcsImageURI])
1388+
1389+-- | Set of features pertaining to the image, computed by various computer
1390+-- vision methods over safe-search verticals (for example, adult, spoof,
1391+-- medical, violence).
1392+--
1393+-- /See:/ 'safeSearchAnnotation' smart constructor.
1394+data SafeSearchAnnotation = SafeSearchAnnotation
1395+ { _ssaSpoof :: !(Maybe SafeSearchAnnotationSpoof)
1396+ , _ssaAdult :: !(Maybe SafeSearchAnnotationAdult)
1397+ , _ssaMedical :: !(Maybe SafeSearchAnnotationMedical)
1398+ , _ssaViolence :: !(Maybe SafeSearchAnnotationViolence)
1399+ } deriving (Eq,Show,Data,Typeable,Generic)
1400+
1401+-- | Creates a value of 'SafeSearchAnnotation' with the minimum fields required to make a request.
1402+--
1403+-- Use one of the following lenses to modify other fields as desired:
1404+--
1405+-- * 'ssaSpoof'
1406+--
1407+-- * 'ssaAdult'
1408+--
1409+-- * 'ssaMedical'
1410+--
1411+-- * 'ssaViolence'
1412+safeSearchAnnotation
1413+ :: SafeSearchAnnotation
1414+safeSearchAnnotation =
1415+ SafeSearchAnnotation
1416+ { _ssaSpoof = Nothing
1417+ , _ssaAdult = Nothing
1418+ , _ssaMedical = Nothing
1419+ , _ssaViolence = Nothing
1420+ }
1421+
1422+-- | Spoof likelihood. The likelihood that an obvious modification was made
1423+-- to the image\'s canonical version to make it appear funny or offensive.
1424+ssaSpoof :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationSpoof)
1425+ssaSpoof = lens _ssaSpoof (\ s a -> s{_ssaSpoof = a})
1426+
1427+-- | Represents the adult contents likelihood for the image.
1428+ssaAdult :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationAdult)
1429+ssaAdult = lens _ssaAdult (\ s a -> s{_ssaAdult = a})
1430+
1431+-- | Likelihood this is a medical image.
1432+ssaMedical :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationMedical)
1433+ssaMedical
1434+ = lens _ssaMedical (\ s a -> s{_ssaMedical = a})
1435+
1436+-- | Violence likelihood.
1437+ssaViolence :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationViolence)
1438+ssaViolence
1439+ = lens _ssaViolence (\ s a -> s{_ssaViolence = a})
1440+
1441+instance FromJSON SafeSearchAnnotation where
1442+ parseJSON
1443+ = withObject "SafeSearchAnnotation"
1444+ (\ o ->
1445+ SafeSearchAnnotation <$>
1446+ (o .:? "spoof") <*> (o .:? "adult") <*>
1447+ (o .:? "medical")
1448+ <*> (o .:? "violence"))
1449+
1450+instance ToJSON SafeSearchAnnotation where
1451+ toJSON SafeSearchAnnotation{..}
1452+ = object
1453+ (catMaybes
1454+ [("spoof" .=) <$> _ssaSpoof,
1455+ ("adult" .=) <$> _ssaAdult,
1456+ ("medical" .=) <$> _ssaMedical,
1457+ ("violence" .=) <$> _ssaViolence])
1458+
1459+-- | Image context.
1460+--
1461+-- /See:/ 'imageContext' smart constructor.
1462+data ImageContext = ImageContext
1463+ { _icLanguageHints :: !(Maybe [Text])
1464+ , _icLatLongRect :: !(Maybe LatLongRect)
1465+ } deriving (Eq,Show,Data,Typeable,Generic)
1466+
1467+-- | Creates a value of 'ImageContext' with the minimum fields required to make a request.
1468+--
1469+-- Use one of the following lenses to modify other fields as desired:
1470+--
1471+-- * 'icLanguageHints'
1472+--
1473+-- * 'icLatLongRect'
1474+imageContext
1475+ :: ImageContext
1476+imageContext =
1477+ ImageContext
1478+ { _icLanguageHints = Nothing
1479+ , _icLatLongRect = Nothing
1480+ }
1481+
1482+-- | List of languages to use for TEXT_DETECTION. In most cases, an empty
1483+-- value will yield the best results as it will allow text detection to
1484+-- automatically detect the text language. For languages based on the latin
1485+-- alphabet a hint is not needed. In rare cases, when the language of the
1486+-- text in the image is known in advance, setting this hint will help get
1487+-- better results (although it will hurt a great deal if the hint is
1488+-- wrong). Text detection will return an error if one or more of the
1489+-- languages specified here are not supported. The exact list of supported
1490+-- languages are specified here:
1491+-- https:\/\/cloud.google.com\/translate\/v2\/using_rest#language-params
1492+icLanguageHints :: Lens' ImageContext [Text]
1493+icLanguageHints
1494+ = lens _icLanguageHints
1495+ (\ s a -> s{_icLanguageHints = a})
1496+ . _Default
1497+ . _Coerce
1498+
1499+-- | Lat\/long rectangle that specifies the location of the image.
1500+icLatLongRect :: Lens' ImageContext (Maybe LatLongRect)
1501+icLatLongRect
1502+ = lens _icLatLongRect
1503+ (\ s a -> s{_icLatLongRect = a})
1504+
1505+instance FromJSON ImageContext where
1506+ parseJSON
1507+ = withObject "ImageContext"
1508+ (\ o ->
1509+ ImageContext <$>
1510+ (o .:? "languageHints" .!= mempty) <*>
1511+ (o .:? "latLongRect"))
1512+
1513+instance ToJSON ImageContext where
1514+ toJSON ImageContext{..}
1515+ = object
1516+ (catMaybes
1517+ [("languageHints" .=) <$> _icLanguageHints,
1518+ ("latLongRect" .=) <$> _icLatLongRect])
1519+
1520+-- | Set of dominant colors and their corresponding scores.
1521+--
1522+-- /See:/ 'dominantColorsAnnotation' smart constructor.
1523+newtype DominantColorsAnnotation = DominantColorsAnnotation
1524+ { _dcaColors :: Maybe [ColorInfo]
1525+ } deriving (Eq,Show,Data,Typeable,Generic)
1526+
1527+-- | Creates a value of 'DominantColorsAnnotation' with the minimum fields required to make a request.
1528+--
1529+-- Use one of the following lenses to modify other fields as desired:
1530+--
1531+-- * 'dcaColors'
1532+dominantColorsAnnotation
1533+ :: DominantColorsAnnotation
1534+dominantColorsAnnotation =
1535+ DominantColorsAnnotation
1536+ { _dcaColors = Nothing
1537+ }
1538+
1539+-- | RGB color values, with their score and pixel fraction.
1540+dcaColors :: Lens' DominantColorsAnnotation [ColorInfo]
1541+dcaColors
1542+ = lens _dcaColors (\ s a -> s{_dcaColors = a}) .
1543+ _Default
1544+ . _Coerce
1545+
1546+instance FromJSON DominantColorsAnnotation where
1547+ parseJSON
1548+ = withObject "DominantColorsAnnotation"
1549+ (\ o ->
1550+ DominantColorsAnnotation <$>
1551+ (o .:? "colors" .!= mempty))
1552+
1553+instance ToJSON DominantColorsAnnotation where
1554+ toJSON DominantColorsAnnotation{..}
1555+ = object (catMaybes [("colors" .=) <$> _dcaColors])
1556+
1557+-- | Rectangle determined by min and max LatLng pairs.
1558+--
1559+-- /See:/ 'latLongRect' smart constructor.
1560+data LatLongRect = LatLongRect
1561+ { _llrMaxLatLng :: !(Maybe LatLng)
1562+ , _llrMinLatLng :: !(Maybe LatLng)
1563+ } deriving (Eq,Show,Data,Typeable,Generic)
1564+
1565+-- | Creates a value of 'LatLongRect' with the minimum fields required to make a request.
1566+--
1567+-- Use one of the following lenses to modify other fields as desired:
1568+--
1569+-- * 'llrMaxLatLng'
1570+--
1571+-- * 'llrMinLatLng'
1572+latLongRect
1573+ :: LatLongRect
1574+latLongRect =
1575+ LatLongRect
1576+ { _llrMaxLatLng = Nothing
1577+ , _llrMinLatLng = Nothing
1578+ }
1579+
1580+-- | Max lat\/long pair.
1581+llrMaxLatLng :: Lens' LatLongRect (Maybe LatLng)
1582+llrMaxLatLng
1583+ = lens _llrMaxLatLng (\ s a -> s{_llrMaxLatLng = a})
1584+
1585+-- | Min lat\/long pair.
1586+llrMinLatLng :: Lens' LatLongRect (Maybe LatLng)
1587+llrMinLatLng
1588+ = lens _llrMinLatLng (\ s a -> s{_llrMinLatLng = a})
1589+
1590+instance FromJSON LatLongRect where
1591+ parseJSON
1592+ = withObject "LatLongRect"
1593+ (\ o ->
1594+ LatLongRect <$>
1595+ (o .:? "maxLatLng") <*> (o .:? "minLatLng"))
1596+
1597+instance ToJSON LatLongRect where
1598+ toJSON LatLongRect{..}
1599+ = object
1600+ (catMaybes
1601+ [("maxLatLng" .=) <$> _llrMaxLatLng,
1602+ ("minLatLng" .=) <$> _llrMinLatLng])
1603+
1604+-- | Response to a batch image annotation request.
1605+--
1606+-- /See:/ 'batchAnnotateImagesResponse' smart constructor.
1607+newtype BatchAnnotateImagesResponse = BatchAnnotateImagesResponse
1608+ { _bairResponses :: Maybe [AnnotateImageResponse]
1609+ } deriving (Eq,Show,Data,Typeable,Generic)
1610+
1611+-- | Creates a value of 'BatchAnnotateImagesResponse' with the minimum fields required to make a request.
1612+--
1613+-- Use one of the following lenses to modify other fields as desired:
1614+--
1615+-- * 'bairResponses'
1616+batchAnnotateImagesResponse
1617+ :: BatchAnnotateImagesResponse
1618+batchAnnotateImagesResponse =
1619+ BatchAnnotateImagesResponse
1620+ { _bairResponses = Nothing
1621+ }
1622+
1623+-- | Individual responses to image annotation requests within the batch.
1624+bairResponses :: Lens' BatchAnnotateImagesResponse [AnnotateImageResponse]
1625+bairResponses
1626+ = lens _bairResponses
1627+ (\ s a -> s{_bairResponses = a})
1628+ . _Default
1629+ . _Coerce
1630+
1631+instance FromJSON BatchAnnotateImagesResponse where
1632+ parseJSON
1633+ = withObject "BatchAnnotateImagesResponse"
1634+ (\ o ->
1635+ BatchAnnotateImagesResponse <$>
1636+ (o .:? "responses" .!= mempty))
1637+
1638+instance ToJSON BatchAnnotateImagesResponse where
1639+ toJSON BatchAnnotateImagesResponse{..}
1640+ = object
1641+ (catMaybes [("responses" .=) <$> _bairResponses])
1642+
1643+-- | A 3D position in the image, used primarily for Face detection landmarks.
1644+-- A valid Position must have both x and y coordinates. The position
1645+-- coordinates are in the same scale as the original image.
1646+--
1647+-- /See:/ 'position' smart constructor.
1648+data Position = Position
1649+ { _pZ :: !(Maybe (Textual Double))
1650+ , _pX :: !(Maybe (Textual Double))
1651+ , _pY :: !(Maybe (Textual Double))
1652+ } deriving (Eq,Show,Data,Typeable,Generic)
1653+
1654+-- | Creates a value of 'Position' with the minimum fields required to make a request.
1655+--
1656+-- Use one of the following lenses to modify other fields as desired:
1657+--
1658+-- * 'pZ'
1659+--
1660+-- * 'pX'
1661+--
1662+-- * 'pY'
1663+position
1664+ :: Position
1665+position =
1666+ Position
1667+ { _pZ = Nothing
1668+ , _pX = Nothing
1669+ , _pY = Nothing
1670+ }
1671+
1672+-- | Z coordinate (or depth).
1673+pZ :: Lens' Position (Maybe Double)
1674+pZ = lens _pZ (\ s a -> s{_pZ = a}) . mapping _Coerce
1675+
1676+-- | X coordinate.
1677+pX :: Lens' Position (Maybe Double)
1678+pX = lens _pX (\ s a -> s{_pX = a}) . mapping _Coerce
1679+
1680+-- | Y coordinate.
1681+pY :: Lens' Position (Maybe Double)
1682+pY = lens _pY (\ s a -> s{_pY = a}) . mapping _Coerce
1683+
1684+instance FromJSON Position where
1685+ parseJSON
1686+ = withObject "Position"
1687+ (\ o ->
1688+ Position <$>
1689+ (o .:? "z") <*> (o .:? "x") <*> (o .:? "y"))
1690+
1691+instance ToJSON Position where
1692+ toJSON Position{..}
1693+ = object
1694+ (catMaybes
1695+ [("z" .=) <$> _pZ, ("x" .=) <$> _pX,
1696+ ("y" .=) <$> _pY])
gogol-vision/gen/Network/Google/Vision/Types/Sum.hsnew file+843
@@ -0,0 +1,843 @@
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.Vision.Types.Sum
11+-- Copyright : (c) 2015 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.Vision.Types.Sum where
18+
19+import Network.Google.Prelude
20+
21+-- | Under-exposed likelihood.
22+data FaceAnnotationUnderExposedLikelihood
23+ = Unknown
24+ -- ^ @UNKNOWN@
25+ -- Unknown likelihood.
26+ | VeryUnlikely
27+ -- ^ @VERY_UNLIKELY@
28+ -- The image very unlikely belongs to the vertical specified.
29+ | Unlikely
30+ -- ^ @UNLIKELY@
31+ -- The image unlikely belongs to the vertical specified.
32+ | Possible
33+ -- ^ @POSSIBLE@
34+ -- The image possibly belongs to the vertical specified.
35+ | Likely
36+ -- ^ @LIKELY@
37+ -- The image likely belongs to the vertical specified.
38+ | VeryLikely
39+ -- ^ @VERY_LIKELY@
40+ -- The image very likely belongs to the vertical specified.
41+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
42+
43+instance Hashable FaceAnnotationUnderExposedLikelihood
44+
45+instance FromText FaceAnnotationUnderExposedLikelihood where
46+ fromText = \case
47+ "UNKNOWN" -> Just Unknown
48+ "VERY_UNLIKELY" -> Just VeryUnlikely
49+ "UNLIKELY" -> Just Unlikely
50+ "POSSIBLE" -> Just Possible
51+ "LIKELY" -> Just Likely
52+ "VERY_LIKELY" -> Just VeryLikely
53+ _ -> Nothing
54+
55+instance ToText FaceAnnotationUnderExposedLikelihood where
56+ toText = \case
57+ Unknown -> "UNKNOWN"
58+ VeryUnlikely -> "VERY_UNLIKELY"
59+ Unlikely -> "UNLIKELY"
60+ Possible -> "POSSIBLE"
61+ Likely -> "LIKELY"
62+ VeryLikely -> "VERY_LIKELY"
63+
64+instance FromJSON FaceAnnotationUnderExposedLikelihood where
65+ parseJSON = parseJSONText "FaceAnnotationUnderExposedLikelihood"
66+
67+instance ToJSON FaceAnnotationUnderExposedLikelihood where
68+ toJSON = toJSONText
69+
70+-- | Headwear likelihood.
71+data FaceAnnotationHeadwearLikelihood
72+ = FAHLUnknown
73+ -- ^ @UNKNOWN@
74+ -- Unknown likelihood.
75+ | FAHLVeryUnlikely
76+ -- ^ @VERY_UNLIKELY@
77+ -- The image very unlikely belongs to the vertical specified.
78+ | FAHLUnlikely
79+ -- ^ @UNLIKELY@
80+ -- The image unlikely belongs to the vertical specified.
81+ | FAHLPossible
82+ -- ^ @POSSIBLE@
83+ -- The image possibly belongs to the vertical specified.
84+ | FAHLLikely
85+ -- ^ @LIKELY@
86+ -- The image likely belongs to the vertical specified.
87+ | FAHLVeryLikely
88+ -- ^ @VERY_LIKELY@
89+ -- The image very likely belongs to the vertical specified.
90+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
91+
92+instance Hashable FaceAnnotationHeadwearLikelihood
93+
94+instance FromText FaceAnnotationHeadwearLikelihood where
95+ fromText = \case
96+ "UNKNOWN" -> Just FAHLUnknown
97+ "VERY_UNLIKELY" -> Just FAHLVeryUnlikely
98+ "UNLIKELY" -> Just FAHLUnlikely
99+ "POSSIBLE" -> Just FAHLPossible
100+ "LIKELY" -> Just FAHLLikely
101+ "VERY_LIKELY" -> Just FAHLVeryLikely
102+ _ -> Nothing
103+
104+instance ToText FaceAnnotationHeadwearLikelihood where
105+ toText = \case
106+ FAHLUnknown -> "UNKNOWN"
107+ FAHLVeryUnlikely -> "VERY_UNLIKELY"
108+ FAHLUnlikely -> "UNLIKELY"
109+ FAHLPossible -> "POSSIBLE"
110+ FAHLLikely -> "LIKELY"
111+ FAHLVeryLikely -> "VERY_LIKELY"
112+
113+instance FromJSON FaceAnnotationHeadwearLikelihood where
114+ parseJSON = parseJSONText "FaceAnnotationHeadwearLikelihood"
115+
116+instance ToJSON FaceAnnotationHeadwearLikelihood where
117+ toJSON = toJSONText
118+
119+-- | Represents the adult contents likelihood for the image.
120+data SafeSearchAnnotationAdult
121+ = SSAAUnknown
122+ -- ^ @UNKNOWN@
123+ -- Unknown likelihood.
124+ | SSAAVeryUnlikely
125+ -- ^ @VERY_UNLIKELY@
126+ -- The image very unlikely belongs to the vertical specified.
127+ | SSAAUnlikely
128+ -- ^ @UNLIKELY@
129+ -- The image unlikely belongs to the vertical specified.
130+ | SSAAPossible
131+ -- ^ @POSSIBLE@
132+ -- The image possibly belongs to the vertical specified.
133+ | SSAALikely
134+ -- ^ @LIKELY@
135+ -- The image likely belongs to the vertical specified.
136+ | SSAAVeryLikely
137+ -- ^ @VERY_LIKELY@
138+ -- The image very likely belongs to the vertical specified.
139+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
140+
141+instance Hashable SafeSearchAnnotationAdult
142+
143+instance FromText SafeSearchAnnotationAdult where
144+ fromText = \case
145+ "UNKNOWN" -> Just SSAAUnknown
146+ "VERY_UNLIKELY" -> Just SSAAVeryUnlikely
147+ "UNLIKELY" -> Just SSAAUnlikely
148+ "POSSIBLE" -> Just SSAAPossible
149+ "LIKELY" -> Just SSAALikely
150+ "VERY_LIKELY" -> Just SSAAVeryLikely
151+ _ -> Nothing
152+
153+instance ToText SafeSearchAnnotationAdult where
154+ toText = \case
155+ SSAAUnknown -> "UNKNOWN"
156+ SSAAVeryUnlikely -> "VERY_UNLIKELY"
157+ SSAAUnlikely -> "UNLIKELY"
158+ SSAAPossible -> "POSSIBLE"
159+ SSAALikely -> "LIKELY"
160+ SSAAVeryLikely -> "VERY_LIKELY"
161+
162+instance FromJSON SafeSearchAnnotationAdult where
163+ parseJSON = parseJSONText "SafeSearchAnnotationAdult"
164+
165+instance ToJSON SafeSearchAnnotationAdult where
166+ toJSON = toJSONText
167+
168+-- | Anger likelihood.
169+data FaceAnnotationAngerLikelihood
170+ = FAALUnknown
171+ -- ^ @UNKNOWN@
172+ -- Unknown likelihood.
173+ | FAALVeryUnlikely
174+ -- ^ @VERY_UNLIKELY@
175+ -- The image very unlikely belongs to the vertical specified.
176+ | FAALUnlikely
177+ -- ^ @UNLIKELY@
178+ -- The image unlikely belongs to the vertical specified.
179+ | FAALPossible
180+ -- ^ @POSSIBLE@
181+ -- The image possibly belongs to the vertical specified.
182+ | FAALLikely
183+ -- ^ @LIKELY@
184+ -- The image likely belongs to the vertical specified.
185+ | FAALVeryLikely
186+ -- ^ @VERY_LIKELY@
187+ -- The image very likely belongs to the vertical specified.
188+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
189+
190+instance Hashable FaceAnnotationAngerLikelihood
191+
192+instance FromText FaceAnnotationAngerLikelihood where
193+ fromText = \case
194+ "UNKNOWN" -> Just FAALUnknown
195+ "VERY_UNLIKELY" -> Just FAALVeryUnlikely
196+ "UNLIKELY" -> Just FAALUnlikely
197+ "POSSIBLE" -> Just FAALPossible
198+ "LIKELY" -> Just FAALLikely
199+ "VERY_LIKELY" -> Just FAALVeryLikely
200+ _ -> Nothing
201+
202+instance ToText FaceAnnotationAngerLikelihood where
203+ toText = \case
204+ FAALUnknown -> "UNKNOWN"
205+ FAALVeryUnlikely -> "VERY_UNLIKELY"
206+ FAALUnlikely -> "UNLIKELY"
207+ FAALPossible -> "POSSIBLE"
208+ FAALLikely -> "LIKELY"
209+ FAALVeryLikely -> "VERY_LIKELY"
210+
211+instance FromJSON FaceAnnotationAngerLikelihood where
212+ parseJSON = parseJSONText "FaceAnnotationAngerLikelihood"
213+
214+instance ToJSON FaceAnnotationAngerLikelihood where
215+ toJSON = toJSONText
216+
217+-- | Likelihood this is a medical image.
218+data SafeSearchAnnotationMedical
219+ = SSAMUnknown
220+ -- ^ @UNKNOWN@
221+ -- Unknown likelihood.
222+ | SSAMVeryUnlikely
223+ -- ^ @VERY_UNLIKELY@
224+ -- The image very unlikely belongs to the vertical specified.
225+ | SSAMUnlikely
226+ -- ^ @UNLIKELY@
227+ -- The image unlikely belongs to the vertical specified.
228+ | SSAMPossible
229+ -- ^ @POSSIBLE@
230+ -- The image possibly belongs to the vertical specified.
231+ | SSAMLikely
232+ -- ^ @LIKELY@
233+ -- The image likely belongs to the vertical specified.
234+ | SSAMVeryLikely
235+ -- ^ @VERY_LIKELY@
236+ -- The image very likely belongs to the vertical specified.
237+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
238+
239+instance Hashable SafeSearchAnnotationMedical
240+
241+instance FromText SafeSearchAnnotationMedical where
242+ fromText = \case
243+ "UNKNOWN" -> Just SSAMUnknown
244+ "VERY_UNLIKELY" -> Just SSAMVeryUnlikely
245+ "UNLIKELY" -> Just SSAMUnlikely
246+ "POSSIBLE" -> Just SSAMPossible
247+ "LIKELY" -> Just SSAMLikely
248+ "VERY_LIKELY" -> Just SSAMVeryLikely
249+ _ -> Nothing
250+
251+instance ToText SafeSearchAnnotationMedical where
252+ toText = \case
253+ SSAMUnknown -> "UNKNOWN"
254+ SSAMVeryUnlikely -> "VERY_UNLIKELY"
255+ SSAMUnlikely -> "UNLIKELY"
256+ SSAMPossible -> "POSSIBLE"
257+ SSAMLikely -> "LIKELY"
258+ SSAMVeryLikely -> "VERY_LIKELY"
259+
260+instance FromJSON SafeSearchAnnotationMedical where
261+ parseJSON = parseJSONText "SafeSearchAnnotationMedical"
262+
263+instance ToJSON SafeSearchAnnotationMedical where
264+ toJSON = toJSONText
265+
266+-- | Blurred likelihood.
267+data FaceAnnotationBlurredLikelihood
268+ = FABLUnknown
269+ -- ^ @UNKNOWN@
270+ -- Unknown likelihood.
271+ | FABLVeryUnlikely
272+ -- ^ @VERY_UNLIKELY@
273+ -- The image very unlikely belongs to the vertical specified.
274+ | FABLUnlikely
275+ -- ^ @UNLIKELY@
276+ -- The image unlikely belongs to the vertical specified.
277+ | FABLPossible
278+ -- ^ @POSSIBLE@
279+ -- The image possibly belongs to the vertical specified.
280+ | FABLLikely
281+ -- ^ @LIKELY@
282+ -- The image likely belongs to the vertical specified.
283+ | FABLVeryLikely
284+ -- ^ @VERY_LIKELY@
285+ -- The image very likely belongs to the vertical specified.
286+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
287+
288+instance Hashable FaceAnnotationBlurredLikelihood
289+
290+instance FromText FaceAnnotationBlurredLikelihood where
291+ fromText = \case
292+ "UNKNOWN" -> Just FABLUnknown
293+ "VERY_UNLIKELY" -> Just FABLVeryUnlikely
294+ "UNLIKELY" -> Just FABLUnlikely
295+ "POSSIBLE" -> Just FABLPossible
296+ "LIKELY" -> Just FABLLikely
297+ "VERY_LIKELY" -> Just FABLVeryLikely
298+ _ -> Nothing
299+
300+instance ToText FaceAnnotationBlurredLikelihood where
301+ toText = \case
302+ FABLUnknown -> "UNKNOWN"
303+ FABLVeryUnlikely -> "VERY_UNLIKELY"
304+ FABLUnlikely -> "UNLIKELY"
305+ FABLPossible -> "POSSIBLE"
306+ FABLLikely -> "LIKELY"
307+ FABLVeryLikely -> "VERY_LIKELY"
308+
309+instance FromJSON FaceAnnotationBlurredLikelihood where
310+ parseJSON = parseJSONText "FaceAnnotationBlurredLikelihood"
311+
312+instance ToJSON FaceAnnotationBlurredLikelihood where
313+ toJSON = toJSONText
314+
315+-- | Violence likelihood.
316+data SafeSearchAnnotationViolence
317+ = SSAVUnknown
318+ -- ^ @UNKNOWN@
319+ -- Unknown likelihood.
320+ | SSAVVeryUnlikely
321+ -- ^ @VERY_UNLIKELY@
322+ -- The image very unlikely belongs to the vertical specified.
323+ | SSAVUnlikely
324+ -- ^ @UNLIKELY@
325+ -- The image unlikely belongs to the vertical specified.
326+ | SSAVPossible
327+ -- ^ @POSSIBLE@
328+ -- The image possibly belongs to the vertical specified.
329+ | SSAVLikely
330+ -- ^ @LIKELY@
331+ -- The image likely belongs to the vertical specified.
332+ | SSAVVeryLikely
333+ -- ^ @VERY_LIKELY@
334+ -- The image very likely belongs to the vertical specified.
335+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
336+
337+instance Hashable SafeSearchAnnotationViolence
338+
339+instance FromText SafeSearchAnnotationViolence where
340+ fromText = \case
341+ "UNKNOWN" -> Just SSAVUnknown
342+ "VERY_UNLIKELY" -> Just SSAVVeryUnlikely
343+ "UNLIKELY" -> Just SSAVUnlikely
344+ "POSSIBLE" -> Just SSAVPossible
345+ "LIKELY" -> Just SSAVLikely
346+ "VERY_LIKELY" -> Just SSAVVeryLikely
347+ _ -> Nothing
348+
349+instance ToText SafeSearchAnnotationViolence where
350+ toText = \case
351+ SSAVUnknown -> "UNKNOWN"
352+ SSAVVeryUnlikely -> "VERY_UNLIKELY"
353+ SSAVUnlikely -> "UNLIKELY"
354+ SSAVPossible -> "POSSIBLE"
355+ SSAVLikely -> "LIKELY"
356+ SSAVVeryLikely -> "VERY_LIKELY"
357+
358+instance FromJSON SafeSearchAnnotationViolence where
359+ parseJSON = parseJSONText "SafeSearchAnnotationViolence"
360+
361+instance ToJSON SafeSearchAnnotationViolence where
362+ toJSON = toJSONText
363+
364+-- | The feature type.
365+data FeatureType
366+ = TypeUnspecified
367+ -- ^ @TYPE_UNSPECIFIED@
368+ -- Unspecified feature type.
369+ | FaceDetection
370+ -- ^ @FACE_DETECTION@
371+ -- Run face detection.
372+ | LandmarkDetection
373+ -- ^ @LANDMARK_DETECTION@
374+ -- Run landmark detection.
375+ | LogoDetection
376+ -- ^ @LOGO_DETECTION@
377+ -- Run logo detection.
378+ | LabelDetection
379+ -- ^ @LABEL_DETECTION@
380+ -- Run label detection.
381+ | TextDetection
382+ -- ^ @TEXT_DETECTION@
383+ -- Run OCR.
384+ | SafeSearchDetection
385+ -- ^ @SAFE_SEARCH_DETECTION@
386+ -- Run various computer vision models to compute image safe-search
387+ -- properties.
388+ | ImageProperties
389+ -- ^ @IMAGE_PROPERTIES@
390+ -- Compute a set of properties about the image (such as the image\'s
391+ -- dominant colors).
392+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
393+
394+instance Hashable FeatureType
395+
396+instance FromText FeatureType where
397+ fromText = \case
398+ "TYPE_UNSPECIFIED" -> Just TypeUnspecified
399+ "FACE_DETECTION" -> Just FaceDetection
400+ "LANDMARK_DETECTION" -> Just LandmarkDetection
401+ "LOGO_DETECTION" -> Just LogoDetection
402+ "LABEL_DETECTION" -> Just LabelDetection
403+ "TEXT_DETECTION" -> Just TextDetection
404+ "SAFE_SEARCH_DETECTION" -> Just SafeSearchDetection
405+ "IMAGE_PROPERTIES" -> Just ImageProperties
406+ _ -> Nothing
407+
408+instance ToText FeatureType where
409+ toText = \case
410+ TypeUnspecified -> "TYPE_UNSPECIFIED"
411+ FaceDetection -> "FACE_DETECTION"
412+ LandmarkDetection -> "LANDMARK_DETECTION"
413+ LogoDetection -> "LOGO_DETECTION"
414+ LabelDetection -> "LABEL_DETECTION"
415+ TextDetection -> "TEXT_DETECTION"
416+ SafeSearchDetection -> "SAFE_SEARCH_DETECTION"
417+ ImageProperties -> "IMAGE_PROPERTIES"
418+
419+instance FromJSON FeatureType where
420+ parseJSON = parseJSONText "FeatureType"
421+
422+instance ToJSON FeatureType where
423+ toJSON = toJSONText
424+
425+-- | Face landmark type.
426+data LandmarkType
427+ = UnknownLandmark
428+ -- ^ @UNKNOWN_LANDMARK@
429+ -- Unknown face landmark detected. Should not be filled.
430+ | LeftEye
431+ -- ^ @LEFT_EYE@
432+ -- Left eye.
433+ | RightEye
434+ -- ^ @RIGHT_EYE@
435+ -- Right eye.
436+ | LeftOfLeftEyebrow
437+ -- ^ @LEFT_OF_LEFT_EYEBROW@
438+ -- Left of left eyebrow.
439+ | RightOfLeftEyebrow
440+ -- ^ @RIGHT_OF_LEFT_EYEBROW@
441+ -- Right of left eyebrow.
442+ | LeftOfRightEyebrow
443+ -- ^ @LEFT_OF_RIGHT_EYEBROW@
444+ -- Left of right eyebrow.
445+ | RightOfRightEyebrow
446+ -- ^ @RIGHT_OF_RIGHT_EYEBROW@
447+ -- Right of right eyebrow.
448+ | MidpointBetweenEyes
449+ -- ^ @MIDPOINT_BETWEEN_EYES@
450+ -- Midpoint between eyes.
451+ | NoseTip
452+ -- ^ @NOSE_TIP@
453+ -- Nose tip.
454+ | UpperLip
455+ -- ^ @UPPER_LIP@
456+ -- Upper lip.
457+ | LowerLip
458+ -- ^ @LOWER_LIP@
459+ -- Lower lip.
460+ | MouthLeft
461+ -- ^ @MOUTH_LEFT@
462+ -- Mouth left.
463+ | MouthRight
464+ -- ^ @MOUTH_RIGHT@
465+ -- Mouth right.
466+ | MouthCenter
467+ -- ^ @MOUTH_CENTER@
468+ -- Mouth center.
469+ | NoseBottomRight
470+ -- ^ @NOSE_BOTTOM_RIGHT@
471+ -- Nose, bottom right.
472+ | NoseBottomLeft
473+ -- ^ @NOSE_BOTTOM_LEFT@
474+ -- Nose, bottom left.
475+ | NoseBottomCenter
476+ -- ^ @NOSE_BOTTOM_CENTER@
477+ -- Nose, bottom center.
478+ | LeftEyeTopBoundary
479+ -- ^ @LEFT_EYE_TOP_BOUNDARY@
480+ -- Left eye, top boundary.
481+ | LeftEyeRightCorner
482+ -- ^ @LEFT_EYE_RIGHT_CORNER@
483+ -- Left eye, right corner.
484+ | LeftEyeBottomBoundary
485+ -- ^ @LEFT_EYE_BOTTOM_BOUNDARY@
486+ -- Left eye, bottom boundary.
487+ | LeftEyeLeftCorner
488+ -- ^ @LEFT_EYE_LEFT_CORNER@
489+ -- Left eye, left corner.
490+ | RightEyeTopBoundary
491+ -- ^ @RIGHT_EYE_TOP_BOUNDARY@
492+ -- Right eye, top boundary.
493+ | RightEyeRightCorner
494+ -- ^ @RIGHT_EYE_RIGHT_CORNER@
495+ -- Right eye, right corner.
496+ | RightEyeBottomBoundary
497+ -- ^ @RIGHT_EYE_BOTTOM_BOUNDARY@
498+ -- Right eye, bottom boundary.
499+ | RightEyeLeftCorner
500+ -- ^ @RIGHT_EYE_LEFT_CORNER@
501+ -- Right eye, left corner.
502+ | LeftEyebrowUpperMidpoint
503+ -- ^ @LEFT_EYEBROW_UPPER_MIDPOINT@
504+ -- Left eyebrow, upper midpoint.
505+ | RightEyebrowUpperMidpoint
506+ -- ^ @RIGHT_EYEBROW_UPPER_MIDPOINT@
507+ -- Right eyebrow, upper midpoint.
508+ | LeftEarTragion
509+ -- ^ @LEFT_EAR_TRAGION@
510+ -- Left ear tragion.
511+ | RightEarTragion
512+ -- ^ @RIGHT_EAR_TRAGION@
513+ -- Right ear tragion.
514+ | LeftEyePupil
515+ -- ^ @LEFT_EYE_PUPIL@
516+ -- Left eye pupil.
517+ | RightEyePupil
518+ -- ^ @RIGHT_EYE_PUPIL@
519+ -- Right eye pupil.
520+ | ForeheadGlabella
521+ -- ^ @FOREHEAD_GLABELLA@
522+ -- Forehead glabella.
523+ | ChinGnathion
524+ -- ^ @CHIN_GNATHION@
525+ -- Chin gnathion.
526+ | ChinLeftGonion
527+ -- ^ @CHIN_LEFT_GONION@
528+ -- Chin left gonion.
529+ | ChinRightGonion
530+ -- ^ @CHIN_RIGHT_GONION@
531+ -- Chin right gonion.
532+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
533+
534+instance Hashable LandmarkType
535+
536+instance FromText LandmarkType where
537+ fromText = \case
538+ "UNKNOWN_LANDMARK" -> Just UnknownLandmark
539+ "LEFT_EYE" -> Just LeftEye
540+ "RIGHT_EYE" -> Just RightEye
541+ "LEFT_OF_LEFT_EYEBROW" -> Just LeftOfLeftEyebrow
542+ "RIGHT_OF_LEFT_EYEBROW" -> Just RightOfLeftEyebrow
543+ "LEFT_OF_RIGHT_EYEBROW" -> Just LeftOfRightEyebrow
544+ "RIGHT_OF_RIGHT_EYEBROW" -> Just RightOfRightEyebrow
545+ "MIDPOINT_BETWEEN_EYES" -> Just MidpointBetweenEyes
546+ "NOSE_TIP" -> Just NoseTip
547+ "UPPER_LIP" -> Just UpperLip
548+ "LOWER_LIP" -> Just LowerLip
549+ "MOUTH_LEFT" -> Just MouthLeft
550+ "MOUTH_RIGHT" -> Just MouthRight
551+ "MOUTH_CENTER" -> Just MouthCenter
552+ "NOSE_BOTTOM_RIGHT" -> Just NoseBottomRight
553+ "NOSE_BOTTOM_LEFT" -> Just NoseBottomLeft
554+ "NOSE_BOTTOM_CENTER" -> Just NoseBottomCenter
555+ "LEFT_EYE_TOP_BOUNDARY" -> Just LeftEyeTopBoundary
556+ "LEFT_EYE_RIGHT_CORNER" -> Just LeftEyeRightCorner
557+ "LEFT_EYE_BOTTOM_BOUNDARY" -> Just LeftEyeBottomBoundary
558+ "LEFT_EYE_LEFT_CORNER" -> Just LeftEyeLeftCorner
559+ "RIGHT_EYE_TOP_BOUNDARY" -> Just RightEyeTopBoundary
560+ "RIGHT_EYE_RIGHT_CORNER" -> Just RightEyeRightCorner
561+ "RIGHT_EYE_BOTTOM_BOUNDARY" -> Just RightEyeBottomBoundary
562+ "RIGHT_EYE_LEFT_CORNER" -> Just RightEyeLeftCorner
563+ "LEFT_EYEBROW_UPPER_MIDPOINT" -> Just LeftEyebrowUpperMidpoint
564+ "RIGHT_EYEBROW_UPPER_MIDPOINT" -> Just RightEyebrowUpperMidpoint
565+ "LEFT_EAR_TRAGION" -> Just LeftEarTragion
566+ "RIGHT_EAR_TRAGION" -> Just RightEarTragion
567+ "LEFT_EYE_PUPIL" -> Just LeftEyePupil
568+ "RIGHT_EYE_PUPIL" -> Just RightEyePupil
569+ "FOREHEAD_GLABELLA" -> Just ForeheadGlabella
570+ "CHIN_GNATHION" -> Just ChinGnathion
571+ "CHIN_LEFT_GONION" -> Just ChinLeftGonion
572+ "CHIN_RIGHT_GONION" -> Just ChinRightGonion
573+ _ -> Nothing
574+
575+instance ToText LandmarkType where
576+ toText = \case
577+ UnknownLandmark -> "UNKNOWN_LANDMARK"
578+ LeftEye -> "LEFT_EYE"
579+ RightEye -> "RIGHT_EYE"
580+ LeftOfLeftEyebrow -> "LEFT_OF_LEFT_EYEBROW"
581+ RightOfLeftEyebrow -> "RIGHT_OF_LEFT_EYEBROW"
582+ LeftOfRightEyebrow -> "LEFT_OF_RIGHT_EYEBROW"
583+ RightOfRightEyebrow -> "RIGHT_OF_RIGHT_EYEBROW"
584+ MidpointBetweenEyes -> "MIDPOINT_BETWEEN_EYES"
585+ NoseTip -> "NOSE_TIP"
586+ UpperLip -> "UPPER_LIP"
587+ LowerLip -> "LOWER_LIP"
588+ MouthLeft -> "MOUTH_LEFT"
589+ MouthRight -> "MOUTH_RIGHT"
590+ MouthCenter -> "MOUTH_CENTER"
591+ NoseBottomRight -> "NOSE_BOTTOM_RIGHT"
592+ NoseBottomLeft -> "NOSE_BOTTOM_LEFT"
593+ NoseBottomCenter -> "NOSE_BOTTOM_CENTER"
594+ LeftEyeTopBoundary -> "LEFT_EYE_TOP_BOUNDARY"
595+ LeftEyeRightCorner -> "LEFT_EYE_RIGHT_CORNER"
596+ LeftEyeBottomBoundary -> "LEFT_EYE_BOTTOM_BOUNDARY"
597+ LeftEyeLeftCorner -> "LEFT_EYE_LEFT_CORNER"
598+ RightEyeTopBoundary -> "RIGHT_EYE_TOP_BOUNDARY"
599+ RightEyeRightCorner -> "RIGHT_EYE_RIGHT_CORNER"
600+ RightEyeBottomBoundary -> "RIGHT_EYE_BOTTOM_BOUNDARY"
601+ RightEyeLeftCorner -> "RIGHT_EYE_LEFT_CORNER"
602+ LeftEyebrowUpperMidpoint -> "LEFT_EYEBROW_UPPER_MIDPOINT"
603+ RightEyebrowUpperMidpoint -> "RIGHT_EYEBROW_UPPER_MIDPOINT"
604+ LeftEarTragion -> "LEFT_EAR_TRAGION"
605+ RightEarTragion -> "RIGHT_EAR_TRAGION"
606+ LeftEyePupil -> "LEFT_EYE_PUPIL"
607+ RightEyePupil -> "RIGHT_EYE_PUPIL"
608+ ForeheadGlabella -> "FOREHEAD_GLABELLA"
609+ ChinGnathion -> "CHIN_GNATHION"
610+ ChinLeftGonion -> "CHIN_LEFT_GONION"
611+ ChinRightGonion -> "CHIN_RIGHT_GONION"
612+
613+instance FromJSON LandmarkType where
614+ parseJSON = parseJSONText "LandmarkType"
615+
616+instance ToJSON LandmarkType where
617+ toJSON = toJSONText
618+
619+-- | V1 error format.
620+data $Xgafv
621+ = $1
622+ -- ^ @1@
623+ -- v1 error format
624+ | $2
625+ -- ^ @2@
626+ -- v2 error format
627+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
628+
629+instance Hashable $Xgafv
630+
631+instance FromText $Xgafv where
632+ fromText = \case
633+ "1" -> Just $1
634+ "2" -> Just $2
635+ _ -> Nothing
636+
637+instance ToText $Xgafv where
638+ toText = \case
639+ $1 -> "1"
640+ $2 -> "2"
641+
642+instance FromJSON $Xgafv where
643+ parseJSON = parseJSONText "$Xgafv"
644+
645+instance ToJSON $Xgafv where
646+ toJSON = toJSONText
647+
648+-- | Spoof likelihood. The likelihood that an obvious modification was made
649+-- to the image\'s canonical version to make it appear funny or offensive.
650+data SafeSearchAnnotationSpoof
651+ = SSASUnknown
652+ -- ^ @UNKNOWN@
653+ -- Unknown likelihood.
654+ | SSASVeryUnlikely
655+ -- ^ @VERY_UNLIKELY@
656+ -- The image very unlikely belongs to the vertical specified.
657+ | SSASUnlikely
658+ -- ^ @UNLIKELY@
659+ -- The image unlikely belongs to the vertical specified.
660+ | SSASPossible
661+ -- ^ @POSSIBLE@
662+ -- The image possibly belongs to the vertical specified.
663+ | SSASLikely
664+ -- ^ @LIKELY@
665+ -- The image likely belongs to the vertical specified.
666+ | SSASVeryLikely
667+ -- ^ @VERY_LIKELY@
668+ -- The image very likely belongs to the vertical specified.
669+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
670+
671+instance Hashable SafeSearchAnnotationSpoof
672+
673+instance FromText SafeSearchAnnotationSpoof where
674+ fromText = \case
675+ "UNKNOWN" -> Just SSASUnknown
676+ "VERY_UNLIKELY" -> Just SSASVeryUnlikely
677+ "UNLIKELY" -> Just SSASUnlikely
678+ "POSSIBLE" -> Just SSASPossible
679+ "LIKELY" -> Just SSASLikely
680+ "VERY_LIKELY" -> Just SSASVeryLikely
681+ _ -> Nothing
682+
683+instance ToText SafeSearchAnnotationSpoof where
684+ toText = \case
685+ SSASUnknown -> "UNKNOWN"
686+ SSASVeryUnlikely -> "VERY_UNLIKELY"
687+ SSASUnlikely -> "UNLIKELY"
688+ SSASPossible -> "POSSIBLE"
689+ SSASLikely -> "LIKELY"
690+ SSASVeryLikely -> "VERY_LIKELY"
691+
692+instance FromJSON SafeSearchAnnotationSpoof where
693+ parseJSON = parseJSONText "SafeSearchAnnotationSpoof"
694+
695+instance ToJSON SafeSearchAnnotationSpoof where
696+ toJSON = toJSONText
697+
698+-- | Surprise likelihood.
699+data FaceAnnotationSurpriseLikelihood
700+ = FASLUnknown
701+ -- ^ @UNKNOWN@
702+ -- Unknown likelihood.
703+ | FASLVeryUnlikely
704+ -- ^ @VERY_UNLIKELY@
705+ -- The image very unlikely belongs to the vertical specified.
706+ | FASLUnlikely
707+ -- ^ @UNLIKELY@
708+ -- The image unlikely belongs to the vertical specified.
709+ | FASLPossible
710+ -- ^ @POSSIBLE@
711+ -- The image possibly belongs to the vertical specified.
712+ | FASLLikely
713+ -- ^ @LIKELY@
714+ -- The image likely belongs to the vertical specified.
715+ | FASLVeryLikely
716+ -- ^ @VERY_LIKELY@
717+ -- The image very likely belongs to the vertical specified.
718+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
719+
720+instance Hashable FaceAnnotationSurpriseLikelihood
721+
722+instance FromText FaceAnnotationSurpriseLikelihood where
723+ fromText = \case
724+ "UNKNOWN" -> Just FASLUnknown
725+ "VERY_UNLIKELY" -> Just FASLVeryUnlikely
726+ "UNLIKELY" -> Just FASLUnlikely
727+ "POSSIBLE" -> Just FASLPossible
728+ "LIKELY" -> Just FASLLikely
729+ "VERY_LIKELY" -> Just FASLVeryLikely
730+ _ -> Nothing
731+
732+instance ToText FaceAnnotationSurpriseLikelihood where
733+ toText = \case
734+ FASLUnknown -> "UNKNOWN"
735+ FASLVeryUnlikely -> "VERY_UNLIKELY"
736+ FASLUnlikely -> "UNLIKELY"
737+ FASLPossible -> "POSSIBLE"
738+ FASLLikely -> "LIKELY"
739+ FASLVeryLikely -> "VERY_LIKELY"
740+
741+instance FromJSON FaceAnnotationSurpriseLikelihood where
742+ parseJSON = parseJSONText "FaceAnnotationSurpriseLikelihood"
743+
744+instance ToJSON FaceAnnotationSurpriseLikelihood where
745+ toJSON = toJSONText
746+
747+-- | Sorrow likelihood.
748+data FaceAnnotationSorrowLikelihood
749+ = FUnknown
750+ -- ^ @UNKNOWN@
751+ -- Unknown likelihood.
752+ | FVeryUnlikely
753+ -- ^ @VERY_UNLIKELY@
754+ -- The image very unlikely belongs to the vertical specified.
755+ | FUnlikely
756+ -- ^ @UNLIKELY@
757+ -- The image unlikely belongs to the vertical specified.
758+ | FPossible
759+ -- ^ @POSSIBLE@
760+ -- The image possibly belongs to the vertical specified.
761+ | FLikely
762+ -- ^ @LIKELY@
763+ -- The image likely belongs to the vertical specified.
764+ | FVeryLikely
765+ -- ^ @VERY_LIKELY@
766+ -- The image very likely belongs to the vertical specified.
767+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
768+
769+instance Hashable FaceAnnotationSorrowLikelihood
770+
771+instance FromText FaceAnnotationSorrowLikelihood where
772+ fromText = \case
773+ "UNKNOWN" -> Just FUnknown
774+ "VERY_UNLIKELY" -> Just FVeryUnlikely
775+ "UNLIKELY" -> Just FUnlikely
776+ "POSSIBLE" -> Just FPossible
777+ "LIKELY" -> Just FLikely
778+ "VERY_LIKELY" -> Just FVeryLikely
779+ _ -> Nothing
780+
781+instance ToText FaceAnnotationSorrowLikelihood where
782+ toText = \case
783+ FUnknown -> "UNKNOWN"
784+ FVeryUnlikely -> "VERY_UNLIKELY"
785+ FUnlikely -> "UNLIKELY"
786+ FPossible -> "POSSIBLE"
787+ FLikely -> "LIKELY"
788+ FVeryLikely -> "VERY_LIKELY"
789+
790+instance FromJSON FaceAnnotationSorrowLikelihood where
791+ parseJSON = parseJSONText "FaceAnnotationSorrowLikelihood"
792+
793+instance ToJSON FaceAnnotationSorrowLikelihood where
794+ toJSON = toJSONText
795+
796+-- | Joy likelihood.
797+data FaceAnnotationJoyLikelihood
798+ = FAJLUnknown
799+ -- ^ @UNKNOWN@
800+ -- Unknown likelihood.
801+ | FAJLVeryUnlikely
802+ -- ^ @VERY_UNLIKELY@
803+ -- The image very unlikely belongs to the vertical specified.
804+ | FAJLUnlikely
805+ -- ^ @UNLIKELY@
806+ -- The image unlikely belongs to the vertical specified.
807+ | FAJLPossible
808+ -- ^ @POSSIBLE@
809+ -- The image possibly belongs to the vertical specified.
810+ | FAJLLikely
811+ -- ^ @LIKELY@
812+ -- The image likely belongs to the vertical specified.
813+ | FAJLVeryLikely
814+ -- ^ @VERY_LIKELY@
815+ -- The image very likely belongs to the vertical specified.
816+ deriving (Eq,Ord,Enum,Read,Show,Data,Typeable,Generic)
817+
818+instance Hashable FaceAnnotationJoyLikelihood
819+
820+instance FromText FaceAnnotationJoyLikelihood where
821+ fromText = \case
822+ "UNKNOWN" -> Just FAJLUnknown
823+ "VERY_UNLIKELY" -> Just FAJLVeryUnlikely
824+ "UNLIKELY" -> Just FAJLUnlikely
825+ "POSSIBLE" -> Just FAJLPossible
826+ "LIKELY" -> Just FAJLLikely
827+ "VERY_LIKELY" -> Just FAJLVeryLikely
828+ _ -> Nothing
829+
830+instance ToText FaceAnnotationJoyLikelihood where
831+ toText = \case
832+ FAJLUnknown -> "UNKNOWN"
833+ FAJLVeryUnlikely -> "VERY_UNLIKELY"
834+ FAJLUnlikely -> "UNLIKELY"
835+ FAJLPossible -> "POSSIBLE"
836+ FAJLLikely -> "LIKELY"
837+ FAJLVeryLikely -> "VERY_LIKELY"
838+
839+instance FromJSON FaceAnnotationJoyLikelihood where
840+ parseJSON = parseJSONText "FaceAnnotationJoyLikelihood"
841+
842+instance ToJSON FaceAnnotationJoyLikelihood where
843+ toJSON = toJSONText
gogol-vision/gogol-vision.cabalnew file+49
@@ -0,0 +1,49 @@
1+name: gogol-vision
2+version: 0.0.1
3+synopsis: Google Cloud Vision 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 Brendan Hay
11+category: Network, Google, Cloud
12+build-type: Simple
13+cabal-version: >= 1.10
14+extra-source-files: README.md
15+
16+description:
17+ The Google Cloud Vision API allows developers to easily integrate Google
18+ vision features, including image labeling, face, logo, and landmark
19+ detection, optical character recognition (OCR), and detection of
20+ explicit content, into applications.
21+ .
22+ /Warning:/ This is an experimental prototype/preview release which is still
23+ under exploratory development and not intended for public use, caveat emptor!
24+ .
25+ This library is compatible with version @v1@
26+ of the API.
27+
28+source-repository head
29+ type: git
30+ location: git://github.com/brendanhay/gogol.git
31+
32+library
33+ default-language: Haskell2010
34+ hs-source-dirs: src gen
35+
36+ ghc-options: -Wall
37+
38+ exposed-modules:
39+ Network.Google.Resource.Vision.Images.Annotate
40+ , Network.Google.Vision
41+ , Network.Google.Vision.Types
42+
43+ other-modules:
44+ Network.Google.Vision.Types.Product
45+ , Network.Google.Vision.Types.Sum
46+
47+ build-depends:
48+ gogol-core == 0.0.1.*
49+ , base >= 4.7 && < 5
gogol-vision/src/.gitkeepnew file

No changes to the content.