{-# 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.BucketCriteriaAdditionalProperties
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.BucketCriteriaAdditionalProperties where

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

-- | Specifies the operator to use in a property-based condition that filters
-- the results of a query for information about S3 buckets.
--
-- /See:/ 'newBucketCriteriaAdditionalProperties' smart constructor.
data BucketCriteriaAdditionalProperties = BucketCriteriaAdditionalProperties'
  { -- | The value for the property matches (equals) the specified value. If you
    -- specify multiple values, Amazon Macie uses OR logic to join the values.
    BucketCriteriaAdditionalProperties -> Maybe [Text]
eq :: Prelude.Maybe [Prelude.Text],
    -- | The value for the property is greater than the specified value.
    BucketCriteriaAdditionalProperties -> Maybe Integer
gt :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property is greater than or equal to the specified
    -- value.
    BucketCriteriaAdditionalProperties -> Maybe Integer
gte :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property is less than the specified value.
    BucketCriteriaAdditionalProperties -> Maybe Integer
lt :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property is less than or equal to the specified value.
    BucketCriteriaAdditionalProperties -> Maybe Integer
lte :: Prelude.Maybe Prelude.Integer,
    -- | The value for the property doesn\'t match (doesn\'t equal) the specified
    -- value. If you specify multiple values, Amazon Macie uses OR logic to
    -- join the values.
    BucketCriteriaAdditionalProperties -> Maybe [Text]
neq :: Prelude.Maybe [Prelude.Text],
    -- | The name of the bucket begins with the specified value.
    BucketCriteriaAdditionalProperties -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (BucketCriteriaAdditionalProperties
-> BucketCriteriaAdditionalProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketCriteriaAdditionalProperties
-> BucketCriteriaAdditionalProperties -> Bool
$c/= :: BucketCriteriaAdditionalProperties
-> BucketCriteriaAdditionalProperties -> Bool
== :: BucketCriteriaAdditionalProperties
-> BucketCriteriaAdditionalProperties -> Bool
$c== :: BucketCriteriaAdditionalProperties
-> BucketCriteriaAdditionalProperties -> Bool
Prelude.Eq, ReadPrec [BucketCriteriaAdditionalProperties]
ReadPrec BucketCriteriaAdditionalProperties
Int -> ReadS BucketCriteriaAdditionalProperties
ReadS [BucketCriteriaAdditionalProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketCriteriaAdditionalProperties]
$creadListPrec :: ReadPrec [BucketCriteriaAdditionalProperties]
readPrec :: ReadPrec BucketCriteriaAdditionalProperties
$creadPrec :: ReadPrec BucketCriteriaAdditionalProperties
readList :: ReadS [BucketCriteriaAdditionalProperties]
$creadList :: ReadS [BucketCriteriaAdditionalProperties]
readsPrec :: Int -> ReadS BucketCriteriaAdditionalProperties
$creadsPrec :: Int -> ReadS BucketCriteriaAdditionalProperties
Prelude.Read, Int -> BucketCriteriaAdditionalProperties -> ShowS
[BucketCriteriaAdditionalProperties] -> ShowS
BucketCriteriaAdditionalProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketCriteriaAdditionalProperties] -> ShowS
$cshowList :: [BucketCriteriaAdditionalProperties] -> ShowS
show :: BucketCriteriaAdditionalProperties -> String
$cshow :: BucketCriteriaAdditionalProperties -> String
showsPrec :: Int -> BucketCriteriaAdditionalProperties -> ShowS
$cshowsPrec :: Int -> BucketCriteriaAdditionalProperties -> ShowS
Prelude.Show, forall x.
Rep BucketCriteriaAdditionalProperties x
-> BucketCriteriaAdditionalProperties
forall x.
BucketCriteriaAdditionalProperties
-> Rep BucketCriteriaAdditionalProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BucketCriteriaAdditionalProperties x
-> BucketCriteriaAdditionalProperties
$cfrom :: forall x.
BucketCriteriaAdditionalProperties
-> Rep BucketCriteriaAdditionalProperties x
Prelude.Generic)

-- |
-- Create a value of 'BucketCriteriaAdditionalProperties' 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', 'bucketCriteriaAdditionalProperties_eq' - The value for the property matches (equals) the specified value. If you
-- specify multiple values, Amazon Macie uses OR logic to join the values.
--
-- 'gt', 'bucketCriteriaAdditionalProperties_gt' - The value for the property is greater than the specified value.
--
-- 'gte', 'bucketCriteriaAdditionalProperties_gte' - The value for the property is greater than or equal to the specified
-- value.
--
-- 'lt', 'bucketCriteriaAdditionalProperties_lt' - The value for the property is less than the specified value.
--
-- 'lte', 'bucketCriteriaAdditionalProperties_lte' - The value for the property is less than or equal to the specified value.
--
-- 'neq', 'bucketCriteriaAdditionalProperties_neq' - The value for the property doesn\'t match (doesn\'t equal) the specified
-- value. If you specify multiple values, Amazon Macie uses OR logic to
-- join the values.
--
-- 'prefix', 'bucketCriteriaAdditionalProperties_prefix' - The name of the bucket begins with the specified value.
newBucketCriteriaAdditionalProperties ::
  BucketCriteriaAdditionalProperties
newBucketCriteriaAdditionalProperties :: BucketCriteriaAdditionalProperties
newBucketCriteriaAdditionalProperties =
  BucketCriteriaAdditionalProperties'
    { $sel:eq:BucketCriteriaAdditionalProperties' :: Maybe [Text]
eq =
        forall a. Maybe a
Prelude.Nothing,
      $sel:gt:BucketCriteriaAdditionalProperties' :: Maybe Integer
gt = forall a. Maybe a
Prelude.Nothing,
      $sel:gte:BucketCriteriaAdditionalProperties' :: Maybe Integer
gte = forall a. Maybe a
Prelude.Nothing,
      $sel:lt:BucketCriteriaAdditionalProperties' :: Maybe Integer
lt = forall a. Maybe a
Prelude.Nothing,
      $sel:lte:BucketCriteriaAdditionalProperties' :: Maybe Integer
lte = forall a. Maybe a
Prelude.Nothing,
      $sel:neq:BucketCriteriaAdditionalProperties' :: Maybe [Text]
neq = forall a. Maybe a
Prelude.Nothing,
      $sel:prefix:BucketCriteriaAdditionalProperties' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing
    }

-- | The value for the property matches (equals) the specified value. If you
-- specify multiple values, Amazon Macie uses OR logic to join the values.
bucketCriteriaAdditionalProperties_eq :: Lens.Lens' BucketCriteriaAdditionalProperties (Prelude.Maybe [Prelude.Text])
bucketCriteriaAdditionalProperties_eq :: Lens' BucketCriteriaAdditionalProperties (Maybe [Text])
bucketCriteriaAdditionalProperties_eq = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCriteriaAdditionalProperties' {Maybe [Text]
eq :: Maybe [Text]
$sel:eq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
eq} -> Maybe [Text]
eq) (\s :: BucketCriteriaAdditionalProperties
s@BucketCriteriaAdditionalProperties' {} Maybe [Text]
a -> BucketCriteriaAdditionalProperties
s {$sel:eq:BucketCriteriaAdditionalProperties' :: Maybe [Text]
eq = Maybe [Text]
a} :: BucketCriteriaAdditionalProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

-- | The value for the property doesn\'t match (doesn\'t equal) the specified
-- value. If you specify multiple values, Amazon Macie uses OR logic to
-- join the values.
bucketCriteriaAdditionalProperties_neq :: Lens.Lens' BucketCriteriaAdditionalProperties (Prelude.Maybe [Prelude.Text])
bucketCriteriaAdditionalProperties_neq :: Lens' BucketCriteriaAdditionalProperties (Maybe [Text])
bucketCriteriaAdditionalProperties_neq = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCriteriaAdditionalProperties' {Maybe [Text]
neq :: Maybe [Text]
$sel:neq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
neq} -> Maybe [Text]
neq) (\s :: BucketCriteriaAdditionalProperties
s@BucketCriteriaAdditionalProperties' {} Maybe [Text]
a -> BucketCriteriaAdditionalProperties
s {$sel:neq:BucketCriteriaAdditionalProperties' :: Maybe [Text]
neq = Maybe [Text]
a} :: BucketCriteriaAdditionalProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the bucket begins with the specified value.
bucketCriteriaAdditionalProperties_prefix :: Lens.Lens' BucketCriteriaAdditionalProperties (Prelude.Maybe Prelude.Text)
bucketCriteriaAdditionalProperties_prefix :: Lens' BucketCriteriaAdditionalProperties (Maybe Text)
bucketCriteriaAdditionalProperties_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCriteriaAdditionalProperties' {Maybe Text
prefix :: Maybe Text
$sel:prefix:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: BucketCriteriaAdditionalProperties
s@BucketCriteriaAdditionalProperties' {} Maybe Text
a -> BucketCriteriaAdditionalProperties
s {$sel:prefix:BucketCriteriaAdditionalProperties' :: Maybe Text
prefix = Maybe Text
a} :: BucketCriteriaAdditionalProperties)

instance
  Prelude.Hashable
    BucketCriteriaAdditionalProperties
  where
  hashWithSalt :: Int -> BucketCriteriaAdditionalProperties -> Int
hashWithSalt
    Int
_salt
    BucketCriteriaAdditionalProperties' {Maybe Integer
Maybe [Text]
Maybe Text
prefix :: Maybe Text
neq :: Maybe [Text]
lte :: Maybe Integer
lt :: Maybe Integer
gte :: Maybe Integer
gt :: Maybe Integer
eq :: Maybe [Text]
$sel:prefix:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Text
$sel:neq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
$sel:lte:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:lt:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:gte:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:gt:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:eq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
eq
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
gt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
gte
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
lt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
lte
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
neq
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix

instance
  Prelude.NFData
    BucketCriteriaAdditionalProperties
  where
  rnf :: BucketCriteriaAdditionalProperties -> ()
rnf BucketCriteriaAdditionalProperties' {Maybe Integer
Maybe [Text]
Maybe Text
prefix :: Maybe Text
neq :: Maybe [Text]
lte :: Maybe Integer
lt :: Maybe Integer
gte :: Maybe Integer
gt :: Maybe Integer
eq :: Maybe [Text]
$sel:prefix:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Text
$sel:neq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
$sel:lte:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:lt:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:gte:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:gt:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe Integer
$sel:eq:BucketCriteriaAdditionalProperties' :: BucketCriteriaAdditionalProperties -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
eq
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
gt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
gte
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
lt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
lte
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
neq
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix

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