{-# 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.WorkMail.PutInboundDmarcSettings
(
PutInboundDmarcSettings (..),
newPutInboundDmarcSettings,
putInboundDmarcSettings_organizationId,
putInboundDmarcSettings_enforced,
PutInboundDmarcSettingsResponse (..),
newPutInboundDmarcSettingsResponse,
putInboundDmarcSettingsResponse_httpStatus,
)
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkMail.Types
data PutInboundDmarcSettings = PutInboundDmarcSettings'
{
PutInboundDmarcSettings -> Text
organizationId :: Prelude.Text,
PutInboundDmarcSettings -> Bool
enforced :: Prelude.Bool
}
deriving (PutInboundDmarcSettings -> PutInboundDmarcSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutInboundDmarcSettings -> PutInboundDmarcSettings -> Bool
$c/= :: PutInboundDmarcSettings -> PutInboundDmarcSettings -> Bool
== :: PutInboundDmarcSettings -> PutInboundDmarcSettings -> Bool
$c== :: PutInboundDmarcSettings -> PutInboundDmarcSettings -> Bool
Prelude.Eq, ReadPrec [PutInboundDmarcSettings]
ReadPrec PutInboundDmarcSettings
Int -> ReadS PutInboundDmarcSettings
ReadS [PutInboundDmarcSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutInboundDmarcSettings]
$creadListPrec :: ReadPrec [PutInboundDmarcSettings]
readPrec :: ReadPrec PutInboundDmarcSettings
$creadPrec :: ReadPrec PutInboundDmarcSettings
readList :: ReadS [PutInboundDmarcSettings]
$creadList :: ReadS [PutInboundDmarcSettings]
readsPrec :: Int -> ReadS PutInboundDmarcSettings
$creadsPrec :: Int -> ReadS PutInboundDmarcSettings
Prelude.Read, Int -> PutInboundDmarcSettings -> ShowS
[PutInboundDmarcSettings] -> ShowS
PutInboundDmarcSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutInboundDmarcSettings] -> ShowS
$cshowList :: [PutInboundDmarcSettings] -> ShowS
show :: PutInboundDmarcSettings -> String
$cshow :: PutInboundDmarcSettings -> String
showsPrec :: Int -> PutInboundDmarcSettings -> ShowS
$cshowsPrec :: Int -> PutInboundDmarcSettings -> ShowS
Prelude.Show, forall x. Rep PutInboundDmarcSettings x -> PutInboundDmarcSettings
forall x. PutInboundDmarcSettings -> Rep PutInboundDmarcSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutInboundDmarcSettings x -> PutInboundDmarcSettings
$cfrom :: forall x. PutInboundDmarcSettings -> Rep PutInboundDmarcSettings x
Prelude.Generic)
newPutInboundDmarcSettings ::
Prelude.Text ->
Prelude.Bool ->
PutInboundDmarcSettings
newPutInboundDmarcSettings :: Text -> Bool -> PutInboundDmarcSettings
newPutInboundDmarcSettings
Text
pOrganizationId_
Bool
pEnforced_ =
PutInboundDmarcSettings'
{ $sel:organizationId:PutInboundDmarcSettings' :: Text
organizationId =
Text
pOrganizationId_,
$sel:enforced:PutInboundDmarcSettings' :: Bool
enforced = Bool
pEnforced_
}
putInboundDmarcSettings_organizationId :: Lens.Lens' PutInboundDmarcSettings Prelude.Text
putInboundDmarcSettings_organizationId :: Lens' PutInboundDmarcSettings Text
putInboundDmarcSettings_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInboundDmarcSettings' {Text
organizationId :: Text
$sel:organizationId:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Text
organizationId} -> Text
organizationId) (\s :: PutInboundDmarcSettings
s@PutInboundDmarcSettings' {} Text
a -> PutInboundDmarcSettings
s {$sel:organizationId:PutInboundDmarcSettings' :: Text
organizationId = Text
a} :: PutInboundDmarcSettings)
putInboundDmarcSettings_enforced :: Lens.Lens' PutInboundDmarcSettings Prelude.Bool
putInboundDmarcSettings_enforced :: Lens' PutInboundDmarcSettings Bool
putInboundDmarcSettings_enforced = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInboundDmarcSettings' {Bool
enforced :: Bool
$sel:enforced:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Bool
enforced} -> Bool
enforced) (\s :: PutInboundDmarcSettings
s@PutInboundDmarcSettings' {} Bool
a -> PutInboundDmarcSettings
s {$sel:enforced:PutInboundDmarcSettings' :: Bool
enforced = Bool
a} :: PutInboundDmarcSettings)
instance Core.AWSRequest PutInboundDmarcSettings where
type
AWSResponse PutInboundDmarcSettings =
PutInboundDmarcSettingsResponse
request :: (Service -> Service)
-> PutInboundDmarcSettings -> Request PutInboundDmarcSettings
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutInboundDmarcSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutInboundDmarcSettings)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutInboundDmarcSettingsResponse
PutInboundDmarcSettingsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutInboundDmarcSettings where
hashWithSalt :: Int -> PutInboundDmarcSettings -> Int
hashWithSalt Int
_salt PutInboundDmarcSettings' {Bool
Text
enforced :: Bool
organizationId :: Text
$sel:enforced:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Bool
$sel:organizationId:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enforced
instance Prelude.NFData PutInboundDmarcSettings where
rnf :: PutInboundDmarcSettings -> ()
rnf PutInboundDmarcSettings' {Bool
Text
enforced :: Bool
organizationId :: Text
$sel:enforced:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Bool
$sel:organizationId:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enforced
instance Data.ToHeaders PutInboundDmarcSettings where
toHeaders :: PutInboundDmarcSettings -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.PutInboundDmarcSettings" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutInboundDmarcSettings where
toJSON :: PutInboundDmarcSettings -> Value
toJSON PutInboundDmarcSettings' {Bool
Text
enforced :: Bool
organizationId :: Text
$sel:enforced:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Bool
$sel:organizationId:PutInboundDmarcSettings' :: PutInboundDmarcSettings -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
forall a. a -> Maybe a
Prelude.Just (Key
"Enforced" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Bool
enforced)
]
)
instance Data.ToPath PutInboundDmarcSettings where
toPath :: PutInboundDmarcSettings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutInboundDmarcSettings where
toQuery :: PutInboundDmarcSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutInboundDmarcSettingsResponse = PutInboundDmarcSettingsResponse'
{
PutInboundDmarcSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutInboundDmarcSettingsResponse
-> PutInboundDmarcSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutInboundDmarcSettingsResponse
-> PutInboundDmarcSettingsResponse -> Bool
$c/= :: PutInboundDmarcSettingsResponse
-> PutInboundDmarcSettingsResponse -> Bool
== :: PutInboundDmarcSettingsResponse
-> PutInboundDmarcSettingsResponse -> Bool
$c== :: PutInboundDmarcSettingsResponse
-> PutInboundDmarcSettingsResponse -> Bool
Prelude.Eq, ReadPrec [PutInboundDmarcSettingsResponse]
ReadPrec PutInboundDmarcSettingsResponse
Int -> ReadS PutInboundDmarcSettingsResponse
ReadS [PutInboundDmarcSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutInboundDmarcSettingsResponse]
$creadListPrec :: ReadPrec [PutInboundDmarcSettingsResponse]
readPrec :: ReadPrec PutInboundDmarcSettingsResponse
$creadPrec :: ReadPrec PutInboundDmarcSettingsResponse
readList :: ReadS [PutInboundDmarcSettingsResponse]
$creadList :: ReadS [PutInboundDmarcSettingsResponse]
readsPrec :: Int -> ReadS PutInboundDmarcSettingsResponse
$creadsPrec :: Int -> ReadS PutInboundDmarcSettingsResponse
Prelude.Read, Int -> PutInboundDmarcSettingsResponse -> ShowS
[PutInboundDmarcSettingsResponse] -> ShowS
PutInboundDmarcSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutInboundDmarcSettingsResponse] -> ShowS
$cshowList :: [PutInboundDmarcSettingsResponse] -> ShowS
show :: PutInboundDmarcSettingsResponse -> String
$cshow :: PutInboundDmarcSettingsResponse -> String
showsPrec :: Int -> PutInboundDmarcSettingsResponse -> ShowS
$cshowsPrec :: Int -> PutInboundDmarcSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep PutInboundDmarcSettingsResponse x
-> PutInboundDmarcSettingsResponse
forall x.
PutInboundDmarcSettingsResponse
-> Rep PutInboundDmarcSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutInboundDmarcSettingsResponse x
-> PutInboundDmarcSettingsResponse
$cfrom :: forall x.
PutInboundDmarcSettingsResponse
-> Rep PutInboundDmarcSettingsResponse x
Prelude.Generic)
newPutInboundDmarcSettingsResponse ::
Prelude.Int ->
PutInboundDmarcSettingsResponse
newPutInboundDmarcSettingsResponse :: Int -> PutInboundDmarcSettingsResponse
newPutInboundDmarcSettingsResponse Int
pHttpStatus_ =
PutInboundDmarcSettingsResponse'
{ $sel:httpStatus:PutInboundDmarcSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putInboundDmarcSettingsResponse_httpStatus :: Lens.Lens' PutInboundDmarcSettingsResponse Prelude.Int
putInboundDmarcSettingsResponse_httpStatus :: Lens' PutInboundDmarcSettingsResponse Int
putInboundDmarcSettingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInboundDmarcSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutInboundDmarcSettingsResponse' :: PutInboundDmarcSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutInboundDmarcSettingsResponse
s@PutInboundDmarcSettingsResponse' {} Int
a -> PutInboundDmarcSettingsResponse
s {$sel:httpStatus:PutInboundDmarcSettingsResponse' :: Int
httpStatus = Int
a} :: PutInboundDmarcSettingsResponse)
instance
Prelude.NFData
PutInboundDmarcSettingsResponse
where
rnf :: PutInboundDmarcSettingsResponse -> ()
rnf PutInboundDmarcSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutInboundDmarcSettingsResponse' :: PutInboundDmarcSettingsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus