{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MacieV2.Types.CriterionAdditionalProperties
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.CriterionAdditionalProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the operator to use in a property-based condition that filters
-- the results of a query for findings. For detailed information and
-- examples of each operator, see
-- <https://docs.aws.amazon.com/macie/latest/user/findings-filter-basics.html Fundamentals of filtering findings>
-- in the /Amazon Macie User Guide/.
--
-- /See:/ 'newCriterionAdditionalProperties' smart constructor.
data CriterionAdditionalProperties = CriterionAdditionalProperties'
  { -- | The value for the property matches (equals) the specified value. If you
    -- specify multiple values, Macie uses OR logic to join the values.
    CriterionAdditionalProperties -> Maybe [Text]
eq :: Prelude.Maybe [Prelude.Text],
    -- | The value for the property is less than or equal to the specified value.
    CriterionAdditionalProperties -> Maybe Integer
lte :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property is greater than the specified value.
    CriterionAdditionalProperties -> Maybe Integer
gt :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property exclusively matches (equals an exact match
    -- for) all the specified values. If you specify multiple values, Amazon
    -- Macie uses AND logic to join the values.
    --
    -- You can use this operator with the following properties:
    -- customDataIdentifiers.detections.arn,
    -- customDataIdentifiers.detections.name,
    -- resourcesAffected.s3Bucket.tags.key,
    -- resourcesAffected.s3Bucket.tags.value,
    -- resourcesAffected.s3Object.tags.key,
    -- resourcesAffected.s3Object.tags.value, sensitiveData.category, and
    -- sensitiveData.detections.type.
    CriterionAdditionalProperties -> Maybe [Text]
eqExactMatch :: Prelude.Maybe [Prelude.Text],
    -- | The value for the property doesn\'t match (doesn\'t equal) the specified
    -- value. If you specify multiple values, Macie uses OR logic to join the
    -- values.
    CriterionAdditionalProperties -> Maybe [Text]
neq :: Prelude.Maybe [Prelude.Text],
    -- | The value for the property is less than the specified value.
    CriterionAdditionalProperties -> Maybe Integer
lt :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property is greater than or equal to the specified
    -- value.
    CriterionAdditionalProperties -> Maybe Integer
gte :: Prelude.Maybe Prelude.Integer
  }
  deriving (CriterionAdditionalProperties
-> CriterionAdditionalProperties -> Bool
(CriterionAdditionalProperties
 -> CriterionAdditionalProperties -> Bool)
-> (CriterionAdditionalProperties
    -> CriterionAdditionalProperties -> Bool)
-> Eq CriterionAdditionalProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CriterionAdditionalProperties
-> CriterionAdditionalProperties -> Bool
$c/= :: CriterionAdditionalProperties
-> CriterionAdditionalProperties -> Bool
== :: CriterionAdditionalProperties
-> CriterionAdditionalProperties -> Bool
$c== :: CriterionAdditionalProperties
-> CriterionAdditionalProperties -> Bool
Prelude.Eq, ReadPrec [CriterionAdditionalProperties]
ReadPrec CriterionAdditionalProperties
Int -> ReadS CriterionAdditionalProperties
ReadS [CriterionAdditionalProperties]
(Int -> ReadS CriterionAdditionalProperties)
-> ReadS [CriterionAdditionalProperties]
-> ReadPrec CriterionAdditionalProperties
-> ReadPrec [CriterionAdditionalProperties]
-> Read CriterionAdditionalProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CriterionAdditionalProperties]
$creadListPrec :: ReadPrec [CriterionAdditionalProperties]
readPrec :: ReadPrec CriterionAdditionalProperties
$creadPrec :: ReadPrec CriterionAdditionalProperties
readList :: ReadS [CriterionAdditionalProperties]
$creadList :: ReadS [CriterionAdditionalProperties]
readsPrec :: Int -> ReadS CriterionAdditionalProperties
$creadsPrec :: Int -> ReadS CriterionAdditionalProperties
Prelude.Read, Int -> CriterionAdditionalProperties -> ShowS
[CriterionAdditionalProperties] -> ShowS
CriterionAdditionalProperties -> String
(Int -> CriterionAdditionalProperties -> ShowS)
-> (CriterionAdditionalProperties -> String)
-> ([CriterionAdditionalProperties] -> ShowS)
-> Show CriterionAdditionalProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CriterionAdditionalProperties] -> ShowS
$cshowList :: [CriterionAdditionalProperties] -> ShowS
show :: CriterionAdditionalProperties -> String
$cshow :: CriterionAdditionalProperties -> String
showsPrec :: Int -> CriterionAdditionalProperties -> ShowS
$cshowsPrec :: Int -> CriterionAdditionalProperties -> ShowS
Prelude.Show, (forall x.
 CriterionAdditionalProperties
 -> Rep CriterionAdditionalProperties x)
-> (forall x.
    Rep CriterionAdditionalProperties x
    -> CriterionAdditionalProperties)
-> Generic CriterionAdditionalProperties
forall x.
Rep CriterionAdditionalProperties x
-> CriterionAdditionalProperties
forall x.
CriterionAdditionalProperties
-> Rep CriterionAdditionalProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CriterionAdditionalProperties x
-> CriterionAdditionalProperties
$cfrom :: forall x.
CriterionAdditionalProperties
-> Rep CriterionAdditionalProperties x
Prelude.Generic)

-- |
-- Create a value of 'CriterionAdditionalProperties' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'eq', 'criterionAdditionalProperties_eq' - The value for the property matches (equals) the specified value. If you
-- specify multiple values, Macie uses OR logic to join the values.
--
-- 'lte', 'criterionAdditionalProperties_lte' - The value for the property is less than or equal to the specified value.
--
-- 'gt', 'criterionAdditionalProperties_gt' - The value for the property is greater than the specified value.
--
-- 'eqExactMatch', 'criterionAdditionalProperties_eqExactMatch' - The value for the property exclusively matches (equals an exact match
-- for) all the specified values. If you specify multiple values, Amazon
-- Macie uses AND logic to join the values.
--
-- You can use this operator with the following properties:
-- customDataIdentifiers.detections.arn,
-- customDataIdentifiers.detections.name,
-- resourcesAffected.s3Bucket.tags.key,
-- resourcesAffected.s3Bucket.tags.value,
-- resourcesAffected.s3Object.tags.key,
-- resourcesAffected.s3Object.tags.value, sensitiveData.category, and
-- sensitiveData.detections.type.
--
-- 'neq', 'criterionAdditionalProperties_neq' - The value for the property doesn\'t match (doesn\'t equal) the specified
-- value. If you specify multiple values, Macie uses OR logic to join the
-- values.
--
-- 'lt', 'criterionAdditionalProperties_lt' - The value for the property is less than the specified value.
--
-- 'gte', 'criterionAdditionalProperties_gte' - The value for the property is greater than or equal to the specified
-- value.
newCriterionAdditionalProperties ::
  CriterionAdditionalProperties
newCriterionAdditionalProperties :: CriterionAdditionalProperties
newCriterionAdditionalProperties =
  CriterionAdditionalProperties' :: Maybe [Text]
-> Maybe Integer
-> Maybe Integer
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Integer
-> Maybe Integer
-> CriterionAdditionalProperties
CriterionAdditionalProperties'
    { $sel:eq:CriterionAdditionalProperties' :: Maybe [Text]
eq =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:lte:CriterionAdditionalProperties' :: Maybe Integer
lte = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:gt:CriterionAdditionalProperties' :: Maybe Integer
gt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:eqExactMatch:CriterionAdditionalProperties' :: Maybe [Text]
eqExactMatch = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:neq:CriterionAdditionalProperties' :: Maybe [Text]
neq = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:lt:CriterionAdditionalProperties' :: Maybe Integer
lt = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:gte:CriterionAdditionalProperties' :: Maybe Integer
gte = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The value for the property matches (equals) the specified value. If you
-- specify multiple values, Macie uses OR logic to join the values.
criterionAdditionalProperties_eq :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe [Prelude.Text])
criterionAdditionalProperties_eq :: (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_eq = (CriterionAdditionalProperties -> Maybe [Text])
-> (CriterionAdditionalProperties
    -> Maybe [Text] -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe [Text]
eq :: Maybe [Text]
$sel:eq:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
eq} -> Maybe [Text]
eq) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe [Text]
a -> CriterionAdditionalProperties
s {$sel:eq:CriterionAdditionalProperties' :: Maybe [Text]
eq = Maybe [Text]
a} :: CriterionAdditionalProperties) ((Maybe [Text] -> f (Maybe [Text]))
 -> CriterionAdditionalProperties
 -> f CriterionAdditionalProperties)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties
-> f CriterionAdditionalProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value for the property is less than or equal to the specified value.
criterionAdditionalProperties_lte :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe Prelude.Integer)
criterionAdditionalProperties_lte :: (Maybe Integer -> f (Maybe Integer))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_lte = (CriterionAdditionalProperties -> Maybe Integer)
-> (CriterionAdditionalProperties
    -> Maybe Integer -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe Integer
lte :: Maybe Integer
$sel:lte:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
lte} -> Maybe Integer
lte) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe Integer
a -> CriterionAdditionalProperties
s {$sel:lte:CriterionAdditionalProperties' :: Maybe Integer
lte = Maybe Integer
a} :: CriterionAdditionalProperties)

-- | The value for the property is greater than the specified value.
criterionAdditionalProperties_gt :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe Prelude.Integer)
criterionAdditionalProperties_gt :: (Maybe Integer -> f (Maybe Integer))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_gt = (CriterionAdditionalProperties -> Maybe Integer)
-> (CriterionAdditionalProperties
    -> Maybe Integer -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe Integer
gt :: Maybe Integer
$sel:gt:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
gt} -> Maybe Integer
gt) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe Integer
a -> CriterionAdditionalProperties
s {$sel:gt:CriterionAdditionalProperties' :: Maybe Integer
gt = Maybe Integer
a} :: CriterionAdditionalProperties)

-- | The value for the property exclusively matches (equals an exact match
-- for) all the specified values. If you specify multiple values, Amazon
-- Macie uses AND logic to join the values.
--
-- You can use this operator with the following properties:
-- customDataIdentifiers.detections.arn,
-- customDataIdentifiers.detections.name,
-- resourcesAffected.s3Bucket.tags.key,
-- resourcesAffected.s3Bucket.tags.value,
-- resourcesAffected.s3Object.tags.key,
-- resourcesAffected.s3Object.tags.value, sensitiveData.category, and
-- sensitiveData.detections.type.
criterionAdditionalProperties_eqExactMatch :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe [Prelude.Text])
criterionAdditionalProperties_eqExactMatch :: (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_eqExactMatch = (CriterionAdditionalProperties -> Maybe [Text])
-> (CriterionAdditionalProperties
    -> Maybe [Text] -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe [Text]
eqExactMatch :: Maybe [Text]
$sel:eqExactMatch:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
eqExactMatch} -> Maybe [Text]
eqExactMatch) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe [Text]
a -> CriterionAdditionalProperties
s {$sel:eqExactMatch:CriterionAdditionalProperties' :: Maybe [Text]
eqExactMatch = Maybe [Text]
a} :: CriterionAdditionalProperties) ((Maybe [Text] -> f (Maybe [Text]))
 -> CriterionAdditionalProperties
 -> f CriterionAdditionalProperties)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties
-> f CriterionAdditionalProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value for the property doesn\'t match (doesn\'t equal) the specified
-- value. If you specify multiple values, Macie uses OR logic to join the
-- values.
criterionAdditionalProperties_neq :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe [Prelude.Text])
criterionAdditionalProperties_neq :: (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_neq = (CriterionAdditionalProperties -> Maybe [Text])
-> (CriterionAdditionalProperties
    -> Maybe [Text] -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe [Text]
neq :: Maybe [Text]
$sel:neq:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
neq} -> Maybe [Text]
neq) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe [Text]
a -> CriterionAdditionalProperties
s {$sel:neq:CriterionAdditionalProperties' :: Maybe [Text]
neq = Maybe [Text]
a} :: CriterionAdditionalProperties) ((Maybe [Text] -> f (Maybe [Text]))
 -> CriterionAdditionalProperties
 -> f CriterionAdditionalProperties)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CriterionAdditionalProperties
-> f CriterionAdditionalProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value for the property is less than the specified value.
criterionAdditionalProperties_lt :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe Prelude.Integer)
criterionAdditionalProperties_lt :: (Maybe Integer -> f (Maybe Integer))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_lt = (CriterionAdditionalProperties -> Maybe Integer)
-> (CriterionAdditionalProperties
    -> Maybe Integer -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe Integer
lt :: Maybe Integer
$sel:lt:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
lt} -> Maybe Integer
lt) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe Integer
a -> CriterionAdditionalProperties
s {$sel:lt:CriterionAdditionalProperties' :: Maybe Integer
lt = Maybe Integer
a} :: CriterionAdditionalProperties)

-- | The value for the property is greater than or equal to the specified
-- value.
criterionAdditionalProperties_gte :: Lens.Lens' CriterionAdditionalProperties (Prelude.Maybe Prelude.Integer)
criterionAdditionalProperties_gte :: (Maybe Integer -> f (Maybe Integer))
-> CriterionAdditionalProperties -> f CriterionAdditionalProperties
criterionAdditionalProperties_gte = (CriterionAdditionalProperties -> Maybe Integer)
-> (CriterionAdditionalProperties
    -> Maybe Integer -> CriterionAdditionalProperties)
-> Lens
     CriterionAdditionalProperties
     CriterionAdditionalProperties
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CriterionAdditionalProperties' {Maybe Integer
gte :: Maybe Integer
$sel:gte:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
gte} -> Maybe Integer
gte) (\s :: CriterionAdditionalProperties
s@CriterionAdditionalProperties' {} Maybe Integer
a -> CriterionAdditionalProperties
s {$sel:gte:CriterionAdditionalProperties' :: Maybe Integer
gte = Maybe Integer
a} :: CriterionAdditionalProperties)

instance Core.FromJSON CriterionAdditionalProperties where
  parseJSON :: Value -> Parser CriterionAdditionalProperties
parseJSON =
    String
-> (Object -> Parser CriterionAdditionalProperties)
-> Value
-> Parser CriterionAdditionalProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CriterionAdditionalProperties"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Integer
-> Maybe Integer
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Integer
-> Maybe Integer
-> CriterionAdditionalProperties
CriterionAdditionalProperties'
            (Maybe [Text]
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe [Text]
 -> Maybe [Text]
 -> Maybe Integer
 -> Maybe Integer
 -> CriterionAdditionalProperties)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Integer
      -> Maybe Integer
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Integer
      -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eq" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Integer
   -> Maybe Integer
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Integer
   -> CriterionAdditionalProperties)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe [Text]
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Integer
      -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lte")
            Parser
  (Maybe Integer
   -> Maybe [Text]
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Integer
   -> CriterionAdditionalProperties)
-> Parser (Maybe Integer)
-> Parser
     (Maybe [Text]
      -> Maybe [Text]
      -> Maybe Integer
      -> Maybe Integer
      -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gt")
            Parser
  (Maybe [Text]
   -> Maybe [Text]
   -> Maybe Integer
   -> Maybe Integer
   -> CriterionAdditionalProperties)
-> Parser (Maybe [Text])
-> Parser
     (Maybe [Text]
      -> Maybe Integer -> Maybe Integer -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eqExactMatch" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe [Text]
   -> Maybe Integer -> Maybe Integer -> CriterionAdditionalProperties)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Integer -> Maybe Integer -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"neq" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Integer -> Maybe Integer -> CriterionAdditionalProperties)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> CriterionAdditionalProperties)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lt")
            Parser (Maybe Integer -> CriterionAdditionalProperties)
-> Parser (Maybe Integer) -> Parser CriterionAdditionalProperties
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gte")
      )

instance
  Prelude.Hashable
    CriterionAdditionalProperties

instance Prelude.NFData CriterionAdditionalProperties

instance Core.ToJSON CriterionAdditionalProperties where
  toJSON :: CriterionAdditionalProperties -> Value
toJSON CriterionAdditionalProperties' {Maybe Integer
Maybe [Text]
gte :: Maybe Integer
lt :: Maybe Integer
neq :: Maybe [Text]
eqExactMatch :: Maybe [Text]
gt :: Maybe Integer
lte :: Maybe Integer
eq :: Maybe [Text]
$sel:gte:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
$sel:lt:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
$sel:neq:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
$sel:eqExactMatch:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
$sel:gt:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
$sel:lte:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe Integer
$sel:eq:CriterionAdditionalProperties' :: CriterionAdditionalProperties -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"eq" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
eq,
            (Text
"lte" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
lte,
            (Text
"gt" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
gt,
            (Text
"eqExactMatch" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
eqExactMatch,
            (Text
"neq" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
neq,
            (Text
"lt" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
lt,
            (Text
"gte" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
gte
          ]
      )