{-# 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 #-}
module Amazonka.Comprehend.Types.EndpointFilter where
import Amazonka.Comprehend.Types.EndpointStatus
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
data EndpointFilter = EndpointFilter'
{
EndpointFilter -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Data.POSIX,
EndpointFilter -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Data.POSIX,
EndpointFilter -> Maybe Text
modelArn :: Prelude.Maybe Prelude.Text,
EndpointFilter -> Maybe EndpointStatus
status :: Prelude.Maybe EndpointStatus
}
deriving (EndpointFilter -> EndpointFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointFilter -> EndpointFilter -> Bool
$c/= :: EndpointFilter -> EndpointFilter -> Bool
== :: EndpointFilter -> EndpointFilter -> Bool
$c== :: EndpointFilter -> EndpointFilter -> Bool
Prelude.Eq, ReadPrec [EndpointFilter]
ReadPrec EndpointFilter
Int -> ReadS EndpointFilter
ReadS [EndpointFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointFilter]
$creadListPrec :: ReadPrec [EndpointFilter]
readPrec :: ReadPrec EndpointFilter
$creadPrec :: ReadPrec EndpointFilter
readList :: ReadS [EndpointFilter]
$creadList :: ReadS [EndpointFilter]
readsPrec :: Int -> ReadS EndpointFilter
$creadsPrec :: Int -> ReadS EndpointFilter
Prelude.Read, Int -> EndpointFilter -> ShowS
[EndpointFilter] -> ShowS
EndpointFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointFilter] -> ShowS
$cshowList :: [EndpointFilter] -> ShowS
show :: EndpointFilter -> String
$cshow :: EndpointFilter -> String
showsPrec :: Int -> EndpointFilter -> ShowS
$cshowsPrec :: Int -> EndpointFilter -> ShowS
Prelude.Show, forall x. Rep EndpointFilter x -> EndpointFilter
forall x. EndpointFilter -> Rep EndpointFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointFilter x -> EndpointFilter
$cfrom :: forall x. EndpointFilter -> Rep EndpointFilter x
Prelude.Generic)
newEndpointFilter ::
EndpointFilter
newEndpointFilter :: EndpointFilter
newEndpointFilter =
EndpointFilter'
{ $sel:creationTimeAfter:EndpointFilter' :: Maybe POSIX
creationTimeAfter =
forall a. Maybe a
Prelude.Nothing,
$sel:creationTimeBefore:EndpointFilter' :: Maybe POSIX
creationTimeBefore = forall a. Maybe a
Prelude.Nothing,
$sel:modelArn:EndpointFilter' :: Maybe Text
modelArn = forall a. Maybe a
Prelude.Nothing,
$sel:status:EndpointFilter' :: Maybe EndpointStatus
status = forall a. Maybe a
Prelude.Nothing
}
endpointFilter_creationTimeAfter :: Lens.Lens' EndpointFilter (Prelude.Maybe Prelude.UTCTime)
endpointFilter_creationTimeAfter :: Lens' EndpointFilter (Maybe UTCTime)
endpointFilter_creationTimeAfter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointFilter' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:EndpointFilter' :: EndpointFilter -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: EndpointFilter
s@EndpointFilter' {} Maybe POSIX
a -> EndpointFilter
s {$sel:creationTimeAfter:EndpointFilter' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: EndpointFilter) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
endpointFilter_creationTimeBefore :: Lens.Lens' EndpointFilter (Prelude.Maybe Prelude.UTCTime)
endpointFilter_creationTimeBefore :: Lens' EndpointFilter (Maybe UTCTime)
endpointFilter_creationTimeBefore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointFilter' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:EndpointFilter' :: EndpointFilter -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: EndpointFilter
s@EndpointFilter' {} Maybe POSIX
a -> EndpointFilter
s {$sel:creationTimeBefore:EndpointFilter' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: EndpointFilter) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
endpointFilter_modelArn :: Lens.Lens' EndpointFilter (Prelude.Maybe Prelude.Text)
endpointFilter_modelArn :: Lens' EndpointFilter (Maybe Text)
endpointFilter_modelArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointFilter' {Maybe Text
modelArn :: Maybe Text
$sel:modelArn:EndpointFilter' :: EndpointFilter -> Maybe Text
modelArn} -> Maybe Text
modelArn) (\s :: EndpointFilter
s@EndpointFilter' {} Maybe Text
a -> EndpointFilter
s {$sel:modelArn:EndpointFilter' :: Maybe Text
modelArn = Maybe Text
a} :: EndpointFilter)
endpointFilter_status :: Lens.Lens' EndpointFilter (Prelude.Maybe EndpointStatus)
endpointFilter_status :: Lens' EndpointFilter (Maybe EndpointStatus)
endpointFilter_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointFilter' {Maybe EndpointStatus
status :: Maybe EndpointStatus
$sel:status:EndpointFilter' :: EndpointFilter -> Maybe EndpointStatus
status} -> Maybe EndpointStatus
status) (\s :: EndpointFilter
s@EndpointFilter' {} Maybe EndpointStatus
a -> EndpointFilter
s {$sel:status:EndpointFilter' :: Maybe EndpointStatus
status = Maybe EndpointStatus
a} :: EndpointFilter)
instance Prelude.Hashable EndpointFilter where
hashWithSalt :: Int -> EndpointFilter -> Int
hashWithSalt Int
_salt EndpointFilter' {Maybe Text
Maybe POSIX
Maybe EndpointStatus
status :: Maybe EndpointStatus
modelArn :: Maybe Text
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:status:EndpointFilter' :: EndpointFilter -> Maybe EndpointStatus
$sel:modelArn:EndpointFilter' :: EndpointFilter -> Maybe Text
$sel:creationTimeBefore:EndpointFilter' :: EndpointFilter -> Maybe POSIX
$sel:creationTimeAfter:EndpointFilter' :: EndpointFilter -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeAfter
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTimeBefore
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EndpointStatus
status
instance Prelude.NFData EndpointFilter where
rnf :: EndpointFilter -> ()
rnf EndpointFilter' {Maybe Text
Maybe POSIX
Maybe EndpointStatus
status :: Maybe EndpointStatus
modelArn :: Maybe Text
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:status:EndpointFilter' :: EndpointFilter -> Maybe EndpointStatus
$sel:modelArn:EndpointFilter' :: EndpointFilter -> Maybe Text
$sel:creationTimeBefore:EndpointFilter' :: EndpointFilter -> Maybe POSIX
$sel:creationTimeAfter:EndpointFilter' :: EndpointFilter -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeAfter
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTimeBefore
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EndpointStatus
status
instance Data.ToJSON EndpointFilter where
toJSON :: EndpointFilter -> Value
toJSON EndpointFilter' {Maybe Text
Maybe POSIX
Maybe EndpointStatus
status :: Maybe EndpointStatus
modelArn :: Maybe Text
creationTimeBefore :: Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:status:EndpointFilter' :: EndpointFilter -> Maybe EndpointStatus
$sel:modelArn:EndpointFilter' :: EndpointFilter -> Maybe Text
$sel:creationTimeBefore:EndpointFilter' :: EndpointFilter -> Maybe POSIX
$sel:creationTimeAfter:EndpointFilter' :: EndpointFilter -> Maybe POSIX
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CreationTimeAfter" 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 POSIX
creationTimeAfter,
(Key
"CreationTimeBefore" 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 POSIX
creationTimeBefore,
(Key
"ModelArn" 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
modelArn,
(Key
"Status" 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 EndpointStatus
status
]
)