{-# 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.Kinesis.Types.ShardFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Kinesis.Types.ShardFilterType
import qualified Amazonka.Prelude as Prelude
data ShardFilter = ShardFilter'
{
ShardFilter -> Maybe Text
shardId :: Prelude.Maybe Prelude.Text,
ShardFilter -> Maybe POSIX
timestamp :: Prelude.Maybe Data.POSIX,
ShardFilter -> ShardFilterType
type' :: ShardFilterType
}
deriving (ShardFilter -> ShardFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShardFilter -> ShardFilter -> Bool
$c/= :: ShardFilter -> ShardFilter -> Bool
== :: ShardFilter -> ShardFilter -> Bool
$c== :: ShardFilter -> ShardFilter -> Bool
Prelude.Eq, ReadPrec [ShardFilter]
ReadPrec ShardFilter
Int -> ReadS ShardFilter
ReadS [ShardFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShardFilter]
$creadListPrec :: ReadPrec [ShardFilter]
readPrec :: ReadPrec ShardFilter
$creadPrec :: ReadPrec ShardFilter
readList :: ReadS [ShardFilter]
$creadList :: ReadS [ShardFilter]
readsPrec :: Int -> ReadS ShardFilter
$creadsPrec :: Int -> ReadS ShardFilter
Prelude.Read, Int -> ShardFilter -> ShowS
[ShardFilter] -> ShowS
ShardFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShardFilter] -> ShowS
$cshowList :: [ShardFilter] -> ShowS
show :: ShardFilter -> String
$cshow :: ShardFilter -> String
showsPrec :: Int -> ShardFilter -> ShowS
$cshowsPrec :: Int -> ShardFilter -> ShowS
Prelude.Show, forall x. Rep ShardFilter x -> ShardFilter
forall x. ShardFilter -> Rep ShardFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShardFilter x -> ShardFilter
$cfrom :: forall x. ShardFilter -> Rep ShardFilter x
Prelude.Generic)
newShardFilter ::
ShardFilterType ->
ShardFilter
newShardFilter :: ShardFilterType -> ShardFilter
newShardFilter ShardFilterType
pType_ =
ShardFilter'
{ $sel:shardId:ShardFilter' :: Maybe Text
shardId = forall a. Maybe a
Prelude.Nothing,
$sel:timestamp:ShardFilter' :: Maybe POSIX
timestamp = forall a. Maybe a
Prelude.Nothing,
$sel:type':ShardFilter' :: ShardFilterType
type' = ShardFilterType
pType_
}
shardFilter_shardId :: Lens.Lens' ShardFilter (Prelude.Maybe Prelude.Text)
shardFilter_shardId :: Lens' ShardFilter (Maybe Text)
shardFilter_shardId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardFilter' {Maybe Text
shardId :: Maybe Text
$sel:shardId:ShardFilter' :: ShardFilter -> Maybe Text
shardId} -> Maybe Text
shardId) (\s :: ShardFilter
s@ShardFilter' {} Maybe Text
a -> ShardFilter
s {$sel:shardId:ShardFilter' :: Maybe Text
shardId = Maybe Text
a} :: ShardFilter)
shardFilter_timestamp :: Lens.Lens' ShardFilter (Prelude.Maybe Prelude.UTCTime)
shardFilter_timestamp :: Lens' ShardFilter (Maybe UTCTime)
shardFilter_timestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardFilter' {Maybe POSIX
timestamp :: Maybe POSIX
$sel:timestamp:ShardFilter' :: ShardFilter -> Maybe POSIX
timestamp} -> Maybe POSIX
timestamp) (\s :: ShardFilter
s@ShardFilter' {} Maybe POSIX
a -> ShardFilter
s {$sel:timestamp:ShardFilter' :: Maybe POSIX
timestamp = Maybe POSIX
a} :: ShardFilter) 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
shardFilter_type :: Lens.Lens' ShardFilter ShardFilterType
shardFilter_type :: Lens' ShardFilter ShardFilterType
shardFilter_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShardFilter' {ShardFilterType
type' :: ShardFilterType
$sel:type':ShardFilter' :: ShardFilter -> ShardFilterType
type'} -> ShardFilterType
type') (\s :: ShardFilter
s@ShardFilter' {} ShardFilterType
a -> ShardFilter
s {$sel:type':ShardFilter' :: ShardFilterType
type' = ShardFilterType
a} :: ShardFilter)
instance Prelude.Hashable ShardFilter where
hashWithSalt :: Int -> ShardFilter -> Int
hashWithSalt Int
_salt ShardFilter' {Maybe Text
Maybe POSIX
ShardFilterType
type' :: ShardFilterType
timestamp :: Maybe POSIX
shardId :: Maybe Text
$sel:type':ShardFilter' :: ShardFilter -> ShardFilterType
$sel:timestamp:ShardFilter' :: ShardFilter -> Maybe POSIX
$sel:shardId:ShardFilter' :: ShardFilter -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shardId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
timestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ShardFilterType
type'
instance Prelude.NFData ShardFilter where
rnf :: ShardFilter -> ()
rnf ShardFilter' {Maybe Text
Maybe POSIX
ShardFilterType
type' :: ShardFilterType
timestamp :: Maybe POSIX
shardId :: Maybe Text
$sel:type':ShardFilter' :: ShardFilter -> ShardFilterType
$sel:timestamp:ShardFilter' :: ShardFilter -> Maybe POSIX
$sel:shardId:ShardFilter' :: ShardFilter -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shardId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
timestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ShardFilterType
type'
instance Data.ToJSON ShardFilter where
toJSON :: ShardFilter -> Value
toJSON ShardFilter' {Maybe Text
Maybe POSIX
ShardFilterType
type' :: ShardFilterType
timestamp :: Maybe POSIX
shardId :: Maybe Text
$sel:type':ShardFilter' :: ShardFilter -> ShardFilterType
$sel:timestamp:ShardFilter' :: ShardFilter -> Maybe POSIX
$sel:shardId:ShardFilter' :: ShardFilter -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ShardId" 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
shardId,
(Key
"Timestamp" 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
timestamp,
forall a. a -> Maybe a
Prelude.Just (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ShardFilterType
type')
]
)