{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.PinpointEmail.PutDeliverabilityDashboardOption
(
PutDeliverabilityDashboardOption (..),
newPutDeliverabilityDashboardOption,
putDeliverabilityDashboardOption_subscribedDomains,
putDeliverabilityDashboardOption_dashboardEnabled,
PutDeliverabilityDashboardOptionResponse (..),
newPutDeliverabilityDashboardOptionResponse,
putDeliverabilityDashboardOptionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutDeliverabilityDashboardOption = PutDeliverabilityDashboardOption'
{
PutDeliverabilityDashboardOption
-> Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains :: Prelude.Maybe [DomainDeliverabilityTrackingOption],
PutDeliverabilityDashboardOption -> Bool
dashboardEnabled :: Prelude.Bool
}
deriving (PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool
(PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool)
-> (PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool)
-> Eq PutDeliverabilityDashboardOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool
$c/= :: PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool
== :: PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool
$c== :: PutDeliverabilityDashboardOption
-> PutDeliverabilityDashboardOption -> Bool
Prelude.Eq, ReadPrec [PutDeliverabilityDashboardOption]
ReadPrec PutDeliverabilityDashboardOption
Int -> ReadS PutDeliverabilityDashboardOption
ReadS [PutDeliverabilityDashboardOption]
(Int -> ReadS PutDeliverabilityDashboardOption)
-> ReadS [PutDeliverabilityDashboardOption]
-> ReadPrec PutDeliverabilityDashboardOption
-> ReadPrec [PutDeliverabilityDashboardOption]
-> Read PutDeliverabilityDashboardOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDeliverabilityDashboardOption]
$creadListPrec :: ReadPrec [PutDeliverabilityDashboardOption]
readPrec :: ReadPrec PutDeliverabilityDashboardOption
$creadPrec :: ReadPrec PutDeliverabilityDashboardOption
readList :: ReadS [PutDeliverabilityDashboardOption]
$creadList :: ReadS [PutDeliverabilityDashboardOption]
readsPrec :: Int -> ReadS PutDeliverabilityDashboardOption
$creadsPrec :: Int -> ReadS PutDeliverabilityDashboardOption
Prelude.Read, Int -> PutDeliverabilityDashboardOption -> ShowS
[PutDeliverabilityDashboardOption] -> ShowS
PutDeliverabilityDashboardOption -> String
(Int -> PutDeliverabilityDashboardOption -> ShowS)
-> (PutDeliverabilityDashboardOption -> String)
-> ([PutDeliverabilityDashboardOption] -> ShowS)
-> Show PutDeliverabilityDashboardOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDeliverabilityDashboardOption] -> ShowS
$cshowList :: [PutDeliverabilityDashboardOption] -> ShowS
show :: PutDeliverabilityDashboardOption -> String
$cshow :: PutDeliverabilityDashboardOption -> String
showsPrec :: Int -> PutDeliverabilityDashboardOption -> ShowS
$cshowsPrec :: Int -> PutDeliverabilityDashboardOption -> ShowS
Prelude.Show, (forall x.
PutDeliverabilityDashboardOption
-> Rep PutDeliverabilityDashboardOption x)
-> (forall x.
Rep PutDeliverabilityDashboardOption x
-> PutDeliverabilityDashboardOption)
-> Generic PutDeliverabilityDashboardOption
forall x.
Rep PutDeliverabilityDashboardOption x
-> PutDeliverabilityDashboardOption
forall x.
PutDeliverabilityDashboardOption
-> Rep PutDeliverabilityDashboardOption x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDeliverabilityDashboardOption x
-> PutDeliverabilityDashboardOption
$cfrom :: forall x.
PutDeliverabilityDashboardOption
-> Rep PutDeliverabilityDashboardOption x
Prelude.Generic)
newPutDeliverabilityDashboardOption ::
Prelude.Bool ->
PutDeliverabilityDashboardOption
newPutDeliverabilityDashboardOption :: Bool -> PutDeliverabilityDashboardOption
newPutDeliverabilityDashboardOption
Bool
pDashboardEnabled_ =
PutDeliverabilityDashboardOption' :: Maybe [DomainDeliverabilityTrackingOption]
-> Bool -> PutDeliverabilityDashboardOption
PutDeliverabilityDashboardOption'
{ $sel:subscribedDomains:PutDeliverabilityDashboardOption' :: Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains =
Maybe [DomainDeliverabilityTrackingOption]
forall a. Maybe a
Prelude.Nothing,
$sel:dashboardEnabled:PutDeliverabilityDashboardOption' :: Bool
dashboardEnabled = Bool
pDashboardEnabled_
}
putDeliverabilityDashboardOption_subscribedDomains :: Lens.Lens' PutDeliverabilityDashboardOption (Prelude.Maybe [DomainDeliverabilityTrackingOption])
putDeliverabilityDashboardOption_subscribedDomains :: (Maybe [DomainDeliverabilityTrackingOption]
-> f (Maybe [DomainDeliverabilityTrackingOption]))
-> PutDeliverabilityDashboardOption
-> f PutDeliverabilityDashboardOption
putDeliverabilityDashboardOption_subscribedDomains = (PutDeliverabilityDashboardOption
-> Maybe [DomainDeliverabilityTrackingOption])
-> (PutDeliverabilityDashboardOption
-> Maybe [DomainDeliverabilityTrackingOption]
-> PutDeliverabilityDashboardOption)
-> Lens
PutDeliverabilityDashboardOption
PutDeliverabilityDashboardOption
(Maybe [DomainDeliverabilityTrackingOption])
(Maybe [DomainDeliverabilityTrackingOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDeliverabilityDashboardOption' {Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains :: Maybe [DomainDeliverabilityTrackingOption]
$sel:subscribedDomains:PutDeliverabilityDashboardOption' :: PutDeliverabilityDashboardOption
-> Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains} -> Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains) (\s :: PutDeliverabilityDashboardOption
s@PutDeliverabilityDashboardOption' {} Maybe [DomainDeliverabilityTrackingOption]
a -> PutDeliverabilityDashboardOption
s {$sel:subscribedDomains:PutDeliverabilityDashboardOption' :: Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains = Maybe [DomainDeliverabilityTrackingOption]
a} :: PutDeliverabilityDashboardOption) ((Maybe [DomainDeliverabilityTrackingOption]
-> f (Maybe [DomainDeliverabilityTrackingOption]))
-> PutDeliverabilityDashboardOption
-> f PutDeliverabilityDashboardOption)
-> ((Maybe [DomainDeliverabilityTrackingOption]
-> f (Maybe [DomainDeliverabilityTrackingOption]))
-> Maybe [DomainDeliverabilityTrackingOption]
-> f (Maybe [DomainDeliverabilityTrackingOption]))
-> (Maybe [DomainDeliverabilityTrackingOption]
-> f (Maybe [DomainDeliverabilityTrackingOption]))
-> PutDeliverabilityDashboardOption
-> f PutDeliverabilityDashboardOption
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
-> Iso
(Maybe [DomainDeliverabilityTrackingOption])
(Maybe [DomainDeliverabilityTrackingOption])
(Maybe [DomainDeliverabilityTrackingOption])
(Maybe [DomainDeliverabilityTrackingOption])
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
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
[DomainDeliverabilityTrackingOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putDeliverabilityDashboardOption_dashboardEnabled :: Lens.Lens' PutDeliverabilityDashboardOption Prelude.Bool
putDeliverabilityDashboardOption_dashboardEnabled :: (Bool -> f Bool)
-> PutDeliverabilityDashboardOption
-> f PutDeliverabilityDashboardOption
putDeliverabilityDashboardOption_dashboardEnabled = (PutDeliverabilityDashboardOption -> Bool)
-> (PutDeliverabilityDashboardOption
-> Bool -> PutDeliverabilityDashboardOption)
-> Lens
PutDeliverabilityDashboardOption
PutDeliverabilityDashboardOption
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDeliverabilityDashboardOption' {Bool
dashboardEnabled :: Bool
$sel:dashboardEnabled:PutDeliverabilityDashboardOption' :: PutDeliverabilityDashboardOption -> Bool
dashboardEnabled} -> Bool
dashboardEnabled) (\s :: PutDeliverabilityDashboardOption
s@PutDeliverabilityDashboardOption' {} Bool
a -> PutDeliverabilityDashboardOption
s {$sel:dashboardEnabled:PutDeliverabilityDashboardOption' :: Bool
dashboardEnabled = Bool
a} :: PutDeliverabilityDashboardOption)
instance
Core.AWSRequest
PutDeliverabilityDashboardOption
where
type
AWSResponse PutDeliverabilityDashboardOption =
PutDeliverabilityDashboardOptionResponse
request :: PutDeliverabilityDashboardOption
-> Request PutDeliverabilityDashboardOption
request = Service
-> PutDeliverabilityDashboardOption
-> Request PutDeliverabilityDashboardOption
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutDeliverabilityDashboardOption
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDeliverabilityDashboardOption)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutDeliverabilityDashboardOption))
-> Logger
-> Service
-> Proxy PutDeliverabilityDashboardOption
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutDeliverabilityDashboardOption)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutDeliverabilityDashboardOptionResponse
PutDeliverabilityDashboardOptionResponse'
(Int -> PutDeliverabilityDashboardOptionResponse)
-> Either String Int
-> Either String PutDeliverabilityDashboardOptionResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
PutDeliverabilityDashboardOption
instance
Prelude.NFData
PutDeliverabilityDashboardOption
instance
Core.ToHeaders
PutDeliverabilityDashboardOption
where
toHeaders :: PutDeliverabilityDashboardOption -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutDeliverabilityDashboardOption -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutDeliverabilityDashboardOption where
toJSON :: PutDeliverabilityDashboardOption -> Value
toJSON PutDeliverabilityDashboardOption' {Bool
Maybe [DomainDeliverabilityTrackingOption]
dashboardEnabled :: Bool
subscribedDomains :: Maybe [DomainDeliverabilityTrackingOption]
$sel:dashboardEnabled:PutDeliverabilityDashboardOption' :: PutDeliverabilityDashboardOption -> Bool
$sel:subscribedDomains:PutDeliverabilityDashboardOption' :: PutDeliverabilityDashboardOption
-> Maybe [DomainDeliverabilityTrackingOption]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SubscribedDomains" Text -> [DomainDeliverabilityTrackingOption] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([DomainDeliverabilityTrackingOption] -> Pair)
-> Maybe [DomainDeliverabilityTrackingOption] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DomainDeliverabilityTrackingOption]
subscribedDomains,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DashboardEnabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
dashboardEnabled)
]
)
instance Core.ToPath PutDeliverabilityDashboardOption where
toPath :: PutDeliverabilityDashboardOption -> ByteString
toPath =
ByteString -> PutDeliverabilityDashboardOption -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/v1/email/deliverability-dashboard"
instance
Core.ToQuery
PutDeliverabilityDashboardOption
where
toQuery :: PutDeliverabilityDashboardOption -> QueryString
toQuery = QueryString -> PutDeliverabilityDashboardOption -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutDeliverabilityDashboardOptionResponse = PutDeliverabilityDashboardOptionResponse'
{
PutDeliverabilityDashboardOptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool
(PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool)
-> (PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool)
-> Eq PutDeliverabilityDashboardOptionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool
$c/= :: PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool
== :: PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool
$c== :: PutDeliverabilityDashboardOptionResponse
-> PutDeliverabilityDashboardOptionResponse -> Bool
Prelude.Eq, ReadPrec [PutDeliverabilityDashboardOptionResponse]
ReadPrec PutDeliverabilityDashboardOptionResponse
Int -> ReadS PutDeliverabilityDashboardOptionResponse
ReadS [PutDeliverabilityDashboardOptionResponse]
(Int -> ReadS PutDeliverabilityDashboardOptionResponse)
-> ReadS [PutDeliverabilityDashboardOptionResponse]
-> ReadPrec PutDeliverabilityDashboardOptionResponse
-> ReadPrec [PutDeliverabilityDashboardOptionResponse]
-> Read PutDeliverabilityDashboardOptionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutDeliverabilityDashboardOptionResponse]
$creadListPrec :: ReadPrec [PutDeliverabilityDashboardOptionResponse]
readPrec :: ReadPrec PutDeliverabilityDashboardOptionResponse
$creadPrec :: ReadPrec PutDeliverabilityDashboardOptionResponse
readList :: ReadS [PutDeliverabilityDashboardOptionResponse]
$creadList :: ReadS [PutDeliverabilityDashboardOptionResponse]
readsPrec :: Int -> ReadS PutDeliverabilityDashboardOptionResponse
$creadsPrec :: Int -> ReadS PutDeliverabilityDashboardOptionResponse
Prelude.Read, Int -> PutDeliverabilityDashboardOptionResponse -> ShowS
[PutDeliverabilityDashboardOptionResponse] -> ShowS
PutDeliverabilityDashboardOptionResponse -> String
(Int -> PutDeliverabilityDashboardOptionResponse -> ShowS)
-> (PutDeliverabilityDashboardOptionResponse -> String)
-> ([PutDeliverabilityDashboardOptionResponse] -> ShowS)
-> Show PutDeliverabilityDashboardOptionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutDeliverabilityDashboardOptionResponse] -> ShowS
$cshowList :: [PutDeliverabilityDashboardOptionResponse] -> ShowS
show :: PutDeliverabilityDashboardOptionResponse -> String
$cshow :: PutDeliverabilityDashboardOptionResponse -> String
showsPrec :: Int -> PutDeliverabilityDashboardOptionResponse -> ShowS
$cshowsPrec :: Int -> PutDeliverabilityDashboardOptionResponse -> ShowS
Prelude.Show, (forall x.
PutDeliverabilityDashboardOptionResponse
-> Rep PutDeliverabilityDashboardOptionResponse x)
-> (forall x.
Rep PutDeliverabilityDashboardOptionResponse x
-> PutDeliverabilityDashboardOptionResponse)
-> Generic PutDeliverabilityDashboardOptionResponse
forall x.
Rep PutDeliverabilityDashboardOptionResponse x
-> PutDeliverabilityDashboardOptionResponse
forall x.
PutDeliverabilityDashboardOptionResponse
-> Rep PutDeliverabilityDashboardOptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutDeliverabilityDashboardOptionResponse x
-> PutDeliverabilityDashboardOptionResponse
$cfrom :: forall x.
PutDeliverabilityDashboardOptionResponse
-> Rep PutDeliverabilityDashboardOptionResponse x
Prelude.Generic)
newPutDeliverabilityDashboardOptionResponse ::
Prelude.Int ->
PutDeliverabilityDashboardOptionResponse
newPutDeliverabilityDashboardOptionResponse :: Int -> PutDeliverabilityDashboardOptionResponse
newPutDeliverabilityDashboardOptionResponse
Int
pHttpStatus_ =
PutDeliverabilityDashboardOptionResponse' :: Int -> PutDeliverabilityDashboardOptionResponse
PutDeliverabilityDashboardOptionResponse'
{ $sel:httpStatus:PutDeliverabilityDashboardOptionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putDeliverabilityDashboardOptionResponse_httpStatus :: Lens.Lens' PutDeliverabilityDashboardOptionResponse Prelude.Int
putDeliverabilityDashboardOptionResponse_httpStatus :: (Int -> f Int)
-> PutDeliverabilityDashboardOptionResponse
-> f PutDeliverabilityDashboardOptionResponse
putDeliverabilityDashboardOptionResponse_httpStatus = (PutDeliverabilityDashboardOptionResponse -> Int)
-> (PutDeliverabilityDashboardOptionResponse
-> Int -> PutDeliverabilityDashboardOptionResponse)
-> Lens
PutDeliverabilityDashboardOptionResponse
PutDeliverabilityDashboardOptionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutDeliverabilityDashboardOptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutDeliverabilityDashboardOptionResponse' :: PutDeliverabilityDashboardOptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutDeliverabilityDashboardOptionResponse
s@PutDeliverabilityDashboardOptionResponse' {} Int
a -> PutDeliverabilityDashboardOptionResponse
s {$sel:httpStatus:PutDeliverabilityDashboardOptionResponse' :: Int
httpStatus = Int
a} :: PutDeliverabilityDashboardOptionResponse)
instance
Prelude.NFData
PutDeliverabilityDashboardOptionResponse