{-# 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.PinpointEmail.Types.DkimAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointEmail.Types.DkimStatus
import qualified Amazonka.Prelude as Prelude
data DkimAttributes = DkimAttributes'
{
DkimAttributes -> Maybe Bool
signingEnabled :: Prelude.Maybe Prelude.Bool,
DkimAttributes -> Maybe DkimStatus
status :: Prelude.Maybe DkimStatus,
DkimAttributes -> Maybe [Text]
tokens :: Prelude.Maybe [Prelude.Text]
}
deriving (DkimAttributes -> DkimAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DkimAttributes -> DkimAttributes -> Bool
$c/= :: DkimAttributes -> DkimAttributes -> Bool
== :: DkimAttributes -> DkimAttributes -> Bool
$c== :: DkimAttributes -> DkimAttributes -> Bool
Prelude.Eq, ReadPrec [DkimAttributes]
ReadPrec DkimAttributes
Int -> ReadS DkimAttributes
ReadS [DkimAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DkimAttributes]
$creadListPrec :: ReadPrec [DkimAttributes]
readPrec :: ReadPrec DkimAttributes
$creadPrec :: ReadPrec DkimAttributes
readList :: ReadS [DkimAttributes]
$creadList :: ReadS [DkimAttributes]
readsPrec :: Int -> ReadS DkimAttributes
$creadsPrec :: Int -> ReadS DkimAttributes
Prelude.Read, Int -> DkimAttributes -> ShowS
[DkimAttributes] -> ShowS
DkimAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DkimAttributes] -> ShowS
$cshowList :: [DkimAttributes] -> ShowS
show :: DkimAttributes -> String
$cshow :: DkimAttributes -> String
showsPrec :: Int -> DkimAttributes -> ShowS
$cshowsPrec :: Int -> DkimAttributes -> ShowS
Prelude.Show, forall x. Rep DkimAttributes x -> DkimAttributes
forall x. DkimAttributes -> Rep DkimAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DkimAttributes x -> DkimAttributes
$cfrom :: forall x. DkimAttributes -> Rep DkimAttributes x
Prelude.Generic)
newDkimAttributes ::
DkimAttributes
newDkimAttributes :: DkimAttributes
newDkimAttributes =
DkimAttributes'
{ $sel:signingEnabled:DkimAttributes' :: Maybe Bool
signingEnabled = forall a. Maybe a
Prelude.Nothing,
$sel:status:DkimAttributes' :: Maybe DkimStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:tokens:DkimAttributes' :: Maybe [Text]
tokens = forall a. Maybe a
Prelude.Nothing
}
dkimAttributes_signingEnabled :: Lens.Lens' DkimAttributes (Prelude.Maybe Prelude.Bool)
dkimAttributes_signingEnabled :: Lens' DkimAttributes (Maybe Bool)
dkimAttributes_signingEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DkimAttributes' {Maybe Bool
signingEnabled :: Maybe Bool
$sel:signingEnabled:DkimAttributes' :: DkimAttributes -> Maybe Bool
signingEnabled} -> Maybe Bool
signingEnabled) (\s :: DkimAttributes
s@DkimAttributes' {} Maybe Bool
a -> DkimAttributes
s {$sel:signingEnabled:DkimAttributes' :: Maybe Bool
signingEnabled = Maybe Bool
a} :: DkimAttributes)
dkimAttributes_status :: Lens.Lens' DkimAttributes (Prelude.Maybe DkimStatus)
dkimAttributes_status :: Lens' DkimAttributes (Maybe DkimStatus)
dkimAttributes_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DkimAttributes' {Maybe DkimStatus
status :: Maybe DkimStatus
$sel:status:DkimAttributes' :: DkimAttributes -> Maybe DkimStatus
status} -> Maybe DkimStatus
status) (\s :: DkimAttributes
s@DkimAttributes' {} Maybe DkimStatus
a -> DkimAttributes
s {$sel:status:DkimAttributes' :: Maybe DkimStatus
status = Maybe DkimStatus
a} :: DkimAttributes)
dkimAttributes_tokens :: Lens.Lens' DkimAttributes (Prelude.Maybe [Prelude.Text])
dkimAttributes_tokens :: Lens' DkimAttributes (Maybe [Text])
dkimAttributes_tokens = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DkimAttributes' {Maybe [Text]
tokens :: Maybe [Text]
$sel:tokens:DkimAttributes' :: DkimAttributes -> Maybe [Text]
tokens} -> Maybe [Text]
tokens) (\s :: DkimAttributes
s@DkimAttributes' {} Maybe [Text]
a -> DkimAttributes
s {$sel:tokens:DkimAttributes' :: Maybe [Text]
tokens = Maybe [Text]
a} :: DkimAttributes) 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
instance Data.FromJSON DkimAttributes where
parseJSON :: Value -> Parser DkimAttributes
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DkimAttributes"
( \Object
x ->
Maybe Bool -> Maybe DkimStatus -> Maybe [Text] -> DkimAttributes
DkimAttributes'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SigningEnabled")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tokens" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable DkimAttributes where
hashWithSalt :: Int -> DkimAttributes -> Int
hashWithSalt Int
_salt DkimAttributes' {Maybe Bool
Maybe [Text]
Maybe DkimStatus
tokens :: Maybe [Text]
status :: Maybe DkimStatus
signingEnabled :: Maybe Bool
$sel:tokens:DkimAttributes' :: DkimAttributes -> Maybe [Text]
$sel:status:DkimAttributes' :: DkimAttributes -> Maybe DkimStatus
$sel:signingEnabled:DkimAttributes' :: DkimAttributes -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
signingEnabled
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DkimStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
tokens
instance Prelude.NFData DkimAttributes where
rnf :: DkimAttributes -> ()
rnf DkimAttributes' {Maybe Bool
Maybe [Text]
Maybe DkimStatus
tokens :: Maybe [Text]
status :: Maybe DkimStatus
signingEnabled :: Maybe Bool
$sel:tokens:DkimAttributes' :: DkimAttributes -> Maybe [Text]
$sel:status:DkimAttributes' :: DkimAttributes -> Maybe DkimStatus
$sel:signingEnabled:DkimAttributes' :: DkimAttributes -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
signingEnabled
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DkimStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
tokens