{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Vision.Types.Product where
import Network.Google.Prelude
import Network.Google.Vision.Types.Sum
data LatLng = LatLng'
{ _llLatitude :: !(Maybe (Textual Double))
, _llLongitude :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
latLng
:: LatLng
latLng =
LatLng'
{ _llLatitude = Nothing
, _llLongitude = Nothing
}
llLatitude :: Lens' LatLng (Maybe Double)
llLatitude
= lens _llLatitude (\ s a -> s{_llLatitude = a}) .
mapping _Coerce
llLongitude :: Lens' LatLng (Maybe Double)
llLongitude
= lens _llLongitude (\ s a -> s{_llLongitude = a}) .
mapping _Coerce
instance FromJSON LatLng where
parseJSON
= withObject "LatLng"
(\ o ->
LatLng' <$>
(o .:? "latitude") <*> (o .:? "longitude"))
instance ToJSON LatLng where
toJSON LatLng'{..}
= object
(catMaybes
[("latitude" .=) <$> _llLatitude,
("longitude" .=) <$> _llLongitude])
data Feature = Feature'
{ _fType :: !(Maybe FeatureType)
, _fMaxResults :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
feature
:: Feature
feature =
Feature'
{ _fType = Nothing
, _fMaxResults = Nothing
}
fType :: Lens' Feature (Maybe FeatureType)
fType = lens _fType (\ s a -> s{_fType = a})
fMaxResults :: Lens' Feature (Maybe Int32)
fMaxResults
= lens _fMaxResults (\ s a -> s{_fMaxResults = a}) .
mapping _Coerce
instance FromJSON Feature where
parseJSON
= withObject "Feature"
(\ o ->
Feature' <$> (o .:? "type") <*> (o .:? "maxResults"))
instance ToJSON Feature where
toJSON Feature'{..}
= object
(catMaybes
[("type" .=) <$> _fType,
("maxResults" .=) <$> _fMaxResults])
data Status = Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
status
:: Status
status =
Status'
{ _sDetails = Nothing
, _sCode = Nothing
, _sMessage = Nothing
}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
data Property = Property'
{ _pValue :: !(Maybe Text)
, _pName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
property
:: Property
property =
Property'
{ _pValue = Nothing
, _pName = Nothing
}
pValue :: Lens' Property (Maybe Text)
pValue = lens _pValue (\ s a -> s{_pValue = a})
pName :: Lens' Property (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a})
instance FromJSON Property where
parseJSON
= withObject "Property"
(\ o ->
Property' <$> (o .:? "value") <*> (o .:? "name"))
instance ToJSON Property where
toJSON Property'{..}
= object
(catMaybes
[("value" .=) <$> _pValue, ("name" .=) <$> _pName])
data Image = Image'
{ _iContent :: !(Maybe Base64)
, _iSource :: !(Maybe ImageSource)
} deriving (Eq,Show,Data,Typeable,Generic)
image
:: Image
image =
Image'
{ _iContent = Nothing
, _iSource = Nothing
}
iContent :: Lens' Image (Maybe ByteString)
iContent
= lens _iContent (\ s a -> s{_iContent = a}) .
mapping _Base64
iSource :: Lens' Image (Maybe ImageSource)
iSource = lens _iSource (\ s a -> s{_iSource = a})
instance FromJSON Image where
parseJSON
= withObject "Image"
(\ o ->
Image' <$> (o .:? "content") <*> (o .:? "source"))
instance ToJSON Image where
toJSON Image'{..}
= object
(catMaybes
[("content" .=) <$> _iContent,
("source" .=) <$> _iSource])
data Landmark = Landmark'
{ _lType :: !(Maybe LandmarkType)
, _lPosition :: !(Maybe Position)
} deriving (Eq,Show,Data,Typeable,Generic)
landmark
:: Landmark
landmark =
Landmark'
{ _lType = Nothing
, _lPosition = Nothing
}
lType :: Lens' Landmark (Maybe LandmarkType)
lType = lens _lType (\ s a -> s{_lType = a})
lPosition :: Lens' Landmark (Maybe Position)
lPosition
= lens _lPosition (\ s a -> s{_lPosition = a})
instance FromJSON Landmark where
parseJSON
= withObject "Landmark"
(\ o ->
Landmark' <$> (o .:? "type") <*> (o .:? "position"))
instance ToJSON Landmark where
toJSON Landmark'{..}
= object
(catMaybes
[("type" .=) <$> _lType,
("position" .=) <$> _lPosition])
data Color = Color'
{ _cRed :: !(Maybe (Textual Double))
, _cAlpha :: !(Maybe (Textual Double))
, _cGreen :: !(Maybe (Textual Double))
, _cBlue :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
color
:: Color
color =
Color'
{ _cRed = Nothing
, _cAlpha = Nothing
, _cGreen = Nothing
, _cBlue = Nothing
}
cRed :: Lens' Color (Maybe Double)
cRed
= lens _cRed (\ s a -> s{_cRed = a}) .
mapping _Coerce
cAlpha :: Lens' Color (Maybe Double)
cAlpha
= lens _cAlpha (\ s a -> s{_cAlpha = a}) .
mapping _Coerce
cGreen :: Lens' Color (Maybe Double)
cGreen
= lens _cGreen (\ s a -> s{_cGreen = a}) .
mapping _Coerce
cBlue :: Lens' Color (Maybe Double)
cBlue
= lens _cBlue (\ s a -> s{_cBlue = a}) .
mapping _Coerce
instance FromJSON Color where
parseJSON
= withObject "Color"
(\ o ->
Color' <$>
(o .:? "red") <*> (o .:? "alpha") <*> (o .:? "green")
<*> (o .:? "blue"))
instance ToJSON Color where
toJSON Color'{..}
= object
(catMaybes
[("red" .=) <$> _cRed, ("alpha" .=) <$> _cAlpha,
("green" .=) <$> _cGreen, ("blue" .=) <$> _cBlue])
newtype BoundingPoly = BoundingPoly'
{ _bpVertices :: Maybe [Vertex]
} deriving (Eq,Show,Data,Typeable,Generic)
boundingPoly
:: BoundingPoly
boundingPoly =
BoundingPoly'
{ _bpVertices = Nothing
}
bpVertices :: Lens' BoundingPoly [Vertex]
bpVertices
= lens _bpVertices (\ s a -> s{_bpVertices = a}) .
_Default
. _Coerce
instance FromJSON BoundingPoly where
parseJSON
= withObject "BoundingPoly"
(\ o ->
BoundingPoly' <$> (o .:? "vertices" .!= mempty))
instance ToJSON BoundingPoly where
toJSON BoundingPoly'{..}
= object
(catMaybes [("vertices" .=) <$> _bpVertices])
data Vertex = Vertex'
{ _vX :: !(Maybe (Textual Int32))
, _vY :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
vertex
:: Vertex
vertex =
Vertex'
{ _vX = Nothing
, _vY = Nothing
}
vX :: Lens' Vertex (Maybe Int32)
vX = lens _vX (\ s a -> s{_vX = a}) . mapping _Coerce
vY :: Lens' Vertex (Maybe Int32)
vY = lens _vY (\ s a -> s{_vY = a}) . mapping _Coerce
instance FromJSON Vertex where
parseJSON
= withObject "Vertex"
(\ o -> Vertex' <$> (o .:? "x") <*> (o .:? "y"))
instance ToJSON Vertex where
toJSON Vertex'{..}
= object
(catMaybes [("x" .=) <$> _vX, ("y" .=) <$> _vY])
newtype LocationInfo = LocationInfo'
{ _liLatLng :: Maybe LatLng
} deriving (Eq,Show,Data,Typeable,Generic)
locationInfo
:: LocationInfo
locationInfo =
LocationInfo'
{ _liLatLng = Nothing
}
liLatLng :: Lens' LocationInfo (Maybe LatLng)
liLatLng = lens _liLatLng (\ s a -> s{_liLatLng = a})
instance FromJSON LocationInfo where
parseJSON
= withObject "LocationInfo"
(\ o -> LocationInfo' <$> (o .:? "latLng"))
instance ToJSON LocationInfo where
toJSON LocationInfo'{..}
= object (catMaybes [("latLng" .=) <$> _liLatLng])
newtype StatusDetailsItem = StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem'
{ _sdiAddtional = _Coerce # pSdiAddtional_
}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
newtype BatchAnnotateImagesRequest = BatchAnnotateImagesRequest'
{ _bairRequests :: Maybe [AnnotateImageRequest]
} deriving (Eq,Show,Data,Typeable,Generic)
batchAnnotateImagesRequest
:: BatchAnnotateImagesRequest
batchAnnotateImagesRequest =
BatchAnnotateImagesRequest'
{ _bairRequests = Nothing
}
bairRequests :: Lens' BatchAnnotateImagesRequest [AnnotateImageRequest]
bairRequests
= lens _bairRequests (\ s a -> s{_bairRequests = a})
. _Default
. _Coerce
instance FromJSON BatchAnnotateImagesRequest where
parseJSON
= withObject "BatchAnnotateImagesRequest"
(\ o ->
BatchAnnotateImagesRequest' <$>
(o .:? "requests" .!= mempty))
instance ToJSON BatchAnnotateImagesRequest where
toJSON BatchAnnotateImagesRequest'{..}
= object
(catMaybes [("requests" .=) <$> _bairRequests])
data ColorInfo = ColorInfo'
{ _ciColor :: !(Maybe Color)
, _ciScore :: !(Maybe (Textual Double))
, _ciPixelFraction :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
colorInfo
:: ColorInfo
colorInfo =
ColorInfo'
{ _ciColor = Nothing
, _ciScore = Nothing
, _ciPixelFraction = Nothing
}
ciColor :: Lens' ColorInfo (Maybe Color)
ciColor = lens _ciColor (\ s a -> s{_ciColor = a})
ciScore :: Lens' ColorInfo (Maybe Double)
ciScore
= lens _ciScore (\ s a -> s{_ciScore = a}) .
mapping _Coerce
ciPixelFraction :: Lens' ColorInfo (Maybe Double)
ciPixelFraction
= lens _ciPixelFraction
(\ s a -> s{_ciPixelFraction = a})
. mapping _Coerce
instance FromJSON ColorInfo where
parseJSON
= withObject "ColorInfo"
(\ o ->
ColorInfo' <$>
(o .:? "color") <*> (o .:? "score") <*>
(o .:? "pixelFraction"))
instance ToJSON ColorInfo where
toJSON ColorInfo'{..}
= object
(catMaybes
[("color" .=) <$> _ciColor,
("score" .=) <$> _ciScore,
("pixelFraction" .=) <$> _ciPixelFraction])
data AnnotateImageResponse = AnnotateImageResponse'
{ _airLogoAnnotations :: !(Maybe [EntityAnnotation])
, _airLabelAnnotations :: !(Maybe [EntityAnnotation])
, _airFaceAnnotations :: !(Maybe [FaceAnnotation])
, _airError :: !(Maybe Status)
, _airSafeSearchAnnotation :: !(Maybe SafeSearchAnnotation)
, _airLandmarkAnnotations :: !(Maybe [EntityAnnotation])
, _airTextAnnotations :: !(Maybe [EntityAnnotation])
, _airImagePropertiesAnnotation :: !(Maybe ImageProperties)
} deriving (Eq,Show,Data,Typeable,Generic)
annotateImageResponse
:: AnnotateImageResponse
annotateImageResponse =
AnnotateImageResponse'
{ _airLogoAnnotations = Nothing
, _airLabelAnnotations = Nothing
, _airFaceAnnotations = Nothing
, _airError = Nothing
, _airSafeSearchAnnotation = Nothing
, _airLandmarkAnnotations = Nothing
, _airTextAnnotations = Nothing
, _airImagePropertiesAnnotation = Nothing
}
airLogoAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
airLogoAnnotations
= lens _airLogoAnnotations
(\ s a -> s{_airLogoAnnotations = a})
. _Default
. _Coerce
airLabelAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
airLabelAnnotations
= lens _airLabelAnnotations
(\ s a -> s{_airLabelAnnotations = a})
. _Default
. _Coerce
airFaceAnnotations :: Lens' AnnotateImageResponse [FaceAnnotation]
airFaceAnnotations
= lens _airFaceAnnotations
(\ s a -> s{_airFaceAnnotations = a})
. _Default
. _Coerce
airError :: Lens' AnnotateImageResponse (Maybe Status)
airError = lens _airError (\ s a -> s{_airError = a})
airSafeSearchAnnotation :: Lens' AnnotateImageResponse (Maybe SafeSearchAnnotation)
airSafeSearchAnnotation
= lens _airSafeSearchAnnotation
(\ s a -> s{_airSafeSearchAnnotation = a})
airLandmarkAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
airLandmarkAnnotations
= lens _airLandmarkAnnotations
(\ s a -> s{_airLandmarkAnnotations = a})
. _Default
. _Coerce
airTextAnnotations :: Lens' AnnotateImageResponse [EntityAnnotation]
airTextAnnotations
= lens _airTextAnnotations
(\ s a -> s{_airTextAnnotations = a})
. _Default
. _Coerce
airImagePropertiesAnnotation :: Lens' AnnotateImageResponse (Maybe ImageProperties)
airImagePropertiesAnnotation
= lens _airImagePropertiesAnnotation
(\ s a -> s{_airImagePropertiesAnnotation = a})
instance FromJSON AnnotateImageResponse where
parseJSON
= withObject "AnnotateImageResponse"
(\ o ->
AnnotateImageResponse' <$>
(o .:? "logoAnnotations" .!= mempty) <*>
(o .:? "labelAnnotations" .!= mempty)
<*> (o .:? "faceAnnotations" .!= mempty)
<*> (o .:? "error")
<*> (o .:? "safeSearchAnnotation")
<*> (o .:? "landmarkAnnotations" .!= mempty)
<*> (o .:? "textAnnotations" .!= mempty)
<*> (o .:? "imagePropertiesAnnotation"))
instance ToJSON AnnotateImageResponse where
toJSON AnnotateImageResponse'{..}
= object
(catMaybes
[("logoAnnotations" .=) <$> _airLogoAnnotations,
("labelAnnotations" .=) <$> _airLabelAnnotations,
("faceAnnotations" .=) <$> _airFaceAnnotations,
("error" .=) <$> _airError,
("safeSearchAnnotation" .=) <$>
_airSafeSearchAnnotation,
("landmarkAnnotations" .=) <$>
_airLandmarkAnnotations,
("textAnnotations" .=) <$> _airTextAnnotations,
("imagePropertiesAnnotation" .=) <$>
_airImagePropertiesAnnotation])
newtype ImageProperties = ImageProperties'
{ _ipDominantColors :: Maybe DominantColorsAnnotation
} deriving (Eq,Show,Data,Typeable,Generic)
imageProperties
:: ImageProperties
imageProperties =
ImageProperties'
{ _ipDominantColors = Nothing
}
ipDominantColors :: Lens' ImageProperties (Maybe DominantColorsAnnotation)
ipDominantColors
= lens _ipDominantColors
(\ s a -> s{_ipDominantColors = a})
instance FromJSON ImageProperties where
parseJSON
= withObject "ImageProperties"
(\ o ->
ImageProperties' <$> (o .:? "dominantColors"))
instance ToJSON ImageProperties where
toJSON ImageProperties'{..}
= object
(catMaybes
[("dominantColors" .=) <$> _ipDominantColors])
data FaceAnnotation = FaceAnnotation'
{ _faTiltAngle :: !(Maybe (Textual Double))
, _faBlurredLikelihood :: !(Maybe FaceAnnotationBlurredLikelihood)
, _faBoundingPoly :: !(Maybe BoundingPoly)
, _faSurpriseLikelihood :: !(Maybe FaceAnnotationSurpriseLikelihood)
, _faLandmarkingConfidence :: !(Maybe (Textual Double))
, _faPanAngle :: !(Maybe (Textual Double))
, _faRollAngle :: !(Maybe (Textual Double))
, _faUnderExposedLikelihood :: !(Maybe FaceAnnotationUnderExposedLikelihood)
, _faFdBoundingPoly :: !(Maybe BoundingPoly)
, _faAngerLikelihood :: !(Maybe FaceAnnotationAngerLikelihood)
, _faDetectionConfidence :: !(Maybe (Textual Double))
, _faHeadwearLikelihood :: !(Maybe FaceAnnotationHeadwearLikelihood)
, _faSorrowLikelihood :: !(Maybe FaceAnnotationSorrowLikelihood)
, _faJoyLikelihood :: !(Maybe FaceAnnotationJoyLikelihood)
, _faLandmarks :: !(Maybe [Landmark])
} deriving (Eq,Show,Data,Typeable,Generic)
faceAnnotation
:: FaceAnnotation
faceAnnotation =
FaceAnnotation'
{ _faTiltAngle = Nothing
, _faBlurredLikelihood = Nothing
, _faBoundingPoly = Nothing
, _faSurpriseLikelihood = Nothing
, _faLandmarkingConfidence = Nothing
, _faPanAngle = Nothing
, _faRollAngle = Nothing
, _faUnderExposedLikelihood = Nothing
, _faFdBoundingPoly = Nothing
, _faAngerLikelihood = Nothing
, _faDetectionConfidence = Nothing
, _faHeadwearLikelihood = Nothing
, _faSorrowLikelihood = Nothing
, _faJoyLikelihood = Nothing
, _faLandmarks = Nothing
}
faTiltAngle :: Lens' FaceAnnotation (Maybe Double)
faTiltAngle
= lens _faTiltAngle (\ s a -> s{_faTiltAngle = a}) .
mapping _Coerce
faBlurredLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationBlurredLikelihood)
faBlurredLikelihood
= lens _faBlurredLikelihood
(\ s a -> s{_faBlurredLikelihood = a})
faBoundingPoly :: Lens' FaceAnnotation (Maybe BoundingPoly)
faBoundingPoly
= lens _faBoundingPoly
(\ s a -> s{_faBoundingPoly = a})
faSurpriseLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationSurpriseLikelihood)
faSurpriseLikelihood
= lens _faSurpriseLikelihood
(\ s a -> s{_faSurpriseLikelihood = a})
faLandmarkingConfidence :: Lens' FaceAnnotation (Maybe Double)
faLandmarkingConfidence
= lens _faLandmarkingConfidence
(\ s a -> s{_faLandmarkingConfidence = a})
. mapping _Coerce
faPanAngle :: Lens' FaceAnnotation (Maybe Double)
faPanAngle
= lens _faPanAngle (\ s a -> s{_faPanAngle = a}) .
mapping _Coerce
faRollAngle :: Lens' FaceAnnotation (Maybe Double)
faRollAngle
= lens _faRollAngle (\ s a -> s{_faRollAngle = a}) .
mapping _Coerce
faUnderExposedLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationUnderExposedLikelihood)
faUnderExposedLikelihood
= lens _faUnderExposedLikelihood
(\ s a -> s{_faUnderExposedLikelihood = a})
faFdBoundingPoly :: Lens' FaceAnnotation (Maybe BoundingPoly)
faFdBoundingPoly
= lens _faFdBoundingPoly
(\ s a -> s{_faFdBoundingPoly = a})
faAngerLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationAngerLikelihood)
faAngerLikelihood
= lens _faAngerLikelihood
(\ s a -> s{_faAngerLikelihood = a})
faDetectionConfidence :: Lens' FaceAnnotation (Maybe Double)
faDetectionConfidence
= lens _faDetectionConfidence
(\ s a -> s{_faDetectionConfidence = a})
. mapping _Coerce
faHeadwearLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationHeadwearLikelihood)
faHeadwearLikelihood
= lens _faHeadwearLikelihood
(\ s a -> s{_faHeadwearLikelihood = a})
faSorrowLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationSorrowLikelihood)
faSorrowLikelihood
= lens _faSorrowLikelihood
(\ s a -> s{_faSorrowLikelihood = a})
faJoyLikelihood :: Lens' FaceAnnotation (Maybe FaceAnnotationJoyLikelihood)
faJoyLikelihood
= lens _faJoyLikelihood
(\ s a -> s{_faJoyLikelihood = a})
faLandmarks :: Lens' FaceAnnotation [Landmark]
faLandmarks
= lens _faLandmarks (\ s a -> s{_faLandmarks = a}) .
_Default
. _Coerce
instance FromJSON FaceAnnotation where
parseJSON
= withObject "FaceAnnotation"
(\ o ->
FaceAnnotation' <$>
(o .:? "tiltAngle") <*> (o .:? "blurredLikelihood")
<*> (o .:? "boundingPoly")
<*> (o .:? "surpriseLikelihood")
<*> (o .:? "landmarkingConfidence")
<*> (o .:? "panAngle")
<*> (o .:? "rollAngle")
<*> (o .:? "underExposedLikelihood")
<*> (o .:? "fdBoundingPoly")
<*> (o .:? "angerLikelihood")
<*> (o .:? "detectionConfidence")
<*> (o .:? "headwearLikelihood")
<*> (o .:? "sorrowLikelihood")
<*> (o .:? "joyLikelihood")
<*> (o .:? "landmarks" .!= mempty))
instance ToJSON FaceAnnotation where
toJSON FaceAnnotation'{..}
= object
(catMaybes
[("tiltAngle" .=) <$> _faTiltAngle,
("blurredLikelihood" .=) <$> _faBlurredLikelihood,
("boundingPoly" .=) <$> _faBoundingPoly,
("surpriseLikelihood" .=) <$> _faSurpriseLikelihood,
("landmarkingConfidence" .=) <$>
_faLandmarkingConfidence,
("panAngle" .=) <$> _faPanAngle,
("rollAngle" .=) <$> _faRollAngle,
("underExposedLikelihood" .=) <$>
_faUnderExposedLikelihood,
("fdBoundingPoly" .=) <$> _faFdBoundingPoly,
("angerLikelihood" .=) <$> _faAngerLikelihood,
("detectionConfidence" .=) <$>
_faDetectionConfidence,
("headwearLikelihood" .=) <$> _faHeadwearLikelihood,
("sorrowLikelihood" .=) <$> _faSorrowLikelihood,
("joyLikelihood" .=) <$> _faJoyLikelihood,
("landmarks" .=) <$> _faLandmarks])
data EntityAnnotation = EntityAnnotation'
{ _eaScore :: !(Maybe (Textual Double))
, _eaTopicality :: !(Maybe (Textual Double))
, _eaLocale :: !(Maybe Text)
, _eaBoundingPoly :: !(Maybe BoundingPoly)
, _eaConfidence :: !(Maybe (Textual Double))
, _eaMid :: !(Maybe Text)
, _eaLocations :: !(Maybe [LocationInfo])
, _eaDescription :: !(Maybe Text)
, _eaProperties :: !(Maybe [Property])
} deriving (Eq,Show,Data,Typeable,Generic)
entityAnnotation
:: EntityAnnotation
entityAnnotation =
EntityAnnotation'
{ _eaScore = Nothing
, _eaTopicality = Nothing
, _eaLocale = Nothing
, _eaBoundingPoly = Nothing
, _eaConfidence = Nothing
, _eaMid = Nothing
, _eaLocations = Nothing
, _eaDescription = Nothing
, _eaProperties = Nothing
}
eaScore :: Lens' EntityAnnotation (Maybe Double)
eaScore
= lens _eaScore (\ s a -> s{_eaScore = a}) .
mapping _Coerce
eaTopicality :: Lens' EntityAnnotation (Maybe Double)
eaTopicality
= lens _eaTopicality (\ s a -> s{_eaTopicality = a})
. mapping _Coerce
eaLocale :: Lens' EntityAnnotation (Maybe Text)
eaLocale = lens _eaLocale (\ s a -> s{_eaLocale = a})
eaBoundingPoly :: Lens' EntityAnnotation (Maybe BoundingPoly)
eaBoundingPoly
= lens _eaBoundingPoly
(\ s a -> s{_eaBoundingPoly = a})
eaConfidence :: Lens' EntityAnnotation (Maybe Double)
eaConfidence
= lens _eaConfidence (\ s a -> s{_eaConfidence = a})
. mapping _Coerce
eaMid :: Lens' EntityAnnotation (Maybe Text)
eaMid = lens _eaMid (\ s a -> s{_eaMid = a})
eaLocations :: Lens' EntityAnnotation [LocationInfo]
eaLocations
= lens _eaLocations (\ s a -> s{_eaLocations = a}) .
_Default
. _Coerce
eaDescription :: Lens' EntityAnnotation (Maybe Text)
eaDescription
= lens _eaDescription
(\ s a -> s{_eaDescription = a})
eaProperties :: Lens' EntityAnnotation [Property]
eaProperties
= lens _eaProperties (\ s a -> s{_eaProperties = a})
. _Default
. _Coerce
instance FromJSON EntityAnnotation where
parseJSON
= withObject "EntityAnnotation"
(\ o ->
EntityAnnotation' <$>
(o .:? "score") <*> (o .:? "topicality") <*>
(o .:? "locale")
<*> (o .:? "boundingPoly")
<*> (o .:? "confidence")
<*> (o .:? "mid")
<*> (o .:? "locations" .!= mempty)
<*> (o .:? "description")
<*> (o .:? "properties" .!= mempty))
instance ToJSON EntityAnnotation where
toJSON EntityAnnotation'{..}
= object
(catMaybes
[("score" .=) <$> _eaScore,
("topicality" .=) <$> _eaTopicality,
("locale" .=) <$> _eaLocale,
("boundingPoly" .=) <$> _eaBoundingPoly,
("confidence" .=) <$> _eaConfidence,
("mid" .=) <$> _eaMid,
("locations" .=) <$> _eaLocations,
("description" .=) <$> _eaDescription,
("properties" .=) <$> _eaProperties])
data AnnotateImageRequest = AnnotateImageRequest'
{ _airImage :: !(Maybe Image)
, _airFeatures :: !(Maybe [Feature])
, _airImageContext :: !(Maybe ImageContext)
} deriving (Eq,Show,Data,Typeable,Generic)
annotateImageRequest
:: AnnotateImageRequest
annotateImageRequest =
AnnotateImageRequest'
{ _airImage = Nothing
, _airFeatures = Nothing
, _airImageContext = Nothing
}
airImage :: Lens' AnnotateImageRequest (Maybe Image)
airImage = lens _airImage (\ s a -> s{_airImage = a})
airFeatures :: Lens' AnnotateImageRequest [Feature]
airFeatures
= lens _airFeatures (\ s a -> s{_airFeatures = a}) .
_Default
. _Coerce
airImageContext :: Lens' AnnotateImageRequest (Maybe ImageContext)
airImageContext
= lens _airImageContext
(\ s a -> s{_airImageContext = a})
instance FromJSON AnnotateImageRequest where
parseJSON
= withObject "AnnotateImageRequest"
(\ o ->
AnnotateImageRequest' <$>
(o .:? "image") <*> (o .:? "features" .!= mempty) <*>
(o .:? "imageContext"))
instance ToJSON AnnotateImageRequest where
toJSON AnnotateImageRequest'{..}
= object
(catMaybes
[("image" .=) <$> _airImage,
("features" .=) <$> _airFeatures,
("imageContext" .=) <$> _airImageContext])
newtype ImageSource = ImageSource'
{ _isGcsImageURI :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
imageSource
:: ImageSource
imageSource =
ImageSource'
{ _isGcsImageURI = Nothing
}
isGcsImageURI :: Lens' ImageSource (Maybe Text)
isGcsImageURI
= lens _isGcsImageURI
(\ s a -> s{_isGcsImageURI = a})
instance FromJSON ImageSource where
parseJSON
= withObject "ImageSource"
(\ o -> ImageSource' <$> (o .:? "gcsImageUri"))
instance ToJSON ImageSource where
toJSON ImageSource'{..}
= object
(catMaybes [("gcsImageUri" .=) <$> _isGcsImageURI])
data SafeSearchAnnotation = SafeSearchAnnotation'
{ _ssaSpoof :: !(Maybe SafeSearchAnnotationSpoof)
, _ssaAdult :: !(Maybe SafeSearchAnnotationAdult)
, _ssaMedical :: !(Maybe SafeSearchAnnotationMedical)
, _ssaViolence :: !(Maybe SafeSearchAnnotationViolence)
} deriving (Eq,Show,Data,Typeable,Generic)
safeSearchAnnotation
:: SafeSearchAnnotation
safeSearchAnnotation =
SafeSearchAnnotation'
{ _ssaSpoof = Nothing
, _ssaAdult = Nothing
, _ssaMedical = Nothing
, _ssaViolence = Nothing
}
ssaSpoof :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationSpoof)
ssaSpoof = lens _ssaSpoof (\ s a -> s{_ssaSpoof = a})
ssaAdult :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationAdult)
ssaAdult = lens _ssaAdult (\ s a -> s{_ssaAdult = a})
ssaMedical :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationMedical)
ssaMedical
= lens _ssaMedical (\ s a -> s{_ssaMedical = a})
ssaViolence :: Lens' SafeSearchAnnotation (Maybe SafeSearchAnnotationViolence)
ssaViolence
= lens _ssaViolence (\ s a -> s{_ssaViolence = a})
instance FromJSON SafeSearchAnnotation where
parseJSON
= withObject "SafeSearchAnnotation"
(\ o ->
SafeSearchAnnotation' <$>
(o .:? "spoof") <*> (o .:? "adult") <*>
(o .:? "medical")
<*> (o .:? "violence"))
instance ToJSON SafeSearchAnnotation where
toJSON SafeSearchAnnotation'{..}
= object
(catMaybes
[("spoof" .=) <$> _ssaSpoof,
("adult" .=) <$> _ssaAdult,
("medical" .=) <$> _ssaMedical,
("violence" .=) <$> _ssaViolence])
data ImageContext = ImageContext'
{ _icLanguageHints :: !(Maybe [Text])
, _icLatLongRect :: !(Maybe LatLongRect)
} deriving (Eq,Show,Data,Typeable,Generic)
imageContext
:: ImageContext
imageContext =
ImageContext'
{ _icLanguageHints = Nothing
, _icLatLongRect = Nothing
}
icLanguageHints :: Lens' ImageContext [Text]
icLanguageHints
= lens _icLanguageHints
(\ s a -> s{_icLanguageHints = a})
. _Default
. _Coerce
icLatLongRect :: Lens' ImageContext (Maybe LatLongRect)
icLatLongRect
= lens _icLatLongRect
(\ s a -> s{_icLatLongRect = a})
instance FromJSON ImageContext where
parseJSON
= withObject "ImageContext"
(\ o ->
ImageContext' <$>
(o .:? "languageHints" .!= mempty) <*>
(o .:? "latLongRect"))
instance ToJSON ImageContext where
toJSON ImageContext'{..}
= object
(catMaybes
[("languageHints" .=) <$> _icLanguageHints,
("latLongRect" .=) <$> _icLatLongRect])
newtype DominantColorsAnnotation = DominantColorsAnnotation'
{ _dcaColors :: Maybe [ColorInfo]
} deriving (Eq,Show,Data,Typeable,Generic)
dominantColorsAnnotation
:: DominantColorsAnnotation
dominantColorsAnnotation =
DominantColorsAnnotation'
{ _dcaColors = Nothing
}
dcaColors :: Lens' DominantColorsAnnotation [ColorInfo]
dcaColors
= lens _dcaColors (\ s a -> s{_dcaColors = a}) .
_Default
. _Coerce
instance FromJSON DominantColorsAnnotation where
parseJSON
= withObject "DominantColorsAnnotation"
(\ o ->
DominantColorsAnnotation' <$>
(o .:? "colors" .!= mempty))
instance ToJSON DominantColorsAnnotation where
toJSON DominantColorsAnnotation'{..}
= object (catMaybes [("colors" .=) <$> _dcaColors])
data LatLongRect = LatLongRect'
{ _llrMaxLatLng :: !(Maybe LatLng)
, _llrMinLatLng :: !(Maybe LatLng)
} deriving (Eq,Show,Data,Typeable,Generic)
latLongRect
:: LatLongRect
latLongRect =
LatLongRect'
{ _llrMaxLatLng = Nothing
, _llrMinLatLng = Nothing
}
llrMaxLatLng :: Lens' LatLongRect (Maybe LatLng)
llrMaxLatLng
= lens _llrMaxLatLng (\ s a -> s{_llrMaxLatLng = a})
llrMinLatLng :: Lens' LatLongRect (Maybe LatLng)
llrMinLatLng
= lens _llrMinLatLng (\ s a -> s{_llrMinLatLng = a})
instance FromJSON LatLongRect where
parseJSON
= withObject "LatLongRect"
(\ o ->
LatLongRect' <$>
(o .:? "maxLatLng") <*> (o .:? "minLatLng"))
instance ToJSON LatLongRect where
toJSON LatLongRect'{..}
= object
(catMaybes
[("maxLatLng" .=) <$> _llrMaxLatLng,
("minLatLng" .=) <$> _llrMinLatLng])
newtype BatchAnnotateImagesResponse = BatchAnnotateImagesResponse'
{ _bairResponses :: Maybe [AnnotateImageResponse]
} deriving (Eq,Show,Data,Typeable,Generic)
batchAnnotateImagesResponse
:: BatchAnnotateImagesResponse
batchAnnotateImagesResponse =
BatchAnnotateImagesResponse'
{ _bairResponses = Nothing
}
bairResponses :: Lens' BatchAnnotateImagesResponse [AnnotateImageResponse]
bairResponses
= lens _bairResponses
(\ s a -> s{_bairResponses = a})
. _Default
. _Coerce
instance FromJSON BatchAnnotateImagesResponse where
parseJSON
= withObject "BatchAnnotateImagesResponse"
(\ o ->
BatchAnnotateImagesResponse' <$>
(o .:? "responses" .!= mempty))
instance ToJSON BatchAnnotateImagesResponse where
toJSON BatchAnnotateImagesResponse'{..}
= object
(catMaybes [("responses" .=) <$> _bairResponses])
data Position = Position'
{ _pZ :: !(Maybe (Textual Double))
, _pX :: !(Maybe (Textual Double))
, _pY :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
position
:: Position
position =
Position'
{ _pZ = Nothing
, _pX = Nothing
, _pY = Nothing
}
pZ :: Lens' Position (Maybe Double)
pZ = lens _pZ (\ s a -> s{_pZ = a}) . mapping _Coerce
pX :: Lens' Position (Maybe Double)
pX = lens _pX (\ s a -> s{_pX = a}) . mapping _Coerce
pY :: Lens' Position (Maybe Double)
pY = lens _pY (\ s a -> s{_pY = a}) . mapping _Coerce
instance FromJSON Position where
parseJSON
= withObject "Position"
(\ o ->
Position' <$>
(o .:? "z") <*> (o .:? "x") <*> (o .:? "y"))
instance ToJSON Position where
toJSON Position'{..}
= object
(catMaybes
[("z" .=) <$> _pZ, ("x" .=) <$> _pX,
("y" .=) <$> _pY])