{-# 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.DLP.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.DLP.Types.Product where

import           Network.Google.DLP.Types.Sum
import           Network.Google.Prelude

-- | Statistics regarding a specific InfoType.
--
-- /See:/ 'googlePrivacyDlpV2InfoTypeStats' smart constructor.
data GooglePrivacyDlpV2InfoTypeStats = GooglePrivacyDlpV2InfoTypeStats'
    { _gpdvitsCount    :: !(Maybe (Textual Int64))
    , _gpdvitsInfoType :: !(Maybe GooglePrivacyDlpV2InfoType)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InfoTypeStats' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvitsCount'
--
-- * 'gpdvitsInfoType'
googlePrivacyDlpV2InfoTypeStats
    :: GooglePrivacyDlpV2InfoTypeStats
googlePrivacyDlpV2InfoTypeStats =
    GooglePrivacyDlpV2InfoTypeStats'
    { _gpdvitsCount = Nothing
    , _gpdvitsInfoType = Nothing
    }

-- | Number of findings for this infoType.
gpdvitsCount :: Lens' GooglePrivacyDlpV2InfoTypeStats (Maybe Int64)
gpdvitsCount
  = lens _gpdvitsCount (\ s a -> s{_gpdvitsCount = a})
      . mapping _Coerce

-- | The type of finding this stat is for.
gpdvitsInfoType :: Lens' GooglePrivacyDlpV2InfoTypeStats (Maybe GooglePrivacyDlpV2InfoType)
gpdvitsInfoType
  = lens _gpdvitsInfoType
      (\ s a -> s{_gpdvitsInfoType = a})

instance FromJSON GooglePrivacyDlpV2InfoTypeStats
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2InfoTypeStats"
              (\ o ->
                 GooglePrivacyDlpV2InfoTypeStats' <$>
                   (o .:? "count") <*> (o .:? "infoType"))

instance ToJSON GooglePrivacyDlpV2InfoTypeStats where
        toJSON GooglePrivacyDlpV2InfoTypeStats'{..}
          = object
              (catMaybes
                 [("count" .=) <$> _gpdvitsCount,
                  ("infoType" .=) <$> _gpdvitsInfoType])

-- | Redact a given value. For example, if used with an
-- \`InfoTypeTransformation\` transforming PHONE_NUMBER, and input \'My
-- phone number is 206-555-0123\', the output would be \'My phone number is
-- \'.
--
-- /See:/ 'googlePrivacyDlpV2RedactConfig' smart constructor.
data GooglePrivacyDlpV2RedactConfig =
    GooglePrivacyDlpV2RedactConfig'
    deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RedactConfig' with the minimum fields required to make a request.
--
googlePrivacyDlpV2RedactConfig
    :: GooglePrivacyDlpV2RedactConfig
googlePrivacyDlpV2RedactConfig = GooglePrivacyDlpV2RedactConfig'

instance FromJSON GooglePrivacyDlpV2RedactConfig
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2RedactConfig"
              (\ o -> pure GooglePrivacyDlpV2RedactConfig')

instance ToJSON GooglePrivacyDlpV2RedactConfig where
        toJSON = const emptyObject

-- | Request message for UpdateJobTrigger.
--
-- /See:/ 'googlePrivacyDlpV2UpdateJobTriggerRequest' smart constructor.
data GooglePrivacyDlpV2UpdateJobTriggerRequest = GooglePrivacyDlpV2UpdateJobTriggerRequest'
    { _gpdvujtrUpdateMask :: !(Maybe GFieldMask)
    , _gpdvujtrJobTrigger :: !(Maybe GooglePrivacyDlpV2JobTrigger)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2UpdateJobTriggerRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvujtrUpdateMask'
--
-- * 'gpdvujtrJobTrigger'
googlePrivacyDlpV2UpdateJobTriggerRequest
    :: GooglePrivacyDlpV2UpdateJobTriggerRequest
googlePrivacyDlpV2UpdateJobTriggerRequest =
    GooglePrivacyDlpV2UpdateJobTriggerRequest'
    { _gpdvujtrUpdateMask = Nothing
    , _gpdvujtrJobTrigger = Nothing
    }

-- | Mask to control which fields get updated.
gpdvujtrUpdateMask :: Lens' GooglePrivacyDlpV2UpdateJobTriggerRequest (Maybe GFieldMask)
gpdvujtrUpdateMask
  = lens _gpdvujtrUpdateMask
      (\ s a -> s{_gpdvujtrUpdateMask = a})

-- | New JobTrigger value.
gpdvujtrJobTrigger :: Lens' GooglePrivacyDlpV2UpdateJobTriggerRequest (Maybe GooglePrivacyDlpV2JobTrigger)
gpdvujtrJobTrigger
  = lens _gpdvujtrJobTrigger
      (\ s a -> s{_gpdvujtrJobTrigger = a})

instance FromJSON
         GooglePrivacyDlpV2UpdateJobTriggerRequest where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2UpdateJobTriggerRequest"
              (\ o ->
                 GooglePrivacyDlpV2UpdateJobTriggerRequest' <$>
                   (o .:? "updateMask") <*> (o .:? "jobTrigger"))

instance ToJSON
         GooglePrivacyDlpV2UpdateJobTriggerRequest where
        toJSON GooglePrivacyDlpV2UpdateJobTriggerRequest'{..}
          = object
              (catMaybes
                 [("updateMask" .=) <$> _gpdvujtrUpdateMask,
                  ("jobTrigger" .=) <$> _gpdvujtrJobTrigger])

-- | Generic half-open interval [start, end)
--
-- /See:/ 'googlePrivacyDlpV2Range' smart constructor.
data GooglePrivacyDlpV2Range = GooglePrivacyDlpV2Range'
    { _gpdvrStart :: !(Maybe (Textual Int64))
    , _gpdvrEnd   :: !(Maybe (Textual Int64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2Range' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrStart'
--
-- * 'gpdvrEnd'
googlePrivacyDlpV2Range
    :: GooglePrivacyDlpV2Range
googlePrivacyDlpV2Range =
    GooglePrivacyDlpV2Range'
    { _gpdvrStart = Nothing
    , _gpdvrEnd = Nothing
    }

-- | Index of the first character of the range (inclusive).
gpdvrStart :: Lens' GooglePrivacyDlpV2Range (Maybe Int64)
gpdvrStart
  = lens _gpdvrStart (\ s a -> s{_gpdvrStart = a}) .
      mapping _Coerce

-- | Index of the last character of the range (exclusive).
gpdvrEnd :: Lens' GooglePrivacyDlpV2Range (Maybe Int64)
gpdvrEnd
  = lens _gpdvrEnd (\ s a -> s{_gpdvrEnd = a}) .
      mapping _Coerce

instance FromJSON GooglePrivacyDlpV2Range where
        parseJSON
          = withObject "GooglePrivacyDlpV2Range"
              (\ o ->
                 GooglePrivacyDlpV2Range' <$>
                   (o .:? "start") <*> (o .:? "end"))

instance ToJSON GooglePrivacyDlpV2Range where
        toJSON GooglePrivacyDlpV2Range'{..}
          = object
              (catMaybes
                 [("start" .=) <$> _gpdvrStart,
                  ("end" .=) <$> _gpdvrEnd])

-- | 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:/ 'googleRpcStatus' smart constructor.
data GoogleRpcStatus = GoogleRpcStatus'
    { _grsDetails :: !(Maybe [GoogleRpcStatusDetailsItem])
    , _grsCode    :: !(Maybe (Textual Int32))
    , _grsMessage :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleRpcStatus' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'grsDetails'
--
-- * 'grsCode'
--
-- * 'grsMessage'
googleRpcStatus
    :: GoogleRpcStatus
googleRpcStatus =
    GoogleRpcStatus'
    { _grsDetails = Nothing
    , _grsCode = Nothing
    , _grsMessage = Nothing
    }

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

-- | The status code, which should be an enum value of google.rpc.Code.
grsCode :: Lens' GoogleRpcStatus (Maybe Int32)
grsCode
  = lens _grsCode (\ s a -> s{_grsCode = 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.
grsMessage :: Lens' GoogleRpcStatus (Maybe Text)
grsMessage
  = lens _grsMessage (\ s a -> s{_grsMessage = a})

instance FromJSON GoogleRpcStatus where
        parseJSON
          = withObject "GoogleRpcStatus"
              (\ o ->
                 GoogleRpcStatus' <$>
                   (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
                     (o .:? "message"))

instance ToJSON GoogleRpcStatus where
        toJSON GoogleRpcStatus'{..}
          = object
              (catMaybes
                 [("details" .=) <$> _grsDetails,
                  ("code" .=) <$> _grsCode,
                  ("message" .=) <$> _grsMessage])

-- | Buckets values based on fixed size ranges. The Bucketing transformation
-- can provide all of this functionality, but requires more configuration.
-- This message is provided as a convenience to the user for simple
-- bucketing strategies. The transformed value will be a hyphenated string
-- of -, i.e if lower_bound = 10 and upper_bound = 20 all values that are
-- within this bucket will be replaced with \"10-20\". This can be used on
-- data of type: double, long. If the bound Value type differs from the
-- type of data being transformed, we will first attempt converting the
-- type of the data to be transformed to match the type of the bound before
-- comparing. See https:\/\/cloud.google.com\/dlp\/docs\/concepts-bucketing
-- to learn more.
--
-- /See:/ 'googlePrivacyDlpV2FixedSizeBucketingConfig' smart constructor.
data GooglePrivacyDlpV2FixedSizeBucketingConfig = GooglePrivacyDlpV2FixedSizeBucketingConfig'
    { _gpdvfsbcUpperBound :: !(Maybe GooglePrivacyDlpV2Value)
    , _gpdvfsbcLowerBound :: !(Maybe GooglePrivacyDlpV2Value)
    , _gpdvfsbcBucketSize :: !(Maybe (Textual Double))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2FixedSizeBucketingConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvfsbcUpperBound'
--
-- * 'gpdvfsbcLowerBound'
--
-- * 'gpdvfsbcBucketSize'
googlePrivacyDlpV2FixedSizeBucketingConfig
    :: GooglePrivacyDlpV2FixedSizeBucketingConfig
googlePrivacyDlpV2FixedSizeBucketingConfig =
    GooglePrivacyDlpV2FixedSizeBucketingConfig'
    { _gpdvfsbcUpperBound = Nothing
    , _gpdvfsbcLowerBound = Nothing
    , _gpdvfsbcBucketSize = Nothing
    }

-- | Upper bound value of buckets. All values greater than upper_bound are
-- grouped together into a single bucket; for example if \`upper_bound\` =
-- 89, then all values greater than 89 are replaced with the value “89+”.
-- [Required].
gpdvfsbcUpperBound :: Lens' GooglePrivacyDlpV2FixedSizeBucketingConfig (Maybe GooglePrivacyDlpV2Value)
gpdvfsbcUpperBound
  = lens _gpdvfsbcUpperBound
      (\ s a -> s{_gpdvfsbcUpperBound = a})

-- | Lower bound value of buckets. All values less than \`lower_bound\` are
-- grouped together into a single bucket; for example if \`lower_bound\` =
-- 10, then all values less than 10 are replaced with the value “-10”.
-- [Required].
gpdvfsbcLowerBound :: Lens' GooglePrivacyDlpV2FixedSizeBucketingConfig (Maybe GooglePrivacyDlpV2Value)
gpdvfsbcLowerBound
  = lens _gpdvfsbcLowerBound
      (\ s a -> s{_gpdvfsbcLowerBound = a})

-- | Size of each bucket (except for minimum and maximum buckets). So if
-- \`lower_bound\` = 10, \`upper_bound\` = 89, and \`bucket_size\` = 10,
-- then the following buckets would be used: -10, 10-20, 20-30, 30-40,
-- 40-50, 50-60, 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals
-- works. [Required].
gpdvfsbcBucketSize :: Lens' GooglePrivacyDlpV2FixedSizeBucketingConfig (Maybe Double)
gpdvfsbcBucketSize
  = lens _gpdvfsbcBucketSize
      (\ s a -> s{_gpdvfsbcBucketSize = a})
      . mapping _Coerce

instance FromJSON
         GooglePrivacyDlpV2FixedSizeBucketingConfig where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2FixedSizeBucketingConfig"
              (\ o ->
                 GooglePrivacyDlpV2FixedSizeBucketingConfig' <$>
                   (o .:? "upperBound") <*> (o .:? "lowerBound") <*>
                     (o .:? "bucketSize"))

instance ToJSON
         GooglePrivacyDlpV2FixedSizeBucketingConfig where
        toJSON
          GooglePrivacyDlpV2FixedSizeBucketingConfig'{..}
          = object
              (catMaybes
                 [("upperBound" .=) <$> _gpdvfsbcUpperBound,
                  ("lowerBound" .=) <$> _gpdvfsbcLowerBound,
                  ("bucketSize" .=) <$> _gpdvfsbcBucketSize])

-- | All the findings for a single scanned item.
--
-- /See:/ 'googlePrivacyDlpV2InspectResult' smart constructor.
data GooglePrivacyDlpV2InspectResult = GooglePrivacyDlpV2InspectResult'
    { _gpdvirFindingsTruncated :: !(Maybe Bool)
    , _gpdvirFindings          :: !(Maybe [GooglePrivacyDlpV2Finding])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InspectResult' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvirFindingsTruncated'
--
-- * 'gpdvirFindings'
googlePrivacyDlpV2InspectResult
    :: GooglePrivacyDlpV2InspectResult
googlePrivacyDlpV2InspectResult =
    GooglePrivacyDlpV2InspectResult'
    { _gpdvirFindingsTruncated = Nothing
    , _gpdvirFindings = Nothing
    }

-- | If true, then this item might have more findings than were returned, and
-- the findings returned are an arbitrary subset of all findings. The
-- findings list might be truncated because the input items were too large,
-- or because the server reached the maximum amount of resources allowed
-- for a single API call. For best results, divide the input into smaller
-- batches.
gpdvirFindingsTruncated :: Lens' GooglePrivacyDlpV2InspectResult (Maybe Bool)
gpdvirFindingsTruncated
  = lens _gpdvirFindingsTruncated
      (\ s a -> s{_gpdvirFindingsTruncated = a})

-- | List of findings for an item.
gpdvirFindings :: Lens' GooglePrivacyDlpV2InspectResult [GooglePrivacyDlpV2Finding]
gpdvirFindings
  = lens _gpdvirFindings
      (\ s a -> s{_gpdvirFindings = a})
      . _Default
      . _Coerce

instance FromJSON GooglePrivacyDlpV2InspectResult
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2InspectResult"
              (\ o ->
                 GooglePrivacyDlpV2InspectResult' <$>
                   (o .:? "findingsTruncated") <*>
                     (o .:? "findings" .!= mempty))

instance ToJSON GooglePrivacyDlpV2InspectResult where
        toJSON GooglePrivacyDlpV2InspectResult'{..}
          = object
              (catMaybes
                 [("findingsTruncated" .=) <$>
                    _gpdvirFindingsTruncated,
                  ("findings" .=) <$> _gpdvirFindings])

-- | Configuration for a StoredInfoType.
--
-- /See:/ 'googlePrivacyDlpV2StoredInfoTypeConfig' smart constructor.
data GooglePrivacyDlpV2StoredInfoTypeConfig = GooglePrivacyDlpV2StoredInfoTypeConfig'
    { _gpdvsitcLargeCustomDictionary :: !(Maybe GooglePrivacyDlpV2LargeCustomDictionaryConfig)
    , _gpdvsitcDisplayName           :: !(Maybe Text)
    , _gpdvsitcDescription           :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2StoredInfoTypeConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvsitcLargeCustomDictionary'
--
-- * 'gpdvsitcDisplayName'
--
-- * 'gpdvsitcDescription'
googlePrivacyDlpV2StoredInfoTypeConfig
    :: GooglePrivacyDlpV2StoredInfoTypeConfig
googlePrivacyDlpV2StoredInfoTypeConfig =
    GooglePrivacyDlpV2StoredInfoTypeConfig'
    { _gpdvsitcLargeCustomDictionary = Nothing
    , _gpdvsitcDisplayName = Nothing
    , _gpdvsitcDescription = Nothing
    }

-- | StoredInfoType where findings are defined by a dictionary of phrases.
gpdvsitcLargeCustomDictionary :: Lens' GooglePrivacyDlpV2StoredInfoTypeConfig (Maybe GooglePrivacyDlpV2LargeCustomDictionaryConfig)
gpdvsitcLargeCustomDictionary
  = lens _gpdvsitcLargeCustomDictionary
      (\ s a -> s{_gpdvsitcLargeCustomDictionary = a})

-- | Display name of the StoredInfoType (max 256 characters).
gpdvsitcDisplayName :: Lens' GooglePrivacyDlpV2StoredInfoTypeConfig (Maybe Text)
gpdvsitcDisplayName
  = lens _gpdvsitcDisplayName
      (\ s a -> s{_gpdvsitcDisplayName = a})

-- | Description of the StoredInfoType (max 256 characters).
gpdvsitcDescription :: Lens' GooglePrivacyDlpV2StoredInfoTypeConfig (Maybe Text)
gpdvsitcDescription
  = lens _gpdvsitcDescription
      (\ s a -> s{_gpdvsitcDescription = a})

instance FromJSON
         GooglePrivacyDlpV2StoredInfoTypeConfig where
        parseJSON
          = withObject "GooglePrivacyDlpV2StoredInfoTypeConfig"
              (\ o ->
                 GooglePrivacyDlpV2StoredInfoTypeConfig' <$>
                   (o .:? "largeCustomDictionary") <*>
                     (o .:? "displayName")
                     <*> (o .:? "description"))

instance ToJSON
         GooglePrivacyDlpV2StoredInfoTypeConfig where
        toJSON GooglePrivacyDlpV2StoredInfoTypeConfig'{..}
          = object
              (catMaybes
                 [("largeCustomDictionary" .=) <$>
                    _gpdvsitcLargeCustomDictionary,
                  ("displayName" .=) <$> _gpdvsitcDisplayName,
                  ("description" .=) <$> _gpdvsitcDescription])

-- | A transformation to apply to text that is identified as a specific
-- info_type.
--
-- /See:/ 'googlePrivacyDlpV2InfoTypeTransformation' smart constructor.
data GooglePrivacyDlpV2InfoTypeTransformation = GooglePrivacyDlpV2InfoTypeTransformation'
    { _gpdvittInfoTypes               :: !(Maybe [GooglePrivacyDlpV2InfoType])
    , _gpdvittPrimitiveTransformation :: !(Maybe GooglePrivacyDlpV2PrimitiveTransformation)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InfoTypeTransformation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvittInfoTypes'
--
-- * 'gpdvittPrimitiveTransformation'
googlePrivacyDlpV2InfoTypeTransformation
    :: GooglePrivacyDlpV2InfoTypeTransformation
googlePrivacyDlpV2InfoTypeTransformation =
    GooglePrivacyDlpV2InfoTypeTransformation'
    { _gpdvittInfoTypes = Nothing
    , _gpdvittPrimitiveTransformation = Nothing
    }

-- | InfoTypes to apply the transformation to. An empty list will cause this
-- transformation to apply to all findings that correspond to infoTypes
-- that were requested in \`InspectConfig\`.
gpdvittInfoTypes :: Lens' GooglePrivacyDlpV2InfoTypeTransformation [GooglePrivacyDlpV2InfoType]
gpdvittInfoTypes
  = lens _gpdvittInfoTypes
      (\ s a -> s{_gpdvittInfoTypes = a})
      . _Default
      . _Coerce

-- | Primitive transformation to apply to the infoType. [required]
gpdvittPrimitiveTransformation :: Lens' GooglePrivacyDlpV2InfoTypeTransformation (Maybe GooglePrivacyDlpV2PrimitiveTransformation)
gpdvittPrimitiveTransformation
  = lens _gpdvittPrimitiveTransformation
      (\ s a -> s{_gpdvittPrimitiveTransformation = a})

instance FromJSON
         GooglePrivacyDlpV2InfoTypeTransformation where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2InfoTypeTransformation"
              (\ o ->
                 GooglePrivacyDlpV2InfoTypeTransformation' <$>
                   (o .:? "infoTypes" .!= mempty) <*>
                     (o .:? "primitiveTransformation"))

instance ToJSON
         GooglePrivacyDlpV2InfoTypeTransformation where
        toJSON GooglePrivacyDlpV2InfoTypeTransformation'{..}
          = object
              (catMaybes
                 [("infoTypes" .=) <$> _gpdvittInfoTypes,
                  ("primitiveTransformation" .=) <$>
                    _gpdvittPrimitiveTransformation])

-- | General identifier of a data field in a storage service.
--
-- /See:/ 'googlePrivacyDlpV2FieldId' smart constructor.
newtype GooglePrivacyDlpV2FieldId = GooglePrivacyDlpV2FieldId'
    { _gpdvfiName :: Maybe Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2FieldId' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvfiName'
googlePrivacyDlpV2FieldId
    :: GooglePrivacyDlpV2FieldId
googlePrivacyDlpV2FieldId =
    GooglePrivacyDlpV2FieldId'
    { _gpdvfiName = Nothing
    }

-- | Name describing the field.
gpdvfiName :: Lens' GooglePrivacyDlpV2FieldId (Maybe Text)
gpdvfiName
  = lens _gpdvfiName (\ s a -> s{_gpdvfiName = a})

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

instance ToJSON GooglePrivacyDlpV2FieldId where
        toJSON GooglePrivacyDlpV2FieldId'{..}
          = object (catMaybes [("name" .=) <$> _gpdvfiName])

-- | Combines all of the information about a DLP job.
--
-- /See:/ 'googlePrivacyDlpV2DlpJob' smart constructor.
data GooglePrivacyDlpV2DlpJob = GooglePrivacyDlpV2DlpJob'
    { _gpdvdjInspectDetails :: !(Maybe GooglePrivacyDlpV2InspectDataSourceDetails)
    , _gpdvdjState          :: !(Maybe GooglePrivacyDlpV2DlpJobState)
    , _gpdvdjStartTime      :: !(Maybe DateTime')
    , _gpdvdjJobTriggerName :: !(Maybe Text)
    , _gpdvdjRiskDetails    :: !(Maybe GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails)
    , _gpdvdjName           :: !(Maybe Text)
    , _gpdvdjEndTime        :: !(Maybe DateTime')
    , _gpdvdjType           :: !(Maybe GooglePrivacyDlpV2DlpJobType)
    , _gpdvdjErrors         :: !(Maybe [GooglePrivacyDlpV2Error])
    , _gpdvdjCreateTime     :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2DlpJob' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvdjInspectDetails'
--
-- * 'gpdvdjState'
--
-- * 'gpdvdjStartTime'
--
-- * 'gpdvdjJobTriggerName'
--
-- * 'gpdvdjRiskDetails'
--
-- * 'gpdvdjName'
--
-- * 'gpdvdjEndTime'
--
-- * 'gpdvdjType'
--
-- * 'gpdvdjErrors'
--
-- * 'gpdvdjCreateTime'
googlePrivacyDlpV2DlpJob
    :: GooglePrivacyDlpV2DlpJob
googlePrivacyDlpV2DlpJob =
    GooglePrivacyDlpV2DlpJob'
    { _gpdvdjInspectDetails = Nothing
    , _gpdvdjState = Nothing
    , _gpdvdjStartTime = Nothing
    , _gpdvdjJobTriggerName = Nothing
    , _gpdvdjRiskDetails = Nothing
    , _gpdvdjName = Nothing
    , _gpdvdjEndTime = Nothing
    , _gpdvdjType = Nothing
    , _gpdvdjErrors = Nothing
    , _gpdvdjCreateTime = Nothing
    }

-- | Results from inspecting a data source.
gpdvdjInspectDetails :: Lens' GooglePrivacyDlpV2DlpJob (Maybe GooglePrivacyDlpV2InspectDataSourceDetails)
gpdvdjInspectDetails
  = lens _gpdvdjInspectDetails
      (\ s a -> s{_gpdvdjInspectDetails = a})

-- | State of a job.
gpdvdjState :: Lens' GooglePrivacyDlpV2DlpJob (Maybe GooglePrivacyDlpV2DlpJobState)
gpdvdjState
  = lens _gpdvdjState (\ s a -> s{_gpdvdjState = a})

-- | Time when the job started.
gpdvdjStartTime :: Lens' GooglePrivacyDlpV2DlpJob (Maybe UTCTime)
gpdvdjStartTime
  = lens _gpdvdjStartTime
      (\ s a -> s{_gpdvdjStartTime = a})
      . mapping _DateTime

-- | If created by a job trigger, the resource name of the trigger that
-- instantiated the job.
gpdvdjJobTriggerName :: Lens' GooglePrivacyDlpV2DlpJob (Maybe Text)
gpdvdjJobTriggerName
  = lens _gpdvdjJobTriggerName
      (\ s a -> s{_gpdvdjJobTriggerName = a})

-- | Results from analyzing risk of a data source.
gpdvdjRiskDetails :: Lens' GooglePrivacyDlpV2DlpJob (Maybe GooglePrivacyDlpV2AnalyzeDataSourceRiskDetails)
gpdvdjRiskDetails
  = lens _gpdvdjRiskDetails
      (\ s a -> s{_gpdvdjRiskDetails = a})

-- | The server-assigned name.
gpdvdjName :: Lens' GooglePrivacyDlpV2DlpJob (Maybe Text)
gpdvdjName
  = lens _gpdvdjName (\ s a -> s{_gpdvdjName = a})

-- | Time when the job finished.
gpdvdjEndTime :: Lens' GooglePrivacyDlpV2DlpJob (Maybe UTCTime)
gpdvdjEndTime
  = lens _gpdvdjEndTime
      (\ s a -> s{_gpdvdjEndTime = a})
      . mapping _DateTime

-- | The type of job.
gpdvdjType :: Lens' GooglePrivacyDlpV2DlpJob (Maybe GooglePrivacyDlpV2DlpJobType)
gpdvdjType
  = lens _gpdvdjType (\ s a -> s{_gpdvdjType = a})

-- | A stream of errors encountered running the job.
gpdvdjErrors :: Lens' GooglePrivacyDlpV2DlpJob [GooglePrivacyDlpV2Error]
gpdvdjErrors
  = lens _gpdvdjErrors (\ s a -> s{_gpdvdjErrors = a})
      . _Default
      . _Coerce

-- | Time when the job was created.
gpdvdjCreateTime :: Lens' GooglePrivacyDlpV2DlpJob (Maybe UTCTime)
gpdvdjCreateTime
  = lens _gpdvdjCreateTime
      (\ s a -> s{_gpdvdjCreateTime = a})
      . mapping _DateTime

instance FromJSON GooglePrivacyDlpV2DlpJob where
        parseJSON
          = withObject "GooglePrivacyDlpV2DlpJob"
              (\ o ->
                 GooglePrivacyDlpV2DlpJob' <$>
                   (o .:? "inspectDetails") <*> (o .:? "state") <*>
                     (o .:? "startTime")
                     <*> (o .:? "jobTriggerName")
                     <*> (o .:? "riskDetails")
                     <*> (o .:? "name")
                     <*> (o .:? "endTime")
                     <*> (o .:? "type")
                     <*> (o .:? "errors" .!= mempty)
                     <*> (o .:? "createTime"))

instance ToJSON GooglePrivacyDlpV2DlpJob where
        toJSON GooglePrivacyDlpV2DlpJob'{..}
          = object
              (catMaybes
                 [("inspectDetails" .=) <$> _gpdvdjInspectDetails,
                  ("state" .=) <$> _gpdvdjState,
                  ("startTime" .=) <$> _gpdvdjStartTime,
                  ("jobTriggerName" .=) <$> _gpdvdjJobTriggerName,
                  ("riskDetails" .=) <$> _gpdvdjRiskDetails,
                  ("name" .=) <$> _gpdvdjName,
                  ("endTime" .=) <$> _gpdvdjEndTime,
                  ("type" .=) <$> _gpdvdjType,
                  ("errors" .=) <$> _gpdvdjErrors,
                  ("createTime" .=) <$> _gpdvdjCreateTime])

-- | A type of transformation that is applied over structured data such as a
-- table.
--
-- /See:/ 'googlePrivacyDlpV2RecordTransformations' smart constructor.
data GooglePrivacyDlpV2RecordTransformations = GooglePrivacyDlpV2RecordTransformations'
    { _gpdvrtRecordSuppressions   :: !(Maybe [GooglePrivacyDlpV2RecordSuppression])
    , _gpdvrtFieldTransformations :: !(Maybe [GooglePrivacyDlpV2FieldTransformation])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RecordTransformations' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrtRecordSuppressions'
--
-- * 'gpdvrtFieldTransformations'
googlePrivacyDlpV2RecordTransformations
    :: GooglePrivacyDlpV2RecordTransformations
googlePrivacyDlpV2RecordTransformations =
    GooglePrivacyDlpV2RecordTransformations'
    { _gpdvrtRecordSuppressions = Nothing
    , _gpdvrtFieldTransformations = Nothing
    }

-- | Configuration defining which records get suppressed entirely. Records
-- that match any suppression rule are omitted from the output [optional].
gpdvrtRecordSuppressions :: Lens' GooglePrivacyDlpV2RecordTransformations [GooglePrivacyDlpV2RecordSuppression]
gpdvrtRecordSuppressions
  = lens _gpdvrtRecordSuppressions
      (\ s a -> s{_gpdvrtRecordSuppressions = a})
      . _Default
      . _Coerce

-- | Transform the record by applying various field transformations.
gpdvrtFieldTransformations :: Lens' GooglePrivacyDlpV2RecordTransformations [GooglePrivacyDlpV2FieldTransformation]
gpdvrtFieldTransformations
  = lens _gpdvrtFieldTransformations
      (\ s a -> s{_gpdvrtFieldTransformations = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2RecordTransformations where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2RecordTransformations"
              (\ o ->
                 GooglePrivacyDlpV2RecordTransformations' <$>
                   (o .:? "recordSuppressions" .!= mempty) <*>
                     (o .:? "fieldTransformations" .!= mempty))

instance ToJSON
         GooglePrivacyDlpV2RecordTransformations where
        toJSON GooglePrivacyDlpV2RecordTransformations'{..}
          = object
              (catMaybes
                 [("recordSuppressions" .=) <$>
                    _gpdvrtRecordSuppressions,
                  ("fieldTransformations" .=) <$>
                    _gpdvrtFieldTransformations])

-- | A unique identifier for a Datastore entity. If a key\'s partition ID or
-- any of its path kinds or names are reserved\/read-only, the key is
-- reserved\/read-only. A reserved\/read-only key is forbidden in certain
-- documented contexts.
--
-- /See:/ 'googlePrivacyDlpV2Key' smart constructor.
data GooglePrivacyDlpV2Key = GooglePrivacyDlpV2Key'
    { _gpdvkPartitionId :: !(Maybe GooglePrivacyDlpV2PartitionId)
    , _gpdvkPath        :: !(Maybe [GooglePrivacyDlpV2PathElement])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2Key' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvkPartitionId'
--
-- * 'gpdvkPath'
googlePrivacyDlpV2Key
    :: GooglePrivacyDlpV2Key
googlePrivacyDlpV2Key =
    GooglePrivacyDlpV2Key'
    { _gpdvkPartitionId = Nothing
    , _gpdvkPath = Nothing
    }

-- | Entities are partitioned into subsets, currently identified by a project
-- ID and namespace ID. Queries are scoped to a single partition.
gpdvkPartitionId :: Lens' GooglePrivacyDlpV2Key (Maybe GooglePrivacyDlpV2PartitionId)
gpdvkPartitionId
  = lens _gpdvkPartitionId
      (\ s a -> s{_gpdvkPartitionId = a})

-- | The entity path. An entity path consists of one or more elements
-- composed of a kind and a string or numerical identifier, which identify
-- entities. The first element identifies a _root entity_, the second
-- element identifies a _child_ of the root entity, the third element
-- identifies a child of the second entity, and so forth. The entities
-- identified by all prefixes of the path are called the element\'s
-- _ancestors_. A path can never be empty, and a path can have at most 100
-- elements.
gpdvkPath :: Lens' GooglePrivacyDlpV2Key [GooglePrivacyDlpV2PathElement]
gpdvkPath
  = lens _gpdvkPath (\ s a -> s{_gpdvkPath = a}) .
      _Default
      . _Coerce

instance FromJSON GooglePrivacyDlpV2Key where
        parseJSON
          = withObject "GooglePrivacyDlpV2Key"
              (\ o ->
                 GooglePrivacyDlpV2Key' <$>
                   (o .:? "partitionId") <*> (o .:? "path" .!= mempty))

instance ToJSON GooglePrivacyDlpV2Key where
        toJSON GooglePrivacyDlpV2Key'{..}
          = object
              (catMaybes
                 [("partitionId" .=) <$> _gpdvkPartitionId,
                  ("path" .=) <$> _gpdvkPath])

-- | Generalization function that buckets values based on ranges. The ranges
-- and replacement values are dynamically provided by the user for custom
-- behavior, such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH This can be
-- used on data of type: number, long, string, timestamp. If the bound
-- \`Value\` type differs from the type of data being transformed, we will
-- first attempt converting the type of the data to be transformed to match
-- the type of the bound before comparing. See
-- https:\/\/cloud.google.com\/dlp\/docs\/concepts-bucketing to learn more.
--
-- /See:/ 'googlePrivacyDlpV2BucketingConfig' smart constructor.
newtype GooglePrivacyDlpV2BucketingConfig = GooglePrivacyDlpV2BucketingConfig'
    { _gpdvbcBuckets :: Maybe [GooglePrivacyDlpV2Bucket]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2BucketingConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvbcBuckets'
googlePrivacyDlpV2BucketingConfig
    :: GooglePrivacyDlpV2BucketingConfig
googlePrivacyDlpV2BucketingConfig =
    GooglePrivacyDlpV2BucketingConfig'
    { _gpdvbcBuckets = Nothing
    }

-- | Set of buckets. Ranges must be non-overlapping.
gpdvbcBuckets :: Lens' GooglePrivacyDlpV2BucketingConfig [GooglePrivacyDlpV2Bucket]
gpdvbcBuckets
  = lens _gpdvbcBuckets
      (\ s a -> s{_gpdvbcBuckets = a})
      . _Default
      . _Coerce

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

instance ToJSON GooglePrivacyDlpV2BucketingConfig
         where
        toJSON GooglePrivacyDlpV2BucketingConfig'{..}
          = object
              (catMaybes [("buckets" .=) <$> _gpdvbcBuckets])

-- | Configuration description of the scanning process. When used with
-- redactContent only info_types and min_likelihood are currently used.
--
-- /See:/ 'googlePrivacyDlpV2InspectConfig' smart constructor.
data GooglePrivacyDlpV2InspectConfig = GooglePrivacyDlpV2InspectConfig'
    { _gpdvicInfoTypes        :: !(Maybe [GooglePrivacyDlpV2InfoType])
    , _gpdvicMinLikelihood    :: !(Maybe GooglePrivacyDlpV2InspectConfigMinLikelihood)
    , _gpdvicExcludeInfoTypes :: !(Maybe Bool)
    , _gpdvicIncludeQuote     :: !(Maybe Bool)
    , _gpdvicCustomInfoTypes  :: !(Maybe [GooglePrivacyDlpV2CustomInfoType])
    , _gpdvicLimits           :: !(Maybe GooglePrivacyDlpV2FindingLimits)
    , _gpdvicContentOptions   :: !(Maybe [Text])
    , _gpdvicRuleSet          :: !(Maybe [GooglePrivacyDlpV2InspectionRuleSet])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InspectConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvicInfoTypes'
--
-- * 'gpdvicMinLikelihood'
--
-- * 'gpdvicExcludeInfoTypes'
--
-- * 'gpdvicIncludeQuote'
--
-- * 'gpdvicCustomInfoTypes'
--
-- * 'gpdvicLimits'
--
-- * 'gpdvicContentOptions'
--
-- * 'gpdvicRuleSet'
googlePrivacyDlpV2InspectConfig
    :: GooglePrivacyDlpV2InspectConfig
googlePrivacyDlpV2InspectConfig =
    GooglePrivacyDlpV2InspectConfig'
    { _gpdvicInfoTypes = Nothing
    , _gpdvicMinLikelihood = Nothing
    , _gpdvicExcludeInfoTypes = Nothing
    , _gpdvicIncludeQuote = Nothing
    , _gpdvicCustomInfoTypes = Nothing
    , _gpdvicLimits = Nothing
    , _gpdvicContentOptions = Nothing
    , _gpdvicRuleSet = Nothing
    }

-- | Restricts what info_types to look for. The values must correspond to
-- InfoType values returned by ListInfoTypes or listed at
-- https:\/\/cloud.google.com\/dlp\/docs\/infotypes-reference. When no
-- InfoTypes or CustomInfoTypes are specified in a request, the system may
-- automatically choose what detectors to run. By default this may be all
-- types, but may change over time as detectors are updated. The special
-- InfoType name \"ALL_BASIC\" can be used to trigger all detectors, but
-- may change over time as new InfoTypes are added. If you need precise
-- control and predictability as to what detectors are run you should
-- specify specific InfoTypes listed in the reference.
gpdvicInfoTypes :: Lens' GooglePrivacyDlpV2InspectConfig [GooglePrivacyDlpV2InfoType]
gpdvicInfoTypes
  = lens _gpdvicInfoTypes
      (\ s a -> s{_gpdvicInfoTypes = a})
      . _Default
      . _Coerce

-- | Only returns findings equal or above this threshold. The default is
-- POSSIBLE. See https:\/\/cloud.google.com\/dlp\/docs\/likelihood to learn
-- more.
gpdvicMinLikelihood :: Lens' GooglePrivacyDlpV2InspectConfig (Maybe GooglePrivacyDlpV2InspectConfigMinLikelihood)
gpdvicMinLikelihood
  = lens _gpdvicMinLikelihood
      (\ s a -> s{_gpdvicMinLikelihood = a})

-- | When true, excludes type information of the findings.
gpdvicExcludeInfoTypes :: Lens' GooglePrivacyDlpV2InspectConfig (Maybe Bool)
gpdvicExcludeInfoTypes
  = lens _gpdvicExcludeInfoTypes
      (\ s a -> s{_gpdvicExcludeInfoTypes = a})

-- | When true, a contextual quote from the data that triggered a finding is
-- included in the response; see Finding.quote.
gpdvicIncludeQuote :: Lens' GooglePrivacyDlpV2InspectConfig (Maybe Bool)
gpdvicIncludeQuote
  = lens _gpdvicIncludeQuote
      (\ s a -> s{_gpdvicIncludeQuote = a})

-- | CustomInfoTypes provided by the user. See
-- https:\/\/cloud.google.com\/dlp\/docs\/creating-custom-infotypes to
-- learn more.
gpdvicCustomInfoTypes :: Lens' GooglePrivacyDlpV2InspectConfig [GooglePrivacyDlpV2CustomInfoType]
gpdvicCustomInfoTypes
  = lens _gpdvicCustomInfoTypes
      (\ s a -> s{_gpdvicCustomInfoTypes = a})
      . _Default
      . _Coerce

gpdvicLimits :: Lens' GooglePrivacyDlpV2InspectConfig (Maybe GooglePrivacyDlpV2FindingLimits)
gpdvicLimits
  = lens _gpdvicLimits (\ s a -> s{_gpdvicLimits = a})

-- | List of options defining data content to scan. If empty, text, images,
-- and other content will be included.
gpdvicContentOptions :: Lens' GooglePrivacyDlpV2InspectConfig [Text]
gpdvicContentOptions
  = lens _gpdvicContentOptions
      (\ s a -> s{_gpdvicContentOptions = a})
      . _Default
      . _Coerce

-- | Set of rules to apply to the findings for this InspectConfig. Exclusion
-- rules, contained in the set are executed in the end, other rules are
-- executed in the order they are specified for each info type.
gpdvicRuleSet :: Lens' GooglePrivacyDlpV2InspectConfig [GooglePrivacyDlpV2InspectionRuleSet]
gpdvicRuleSet
  = lens _gpdvicRuleSet
      (\ s a -> s{_gpdvicRuleSet = a})
      . _Default
      . _Coerce

instance FromJSON GooglePrivacyDlpV2InspectConfig
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2InspectConfig"
              (\ o ->
                 GooglePrivacyDlpV2InspectConfig' <$>
                   (o .:? "infoTypes" .!= mempty) <*>
                     (o .:? "minLikelihood")
                     <*> (o .:? "excludeInfoTypes")
                     <*> (o .:? "includeQuote")
                     <*> (o .:? "customInfoTypes" .!= mempty)
                     <*> (o .:? "limits")
                     <*> (o .:? "contentOptions" .!= mempty)
                     <*> (o .:? "ruleSet" .!= mempty))

instance ToJSON GooglePrivacyDlpV2InspectConfig where
        toJSON GooglePrivacyDlpV2InspectConfig'{..}
          = object
              (catMaybes
                 [("infoTypes" .=) <$> _gpdvicInfoTypes,
                  ("minLikelihood" .=) <$> _gpdvicMinLikelihood,
                  ("excludeInfoTypes" .=) <$> _gpdvicExcludeInfoTypes,
                  ("includeQuote" .=) <$> _gpdvicIncludeQuote,
                  ("customInfoTypes" .=) <$> _gpdvicCustomInfoTypes,
                  ("limits" .=) <$> _gpdvicLimits,
                  ("contentOptions" .=) <$> _gpdvicContentOptions,
                  ("ruleSet" .=) <$> _gpdvicRuleSet])

-- | Configuration for a risk analysis job. See
-- https:\/\/cloud.google.com\/dlp\/docs\/concepts-risk-analysis to learn
-- more.
--
-- /See:/ 'googlePrivacyDlpV2RiskAnalysisJobConfig' smart constructor.
data GooglePrivacyDlpV2RiskAnalysisJobConfig = GooglePrivacyDlpV2RiskAnalysisJobConfig'
    { _gpdvrajcPrivacyMetric :: !(Maybe GooglePrivacyDlpV2PrivacyMetric)
    , _gpdvrajcActions       :: !(Maybe [GooglePrivacyDlpV2Action])
    , _gpdvrajcSourceTable   :: !(Maybe GooglePrivacyDlpV2BigQueryTable)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RiskAnalysisJobConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrajcPrivacyMetric'
--
-- * 'gpdvrajcActions'
--
-- * 'gpdvrajcSourceTable'
googlePrivacyDlpV2RiskAnalysisJobConfig
    :: GooglePrivacyDlpV2RiskAnalysisJobConfig
googlePrivacyDlpV2RiskAnalysisJobConfig =
    GooglePrivacyDlpV2RiskAnalysisJobConfig'
    { _gpdvrajcPrivacyMetric = Nothing
    , _gpdvrajcActions = Nothing
    , _gpdvrajcSourceTable = Nothing
    }

-- | Privacy metric to compute.
gpdvrajcPrivacyMetric :: Lens' GooglePrivacyDlpV2RiskAnalysisJobConfig (Maybe GooglePrivacyDlpV2PrivacyMetric)
gpdvrajcPrivacyMetric
  = lens _gpdvrajcPrivacyMetric
      (\ s a -> s{_gpdvrajcPrivacyMetric = a})

-- | Actions to execute at the completion of the job. Are executed in the
-- order provided.
gpdvrajcActions :: Lens' GooglePrivacyDlpV2RiskAnalysisJobConfig [GooglePrivacyDlpV2Action]
gpdvrajcActions
  = lens _gpdvrajcActions
      (\ s a -> s{_gpdvrajcActions = a})
      . _Default
      . _Coerce

-- | Input dataset to compute metrics over.
gpdvrajcSourceTable :: Lens' GooglePrivacyDlpV2RiskAnalysisJobConfig (Maybe GooglePrivacyDlpV2BigQueryTable)
gpdvrajcSourceTable
  = lens _gpdvrajcSourceTable
      (\ s a -> s{_gpdvrajcSourceTable = a})

instance FromJSON
         GooglePrivacyDlpV2RiskAnalysisJobConfig where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2RiskAnalysisJobConfig"
              (\ o ->
                 GooglePrivacyDlpV2RiskAnalysisJobConfig' <$>
                   (o .:? "privacyMetric") <*>
                     (o .:? "actions" .!= mempty)
                     <*> (o .:? "sourceTable"))

instance ToJSON
         GooglePrivacyDlpV2RiskAnalysisJobConfig where
        toJSON GooglePrivacyDlpV2RiskAnalysisJobConfig'{..}
          = object
              (catMaybes
                 [("privacyMetric" .=) <$> _gpdvrajcPrivacyMetric,
                  ("actions" .=) <$> _gpdvrajcActions,
                  ("sourceTable" .=) <$> _gpdvrajcSourceTable])

-- | Message for infoType-dependent details parsed from quote.
--
-- /See:/ 'googlePrivacyDlpV2QuoteInfo' smart constructor.
newtype GooglePrivacyDlpV2QuoteInfo = GooglePrivacyDlpV2QuoteInfo'
    { _gpdvqiDateTime :: Maybe GooglePrivacyDlpV2DateTime
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2QuoteInfo' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvqiDateTime'
googlePrivacyDlpV2QuoteInfo
    :: GooglePrivacyDlpV2QuoteInfo
googlePrivacyDlpV2QuoteInfo =
    GooglePrivacyDlpV2QuoteInfo'
    { _gpdvqiDateTime = Nothing
    }

-- | The date time indicated by the quote.
gpdvqiDateTime :: Lens' GooglePrivacyDlpV2QuoteInfo (Maybe GooglePrivacyDlpV2DateTime)
gpdvqiDateTime
  = lens _gpdvqiDateTime
      (\ s a -> s{_gpdvqiDateTime = a})

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

instance ToJSON GooglePrivacyDlpV2QuoteInfo where
        toJSON GooglePrivacyDlpV2QuoteInfo'{..}
          = object
              (catMaybes [("dateTime" .=) <$> _gpdvqiDateTime])

-- | Configuration to suppress records whose suppression conditions evaluate
-- to true.
--
-- /See:/ 'googlePrivacyDlpV2RecordSuppression' smart constructor.
newtype GooglePrivacyDlpV2RecordSuppression = GooglePrivacyDlpV2RecordSuppression'
    { _gpdvrsCondition :: Maybe GooglePrivacyDlpV2RecordCondition
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RecordSuppression' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrsCondition'
googlePrivacyDlpV2RecordSuppression
    :: GooglePrivacyDlpV2RecordSuppression
googlePrivacyDlpV2RecordSuppression =
    GooglePrivacyDlpV2RecordSuppression'
    { _gpdvrsCondition = Nothing
    }

-- | A condition that when it evaluates to true will result in the record
-- being evaluated to be suppressed from the transformed content.
gpdvrsCondition :: Lens' GooglePrivacyDlpV2RecordSuppression (Maybe GooglePrivacyDlpV2RecordCondition)
gpdvrsCondition
  = lens _gpdvrsCondition
      (\ s a -> s{_gpdvrsCondition = a})

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

instance ToJSON GooglePrivacyDlpV2RecordSuppression
         where
        toJSON GooglePrivacyDlpV2RecordSuppression'{..}
          = object
              (catMaybes [("condition" .=) <$> _gpdvrsCondition])

-- | This is a data encryption key (DEK) (as opposed to a key encryption key
-- (KEK) stored by KMS). When using KMS to wrap\/unwrap DEKs, be sure to
-- set an appropriate IAM policy on the KMS CryptoKey (KEK) to ensure an
-- attacker cannot unwrap the data crypto key.
--
-- /See:/ 'googlePrivacyDlpV2CryptoKey' smart constructor.
data GooglePrivacyDlpV2CryptoKey = GooglePrivacyDlpV2CryptoKey'
    { _gpdvckTransient  :: !(Maybe GooglePrivacyDlpV2TransientCryptoKey)
    , _gpdvckKmsWrApped :: !(Maybe GooglePrivacyDlpV2KmsWrAppedCryptoKey)
    , _gpdvckUnwrApped  :: !(Maybe GooglePrivacyDlpV2UnwrAppedCryptoKey)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CryptoKey' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvckTransient'
--
-- * 'gpdvckKmsWrApped'
--
-- * 'gpdvckUnwrApped'
googlePrivacyDlpV2CryptoKey
    :: GooglePrivacyDlpV2CryptoKey
googlePrivacyDlpV2CryptoKey =
    GooglePrivacyDlpV2CryptoKey'
    { _gpdvckTransient = Nothing
    , _gpdvckKmsWrApped = Nothing
    , _gpdvckUnwrApped = Nothing
    }

gpdvckTransient :: Lens' GooglePrivacyDlpV2CryptoKey (Maybe GooglePrivacyDlpV2TransientCryptoKey)
gpdvckTransient
  = lens _gpdvckTransient
      (\ s a -> s{_gpdvckTransient = a})

gpdvckKmsWrApped :: Lens' GooglePrivacyDlpV2CryptoKey (Maybe GooglePrivacyDlpV2KmsWrAppedCryptoKey)
gpdvckKmsWrApped
  = lens _gpdvckKmsWrApped
      (\ s a -> s{_gpdvckKmsWrApped = a})

gpdvckUnwrApped :: Lens' GooglePrivacyDlpV2CryptoKey (Maybe GooglePrivacyDlpV2UnwrAppedCryptoKey)
gpdvckUnwrApped
  = lens _gpdvckUnwrApped
      (\ s a -> s{_gpdvckUnwrApped = a})

instance FromJSON GooglePrivacyDlpV2CryptoKey where
        parseJSON
          = withObject "GooglePrivacyDlpV2CryptoKey"
              (\ o ->
                 GooglePrivacyDlpV2CryptoKey' <$>
                   (o .:? "transient") <*> (o .:? "kmsWrapped") <*>
                     (o .:? "unwrapped"))

instance ToJSON GooglePrivacyDlpV2CryptoKey where
        toJSON GooglePrivacyDlpV2CryptoKey'{..}
          = object
              (catMaybes
                 [("transient" .=) <$> _gpdvckTransient,
                  ("kmsWrapped" .=) <$> _gpdvckKmsWrApped,
                  ("unwrapped" .=) <$> _gpdvckUnwrApped])

-- | Configuration for a custom dictionary created from a data source of any
-- size up to the maximum size defined in the
-- [limits](https:\/\/cloud.google.com\/dlp\/limits) page. The artifacts of
-- dictionary creation are stored in the specified Google Cloud Storage
-- location. Consider using \`CustomInfoType.Dictionary\` for smaller
-- dictionaries that satisfy the size requirements.
--
-- /See:/ 'googlePrivacyDlpV2LargeCustomDictionaryConfig' smart constructor.
data GooglePrivacyDlpV2LargeCustomDictionaryConfig = GooglePrivacyDlpV2LargeCustomDictionaryConfig'
    { _gpdvlcdcBigQueryField       :: !(Maybe GooglePrivacyDlpV2BigQueryField)
    , _gpdvlcdcCloudStorageFileSet :: !(Maybe GooglePrivacyDlpV2CloudStorageFileSet)
    , _gpdvlcdcOutputPath          :: !(Maybe GooglePrivacyDlpV2CloudStoragePath)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2LargeCustomDictionaryConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvlcdcBigQueryField'
--
-- * 'gpdvlcdcCloudStorageFileSet'
--
-- * 'gpdvlcdcOutputPath'
googlePrivacyDlpV2LargeCustomDictionaryConfig
    :: GooglePrivacyDlpV2LargeCustomDictionaryConfig
googlePrivacyDlpV2LargeCustomDictionaryConfig =
    GooglePrivacyDlpV2LargeCustomDictionaryConfig'
    { _gpdvlcdcBigQueryField = Nothing
    , _gpdvlcdcCloudStorageFileSet = Nothing
    , _gpdvlcdcOutputPath = Nothing
    }

-- | Field in a BigQuery table where each cell represents a dictionary
-- phrase.
gpdvlcdcBigQueryField :: Lens' GooglePrivacyDlpV2LargeCustomDictionaryConfig (Maybe GooglePrivacyDlpV2BigQueryField)
gpdvlcdcBigQueryField
  = lens _gpdvlcdcBigQueryField
      (\ s a -> s{_gpdvlcdcBigQueryField = a})

-- | Set of files containing newline-delimited lists of dictionary phrases.
gpdvlcdcCloudStorageFileSet :: Lens' GooglePrivacyDlpV2LargeCustomDictionaryConfig (Maybe GooglePrivacyDlpV2CloudStorageFileSet)
gpdvlcdcCloudStorageFileSet
  = lens _gpdvlcdcCloudStorageFileSet
      (\ s a -> s{_gpdvlcdcCloudStorageFileSet = a})

-- | Location to store dictionary artifacts in Google Cloud Storage. These
-- files will only be accessible by project owners and the DLP API. If any
-- of these artifacts are modified, the dictionary is considered invalid
-- and can no longer be used.
gpdvlcdcOutputPath :: Lens' GooglePrivacyDlpV2LargeCustomDictionaryConfig (Maybe GooglePrivacyDlpV2CloudStoragePath)
gpdvlcdcOutputPath
  = lens _gpdvlcdcOutputPath
      (\ s a -> s{_gpdvlcdcOutputPath = a})

instance FromJSON
         GooglePrivacyDlpV2LargeCustomDictionaryConfig where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2LargeCustomDictionaryConfig"
              (\ o ->
                 GooglePrivacyDlpV2LargeCustomDictionaryConfig' <$>
                   (o .:? "bigQueryField") <*>
                     (o .:? "cloudStorageFileSet")
                     <*> (o .:? "outputPath"))

instance ToJSON
         GooglePrivacyDlpV2LargeCustomDictionaryConfig where
        toJSON
          GooglePrivacyDlpV2LargeCustomDictionaryConfig'{..}
          = object
              (catMaybes
                 [("bigQueryField" .=) <$> _gpdvlcdcBigQueryField,
                  ("cloudStorageFileSet" .=) <$>
                    _gpdvlcdcCloudStorageFileSet,
                  ("outputPath" .=) <$> _gpdvlcdcOutputPath])

-- | Message defining a list of words or phrases to search for in the data.
--
-- /See:/ 'googlePrivacyDlpV2WordList' smart constructor.
newtype GooglePrivacyDlpV2WordList = GooglePrivacyDlpV2WordList'
    { _gpdvwlWords :: Maybe [Text]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2WordList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvwlWords'
googlePrivacyDlpV2WordList
    :: GooglePrivacyDlpV2WordList
googlePrivacyDlpV2WordList =
    GooglePrivacyDlpV2WordList'
    { _gpdvwlWords = Nothing
    }

-- | Words or phrases defining the dictionary. The dictionary must contain at
-- least one phrase and every phrase must contain at least 2 characters
-- that are letters or digits. [required]
gpdvwlWords :: Lens' GooglePrivacyDlpV2WordList [Text]
gpdvwlWords
  = lens _gpdvwlWords (\ s a -> s{_gpdvwlWords = a}) .
      _Default
      . _Coerce

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

instance ToJSON GooglePrivacyDlpV2WordList where
        toJSON GooglePrivacyDlpV2WordList'{..}
          = object (catMaybes [("words" .=) <$> _gpdvwlWords])

-- | Container structure for the content to inspect.
--
-- /See:/ 'googlePrivacyDlpV2ContentItem' smart constructor.
data GooglePrivacyDlpV2ContentItem = GooglePrivacyDlpV2ContentItem'
    { _gpdvciValue    :: !(Maybe Text)
    , _gpdvciByteItem :: !(Maybe GooglePrivacyDlpV2ByteContentItem)
    , _gpdvciTable    :: !(Maybe GooglePrivacyDlpV2Table)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2ContentItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvciValue'
--
-- * 'gpdvciByteItem'
--
-- * 'gpdvciTable'
googlePrivacyDlpV2ContentItem
    :: GooglePrivacyDlpV2ContentItem
googlePrivacyDlpV2ContentItem =
    GooglePrivacyDlpV2ContentItem'
    { _gpdvciValue = Nothing
    , _gpdvciByteItem = Nothing
    , _gpdvciTable = Nothing
    }

-- | String data to inspect or redact.
gpdvciValue :: Lens' GooglePrivacyDlpV2ContentItem (Maybe Text)
gpdvciValue
  = lens _gpdvciValue (\ s a -> s{_gpdvciValue = a})

-- | Content data to inspect or redact. Replaces \`type\` and \`data\`.
gpdvciByteItem :: Lens' GooglePrivacyDlpV2ContentItem (Maybe GooglePrivacyDlpV2ByteContentItem)
gpdvciByteItem
  = lens _gpdvciByteItem
      (\ s a -> s{_gpdvciByteItem = a})

-- | Structured content for inspection. See
-- https:\/\/cloud.google.com\/dlp\/docs\/inspecting-text#inspecting_a_table
-- to learn more.
gpdvciTable :: Lens' GooglePrivacyDlpV2ContentItem (Maybe GooglePrivacyDlpV2Table)
gpdvciTable
  = lens _gpdvciTable (\ s a -> s{_gpdvciTable = a})

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

instance ToJSON GooglePrivacyDlpV2ContentItem where
        toJSON GooglePrivacyDlpV2ContentItem'{..}
          = object
              (catMaybes
                 [("value" .=) <$> _gpdvciValue,
                  ("byteItem" .=) <$> _gpdvciByteItem,
                  ("table" .=) <$> _gpdvciTable])

--
-- /See:/ 'googlePrivacyDlpV2CategoricalStatsHistogramBucket' smart constructor.
data GooglePrivacyDlpV2CategoricalStatsHistogramBucket = GooglePrivacyDlpV2CategoricalStatsHistogramBucket'
    { _gpdvcshbValueFrequencyLowerBound :: !(Maybe (Textual Int64))
    , _gpdvcshbBucketValues             :: !(Maybe [GooglePrivacyDlpV2ValueFrequency])
    , _gpdvcshbValueFrequencyUpperBound :: !(Maybe (Textual Int64))
    , _gpdvcshbBucketSize               :: !(Maybe (Textual Int64))
    , _gpdvcshbBucketValueCount         :: !(Maybe (Textual Int64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CategoricalStatsHistogramBucket' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcshbValueFrequencyLowerBound'
--
-- * 'gpdvcshbBucketValues'
--
-- * 'gpdvcshbValueFrequencyUpperBound'
--
-- * 'gpdvcshbBucketSize'
--
-- * 'gpdvcshbBucketValueCount'
googlePrivacyDlpV2CategoricalStatsHistogramBucket
    :: GooglePrivacyDlpV2CategoricalStatsHistogramBucket
googlePrivacyDlpV2CategoricalStatsHistogramBucket =
    GooglePrivacyDlpV2CategoricalStatsHistogramBucket'
    { _gpdvcshbValueFrequencyLowerBound = Nothing
    , _gpdvcshbBucketValues = Nothing
    , _gpdvcshbValueFrequencyUpperBound = Nothing
    , _gpdvcshbBucketSize = Nothing
    , _gpdvcshbBucketValueCount = Nothing
    }

-- | Lower bound on the value frequency of the values in this bucket.
gpdvcshbValueFrequencyLowerBound :: Lens' GooglePrivacyDlpV2CategoricalStatsHistogramBucket (Maybe Int64)
gpdvcshbValueFrequencyLowerBound
  = lens _gpdvcshbValueFrequencyLowerBound
      (\ s a -> s{_gpdvcshbValueFrequencyLowerBound = a})
      . mapping _Coerce

-- | Sample of value frequencies in this bucket. The total number of values
-- returned per bucket is capped at 20.
gpdvcshbBucketValues :: Lens' GooglePrivacyDlpV2CategoricalStatsHistogramBucket [GooglePrivacyDlpV2ValueFrequency]
gpdvcshbBucketValues
  = lens _gpdvcshbBucketValues
      (\ s a -> s{_gpdvcshbBucketValues = a})
      . _Default
      . _Coerce

-- | Upper bound on the value frequency of the values in this bucket.
gpdvcshbValueFrequencyUpperBound :: Lens' GooglePrivacyDlpV2CategoricalStatsHistogramBucket (Maybe Int64)
gpdvcshbValueFrequencyUpperBound
  = lens _gpdvcshbValueFrequencyUpperBound
      (\ s a -> s{_gpdvcshbValueFrequencyUpperBound = a})
      . mapping _Coerce

-- | Total number of values in this bucket.
gpdvcshbBucketSize :: Lens' GooglePrivacyDlpV2CategoricalStatsHistogramBucket (Maybe Int64)
gpdvcshbBucketSize
  = lens _gpdvcshbBucketSize
      (\ s a -> s{_gpdvcshbBucketSize = a})
      . mapping _Coerce

-- | Total number of distinct values in this bucket.
gpdvcshbBucketValueCount :: Lens' GooglePrivacyDlpV2CategoricalStatsHistogramBucket (Maybe Int64)
gpdvcshbBucketValueCount
  = lens _gpdvcshbBucketValueCount
      (\ s a -> s{_gpdvcshbBucketValueCount = a})
      . mapping _Coerce

instance FromJSON
         GooglePrivacyDlpV2CategoricalStatsHistogramBucket
         where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2CategoricalStatsHistogramBucket"
              (\ o ->
                 GooglePrivacyDlpV2CategoricalStatsHistogramBucket'
                   <$>
                   (o .:? "valueFrequencyLowerBound") <*>
                     (o .:? "bucketValues" .!= mempty)
                     <*> (o .:? "valueFrequencyUpperBound")
                     <*> (o .:? "bucketSize")
                     <*> (o .:? "bucketValueCount"))

instance ToJSON
         GooglePrivacyDlpV2CategoricalStatsHistogramBucket
         where
        toJSON
          GooglePrivacyDlpV2CategoricalStatsHistogramBucket'{..}
          = object
              (catMaybes
                 [("valueFrequencyLowerBound" .=) <$>
                    _gpdvcshbValueFrequencyLowerBound,
                  ("bucketValues" .=) <$> _gpdvcshbBucketValues,
                  ("valueFrequencyUpperBound" .=) <$>
                    _gpdvcshbValueFrequencyUpperBound,
                  ("bucketSize" .=) <$> _gpdvcshbBucketSize,
                  ("bucketValueCount" .=) <$>
                    _gpdvcshbBucketValueCount])

--
-- /See:/ 'googlePrivacyDlpV2Result' smart constructor.
data GooglePrivacyDlpV2Result = GooglePrivacyDlpV2Result'
    { _gpdvrProcessedBytes      :: !(Maybe (Textual Int64))
    , _gpdvrInfoTypeStats       :: !(Maybe [GooglePrivacyDlpV2InfoTypeStats])
    , _gpdvrTotalEstimatedBytes :: !(Maybe (Textual Int64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2Result' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrProcessedBytes'
--
-- * 'gpdvrInfoTypeStats'
--
-- * 'gpdvrTotalEstimatedBytes'
googlePrivacyDlpV2Result
    :: GooglePrivacyDlpV2Result
googlePrivacyDlpV2Result =
    GooglePrivacyDlpV2Result'
    { _gpdvrProcessedBytes = Nothing
    , _gpdvrInfoTypeStats = Nothing
    , _gpdvrTotalEstimatedBytes = Nothing
    }

-- | Total size in bytes that were processed.
gpdvrProcessedBytes :: Lens' GooglePrivacyDlpV2Result (Maybe Int64)
gpdvrProcessedBytes
  = lens _gpdvrProcessedBytes
      (\ s a -> s{_gpdvrProcessedBytes = a})
      . mapping _Coerce

-- | Statistics of how many instances of each info type were found during
-- inspect job.
gpdvrInfoTypeStats :: Lens' GooglePrivacyDlpV2Result [GooglePrivacyDlpV2InfoTypeStats]
gpdvrInfoTypeStats
  = lens _gpdvrInfoTypeStats
      (\ s a -> s{_gpdvrInfoTypeStats = a})
      . _Default
      . _Coerce

-- | Estimate of the number of bytes to process.
gpdvrTotalEstimatedBytes :: Lens' GooglePrivacyDlpV2Result (Maybe Int64)
gpdvrTotalEstimatedBytes
  = lens _gpdvrTotalEstimatedBytes
      (\ s a -> s{_gpdvrTotalEstimatedBytes = a})
      . mapping _Coerce

instance FromJSON GooglePrivacyDlpV2Result where
        parseJSON
          = withObject "GooglePrivacyDlpV2Result"
              (\ o ->
                 GooglePrivacyDlpV2Result' <$>
                   (o .:? "processedBytes") <*>
                     (o .:? "infoTypeStats" .!= mempty)
                     <*> (o .:? "totalEstimatedBytes"))

instance ToJSON GooglePrivacyDlpV2Result where
        toJSON GooglePrivacyDlpV2Result'{..}
          = object
              (catMaybes
                 [("processedBytes" .=) <$> _gpdvrProcessedBytes,
                  ("infoTypeStats" .=) <$> _gpdvrInfoTypeStats,
                  ("totalEstimatedBytes" .=) <$>
                    _gpdvrTotalEstimatedBytes])

-- | The results of an inspect DataSource job.
--
-- /See:/ 'googlePrivacyDlpV2InspectDataSourceDetails' smart constructor.
data GooglePrivacyDlpV2InspectDataSourceDetails = GooglePrivacyDlpV2InspectDataSourceDetails'
    { _gpdvidsdResult           :: !(Maybe GooglePrivacyDlpV2Result)
    , _gpdvidsdRequestedOptions :: !(Maybe GooglePrivacyDlpV2RequestedOptions)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InspectDataSourceDetails' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvidsdResult'
--
-- * 'gpdvidsdRequestedOptions'
googlePrivacyDlpV2InspectDataSourceDetails
    :: GooglePrivacyDlpV2InspectDataSourceDetails
googlePrivacyDlpV2InspectDataSourceDetails =
    GooglePrivacyDlpV2InspectDataSourceDetails'
    { _gpdvidsdResult = Nothing
    , _gpdvidsdRequestedOptions = Nothing
    }

-- | A summary of the outcome of this inspect job.
gpdvidsdResult :: Lens' GooglePrivacyDlpV2InspectDataSourceDetails (Maybe GooglePrivacyDlpV2Result)
gpdvidsdResult
  = lens _gpdvidsdResult
      (\ s a -> s{_gpdvidsdResult = a})

-- | The configuration used for this job.
gpdvidsdRequestedOptions :: Lens' GooglePrivacyDlpV2InspectDataSourceDetails (Maybe GooglePrivacyDlpV2RequestedOptions)
gpdvidsdRequestedOptions
  = lens _gpdvidsdRequestedOptions
      (\ s a -> s{_gpdvidsdRequestedOptions = a})

instance FromJSON
         GooglePrivacyDlpV2InspectDataSourceDetails where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2InspectDataSourceDetails"
              (\ o ->
                 GooglePrivacyDlpV2InspectDataSourceDetails' <$>
                   (o .:? "result") <*> (o .:? "requestedOptions"))

instance ToJSON
         GooglePrivacyDlpV2InspectDataSourceDetails where
        toJSON
          GooglePrivacyDlpV2InspectDataSourceDetails'{..}
          = object
              (catMaybes
                 [("result" .=) <$> _gpdvidsdResult,
                  ("requestedOptions" .=) <$>
                    _gpdvidsdRequestedOptions])

-- | Results of redacting an image.
--
-- /See:/ 'googlePrivacyDlpV2RedactImageResponse' smart constructor.
data GooglePrivacyDlpV2RedactImageResponse = GooglePrivacyDlpV2RedactImageResponse'
    { _gpdvrirExtractedText :: !(Maybe Text)
    , _gpdvrirInspectResult :: !(Maybe GooglePrivacyDlpV2InspectResult)
    , _gpdvrirRedactedImage :: !(Maybe Bytes)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RedactImageResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrirExtractedText'
--
-- * 'gpdvrirInspectResult'
--
-- * 'gpdvrirRedactedImage'
googlePrivacyDlpV2RedactImageResponse
    :: GooglePrivacyDlpV2RedactImageResponse
googlePrivacyDlpV2RedactImageResponse =
    GooglePrivacyDlpV2RedactImageResponse'
    { _gpdvrirExtractedText = Nothing
    , _gpdvrirInspectResult = Nothing
    , _gpdvrirRedactedImage = Nothing
    }

-- | If an image was being inspected and the InspectConfig\'s include_quote
-- was set to true, then this field will include all text, if any, that was
-- found in the image.
gpdvrirExtractedText :: Lens' GooglePrivacyDlpV2RedactImageResponse (Maybe Text)
gpdvrirExtractedText
  = lens _gpdvrirExtractedText
      (\ s a -> s{_gpdvrirExtractedText = a})

-- | The findings. Populated when include_findings in the request is true.
gpdvrirInspectResult :: Lens' GooglePrivacyDlpV2RedactImageResponse (Maybe GooglePrivacyDlpV2InspectResult)
gpdvrirInspectResult
  = lens _gpdvrirInspectResult
      (\ s a -> s{_gpdvrirInspectResult = a})

-- | The redacted image. The type will be the same as the original image.
gpdvrirRedactedImage :: Lens' GooglePrivacyDlpV2RedactImageResponse (Maybe ByteString)
gpdvrirRedactedImage
  = lens _gpdvrirRedactedImage
      (\ s a -> s{_gpdvrirRedactedImage = a})
      . mapping _Bytes

instance FromJSON
         GooglePrivacyDlpV2RedactImageResponse where
        parseJSON
          = withObject "GooglePrivacyDlpV2RedactImageResponse"
              (\ o ->
                 GooglePrivacyDlpV2RedactImageResponse' <$>
                   (o .:? "extractedText") <*> (o .:? "inspectResult")
                     <*> (o .:? "redactedImage"))

instance ToJSON GooglePrivacyDlpV2RedactImageResponse
         where
        toJSON GooglePrivacyDlpV2RedactImageResponse'{..}
          = object
              (catMaybes
                 [("extractedText" .=) <$> _gpdvrirExtractedText,
                  ("inspectResult" .=) <$> _gpdvrirInspectResult,
                  ("redactedImage" .=) <$> _gpdvrirRedactedImage])

-- | Publish the results of a DlpJob to a pub sub channel. Compatible with:
-- Inspect, Risk
--
-- /See:/ 'googlePrivacyDlpV2PublishToPubSub' smart constructor.
newtype GooglePrivacyDlpV2PublishToPubSub = GooglePrivacyDlpV2PublishToPubSub'
    { _gpdvptpsTopic :: Maybe Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2PublishToPubSub' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvptpsTopic'
googlePrivacyDlpV2PublishToPubSub
    :: GooglePrivacyDlpV2PublishToPubSub
googlePrivacyDlpV2PublishToPubSub =
    GooglePrivacyDlpV2PublishToPubSub'
    { _gpdvptpsTopic = Nothing
    }

-- | Cloud Pub\/Sub topic to send notifications to. The topic must have given
-- publishing access rights to the DLP API service account executing the
-- long running DlpJob sending the notifications. Format is
-- projects\/{project}\/topics\/{topic}.
gpdvptpsTopic :: Lens' GooglePrivacyDlpV2PublishToPubSub (Maybe Text)
gpdvptpsTopic
  = lens _gpdvptpsTopic
      (\ s a -> s{_gpdvptpsTopic = a})

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

instance ToJSON GooglePrivacyDlpV2PublishToPubSub
         where
        toJSON GooglePrivacyDlpV2PublishToPubSub'{..}
          = object
              (catMaybes [("topic" .=) <$> _gpdvptpsTopic])

-- | Row key for identifying a record in BigQuery table.
--
-- /See:/ 'googlePrivacyDlpV2BigQueryKey' smart constructor.
data GooglePrivacyDlpV2BigQueryKey = GooglePrivacyDlpV2BigQueryKey'
    { _gpdvbqkTableReference :: !(Maybe GooglePrivacyDlpV2BigQueryTable)
    , _gpdvbqkRowNumber      :: !(Maybe (Textual Int64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2BigQueryKey' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvbqkTableReference'
--
-- * 'gpdvbqkRowNumber'
googlePrivacyDlpV2BigQueryKey
    :: GooglePrivacyDlpV2BigQueryKey
googlePrivacyDlpV2BigQueryKey =
    GooglePrivacyDlpV2BigQueryKey'
    { _gpdvbqkTableReference = Nothing
    , _gpdvbqkRowNumber = Nothing
    }

-- | Complete BigQuery table reference.
gpdvbqkTableReference :: Lens' GooglePrivacyDlpV2BigQueryKey (Maybe GooglePrivacyDlpV2BigQueryTable)
gpdvbqkTableReference
  = lens _gpdvbqkTableReference
      (\ s a -> s{_gpdvbqkTableReference = a})

-- | Absolute number of the row from the beginning of the table at the time
-- of scanning.
gpdvbqkRowNumber :: Lens' GooglePrivacyDlpV2BigQueryKey (Maybe Int64)
gpdvbqkRowNumber
  = lens _gpdvbqkRowNumber
      (\ s a -> s{_gpdvbqkRowNumber = a})
      . mapping _Coerce

instance FromJSON GooglePrivacyDlpV2BigQueryKey where
        parseJSON
          = withObject "GooglePrivacyDlpV2BigQueryKey"
              (\ o ->
                 GooglePrivacyDlpV2BigQueryKey' <$>
                   (o .:? "tableReference") <*> (o .:? "rowNumber"))

instance ToJSON GooglePrivacyDlpV2BigQueryKey where
        toJSON GooglePrivacyDlpV2BigQueryKey'{..}
          = object
              (catMaybes
                 [("tableReference" .=) <$> _gpdvbqkTableReference,
                  ("rowNumber" .=) <$> _gpdvbqkRowNumber])

-- | Rule for modifying a CustomInfoType to alter behavior under certain
-- circumstances, depending on the specific details of the rule. Not
-- supported for the \`surrogate_type\` custom info type.
--
-- /See:/ 'googlePrivacyDlpV2DetectionRule' smart constructor.
newtype GooglePrivacyDlpV2DetectionRule = GooglePrivacyDlpV2DetectionRule'
    { _gpdvdrHotwordRule :: Maybe GooglePrivacyDlpV2HotwordRule
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2DetectionRule' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvdrHotwordRule'
googlePrivacyDlpV2DetectionRule
    :: GooglePrivacyDlpV2DetectionRule
googlePrivacyDlpV2DetectionRule =
    GooglePrivacyDlpV2DetectionRule'
    { _gpdvdrHotwordRule = Nothing
    }

-- | Hotword-based detection rule.
gpdvdrHotwordRule :: Lens' GooglePrivacyDlpV2DetectionRule (Maybe GooglePrivacyDlpV2HotwordRule)
gpdvdrHotwordRule
  = lens _gpdvdrHotwordRule
      (\ s a -> s{_gpdvdrHotwordRule = a})

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

instance ToJSON GooglePrivacyDlpV2DetectionRule where
        toJSON GooglePrivacyDlpV2DetectionRule'{..}
          = object
              (catMaybes
                 [("hotwordRule" .=) <$> _gpdvdrHotwordRule])

-- | A condition for determining whether a transformation should be applied
-- to a field.
--
-- /See:/ 'googlePrivacyDlpV2RecordCondition' smart constructor.
newtype GooglePrivacyDlpV2RecordCondition = GooglePrivacyDlpV2RecordCondition'
    { _gpdvrcExpressions :: Maybe GooglePrivacyDlpV2Expressions
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RecordCondition' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrcExpressions'
googlePrivacyDlpV2RecordCondition
    :: GooglePrivacyDlpV2RecordCondition
googlePrivacyDlpV2RecordCondition =
    GooglePrivacyDlpV2RecordCondition'
    { _gpdvrcExpressions = Nothing
    }

-- | An expression.
gpdvrcExpressions :: Lens' GooglePrivacyDlpV2RecordCondition (Maybe GooglePrivacyDlpV2Expressions)
gpdvrcExpressions
  = lens _gpdvrcExpressions
      (\ s a -> s{_gpdvrcExpressions = a})

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

instance ToJSON GooglePrivacyDlpV2RecordCondition
         where
        toJSON GooglePrivacyDlpV2RecordCondition'{..}
          = object
              (catMaybes
                 [("expressions" .=) <$> _gpdvrcExpressions])

-- | Shifts dates by random number of days, with option to be consistent for
-- the same context. See
-- https:\/\/cloud.google.com\/dlp\/docs\/concepts-date-shifting to learn
-- more.
--
-- /See:/ 'googlePrivacyDlpV2DateShiftConfig' smart constructor.
data GooglePrivacyDlpV2DateShiftConfig = GooglePrivacyDlpV2DateShiftConfig'
    { _gpdvdscContext        :: !(Maybe GooglePrivacyDlpV2FieldId)
    , _gpdvdscUpperBoundDays :: !(Maybe (Textual Int32))
    , _gpdvdscCryptoKey      :: !(Maybe GooglePrivacyDlpV2CryptoKey)
    , _gpdvdscLowerBoundDays :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2DateShiftConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvdscContext'
--
-- * 'gpdvdscUpperBoundDays'
--
-- * 'gpdvdscCryptoKey'
--
-- * 'gpdvdscLowerBoundDays'
googlePrivacyDlpV2DateShiftConfig
    :: GooglePrivacyDlpV2DateShiftConfig
googlePrivacyDlpV2DateShiftConfig =
    GooglePrivacyDlpV2DateShiftConfig'
    { _gpdvdscContext = Nothing
    , _gpdvdscUpperBoundDays = Nothing
    , _gpdvdscCryptoKey = Nothing
    , _gpdvdscLowerBoundDays = Nothing
    }

-- | Points to the field that contains the context, for example, an entity
-- id. If set, must also set method. If set, shift will be consistent for
-- the given context.
gpdvdscContext :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe GooglePrivacyDlpV2FieldId)
gpdvdscContext
  = lens _gpdvdscContext
      (\ s a -> s{_gpdvdscContext = a})

-- | Range of shift in days. Actual shift will be selected at random within
-- this range (inclusive ends). Negative means shift to earlier in time.
-- Must not be more than 365250 days (1000 years) each direction. For
-- example, 3 means shift date to at most 3 days into the future.
-- [Required]
gpdvdscUpperBoundDays :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe Int32)
gpdvdscUpperBoundDays
  = lens _gpdvdscUpperBoundDays
      (\ s a -> s{_gpdvdscUpperBoundDays = a})
      . mapping _Coerce

-- | Causes the shift to be computed based on this key and the context. This
-- results in the same shift for the same context and crypto_key.
gpdvdscCryptoKey :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe GooglePrivacyDlpV2CryptoKey)
gpdvdscCryptoKey
  = lens _gpdvdscCryptoKey
      (\ s a -> s{_gpdvdscCryptoKey = a})

-- | For example, -5 means shift date to at most 5 days back in the past.
-- [Required]
gpdvdscLowerBoundDays :: Lens' GooglePrivacyDlpV2DateShiftConfig (Maybe Int32)
gpdvdscLowerBoundDays
  = lens _gpdvdscLowerBoundDays
      (\ s a -> s{_gpdvdscLowerBoundDays = a})
      . mapping _Coerce

instance FromJSON GooglePrivacyDlpV2DateShiftConfig
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2DateShiftConfig"
              (\ o ->
                 GooglePrivacyDlpV2DateShiftConfig' <$>
                   (o .:? "context") <*> (o .:? "upperBoundDays") <*>
                     (o .:? "cryptoKey")
                     <*> (o .:? "lowerBoundDays"))

instance ToJSON GooglePrivacyDlpV2DateShiftConfig
         where
        toJSON GooglePrivacyDlpV2DateShiftConfig'{..}
          = object
              (catMaybes
                 [("context" .=) <$> _gpdvdscContext,
                  ("upperBoundDays" .=) <$> _gpdvdscUpperBoundDays,
                  ("cryptoKey" .=) <$> _gpdvdscCryptoKey,
                  ("lowerBoundDays" .=) <$> _gpdvdscLowerBoundDays])

-- | Request to search for potentially sensitive info in a ContentItem.
--
-- /See:/ 'googlePrivacyDlpV2InspectContentRequest' smart constructor.
data GooglePrivacyDlpV2InspectContentRequest = GooglePrivacyDlpV2InspectContentRequest'
    { _gpdvicrInspectConfig       :: !(Maybe GooglePrivacyDlpV2InspectConfig)
    , _gpdvicrItem                :: !(Maybe GooglePrivacyDlpV2ContentItem)
    , _gpdvicrInspectTemplateName :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InspectContentRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvicrInspectConfig'
--
-- * 'gpdvicrItem'
--
-- * 'gpdvicrInspectTemplateName'
googlePrivacyDlpV2InspectContentRequest
    :: GooglePrivacyDlpV2InspectContentRequest
googlePrivacyDlpV2InspectContentRequest =
    GooglePrivacyDlpV2InspectContentRequest'
    { _gpdvicrInspectConfig = Nothing
    , _gpdvicrItem = Nothing
    , _gpdvicrInspectTemplateName = Nothing
    }

-- | Configuration for the inspector. What specified here will override the
-- template referenced by the inspect_template_name argument.
gpdvicrInspectConfig :: Lens' GooglePrivacyDlpV2InspectContentRequest (Maybe GooglePrivacyDlpV2InspectConfig)
gpdvicrInspectConfig
  = lens _gpdvicrInspectConfig
      (\ s a -> s{_gpdvicrInspectConfig = a})

-- | The item to inspect.
gpdvicrItem :: Lens' GooglePrivacyDlpV2InspectContentRequest (Maybe GooglePrivacyDlpV2ContentItem)
gpdvicrItem
  = lens _gpdvicrItem (\ s a -> s{_gpdvicrItem = a})

-- | Optional template to use. Any configuration directly specified in
-- inspect_config will override those set in the template. Singular fields
-- that are set in this request will replace their corresponding fields in
-- the template. Repeated fields are appended. Singular sub-messages and
-- groups are recursively merged.
gpdvicrInspectTemplateName :: Lens' GooglePrivacyDlpV2InspectContentRequest (Maybe Text)
gpdvicrInspectTemplateName
  = lens _gpdvicrInspectTemplateName
      (\ s a -> s{_gpdvicrInspectTemplateName = a})

instance FromJSON
         GooglePrivacyDlpV2InspectContentRequest where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2InspectContentRequest"
              (\ o ->
                 GooglePrivacyDlpV2InspectContentRequest' <$>
                   (o .:? "inspectConfig") <*> (o .:? "item") <*>
                     (o .:? "inspectTemplateName"))

instance ToJSON
         GooglePrivacyDlpV2InspectContentRequest where
        toJSON GooglePrivacyDlpV2InspectContentRequest'{..}
          = object
              (catMaybes
                 [("inspectConfig" .=) <$> _gpdvicrInspectConfig,
                  ("item" .=) <$> _gpdvicrItem,
                  ("inspectTemplateName" .=) <$>
                    _gpdvicrInspectTemplateName])

-- | Result of the categorical stats computation.
--
-- /See:/ 'googlePrivacyDlpV2CategoricalStatsResult' smart constructor.
newtype GooglePrivacyDlpV2CategoricalStatsResult = GooglePrivacyDlpV2CategoricalStatsResult'
    { _gpdvcsrValueFrequencyHistogramBuckets :: Maybe [GooglePrivacyDlpV2CategoricalStatsHistogramBucket]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CategoricalStatsResult' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcsrValueFrequencyHistogramBuckets'
googlePrivacyDlpV2CategoricalStatsResult
    :: GooglePrivacyDlpV2CategoricalStatsResult
googlePrivacyDlpV2CategoricalStatsResult =
    GooglePrivacyDlpV2CategoricalStatsResult'
    { _gpdvcsrValueFrequencyHistogramBuckets = Nothing
    }

-- | Histogram of value frequencies in the column.
gpdvcsrValueFrequencyHistogramBuckets :: Lens' GooglePrivacyDlpV2CategoricalStatsResult [GooglePrivacyDlpV2CategoricalStatsHistogramBucket]
gpdvcsrValueFrequencyHistogramBuckets
  = lens _gpdvcsrValueFrequencyHistogramBuckets
      (\ s a ->
         s{_gpdvcsrValueFrequencyHistogramBuckets = a})
      . _Default
      . _Coerce

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

instance ToJSON
         GooglePrivacyDlpV2CategoricalStatsResult where
        toJSON GooglePrivacyDlpV2CategoricalStatsResult'{..}
          = object
              (catMaybes
                 [("valueFrequencyHistogramBuckets" .=) <$>
                    _gpdvcsrValueFrequencyHistogramBuckets])

-- | Result of the numerical stats computation.
--
-- /See:/ 'googlePrivacyDlpV2NumericalStatsResult' smart constructor.
data GooglePrivacyDlpV2NumericalStatsResult = GooglePrivacyDlpV2NumericalStatsResult'
    { _gpdvnsrMaxValue       :: !(Maybe GooglePrivacyDlpV2Value)
    , _gpdvnsrQuantileValues :: !(Maybe [GooglePrivacyDlpV2Value])
    , _gpdvnsrMinValue       :: !(Maybe GooglePrivacyDlpV2Value)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2NumericalStatsResult' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvnsrMaxValue'
--
-- * 'gpdvnsrQuantileValues'
--
-- * 'gpdvnsrMinValue'
googlePrivacyDlpV2NumericalStatsResult
    :: GooglePrivacyDlpV2NumericalStatsResult
googlePrivacyDlpV2NumericalStatsResult =
    GooglePrivacyDlpV2NumericalStatsResult'
    { _gpdvnsrMaxValue = Nothing
    , _gpdvnsrQuantileValues = Nothing
    , _gpdvnsrMinValue = Nothing
    }

-- | Maximum value appearing in the column.
gpdvnsrMaxValue :: Lens' GooglePrivacyDlpV2NumericalStatsResult (Maybe GooglePrivacyDlpV2Value)
gpdvnsrMaxValue
  = lens _gpdvnsrMaxValue
      (\ s a -> s{_gpdvnsrMaxValue = a})

-- | List of 99 values that partition the set of field values into 100 equal
-- sized buckets.
gpdvnsrQuantileValues :: Lens' GooglePrivacyDlpV2NumericalStatsResult [GooglePrivacyDlpV2Value]
gpdvnsrQuantileValues
  = lens _gpdvnsrQuantileValues
      (\ s a -> s{_gpdvnsrQuantileValues = a})
      . _Default
      . _Coerce

-- | Minimum value appearing in the column.
gpdvnsrMinValue :: Lens' GooglePrivacyDlpV2NumericalStatsResult (Maybe GooglePrivacyDlpV2Value)
gpdvnsrMinValue
  = lens _gpdvnsrMinValue
      (\ s a -> s{_gpdvnsrMinValue = a})

instance FromJSON
         GooglePrivacyDlpV2NumericalStatsResult where
        parseJSON
          = withObject "GooglePrivacyDlpV2NumericalStatsResult"
              (\ o ->
                 GooglePrivacyDlpV2NumericalStatsResult' <$>
                   (o .:? "maxValue") <*>
                     (o .:? "quantileValues" .!= mempty)
                     <*> (o .:? "minValue"))

instance ToJSON
         GooglePrivacyDlpV2NumericalStatsResult where
        toJSON GooglePrivacyDlpV2NumericalStatsResult'{..}
          = object
              (catMaybes
                 [("maxValue" .=) <$> _gpdvnsrMaxValue,
                  ("quantileValues" .=) <$> _gpdvnsrQuantileValues,
                  ("minValue" .=) <$> _gpdvnsrMinValue])

-- | Publish the result summary of a DlpJob to the Cloud Security Command
-- Center (CSCC Alpha). This action is only available for projects which
-- are parts of an organization and whitelisted for the alpha Cloud
-- Security Command Center. The action will publish count of finding
-- instances and their info types. The summary of findings will be
-- persisted in CSCC and are governed by CSCC service-specific policy, see
-- https:\/\/cloud.google.com\/terms\/service-terms Only a single instance
-- of this action can be specified. Compatible with: Inspect
--
-- /See:/ 'googlePrivacyDlpV2PublishSummaryToCscc' smart constructor.
data GooglePrivacyDlpV2PublishSummaryToCscc =
    GooglePrivacyDlpV2PublishSummaryToCscc'
    deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2PublishSummaryToCscc' with the minimum fields required to make a request.
--
googlePrivacyDlpV2PublishSummaryToCscc
    :: GooglePrivacyDlpV2PublishSummaryToCscc
googlePrivacyDlpV2PublishSummaryToCscc =
    GooglePrivacyDlpV2PublishSummaryToCscc'

instance FromJSON
         GooglePrivacyDlpV2PublishSummaryToCscc where
        parseJSON
          = withObject "GooglePrivacyDlpV2PublishSummaryToCscc"
              (\ o -> pure GooglePrivacyDlpV2PublishSummaryToCscc')

instance ToJSON
         GooglePrivacyDlpV2PublishSummaryToCscc where
        toJSON = const emptyObject

-- | Request message for UpdateInspectTemplate.
--
-- /See:/ 'googlePrivacyDlpV2UpdateInspectTemplateRequest' smart constructor.
data GooglePrivacyDlpV2UpdateInspectTemplateRequest = GooglePrivacyDlpV2UpdateInspectTemplateRequest'
    { _gpdvuitrUpdateMask      :: !(Maybe GFieldMask)
    , _gpdvuitrInspectTemplate :: !(Maybe GooglePrivacyDlpV2InspectTemplate)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2UpdateInspectTemplateRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvuitrUpdateMask'
--
-- * 'gpdvuitrInspectTemplate'
googlePrivacyDlpV2UpdateInspectTemplateRequest
    :: GooglePrivacyDlpV2UpdateInspectTemplateRequest
googlePrivacyDlpV2UpdateInspectTemplateRequest =
    GooglePrivacyDlpV2UpdateInspectTemplateRequest'
    { _gpdvuitrUpdateMask = Nothing
    , _gpdvuitrInspectTemplate = Nothing
    }

-- | Mask to control which fields get updated.
gpdvuitrUpdateMask :: Lens' GooglePrivacyDlpV2UpdateInspectTemplateRequest (Maybe GFieldMask)
gpdvuitrUpdateMask
  = lens _gpdvuitrUpdateMask
      (\ s a -> s{_gpdvuitrUpdateMask = a})

-- | New InspectTemplate value.
gpdvuitrInspectTemplate :: Lens' GooglePrivacyDlpV2UpdateInspectTemplateRequest (Maybe GooglePrivacyDlpV2InspectTemplate)
gpdvuitrInspectTemplate
  = lens _gpdvuitrInspectTemplate
      (\ s a -> s{_gpdvuitrInspectTemplate = a})

instance FromJSON
         GooglePrivacyDlpV2UpdateInspectTemplateRequest where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2UpdateInspectTemplateRequest"
              (\ o ->
                 GooglePrivacyDlpV2UpdateInspectTemplateRequest' <$>
                   (o .:? "updateMask") <*> (o .:? "inspectTemplate"))

instance ToJSON
         GooglePrivacyDlpV2UpdateInspectTemplateRequest where
        toJSON
          GooglePrivacyDlpV2UpdateInspectTemplateRequest'{..}
          = object
              (catMaybes
                 [("updateMask" .=) <$> _gpdvuitrUpdateMask,
                  ("inspectTemplate" .=) <$> _gpdvuitrInspectTemplate])

-- | An entity in a dataset is a field or set of fields that correspond to a
-- single person. For example, in medical records the \`EntityId\` might be
-- a patient identifier, or for financial records it might be an account
-- identifier. This message is used when generalizations or analysis must
-- take into account that multiple rows correspond to the same entity.
--
-- /See:/ 'googlePrivacyDlpV2EntityId' smart constructor.
newtype GooglePrivacyDlpV2EntityId = GooglePrivacyDlpV2EntityId'
    { _gpdveiField :: Maybe GooglePrivacyDlpV2FieldId
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2EntityId' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdveiField'
googlePrivacyDlpV2EntityId
    :: GooglePrivacyDlpV2EntityId
googlePrivacyDlpV2EntityId =
    GooglePrivacyDlpV2EntityId'
    { _gpdveiField = Nothing
    }

-- | Composite key indicating which field contains the entity identifier.
gpdveiField :: Lens' GooglePrivacyDlpV2EntityId (Maybe GooglePrivacyDlpV2FieldId)
gpdveiField
  = lens _gpdveiField (\ s a -> s{_gpdveiField = a})

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

instance ToJSON GooglePrivacyDlpV2EntityId where
        toJSON GooglePrivacyDlpV2EntityId'{..}
          = object (catMaybes [("field" .=) <$> _gpdveiField])

-- | Container for bytes to inspect or redact.
--
-- /See:/ 'googlePrivacyDlpV2ByteContentItem' smart constructor.
data GooglePrivacyDlpV2ByteContentItem = GooglePrivacyDlpV2ByteContentItem'
    { _gpdvbciData :: !(Maybe Bytes)
    , _gpdvbciType :: !(Maybe GooglePrivacyDlpV2ByteContentItemType)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2ByteContentItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvbciData'
--
-- * 'gpdvbciType'
googlePrivacyDlpV2ByteContentItem
    :: GooglePrivacyDlpV2ByteContentItem
googlePrivacyDlpV2ByteContentItem =
    GooglePrivacyDlpV2ByteContentItem'
    { _gpdvbciData = Nothing
    , _gpdvbciType = Nothing
    }

-- | Content data to inspect or redact.
gpdvbciData :: Lens' GooglePrivacyDlpV2ByteContentItem (Maybe ByteString)
gpdvbciData
  = lens _gpdvbciData (\ s a -> s{_gpdvbciData = a}) .
      mapping _Bytes

-- | The type of data stored in the bytes string. Default will be TEXT_UTF8.
gpdvbciType :: Lens' GooglePrivacyDlpV2ByteContentItem (Maybe GooglePrivacyDlpV2ByteContentItemType)
gpdvbciType
  = lens _gpdvbciType (\ s a -> s{_gpdvbciType = a})

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

instance ToJSON GooglePrivacyDlpV2ByteContentItem
         where
        toJSON GooglePrivacyDlpV2ByteContentItem'{..}
          = object
              (catMaybes
                 [("data" .=) <$> _gpdvbciData,
                  ("type" .=) <$> _gpdvbciType])

--
-- /See:/ 'googlePrivacyDlpV2TaggedField' smart constructor.
data GooglePrivacyDlpV2TaggedField = GooglePrivacyDlpV2TaggedField'
    { _gpdvtfField     :: !(Maybe GooglePrivacyDlpV2FieldId)
    , _gpdvtfInfoType  :: !(Maybe GooglePrivacyDlpV2InfoType)
    , _gpdvtfInferred  :: !(Maybe GoogleProtobufEmpty)
    , _gpdvtfCustomTag :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2TaggedField' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvtfField'
--
-- * 'gpdvtfInfoType'
--
-- * 'gpdvtfInferred'
--
-- * 'gpdvtfCustomTag'
googlePrivacyDlpV2TaggedField
    :: GooglePrivacyDlpV2TaggedField
googlePrivacyDlpV2TaggedField =
    GooglePrivacyDlpV2TaggedField'
    { _gpdvtfField = Nothing
    , _gpdvtfInfoType = Nothing
    , _gpdvtfInferred = Nothing
    , _gpdvtfCustomTag = Nothing
    }

-- | Identifies the column. [required]
gpdvtfField :: Lens' GooglePrivacyDlpV2TaggedField (Maybe GooglePrivacyDlpV2FieldId)
gpdvtfField
  = lens _gpdvtfField (\ s a -> s{_gpdvtfField = a})

-- | A column can be tagged with a InfoType to use the relevant public
-- dataset as a statistical model of population, if available. We currently
-- support US ZIP codes, region codes, ages and genders. To
-- programmatically obtain the list of supported InfoTypes, use
-- ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
gpdvtfInfoType :: Lens' GooglePrivacyDlpV2TaggedField (Maybe GooglePrivacyDlpV2InfoType)
gpdvtfInfoType
  = lens _gpdvtfInfoType
      (\ s a -> s{_gpdvtfInfoType = a})

-- | If no semantic tag is indicated, we infer the statistical model from the
-- distribution of values in the input data
gpdvtfInferred :: Lens' GooglePrivacyDlpV2TaggedField (Maybe GoogleProtobufEmpty)
gpdvtfInferred
  = lens _gpdvtfInferred
      (\ s a -> s{_gpdvtfInferred = a})

-- | A column can be tagged with a custom tag. In this case, the user must
-- indicate an auxiliary table that contains statistical information on the
-- possible values of this column (below).
gpdvtfCustomTag :: Lens' GooglePrivacyDlpV2TaggedField (Maybe Text)
gpdvtfCustomTag
  = lens _gpdvtfCustomTag
      (\ s a -> s{_gpdvtfCustomTag = a})

instance FromJSON GooglePrivacyDlpV2TaggedField where
        parseJSON
          = withObject "GooglePrivacyDlpV2TaggedField"
              (\ o ->
                 GooglePrivacyDlpV2TaggedField' <$>
                   (o .:? "field") <*> (o .:? "infoType") <*>
                     (o .:? "inferred")
                     <*> (o .:? "customTag"))

instance ToJSON GooglePrivacyDlpV2TaggedField where
        toJSON GooglePrivacyDlpV2TaggedField'{..}
          = object
              (catMaybes
                 [("field" .=) <$> _gpdvtfField,
                  ("infoType" .=) <$> _gpdvtfInfoType,
                  ("inferred" .=) <$> _gpdvtfInferred,
                  ("customTag" .=) <$> _gpdvtfCustomTag])

-- | Options defining BigQuery table and row identifiers.
--
-- /See:/ 'googlePrivacyDlpV2BigQueryOptions' smart constructor.
data GooglePrivacyDlpV2BigQueryOptions = GooglePrivacyDlpV2BigQueryOptions'
    { _gpdvbqoRowsLimit         :: !(Maybe (Textual Int64))
    , _gpdvbqoRowsLimitPercent  :: !(Maybe (Textual Int32))
    , _gpdvbqoTableReference    :: !(Maybe GooglePrivacyDlpV2BigQueryTable)
    , _gpdvbqoIdentifyingFields :: !(Maybe [GooglePrivacyDlpV2FieldId])
    , _gpdvbqoExcludedFields    :: !(Maybe [GooglePrivacyDlpV2FieldId])
    , _gpdvbqoSampleMethod      :: !(Maybe GooglePrivacyDlpV2BigQueryOptionsSampleMethod)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2BigQueryOptions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvbqoRowsLimit'
--
-- * 'gpdvbqoRowsLimitPercent'
--
-- * 'gpdvbqoTableReference'
--
-- * 'gpdvbqoIdentifyingFields'
--
-- * 'gpdvbqoExcludedFields'
--
-- * 'gpdvbqoSampleMethod'
googlePrivacyDlpV2BigQueryOptions
    :: GooglePrivacyDlpV2BigQueryOptions
googlePrivacyDlpV2BigQueryOptions =
    GooglePrivacyDlpV2BigQueryOptions'
    { _gpdvbqoRowsLimit = Nothing
    , _gpdvbqoRowsLimitPercent = Nothing
    , _gpdvbqoTableReference = Nothing
    , _gpdvbqoIdentifyingFields = Nothing
    , _gpdvbqoExcludedFields = Nothing
    , _gpdvbqoSampleMethod = Nothing
    }

-- | Max number of rows to scan. If the table has more rows than this value,
-- the rest of the rows are omitted. If not set, or if set to 0, all rows
-- will be scanned. Only one of rows_limit and rows_limit_percent can be
-- specified. Cannot be used in conjunction with TimespanConfig.
gpdvbqoRowsLimit :: Lens' GooglePrivacyDlpV2BigQueryOptions (Maybe Int64)
gpdvbqoRowsLimit
  = lens _gpdvbqoRowsLimit
      (\ s a -> s{_gpdvbqoRowsLimit = a})
      . mapping _Coerce

-- | Max percentage of rows to scan. The rest are omitted. The number of rows
-- scanned is rounded down. Must be between 0 and 100, inclusively. Both 0
-- and 100 means no limit. Defaults to 0. Only one of rows_limit and
-- rows_limit_percent can be specified. Cannot be used in conjunction with
-- TimespanConfig.
gpdvbqoRowsLimitPercent :: Lens' GooglePrivacyDlpV2BigQueryOptions (Maybe Int32)
gpdvbqoRowsLimitPercent
  = lens _gpdvbqoRowsLimitPercent
      (\ s a -> s{_gpdvbqoRowsLimitPercent = a})
      . mapping _Coerce

-- | Complete BigQuery table reference.
gpdvbqoTableReference :: Lens' GooglePrivacyDlpV2BigQueryOptions (Maybe GooglePrivacyDlpV2BigQueryTable)
gpdvbqoTableReference
  = lens _gpdvbqoTableReference
      (\ s a -> s{_gpdvbqoTableReference = a})

-- | References to fields uniquely identifying rows within the table. Nested
-- fields in the format, like \`person.birthdate.year\`, are allowed.
gpdvbqoIdentifyingFields :: Lens' GooglePrivacyDlpV2BigQueryOptions [GooglePrivacyDlpV2FieldId]
gpdvbqoIdentifyingFields
  = lens _gpdvbqoIdentifyingFields
      (\ s a -> s{_gpdvbqoIdentifyingFields = a})
      . _Default
      . _Coerce

-- | References to fields excluded from scanning. This allows you to skip
-- inspection of entire columns which you know have no findings.
gpdvbqoExcludedFields :: Lens' GooglePrivacyDlpV2BigQueryOptions [GooglePrivacyDlpV2FieldId]
gpdvbqoExcludedFields
  = lens _gpdvbqoExcludedFields
      (\ s a -> s{_gpdvbqoExcludedFields = a})
      . _Default
      . _Coerce

gpdvbqoSampleMethod :: Lens' GooglePrivacyDlpV2BigQueryOptions (Maybe GooglePrivacyDlpV2BigQueryOptionsSampleMethod)
gpdvbqoSampleMethod
  = lens _gpdvbqoSampleMethod
      (\ s a -> s{_gpdvbqoSampleMethod = a})

instance FromJSON GooglePrivacyDlpV2BigQueryOptions
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2BigQueryOptions"
              (\ o ->
                 GooglePrivacyDlpV2BigQueryOptions' <$>
                   (o .:? "rowsLimit") <*> (o .:? "rowsLimitPercent")
                     <*> (o .:? "tableReference")
                     <*> (o .:? "identifyingFields" .!= mempty)
                     <*> (o .:? "excludedFields" .!= mempty)
                     <*> (o .:? "sampleMethod"))

instance ToJSON GooglePrivacyDlpV2BigQueryOptions
         where
        toJSON GooglePrivacyDlpV2BigQueryOptions'{..}
          = object
              (catMaybes
                 [("rowsLimit" .=) <$> _gpdvbqoRowsLimit,
                  ("rowsLimitPercent" .=) <$> _gpdvbqoRowsLimitPercent,
                  ("tableReference" .=) <$> _gpdvbqoTableReference,
                  ("identifyingFields" .=) <$>
                    _gpdvbqoIdentifyingFields,
                  ("excludedFields" .=) <$> _gpdvbqoExcludedFields,
                  ("sampleMethod" .=) <$> _gpdvbqoSampleMethod])

-- | A tuple of values for the quasi-identifier columns.
--
-- /See:/ 'googlePrivacyDlpV2KMapEstimationQuasiIdValues' smart constructor.
data GooglePrivacyDlpV2KMapEstimationQuasiIdValues = GooglePrivacyDlpV2KMapEstimationQuasiIdValues'
    { _gpdvkmeqivEstimatedAnonymity :: !(Maybe (Textual Int64))
    , _gpdvkmeqivQuasiIdsValues     :: !(Maybe [GooglePrivacyDlpV2Value])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2KMapEstimationQuasiIdValues' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvkmeqivEstimatedAnonymity'
--
-- * 'gpdvkmeqivQuasiIdsValues'
googlePrivacyDlpV2KMapEstimationQuasiIdValues
    :: GooglePrivacyDlpV2KMapEstimationQuasiIdValues
googlePrivacyDlpV2KMapEstimationQuasiIdValues =
    GooglePrivacyDlpV2KMapEstimationQuasiIdValues'
    { _gpdvkmeqivEstimatedAnonymity = Nothing
    , _gpdvkmeqivQuasiIdsValues = Nothing
    }

-- | The estimated anonymity for these quasi-identifier values.
gpdvkmeqivEstimatedAnonymity :: Lens' GooglePrivacyDlpV2KMapEstimationQuasiIdValues (Maybe Int64)
gpdvkmeqivEstimatedAnonymity
  = lens _gpdvkmeqivEstimatedAnonymity
      (\ s a -> s{_gpdvkmeqivEstimatedAnonymity = a})
      . mapping _Coerce

-- | The quasi-identifier values.
gpdvkmeqivQuasiIdsValues :: Lens' GooglePrivacyDlpV2KMapEstimationQuasiIdValues [GooglePrivacyDlpV2Value]
gpdvkmeqivQuasiIdsValues
  = lens _gpdvkmeqivQuasiIdsValues
      (\ s a -> s{_gpdvkmeqivQuasiIdsValues = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2KMapEstimationQuasiIdValues where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2KMapEstimationQuasiIdValues"
              (\ o ->
                 GooglePrivacyDlpV2KMapEstimationQuasiIdValues' <$>
                   (o .:? "estimatedAnonymity") <*>
                     (o .:? "quasiIdsValues" .!= mempty))

instance ToJSON
         GooglePrivacyDlpV2KMapEstimationQuasiIdValues where
        toJSON
          GooglePrivacyDlpV2KMapEstimationQuasiIdValues'{..}
          = object
              (catMaybes
                 [("estimatedAnonymity" .=) <$>
                    _gpdvkmeqivEstimatedAnonymity,
                  ("quasiIdsValues" .=) <$> _gpdvkmeqivQuasiIdsValues])

-- | List of exclude infoTypes.
--
-- /See:/ 'googlePrivacyDlpV2ExcludeInfoTypes' smart constructor.
newtype GooglePrivacyDlpV2ExcludeInfoTypes = GooglePrivacyDlpV2ExcludeInfoTypes'
    { _gpdveitInfoTypes :: Maybe [GooglePrivacyDlpV2InfoType]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2ExcludeInfoTypes' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdveitInfoTypes'
googlePrivacyDlpV2ExcludeInfoTypes
    :: GooglePrivacyDlpV2ExcludeInfoTypes
googlePrivacyDlpV2ExcludeInfoTypes =
    GooglePrivacyDlpV2ExcludeInfoTypes'
    { _gpdveitInfoTypes = Nothing
    }

-- | InfoType list in ExclusionRule rule drops a finding when it overlaps or
-- contained within with a finding of an infoType from this list. For
-- example, for \`InspectionRuleSet.info_types\` containing
-- \"PHONE_NUMBER\"\` and \`exclusion_rule\` containing
-- \`exclude_info_types.info_types\` with \"EMAIL_ADDRESS\" the phone
-- number findings are dropped if they overlap with EMAIL_ADDRESS finding.
-- That leads to \"555-222-2222\'example.org\" to generate only a single
-- finding, namely email address.
gpdveitInfoTypes :: Lens' GooglePrivacyDlpV2ExcludeInfoTypes [GooglePrivacyDlpV2InfoType]
gpdveitInfoTypes
  = lens _gpdveitInfoTypes
      (\ s a -> s{_gpdveitInfoTypes = a})
      . _Default
      . _Coerce

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

instance ToJSON GooglePrivacyDlpV2ExcludeInfoTypes
         where
        toJSON GooglePrivacyDlpV2ExcludeInfoTypes'{..}
          = object
              (catMaybes [("infoTypes" .=) <$> _gpdveitInfoTypes])

-- | Request message for CreateInspectTemplate.
--
-- /See:/ 'googlePrivacyDlpV2CreateInspectTemplateRequest' smart constructor.
data GooglePrivacyDlpV2CreateInspectTemplateRequest = GooglePrivacyDlpV2CreateInspectTemplateRequest'
    { _gpdvcitrTemplateId      :: !(Maybe Text)
    , _gpdvcitrInspectTemplate :: !(Maybe GooglePrivacyDlpV2InspectTemplate)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CreateInspectTemplateRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcitrTemplateId'
--
-- * 'gpdvcitrInspectTemplate'
googlePrivacyDlpV2CreateInspectTemplateRequest
    :: GooglePrivacyDlpV2CreateInspectTemplateRequest
googlePrivacyDlpV2CreateInspectTemplateRequest =
    GooglePrivacyDlpV2CreateInspectTemplateRequest'
    { _gpdvcitrTemplateId = Nothing
    , _gpdvcitrInspectTemplate = Nothing
    }

-- | The template id can contain uppercase and lowercase letters, numbers,
-- and hyphens; that is, it must match the regular expression:
-- \`[a-zA-Z\\\\d-]+\`. The maximum length is 100 characters. Can be empty
-- to allow the system to generate one.
gpdvcitrTemplateId :: Lens' GooglePrivacyDlpV2CreateInspectTemplateRequest (Maybe Text)
gpdvcitrTemplateId
  = lens _gpdvcitrTemplateId
      (\ s a -> s{_gpdvcitrTemplateId = a})

-- | The InspectTemplate to create.
gpdvcitrInspectTemplate :: Lens' GooglePrivacyDlpV2CreateInspectTemplateRequest (Maybe GooglePrivacyDlpV2InspectTemplate)
gpdvcitrInspectTemplate
  = lens _gpdvcitrInspectTemplate
      (\ s a -> s{_gpdvcitrInspectTemplate = a})

instance FromJSON
         GooglePrivacyDlpV2CreateInspectTemplateRequest where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2CreateInspectTemplateRequest"
              (\ o ->
                 GooglePrivacyDlpV2CreateInspectTemplateRequest' <$>
                   (o .:? "templateId") <*> (o .:? "inspectTemplate"))

instance ToJSON
         GooglePrivacyDlpV2CreateInspectTemplateRequest where
        toJSON
          GooglePrivacyDlpV2CreateInspectTemplateRequest'{..}
          = object
              (catMaybes
                 [("templateId" .=) <$> _gpdvcitrTemplateId,
                  ("inspectTemplate" .=) <$> _gpdvcitrInspectTemplate])

-- | A (kind, ID\/name) pair used to construct a key path. If either name or
-- ID is set, the element is complete. If neither is set, the element is
-- incomplete.
--
-- /See:/ 'googlePrivacyDlpV2PathElement' smart constructor.
data GooglePrivacyDlpV2PathElement = GooglePrivacyDlpV2PathElement'
    { _gpdvpeKind :: !(Maybe Text)
    , _gpdvpeName :: !(Maybe Text)
    , _gpdvpeId   :: !(Maybe (Textual Int64))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2PathElement' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvpeKind'
--
-- * 'gpdvpeName'
--
-- * 'gpdvpeId'
googlePrivacyDlpV2PathElement
    :: GooglePrivacyDlpV2PathElement
googlePrivacyDlpV2PathElement =
    GooglePrivacyDlpV2PathElement'
    { _gpdvpeKind = Nothing
    , _gpdvpeName = Nothing
    , _gpdvpeId = Nothing
    }

-- | The kind of the entity. A kind matching regex \`__.*__\` is
-- reserved\/read-only. A kind must not contain more than 1500 bytes when
-- UTF-8 encoded. Cannot be \`\"\"\`.
gpdvpeKind :: Lens' GooglePrivacyDlpV2PathElement (Maybe Text)
gpdvpeKind
  = lens _gpdvpeKind (\ s a -> s{_gpdvpeKind = a})

-- | The name of the entity. A name matching regex \`__.*__\` is
-- reserved\/read-only. A name must not be more than 1500 bytes when UTF-8
-- encoded. Cannot be \`\"\"\`.
gpdvpeName :: Lens' GooglePrivacyDlpV2PathElement (Maybe Text)
gpdvpeName
  = lens _gpdvpeName (\ s a -> s{_gpdvpeName = a})

-- | The auto-allocated ID of the entity. Never equal to zero. Values less
-- than zero are discouraged and may not be supported in the future.
gpdvpeId :: Lens' GooglePrivacyDlpV2PathElement (Maybe Int64)
gpdvpeId
  = lens _gpdvpeId (\ s a -> s{_gpdvpeId = a}) .
      mapping _Coerce

instance FromJSON GooglePrivacyDlpV2PathElement where
        parseJSON
          = withObject "GooglePrivacyDlpV2PathElement"
              (\ o ->
                 GooglePrivacyDlpV2PathElement' <$>
                   (o .:? "kind") <*> (o .:? "name") <*> (o .:? "id"))

instance ToJSON GooglePrivacyDlpV2PathElement where
        toJSON GooglePrivacyDlpV2PathElement'{..}
          = object
              (catMaybes
                 [("kind" .=) <$> _gpdvpeKind,
                  ("name" .=) <$> _gpdvpeName,
                  ("id" .=) <$> _gpdvpeId])

-- | Result of the δ-presence computation. Note that these results are an
-- estimation, not exact values.
--
-- /See:/ 'googlePrivacyDlpV2DeltaPresenceEstimationResult' smart constructor.
newtype GooglePrivacyDlpV2DeltaPresenceEstimationResult = GooglePrivacyDlpV2DeltaPresenceEstimationResult'
    { _gpdvdperDeltaPresenceEstimationHistogram :: Maybe [GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket]
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2DeltaPresenceEstimationResult' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvdperDeltaPresenceEstimationHistogram'
googlePrivacyDlpV2DeltaPresenceEstimationResult
    :: GooglePrivacyDlpV2DeltaPresenceEstimationResult
googlePrivacyDlpV2DeltaPresenceEstimationResult =
    GooglePrivacyDlpV2DeltaPresenceEstimationResult'
    { _gpdvdperDeltaPresenceEstimationHistogram = Nothing
    }

-- | The intervals [min_probability, max_probability) do not overlap. If a
-- value doesn\'t correspond to any such interval, the associated frequency
-- is zero. For example, the following records: {min_probability: 0,
-- max_probability: 0.1, frequency: 17} {min_probability: 0.2,
-- max_probability: 0.3, frequency: 42} {min_probability: 0.3,
-- max_probability: 0.4, frequency: 99} mean that there are no record with
-- an estimated probability in [0.1, 0.2) nor larger or equal to 0.4.
gpdvdperDeltaPresenceEstimationHistogram :: Lens' GooglePrivacyDlpV2DeltaPresenceEstimationResult [GooglePrivacyDlpV2DeltaPresenceEstimationHistogramBucket]
gpdvdperDeltaPresenceEstimationHistogram
  = lens _gpdvdperDeltaPresenceEstimationHistogram
      (\ s a ->
         s{_gpdvdperDeltaPresenceEstimationHistogram = a})
      . _Default
      . _Coerce

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

instance ToJSON
         GooglePrivacyDlpV2DeltaPresenceEstimationResult where
        toJSON
          GooglePrivacyDlpV2DeltaPresenceEstimationResult'{..}
          = object
              (catMaybes
                 [("deltaPresenceEstimationHistogram" .=) <$>
                    _gpdvdperDeltaPresenceEstimationHistogram])

--
-- /See:/ 'googlePrivacyDlpV2InspectJobConfig' smart constructor.
data GooglePrivacyDlpV2InspectJobConfig = GooglePrivacyDlpV2InspectJobConfig'
    { _gpdvijcActions             :: !(Maybe [GooglePrivacyDlpV2Action])
    , _gpdvijcStorageConfig       :: !(Maybe GooglePrivacyDlpV2StorageConfig)
    , _gpdvijcInspectConfig       :: !(Maybe GooglePrivacyDlpV2InspectConfig)
    , _gpdvijcInspectTemplateName :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InspectJobConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvijcActions'
--
-- * 'gpdvijcStorageConfig'
--
-- * 'gpdvijcInspectConfig'
--
-- * 'gpdvijcInspectTemplateName'
googlePrivacyDlpV2InspectJobConfig
    :: GooglePrivacyDlpV2InspectJobConfig
googlePrivacyDlpV2InspectJobConfig =
    GooglePrivacyDlpV2InspectJobConfig'
    { _gpdvijcActions = Nothing
    , _gpdvijcStorageConfig = Nothing
    , _gpdvijcInspectConfig = Nothing
    , _gpdvijcInspectTemplateName = Nothing
    }

-- | Actions to execute at the completion of the job. Are executed in the
-- order provided.
gpdvijcActions :: Lens' GooglePrivacyDlpV2InspectJobConfig [GooglePrivacyDlpV2Action]
gpdvijcActions
  = lens _gpdvijcActions
      (\ s a -> s{_gpdvijcActions = a})
      . _Default
      . _Coerce

-- | The data to scan.
gpdvijcStorageConfig :: Lens' GooglePrivacyDlpV2InspectJobConfig (Maybe GooglePrivacyDlpV2StorageConfig)
gpdvijcStorageConfig
  = lens _gpdvijcStorageConfig
      (\ s a -> s{_gpdvijcStorageConfig = a})

-- | How and what to scan for.
gpdvijcInspectConfig :: Lens' GooglePrivacyDlpV2InspectJobConfig (Maybe GooglePrivacyDlpV2InspectConfig)
gpdvijcInspectConfig
  = lens _gpdvijcInspectConfig
      (\ s a -> s{_gpdvijcInspectConfig = a})

-- | If provided, will be used as the default for all values in
-- InspectConfig. \`inspect_config\` will be merged into the values
-- persisted as part of the template.
gpdvijcInspectTemplateName :: Lens' GooglePrivacyDlpV2InspectJobConfig (Maybe Text)
gpdvijcInspectTemplateName
  = lens _gpdvijcInspectTemplateName
      (\ s a -> s{_gpdvijcInspectTemplateName = a})

instance FromJSON GooglePrivacyDlpV2InspectJobConfig
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2InspectJobConfig"
              (\ o ->
                 GooglePrivacyDlpV2InspectJobConfig' <$>
                   (o .:? "actions" .!= mempty) <*>
                     (o .:? "storageConfig")
                     <*> (o .:? "inspectConfig")
                     <*> (o .:? "inspectTemplateName"))

instance ToJSON GooglePrivacyDlpV2InspectJobConfig
         where
        toJSON GooglePrivacyDlpV2InspectJobConfig'{..}
          = object
              (catMaybes
                 [("actions" .=) <$> _gpdvijcActions,
                  ("storageConfig" .=) <$> _gpdvijcStorageConfig,
                  ("inspectConfig" .=) <$> _gpdvijcInspectConfig,
                  ("inspectTemplateName" .=) <$>
                    _gpdvijcInspectTemplateName])

-- | A reference to a StoredInfoType to use with scanning.
--
-- /See:/ 'googlePrivacyDlpV2StoredType' smart constructor.
data GooglePrivacyDlpV2StoredType = GooglePrivacyDlpV2StoredType'
    { _gpdvstName       :: !(Maybe Text)
    , _gpdvstCreateTime :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2StoredType' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvstName'
--
-- * 'gpdvstCreateTime'
googlePrivacyDlpV2StoredType
    :: GooglePrivacyDlpV2StoredType
googlePrivacyDlpV2StoredType =
    GooglePrivacyDlpV2StoredType'
    { _gpdvstName = Nothing
    , _gpdvstCreateTime = Nothing
    }

-- | Resource name of the requested \`StoredInfoType\`, for example
-- \`organizations\/433245324\/storedInfoTypes\/432452342\` or
-- \`projects\/project-id\/storedInfoTypes\/432452342\`.
gpdvstName :: Lens' GooglePrivacyDlpV2StoredType (Maybe Text)
gpdvstName
  = lens _gpdvstName (\ s a -> s{_gpdvstName = a})

-- | Timestamp indicating when the version of the \`StoredInfoType\` used for
-- inspection was created. Output-only field, populated by the system.
gpdvstCreateTime :: Lens' GooglePrivacyDlpV2StoredType (Maybe UTCTime)
gpdvstCreateTime
  = lens _gpdvstCreateTime
      (\ s a -> s{_gpdvstCreateTime = a})
      . mapping _DateTime

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

instance ToJSON GooglePrivacyDlpV2StoredType where
        toJSON GooglePrivacyDlpV2StoredType'{..}
          = object
              (catMaybes
                 [("name" .=) <$> _gpdvstName,
                  ("createTime" .=) <$> _gpdvstCreateTime])

-- | The transformation to apply to the field.
--
-- /See:/ 'googlePrivacyDlpV2FieldTransformation' smart constructor.
data GooglePrivacyDlpV2FieldTransformation = GooglePrivacyDlpV2FieldTransformation'
    { _gpdvftInfoTypeTransformations :: !(Maybe GooglePrivacyDlpV2InfoTypeTransformations)
    , _gpdvftPrimitiveTransformation :: !(Maybe GooglePrivacyDlpV2PrimitiveTransformation)
    , _gpdvftCondition               :: !(Maybe GooglePrivacyDlpV2RecordCondition)
    , _gpdvftFields                  :: !(Maybe [GooglePrivacyDlpV2FieldId])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2FieldTransformation' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvftInfoTypeTransformations'
--
-- * 'gpdvftPrimitiveTransformation'
--
-- * 'gpdvftCondition'
--
-- * 'gpdvftFields'
googlePrivacyDlpV2FieldTransformation
    :: GooglePrivacyDlpV2FieldTransformation
googlePrivacyDlpV2FieldTransformation =
    GooglePrivacyDlpV2FieldTransformation'
    { _gpdvftInfoTypeTransformations = Nothing
    , _gpdvftPrimitiveTransformation = Nothing
    , _gpdvftCondition = Nothing
    , _gpdvftFields = Nothing
    }

-- | Treat the contents of the field as free text, and selectively transform
-- content that matches an \`InfoType\`.
gpdvftInfoTypeTransformations :: Lens' GooglePrivacyDlpV2FieldTransformation (Maybe GooglePrivacyDlpV2InfoTypeTransformations)
gpdvftInfoTypeTransformations
  = lens _gpdvftInfoTypeTransformations
      (\ s a -> s{_gpdvftInfoTypeTransformations = a})

-- | Apply the transformation to the entire field.
gpdvftPrimitiveTransformation :: Lens' GooglePrivacyDlpV2FieldTransformation (Maybe GooglePrivacyDlpV2PrimitiveTransformation)
gpdvftPrimitiveTransformation
  = lens _gpdvftPrimitiveTransformation
      (\ s a -> s{_gpdvftPrimitiveTransformation = a})

-- | Only apply the transformation if the condition evaluates to true for the
-- given \`RecordCondition\`. The conditions are allowed to reference
-- fields that are not used in the actual transformation. [optional]
-- Example Use Cases: - Apply a different bucket transformation to an age
-- column if the zip code column for the same record is within a specific
-- range. - Redact a field if the date of birth field is greater than 85.
gpdvftCondition :: Lens' GooglePrivacyDlpV2FieldTransformation (Maybe GooglePrivacyDlpV2RecordCondition)
gpdvftCondition
  = lens _gpdvftCondition
      (\ s a -> s{_gpdvftCondition = a})

-- | Input field(s) to apply the transformation to. [required]
gpdvftFields :: Lens' GooglePrivacyDlpV2FieldTransformation [GooglePrivacyDlpV2FieldId]
gpdvftFields
  = lens _gpdvftFields (\ s a -> s{_gpdvftFields = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2FieldTransformation where
        parseJSON
          = withObject "GooglePrivacyDlpV2FieldTransformation"
              (\ o ->
                 GooglePrivacyDlpV2FieldTransformation' <$>
                   (o .:? "infoTypeTransformations") <*>
                     (o .:? "primitiveTransformation")
                     <*> (o .:? "condition")
                     <*> (o .:? "fields" .!= mempty))

instance ToJSON GooglePrivacyDlpV2FieldTransformation
         where
        toJSON GooglePrivacyDlpV2FieldTransformation'{..}
          = object
              (catMaybes
                 [("infoTypeTransformations" .=) <$>
                    _gpdvftInfoTypeTransformations,
                  ("primitiveTransformation" .=) <$>
                    _gpdvftPrimitiveTransformation,
                  ("condition" .=) <$> _gpdvftCondition,
                  ("fields" .=) <$> _gpdvftFields])

-- | The rule that adjusts the likelihood of findings within a certain
-- proximity of hotwords.
--
-- /See:/ 'googlePrivacyDlpV2HotwordRule' smart constructor.
data GooglePrivacyDlpV2HotwordRule = GooglePrivacyDlpV2HotwordRule'
    { _gpdvhrProximity            :: !(Maybe GooglePrivacyDlpV2Proximity)
    , _gpdvhrLikelihoodAdjustment :: !(Maybe GooglePrivacyDlpV2LikelihoodAdjustment)
    , _gpdvhrHotwordRegex         :: !(Maybe GooglePrivacyDlpV2Regex)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2HotwordRule' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvhrProximity'
--
-- * 'gpdvhrLikelihoodAdjustment'
--
-- * 'gpdvhrHotwordRegex'
googlePrivacyDlpV2HotwordRule
    :: GooglePrivacyDlpV2HotwordRule
googlePrivacyDlpV2HotwordRule =
    GooglePrivacyDlpV2HotwordRule'
    { _gpdvhrProximity = Nothing
    , _gpdvhrLikelihoodAdjustment = Nothing
    , _gpdvhrHotwordRegex = Nothing
    }

-- | Proximity of the finding within which the entire hotword must reside.
-- The total length of the window cannot exceed 1000 characters. Note that
-- the finding itself will be included in the window, so that hotwords may
-- be used to match substrings of the finding itself. For example, the
-- certainty of a phone number regex \"\\(\\d{3}\\) \\d{3}-\\d{4}\" could
-- be adjusted upwards if the area code is known to be the local area code
-- of a company office using the hotword regex \"\\(xxx\\)\", where \"xxx\"
-- is the area code in question.
gpdvhrProximity :: Lens' GooglePrivacyDlpV2HotwordRule (Maybe GooglePrivacyDlpV2Proximity)
gpdvhrProximity
  = lens _gpdvhrProximity
      (\ s a -> s{_gpdvhrProximity = a})

-- | Likelihood adjustment to apply to all matching findings.
gpdvhrLikelihoodAdjustment :: Lens' GooglePrivacyDlpV2HotwordRule (Maybe GooglePrivacyDlpV2LikelihoodAdjustment)
gpdvhrLikelihoodAdjustment
  = lens _gpdvhrLikelihoodAdjustment
      (\ s a -> s{_gpdvhrLikelihoodAdjustment = a})

-- | Regular expression pattern defining what qualifies as a hotword.
gpdvhrHotwordRegex :: Lens' GooglePrivacyDlpV2HotwordRule (Maybe GooglePrivacyDlpV2Regex)
gpdvhrHotwordRegex
  = lens _gpdvhrHotwordRegex
      (\ s a -> s{_gpdvhrHotwordRegex = a})

instance FromJSON GooglePrivacyDlpV2HotwordRule where
        parseJSON
          = withObject "GooglePrivacyDlpV2HotwordRule"
              (\ o ->
                 GooglePrivacyDlpV2HotwordRule' <$>
                   (o .:? "proximity") <*>
                     (o .:? "likelihoodAdjustment")
                     <*> (o .:? "hotwordRegex"))

instance ToJSON GooglePrivacyDlpV2HotwordRule where
        toJSON GooglePrivacyDlpV2HotwordRule'{..}
          = object
              (catMaybes
                 [("proximity" .=) <$> _gpdvhrProximity,
                  ("likelihoodAdjustment" .=) <$>
                    _gpdvhrLikelihoodAdjustment,
                  ("hotwordRegex" .=) <$> _gpdvhrHotwordRegex])

-- | Request to search for potentially sensitive info in an image and redact
-- it by covering it with a colored rectangle.
--
-- /See:/ 'googlePrivacyDlpV2RedactImageRequest' smart constructor.
data GooglePrivacyDlpV2RedactImageRequest = GooglePrivacyDlpV2RedactImageRequest'
    { _gpdvrirIncludeFindings       :: !(Maybe Bool)
    , _gpdvrirInspectConfig         :: !(Maybe GooglePrivacyDlpV2InspectConfig)
    , _gpdvrirByteItem              :: !(Maybe GooglePrivacyDlpV2ByteContentItem)
    , _gpdvrirImageRedactionConfigs :: !(Maybe [GooglePrivacyDlpV2ImageRedactionConfig])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2RedactImageRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvrirIncludeFindings'
--
-- * 'gpdvrirInspectConfig'
--
-- * 'gpdvrirByteItem'
--
-- * 'gpdvrirImageRedactionConfigs'
googlePrivacyDlpV2RedactImageRequest
    :: GooglePrivacyDlpV2RedactImageRequest
googlePrivacyDlpV2RedactImageRequest =
    GooglePrivacyDlpV2RedactImageRequest'
    { _gpdvrirIncludeFindings = Nothing
    , _gpdvrirInspectConfig = Nothing
    , _gpdvrirByteItem = Nothing
    , _gpdvrirImageRedactionConfigs = Nothing
    }

-- | Whether the response should include findings along with the redacted
-- image.
gpdvrirIncludeFindings :: Lens' GooglePrivacyDlpV2RedactImageRequest (Maybe Bool)
gpdvrirIncludeFindings
  = lens _gpdvrirIncludeFindings
      (\ s a -> s{_gpdvrirIncludeFindings = a})

-- | Configuration for the inspector.
gpdvrirInspectConfig :: Lens' GooglePrivacyDlpV2RedactImageRequest (Maybe GooglePrivacyDlpV2InspectConfig)
gpdvrirInspectConfig
  = lens _gpdvrirInspectConfig
      (\ s a -> s{_gpdvrirInspectConfig = a})

-- | The content must be PNG, JPEG, SVG or BMP.
gpdvrirByteItem :: Lens' GooglePrivacyDlpV2RedactImageRequest (Maybe GooglePrivacyDlpV2ByteContentItem)
gpdvrirByteItem
  = lens _gpdvrirByteItem
      (\ s a -> s{_gpdvrirByteItem = a})

-- | The configuration for specifying what content to redact from images.
gpdvrirImageRedactionConfigs :: Lens' GooglePrivacyDlpV2RedactImageRequest [GooglePrivacyDlpV2ImageRedactionConfig]
gpdvrirImageRedactionConfigs
  = lens _gpdvrirImageRedactionConfigs
      (\ s a -> s{_gpdvrirImageRedactionConfigs = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2RedactImageRequest where
        parseJSON
          = withObject "GooglePrivacyDlpV2RedactImageRequest"
              (\ o ->
                 GooglePrivacyDlpV2RedactImageRequest' <$>
                   (o .:? "includeFindings") <*> (o .:? "inspectConfig")
                     <*> (o .:? "byteItem")
                     <*> (o .:? "imageRedactionConfigs" .!= mempty))

instance ToJSON GooglePrivacyDlpV2RedactImageRequest
         where
        toJSON GooglePrivacyDlpV2RedactImageRequest'{..}
          = object
              (catMaybes
                 [("includeFindings" .=) <$> _gpdvrirIncludeFindings,
                  ("inspectConfig" .=) <$> _gpdvrirInspectConfig,
                  ("byteItem" .=) <$> _gpdvrirByteItem,
                  ("imageRedactionConfigs" .=) <$>
                    _gpdvrirImageRedactionConfigs])

--
-- /See:/ 'googlePrivacyDlpV2FindingLimits' smart constructor.
data GooglePrivacyDlpV2FindingLimits = GooglePrivacyDlpV2FindingLimits'
    { _gpdvflMaxFindingsPerItem     :: !(Maybe (Textual Int32))
    , _gpdvflMaxFindingsPerInfoType :: !(Maybe [GooglePrivacyDlpV2InfoTypeLimit])
    , _gpdvflMaxFindingsPerRequest  :: !(Maybe (Textual Int32))
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2FindingLimits' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvflMaxFindingsPerItem'
--
-- * 'gpdvflMaxFindingsPerInfoType'
--
-- * 'gpdvflMaxFindingsPerRequest'
googlePrivacyDlpV2FindingLimits
    :: GooglePrivacyDlpV2FindingLimits
googlePrivacyDlpV2FindingLimits =
    GooglePrivacyDlpV2FindingLimits'
    { _gpdvflMaxFindingsPerItem = Nothing
    , _gpdvflMaxFindingsPerInfoType = Nothing
    , _gpdvflMaxFindingsPerRequest = Nothing
    }

-- | Max number of findings that will be returned for each item scanned. When
-- set within \`InspectDataSourceRequest\`, the maximum returned is 1000
-- regardless if this is set higher. When set within
-- \`InspectContentRequest\`, this field is ignored.
gpdvflMaxFindingsPerItem :: Lens' GooglePrivacyDlpV2FindingLimits (Maybe Int32)
gpdvflMaxFindingsPerItem
  = lens _gpdvflMaxFindingsPerItem
      (\ s a -> s{_gpdvflMaxFindingsPerItem = a})
      . mapping _Coerce

-- | Configuration of findings limit given for specified infoTypes.
gpdvflMaxFindingsPerInfoType :: Lens' GooglePrivacyDlpV2FindingLimits [GooglePrivacyDlpV2InfoTypeLimit]
gpdvflMaxFindingsPerInfoType
  = lens _gpdvflMaxFindingsPerInfoType
      (\ s a -> s{_gpdvflMaxFindingsPerInfoType = a})
      . _Default
      . _Coerce

-- | Max number of findings that will be returned per request\/job. When set
-- within \`InspectContentRequest\`, the maximum returned is 1000
-- regardless if this is set higher.
gpdvflMaxFindingsPerRequest :: Lens' GooglePrivacyDlpV2FindingLimits (Maybe Int32)
gpdvflMaxFindingsPerRequest
  = lens _gpdvflMaxFindingsPerRequest
      (\ s a -> s{_gpdvflMaxFindingsPerRequest = a})
      . mapping _Coerce

instance FromJSON GooglePrivacyDlpV2FindingLimits
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2FindingLimits"
              (\ o ->
                 GooglePrivacyDlpV2FindingLimits' <$>
                   (o .:? "maxFindingsPerItem") <*>
                     (o .:? "maxFindingsPerInfoType" .!= mempty)
                     <*> (o .:? "maxFindingsPerRequest"))

instance ToJSON GooglePrivacyDlpV2FindingLimits where
        toJSON GooglePrivacyDlpV2FindingLimits'{..}
          = object
              (catMaybes
                 [("maxFindingsPerItem" .=) <$>
                    _gpdvflMaxFindingsPerItem,
                  ("maxFindingsPerInfoType" .=) <$>
                    _gpdvflMaxFindingsPerInfoType,
                  ("maxFindingsPerRequest" .=) <$>
                    _gpdvflMaxFindingsPerRequest])

-- | The field type of \`value\` and \`field\` do not need to match to be
-- considered equal, but not all comparisons are possible. A \`value\` of
-- type: - \`string\` can be compared against all other types - \`boolean\`
-- can only be compared against other booleans - \`integer\` can be
-- compared against doubles or a string if the string value can be parsed
-- as an integer. - \`double\` can be compared against integers or a string
-- if the string can be parsed as a double. - \`Timestamp\` can be compared
-- against strings in RFC 3339 date string format. - \`TimeOfDay\` can be
-- compared against timestamps and strings in the format of \'HH:mm:ss\'.
-- If we fail to compare do to type mismatch, a warning will be given and
-- the condition will evaluate to false.
--
-- /See:/ 'googlePrivacyDlpV2Condition' smart constructor.
data GooglePrivacyDlpV2Condition = GooglePrivacyDlpV2Condition'
    { _gpdvcField    :: !(Maybe GooglePrivacyDlpV2FieldId)
    , _gpdvcOperator :: !(Maybe GooglePrivacyDlpV2ConditionOperator)
    , _gpdvcValue    :: !(Maybe GooglePrivacyDlpV2Value)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2Condition' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcField'
--
-- * 'gpdvcOperator'
--
-- * 'gpdvcValue'
googlePrivacyDlpV2Condition
    :: GooglePrivacyDlpV2Condition
googlePrivacyDlpV2Condition =
    GooglePrivacyDlpV2Condition'
    { _gpdvcField = Nothing
    , _gpdvcOperator = Nothing
    , _gpdvcValue = Nothing
    }

-- | Field within the record this condition is evaluated against. [required]
gpdvcField :: Lens' GooglePrivacyDlpV2Condition (Maybe GooglePrivacyDlpV2FieldId)
gpdvcField
  = lens _gpdvcField (\ s a -> s{_gpdvcField = a})

-- | Operator used to compare the field or infoType to the value. [required]
gpdvcOperator :: Lens' GooglePrivacyDlpV2Condition (Maybe GooglePrivacyDlpV2ConditionOperator)
gpdvcOperator
  = lens _gpdvcOperator
      (\ s a -> s{_gpdvcOperator = a})

-- | Value to compare against. [Required, except for \`EXISTS\` tests.]
gpdvcValue :: Lens' GooglePrivacyDlpV2Condition (Maybe GooglePrivacyDlpV2Value)
gpdvcValue
  = lens _gpdvcValue (\ s a -> s{_gpdvcValue = a})

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

instance ToJSON GooglePrivacyDlpV2Condition where
        toJSON GooglePrivacyDlpV2Condition'{..}
          = object
              (catMaybes
                 [("field" .=) <$> _gpdvcField,
                  ("operator" .=) <$> _gpdvcOperator,
                  ("value" .=) <$> _gpdvcValue])

-- | Configuration of the timespan of the items to include in scanning.
-- Currently only supported when inspecting Google Cloud Storage and
-- BigQuery.
--
-- /See:/ 'googlePrivacyDlpV2TimespanConfig' smart constructor.
data GooglePrivacyDlpV2TimespanConfig = GooglePrivacyDlpV2TimespanConfig'
    { _gpdvtcTimestampField                       :: !(Maybe GooglePrivacyDlpV2FieldId)
    , _gpdvtcStartTime                            :: !(Maybe DateTime')
    , _gpdvtcEnableAutoPopulationOfTimespanConfig :: !(Maybe Bool)
    , _gpdvtcEndTime                              :: !(Maybe DateTime')
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2TimespanConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvtcTimestampField'
--
-- * 'gpdvtcStartTime'
--
-- * 'gpdvtcEnableAutoPopulationOfTimespanConfig'
--
-- * 'gpdvtcEndTime'
googlePrivacyDlpV2TimespanConfig
    :: GooglePrivacyDlpV2TimespanConfig
googlePrivacyDlpV2TimespanConfig =
    GooglePrivacyDlpV2TimespanConfig'
    { _gpdvtcTimestampField = Nothing
    , _gpdvtcStartTime = Nothing
    , _gpdvtcEnableAutoPopulationOfTimespanConfig = Nothing
    , _gpdvtcEndTime = Nothing
    }

-- | Specification of the field containing the timestamp of scanned items.
-- Used for data sources like Datastore or BigQuery. If not specified for
-- BigQuery, table last modification timestamp is checked against given
-- time span. The valid data types of the timestamp field are: for BigQuery
-- - timestamp, date, datetime; for Datastore - timestamp. Datastore entity
-- will be scanned if the timestamp property does not exist or its value is
-- empty or invalid.
gpdvtcTimestampField :: Lens' GooglePrivacyDlpV2TimespanConfig (Maybe GooglePrivacyDlpV2FieldId)
gpdvtcTimestampField
  = lens _gpdvtcTimestampField
      (\ s a -> s{_gpdvtcTimestampField = a})

-- | Exclude files or rows older than this value.
gpdvtcStartTime :: Lens' GooglePrivacyDlpV2TimespanConfig (Maybe UTCTime)
gpdvtcStartTime
  = lens _gpdvtcStartTime
      (\ s a -> s{_gpdvtcStartTime = a})
      . mapping _DateTime

-- | When the job is started by a JobTrigger we will automatically figure out
-- a valid start_time to avoid scanning files that have not been modified
-- since the last time the JobTrigger executed. This will be based on the
-- time of the execution of the last run of the JobTrigger.
gpdvtcEnableAutoPopulationOfTimespanConfig :: Lens' GooglePrivacyDlpV2TimespanConfig (Maybe Bool)
gpdvtcEnableAutoPopulationOfTimespanConfig
  = lens _gpdvtcEnableAutoPopulationOfTimespanConfig
      (\ s a ->
         s{_gpdvtcEnableAutoPopulationOfTimespanConfig = a})

-- | Exclude files or rows newer than this value. If set to zero, no upper
-- time limit is applied.
gpdvtcEndTime :: Lens' GooglePrivacyDlpV2TimespanConfig (Maybe UTCTime)
gpdvtcEndTime
  = lens _gpdvtcEndTime
      (\ s a -> s{_gpdvtcEndTime = a})
      . mapping _DateTime

instance FromJSON GooglePrivacyDlpV2TimespanConfig
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2TimespanConfig"
              (\ o ->
                 GooglePrivacyDlpV2TimespanConfig' <$>
                   (o .:? "timestampField") <*> (o .:? "startTime") <*>
                     (o .:? "enableAutoPopulationOfTimespanConfig")
                     <*> (o .:? "endTime"))

instance ToJSON GooglePrivacyDlpV2TimespanConfig
         where
        toJSON GooglePrivacyDlpV2TimespanConfig'{..}
          = object
              (catMaybes
                 [("timestampField" .=) <$> _gpdvtcTimestampField,
                  ("startTime" .=) <$> _gpdvtcStartTime,
                  ("enableAutoPopulationOfTimespanConfig" .=) <$>
                    _gpdvtcEnableAutoPopulationOfTimespanConfig,
                  ("endTime" .=) <$> _gpdvtcEndTime])

-- | Request message for CreateDeidentifyTemplate.
--
-- /See:/ 'googlePrivacyDlpV2CreateDeidentifyTemplateRequest' smart constructor.
data GooglePrivacyDlpV2CreateDeidentifyTemplateRequest = GooglePrivacyDlpV2CreateDeidentifyTemplateRequest'
    { _gpdvcdtrTemplateId         :: !(Maybe Text)
    , _gpdvcdtrDeidentifyTemplate :: !(Maybe GooglePrivacyDlpV2DeidentifyTemplate)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CreateDeidentifyTemplateRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcdtrTemplateId'
--
-- * 'gpdvcdtrDeidentifyTemplate'
googlePrivacyDlpV2CreateDeidentifyTemplateRequest
    :: GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
googlePrivacyDlpV2CreateDeidentifyTemplateRequest =
    GooglePrivacyDlpV2CreateDeidentifyTemplateRequest'
    { _gpdvcdtrTemplateId = Nothing
    , _gpdvcdtrDeidentifyTemplate = Nothing
    }

-- | The template id can contain uppercase and lowercase letters, numbers,
-- and hyphens; that is, it must match the regular expression:
-- \`[a-zA-Z\\\\d-]+\`. The maximum length is 100 characters. Can be empty
-- to allow the system to generate one.
gpdvcdtrTemplateId :: Lens' GooglePrivacyDlpV2CreateDeidentifyTemplateRequest (Maybe Text)
gpdvcdtrTemplateId
  = lens _gpdvcdtrTemplateId
      (\ s a -> s{_gpdvcdtrTemplateId = a})

-- | The DeidentifyTemplate to create.
gpdvcdtrDeidentifyTemplate :: Lens' GooglePrivacyDlpV2CreateDeidentifyTemplateRequest (Maybe GooglePrivacyDlpV2DeidentifyTemplate)
gpdvcdtrDeidentifyTemplate
  = lens _gpdvcdtrDeidentifyTemplate
      (\ s a -> s{_gpdvcdtrDeidentifyTemplate = a})

instance FromJSON
         GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
         where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2CreateDeidentifyTemplateRequest"
              (\ o ->
                 GooglePrivacyDlpV2CreateDeidentifyTemplateRequest'
                   <$>
                   (o .:? "templateId") <*>
                     (o .:? "deidentifyTemplate"))

instance ToJSON
         GooglePrivacyDlpV2CreateDeidentifyTemplateRequest
         where
        toJSON
          GooglePrivacyDlpV2CreateDeidentifyTemplateRequest'{..}
          = object
              (catMaybes
                 [("templateId" .=) <$> _gpdvcdtrTemplateId,
                  ("deidentifyTemplate" .=) <$>
                    _gpdvcdtrDeidentifyTemplate])

-- | Use this to have a random data crypto key generated. It will be
-- discarded after the request finishes.
--
-- /See:/ 'googlePrivacyDlpV2TransientCryptoKey' smart constructor.
newtype GooglePrivacyDlpV2TransientCryptoKey = GooglePrivacyDlpV2TransientCryptoKey'
    { _gpdvtckName :: Maybe Text
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2TransientCryptoKey' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvtckName'
googlePrivacyDlpV2TransientCryptoKey
    :: GooglePrivacyDlpV2TransientCryptoKey
googlePrivacyDlpV2TransientCryptoKey =
    GooglePrivacyDlpV2TransientCryptoKey'
    { _gpdvtckName = Nothing
    }

-- | Name of the key. [required] This is an arbitrary string used to
-- differentiate different keys. A unique key is generated per name: two
-- separate \`TransientCryptoKey\` protos share the same generated key if
-- their names are the same. When the data crypto key is generated, this
-- name is not used in any way (repeating the api call will result in a
-- different key being generated).
gpdvtckName :: Lens' GooglePrivacyDlpV2TransientCryptoKey (Maybe Text)
gpdvtckName
  = lens _gpdvtckName (\ s a -> s{_gpdvtckName = a})

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

instance ToJSON GooglePrivacyDlpV2TransientCryptoKey
         where
        toJSON GooglePrivacyDlpV2TransientCryptoKey'{..}
          = object (catMaybes [("name" .=) <$> _gpdvtckName])

-- | InfoType description.
--
-- /See:/ 'googlePrivacyDlpV2InfoTypeDescription' smart constructor.
data GooglePrivacyDlpV2InfoTypeDescription = GooglePrivacyDlpV2InfoTypeDescription'
    { _gpdvitdName        :: !(Maybe Text)
    , _gpdvitdDisplayName :: !(Maybe Text)
    , _gpdvitdSupportedBy :: !(Maybe [Text])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2InfoTypeDescription' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvitdName'
--
-- * 'gpdvitdDisplayName'
--
-- * 'gpdvitdSupportedBy'
googlePrivacyDlpV2InfoTypeDescription
    :: GooglePrivacyDlpV2InfoTypeDescription
googlePrivacyDlpV2InfoTypeDescription =
    GooglePrivacyDlpV2InfoTypeDescription'
    { _gpdvitdName = Nothing
    , _gpdvitdDisplayName = Nothing
    , _gpdvitdSupportedBy = Nothing
    }

-- | Internal name of the infoType.
gpdvitdName :: Lens' GooglePrivacyDlpV2InfoTypeDescription (Maybe Text)
gpdvitdName
  = lens _gpdvitdName (\ s a -> s{_gpdvitdName = a})

-- | Human readable form of the infoType name.
gpdvitdDisplayName :: Lens' GooglePrivacyDlpV2InfoTypeDescription (Maybe Text)
gpdvitdDisplayName
  = lens _gpdvitdDisplayName
      (\ s a -> s{_gpdvitdDisplayName = a})

-- | Which parts of the API supports this InfoType.
gpdvitdSupportedBy :: Lens' GooglePrivacyDlpV2InfoTypeDescription [Text]
gpdvitdSupportedBy
  = lens _gpdvitdSupportedBy
      (\ s a -> s{_gpdvitdSupportedBy = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2InfoTypeDescription where
        parseJSON
          = withObject "GooglePrivacyDlpV2InfoTypeDescription"
              (\ o ->
                 GooglePrivacyDlpV2InfoTypeDescription' <$>
                   (o .:? "name") <*> (o .:? "displayName") <*>
                     (o .:? "supportedBy" .!= mempty))

instance ToJSON GooglePrivacyDlpV2InfoTypeDescription
         where
        toJSON GooglePrivacyDlpV2InfoTypeDescription'{..}
          = object
              (catMaybes
                 [("name" .=) <$> _gpdvitdName,
                  ("displayName" .=) <$> _gpdvitdDisplayName,
                  ("supportedBy" .=) <$> _gpdvitdSupportedBy])

-- | A generic empty message that you can re-use to avoid defining duplicated
-- empty messages in your APIs. A typical example is to use it as the
-- request or the response type of an API method. For instance: service Foo
-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
--
-- /See:/ 'googleProtobufEmpty' smart constructor.
data GoogleProtobufEmpty =
    GoogleProtobufEmpty'
    deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleProtobufEmpty' with the minimum fields required to make a request.
--
googleProtobufEmpty
    :: GoogleProtobufEmpty
googleProtobufEmpty = GoogleProtobufEmpty'

instance FromJSON GoogleProtobufEmpty where
        parseJSON
          = withObject "GoogleProtobufEmpty"
              (\ o -> pure GoogleProtobufEmpty')

instance ToJSON GoogleProtobufEmpty where
        toJSON = const emptyObject

--
-- /See:/ 'googleRpcStatusDetailsItem' smart constructor.
newtype GoogleRpcStatusDetailsItem = GoogleRpcStatusDetailsItem'
    { _grsdiAddtional :: HashMap Text JSONValue
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GoogleRpcStatusDetailsItem' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'grsdiAddtional'
googleRpcStatusDetailsItem
    :: HashMap Text JSONValue -- ^ 'grsdiAddtional'
    -> GoogleRpcStatusDetailsItem
googleRpcStatusDetailsItem pGrsdiAddtional_ =
    GoogleRpcStatusDetailsItem'
    { _grsdiAddtional = _Coerce # pGrsdiAddtional_
    }

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

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

instance ToJSON GoogleRpcStatusDetailsItem where
        toJSON = toJSON . _grsdiAddtional

-- | Configuration for determining how redaction of images should occur.
--
-- /See:/ 'googlePrivacyDlpV2ImageRedactionConfig' smart constructor.
data GooglePrivacyDlpV2ImageRedactionConfig = GooglePrivacyDlpV2ImageRedactionConfig'
    { _gpdvircRedactionColor :: !(Maybe GooglePrivacyDlpV2Color)
    , _gpdvircInfoType       :: !(Maybe GooglePrivacyDlpV2InfoType)
    , _gpdvircRedactAllText  :: !(Maybe Bool)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2ImageRedactionConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvircRedactionColor'
--
-- * 'gpdvircInfoType'
--
-- * 'gpdvircRedactAllText'
googlePrivacyDlpV2ImageRedactionConfig
    :: GooglePrivacyDlpV2ImageRedactionConfig
googlePrivacyDlpV2ImageRedactionConfig =
    GooglePrivacyDlpV2ImageRedactionConfig'
    { _gpdvircRedactionColor = Nothing
    , _gpdvircInfoType = Nothing
    , _gpdvircRedactAllText = Nothing
    }

-- | The color to use when redacting content from an image. If not specified,
-- the default is black.
gpdvircRedactionColor :: Lens' GooglePrivacyDlpV2ImageRedactionConfig (Maybe GooglePrivacyDlpV2Color)
gpdvircRedactionColor
  = lens _gpdvircRedactionColor
      (\ s a -> s{_gpdvircRedactionColor = a})

-- | Only one per info_type should be provided per request. If not specified,
-- and redact_all_text is false, the DLP API will redact all text that it
-- matches against all info_types that are found, but not specified in
-- another ImageRedactionConfig.
gpdvircInfoType :: Lens' GooglePrivacyDlpV2ImageRedactionConfig (Maybe GooglePrivacyDlpV2InfoType)
gpdvircInfoType
  = lens _gpdvircInfoType
      (\ s a -> s{_gpdvircInfoType = a})

-- | If true, all text found in the image, regardless whether it matches an
-- info_type, is redacted. Only one should be provided.
gpdvircRedactAllText :: Lens' GooglePrivacyDlpV2ImageRedactionConfig (Maybe Bool)
gpdvircRedactAllText
  = lens _gpdvircRedactAllText
      (\ s a -> s{_gpdvircRedactAllText = a})

instance FromJSON
         GooglePrivacyDlpV2ImageRedactionConfig where
        parseJSON
          = withObject "GooglePrivacyDlpV2ImageRedactionConfig"
              (\ o ->
                 GooglePrivacyDlpV2ImageRedactionConfig' <$>
                   (o .:? "redactionColor") <*> (o .:? "infoType") <*>
                     (o .:? "redactAllText"))

instance ToJSON
         GooglePrivacyDlpV2ImageRedactionConfig where
        toJSON GooglePrivacyDlpV2ImageRedactionConfig'{..}
          = object
              (catMaybes
                 [("redactionColor" .=) <$> _gpdvircRedactionColor,
                  ("infoType" .=) <$> _gpdvircInfoType,
                  ("redactAllText" .=) <$> _gpdvircRedactAllText])

-- | What event needs to occur for a new job to be started.
--
-- /See:/ 'googlePrivacyDlpV2Trigger' smart constructor.
newtype GooglePrivacyDlpV2Trigger = GooglePrivacyDlpV2Trigger'
    { _gpdvtSchedule :: Maybe GooglePrivacyDlpV2Schedule
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2Trigger' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvtSchedule'
googlePrivacyDlpV2Trigger
    :: GooglePrivacyDlpV2Trigger
googlePrivacyDlpV2Trigger =
    GooglePrivacyDlpV2Trigger'
    { _gpdvtSchedule = Nothing
    }

-- | Create a job on a repeating basis based on the elapse of time.
gpdvtSchedule :: Lens' GooglePrivacyDlpV2Trigger (Maybe GooglePrivacyDlpV2Schedule)
gpdvtSchedule
  = lens _gpdvtSchedule
      (\ s a -> s{_gpdvtSchedule = a})

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

instance ToJSON GooglePrivacyDlpV2Trigger where
        toJSON GooglePrivacyDlpV2Trigger'{..}
          = object
              (catMaybes [("schedule" .=) <$> _gpdvtSchedule])

-- | Options defining a file or a set of files within a Google Cloud Storage
-- bucket.
--
-- /See:/ 'googlePrivacyDlpV2CloudStorageOptions' smart constructor.
data GooglePrivacyDlpV2CloudStorageOptions = GooglePrivacyDlpV2CloudStorageOptions'
    { _gpdvcsoFileSet                  :: !(Maybe GooglePrivacyDlpV2FileSet)
    , _gpdvcsoBytesLimitPerFile        :: !(Maybe (Textual Int64))
    , _gpdvcsoFileTypes                :: !(Maybe [Text])
    , _gpdvcsoBytesLimitPerFilePercent :: !(Maybe (Textual Int32))
    , _gpdvcsoFilesLimitPercent        :: !(Maybe (Textual Int32))
    , _gpdvcsoSampleMethod             :: !(Maybe GooglePrivacyDlpV2CloudStorageOptionsSampleMethod)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CloudStorageOptions' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcsoFileSet'
--
-- * 'gpdvcsoBytesLimitPerFile'
--
-- * 'gpdvcsoFileTypes'
--
-- * 'gpdvcsoBytesLimitPerFilePercent'
--
-- * 'gpdvcsoFilesLimitPercent'
--
-- * 'gpdvcsoSampleMethod'
googlePrivacyDlpV2CloudStorageOptions
    :: GooglePrivacyDlpV2CloudStorageOptions
googlePrivacyDlpV2CloudStorageOptions =
    GooglePrivacyDlpV2CloudStorageOptions'
    { _gpdvcsoFileSet = Nothing
    , _gpdvcsoBytesLimitPerFile = Nothing
    , _gpdvcsoFileTypes = Nothing
    , _gpdvcsoBytesLimitPerFilePercent = Nothing
    , _gpdvcsoFilesLimitPercent = Nothing
    , _gpdvcsoSampleMethod = Nothing
    }

-- | The set of one or more files to scan.
gpdvcsoFileSet :: Lens' GooglePrivacyDlpV2CloudStorageOptions (Maybe GooglePrivacyDlpV2FileSet)
gpdvcsoFileSet
  = lens _gpdvcsoFileSet
      (\ s a -> s{_gpdvcsoFileSet = a})

-- | Max number of bytes to scan from a file. If a scanned file\'s size is
-- bigger than this value then the rest of the bytes are omitted. Only one
-- of bytes_limit_per_file and bytes_limit_per_file_percent can be
-- specified.
gpdvcsoBytesLimitPerFile :: Lens' GooglePrivacyDlpV2CloudStorageOptions (Maybe Int64)
gpdvcsoBytesLimitPerFile
  = lens _gpdvcsoBytesLimitPerFile
      (\ s a -> s{_gpdvcsoBytesLimitPerFile = a})
      . mapping _Coerce

-- | List of file type groups to include in the scan. If empty, all files are
-- scanned and available data format processors are applied. In addition,
-- the binary content of the selected files is always scanned as well.
gpdvcsoFileTypes :: Lens' GooglePrivacyDlpV2CloudStorageOptions [Text]
gpdvcsoFileTypes
  = lens _gpdvcsoFileTypes
      (\ s a -> s{_gpdvcsoFileTypes = a})
      . _Default
      . _Coerce

-- | Max percentage of bytes to scan from a file. The rest are omitted. The
-- number of bytes scanned is rounded down. Must be between 0 and 100,
-- inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one of
-- bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
gpdvcsoBytesLimitPerFilePercent :: Lens' GooglePrivacyDlpV2CloudStorageOptions (Maybe Int32)
gpdvcsoBytesLimitPerFilePercent
  = lens _gpdvcsoBytesLimitPerFilePercent
      (\ s a -> s{_gpdvcsoBytesLimitPerFilePercent = a})
      . mapping _Coerce

-- | Limits the number of files to scan to this percentage of the input
-- FileSet. Number of files scanned is rounded down. Must be between 0 and
-- 100, inclusively. Both 0 and 100 means no limit. Defaults to 0.
gpdvcsoFilesLimitPercent :: Lens' GooglePrivacyDlpV2CloudStorageOptions (Maybe Int32)
gpdvcsoFilesLimitPercent
  = lens _gpdvcsoFilesLimitPercent
      (\ s a -> s{_gpdvcsoFilesLimitPercent = a})
      . mapping _Coerce

gpdvcsoSampleMethod :: Lens' GooglePrivacyDlpV2CloudStorageOptions (Maybe GooglePrivacyDlpV2CloudStorageOptionsSampleMethod)
gpdvcsoSampleMethod
  = lens _gpdvcsoSampleMethod
      (\ s a -> s{_gpdvcsoSampleMethod = a})

instance FromJSON
         GooglePrivacyDlpV2CloudStorageOptions where
        parseJSON
          = withObject "GooglePrivacyDlpV2CloudStorageOptions"
              (\ o ->
                 GooglePrivacyDlpV2CloudStorageOptions' <$>
                   (o .:? "fileSet") <*> (o .:? "bytesLimitPerFile") <*>
                     (o .:? "fileTypes" .!= mempty)
                     <*> (o .:? "bytesLimitPerFilePercent")
                     <*> (o .:? "filesLimitPercent")
                     <*> (o .:? "sampleMethod"))

instance ToJSON GooglePrivacyDlpV2CloudStorageOptions
         where
        toJSON GooglePrivacyDlpV2CloudStorageOptions'{..}
          = object
              (catMaybes
                 [("fileSet" .=) <$> _gpdvcsoFileSet,
                  ("bytesLimitPerFile" .=) <$>
                    _gpdvcsoBytesLimitPerFile,
                  ("fileTypes" .=) <$> _gpdvcsoFileTypes,
                  ("bytesLimitPerFilePercent" .=) <$>
                    _gpdvcsoBytesLimitPerFilePercent,
                  ("filesLimitPercent" .=) <$>
                    _gpdvcsoFilesLimitPercent,
                  ("sampleMethod" .=) <$> _gpdvcsoSampleMethod])

-- | δ-presence metric, used to estimate how likely it is for an attacker to
-- figure out that one given individual appears in a de-identified dataset.
-- Similarly to the k-map metric, we cannot compute δ-presence exactly
-- without knowing the attack dataset, so we use a statistical model
-- instead.
--
-- /See:/ 'googlePrivacyDlpV2DeltaPresenceEstimationConfig' smart constructor.
data GooglePrivacyDlpV2DeltaPresenceEstimationConfig = GooglePrivacyDlpV2DeltaPresenceEstimationConfig'
    { _gpdvdpecAuxiliaryTables :: !(Maybe [GooglePrivacyDlpV2StatisticalTable])
    , _gpdvdpecRegionCode      :: !(Maybe Text)
    , _gpdvdpecQuasiIds        :: !(Maybe [GooglePrivacyDlpV2QuasiId])
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2DeltaPresenceEstimationConfig' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvdpecAuxiliaryTables'
--
-- * 'gpdvdpecRegionCode'
--
-- * 'gpdvdpecQuasiIds'
googlePrivacyDlpV2DeltaPresenceEstimationConfig
    :: GooglePrivacyDlpV2DeltaPresenceEstimationConfig
googlePrivacyDlpV2DeltaPresenceEstimationConfig =
    GooglePrivacyDlpV2DeltaPresenceEstimationConfig'
    { _gpdvdpecAuxiliaryTables = Nothing
    , _gpdvdpecRegionCode = Nothing
    , _gpdvdpecQuasiIds = Nothing
    }

-- | Several auxiliary tables can be used in the analysis. Each custom_tag
-- used to tag a quasi-identifiers field must appear in exactly one field
-- of one auxiliary table.
gpdvdpecAuxiliaryTables :: Lens' GooglePrivacyDlpV2DeltaPresenceEstimationConfig [GooglePrivacyDlpV2StatisticalTable]
gpdvdpecAuxiliaryTables
  = lens _gpdvdpecAuxiliaryTables
      (\ s a -> s{_gpdvdpecAuxiliaryTables = a})
      . _Default
      . _Coerce

-- | ISO 3166-1 alpha-2 region code to use in the statistical modeling.
-- Required if no column is tagged with a region-specific InfoType (like
-- US_ZIP_5) or a region code.
gpdvdpecRegionCode :: Lens' GooglePrivacyDlpV2DeltaPresenceEstimationConfig (Maybe Text)
gpdvdpecRegionCode
  = lens _gpdvdpecRegionCode
      (\ s a -> s{_gpdvdpecRegionCode = a})

-- | Fields considered to be quasi-identifiers. No two fields can have the
-- same tag. [required]
gpdvdpecQuasiIds :: Lens' GooglePrivacyDlpV2DeltaPresenceEstimationConfig [GooglePrivacyDlpV2QuasiId]
gpdvdpecQuasiIds
  = lens _gpdvdpecQuasiIds
      (\ s a -> s{_gpdvdpecQuasiIds = a})
      . _Default
      . _Coerce

instance FromJSON
         GooglePrivacyDlpV2DeltaPresenceEstimationConfig where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2DeltaPresenceEstimationConfig"
              (\ o ->
                 GooglePrivacyDlpV2DeltaPresenceEstimationConfig' <$>
                   (o .:? "auxiliaryTables" .!= mempty) <*>
                     (o .:? "regionCode")
                     <*> (o .:? "quasiIds" .!= mempty))

instance ToJSON
         GooglePrivacyDlpV2DeltaPresenceEstimationConfig where
        toJSON
          GooglePrivacyDlpV2DeltaPresenceEstimationConfig'{..}
          = object
              (catMaybes
                 [("auxiliaryTables" .=) <$> _gpdvdpecAuxiliaryTables,
                  ("regionCode" .=) <$> _gpdvdpecRegionCode,
                  ("quasiIds" .=) <$> _gpdvdpecQuasiIds])

-- | Request message for CreateStoredInfoType.
--
-- /See:/ 'googlePrivacyDlpV2CreateStoredInfoTypeRequest' smart constructor.
data GooglePrivacyDlpV2CreateStoredInfoTypeRequest = GooglePrivacyDlpV2CreateStoredInfoTypeRequest'
    { _gpdvcsitrConfig           :: !(Maybe GooglePrivacyDlpV2StoredInfoTypeConfig)
    , _gpdvcsitrStoredInfoTypeId :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2CreateStoredInfoTypeRequest' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvcsitrConfig'
--
-- * 'gpdvcsitrStoredInfoTypeId'
googlePrivacyDlpV2CreateStoredInfoTypeRequest
    :: GooglePrivacyDlpV2CreateStoredInfoTypeRequest
googlePrivacyDlpV2CreateStoredInfoTypeRequest =
    GooglePrivacyDlpV2CreateStoredInfoTypeRequest'
    { _gpdvcsitrConfig = Nothing
    , _gpdvcsitrStoredInfoTypeId = Nothing
    }

-- | Configuration of the storedInfoType to create.
gpdvcsitrConfig :: Lens' GooglePrivacyDlpV2CreateStoredInfoTypeRequest (Maybe GooglePrivacyDlpV2StoredInfoTypeConfig)
gpdvcsitrConfig
  = lens _gpdvcsitrConfig
      (\ s a -> s{_gpdvcsitrConfig = a})

-- | The storedInfoType ID can contain uppercase and lowercase letters,
-- numbers, and hyphens; that is, it must match the regular expression:
-- \`[a-zA-Z\\\\d-]+\`. The maximum length is 100 characters. Can be empty
-- to allow the system to generate one.
gpdvcsitrStoredInfoTypeId :: Lens' GooglePrivacyDlpV2CreateStoredInfoTypeRequest (Maybe Text)
gpdvcsitrStoredInfoTypeId
  = lens _gpdvcsitrStoredInfoTypeId
      (\ s a -> s{_gpdvcsitrStoredInfoTypeId = a})

instance FromJSON
         GooglePrivacyDlpV2CreateStoredInfoTypeRequest where
        parseJSON
          = withObject
              "GooglePrivacyDlpV2CreateStoredInfoTypeRequest"
              (\ o ->
                 GooglePrivacyDlpV2CreateStoredInfoTypeRequest' <$>
                   (o .:? "config") <*> (o .:? "storedInfoTypeId"))

instance ToJSON
         GooglePrivacyDlpV2CreateStoredInfoTypeRequest where
        toJSON
          GooglePrivacyDlpV2CreateStoredInfoTypeRequest'{..}
          = object
              (catMaybes
                 [("config" .=) <$> _gpdvcsitrConfig,
                  ("storedInfoTypeId" .=) <$>
                    _gpdvcsitrStoredInfoTypeId])

-- | A quasi-identifier column has a custom_tag, used to know which column in
-- the data corresponds to which column in the statistical model.
--
-- /See:/ 'googlePrivacyDlpV2QuasiIdField' smart constructor.
data GooglePrivacyDlpV2QuasiIdField = GooglePrivacyDlpV2QuasiIdField'
    { _gpdvqifField     :: !(Maybe GooglePrivacyDlpV2FieldId)
    , _gpdvqifCustomTag :: !(Maybe Text)
    } deriving (Eq,Show,Data,Typeable,Generic)

-- | Creates a value of 'GooglePrivacyDlpV2QuasiIdField' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'gpdvqifField'
--
-- * 'gpdvqifCustomTag'
googlePrivacyDlpV2QuasiIdField
    :: GooglePrivacyDlpV2QuasiIdField
googlePrivacyDlpV2QuasiIdField =
    GooglePrivacyDlpV2QuasiIdField'
    { _gpdvqifField = Nothing
    , _gpdvqifCustomTag = Nothing
    }

gpdvqifField :: Lens' GooglePrivacyDlpV2QuasiIdField (Maybe GooglePrivacyDlpV2FieldId)
gpdvqifField
  = lens _gpdvqifField (\ s a -> s{_gpdvqifField = a})

gpdvqifCustomTag :: Lens' GooglePrivacyDlpV2QuasiIdField (Maybe Text)
gpdvqifCustomTag
  = lens _gpdvqifCustomTag
      (\ s a -> s{_gpdvqifCustomTag = a})

instance FromJSON GooglePrivacyDlpV2QuasiIdField
         where
        parseJSON
          = withObject "GooglePrivacyDlpV2QuasiIdField"
              (\ o ->
                 GooglePrivacyDlpV2QuasiIdField' <$>
                   (o .:? "field") <*> (o .:? "customTag")