{-# 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
-- Copyright   : (c) 2015-2016 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
module Network.Google.Vision.Types.Product where

import           Network.Google.Prelude
import           Network.Google.Vision.Types.Sum

-- | Set of detected objects with bounding boxes.
--
-- /See:/ 'googleCloudVisionV1p1beta1LocalizedObjectAnnotation' smart constructor.
data GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation = GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation'
    { _gcvvloaLanguageCode :: !(Maybe Text)
    , _gcvvloaScore        :: !(Maybe (Textual Double))
    , _gcvvloaBoundingPoly :: !(Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
    , _gcvvloaName         :: !(Maybe Text)
    , _gcvvloaMid          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvloaLanguageCode'
--
-- * 'gcvvloaScore'
--
-- * 'gcvvloaBoundingPoly'
--
-- * 'gcvvloaName'
--
-- * 'gcvvloaMid'
googleCloudVisionV1p1beta1LocalizedObjectAnnotation
    :: GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
googleCloudVisionV1p1beta1LocalizedObjectAnnotation =
    GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation'
    { _gcvvloaLanguageCode = Nothing
    , _gcvvloaScore = Nothing
    , _gcvvloaBoundingPoly = Nothing
    , _gcvvloaName = Nothing
    , _gcvvloaMid = Nothing
    }

-- | The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more
-- information, see
-- http:\/\/www.unicode.org\/reports\/tr35\/#Unicode_locale_identifier.
gcvvloaLanguageCode :: Lens' GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation (Maybe Text)
gcvvloaLanguageCode
  = lens _gcvvloaLanguageCode
      (\ s a -> s{_gcvvloaLanguageCode = a})

-- | Score of the result. Range [0, 1].
gcvvloaScore :: Lens' GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation (Maybe Double)
gcvvloaScore
  = lens _gcvvloaScore (\ s a -> s{_gcvvloaScore = a})
      . mapping _Coerce

-- | Image region to which this object belongs. This must be populated.
gcvvloaBoundingPoly :: Lens' GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation (Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
gcvvloaBoundingPoly
  = lens _gcvvloaBoundingPoly
      (\ s a -> s{_gcvvloaBoundingPoly = a})

-- | Object name, expressed in its \`language_code\` language.
gcvvloaName :: Lens' GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation (Maybe Text)
gcvvloaName
  = lens _gcvvloaName (\ s a -> s{_gcvvloaName = a})

-- | Object ID that should align with EntityAnnotation mid.
gcvvloaMid :: Lens' GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation (Maybe Text)
gcvvloaMid
  = lens _gcvvloaMid (\ s a -> s{_gcvvloaMid = a})

instance FromJSON
         GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation'
                   <$>
                   (o .:? "languageCode") <*> (o .:? "score") <*>
                     (o .:? "boundingPoly")
                     <*> (o .:? "name")
                     <*> (o .:? "mid"))

instance ToJSON
         GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation
         where
        toJSON
          GoogleCloudVisionV1p1beta1LocalizedObjectAnnotation'{..}
          = object
              (catMaybes
                 [("languageCode" .=) <$> _gcvvloaLanguageCode,
                  ("score" .=) <$> _gcvvloaScore,
                  ("boundingPoly" .=) <$> _gcvvloaBoundingPoly,
                  ("name" .=) <$> _gcvvloaName,
                  ("mid" .=) <$> _gcvvloaMid])

-- | An object representing a latitude\/longitude pair. This is expressed as
-- a pair of doubles representing degrees latitude and degrees longitude.
-- Unless specified otherwise, this must conform to the
-- <http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf WGS84 standard>.
-- Values must be within normalized ranges.
--
-- /See:/ 'latLng' smart constructor.
data LatLng = LatLng'
    { _llLatitude  :: !(Maybe (Textual Double))
    , _llLongitude :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LatLng' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'llLatitude'
--
-- * 'llLongitude'
latLng
    :: LatLng
latLng =
    LatLng'
    { _llLatitude = Nothing
    , _llLongitude = Nothing
    }

-- | The latitude in degrees. It must be in the range [-90.0, +90.0].
llLatitude :: Lens' LatLng (Maybe Double)
llLatitude
  = lens _llLatitude (\ s a -> s{_llLatitude = a}) .
      mapping _Coerce

-- | The longitude in degrees. It must be in the range [-180.0, +180.0].
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])

-- | The desired output location and metadata.
--
-- /See:/ 'googleCloudVisionV1p1beta1OutputConfig' smart constructor.
data GoogleCloudVisionV1p1beta1OutputConfig = GoogleCloudVisionV1p1beta1OutputConfig'
    { _gcvvocGcsDestination :: !(Maybe GoogleCloudVisionV1p1beta1GcsDestination)
    , _gcvvocBatchSize      :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1OutputConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvocGcsDestination'
--
-- * 'gcvvocBatchSize'
googleCloudVisionV1p1beta1OutputConfig
    :: GoogleCloudVisionV1p1beta1OutputConfig
googleCloudVisionV1p1beta1OutputConfig =
    GoogleCloudVisionV1p1beta1OutputConfig'
    { _gcvvocGcsDestination = Nothing
    , _gcvvocBatchSize = Nothing
    }

-- | The Google Cloud Storage location to write the output(s) to.
gcvvocGcsDestination :: Lens' GoogleCloudVisionV1p1beta1OutputConfig (Maybe GoogleCloudVisionV1p1beta1GcsDestination)
gcvvocGcsDestination
  = lens _gcvvocGcsDestination
      (\ s a -> s{_gcvvocGcsDestination = a})

-- | The max number of response protos to put into each output JSON file on
-- Google Cloud Storage. The valid range is [1, 100]. If not specified, the
-- default value is 20. For example, for one pdf file with 100 pages, 100
-- response protos will be generated. If \`batch_size\` = 20, then 5 json
-- files each containing 20 response protos will be written under the
-- prefix \`gcs_destination\`.\`uri\`. Currently, batch_size only applies
-- to GcsDestination, with potential future support for other output
-- configurations.
gcvvocBatchSize :: Lens' GoogleCloudVisionV1p1beta1OutputConfig (Maybe Int32)
gcvvocBatchSize
  = lens _gcvvocBatchSize
      (\ s a -> s{_gcvvocBatchSize = a})
      . mapping _Coerce

instance FromJSON
         GoogleCloudVisionV1p1beta1OutputConfig where
        parseJSON
          = withObject "GoogleCloudVisionV1p1beta1OutputConfig"
              (\ o ->
                 GoogleCloudVisionV1p1beta1OutputConfig' <$>
                   (o .:? "gcsDestination") <*> (o .:? "batchSize"))

instance ToJSON
         GoogleCloudVisionV1p1beta1OutputConfig where
        toJSON GoogleCloudVisionV1p1beta1OutputConfig'{..}
          = object
              (catMaybes
                 [("gcsDestination" .=) <$> _gcvvocGcsDestination,
                  ("batchSize" .=) <$> _gcvvocBatchSize])

-- | A product label represented as a key-value pair.
--
-- /See:/ 'googleCloudVisionV1p3beta1ProductKeyValue' smart constructor.
data GoogleCloudVisionV1p3beta1ProductKeyValue = GoogleCloudVisionV1p3beta1ProductKeyValue'
    { _gcvvpkvValue :: !(Maybe Text)
    , _gcvvpkvKey   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1ProductKeyValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpkvValue'
--
-- * 'gcvvpkvKey'
googleCloudVisionV1p3beta1ProductKeyValue
    :: GoogleCloudVisionV1p3beta1ProductKeyValue
googleCloudVisionV1p3beta1ProductKeyValue =
    GoogleCloudVisionV1p3beta1ProductKeyValue'
    { _gcvvpkvValue = Nothing
    , _gcvvpkvKey = Nothing
    }

-- | The value of the label attached to the product. Cannot be empty and
-- cannot exceed 128 bytes.
gcvvpkvValue :: Lens' GoogleCloudVisionV1p3beta1ProductKeyValue (Maybe Text)
gcvvpkvValue
  = lens _gcvvpkvValue (\ s a -> s{_gcvvpkvValue = a})

-- | The key of the label attached to the product. Cannot be empty and cannot
-- exceed 128 bytes.
gcvvpkvKey :: Lens' GoogleCloudVisionV1p3beta1ProductKeyValue (Maybe Text)
gcvvpkvKey
  = lens _gcvvpkvKey (\ s a -> s{_gcvvpkvKey = a})

instance FromJSON
         GoogleCloudVisionV1p3beta1ProductKeyValue where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1ProductKeyValue"
              (\ o ->
                 GoogleCloudVisionV1p3beta1ProductKeyValue' <$>
                   (o .:? "value") <*> (o .:? "key"))

instance ToJSON
         GoogleCloudVisionV1p3beta1ProductKeyValue where
        toJSON GoogleCloudVisionV1p3beta1ProductKeyValue'{..}
          = object
              (catMaybes
                 [("value" .=) <$> _gcvvpkvValue,
                  ("key" .=) <$> _gcvvpkvKey])

-- | Response to an async batch file annotation request.
--
-- /See:/ 'googleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse' smart constructor.
newtype GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse = GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse'
    { _gcvvabafrResponses :: Maybe [GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvabafrResponses'
googleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
    :: GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
googleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse =
    GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse'
    { _gcvvabafrResponses = Nothing
    }

-- | The list of file annotation responses, one for each request in
-- AsyncBatchAnnotateFilesRequest.
gcvvabafrResponses :: Lens' GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse [GoogleCloudVisionV1p2beta1AsyncAnnotateFileResponse]
gcvvabafrResponses
  = lens _gcvvabafrResponses
      (\ s a -> s{_gcvvabafrResponses = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse"
              (\ o ->
                 GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse'
                   <$> (o .:? "responses" .!= mempty))

instance ToJSON
         GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse
         where
        toJSON
          GoogleCloudVisionV1p2beta1AsyncBatchAnnotateFilesResponse'{..}
          = object
              (catMaybes
                 [("responses" .=) <$> _gcvvabafrResponses])

-- | If an image was produced from a file (e.g. a PDF), this message gives
-- information about the source of that image.
--
-- /See:/ 'googleCloudVisionV1p3beta1ImageAnnotationContext' smart constructor.
data GoogleCloudVisionV1p3beta1ImageAnnotationContext = GoogleCloudVisionV1p3beta1ImageAnnotationContext'
    { _gcvviacURI        :: !(Maybe Text)
    , _gcvviacPageNumber :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1ImageAnnotationContext' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvviacURI'
--
-- * 'gcvviacPageNumber'
googleCloudVisionV1p3beta1ImageAnnotationContext
    :: GoogleCloudVisionV1p3beta1ImageAnnotationContext
googleCloudVisionV1p3beta1ImageAnnotationContext =
    GoogleCloudVisionV1p3beta1ImageAnnotationContext'
    { _gcvviacURI = Nothing
    , _gcvviacPageNumber = Nothing
    }

-- | The URI of the file used to produce the image.
gcvviacURI :: Lens' GoogleCloudVisionV1p3beta1ImageAnnotationContext (Maybe Text)
gcvviacURI
  = lens _gcvviacURI (\ s a -> s{_gcvviacURI = a})

-- | If the file was a PDF or TIFF, this field gives the page number within
-- the file used to produce the image.
gcvviacPageNumber :: Lens' GoogleCloudVisionV1p3beta1ImageAnnotationContext (Maybe Int32)
gcvviacPageNumber
  = lens _gcvviacPageNumber
      (\ s a -> s{_gcvviacPageNumber = a})
      . mapping _Coerce

instance FromJSON
         GoogleCloudVisionV1p3beta1ImageAnnotationContext
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1ImageAnnotationContext"
              (\ o ->
                 GoogleCloudVisionV1p3beta1ImageAnnotationContext' <$>
                   (o .:? "uri") <*> (o .:? "pageNumber"))

instance ToJSON
         GoogleCloudVisionV1p3beta1ImageAnnotationContext
         where
        toJSON
          GoogleCloudVisionV1p3beta1ImageAnnotationContext'{..}
          = object
              (catMaybes
                 [("uri" .=) <$> _gcvviacURI,
                  ("pageNumber" .=) <$> _gcvviacPageNumber])

-- | A \`Property\` consists of a user-supplied name\/value pair.
--
-- /See:/ 'googleCloudVisionV1p3beta1Property' smart constructor.
data GoogleCloudVisionV1p3beta1Property = GoogleCloudVisionV1p3beta1Property'
    { _gcvvpUint64Value :: !(Maybe (Textual Word64))
    , _gcvvpValue       :: !(Maybe Text)
    , _gcvvpName        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1Property' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpUint64Value'
--
-- * 'gcvvpValue'
--
-- * 'gcvvpName'
googleCloudVisionV1p3beta1Property
    :: GoogleCloudVisionV1p3beta1Property
googleCloudVisionV1p3beta1Property =
    GoogleCloudVisionV1p3beta1Property'
    { _gcvvpUint64Value = Nothing
    , _gcvvpValue = Nothing
    , _gcvvpName = Nothing
    }

-- | Value of numeric properties.
gcvvpUint64Value :: Lens' GoogleCloudVisionV1p3beta1Property (Maybe Word64)
gcvvpUint64Value
  = lens _gcvvpUint64Value
      (\ s a -> s{_gcvvpUint64Value = a})
      . mapping _Coerce

-- | Value of the property.
gcvvpValue :: Lens' GoogleCloudVisionV1p3beta1Property (Maybe Text)
gcvvpValue
  = lens _gcvvpValue (\ s a -> s{_gcvvpValue = a})

-- | Name of the property.
gcvvpName :: Lens' GoogleCloudVisionV1p3beta1Property (Maybe Text)
gcvvpName
  = lens _gcvvpName (\ s a -> s{_gcvvpName = a})

instance FromJSON GoogleCloudVisionV1p3beta1Property
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p3beta1Property"
              (\ o ->
                 GoogleCloudVisionV1p3beta1Property' <$>
                   (o .:? "uint64Value") <*> (o .:? "value") <*>
                     (o .:? "name"))

instance ToJSON GoogleCloudVisionV1p3beta1Property
         where
        toJSON GoogleCloudVisionV1p3beta1Property'{..}
          = object
              (catMaybes
                 [("uint64Value" .=) <$> _gcvvpUint64Value,
                  ("value" .=) <$> _gcvvpValue,
                  ("name" .=) <$> _gcvvpName])

-- | Detected language for a structural component.
--
-- /See:/ 'googleCloudVisionV1p2beta1TextAnnotationDetectedLanguage' smart constructor.
data GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage = GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage'
    { _gcvvtadlLanguageCode :: !(Maybe Text)
    , _gcvvtadlConfidence   :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvtadlLanguageCode'
--
-- * 'gcvvtadlConfidence'
googleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
    :: GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
googleCloudVisionV1p2beta1TextAnnotationDetectedLanguage =
    GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage'
    { _gcvvtadlLanguageCode = Nothing
    , _gcvvtadlConfidence = Nothing
    }

-- | The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more
-- information, see
-- http:\/\/www.unicode.org\/reports\/tr35\/#Unicode_locale_identifier.
gcvvtadlLanguageCode :: Lens' GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage (Maybe Text)
gcvvtadlLanguageCode
  = lens _gcvvtadlLanguageCode
      (\ s a -> s{_gcvvtadlLanguageCode = a})

-- | Confidence of detected language. Range [0, 1].
gcvvtadlConfidence :: Lens' GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage (Maybe Double)
gcvvtadlConfidence
  = lens _gcvvtadlConfidence
      (\ s a -> s{_gcvvtadlConfidence = a})
      . mapping _Coerce

instance FromJSON
         GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage"
              (\ o ->
                 GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage'
                   <$> (o .:? "languageCode") <*> (o .:? "confidence"))

instance ToJSON
         GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage
         where
        toJSON
          GoogleCloudVisionV1p2beta1TextAnnotationDetectedLanguage'{..}
          = object
              (catMaybes
                 [("languageCode" .=) <$> _gcvvtadlLanguageCode,
                  ("confidence" .=) <$> _gcvvtadlConfidence])

-- | A product label represented as a key-value pair.
--
-- /See:/ 'keyValue' smart constructor.
data KeyValue = KeyValue'
    { _kvValue :: !(Maybe Text)
    , _kvKey   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'KeyValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'kvValue'
--
-- * 'kvKey'
keyValue
    :: KeyValue
keyValue =
    KeyValue'
    { _kvValue = Nothing
    , _kvKey = Nothing
    }

-- | The value of the label attached to the product. Cannot be empty and
-- cannot exceed 128 bytes.
kvValue :: Lens' KeyValue (Maybe Text)
kvValue = lens _kvValue (\ s a -> s{_kvValue = a})

-- | The key of the label attached to the product. Cannot be empty and cannot
-- exceed 128 bytes.
kvKey :: Lens' KeyValue (Maybe Text)
kvKey = lens _kvKey (\ s a -> s{_kvKey = a})

instance FromJSON KeyValue where
        parseJSON
          = withObject "KeyValue"
              (\ o ->
                 KeyValue' <$> (o .:? "value") <*> (o .:? "key"))

instance ToJSON KeyValue where
        toJSON KeyValue'{..}
          = object
              (catMaybes
                 [("value" .=) <$> _kvValue, ("key" .=) <$> _kvKey])

-- | Response to an image annotation request.
--
-- /See:/ 'googleCloudVisionV1p2beta1AnnotateImageResponse' smart constructor.
data GoogleCloudVisionV1p2beta1AnnotateImageResponse = GoogleCloudVisionV1p2beta1AnnotateImageResponse'
    { _gcvvairLogoAnnotations            :: !(Maybe [GoogleCloudVisionV1p2beta1EntityAnnotation])
    , _gcvvairProductSearchResults       :: !(Maybe GoogleCloudVisionV1p2beta1ProductSearchResults)
    , _gcvvairContext                    :: !(Maybe GoogleCloudVisionV1p2beta1ImageAnnotationContext)
    , _gcvvairLabelAnnotations           :: !(Maybe [GoogleCloudVisionV1p2beta1EntityAnnotation])
    , _gcvvairFaceAnnotations            :: !(Maybe [GoogleCloudVisionV1p2beta1FaceAnnotation])
    , _gcvvairError                      :: !(Maybe Status)
    , _gcvvairWebDetection               :: !(Maybe GoogleCloudVisionV1p2beta1WebDetection)
    , _gcvvairSafeSearchAnnotation       :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotation)
    , _gcvvairLandmarkAnnotations        :: !(Maybe [GoogleCloudVisionV1p2beta1EntityAnnotation])
    , _gcvvairLocalizedObjectAnnotations :: !(Maybe [GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation])
    , _gcvvairTextAnnotations            :: !(Maybe [GoogleCloudVisionV1p2beta1EntityAnnotation])
    , _gcvvairCropHintsAnnotation        :: !(Maybe GoogleCloudVisionV1p2beta1CropHintsAnnotation)
    , _gcvvairFullTextAnnotation         :: !(Maybe GoogleCloudVisionV1p2beta1TextAnnotation)
    , _gcvvairImagePropertiesAnnotation  :: !(Maybe GoogleCloudVisionV1p2beta1ImageProperties)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1AnnotateImageResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvairLogoAnnotations'
--
-- * 'gcvvairProductSearchResults'
--
-- * 'gcvvairContext'
--
-- * 'gcvvairLabelAnnotations'
--
-- * 'gcvvairFaceAnnotations'
--
-- * 'gcvvairError'
--
-- * 'gcvvairWebDetection'
--
-- * 'gcvvairSafeSearchAnnotation'
--
-- * 'gcvvairLandmarkAnnotations'
--
-- * 'gcvvairLocalizedObjectAnnotations'
--
-- * 'gcvvairTextAnnotations'
--
-- * 'gcvvairCropHintsAnnotation'
--
-- * 'gcvvairFullTextAnnotation'
--
-- * 'gcvvairImagePropertiesAnnotation'
googleCloudVisionV1p2beta1AnnotateImageResponse
    :: GoogleCloudVisionV1p2beta1AnnotateImageResponse
googleCloudVisionV1p2beta1AnnotateImageResponse =
    GoogleCloudVisionV1p2beta1AnnotateImageResponse'
    { _gcvvairLogoAnnotations = Nothing
    , _gcvvairProductSearchResults = Nothing
    , _gcvvairContext = Nothing
    , _gcvvairLabelAnnotations = Nothing
    , _gcvvairFaceAnnotations = Nothing
    , _gcvvairError = Nothing
    , _gcvvairWebDetection = Nothing
    , _gcvvairSafeSearchAnnotation = Nothing
    , _gcvvairLandmarkAnnotations = Nothing
    , _gcvvairLocalizedObjectAnnotations = Nothing
    , _gcvvairTextAnnotations = Nothing
    , _gcvvairCropHintsAnnotation = Nothing
    , _gcvvairFullTextAnnotation = Nothing
    , _gcvvairImagePropertiesAnnotation = Nothing
    }

-- | If present, logo detection has completed successfully.
gcvvairLogoAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1EntityAnnotation]
gcvvairLogoAnnotations
  = lens _gcvvairLogoAnnotations
      (\ s a -> s{_gcvvairLogoAnnotations = a})
      . _Default
      . _Coerce

-- | If present, product search has completed successfully.
gcvvairProductSearchResults :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1ProductSearchResults)
gcvvairProductSearchResults
  = lens _gcvvairProductSearchResults
      (\ s a -> s{_gcvvairProductSearchResults = a})

-- | If present, contextual information is needed to understand where this
-- image comes from.
gcvvairContext :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1ImageAnnotationContext)
gcvvairContext
  = lens _gcvvairContext
      (\ s a -> s{_gcvvairContext = a})

-- | If present, label detection has completed successfully.
gcvvairLabelAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1EntityAnnotation]
gcvvairLabelAnnotations
  = lens _gcvvairLabelAnnotations
      (\ s a -> s{_gcvvairLabelAnnotations = a})
      . _Default
      . _Coerce

-- | If present, face detection has completed successfully.
gcvvairFaceAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1FaceAnnotation]
gcvvairFaceAnnotations
  = lens _gcvvairFaceAnnotations
      (\ s a -> s{_gcvvairFaceAnnotations = a})
      . _Default
      . _Coerce

-- | If set, represents the error message for the operation. Note that
-- filled-in image annotations are guaranteed to be correct, even when
-- \`error\` is set.
gcvvairError :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe Status)
gcvvairError
  = lens _gcvvairError (\ s a -> s{_gcvvairError = a})

-- | If present, web detection has completed successfully.
gcvvairWebDetection :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1WebDetection)
gcvvairWebDetection
  = lens _gcvvairWebDetection
      (\ s a -> s{_gcvvairWebDetection = a})

-- | If present, safe-search annotation has completed successfully.
gcvvairSafeSearchAnnotation :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotation)
gcvvairSafeSearchAnnotation
  = lens _gcvvairSafeSearchAnnotation
      (\ s a -> s{_gcvvairSafeSearchAnnotation = a})

-- | If present, landmark detection has completed successfully.
gcvvairLandmarkAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1EntityAnnotation]
gcvvairLandmarkAnnotations
  = lens _gcvvairLandmarkAnnotations
      (\ s a -> s{_gcvvairLandmarkAnnotations = a})
      . _Default
      . _Coerce

-- | If present, localized object detection has completed successfully. This
-- will be sorted descending by confidence score.
gcvvairLocalizedObjectAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1LocalizedObjectAnnotation]
gcvvairLocalizedObjectAnnotations
  = lens _gcvvairLocalizedObjectAnnotations
      (\ s a -> s{_gcvvairLocalizedObjectAnnotations = a})
      . _Default
      . _Coerce

-- | If present, text (OCR) detection has completed successfully.
gcvvairTextAnnotations :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse [GoogleCloudVisionV1p2beta1EntityAnnotation]
gcvvairTextAnnotations
  = lens _gcvvairTextAnnotations
      (\ s a -> s{_gcvvairTextAnnotations = a})
      . _Default
      . _Coerce

-- | If present, crop hints have completed successfully.
gcvvairCropHintsAnnotation :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1CropHintsAnnotation)
gcvvairCropHintsAnnotation
  = lens _gcvvairCropHintsAnnotation
      (\ s a -> s{_gcvvairCropHintsAnnotation = a})

-- | If present, text (OCR) detection or document (OCR) text detection has
-- completed successfully. This annotation provides the structural
-- hierarchy for the OCR detected text.
gcvvairFullTextAnnotation :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1TextAnnotation)
gcvvairFullTextAnnotation
  = lens _gcvvairFullTextAnnotation
      (\ s a -> s{_gcvvairFullTextAnnotation = a})

-- | If present, image properties were extracted successfully.
gcvvairImagePropertiesAnnotation :: Lens' GoogleCloudVisionV1p2beta1AnnotateImageResponse (Maybe GoogleCloudVisionV1p2beta1ImageProperties)
gcvvairImagePropertiesAnnotation
  = lens _gcvvairImagePropertiesAnnotation
      (\ s a -> s{_gcvvairImagePropertiesAnnotation = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1AnnotateImageResponse where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1AnnotateImageResponse"
              (\ o ->
                 GoogleCloudVisionV1p2beta1AnnotateImageResponse' <$>
                   (o .:? "logoAnnotations" .!= mempty) <*>
                     (o .:? "productSearchResults")
                     <*> (o .:? "context")
                     <*> (o .:? "labelAnnotations" .!= mempty)
                     <*> (o .:? "faceAnnotations" .!= mempty)
                     <*> (o .:? "error")
                     <*> (o .:? "webDetection")
                     <*> (o .:? "safeSearchAnnotation")
                     <*> (o .:? "landmarkAnnotations" .!= mempty)
                     <*> (o .:? "localizedObjectAnnotations" .!= mempty)
                     <*> (o .:? "textAnnotations" .!= mempty)
                     <*> (o .:? "cropHintsAnnotation")
                     <*> (o .:? "fullTextAnnotation")
                     <*> (o .:? "imagePropertiesAnnotation"))

instance ToJSON
         GoogleCloudVisionV1p2beta1AnnotateImageResponse where
        toJSON
          GoogleCloudVisionV1p2beta1AnnotateImageResponse'{..}
          = object
              (catMaybes
                 [("logoAnnotations" .=) <$> _gcvvairLogoAnnotations,
                  ("productSearchResults" .=) <$>
                    _gcvvairProductSearchResults,
                  ("context" .=) <$> _gcvvairContext,
                  ("labelAnnotations" .=) <$> _gcvvairLabelAnnotations,
                  ("faceAnnotations" .=) <$> _gcvvairFaceAnnotations,
                  ("error" .=) <$> _gcvvairError,
                  ("webDetection" .=) <$> _gcvvairWebDetection,
                  ("safeSearchAnnotation" .=) <$>
                    _gcvvairSafeSearchAnnotation,
                  ("landmarkAnnotations" .=) <$>
                    _gcvvairLandmarkAnnotations,
                  ("localizedObjectAnnotations" .=) <$>
                    _gcvvairLocalizedObjectAnnotations,
                  ("textAnnotations" .=) <$> _gcvvairTextAnnotations,
                  ("cropHintsAnnotation" .=) <$>
                    _gcvvairCropHintsAnnotation,
                  ("fullTextAnnotation" .=) <$>
                    _gcvvairFullTextAnnotation,
                  ("imagePropertiesAnnotation" .=) <$>
                    _gcvvairImagePropertiesAnnotation])

-- | Response message for the \`ImportProductSets\` method. This message is
-- returned by the google.longrunning.Operations.GetOperation method in the
-- returned google.longrunning.Operation.response field.
--
-- /See:/ 'importProductSetsResponse' smart constructor.
data ImportProductSetsResponse = ImportProductSetsResponse'
    { _ipsrReferenceImages :: !(Maybe [ReferenceImage])
    , _ipsrStatuses        :: !(Maybe [Status])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImportProductSetsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ipsrReferenceImages'
--
-- * 'ipsrStatuses'
importProductSetsResponse
    :: ImportProductSetsResponse
importProductSetsResponse =
    ImportProductSetsResponse'
    { _ipsrReferenceImages = Nothing
    , _ipsrStatuses = Nothing
    }

-- | The list of reference_images that are imported successfully.
ipsrReferenceImages :: Lens' ImportProductSetsResponse [ReferenceImage]
ipsrReferenceImages
  = lens _ipsrReferenceImages
      (\ s a -> s{_ipsrReferenceImages = a})
      . _Default
      . _Coerce

-- | The rpc status for each ImportProductSet request, including both
-- successes and errors. The number of statuses here matches the number of
-- lines in the csv file, and statuses[i] stores the success or failure
-- status of processing the i-th line of the csv, starting from line 0.
ipsrStatuses :: Lens' ImportProductSetsResponse [Status]
ipsrStatuses
  = lens _ipsrStatuses (\ s a -> s{_ipsrStatuses = a})
      . _Default
      . _Coerce

instance FromJSON ImportProductSetsResponse where
        parseJSON
          = withObject "ImportProductSetsResponse"
              (\ o ->
                 ImportProductSetsResponse' <$>
                   (o .:? "referenceImages" .!= mempty) <*>
                     (o .:? "statuses" .!= mempty))

instance ToJSON ImportProductSetsResponse where
        toJSON ImportProductSetsResponse'{..}
          = object
              (catMaybes
                 [("referenceImages" .=) <$> _ipsrReferenceImages,
                  ("statuses" .=) <$> _ipsrStatuses])

-- | A single symbol representation.
--
-- /See:/ 'googleCloudVisionV1p2beta1Symbol' smart constructor.
data GoogleCloudVisionV1p2beta1Symbol = GoogleCloudVisionV1p2beta1Symbol'
    { _gcvvsProperty    :: !(Maybe GoogleCloudVisionV1p2beta1TextAnnotationTextProperty)
    , _gcvvsBoundingBox :: !(Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
    , _gcvvsText        :: !(Maybe Text)
    , _gcvvsConfidence  :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1Symbol' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvsProperty'
--
-- * 'gcvvsBoundingBox'
--
-- * 'gcvvsText'
--
-- * 'gcvvsConfidence'
googleCloudVisionV1p2beta1Symbol
    :: GoogleCloudVisionV1p2beta1Symbol
googleCloudVisionV1p2beta1Symbol =
    GoogleCloudVisionV1p2beta1Symbol'
    { _gcvvsProperty = Nothing
    , _gcvvsBoundingBox = Nothing
    , _gcvvsText = Nothing
    , _gcvvsConfidence = Nothing
    }

-- | Additional information detected for the symbol.
gcvvsProperty :: Lens' GoogleCloudVisionV1p2beta1Symbol (Maybe GoogleCloudVisionV1p2beta1TextAnnotationTextProperty)
gcvvsProperty
  = lens _gcvvsProperty
      (\ s a -> s{_gcvvsProperty = a})

-- | The bounding box for the symbol. The vertices are in the order of
-- top-left, top-right, bottom-right, bottom-left. When a rotation of the
-- bounding box is detected the rotation is represented as around the
-- top-left corner as defined when the text is read in the \'natural\'
-- orientation. For example: * when the text is horizontal it might look
-- like: 0----1 | | 3----2 * when it\'s rotated 180 degrees around the
-- top-left corner it becomes: 2----3 | | 1----0 and the vertice order will
-- still be (0, 1, 2, 3).
gcvvsBoundingBox :: Lens' GoogleCloudVisionV1p2beta1Symbol (Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
gcvvsBoundingBox
  = lens _gcvvsBoundingBox
      (\ s a -> s{_gcvvsBoundingBox = a})

-- | The actual UTF-8 representation of the symbol.
gcvvsText :: Lens' GoogleCloudVisionV1p2beta1Symbol (Maybe Text)
gcvvsText
  = lens _gcvvsText (\ s a -> s{_gcvvsText = a})

-- | Confidence of the OCR results for the symbol. Range [0, 1].
gcvvsConfidence :: Lens' GoogleCloudVisionV1p2beta1Symbol (Maybe Double)
gcvvsConfidence
  = lens _gcvvsConfidence
      (\ s a -> s{_gcvvsConfidence = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p2beta1Symbol
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1Symbol"
              (\ o ->
                 GoogleCloudVisionV1p2beta1Symbol' <$>
                   (o .:? "property") <*> (o .:? "boundingBox") <*>
                     (o .:? "text")
                     <*> (o .:? "confidence"))

instance ToJSON GoogleCloudVisionV1p2beta1Symbol
         where
        toJSON GoogleCloudVisionV1p2beta1Symbol'{..}
          = object
              (catMaybes
                 [("property" .=) <$> _gcvvsProperty,
                  ("boundingBox" .=) <$> _gcvvsBoundingBox,
                  ("text" .=) <$> _gcvvsText,
                  ("confidence" .=) <$> _gcvvsConfidence])

-- | Structural unit of text representing a number of words in certain order.
--
-- /See:/ 'googleCloudVisionV1p2beta1Paragraph' smart constructor.
data GoogleCloudVisionV1p2beta1Paragraph = GoogleCloudVisionV1p2beta1Paragraph'
    { _gcvvpProperty    :: !(Maybe GoogleCloudVisionV1p2beta1TextAnnotationTextProperty)
    , _gcvvpBoundingBox :: !(Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
    , _gcvvpConfidence  :: !(Maybe (Textual Double))
    , _gcvvpWords       :: !(Maybe [GoogleCloudVisionV1p2beta1Word])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1Paragraph' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpProperty'
--
-- * 'gcvvpBoundingBox'
--
-- * 'gcvvpConfidence'
--
-- * 'gcvvpWords'
googleCloudVisionV1p2beta1Paragraph
    :: GoogleCloudVisionV1p2beta1Paragraph
googleCloudVisionV1p2beta1Paragraph =
    GoogleCloudVisionV1p2beta1Paragraph'
    { _gcvvpProperty = Nothing
    , _gcvvpBoundingBox = Nothing
    , _gcvvpConfidence = Nothing
    , _gcvvpWords = Nothing
    }

-- | Additional information detected for the paragraph.
gcvvpProperty :: Lens' GoogleCloudVisionV1p2beta1Paragraph (Maybe GoogleCloudVisionV1p2beta1TextAnnotationTextProperty)
gcvvpProperty
  = lens _gcvvpProperty
      (\ s a -> s{_gcvvpProperty = a})

-- | The bounding box for the paragraph. The vertices are in the order of
-- top-left, top-right, bottom-right, bottom-left. When a rotation of the
-- bounding box is detected the rotation is represented as around the
-- top-left corner as defined when the text is read in the \'natural\'
-- orientation. For example: * when the text is horizontal it might look
-- like: 0----1 | | 3----2 * when it\'s rotated 180 degrees around the
-- top-left corner it becomes: 2----3 | | 1----0 and the vertex order will
-- still be (0, 1, 2, 3).
gcvvpBoundingBox :: Lens' GoogleCloudVisionV1p2beta1Paragraph (Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
gcvvpBoundingBox
  = lens _gcvvpBoundingBox
      (\ s a -> s{_gcvvpBoundingBox = a})

-- | Confidence of the OCR results for the paragraph. Range [0, 1].
gcvvpConfidence :: Lens' GoogleCloudVisionV1p2beta1Paragraph (Maybe Double)
gcvvpConfidence
  = lens _gcvvpConfidence
      (\ s a -> s{_gcvvpConfidence = a})
      . mapping _Coerce

-- | List of words in this paragraph.
gcvvpWords :: Lens' GoogleCloudVisionV1p2beta1Paragraph [GoogleCloudVisionV1p2beta1Word]
gcvvpWords
  = lens _gcvvpWords (\ s a -> s{_gcvvpWords = a}) .
      _Default
      . _Coerce

instance FromJSON GoogleCloudVisionV1p2beta1Paragraph
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1Paragraph"
              (\ o ->
                 GoogleCloudVisionV1p2beta1Paragraph' <$>
                   (o .:? "property") <*> (o .:? "boundingBox") <*>
                     (o .:? "confidence")
                     <*> (o .:? "words" .!= mempty))

instance ToJSON GoogleCloudVisionV1p2beta1Paragraph
         where
        toJSON GoogleCloudVisionV1p2beta1Paragraph'{..}
          = object
              (catMaybes
                 [("property" .=) <$> _gcvvpProperty,
                  ("boundingBox" .=) <$> _gcvvpBoundingBox,
                  ("confidence" .=) <$> _gcvvpConfidence,
                  ("words" .=) <$> _gcvvpWords])

-- | The \`Status\` type defines a logical error model that is suitable for
-- different programming environments, including REST APIs and RPC APIs. It
-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
-- designed to be: - Simple to use and understand for most users - Flexible
-- enough to meet unexpected needs # Overview The \`Status\` message
-- contains three pieces of data: error code, error message, and error
-- details. The error code should be an enum value of google.rpc.Code, but
-- it may accept additional error codes if needed. The error message should
-- be a developer-facing English message that helps developers *understand*
-- and *resolve* the error. If a localized user-facing error message is
-- needed, put the localized message in the error details or localize it in
-- the client. The optional error details may contain arbitrary information
-- about the error. There is a predefined set of error detail types in the
-- package \`google.rpc\` that can be used for common error conditions. #
-- Language mapping The \`Status\` message is the logical representation of
-- the error model, but it is not necessarily the actual wire format. When
-- the \`Status\` message is exposed in different client libraries and
-- different wire protocols, it can be mapped differently. For example, it
-- will likely be mapped to some exceptions in Java, but more likely mapped
-- to some error codes in C. # Other uses The error model and the
-- \`Status\` message can be used in a variety of environments, either with
-- or without APIs, to provide a consistent developer experience across
-- different environments. Example uses of this error model include: -
-- Partial errors. If a service needs to return partial errors to the
-- client, it may embed the \`Status\` in the normal response to indicate
-- the partial errors. - Workflow errors. A typical workflow has multiple
-- steps. Each step may have a \`Status\` message for error reporting. -
-- Batch operations. If a client uses batch request and batch response, the
-- \`Status\` message should be used directly inside batch response, one
-- for each error sub-response. - Asynchronous operations. If an API call
-- embeds asynchronous operation results in its response, the status of
-- those operations should be represented directly using the \`Status\`
-- message. - Logging. If some API errors are stored in logs, the message
-- \`Status\` could be used directly after any stripping needed for
-- security\/privacy reasons.
--
-- /See:/ 'status' smart constructor.
data Status = Status'
    { _sDetails :: !(Maybe [StatusDetailsItem])
    , _sCode    :: !(Maybe (Textual Int32))
    , _sMessage :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Status' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sDetails'
--
-- * 'sCode'
--
-- * 'sMessage'
status
    :: Status
status =
    Status'
    { _sDetails = Nothing
    , _sCode = Nothing
    , _sMessage = Nothing
    }

-- | A list of messages that carry the error details. There is a common set
-- of message types for APIs to use.
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
  = lens _sDetails (\ s a -> s{_sDetails = a}) .
      _Default
      . _Coerce

-- | The status code, which should be an enum value of google.rpc.Code.
sCode :: Lens' Status (Maybe Int32)
sCode
  = lens _sCode (\ s a -> s{_sCode = a}) .
      mapping _Coerce

-- | A developer-facing error message, which should be in English. Any
-- user-facing error message should be localized and sent in the
-- google.rpc.Status.details field, or localized by the client.
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])

-- | A face annotation object contains the results of face detection.
--
-- /See:/ 'googleCloudVisionV1p2beta1FaceAnnotation' smart constructor.
data GoogleCloudVisionV1p2beta1FaceAnnotation = GoogleCloudVisionV1p2beta1FaceAnnotation'
    { _gcvvfaTiltAngle              :: !(Maybe (Textual Double))
    , _gcvvfaBlurredLikelihood      :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationBlurredLikelihood)
    , _gcvvfaBoundingPoly           :: !(Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
    , _gcvvfaSurpriseLikelihood     :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationSurpriseLikelihood)
    , _gcvvfaLandmarkingConfidence  :: !(Maybe (Textual Double))
    , _gcvvfaPanAngle               :: !(Maybe (Textual Double))
    , _gcvvfaRollAngle              :: !(Maybe (Textual Double))
    , _gcvvfaUnderExposedLikelihood :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationUnderExposedLikelihood)
    , _gcvvfaFdBoundingPoly         :: !(Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
    , _gcvvfaAngerLikelihood        :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationAngerLikelihood)
    , _gcvvfaDetectionConfidence    :: !(Maybe (Textual Double))
    , _gcvvfaHeadwearLikelihood     :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationHeadwearLikelihood)
    , _gcvvfaSorrowLikelihood       :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationSorrowLikelihood)
    , _gcvvfaJoyLikelihood          :: !(Maybe GoogleCloudVisionV1p2beta1FaceAnnotationJoyLikelihood)
    , _gcvvfaLandmarks              :: !(Maybe [GoogleCloudVisionV1p2beta1FaceAnnotationLandmark])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1FaceAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvfaTiltAngle'
--
-- * 'gcvvfaBlurredLikelihood'
--
-- * 'gcvvfaBoundingPoly'
--
-- * 'gcvvfaSurpriseLikelihood'
--
-- * 'gcvvfaLandmarkingConfidence'
--
-- * 'gcvvfaPanAngle'
--
-- * 'gcvvfaRollAngle'
--
-- * 'gcvvfaUnderExposedLikelihood'
--
-- * 'gcvvfaFdBoundingPoly'
--
-- * 'gcvvfaAngerLikelihood'
--
-- * 'gcvvfaDetectionConfidence'
--
-- * 'gcvvfaHeadwearLikelihood'
--
-- * 'gcvvfaSorrowLikelihood'
--
-- * 'gcvvfaJoyLikelihood'
--
-- * 'gcvvfaLandmarks'
googleCloudVisionV1p2beta1FaceAnnotation
    :: GoogleCloudVisionV1p2beta1FaceAnnotation
googleCloudVisionV1p2beta1FaceAnnotation =
    GoogleCloudVisionV1p2beta1FaceAnnotation'
    { _gcvvfaTiltAngle = Nothing
    , _gcvvfaBlurredLikelihood = Nothing
    , _gcvvfaBoundingPoly = Nothing
    , _gcvvfaSurpriseLikelihood = Nothing
    , _gcvvfaLandmarkingConfidence = Nothing
    , _gcvvfaPanAngle = Nothing
    , _gcvvfaRollAngle = Nothing
    , _gcvvfaUnderExposedLikelihood = Nothing
    , _gcvvfaFdBoundingPoly = Nothing
    , _gcvvfaAngerLikelihood = Nothing
    , _gcvvfaDetectionConfidence = Nothing
    , _gcvvfaHeadwearLikelihood = Nothing
    , _gcvvfaSorrowLikelihood = Nothing
    , _gcvvfaJoyLikelihood = Nothing
    , _gcvvfaLandmarks = Nothing
    }

-- | Pitch angle, which indicates the upwards\/downwards angle that the face
-- is pointing relative to the image\'s horizontal plane. Range [-180,180].
gcvvfaTiltAngle :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe Double)
gcvvfaTiltAngle
  = lens _gcvvfaTiltAngle
      (\ s a -> s{_gcvvfaTiltAngle = a})
      . mapping _Coerce

-- | Blurred likelihood.
gcvvfaBlurredLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationBlurredLikelihood)
gcvvfaBlurredLikelihood
  = lens _gcvvfaBlurredLikelihood
      (\ s a -> s{_gcvvfaBlurredLikelihood = a})

-- | The bounding polygon around the face. The coordinates of the bounding
-- box are in the original image\'s scale, as returned in \`ImageParams\`.
-- The bounding box is computed to \"frame\" the face in accordance with
-- human expectations. It is based on the landmarker results. Note that one
-- or more x and\/or y coordinates may not be generated in the
-- \`BoundingPoly\` (the polygon will be unbounded) if only a partial face
-- appears in the image to be annotated.
gcvvfaBoundingPoly :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
gcvvfaBoundingPoly
  = lens _gcvvfaBoundingPoly
      (\ s a -> s{_gcvvfaBoundingPoly = a})

-- | Surprise likelihood.
gcvvfaSurpriseLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationSurpriseLikelihood)
gcvvfaSurpriseLikelihood
  = lens _gcvvfaSurpriseLikelihood
      (\ s a -> s{_gcvvfaSurpriseLikelihood = a})

-- | Face landmarking confidence. Range [0, 1].
gcvvfaLandmarkingConfidence :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe Double)
gcvvfaLandmarkingConfidence
  = lens _gcvvfaLandmarkingConfidence
      (\ s a -> s{_gcvvfaLandmarkingConfidence = a})
      . mapping _Coerce

-- | Yaw angle, which indicates the leftward\/rightward angle that the face
-- is pointing relative to the vertical plane perpendicular to the image.
-- Range [-180,180].
gcvvfaPanAngle :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe Double)
gcvvfaPanAngle
  = lens _gcvvfaPanAngle
      (\ s a -> s{_gcvvfaPanAngle = a})
      . mapping _Coerce

-- | Roll angle, which indicates the amount of clockwise\/anti-clockwise
-- rotation of the face relative to the image vertical about the axis
-- perpendicular to the face. Range [-180,180].
gcvvfaRollAngle :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe Double)
gcvvfaRollAngle
  = lens _gcvvfaRollAngle
      (\ s a -> s{_gcvvfaRollAngle = a})
      . mapping _Coerce

-- | Under-exposed likelihood.
gcvvfaUnderExposedLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationUnderExposedLikelihood)
gcvvfaUnderExposedLikelihood
  = lens _gcvvfaUnderExposedLikelihood
      (\ s a -> s{_gcvvfaUnderExposedLikelihood = a})

-- | The \`fd_bounding_poly\` bounding polygon is tighter than the
-- \`boundingPoly\`, and encloses only the skin part of the face.
-- Typically, it is used to eliminate the face from any image analysis that
-- detects the \"amount of skin\" visible in an image. It is not based on
-- the landmarker results, only on the initial face detection, hence the
-- 'fd' (face detection) prefix.
gcvvfaFdBoundingPoly :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
gcvvfaFdBoundingPoly
  = lens _gcvvfaFdBoundingPoly
      (\ s a -> s{_gcvvfaFdBoundingPoly = a})

-- | Anger likelihood.
gcvvfaAngerLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationAngerLikelihood)
gcvvfaAngerLikelihood
  = lens _gcvvfaAngerLikelihood
      (\ s a -> s{_gcvvfaAngerLikelihood = a})

-- | Detection confidence. Range [0, 1].
gcvvfaDetectionConfidence :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe Double)
gcvvfaDetectionConfidence
  = lens _gcvvfaDetectionConfidence
      (\ s a -> s{_gcvvfaDetectionConfidence = a})
      . mapping _Coerce

-- | Headwear likelihood.
gcvvfaHeadwearLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationHeadwearLikelihood)
gcvvfaHeadwearLikelihood
  = lens _gcvvfaHeadwearLikelihood
      (\ s a -> s{_gcvvfaHeadwearLikelihood = a})

-- | Sorrow likelihood.
gcvvfaSorrowLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationSorrowLikelihood)
gcvvfaSorrowLikelihood
  = lens _gcvvfaSorrowLikelihood
      (\ s a -> s{_gcvvfaSorrowLikelihood = a})

-- | Joy likelihood.
gcvvfaJoyLikelihood :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation (Maybe GoogleCloudVisionV1p2beta1FaceAnnotationJoyLikelihood)
gcvvfaJoyLikelihood
  = lens _gcvvfaJoyLikelihood
      (\ s a -> s{_gcvvfaJoyLikelihood = a})

-- | Detected face landmarks.
gcvvfaLandmarks :: Lens' GoogleCloudVisionV1p2beta1FaceAnnotation [GoogleCloudVisionV1p2beta1FaceAnnotationLandmark]
gcvvfaLandmarks
  = lens _gcvvfaLandmarks
      (\ s a -> s{_gcvvfaLandmarks = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p2beta1FaceAnnotation where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1FaceAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p2beta1FaceAnnotation' <$>
                   (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
         GoogleCloudVisionV1p2beta1FaceAnnotation where
        toJSON GoogleCloudVisionV1p2beta1FaceAnnotation'{..}
          = object
              (catMaybes
                 [("tiltAngle" .=) <$> _gcvvfaTiltAngle,
                  ("blurredLikelihood" .=) <$>
                    _gcvvfaBlurredLikelihood,
                  ("boundingPoly" .=) <$> _gcvvfaBoundingPoly,
                  ("surpriseLikelihood" .=) <$>
                    _gcvvfaSurpriseLikelihood,
                  ("landmarkingConfidence" .=) <$>
                    _gcvvfaLandmarkingConfidence,
                  ("panAngle" .=) <$> _gcvvfaPanAngle,
                  ("rollAngle" .=) <$> _gcvvfaRollAngle,
                  ("underExposedLikelihood" .=) <$>
                    _gcvvfaUnderExposedLikelihood,
                  ("fdBoundingPoly" .=) <$> _gcvvfaFdBoundingPoly,
                  ("angerLikelihood" .=) <$> _gcvvfaAngerLikelihood,
                  ("detectionConfidence" .=) <$>
                    _gcvvfaDetectionConfidence,
                  ("headwearLikelihood" .=) <$>
                    _gcvvfaHeadwearLikelihood,
                  ("sorrowLikelihood" .=) <$> _gcvvfaSorrowLikelihood,
                  ("joyLikelihood" .=) <$> _gcvvfaJoyLikelihood,
                  ("landmarks" .=) <$> _gcvvfaLandmarks])

-- | Service-specific metadata associated with the operation. It typically
-- contains progress information and common metadata such as create time.
-- Some services might not provide such metadata. Any method that returns a
-- long-running operation should document the metadata type, if any.
--
-- /See:/ 'operationSchema' smart constructor.
newtype OperationSchema = OperationSchema'
    { _osAddtional :: HashMap Text JSONValue
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'OperationSchema' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'osAddtional'
operationSchema
    :: HashMap Text JSONValue -- ^ 'osAddtional'
    -> OperationSchema
operationSchema pOsAddtional_ =
    OperationSchema'
    { _osAddtional = _Coerce # pOsAddtional_
    }

-- | Properties of the object. Contains field \'type with type URL.
osAddtional :: Lens' OperationSchema (HashMap Text JSONValue)
osAddtional
  = lens _osAddtional (\ s a -> s{_osAddtional = a}) .
      _Coerce

instance FromJSON OperationSchema where
        parseJSON
          = withObject "OperationSchema"
              (\ o -> OperationSchema' <$> (parseJSONObject o))

instance ToJSON OperationSchema where
        toJSON = toJSON . _osAddtional

-- | Single crop hint that is used to generate a new crop when serving an
-- image.
--
-- /See:/ 'googleCloudVisionV1p1beta1CropHint' smart constructor.
data GoogleCloudVisionV1p1beta1CropHint = GoogleCloudVisionV1p1beta1CropHint'
    { _gcvvchBoundingPoly       :: !(Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
    , _gcvvchConfidence         :: !(Maybe (Textual Double))
    , _gcvvchImportanceFraction :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1CropHint' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvchBoundingPoly'
--
-- * 'gcvvchConfidence'
--
-- * 'gcvvchImportanceFraction'
googleCloudVisionV1p1beta1CropHint
    :: GoogleCloudVisionV1p1beta1CropHint
googleCloudVisionV1p1beta1CropHint =
    GoogleCloudVisionV1p1beta1CropHint'
    { _gcvvchBoundingPoly = Nothing
    , _gcvvchConfidence = Nothing
    , _gcvvchImportanceFraction = Nothing
    }

-- | The bounding polygon for the crop region. The coordinates of the
-- bounding box are in the original image\'s scale, as returned in
-- \`ImageParams\`.
gcvvchBoundingPoly :: Lens' GoogleCloudVisionV1p1beta1CropHint (Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
gcvvchBoundingPoly
  = lens _gcvvchBoundingPoly
      (\ s a -> s{_gcvvchBoundingPoly = a})

-- | Confidence of this being a salient region. Range [0, 1].
gcvvchConfidence :: Lens' GoogleCloudVisionV1p1beta1CropHint (Maybe Double)
gcvvchConfidence
  = lens _gcvvchConfidence
      (\ s a -> s{_gcvvchConfidence = a})
      . mapping _Coerce

-- | Fraction of importance of this salient region with respect to the
-- original image.
gcvvchImportanceFraction :: Lens' GoogleCloudVisionV1p1beta1CropHint (Maybe Double)
gcvvchImportanceFraction
  = lens _gcvvchImportanceFraction
      (\ s a -> s{_gcvvchImportanceFraction = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p1beta1CropHint
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p1beta1CropHint"
              (\ o ->
                 GoogleCloudVisionV1p1beta1CropHint' <$>
                   (o .:? "boundingPoly") <*> (o .:? "confidence") <*>
                     (o .:? "importanceFraction"))

instance ToJSON GoogleCloudVisionV1p1beta1CropHint
         where
        toJSON GoogleCloudVisionV1p1beta1CropHint'{..}
          = object
              (catMaybes
                 [("boundingPoly" .=) <$> _gcvvchBoundingPoly,
                  ("confidence" .=) <$> _gcvvchConfidence,
                  ("importanceFraction" .=) <$>
                    _gcvvchImportanceFraction])

-- | Stores image properties, such as dominant colors.
--
-- /See:/ 'googleCloudVisionV1p2beta1ImageProperties' smart constructor.
newtype GoogleCloudVisionV1p2beta1ImageProperties = GoogleCloudVisionV1p2beta1ImageProperties'
    { _gcvvipDominantColors :: Maybe GoogleCloudVisionV1p2beta1DominantColorsAnnotation
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1ImageProperties' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvipDominantColors'
googleCloudVisionV1p2beta1ImageProperties
    :: GoogleCloudVisionV1p2beta1ImageProperties
googleCloudVisionV1p2beta1ImageProperties =
    GoogleCloudVisionV1p2beta1ImageProperties'
    { _gcvvipDominantColors = Nothing
    }

-- | If present, dominant colors completed successfully.
gcvvipDominantColors :: Lens' GoogleCloudVisionV1p2beta1ImageProperties (Maybe GoogleCloudVisionV1p2beta1DominantColorsAnnotation)
gcvvipDominantColors
  = lens _gcvvipDominantColors
      (\ s a -> s{_gcvvipDominantColors = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1ImageProperties where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1ImageProperties"
              (\ o ->
                 GoogleCloudVisionV1p2beta1ImageProperties' <$>
                   (o .:? "dominantColors"))

instance ToJSON
         GoogleCloudVisionV1p2beta1ImageProperties where
        toJSON GoogleCloudVisionV1p2beta1ImageProperties'{..}
          = object
              (catMaybes
                 [("dominantColors" .=) <$> _gcvvipDominantColors])

-- | Results for a product search request.
--
-- /See:/ 'googleCloudVisionV1p3beta1ProductSearchResults' smart constructor.
data GoogleCloudVisionV1p3beta1ProductSearchResults = GoogleCloudVisionV1p3beta1ProductSearchResults'
    { _gcvvpsrProductGroupedResults :: !(Maybe [GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult])
    , _gcvvpsrResults               :: !(Maybe [GoogleCloudVisionV1p3beta1ProductSearchResultsResult])
    , _gcvvpsrIndexTime             :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1ProductSearchResults' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpsrProductGroupedResults'
--
-- * 'gcvvpsrResults'
--
-- * 'gcvvpsrIndexTime'
googleCloudVisionV1p3beta1ProductSearchResults
    :: GoogleCloudVisionV1p3beta1ProductSearchResults
googleCloudVisionV1p3beta1ProductSearchResults =
    GoogleCloudVisionV1p3beta1ProductSearchResults'
    { _gcvvpsrProductGroupedResults = Nothing
    , _gcvvpsrResults = Nothing
    , _gcvvpsrIndexTime = Nothing
    }

-- | List of results grouped by products detected in the query image. Each
-- entry corresponds to one bounding polygon in the query image, and
-- contains the matching products specific to that region. There may be
-- duplicate product matches in the union of all the per-product results.
gcvvpsrProductGroupedResults :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResults [GoogleCloudVisionV1p3beta1ProductSearchResultsGroupedResult]
gcvvpsrProductGroupedResults
  = lens _gcvvpsrProductGroupedResults
      (\ s a -> s{_gcvvpsrProductGroupedResults = a})
      . _Default
      . _Coerce

-- | List of results, one for each product match.
gcvvpsrResults :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResults [GoogleCloudVisionV1p3beta1ProductSearchResultsResult]
gcvvpsrResults
  = lens _gcvvpsrResults
      (\ s a -> s{_gcvvpsrResults = a})
      . _Default
      . _Coerce

-- | Timestamp of the index which provided these results. Changes made after
-- this time are not reflected in the current results.
gcvvpsrIndexTime :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResults (Maybe UTCTime)
gcvvpsrIndexTime
  = lens _gcvvpsrIndexTime
      (\ s a -> s{_gcvvpsrIndexTime = a})
      . mapping _DateTime

instance FromJSON
         GoogleCloudVisionV1p3beta1ProductSearchResults where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1ProductSearchResults"
              (\ o ->
                 GoogleCloudVisionV1p3beta1ProductSearchResults' <$>
                   (o .:? "productGroupedResults" .!= mempty) <*>
                     (o .:? "results" .!= mempty)
                     <*> (o .:? "indexTime"))

instance ToJSON
         GoogleCloudVisionV1p3beta1ProductSearchResults where
        toJSON
          GoogleCloudVisionV1p3beta1ProductSearchResults'{..}
          = object
              (catMaybes
                 [("productGroupedResults" .=) <$>
                    _gcvvpsrProductGroupedResults,
                  ("results" .=) <$> _gcvvpsrResults,
                  ("indexTime" .=) <$> _gcvvpsrIndexTime])

-- | The desired output location and metadata.
--
-- /See:/ 'googleCloudVisionV1p2beta1OutputConfig' smart constructor.
data GoogleCloudVisionV1p2beta1OutputConfig = GoogleCloudVisionV1p2beta1OutputConfig'
    { _gGcsDestination :: !(Maybe GoogleCloudVisionV1p2beta1GcsDestination)
    , _gBatchSize      :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1OutputConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gGcsDestination'
--
-- * 'gBatchSize'
googleCloudVisionV1p2beta1OutputConfig
    :: GoogleCloudVisionV1p2beta1OutputConfig
googleCloudVisionV1p2beta1OutputConfig =
    GoogleCloudVisionV1p2beta1OutputConfig'
    { _gGcsDestination = Nothing
    , _gBatchSize = Nothing
    }

-- | The Google Cloud Storage location to write the output(s) to.
gGcsDestination :: Lens' GoogleCloudVisionV1p2beta1OutputConfig (Maybe GoogleCloudVisionV1p2beta1GcsDestination)
gGcsDestination
  = lens _gGcsDestination
      (\ s a -> s{_gGcsDestination = a})

-- | The max number of response protos to put into each output JSON file on
-- Google Cloud Storage. The valid range is [1, 100]. If not specified, the
-- default value is 20. For example, for one pdf file with 100 pages, 100
-- response protos will be generated. If \`batch_size\` = 20, then 5 json
-- files each containing 20 response protos will be written under the
-- prefix \`gcs_destination\`.\`uri\`. Currently, batch_size only applies
-- to GcsDestination, with potential future support for other output
-- configurations.
gBatchSize :: Lens' GoogleCloudVisionV1p2beta1OutputConfig (Maybe Int32)
gBatchSize
  = lens _gBatchSize (\ s a -> s{_gBatchSize = a}) .
      mapping _Coerce

instance FromJSON
         GoogleCloudVisionV1p2beta1OutputConfig where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1OutputConfig"
              (\ o ->
                 GoogleCloudVisionV1p2beta1OutputConfig' <$>
                   (o .:? "gcsDestination") <*> (o .:? "batchSize"))

instance ToJSON
         GoogleCloudVisionV1p2beta1OutputConfig where
        toJSON GoogleCloudVisionV1p2beta1OutputConfig'{..}
          = object
              (catMaybes
                 [("gcsDestination" .=) <$> _gGcsDestination,
                  ("batchSize" .=) <$> _gBatchSize])

-- | Detected language for a structural component.
--
-- /See:/ 'googleCloudVisionV1p1beta1TextAnnotationDetectedLanguage' smart constructor.
data GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage = GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage'
    { _gLanguageCode :: !(Maybe Text)
    , _gConfidence   :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gLanguageCode'
--
-- * 'gConfidence'
googleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
    :: GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
googleCloudVisionV1p1beta1TextAnnotationDetectedLanguage =
    GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage'
    { _gLanguageCode = Nothing
    , _gConfidence = Nothing
    }

-- | The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more
-- information, see
-- http:\/\/www.unicode.org\/reports\/tr35\/#Unicode_locale_identifier.
gLanguageCode :: Lens' GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage (Maybe Text)
gLanguageCode
  = lens _gLanguageCode
      (\ s a -> s{_gLanguageCode = a})

-- | Confidence of detected language. Range [0, 1].
gConfidence :: Lens' GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage (Maybe Double)
gConfidence
  = lens _gConfidence (\ s a -> s{_gConfidence = a}) .
      mapping _Coerce

instance FromJSON
         GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage"
              (\ o ->
                 GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage'
                   <$> (o .:? "languageCode") <*> (o .:? "confidence"))

instance ToJSON
         GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage
         where
        toJSON
          GoogleCloudVisionV1p1beta1TextAnnotationDetectedLanguage'{..}
          = object
              (catMaybes
                 [("languageCode" .=) <$> _gLanguageCode,
                  ("confidence" .=) <$> _gConfidence])

-- | A single symbol representation.
--
-- /See:/ 'googleCloudVisionV1p1beta1Symbol' smart constructor.
data GoogleCloudVisionV1p1beta1Symbol = GoogleCloudVisionV1p1beta1Symbol'
    { _gooProperty    :: !(Maybe GoogleCloudVisionV1p1beta1TextAnnotationTextProperty)
    , _gooBoundingBox :: !(Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
    , _gooText        :: !(Maybe Text)
    , _gooConfidence  :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1Symbol' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gooProperty'
--
-- * 'gooBoundingBox'
--
-- * 'gooText'
--
-- * 'gooConfidence'
googleCloudVisionV1p1beta1Symbol
    :: GoogleCloudVisionV1p1beta1Symbol
googleCloudVisionV1p1beta1Symbol =
    GoogleCloudVisionV1p1beta1Symbol'
    { _gooProperty = Nothing
    , _gooBoundingBox = Nothing
    , _gooText = Nothing
    , _gooConfidence = Nothing
    }

-- | Additional information detected for the symbol.
gooProperty :: Lens' GoogleCloudVisionV1p1beta1Symbol (Maybe GoogleCloudVisionV1p1beta1TextAnnotationTextProperty)
gooProperty
  = lens _gooProperty (\ s a -> s{_gooProperty = a})

-- | The bounding box for the symbol. The vertices are in the order of
-- top-left, top-right, bottom-right, bottom-left. When a rotation of the
-- bounding box is detected the rotation is represented as around the
-- top-left corner as defined when the text is read in the \'natural\'
-- orientation. For example: * when the text is horizontal it might look
-- like: 0----1 | | 3----2 * when it\'s rotated 180 degrees around the
-- top-left corner it becomes: 2----3 | | 1----0 and the vertice order will
-- still be (0, 1, 2, 3).
gooBoundingBox :: Lens' GoogleCloudVisionV1p1beta1Symbol (Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
gooBoundingBox
  = lens _gooBoundingBox
      (\ s a -> s{_gooBoundingBox = a})

-- | The actual UTF-8 representation of the symbol.
gooText :: Lens' GoogleCloudVisionV1p1beta1Symbol (Maybe Text)
gooText = lens _gooText (\ s a -> s{_gooText = a})

-- | Confidence of the OCR results for the symbol. Range [0, 1].
gooConfidence :: Lens' GoogleCloudVisionV1p1beta1Symbol (Maybe Double)
gooConfidence
  = lens _gooConfidence
      (\ s a -> s{_gooConfidence = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p1beta1Symbol
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p1beta1Symbol"
              (\ o ->
                 GoogleCloudVisionV1p1beta1Symbol' <$>
                   (o .:? "property") <*> (o .:? "boundingBox") <*>
                     (o .:? "text")
                     <*> (o .:? "confidence"))

instance ToJSON GoogleCloudVisionV1p1beta1Symbol
         where
        toJSON GoogleCloudVisionV1p1beta1Symbol'{..}
          = object
              (catMaybes
                 [("property" .=) <$> _gooProperty,
                  ("boundingBox" .=) <$> _gooBoundingBox,
                  ("text" .=) <$> _gooText,
                  ("confidence" .=) <$> _gooConfidence])

-- | If an image was produced from a file (e.g. a PDF), this message gives
-- information about the source of that image.
--
-- /See:/ 'imageAnnotationContext' smart constructor.
data ImageAnnotationContext = ImageAnnotationContext'
    { _iacURI        :: !(Maybe Text)
    , _iacPageNumber :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ImageAnnotationContext' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'iacURI'
--
-- * 'iacPageNumber'
imageAnnotationContext
    :: ImageAnnotationContext
imageAnnotationContext =
    ImageAnnotationContext'
    { _iacURI = Nothing
    , _iacPageNumber = Nothing
    }

-- | The URI of the file used to produce the image.
iacURI :: Lens' ImageAnnotationContext (Maybe Text)
iacURI = lens _iacURI (\ s a -> s{_iacURI = a})

-- | If the file was a PDF or TIFF, this field gives the page number within
-- the file used to produce the image.
iacPageNumber :: Lens' ImageAnnotationContext (Maybe Int32)
iacPageNumber
  = lens _iacPageNumber
      (\ s a -> s{_iacPageNumber = a})
      . mapping _Coerce

instance FromJSON ImageAnnotationContext where
        parseJSON
          = withObject "ImageAnnotationContext"
              (\ o ->
                 ImageAnnotationContext' <$>
                   (o .:? "uri") <*> (o .:? "pageNumber"))

instance ToJSON ImageAnnotationContext where
        toJSON ImageAnnotationContext'{..}
          = object
              (catMaybes
                 [("uri" .=) <$> _iacURI,
                  ("pageNumber" .=) <$> _iacPageNumber])

-- | Single crop hint that is used to generate a new crop when serving an
-- image.
--
-- /See:/ 'googleCloudVisionV1p2beta1CropHint' smart constructor.
data GoogleCloudVisionV1p2beta1CropHint = GoogleCloudVisionV1p2beta1CropHint'
    { _gcvvchcBoundingPoly       :: !(Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
    , _gcvvchcConfidence         :: !(Maybe (Textual Double))
    , _gcvvchcImportanceFraction :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1CropHint' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvchcBoundingPoly'
--
-- * 'gcvvchcConfidence'
--
-- * 'gcvvchcImportanceFraction'
googleCloudVisionV1p2beta1CropHint
    :: GoogleCloudVisionV1p2beta1CropHint
googleCloudVisionV1p2beta1CropHint =
    GoogleCloudVisionV1p2beta1CropHint'
    { _gcvvchcBoundingPoly = Nothing
    , _gcvvchcConfidence = Nothing
    , _gcvvchcImportanceFraction = Nothing
    }

-- | The bounding polygon for the crop region. The coordinates of the
-- bounding box are in the original image\'s scale, as returned in
-- \`ImageParams\`.
gcvvchcBoundingPoly :: Lens' GoogleCloudVisionV1p2beta1CropHint (Maybe GoogleCloudVisionV1p2beta1BoundingPoly)
gcvvchcBoundingPoly
  = lens _gcvvchcBoundingPoly
      (\ s a -> s{_gcvvchcBoundingPoly = a})

-- | Confidence of this being a salient region. Range [0, 1].
gcvvchcConfidence :: Lens' GoogleCloudVisionV1p2beta1CropHint (Maybe Double)
gcvvchcConfidence
  = lens _gcvvchcConfidence
      (\ s a -> s{_gcvvchcConfidence = a})
      . mapping _Coerce

-- | Fraction of importance of this salient region with respect to the
-- original image.
gcvvchcImportanceFraction :: Lens' GoogleCloudVisionV1p2beta1CropHint (Maybe Double)
gcvvchcImportanceFraction
  = lens _gcvvchcImportanceFraction
      (\ s a -> s{_gcvvchcImportanceFraction = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p2beta1CropHint
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1CropHint"
              (\ o ->
                 GoogleCloudVisionV1p2beta1CropHint' <$>
                   (o .:? "boundingPoly") <*> (o .:? "confidence") <*>
                     (o .:? "importanceFraction"))

instance ToJSON GoogleCloudVisionV1p2beta1CropHint
         where
        toJSON GoogleCloudVisionV1p2beta1CropHint'{..}
          = object
              (catMaybes
                 [("boundingPoly" .=) <$> _gcvvchcBoundingPoly,
                  ("confidence" .=) <$> _gcvvchcConfidence,
                  ("importanceFraction" .=) <$>
                    _gcvvchcImportanceFraction])

-- | A \`Property\` consists of a user-supplied name\/value pair.
--
-- /See:/ 'property' smart constructor.
data Property = Property'
    { _pUint64Value :: !(Maybe (Textual Word64))
    , _pValue       :: !(Maybe Text)
    , _pName        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Property' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pUint64Value'
--
-- * 'pValue'
--
-- * 'pName'
property
    :: Property
property =
    Property'
    { _pUint64Value = Nothing
    , _pValue = Nothing
    , _pName = Nothing
    }

-- | Value of numeric properties.
pUint64Value :: Lens' Property (Maybe Word64)
pUint64Value
  = lens _pUint64Value (\ s a -> s{_pUint64Value = a})
      . mapping _Coerce

-- | Value of the property.
pValue :: Lens' Property (Maybe Text)
pValue = lens _pValue (\ s a -> s{_pValue = a})

-- | Name of the property.
pName :: Lens' Property (Maybe Text)
pName = lens _pName (\ s a -> s{_pName = a})

instance FromJSON Property where
        parseJSON
          = withObject "Property"
              (\ o ->
                 Property' <$>
                   (o .:? "uint64Value") <*> (o .:? "value") <*>
                     (o .:? "name"))

instance ToJSON Property where
        toJSON Property'{..}
          = object
              (catMaybes
                 [("uint64Value" .=) <$> _pUint64Value,
                  ("value" .=) <$> _pValue, ("name" .=) <$> _pName])

-- | A face annotation object contains the results of face detection.
--
-- /See:/ 'googleCloudVisionV1p1beta1FaceAnnotation' smart constructor.
data GoogleCloudVisionV1p1beta1FaceAnnotation = GoogleCloudVisionV1p1beta1FaceAnnotation'
    { _gTiltAngle              :: !(Maybe (Textual Double))
    , _gBlurredLikelihood      :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationBlurredLikelihood)
    , _gBoundingPoly           :: !(Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
    , _gSurpriseLikelihood     :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationSurpriseLikelihood)
    , _gLandmarkingConfidence  :: !(Maybe (Textual Double))
    , _gPanAngle               :: !(Maybe (Textual Double))
    , _gRollAngle              :: !(Maybe (Textual Double))
    , _gUnderExposedLikelihood :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationUnderExposedLikelihood)
    , _gFdBoundingPoly         :: !(Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
    , _gAngerLikelihood        :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationAngerLikelihood)
    , _gDetectionConfidence    :: !(Maybe (Textual Double))
    , _gHeadwearLikelihood     :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationHeadwearLikelihood)
    , _gSorrowLikelihood       :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationSorrowLikelihood)
    , _gJoyLikelihood          :: !(Maybe GoogleCloudVisionV1p1beta1FaceAnnotationJoyLikelihood)
    , _gLandmarks              :: !(Maybe [GoogleCloudVisionV1p1beta1FaceAnnotationLandmark])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1FaceAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gTiltAngle'
--
-- * 'gBlurredLikelihood'
--
-- * 'gBoundingPoly'
--
-- * 'gSurpriseLikelihood'
--
-- * 'gLandmarkingConfidence'
--
-- * 'gPanAngle'
--
-- * 'gRollAngle'
--
-- * 'gUnderExposedLikelihood'
--
-- * 'gFdBoundingPoly'
--
-- * 'gAngerLikelihood'
--
-- * 'gDetectionConfidence'
--
-- * 'gHeadwearLikelihood'
--
-- * 'gSorrowLikelihood'
--
-- * 'gJoyLikelihood'
--
-- * 'gLandmarks'
googleCloudVisionV1p1beta1FaceAnnotation
    :: GoogleCloudVisionV1p1beta1FaceAnnotation
googleCloudVisionV1p1beta1FaceAnnotation =
    GoogleCloudVisionV1p1beta1FaceAnnotation'
    { _gTiltAngle = Nothing
    , _gBlurredLikelihood = Nothing
    , _gBoundingPoly = Nothing
    , _gSurpriseLikelihood = Nothing
    , _gLandmarkingConfidence = Nothing
    , _gPanAngle = Nothing
    , _gRollAngle = Nothing
    , _gUnderExposedLikelihood = Nothing
    , _gFdBoundingPoly = Nothing
    , _gAngerLikelihood = Nothing
    , _gDetectionConfidence = Nothing
    , _gHeadwearLikelihood = Nothing
    , _gSorrowLikelihood = Nothing
    , _gJoyLikelihood = Nothing
    , _gLandmarks = Nothing
    }

-- | Pitch angle, which indicates the upwards\/downwards angle that the face
-- is pointing relative to the image\'s horizontal plane. Range [-180,180].
gTiltAngle :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe Double)
gTiltAngle
  = lens _gTiltAngle (\ s a -> s{_gTiltAngle = a}) .
      mapping _Coerce

-- | Blurred likelihood.
gBlurredLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationBlurredLikelihood)
gBlurredLikelihood
  = lens _gBlurredLikelihood
      (\ s a -> s{_gBlurredLikelihood = a})

-- | The bounding polygon around the face. The coordinates of the bounding
-- box are in the original image\'s scale, as returned in \`ImageParams\`.
-- The bounding box is computed to \"frame\" the face in accordance with
-- human expectations. It is based on the landmarker results. Note that one
-- or more x and\/or y coordinates may not be generated in the
-- \`BoundingPoly\` (the polygon will be unbounded) if only a partial face
-- appears in the image to be annotated.
gBoundingPoly :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
gBoundingPoly
  = lens _gBoundingPoly
      (\ s a -> s{_gBoundingPoly = a})

-- | Surprise likelihood.
gSurpriseLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationSurpriseLikelihood)
gSurpriseLikelihood
  = lens _gSurpriseLikelihood
      (\ s a -> s{_gSurpriseLikelihood = a})

-- | Face landmarking confidence. Range [0, 1].
gLandmarkingConfidence :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe Double)
gLandmarkingConfidence
  = lens _gLandmarkingConfidence
      (\ s a -> s{_gLandmarkingConfidence = a})
      . mapping _Coerce

-- | Yaw angle, which indicates the leftward\/rightward angle that the face
-- is pointing relative to the vertical plane perpendicular to the image.
-- Range [-180,180].
gPanAngle :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe Double)
gPanAngle
  = lens _gPanAngle (\ s a -> s{_gPanAngle = a}) .
      mapping _Coerce

-- | Roll angle, which indicates the amount of clockwise\/anti-clockwise
-- rotation of the face relative to the image vertical about the axis
-- perpendicular to the face. Range [-180,180].
gRollAngle :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe Double)
gRollAngle
  = lens _gRollAngle (\ s a -> s{_gRollAngle = a}) .
      mapping _Coerce

-- | Under-exposed likelihood.
gUnderExposedLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationUnderExposedLikelihood)
gUnderExposedLikelihood
  = lens _gUnderExposedLikelihood
      (\ s a -> s{_gUnderExposedLikelihood = a})

-- | The \`fd_bounding_poly\` bounding polygon is tighter than the
-- \`boundingPoly\`, and encloses only the skin part of the face.
-- Typically, it is used to eliminate the face from any image analysis that
-- detects the \"amount of skin\" visible in an image. It is not based on
-- the landmarker results, only on the initial face detection, hence the
-- 'fd' (face detection) prefix.
gFdBoundingPoly :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1BoundingPoly)
gFdBoundingPoly
  = lens _gFdBoundingPoly
      (\ s a -> s{_gFdBoundingPoly = a})

-- | Anger likelihood.
gAngerLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationAngerLikelihood)
gAngerLikelihood
  = lens _gAngerLikelihood
      (\ s a -> s{_gAngerLikelihood = a})

-- | Detection confidence. Range [0, 1].
gDetectionConfidence :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe Double)
gDetectionConfidence
  = lens _gDetectionConfidence
      (\ s a -> s{_gDetectionConfidence = a})
      . mapping _Coerce

-- | Headwear likelihood.
gHeadwearLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationHeadwearLikelihood)
gHeadwearLikelihood
  = lens _gHeadwearLikelihood
      (\ s a -> s{_gHeadwearLikelihood = a})

-- | Sorrow likelihood.
gSorrowLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationSorrowLikelihood)
gSorrowLikelihood
  = lens _gSorrowLikelihood
      (\ s a -> s{_gSorrowLikelihood = a})

-- | Joy likelihood.
gJoyLikelihood :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation (Maybe GoogleCloudVisionV1p1beta1FaceAnnotationJoyLikelihood)
gJoyLikelihood
  = lens _gJoyLikelihood
      (\ s a -> s{_gJoyLikelihood = a})

-- | Detected face landmarks.
gLandmarks :: Lens' GoogleCloudVisionV1p1beta1FaceAnnotation [GoogleCloudVisionV1p1beta1FaceAnnotationLandmark]
gLandmarks
  = lens _gLandmarks (\ s a -> s{_gLandmarks = a}) .
      _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p1beta1FaceAnnotation where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1FaceAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p1beta1FaceAnnotation' <$>
                   (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
         GoogleCloudVisionV1p1beta1FaceAnnotation where
        toJSON GoogleCloudVisionV1p1beta1FaceAnnotation'{..}
          = object
              (catMaybes
                 [("tiltAngle" .=) <$> _gTiltAngle,
                  ("blurredLikelihood" .=) <$> _gBlurredLikelihood,
                  ("boundingPoly" .=) <$> _gBoundingPoly,
                  ("surpriseLikelihood" .=) <$> _gSurpriseLikelihood,
                  ("landmarkingConfidence" .=) <$>
                    _gLandmarkingConfidence,
                  ("panAngle" .=) <$> _gPanAngle,
                  ("rollAngle" .=) <$> _gRollAngle,
                  ("underExposedLikelihood" .=) <$>
                    _gUnderExposedLikelihood,
                  ("fdBoundingPoly" .=) <$> _gFdBoundingPoly,
                  ("angerLikelihood" .=) <$> _gAngerLikelihood,
                  ("detectionConfidence" .=) <$> _gDetectionConfidence,
                  ("headwearLikelihood" .=) <$> _gHeadwearLikelihood,
                  ("sorrowLikelihood" .=) <$> _gSorrowLikelihood,
                  ("joyLikelihood" .=) <$> _gJoyLikelihood,
                  ("landmarks" .=) <$> _gLandmarks])

-- | The desired input location and metadata.
--
-- /See:/ 'googleCloudVisionV1p3beta1InputConfig' smart constructor.
data GoogleCloudVisionV1p3beta1InputConfig = GoogleCloudVisionV1p3beta1InputConfig'
    { _gcvvicGcsSource :: !(Maybe GoogleCloudVisionV1p3beta1GcsSource)
    , _gcvvicMimeType  :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1InputConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvicGcsSource'
--
-- * 'gcvvicMimeType'
googleCloudVisionV1p3beta1InputConfig
    :: GoogleCloudVisionV1p3beta1InputConfig
googleCloudVisionV1p3beta1InputConfig =
    GoogleCloudVisionV1p3beta1InputConfig'
    { _gcvvicGcsSource = Nothing
    , _gcvvicMimeType = Nothing
    }

-- | The Google Cloud Storage location to read the input from.
gcvvicGcsSource :: Lens' GoogleCloudVisionV1p3beta1InputConfig (Maybe GoogleCloudVisionV1p3beta1GcsSource)
gcvvicGcsSource
  = lens _gcvvicGcsSource
      (\ s a -> s{_gcvvicGcsSource = a})

-- | The type of the file. Currently only \"application\/pdf\" and
-- \"image\/tiff\" are supported. Wildcards are not supported.
gcvvicMimeType :: Lens' GoogleCloudVisionV1p3beta1InputConfig (Maybe Text)
gcvvicMimeType
  = lens _gcvvicMimeType
      (\ s a -> s{_gcvvicMimeType = a})

instance FromJSON
         GoogleCloudVisionV1p3beta1InputConfig where
        parseJSON
          = withObject "GoogleCloudVisionV1p3beta1InputConfig"
              (\ o ->
                 GoogleCloudVisionV1p3beta1InputConfig' <$>
                   (o .:? "gcsSource") <*> (o .:? "mimeType"))

instance ToJSON GoogleCloudVisionV1p3beta1InputConfig
         where
        toJSON GoogleCloudVisionV1p3beta1InputConfig'{..}
          = object
              (catMaybes
                 [("gcsSource" .=) <$> _gcvvicGcsSource,
                  ("mimeType" .=) <$> _gcvvicMimeType])

-- | Metadata for web pages.
--
-- /See:/ 'googleCloudVisionV1p3beta1WebDetectionWebPage' smart constructor.
data GoogleCloudVisionV1p3beta1WebDetectionWebPage = GoogleCloudVisionV1p3beta1WebDetectionWebPage'
    { _gcvvwdwpScore                 :: !(Maybe (Textual Double))
    , _gcvvwdwpURL                   :: !(Maybe Text)
    , _gcvvwdwpPageTitle             :: !(Maybe Text)
    , _gcvvwdwpPartialMatchingImages :: !(Maybe [GoogleCloudVisionV1p3beta1WebDetectionWebImage])
    , _gcvvwdwpFullMatchingImages    :: !(Maybe [GoogleCloudVisionV1p3beta1WebDetectionWebImage])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1WebDetectionWebPage' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvwdwpScore'
--
-- * 'gcvvwdwpURL'
--
-- * 'gcvvwdwpPageTitle'
--
-- * 'gcvvwdwpPartialMatchingImages'
--
-- * 'gcvvwdwpFullMatchingImages'
googleCloudVisionV1p3beta1WebDetectionWebPage
    :: GoogleCloudVisionV1p3beta1WebDetectionWebPage
googleCloudVisionV1p3beta1WebDetectionWebPage =
    GoogleCloudVisionV1p3beta1WebDetectionWebPage'
    { _gcvvwdwpScore = Nothing
    , _gcvvwdwpURL = Nothing
    , _gcvvwdwpPageTitle = Nothing
    , _gcvvwdwpPartialMatchingImages = Nothing
    , _gcvvwdwpFullMatchingImages = Nothing
    }

-- | (Deprecated) Overall relevancy score for the web page.
gcvvwdwpScore :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebPage (Maybe Double)
gcvvwdwpScore
  = lens _gcvvwdwpScore
      (\ s a -> s{_gcvvwdwpScore = a})
      . mapping _Coerce

-- | The result web page URL.
gcvvwdwpURL :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebPage (Maybe Text)
gcvvwdwpURL
  = lens _gcvvwdwpURL (\ s a -> s{_gcvvwdwpURL = a})

-- | Title for the web page, may contain HTML markups.
gcvvwdwpPageTitle :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebPage (Maybe Text)
gcvvwdwpPageTitle
  = lens _gcvvwdwpPageTitle
      (\ s a -> s{_gcvvwdwpPageTitle = a})

-- | Partial matching images on the page. Those images are similar enough to
-- share some key-point features. For example an original image will likely
-- have partial matching for its crops.
gcvvwdwpPartialMatchingImages :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebPage [GoogleCloudVisionV1p3beta1WebDetectionWebImage]
gcvvwdwpPartialMatchingImages
  = lens _gcvvwdwpPartialMatchingImages
      (\ s a -> s{_gcvvwdwpPartialMatchingImages = a})
      . _Default
      . _Coerce

-- | Fully matching images on the page. Can include resized copies of the
-- query image.
gcvvwdwpFullMatchingImages :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebPage [GoogleCloudVisionV1p3beta1WebDetectionWebImage]
gcvvwdwpFullMatchingImages
  = lens _gcvvwdwpFullMatchingImages
      (\ s a -> s{_gcvvwdwpFullMatchingImages = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p3beta1WebDetectionWebPage where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1WebDetectionWebPage"
              (\ o ->
                 GoogleCloudVisionV1p3beta1WebDetectionWebPage' <$>
                   (o .:? "score") <*> (o .:? "url") <*>
                     (o .:? "pageTitle")
                     <*> (o .:? "partialMatchingImages" .!= mempty)
                     <*> (o .:? "fullMatchingImages" .!= mempty))

instance ToJSON
         GoogleCloudVisionV1p3beta1WebDetectionWebPage where
        toJSON
          GoogleCloudVisionV1p3beta1WebDetectionWebPage'{..}
          = object
              (catMaybes
                 [("score" .=) <$> _gcvvwdwpScore,
                  ("url" .=) <$> _gcvvwdwpURL,
                  ("pageTitle" .=) <$> _gcvvwdwpPageTitle,
                  ("partialMatchingImages" .=) <$>
                    _gcvvwdwpPartialMatchingImages,
                  ("fullMatchingImages" .=) <$>
                    _gcvvwdwpFullMatchingImages])

-- | Results for a product search request.
--
-- /See:/ 'productSearchResults' smart constructor.
data ProductSearchResults = ProductSearchResults'
    { _psrProductGroupedResults :: !(Maybe [GroupedResult])
    , _psrResults               :: !(Maybe [Result])
    , _psrIndexTime             :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'ProductSearchResults' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'psrProductGroupedResults'
--
-- * 'psrResults'
--
-- * 'psrIndexTime'
productSearchResults
    :: ProductSearchResults
productSearchResults =
    ProductSearchResults'
    { _psrProductGroupedResults = Nothing
    , _psrResults = Nothing
    , _psrIndexTime = Nothing
    }

-- | List of results grouped by products detected in the query image. Each
-- entry corresponds to one bounding polygon in the query image, and
-- contains the matching products specific to that region. There may be
-- duplicate product matches in the union of all the per-product results.
psrProductGroupedResults :: Lens' ProductSearchResults [GroupedResult]
psrProductGroupedResults
  = lens _psrProductGroupedResults
      (\ s a -> s{_psrProductGroupedResults = a})
      . _Default
      . _Coerce

-- | List of results, one for each product match.
psrResults :: Lens' ProductSearchResults [Result]
psrResults
  = lens _psrResults (\ s a -> s{_psrResults = a}) .
      _Default
      . _Coerce

-- | Timestamp of the index which provided these results. Changes made after
-- this time are not reflected in the current results.
psrIndexTime :: Lens' ProductSearchResults (Maybe UTCTime)
psrIndexTime
  = lens _psrIndexTime (\ s a -> s{_psrIndexTime = a})
      . mapping _DateTime

instance FromJSON ProductSearchResults where
        parseJSON
          = withObject "ProductSearchResults"
              (\ o ->
                 ProductSearchResults' <$>
                   (o .:? "productGroupedResults" .!= mempty) <*>
                     (o .:? "results" .!= mempty)
                     <*> (o .:? "indexTime"))

instance ToJSON ProductSearchResults where
        toJSON ProductSearchResults'{..}
          = object
              (catMaybes
                 [("productGroupedResults" .=) <$>
                    _psrProductGroupedResults,
                  ("results" .=) <$> _psrResults,
                  ("indexTime" .=) <$> _psrIndexTime])

-- | A face-specific landmark (for example, a face feature).
--
-- /See:/ 'landmark' smart constructor.
data Landmark = Landmark'
    { _lType     :: !(Maybe LandmarkType)
    , _lPosition :: !(Maybe Position)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Landmark' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lType'
--
-- * 'lPosition'
landmark
    :: Landmark
landmark =
    Landmark'
    { _lType = Nothing
    , _lPosition = Nothing
    }

-- | Face landmark type.
lType :: Lens' Landmark (Maybe LandmarkType)
lType = lens _lType (\ s a -> s{_lType = a})

-- | Face landmark position.
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])

-- | Set of features pertaining to the image, computed by computer vision
-- methods over safe-search verticals (for example, adult, spoof, medical,
-- violence).
--
-- /See:/ 'googleCloudVisionV1p2beta1SafeSearchAnnotation' smart constructor.
data GoogleCloudVisionV1p2beta1SafeSearchAnnotation = GoogleCloudVisionV1p2beta1SafeSearchAnnotation'
    { _gcvvssaSpoof    :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationSpoof)
    , _gcvvssaRacy     :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationRacy)
    , _gcvvssaAdult    :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationAdult)
    , _gcvvssaMedical  :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationMedical)
    , _gcvvssaViolence :: !(Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationViolence)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1SafeSearchAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvssaSpoof'
--
-- * 'gcvvssaRacy'
--
-- * 'gcvvssaAdult'
--
-- * 'gcvvssaMedical'
--
-- * 'gcvvssaViolence'
googleCloudVisionV1p2beta1SafeSearchAnnotation
    :: GoogleCloudVisionV1p2beta1SafeSearchAnnotation
googleCloudVisionV1p2beta1SafeSearchAnnotation =
    GoogleCloudVisionV1p2beta1SafeSearchAnnotation'
    { _gcvvssaSpoof = Nothing
    , _gcvvssaRacy = Nothing
    , _gcvvssaAdult = Nothing
    , _gcvvssaMedical = Nothing
    , _gcvvssaViolence = Nothing
    }

-- | Spoof likelihood. The likelihood that an modification was made to the
-- image\'s canonical version to make it appear funny or offensive.
gcvvssaSpoof :: Lens' GoogleCloudVisionV1p2beta1SafeSearchAnnotation (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationSpoof)
gcvvssaSpoof
  = lens _gcvvssaSpoof (\ s a -> s{_gcvvssaSpoof = a})

-- | Likelihood that the request image contains racy content. Racy content
-- may include (but is not limited to) skimpy or sheer clothing,
-- strategically covered nudity, lewd or provocative poses, or close-ups of
-- sensitive body areas.
gcvvssaRacy :: Lens' GoogleCloudVisionV1p2beta1SafeSearchAnnotation (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationRacy)
gcvvssaRacy
  = lens _gcvvssaRacy (\ s a -> s{_gcvvssaRacy = a})

-- | Represents the adult content likelihood for the image. Adult content may
-- contain elements such as nudity, pornographic images or cartoons, or
-- sexual activities.
gcvvssaAdult :: Lens' GoogleCloudVisionV1p2beta1SafeSearchAnnotation (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationAdult)
gcvvssaAdult
  = lens _gcvvssaAdult (\ s a -> s{_gcvvssaAdult = a})

-- | Likelihood that this is a medical image.
gcvvssaMedical :: Lens' GoogleCloudVisionV1p2beta1SafeSearchAnnotation (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationMedical)
gcvvssaMedical
  = lens _gcvvssaMedical
      (\ s a -> s{_gcvvssaMedical = a})

-- | Likelihood that this image contains violent content.
gcvvssaViolence :: Lens' GoogleCloudVisionV1p2beta1SafeSearchAnnotation (Maybe GoogleCloudVisionV1p2beta1SafeSearchAnnotationViolence)
gcvvssaViolence
  = lens _gcvvssaViolence
      (\ s a -> s{_gcvvssaViolence = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1SafeSearchAnnotation where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1SafeSearchAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p2beta1SafeSearchAnnotation' <$>
                   (o .:? "spoof") <*> (o .:? "racy") <*>
                     (o .:? "adult")
                     <*> (o .:? "medical")
                     <*> (o .:? "violence"))

instance ToJSON
         GoogleCloudVisionV1p2beta1SafeSearchAnnotation where
        toJSON
          GoogleCloudVisionV1p2beta1SafeSearchAnnotation'{..}
          = object
              (catMaybes
                 [("spoof" .=) <$> _gcvvssaSpoof,
                  ("racy" .=) <$> _gcvvssaRacy,
                  ("adult" .=) <$> _gcvvssaAdult,
                  ("medical" .=) <$> _gcvvssaMedical,
                  ("violence" .=) <$> _gcvvssaViolence])

-- | Contains metadata for the BatchAnnotateImages operation.
--
-- /See:/ 'googleCloudVisionV1p2beta1OperationMetadata' smart constructor.
data GoogleCloudVisionV1p2beta1OperationMetadata = GoogleCloudVisionV1p2beta1OperationMetadata'
    { _gcvvomState      :: !(Maybe GoogleCloudVisionV1p2beta1OperationMetadataState)
    , _gcvvomUpdateTime :: !(Maybe DateTime')
    , _gcvvomCreateTime :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1OperationMetadata' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvomState'
--
-- * 'gcvvomUpdateTime'
--
-- * 'gcvvomCreateTime'
googleCloudVisionV1p2beta1OperationMetadata
    :: GoogleCloudVisionV1p2beta1OperationMetadata
googleCloudVisionV1p2beta1OperationMetadata =
    GoogleCloudVisionV1p2beta1OperationMetadata'
    { _gcvvomState = Nothing
    , _gcvvomUpdateTime = Nothing
    , _gcvvomCreateTime = Nothing
    }

-- | Current state of the batch operation.
gcvvomState :: Lens' GoogleCloudVisionV1p2beta1OperationMetadata (Maybe GoogleCloudVisionV1p2beta1OperationMetadataState)
gcvvomState
  = lens _gcvvomState (\ s a -> s{_gcvvomState = a})

-- | The time when the operation result was last updated.
gcvvomUpdateTime :: Lens' GoogleCloudVisionV1p2beta1OperationMetadata (Maybe UTCTime)
gcvvomUpdateTime
  = lens _gcvvomUpdateTime
      (\ s a -> s{_gcvvomUpdateTime = a})
      . mapping _DateTime

-- | The time when the batch request was received.
gcvvomCreateTime :: Lens' GoogleCloudVisionV1p2beta1OperationMetadata (Maybe UTCTime)
gcvvomCreateTime
  = lens _gcvvomCreateTime
      (\ s a -> s{_gcvvomCreateTime = a})
      . mapping _DateTime

instance FromJSON
         GoogleCloudVisionV1p2beta1OperationMetadata where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1OperationMetadata"
              (\ o ->
                 GoogleCloudVisionV1p2beta1OperationMetadata' <$>
                   (o .:? "state") <*> (o .:? "updateTime") <*>
                     (o .:? "createTime"))

instance ToJSON
         GoogleCloudVisionV1p2beta1OperationMetadata where
        toJSON
          GoogleCloudVisionV1p2beta1OperationMetadata'{..}
          = object
              (catMaybes
                 [("state" .=) <$> _gcvvomState,
                  ("updateTime" .=) <$> _gcvvomUpdateTime,
                  ("createTime" .=) <$> _gcvvomCreateTime])

-- | Set of crop hints that are used to generate new crops when serving
-- images.
--
-- /See:/ 'googleCloudVisionV1p3beta1CropHintsAnnotation' smart constructor.
newtype GoogleCloudVisionV1p3beta1CropHintsAnnotation = GoogleCloudVisionV1p3beta1CropHintsAnnotation'
    { _gcvvchaCropHints :: Maybe [GoogleCloudVisionV1p3beta1CropHint]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1CropHintsAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvchaCropHints'
googleCloudVisionV1p3beta1CropHintsAnnotation
    :: GoogleCloudVisionV1p3beta1CropHintsAnnotation
googleCloudVisionV1p3beta1CropHintsAnnotation =
    GoogleCloudVisionV1p3beta1CropHintsAnnotation'
    { _gcvvchaCropHints = Nothing
    }

-- | Crop hint results.
gcvvchaCropHints :: Lens' GoogleCloudVisionV1p3beta1CropHintsAnnotation [GoogleCloudVisionV1p3beta1CropHint]
gcvvchaCropHints
  = lens _gcvvchaCropHints
      (\ s a -> s{_gcvvchaCropHints = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p3beta1CropHintsAnnotation where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1CropHintsAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p3beta1CropHintsAnnotation' <$>
                   (o .:? "cropHints" .!= mempty))

instance ToJSON
         GoogleCloudVisionV1p3beta1CropHintsAnnotation where
        toJSON
          GoogleCloudVisionV1p3beta1CropHintsAnnotation'{..}
          = object
              (catMaybes [("cropHints" .=) <$> _gcvvchaCropHints])

-- | Color information consists of RGB channels, score, and the fraction of
-- the image that the color occupies in the image.
--
-- /See:/ 'googleCloudVisionV1p1beta1ColorInfo' smart constructor.
data GoogleCloudVisionV1p1beta1ColorInfo = GoogleCloudVisionV1p1beta1ColorInfo'
    { _gcvvciColor         :: !(Maybe Color)
    , _gcvvciScore         :: !(Maybe (Textual Double))
    , _gcvvciPixelFraction :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1ColorInfo' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvciColor'
--
-- * 'gcvvciScore'
--
-- * 'gcvvciPixelFraction'
googleCloudVisionV1p1beta1ColorInfo
    :: GoogleCloudVisionV1p1beta1ColorInfo
googleCloudVisionV1p1beta1ColorInfo =
    GoogleCloudVisionV1p1beta1ColorInfo'
    { _gcvvciColor = Nothing
    , _gcvvciScore = Nothing
    , _gcvvciPixelFraction = Nothing
    }

-- | RGB components of the color.
gcvvciColor :: Lens' GoogleCloudVisionV1p1beta1ColorInfo (Maybe Color)
gcvvciColor
  = lens _gcvvciColor (\ s a -> s{_gcvvciColor = a})

-- | Image-specific score for this color. Value in range [0, 1].
gcvvciScore :: Lens' GoogleCloudVisionV1p1beta1ColorInfo (Maybe Double)
gcvvciScore
  = lens _gcvvciScore (\ s a -> s{_gcvvciScore = a}) .
      mapping _Coerce

-- | The fraction of pixels the color occupies in the image. Value in range
-- [0, 1].
gcvvciPixelFraction :: Lens' GoogleCloudVisionV1p1beta1ColorInfo (Maybe Double)
gcvvciPixelFraction
  = lens _gcvvciPixelFraction
      (\ s a -> s{_gcvvciPixelFraction = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p1beta1ColorInfo
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p1beta1ColorInfo"
              (\ o ->
                 GoogleCloudVisionV1p1beta1ColorInfo' <$>
                   (o .:? "color") <*> (o .:? "score") <*>
                     (o .:? "pixelFraction"))

instance ToJSON GoogleCloudVisionV1p1beta1ColorInfo
         where
        toJSON GoogleCloudVisionV1p1beta1ColorInfo'{..}
          = object
              (catMaybes
                 [("color" .=) <$> _gcvvciColor,
                  ("score" .=) <$> _gcvvciScore,
                  ("pixelFraction" .=) <$> _gcvvciPixelFraction])

-- | The Google Cloud Storage location where the input will be read from.
--
-- /See:/ 'gcsSource' smart constructor.
newtype GcsSource = GcsSource'
    { _gsURI :: Maybe Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GcsSource' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gsURI'
gcsSource
    :: GcsSource
gcsSource =
    GcsSource'
    { _gsURI = Nothing
    }

-- | Google Cloud Storage URI for the input file. This must only be a Google
-- Cloud Storage object. Wildcards are not currently supported.
gsURI :: Lens' GcsSource (Maybe Text)
gsURI = lens _gsURI (\ s a -> s{_gsURI = a})

instance FromJSON GcsSource where
        parseJSON
          = withObject "GcsSource"
              (\ o -> GcsSource' <$> (o .:? "uri"))

instance ToJSON GcsSource where
        toJSON GcsSource'{..}
          = object (catMaybes [("uri" .=) <$> _gsURI])

-- | Detected start or end of a structural component.
--
-- /See:/ 'googleCloudVisionV1p1beta1TextAnnotationDetectedBreak' smart constructor.
data GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak = GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak'
    { _gcvvtadbIsPrefix :: !(Maybe Bool)
    , _gcvvtadbType     :: !(Maybe GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreakType)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvtadbIsPrefix'
--
-- * 'gcvvtadbType'
googleCloudVisionV1p1beta1TextAnnotationDetectedBreak
    :: GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
googleCloudVisionV1p1beta1TextAnnotationDetectedBreak =
    GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak'
    { _gcvvtadbIsPrefix = Nothing
    , _gcvvtadbType = Nothing
    }

-- | True if break prepends the element.
gcvvtadbIsPrefix :: Lens' GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak (Maybe Bool)
gcvvtadbIsPrefix
  = lens _gcvvtadbIsPrefix
      (\ s a -> s{_gcvvtadbIsPrefix = a})

-- | Detected break type.
gcvvtadbType :: Lens' GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak (Maybe GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreakType)
gcvvtadbType
  = lens _gcvvtadbType (\ s a -> s{_gcvvtadbType = a})

instance FromJSON
         GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak"
              (\ o ->
                 GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak'
                   <$> (o .:? "isPrefix") <*> (o .:? "type"))

instance ToJSON
         GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak
         where
        toJSON
          GoogleCloudVisionV1p1beta1TextAnnotationDetectedBreak'{..}
          = object
              (catMaybes
                 [("isPrefix" .=) <$> _gcvvtadbIsPrefix,
                  ("type" .=) <$> _gcvvtadbType])

-- | Set of dominant colors and their corresponding scores.
--
-- /See:/ 'googleCloudVisionV1p1beta1DominantColorsAnnotation' smart constructor.
newtype GoogleCloudVisionV1p1beta1DominantColorsAnnotation = GoogleCloudVisionV1p1beta1DominantColorsAnnotation'
    { _gcvvdcaColors :: Maybe [GoogleCloudVisionV1p1beta1ColorInfo]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1DominantColorsAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvdcaColors'
googleCloudVisionV1p1beta1DominantColorsAnnotation
    :: GoogleCloudVisionV1p1beta1DominantColorsAnnotation
googleCloudVisionV1p1beta1DominantColorsAnnotation =
    GoogleCloudVisionV1p1beta1DominantColorsAnnotation'
    { _gcvvdcaColors = Nothing
    }

-- | RGB color values with their score and pixel fraction.
gcvvdcaColors :: Lens' GoogleCloudVisionV1p1beta1DominantColorsAnnotation [GoogleCloudVisionV1p1beta1ColorInfo]
gcvvdcaColors
  = lens _gcvvdcaColors
      (\ s a -> s{_gcvvdcaColors = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p1beta1DominantColorsAnnotation
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1DominantColorsAnnotation"
              (\ o ->
                 GoogleCloudVisionV1p1beta1DominantColorsAnnotation'
                   <$> (o .:? "colors" .!= mempty))

instance ToJSON
         GoogleCloudVisionV1p1beta1DominantColorsAnnotation
         where
        toJSON
          GoogleCloudVisionV1p1beta1DominantColorsAnnotation'{..}
          = object
              (catMaybes [("colors" .=) <$> _gcvvdcaColors])

-- | Label to provide extra metadata for the web detection.
--
-- /See:/ 'googleCloudVisionV1p3beta1WebDetectionWebLabel' smart constructor.
data GoogleCloudVisionV1p3beta1WebDetectionWebLabel = GoogleCloudVisionV1p3beta1WebDetectionWebLabel'
    { _gcvvwdwlLanguageCode :: !(Maybe Text)
    , _gcvvwdwlLabel        :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1WebDetectionWebLabel' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvwdwlLanguageCode'
--
-- * 'gcvvwdwlLabel'
googleCloudVisionV1p3beta1WebDetectionWebLabel
    :: GoogleCloudVisionV1p3beta1WebDetectionWebLabel
googleCloudVisionV1p3beta1WebDetectionWebLabel =
    GoogleCloudVisionV1p3beta1WebDetectionWebLabel'
    { _gcvvwdwlLanguageCode = Nothing
    , _gcvvwdwlLabel = Nothing
    }

-- | The BCP-47 language code for \`label\`, such as \"en-US\" or
-- \"sr-Latn\". For more information, see
-- http:\/\/www.unicode.org\/reports\/tr35\/#Unicode_locale_identifier.
gcvvwdwlLanguageCode :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebLabel (Maybe Text)
gcvvwdwlLanguageCode
  = lens _gcvvwdwlLanguageCode
      (\ s a -> s{_gcvvwdwlLanguageCode = a})

-- | Label for extra metadata.
gcvvwdwlLabel :: Lens' GoogleCloudVisionV1p3beta1WebDetectionWebLabel (Maybe Text)
gcvvwdwlLabel
  = lens _gcvvwdwlLabel
      (\ s a -> s{_gcvvwdwlLabel = a})

instance FromJSON
         GoogleCloudVisionV1p3beta1WebDetectionWebLabel where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1WebDetectionWebLabel"
              (\ o ->
                 GoogleCloudVisionV1p3beta1WebDetectionWebLabel' <$>
                   (o .:? "languageCode") <*> (o .:? "label"))

instance ToJSON
         GoogleCloudVisionV1p3beta1WebDetectionWebLabel where
        toJSON
          GoogleCloudVisionV1p3beta1WebDetectionWebLabel'{..}
          = object
              (catMaybes
                 [("languageCode" .=) <$> _gcvvwdwlLanguageCode,
                  ("label" .=) <$> _gcvvwdwlLabel])

-- | Image context and\/or feature-specific parameters.
--
-- /See:/ 'googleCloudVisionV1p2beta1ImageContext' smart constructor.
data GoogleCloudVisionV1p2beta1ImageContext = GoogleCloudVisionV1p2beta1ImageContext'
    { _gcvvicCropHintsParams     :: !(Maybe GoogleCloudVisionV1p2beta1CropHintsParams)
    , _gcvvicWebDetectionParams  :: !(Maybe GoogleCloudVisionV1p2beta1WebDetectionParams)
    , _gcvvicProductSearchParams :: !(Maybe GoogleCloudVisionV1p2beta1ProductSearchParams)
    , _gcvvicLanguageHints       :: !(Maybe [Text])
    , _gcvvicLatLongRect         :: !(Maybe GoogleCloudVisionV1p2beta1LatLongRect)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1ImageContext' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvicCropHintsParams'
--
-- * 'gcvvicWebDetectionParams'
--
-- * 'gcvvicProductSearchParams'
--
-- * 'gcvvicLanguageHints'
--
-- * 'gcvvicLatLongRect'
googleCloudVisionV1p2beta1ImageContext
    :: GoogleCloudVisionV1p2beta1ImageContext
googleCloudVisionV1p2beta1ImageContext =
    GoogleCloudVisionV1p2beta1ImageContext'
    { _gcvvicCropHintsParams = Nothing
    , _gcvvicWebDetectionParams = Nothing
    , _gcvvicProductSearchParams = Nothing
    , _gcvvicLanguageHints = Nothing
    , _gcvvicLatLongRect = Nothing
    }

-- | Parameters for crop hints annotation request.
gcvvicCropHintsParams :: Lens' GoogleCloudVisionV1p2beta1ImageContext (Maybe GoogleCloudVisionV1p2beta1CropHintsParams)
gcvvicCropHintsParams
  = lens _gcvvicCropHintsParams
      (\ s a -> s{_gcvvicCropHintsParams = a})

-- | Parameters for web detection.
gcvvicWebDetectionParams :: Lens' GoogleCloudVisionV1p2beta1ImageContext (Maybe GoogleCloudVisionV1p2beta1WebDetectionParams)
gcvvicWebDetectionParams
  = lens _gcvvicWebDetectionParams
      (\ s a -> s{_gcvvicWebDetectionParams = a})

-- | Parameters for product search.
gcvvicProductSearchParams :: Lens' GoogleCloudVisionV1p2beta1ImageContext (Maybe GoogleCloudVisionV1p2beta1ProductSearchParams)
gcvvicProductSearchParams
  = lens _gcvvicProductSearchParams
      (\ s a -> s{_gcvvicProductSearchParams = a})

-- | List of languages to use for TEXT_DETECTION. In most cases, an empty
-- value yields the best results since it enables automatic language
-- detection. For languages based on the Latin alphabet, setting
-- \`language_hints\` is not needed. In rare cases, when the language of
-- the text in the image is known, setting a hint will help get better
-- results (although it will be a significant hindrance if the hint is
-- wrong). Text detection returns an error if one or more of the specified
-- languages is not one of the [supported
-- languages](\/vision\/docs\/languages).
gcvvicLanguageHints :: Lens' GoogleCloudVisionV1p2beta1ImageContext [Text]
gcvvicLanguageHints
  = lens _gcvvicLanguageHints
      (\ s a -> s{_gcvvicLanguageHints = a})
      . _Default
      . _Coerce

-- | Not used.
gcvvicLatLongRect :: Lens' GoogleCloudVisionV1p2beta1ImageContext (Maybe GoogleCloudVisionV1p2beta1LatLongRect)
gcvvicLatLongRect
  = lens _gcvvicLatLongRect
      (\ s a -> s{_gcvvicLatLongRect = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1ImageContext where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1ImageContext"
              (\ o ->
                 GoogleCloudVisionV1p2beta1ImageContext' <$>
                   (o .:? "cropHintsParams") <*>
                     (o .:? "webDetectionParams")
                     <*> (o .:? "productSearchParams")
                     <*> (o .:? "languageHints" .!= mempty)
                     <*> (o .:? "latLongRect"))

instance ToJSON
         GoogleCloudVisionV1p2beta1ImageContext where
        toJSON GoogleCloudVisionV1p2beta1ImageContext'{..}
          = object
              (catMaybes
                 [("cropHintsParams" .=) <$> _gcvvicCropHintsParams,
                  ("webDetectionParams" .=) <$>
                    _gcvvicWebDetectionParams,
                  ("productSearchParams" .=) <$>
                    _gcvvicProductSearchParams,
                  ("languageHints" .=) <$> _gcvvicLanguageHints,
                  ("latLongRect" .=) <$> _gcvvicLatLongRect])

-- | Additional information detected on the structural component.
--
-- /See:/ 'textProperty' smart constructor.
data TextProperty = TextProperty'
    { _tpDetectedLanguages :: !(Maybe [DetectedLanguage])
    , _tpDetectedBreak     :: !(Maybe DetectedBreak)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'TextProperty' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'tpDetectedLanguages'
--
-- * 'tpDetectedBreak'
textProperty
    :: TextProperty
textProperty =
    TextProperty'
    { _tpDetectedLanguages = Nothing
    , _tpDetectedBreak = Nothing
    }

-- | A list of detected languages together with confidence.
tpDetectedLanguages :: Lens' TextProperty [DetectedLanguage]
tpDetectedLanguages
  = lens _tpDetectedLanguages
      (\ s a -> s{_tpDetectedLanguages = a})
      . _Default
      . _Coerce

-- | Detected start or end of a text segment.
tpDetectedBreak :: Lens' TextProperty (Maybe DetectedBreak)
tpDetectedBreak
  = lens _tpDetectedBreak
      (\ s a -> s{_tpDetectedBreak = a})

instance FromJSON TextProperty where
        parseJSON
          = withObject "TextProperty"
              (\ o ->
                 TextProperty' <$>
                   (o .:? "detectedLanguages" .!= mempty) <*>
                     (o .:? "detectedBreak"))

instance ToJSON TextProperty where
        toJSON TextProperty'{..}
          = object
              (catMaybes
                 [("detectedLanguages" .=) <$> _tpDetectedLanguages,
                  ("detectedBreak" .=) <$> _tpDetectedBreak])

-- | TextAnnotation contains a structured representation of OCR extracted
-- text. The hierarchy of an OCR extracted text structure is like this:
-- TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol Each
-- structural component, starting from Page, may further have their own
-- properties. Properties describe detected languages, breaks etc.. Please
-- refer to the TextAnnotation.TextProperty message definition below for
-- more detail.
--
-- /See:/ 'textAnnotation' smart constructor.
data TextAnnotation = TextAnnotation'
    { _taText  :: !(Maybe Text)
    , _taPages :: !(Maybe [Page])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'TextAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'taText'
--
-- * 'taPages'
textAnnotation
    :: TextAnnotation
textAnnotation =
    TextAnnotation'
    { _taText = Nothing
    , _taPages = Nothing
    }

-- | UTF-8 text detected on the pages.
taText :: Lens' TextAnnotation (Maybe Text)
taText = lens _taText (\ s a -> s{_taText = a})

-- | List of pages detected by OCR.
taPages :: Lens' TextAnnotation [Page]
taPages
  = lens _taPages (\ s a -> s{_taPages = a}) . _Default
      . _Coerce

instance FromJSON TextAnnotation where
        parseJSON
          = withObject "TextAnnotation"
              (\ o ->
                 TextAnnotation' <$>
                   (o .:? "text") <*> (o .:? "pages" .!= mempty))

instance ToJSON TextAnnotation where
        toJSON TextAnnotation'{..}
          = object
              (catMaybes
                 [("text" .=) <$> _taText, ("pages" .=) <$> _taPages])

-- | Information about a product.
--
-- /See:/ 'googleCloudVisionV1p3beta1ProductSearchResultsResult' smart constructor.
data GoogleCloudVisionV1p3beta1ProductSearchResultsResult = GoogleCloudVisionV1p3beta1ProductSearchResultsResult'
    { _gcvvpsrrImage   :: !(Maybe Text)
    , _gcvvpsrrScore   :: !(Maybe (Textual Double))
    , _gcvvpsrrProduct :: !(Maybe GoogleCloudVisionV1p3beta1Product)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1ProductSearchResultsResult' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpsrrImage'
--
-- * 'gcvvpsrrScore'
--
-- * 'gcvvpsrrProduct'
googleCloudVisionV1p3beta1ProductSearchResultsResult
    :: GoogleCloudVisionV1p3beta1ProductSearchResultsResult
googleCloudVisionV1p3beta1ProductSearchResultsResult =
    GoogleCloudVisionV1p3beta1ProductSearchResultsResult'
    { _gcvvpsrrImage = Nothing
    , _gcvvpsrrScore = Nothing
    , _gcvvpsrrProduct = Nothing
    }

-- | The resource name of the image from the product that is the closest
-- match to the query.
gcvvpsrrImage :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResultsResult (Maybe Text)
gcvvpsrrImage
  = lens _gcvvpsrrImage
      (\ s a -> s{_gcvvpsrrImage = a})

-- | A confidence level on the match, ranging from 0 (no confidence) to 1
-- (full confidence).
gcvvpsrrScore :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResultsResult (Maybe Double)
gcvvpsrrScore
  = lens _gcvvpsrrScore
      (\ s a -> s{_gcvvpsrrScore = a})
      . mapping _Coerce

-- | The Product.
gcvvpsrrProduct :: Lens' GoogleCloudVisionV1p3beta1ProductSearchResultsResult (Maybe GoogleCloudVisionV1p3beta1Product)
gcvvpsrrProduct
  = lens _gcvvpsrrProduct
      (\ s a -> s{_gcvvpsrrProduct = a})

instance FromJSON
         GoogleCloudVisionV1p3beta1ProductSearchResultsResult
         where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p3beta1ProductSearchResultsResult"
              (\ o ->
                 GoogleCloudVisionV1p3beta1ProductSearchResultsResult'
                   <$>
                   (o .:? "image") <*> (o .:? "score") <*>
                     (o .:? "product"))

instance ToJSON
         GoogleCloudVisionV1p3beta1ProductSearchResultsResult
         where
        toJSON
          GoogleCloudVisionV1p3beta1ProductSearchResultsResult'{..}
          = object
              (catMaybes
                 [("image" .=) <$> _gcvvpsrrImage,
                  ("score" .=) <$> _gcvvpsrrScore,
                  ("product" .=) <$> _gcvvpsrrProduct])

-- | Structural unit of text representing a number of words in certain order.
--
-- /See:/ 'googleCloudVisionV1p3beta1Paragraph' smart constructor.
data GoogleCloudVisionV1p3beta1Paragraph = GoogleCloudVisionV1p3beta1Paragraph'
    { _gcvvpcProperty    :: !(Maybe GoogleCloudVisionV1p3beta1TextAnnotationTextProperty)
    , _gcvvpcBoundingBox :: !(Maybe GoogleCloudVisionV1p3beta1BoundingPoly)
    , _gcvvpcConfidence  :: !(Maybe (Textual Double))
    , _gcvvpcWords       :: !(Maybe [GoogleCloudVisionV1p3beta1Word])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1Paragraph' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvpcProperty'
--
-- * 'gcvvpcBoundingBox'
--
-- * 'gcvvpcConfidence'
--
-- * 'gcvvpcWords'
googleCloudVisionV1p3beta1Paragraph
    :: GoogleCloudVisionV1p3beta1Paragraph
googleCloudVisionV1p3beta1Paragraph =
    GoogleCloudVisionV1p3beta1Paragraph'
    { _gcvvpcProperty = Nothing
    , _gcvvpcBoundingBox = Nothing
    , _gcvvpcConfidence = Nothing
    , _gcvvpcWords = Nothing
    }

-- | Additional information detected for the paragraph.
gcvvpcProperty :: Lens' GoogleCloudVisionV1p3beta1Paragraph (Maybe GoogleCloudVisionV1p3beta1TextAnnotationTextProperty)
gcvvpcProperty
  = lens _gcvvpcProperty
      (\ s a -> s{_gcvvpcProperty = a})

-- | The bounding box for the paragraph. The vertices are in the order of
-- top-left, top-right, bottom-right, bottom-left. When a rotation of the
-- bounding box is detected the rotation is represented as around the
-- top-left corner as defined when the text is read in the \'natural\'
-- orientation. For example: * when the text is horizontal it might look
-- like: 0----1 | | 3----2 * when it\'s rotated 180 degrees around the
-- top-left corner it becomes: 2----3 | | 1----0 and the vertex order will
-- still be (0, 1, 2, 3).
gcvvpcBoundingBox :: Lens' GoogleCloudVisionV1p3beta1Paragraph (Maybe GoogleCloudVisionV1p3beta1BoundingPoly)
gcvvpcBoundingBox
  = lens _gcvvpcBoundingBox
      (\ s a -> s{_gcvvpcBoundingBox = a})

-- | Confidence of the OCR results for the paragraph. Range [0, 1].
gcvvpcConfidence :: Lens' GoogleCloudVisionV1p3beta1Paragraph (Maybe Double)
gcvvpcConfidence
  = lens _gcvvpcConfidence
      (\ s a -> s{_gcvvpcConfidence = a})
      . mapping _Coerce

-- | List of words in this paragraph.
gcvvpcWords :: Lens' GoogleCloudVisionV1p3beta1Paragraph [GoogleCloudVisionV1p3beta1Word]
gcvvpcWords
  = lens _gcvvpcWords (\ s a -> s{_gcvvpcWords = a}) .
      _Default
      . _Coerce

instance FromJSON GoogleCloudVisionV1p3beta1Paragraph
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p3beta1Paragraph"
              (\ o ->
                 GoogleCloudVisionV1p3beta1Paragraph' <$>
                   (o .:? "property") <*> (o .:? "boundingBox") <*>
                     (o .:? "confidence")
                     <*> (o .:? "words" .!= mempty))

instance ToJSON GoogleCloudVisionV1p3beta1Paragraph
         where
        toJSON GoogleCloudVisionV1p3beta1Paragraph'{..}
          = object
              (catMaybes
                 [("property" .=) <$> _gcvvpcProperty,
                  ("boundingBox" .=) <$> _gcvvpcBoundingBox,
                  ("confidence" .=) <$> _gcvvpcConfidence,
                  ("words" .=) <$> _gcvvpcWords])

-- | Entity deduced from similar images on the Internet.
--
-- /See:/ 'googleCloudVisionV1p1beta1WebDetectionWebEntity' smart constructor.
data GoogleCloudVisionV1p1beta1WebDetectionWebEntity = GoogleCloudVisionV1p1beta1WebDetectionWebEntity'
    { _gcvvwdweScore       :: !(Maybe (Textual Double))
    , _gcvvwdweEntityId    :: !(Maybe Text)
    , _gcvvwdweDescription :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p1beta1WebDetectionWebEntity' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvwdweScore'
--
-- * 'gcvvwdweEntityId'
--
-- * 'gcvvwdweDescription'
googleCloudVisionV1p1beta1WebDetectionWebEntity
    :: GoogleCloudVisionV1p1beta1WebDetectionWebEntity
googleCloudVisionV1p1beta1WebDetectionWebEntity =
    GoogleCloudVisionV1p1beta1WebDetectionWebEntity'
    { _gcvvwdweScore = Nothing
    , _gcvvwdweEntityId = Nothing
    , _gcvvwdweDescription = Nothing
    }

-- | Overall relevancy score for the entity. Not normalized and not
-- comparable across different image queries.
gcvvwdweScore :: Lens' GoogleCloudVisionV1p1beta1WebDetectionWebEntity (Maybe Double)
gcvvwdweScore
  = lens _gcvvwdweScore
      (\ s a -> s{_gcvvwdweScore = a})
      . mapping _Coerce

-- | Opaque entity ID.
gcvvwdweEntityId :: Lens' GoogleCloudVisionV1p1beta1WebDetectionWebEntity (Maybe Text)
gcvvwdweEntityId
  = lens _gcvvwdweEntityId
      (\ s a -> s{_gcvvwdweEntityId = a})

-- | Canonical description of the entity, in English.
gcvvwdweDescription :: Lens' GoogleCloudVisionV1p1beta1WebDetectionWebEntity (Maybe Text)
gcvvwdweDescription
  = lens _gcvvwdweDescription
      (\ s a -> s{_gcvvwdweDescription = a})

instance FromJSON
         GoogleCloudVisionV1p1beta1WebDetectionWebEntity where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p1beta1WebDetectionWebEntity"
              (\ o ->
                 GoogleCloudVisionV1p1beta1WebDetectionWebEntity' <$>
                   (o .:? "score") <*> (o .:? "entityId") <*>
                     (o .:? "description"))

instance ToJSON
         GoogleCloudVisionV1p1beta1WebDetectionWebEntity where
        toJSON
          GoogleCloudVisionV1p1beta1WebDetectionWebEntity'{..}
          = object
              (catMaybes
                 [("score" .=) <$> _gcvvwdweScore,
                  ("entityId" .=) <$> _gcvvwdweEntityId,
                  ("description" .=) <$> _gcvvwdweDescription])

-- | Response to a single file annotation request. A file may contain one or
-- more images, which individually have their own responses.
--
-- /See:/ 'googleCloudVisionV1p2beta1AnnotateFileResponse' smart constructor.
data GoogleCloudVisionV1p2beta1AnnotateFileResponse = GoogleCloudVisionV1p2beta1AnnotateFileResponse'
    { _gcvvafrResponses   :: !(Maybe [GoogleCloudVisionV1p2beta1AnnotateImageResponse])
    , _gcvvafrInputConfig :: !(Maybe GoogleCloudVisionV1p2beta1InputConfig)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1AnnotateFileResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvafrResponses'
--
-- * 'gcvvafrInputConfig'
googleCloudVisionV1p2beta1AnnotateFileResponse
    :: GoogleCloudVisionV1p2beta1AnnotateFileResponse
googleCloudVisionV1p2beta1AnnotateFileResponse =
    GoogleCloudVisionV1p2beta1AnnotateFileResponse'
    { _gcvvafrResponses = Nothing
    , _gcvvafrInputConfig = Nothing
    }

-- | Individual responses to images found within the file.
gcvvafrResponses :: Lens' GoogleCloudVisionV1p2beta1AnnotateFileResponse [GoogleCloudVisionV1p2beta1AnnotateImageResponse]
gcvvafrResponses
  = lens _gcvvafrResponses
      (\ s a -> s{_gcvvafrResponses = a})
      . _Default
      . _Coerce

-- | Information about the file for which this response is generated.
gcvvafrInputConfig :: Lens' GoogleCloudVisionV1p2beta1AnnotateFileResponse (Maybe GoogleCloudVisionV1p2beta1InputConfig)
gcvvafrInputConfig
  = lens _gcvvafrInputConfig
      (\ s a -> s{_gcvvafrInputConfig = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1AnnotateFileResponse where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1AnnotateFileResponse"
              (\ o ->
                 GoogleCloudVisionV1p2beta1AnnotateFileResponse' <$>
                   (o .:? "responses" .!= mempty) <*>
                     (o .:? "inputConfig"))

instance ToJSON
         GoogleCloudVisionV1p2beta1AnnotateFileResponse where
        toJSON
          GoogleCloudVisionV1p2beta1AnnotateFileResponse'{..}
          = object
              (catMaybes
                 [("responses" .=) <$> _gcvvafrResponses,
                  ("inputConfig" .=) <$> _gcvvafrInputConfig])

-- | A word representation.
--
-- /See:/ 'googleCloudVisionV1p3beta1Word' smart constructor.
data GoogleCloudVisionV1p3beta1Word = GoogleCloudVisionV1p3beta1Word'
    { _gcvvwProperty    :: !(Maybe GoogleCloudVisionV1p3beta1TextAnnotationTextProperty)
    , _gcvvwBoundingBox :: !(Maybe GoogleCloudVisionV1p3beta1BoundingPoly)
    , _gcvvwSymbols     :: !(Maybe [GoogleCloudVisionV1p3beta1Symbol])
    , _gcvvwConfidence  :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p3beta1Word' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvwProperty'
--
-- * 'gcvvwBoundingBox'
--
-- * 'gcvvwSymbols'
--
-- * 'gcvvwConfidence'
googleCloudVisionV1p3beta1Word
    :: GoogleCloudVisionV1p3beta1Word
googleCloudVisionV1p3beta1Word =
    GoogleCloudVisionV1p3beta1Word'
    { _gcvvwProperty = Nothing
    , _gcvvwBoundingBox = Nothing
    , _gcvvwSymbols = Nothing
    , _gcvvwConfidence = Nothing
    }

-- | Additional information detected for the word.
gcvvwProperty :: Lens' GoogleCloudVisionV1p3beta1Word (Maybe GoogleCloudVisionV1p3beta1TextAnnotationTextProperty)
gcvvwProperty
  = lens _gcvvwProperty
      (\ s a -> s{_gcvvwProperty = a})

-- | The bounding box for the word. The vertices are in the order of
-- top-left, top-right, bottom-right, bottom-left. When a rotation of the
-- bounding box is detected the rotation is represented as around the
-- top-left corner as defined when the text is read in the \'natural\'
-- orientation. For example: * when the text is horizontal it might look
-- like: 0----1 | | 3----2 * when it\'s rotated 180 degrees around the
-- top-left corner it becomes: 2----3 | | 1----0 and the vertex order will
-- still be (0, 1, 2, 3).
gcvvwBoundingBox :: Lens' GoogleCloudVisionV1p3beta1Word (Maybe GoogleCloudVisionV1p3beta1BoundingPoly)
gcvvwBoundingBox
  = lens _gcvvwBoundingBox
      (\ s a -> s{_gcvvwBoundingBox = a})

-- | List of symbols in the word. The order of the symbols follows the
-- natural reading order.
gcvvwSymbols :: Lens' GoogleCloudVisionV1p3beta1Word [GoogleCloudVisionV1p3beta1Symbol]
gcvvwSymbols
  = lens _gcvvwSymbols (\ s a -> s{_gcvvwSymbols = a})
      . _Default
      . _Coerce

-- | Confidence of the OCR results for the word. Range [0, 1].
gcvvwConfidence :: Lens' GoogleCloudVisionV1p3beta1Word (Maybe Double)
gcvvwConfidence
  = lens _gcvvwConfidence
      (\ s a -> s{_gcvvwConfidence = a})
      . mapping _Coerce

instance FromJSON GoogleCloudVisionV1p3beta1Word
         where
        parseJSON
          = withObject "GoogleCloudVisionV1p3beta1Word"
              (\ o ->
                 GoogleCloudVisionV1p3beta1Word' <$>
                   (o .:? "property") <*> (o .:? "boundingBox") <*>
                     (o .:? "symbols" .!= mempty)
                     <*> (o .:? "confidence"))

instance ToJSON GoogleCloudVisionV1p3beta1Word where
        toJSON GoogleCloudVisionV1p3beta1Word'{..}
          = object
              (catMaybes
                 [("property" .=) <$> _gcvvwProperty,
                  ("boundingBox" .=) <$> _gcvvwBoundingBox,
                  ("symbols" .=) <$> _gcvvwSymbols,
                  ("confidence" .=) <$> _gcvvwConfidence])

-- | Set of detected objects with bounding boxes.
--
-- /See:/ 'localizedObjectAnnotation' smart constructor.
data LocalizedObjectAnnotation = LocalizedObjectAnnotation'
    { _loaLanguageCode :: !(Maybe Text)
    , _loaScore        :: !(Maybe (Textual Double))
    , _loaBoundingPoly :: !(Maybe BoundingPoly)
    , _loaName         :: !(Maybe Text)
    , _loaMid          :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'LocalizedObjectAnnotation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'loaLanguageCode'
--
-- * 'loaScore'
--
-- * 'loaBoundingPoly'
--
-- * 'loaName'
--
-- * 'loaMid'
localizedObjectAnnotation
    :: LocalizedObjectAnnotation
localizedObjectAnnotation =
    LocalizedObjectAnnotation'
    { _loaLanguageCode = Nothing
    , _loaScore = Nothing
    , _loaBoundingPoly = Nothing
    , _loaName = Nothing
    , _loaMid = Nothing
    }

-- | The BCP-47 language code, such as \"en-US\" or \"sr-Latn\". For more
-- information, see
-- http:\/\/www.unicode.org\/reports\/tr35\/#Unicode_locale_identifier.
loaLanguageCode :: Lens' LocalizedObjectAnnotation (Maybe Text)
loaLanguageCode
  = lens _loaLanguageCode
      (\ s a -> s{_loaLanguageCode = a})

-- | Score of the result. Range [0, 1].
loaScore :: Lens' LocalizedObjectAnnotation (Maybe Double)
loaScore
  = lens _loaScore (\ s a -> s{_loaScore = a}) .
      mapping _Coerce

-- | Image region to which this object belongs. This must be populated.
loaBoundingPoly :: Lens' LocalizedObjectAnnotation (Maybe BoundingPoly)
loaBoundingPoly
  = lens _loaBoundingPoly
      (\ s a -> s{_loaBoundingPoly = a})

-- | Object name, expressed in its \`language_code\` language.
loaName :: Lens' LocalizedObjectAnnotation (Maybe Text)
loaName = lens _loaName (\ s a -> s{_loaName = a})

-- | Object ID that should align with EntityAnnotation mid.
loaMid :: Lens' LocalizedObjectAnnotation (Maybe Text)
loaMid = lens _loaMid (\ s a -> s{_loaMid = a})

instance FromJSON LocalizedObjectAnnotation where
        parseJSON
          = withObject "LocalizedObjectAnnotation"
              (\ o ->
                 LocalizedObjectAnnotation' <$>
                   (o .:? "languageCode") <*> (o .:? "score") <*>
                     (o .:? "boundingPoly")
                     <*> (o .:? "name")
                     <*> (o .:? "mid"))

instance ToJSON LocalizedObjectAnnotation where
        toJSON LocalizedObjectAnnotation'{..}
          = object
              (catMaybes
                 [("languageCode" .=) <$> _loaLanguageCode,
                  ("score" .=) <$> _loaScore,
                  ("boundingPoly" .=) <$> _loaBoundingPoly,
                  ("name" .=) <$> _loaName, ("mid" .=) <$> _loaMid])

-- | Relevant information for the image from the Internet.
--
-- /See:/ 'googleCloudVisionV1p2beta1WebDetection' smart constructor.
data GoogleCloudVisionV1p2beta1WebDetection = GoogleCloudVisionV1p2beta1WebDetection'
    { _gcvvwdVisuallySimilarImages   :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebImage])
    , _gcvvwdBestGuessLabels         :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebLabel])
    , _gcvvwdPagesWithMatchingImages :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebPage])
    , _gcvvwdPartialMatchingImages   :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebImage])
    , _gcvvwdFullMatchingImages      :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebImage])
    , _gcvvwdWebEntities             :: !(Maybe [GoogleCloudVisionV1p2beta1WebDetectionWebEntity])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1WebDetection' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gcvvwdVisuallySimilarImages'
--
-- * 'gcvvwdBestGuessLabels'
--
-- * 'gcvvwdPagesWithMatchingImages'
--
-- * 'gcvvwdPartialMatchingImages'
--
-- * 'gcvvwdFullMatchingImages'
--
-- * 'gcvvwdWebEntities'
googleCloudVisionV1p2beta1WebDetection
    :: GoogleCloudVisionV1p2beta1WebDetection
googleCloudVisionV1p2beta1WebDetection =
    GoogleCloudVisionV1p2beta1WebDetection'
    { _gcvvwdVisuallySimilarImages = Nothing
    , _gcvvwdBestGuessLabels = Nothing
    , _gcvvwdPagesWithMatchingImages = Nothing
    , _gcvvwdPartialMatchingImages = Nothing
    , _gcvvwdFullMatchingImages = Nothing
    , _gcvvwdWebEntities = Nothing
    }

-- | The visually similar image results.
gcvvwdVisuallySimilarImages :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebImage]
gcvvwdVisuallySimilarImages
  = lens _gcvvwdVisuallySimilarImages
      (\ s a -> s{_gcvvwdVisuallySimilarImages = a})
      . _Default
      . _Coerce

-- | The service\'s best guess as to the topic of the request image. Inferred
-- from similar images on the open web.
gcvvwdBestGuessLabels :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebLabel]
gcvvwdBestGuessLabels
  = lens _gcvvwdBestGuessLabels
      (\ s a -> s{_gcvvwdBestGuessLabels = a})
      . _Default
      . _Coerce

-- | Web pages containing the matching images from the Internet.
gcvvwdPagesWithMatchingImages :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebPage]
gcvvwdPagesWithMatchingImages
  = lens _gcvvwdPagesWithMatchingImages
      (\ s a -> s{_gcvvwdPagesWithMatchingImages = a})
      . _Default
      . _Coerce

-- | Partial matching images from the Internet. Those images are similar
-- enough to share some key-point features. For example an original image
-- will likely have partial matching for its crops.
gcvvwdPartialMatchingImages :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebImage]
gcvvwdPartialMatchingImages
  = lens _gcvvwdPartialMatchingImages
      (\ s a -> s{_gcvvwdPartialMatchingImages = a})
      . _Default
      . _Coerce

-- | Fully matching images from the Internet. Can include resized copies of
-- the query image.
gcvvwdFullMatchingImages :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebImage]
gcvvwdFullMatchingImages
  = lens _gcvvwdFullMatchingImages
      (\ s a -> s{_gcvvwdFullMatchingImages = a})
      . _Default
      . _Coerce

-- | Deduced entities from similar images on the Internet.
gcvvwdWebEntities :: Lens' GoogleCloudVisionV1p2beta1WebDetection [GoogleCloudVisionV1p2beta1WebDetectionWebEntity]
gcvvwdWebEntities
  = lens _gcvvwdWebEntities
      (\ s a -> s{_gcvvwdWebEntities = a})
      . _Default
      . _Coerce

instance FromJSON
         GoogleCloudVisionV1p2beta1WebDetection where
        parseJSON
          = withObject "GoogleCloudVisionV1p2beta1WebDetection"
              (\ o ->
                 GoogleCloudVisionV1p2beta1WebDetection' <$>
                   (o .:? "visuallySimilarImages" .!= mempty) <*>
                     (o .:? "bestGuessLabels" .!= mempty)
                     <*> (o .:? "pagesWithMatchingImages" .!= mempty)
                     <*> (o .:? "partialMatchingImages" .!= mempty)
                     <*> (o .:? "fullMatchingImages" .!= mempty)
                     <*> (o .:? "webEntities" .!= mempty))

instance ToJSON
         GoogleCloudVisionV1p2beta1WebDetection where
        toJSON GoogleCloudVisionV1p2beta1WebDetection'{..}
          = object
              (catMaybes
                 [("visuallySimilarImages" .=) <$>
                    _gcvvwdVisuallySimilarImages,
                  ("bestGuessLabels" .=) <$> _gcvvwdBestGuessLabels,
                  ("pagesWithMatchingImages" .=) <$>
                    _gcvvwdPagesWithMatchingImages,
                  ("partialMatchingImages" .=) <$>
                    _gcvvwdPartialMatchingImages,
                  ("fullMatchingImages" .=) <$>
                    _gcvvwdFullMatchingImages,
                  ("webEntities" .=) <$> _gcvvwdWebEntities])

-- | This resource represents a long-running operation that is the result of
-- a network API call.
--
-- /See:/ 'operation' smart constructor.
data Operation = Operation'
    { _oDone     :: !(Maybe Bool)
    , _oError    :: !(Maybe Status)
    , _oResponse :: !(Maybe OperationResponse)
    , _oName     :: !(Maybe Text)
    , _oMetadata :: !(Maybe OperationSchema)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'Operation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'oDone'
--
-- * 'oError'
--
-- * 'oResponse'
--
-- * 'oName'
--
-- * 'oMetadata'
operation
    :: Operation
operation =
    Operation'
    { _oDone = Nothing
    , _oError = Nothing
    , _oResponse = Nothing
    , _oName = Nothing
    , _oMetadata = Nothing
    }

-- | If the value is \`false\`, it means the operation is still in progress.
-- If \`true\`, the operation is completed, and either \`error\` or
-- \`response\` is available.
oDone :: Lens' Operation (Maybe Bool)
oDone = lens _oDone (\ s a -> s{_oDone = a})

-- | The error result of the operation in case of failure or cancellation.
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a})

-- | The normal response of the operation in case of success. If the original
-- method returns no data on success, such as \`Delete\`, the response is
-- \`google.protobuf.Empty\`. If the original method is standard
-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
-- For other methods, the response should have the type \`XxxResponse\`,
-- where \`Xxx\` is the original method name. For example, if the original
-- method name is \`TakeSnapshot()\`, the inferred response type is
-- \`TakeSnapshotResponse\`.
oResponse :: Lens' Operation (Maybe OperationResponse)
oResponse
  = lens _oResponse (\ s a -> s{_oResponse = a})

-- | The server-assigned name, which is only unique within the same service
-- that originally returns it. If you use the default HTTP mapping, the
-- \`name\` should have the format of \`operations\/some\/unique\/name\`.
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})

-- | Service-specific metadata associated with the operation. It typically
-- contains progress information and common metadata such as create time.
-- Some services might not provide such metadata. Any method that returns a
-- long-running operation should document the metadata type, if any.
oMetadata :: Lens' Operation (Maybe OperationSchema)
oMetadata
  = lens _oMetadata (\ s a -> s{_oMetadata = a})

instance FromJSON Operation where
        parseJSON
          = withObject "Operation"
              (\ o ->
                 Operation' <$>
                   (o .:? "done") <*> (o .:? "error") <*>
                     (o .:? "response")
                     <*> (o .:? "name")
                     <*> (o .:? "metadata"))

instance ToJSON Operation where
        toJSON Operation'{..}
          = object
              (catMaybes
                 [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
                  ("response" .=) <$> _oResponse,
                  ("name" .=) <$> _oName,
                  ("metadata" .=) <$> _oMetadata])

-- | Represents a color in the RGBA color space. This representation is
-- designed for simplicity of conversion to\/from color representations in
-- various languages over compactness; for example, the fields of this
-- representation can be trivially provided to the constructor of
-- \"java.awt.Color\" in Java; it can also be trivially provided to
-- UIColor\'s \"+colorWithRed:green:blue:alpha\" method in iOS; and, with
-- just a little work, it can be easily formatted into a CSS \"rgba()\"
-- string in JavaScript, as well. Here are some examples: Example (Java):
-- import com.google.type.Color; \/\/ ... public static java.awt.Color
-- fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ?
-- protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color(
-- protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(),
-- alpha); } public static Color toProto(java.awt.Color color) { float red
-- = (float) color.getRed(); float green = (float) color.getGreen(); float
-- blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder
-- resultBuilder = Color .newBuilder() .setRed(red \/ denominator)
-- .setGreen(green \/ denominator) .setBlue(blue \/ denominator); int alpha
-- = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue
-- .newBuilder() .setValue(((float) alpha) \/ denominator) .build()); }
-- return resultBuilder.build(); } \/\/ ... Example (iOS \/ Obj-C): \/\/
-- ... static UIColor* fromProto(Color* protocolor) { float red =
-- [protocolor red]; float green = [protocolor green]; float blue =
-- [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float
-- alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value];
-- } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; }
-- static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha;
-- if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { return
-- nil; } Color* result = [[Color alloc] init]; [result setRed:red];
-- [result setGreen:green]; [result setBlue:blue]; if (alpha \<= 0.9999) {
-- [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease];
-- return result; } \/\/ ... Example (JavaScript): \/\/ ... var
-- protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red ||
-- 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac =
-- rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green =
-- Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if
-- (!(\'alpha\' in rgb_color)) { return rgbToCssColor_(red, green, blue); }
-- var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red,
-- green, blue].join(\',\'); return [\'rgba(\', rgbParams, \',\',
-- alphaFrac, \')\'].join(\'\'); }; var rgbToCssColor_ = function(red,
-- green, blue) { var rgbNumber = new Number((red \<\< 16) | (green \<\< 8)
-- | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 -
-- hexString.length; var resultBuilder = [\'#\']; for (var i = 0; i \<
-- missingZeros; i++) { resultBuilder.push(\'0\'); }
-- resultBuilder.push(hexString); return resultBuilder.join(\'\'); }; \/\/
-- ...
--
-- /See:/ 'color' smart constructor.
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)

-- | Creates a value of 'Color' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cRed'
--
-- * 'cAlpha'
--
-- * 'cGreen'
--
-- * 'cBlue'
color
    :: Color
color =
    Color'
    { _cRed = Nothing
    , _cAlpha = Nothing
    , _cGreen = Nothing
    , _cBlue = Nothing
    }

-- | The amount of red in the color as a value in the interval [0, 1].
cRed :: Lens' Color (Maybe Double)
cRed
  = lens _cRed (\ s a -> s{_cRed = a}) .
      mapping _Coerce

-- | The fraction of this color that should be applied to the pixel. That is,
-- the final pixel color is defined by the equation: pixel color = alpha *
-- (this color) + (1.0 - alpha) * (background color) This means that a
-- value of 1.0 corresponds to a solid color, whereas a value of 0.0
-- corresponds to a completely transparent color. This uses a wrapper
-- message rather than a simple float scalar so that it is possible to
-- distinguish between a default value and the value being unset. If
-- omitted, this color object is to be rendered as a solid color (as if the
-- alpha value had been explicitly given with a value of 1.0).
cAlpha :: Lens' Color (Maybe Double)
cAlpha
  = lens _cAlpha (\ s a -> s{_cAlpha = a}) .
      mapping _Coerce

-- | The amount of green in the color as a value in the interval [0, 1].
cGreen :: Lens' Color (Maybe Double)
cGreen
  = lens _cGreen (\ s a -> s{_cGreen = a}) .
      mapping _Coerce

-- | The amount of blue in the color as a value in the interval [0, 1].
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])

-- | A product label represented as a key-value pair.
--
-- /See:/ 'googleCloudVisionV1p2beta1ProductKeyValue' smart constructor.
data GoogleCloudVisionV1p2beta1ProductKeyValue = GoogleCloudVisionV1p2beta1ProductKeyValue'
    { _gValue :: !(Maybe Text)
    , _gKey   :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleCloudVisionV1p2beta1ProductKeyValue' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gValue'
--
-- * 'gKey'
googleCloudVisionV1p2beta1ProductKeyValue
    :: GoogleCloudVisionV1p2beta1ProductKeyValue
googleCloudVisionV1p2beta1ProductKeyValue =
    GoogleCloudVisionV1p2beta1ProductKeyValue'
    { _gValue = Nothing
    , _gKey = Nothing
    }

-- | The value of the label attached to the product. Cannot be empty and
-- cannot exceed 128 bytes.
gValue :: Lens' GoogleCloudVisionV1p2beta1ProductKeyValue (Maybe Text)
gValue = lens _gValue (\ s a -> s{_gValue = a})

-- | The key of the label attached to the product. Cannot be empty and cannot
-- exceed 128 bytes.
gKey :: Lens' GoogleCloudVisionV1p2beta1ProductKeyValue (Maybe Text)
gKey = lens _gKey (\ s a -> s{_gKey = a})

instance FromJSON
         GoogleCloudVisionV1p2beta1ProductKeyValue where
        parseJSON
          = withObject
              "GoogleCloudVisionV1p2beta1ProductKeyValue"
              (\ o ->
                 GoogleCloudVisionV1p2beta1ProductKeyValue' <$>
                   (o .:? "value"