{-# 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.SESV2.GetEmailIdentityPolicies
(
GetEmailIdentityPolicies (..),
newGetEmailIdentityPolicies,
getEmailIdentityPolicies_emailIdentity,
GetEmailIdentityPoliciesResponse (..),
newGetEmailIdentityPoliciesResponse,
getEmailIdentityPoliciesResponse_policies,
getEmailIdentityPoliciesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SESV2.Types
data GetEmailIdentityPolicies = GetEmailIdentityPolicies'
{
GetEmailIdentityPolicies -> Text
emailIdentity :: Prelude.Text
}
deriving (GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool
(GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool)
-> (GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool)
-> Eq GetEmailIdentityPolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool
$c/= :: GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool
== :: GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool
$c== :: GetEmailIdentityPolicies -> GetEmailIdentityPolicies -> Bool
Prelude.Eq, ReadPrec [GetEmailIdentityPolicies]
ReadPrec GetEmailIdentityPolicies
Int -> ReadS GetEmailIdentityPolicies
ReadS [GetEmailIdentityPolicies]
(Int -> ReadS GetEmailIdentityPolicies)
-> ReadS [GetEmailIdentityPolicies]
-> ReadPrec GetEmailIdentityPolicies
-> ReadPrec [GetEmailIdentityPolicies]
-> Read GetEmailIdentityPolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEmailIdentityPolicies]
$creadListPrec :: ReadPrec [GetEmailIdentityPolicies]
readPrec :: ReadPrec GetEmailIdentityPolicies
$creadPrec :: ReadPrec GetEmailIdentityPolicies
readList :: ReadS [GetEmailIdentityPolicies]
$creadList :: ReadS [GetEmailIdentityPolicies]
readsPrec :: Int -> ReadS GetEmailIdentityPolicies
$creadsPrec :: Int -> ReadS GetEmailIdentityPolicies
Prelude.Read, Int -> GetEmailIdentityPolicies -> ShowS
[GetEmailIdentityPolicies] -> ShowS
GetEmailIdentityPolicies -> String
(Int -> GetEmailIdentityPolicies -> ShowS)
-> (GetEmailIdentityPolicies -> String)
-> ([GetEmailIdentityPolicies] -> ShowS)
-> Show GetEmailIdentityPolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEmailIdentityPolicies] -> ShowS
$cshowList :: [GetEmailIdentityPolicies] -> ShowS
show :: GetEmailIdentityPolicies -> String
$cshow :: GetEmailIdentityPolicies -> String
showsPrec :: Int -> GetEmailIdentityPolicies -> ShowS
$cshowsPrec :: Int -> GetEmailIdentityPolicies -> ShowS
Prelude.Show, (forall x.
GetEmailIdentityPolicies -> Rep GetEmailIdentityPolicies x)
-> (forall x.
Rep GetEmailIdentityPolicies x -> GetEmailIdentityPolicies)
-> Generic GetEmailIdentityPolicies
forall x.
Rep GetEmailIdentityPolicies x -> GetEmailIdentityPolicies
forall x.
GetEmailIdentityPolicies -> Rep GetEmailIdentityPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEmailIdentityPolicies x -> GetEmailIdentityPolicies
$cfrom :: forall x.
GetEmailIdentityPolicies -> Rep GetEmailIdentityPolicies x
Prelude.Generic)
newGetEmailIdentityPolicies ::
Prelude.Text ->
GetEmailIdentityPolicies
newGetEmailIdentityPolicies :: Text -> GetEmailIdentityPolicies
newGetEmailIdentityPolicies Text
pEmailIdentity_ =
GetEmailIdentityPolicies' :: Text -> GetEmailIdentityPolicies
GetEmailIdentityPolicies'
{ $sel:emailIdentity:GetEmailIdentityPolicies' :: Text
emailIdentity =
Text
pEmailIdentity_
}
getEmailIdentityPolicies_emailIdentity :: Lens.Lens' GetEmailIdentityPolicies Prelude.Text
getEmailIdentityPolicies_emailIdentity :: (Text -> f Text)
-> GetEmailIdentityPolicies -> f GetEmailIdentityPolicies
getEmailIdentityPolicies_emailIdentity = (GetEmailIdentityPolicies -> Text)
-> (GetEmailIdentityPolicies -> Text -> GetEmailIdentityPolicies)
-> Lens GetEmailIdentityPolicies GetEmailIdentityPolicies Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEmailIdentityPolicies' {Text
emailIdentity :: Text
$sel:emailIdentity:GetEmailIdentityPolicies' :: GetEmailIdentityPolicies -> Text
emailIdentity} -> Text
emailIdentity) (\s :: GetEmailIdentityPolicies
s@GetEmailIdentityPolicies' {} Text
a -> GetEmailIdentityPolicies
s {$sel:emailIdentity:GetEmailIdentityPolicies' :: Text
emailIdentity = Text
a} :: GetEmailIdentityPolicies)
instance Core.AWSRequest GetEmailIdentityPolicies where
type
AWSResponse GetEmailIdentityPolicies =
GetEmailIdentityPoliciesResponse
request :: GetEmailIdentityPolicies -> Request GetEmailIdentityPolicies
request = Service
-> GetEmailIdentityPolicies -> Request GetEmailIdentityPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetEmailIdentityPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEmailIdentityPolicies)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetEmailIdentityPolicies))
-> Logger
-> Service
-> Proxy GetEmailIdentityPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEmailIdentityPolicies)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe (HashMap Text Text)
-> Int -> GetEmailIdentityPoliciesResponse
GetEmailIdentityPoliciesResponse'
(Maybe (HashMap Text Text)
-> Int -> GetEmailIdentityPoliciesResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either String (Int -> GetEmailIdentityPoliciesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Policies" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetEmailIdentityPoliciesResponse)
-> Either String Int
-> Either String GetEmailIdentityPoliciesResponse
forall (f :: * -> *) a b. Applicative f => 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 GetEmailIdentityPolicies
instance Prelude.NFData GetEmailIdentityPolicies
instance Core.ToHeaders GetEmailIdentityPolicies where
toHeaders :: GetEmailIdentityPolicies -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetEmailIdentityPolicies -> 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.ToPath GetEmailIdentityPolicies where
toPath :: GetEmailIdentityPolicies -> ByteString
toPath GetEmailIdentityPolicies' {Text
emailIdentity :: Text
$sel:emailIdentity:GetEmailIdentityPolicies' :: GetEmailIdentityPolicies -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/v2/email/identities/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
emailIdentity,
ByteString
"/policies"
]
instance Core.ToQuery GetEmailIdentityPolicies where
toQuery :: GetEmailIdentityPolicies -> QueryString
toQuery = QueryString -> GetEmailIdentityPolicies -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetEmailIdentityPoliciesResponse = GetEmailIdentityPoliciesResponse'
{
GetEmailIdentityPoliciesResponse -> Maybe (HashMap Text Text)
policies :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GetEmailIdentityPoliciesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool
(GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool)
-> (GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool)
-> Eq GetEmailIdentityPoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool
$c/= :: GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool
== :: GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool
$c== :: GetEmailIdentityPoliciesResponse
-> GetEmailIdentityPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [GetEmailIdentityPoliciesResponse]
ReadPrec GetEmailIdentityPoliciesResponse
Int -> ReadS GetEmailIdentityPoliciesResponse
ReadS [GetEmailIdentityPoliciesResponse]
(Int -> ReadS GetEmailIdentityPoliciesResponse)
-> ReadS [GetEmailIdentityPoliciesResponse]
-> ReadPrec GetEmailIdentityPoliciesResponse
-> ReadPrec [GetEmailIdentityPoliciesResponse]
-> Read GetEmailIdentityPoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEmailIdentityPoliciesResponse]
$creadListPrec :: ReadPrec [GetEmailIdentityPoliciesResponse]
readPrec :: ReadPrec GetEmailIdentityPoliciesResponse
$creadPrec :: ReadPrec GetEmailIdentityPoliciesResponse
readList :: ReadS [GetEmailIdentityPoliciesResponse]
$creadList :: ReadS [GetEmailIdentityPoliciesResponse]
readsPrec :: Int -> ReadS GetEmailIdentityPoliciesResponse
$creadsPrec :: Int -> ReadS GetEmailIdentityPoliciesResponse
Prelude.Read, Int -> GetEmailIdentityPoliciesResponse -> ShowS
[GetEmailIdentityPoliciesResponse] -> ShowS
GetEmailIdentityPoliciesResponse -> String
(Int -> GetEmailIdentityPoliciesResponse -> ShowS)
-> (GetEmailIdentityPoliciesResponse -> String)
-> ([GetEmailIdentityPoliciesResponse] -> ShowS)
-> Show GetEmailIdentityPoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEmailIdentityPoliciesResponse] -> ShowS
$cshowList :: [GetEmailIdentityPoliciesResponse] -> ShowS
show :: GetEmailIdentityPoliciesResponse -> String
$cshow :: GetEmailIdentityPoliciesResponse -> String
showsPrec :: Int -> GetEmailIdentityPoliciesResponse -> ShowS
$cshowsPrec :: Int -> GetEmailIdentityPoliciesResponse -> ShowS
Prelude.Show, (forall x.
GetEmailIdentityPoliciesResponse
-> Rep GetEmailIdentityPoliciesResponse x)
-> (forall x.
Rep GetEmailIdentityPoliciesResponse x
-> GetEmailIdentityPoliciesResponse)
-> Generic GetEmailIdentityPoliciesResponse
forall x.
Rep GetEmailIdentityPoliciesResponse x
-> GetEmailIdentityPoliciesResponse
forall x.
GetEmailIdentityPoliciesResponse
-> Rep GetEmailIdentityPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEmailIdentityPoliciesResponse x
-> GetEmailIdentityPoliciesResponse
$cfrom :: forall x.
GetEmailIdentityPoliciesResponse
-> Rep GetEmailIdentityPoliciesResponse x
Prelude.Generic)
newGetEmailIdentityPoliciesResponse ::
Prelude.Int ->
GetEmailIdentityPoliciesResponse
newGetEmailIdentityPoliciesResponse :: Int -> GetEmailIdentityPoliciesResponse
newGetEmailIdentityPoliciesResponse Int
pHttpStatus_ =
GetEmailIdentityPoliciesResponse' :: Maybe (HashMap Text Text)
-> Int -> GetEmailIdentityPoliciesResponse
GetEmailIdentityPoliciesResponse'
{ $sel:policies:GetEmailIdentityPoliciesResponse' :: Maybe (HashMap Text Text)
policies =
Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEmailIdentityPoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEmailIdentityPoliciesResponse_policies :: Lens.Lens' GetEmailIdentityPoliciesResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getEmailIdentityPoliciesResponse_policies :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetEmailIdentityPoliciesResponse
-> f GetEmailIdentityPoliciesResponse
getEmailIdentityPoliciesResponse_policies = (GetEmailIdentityPoliciesResponse -> Maybe (HashMap Text Text))
-> (GetEmailIdentityPoliciesResponse
-> Maybe (HashMap Text Text) -> GetEmailIdentityPoliciesResponse)
-> Lens
GetEmailIdentityPoliciesResponse
GetEmailIdentityPoliciesResponse
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEmailIdentityPoliciesResponse' {Maybe (HashMap Text Text)
policies :: Maybe (HashMap Text Text)
$sel:policies:GetEmailIdentityPoliciesResponse' :: GetEmailIdentityPoliciesResponse -> Maybe (HashMap Text Text)
policies} -> Maybe (HashMap Text Text)
policies) (\s :: GetEmailIdentityPoliciesResponse
s@GetEmailIdentityPoliciesResponse' {} Maybe (HashMap Text Text)
a -> GetEmailIdentityPoliciesResponse
s {$sel:policies:GetEmailIdentityPoliciesResponse' :: Maybe (HashMap Text Text)
policies = Maybe (HashMap Text Text)
a} :: GetEmailIdentityPoliciesResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetEmailIdentityPoliciesResponse
-> f GetEmailIdentityPoliciesResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetEmailIdentityPoliciesResponse
-> f GetEmailIdentityPoliciesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEmailIdentityPoliciesResponse_httpStatus :: Lens.Lens' GetEmailIdentityPoliciesResponse Prelude.Int
getEmailIdentityPoliciesResponse_httpStatus :: (Int -> f Int)
-> GetEmailIdentityPoliciesResponse
-> f GetEmailIdentityPoliciesResponse
getEmailIdentityPoliciesResponse_httpStatus = (GetEmailIdentityPoliciesResponse -> Int)
-> (GetEmailIdentityPoliciesResponse
-> Int -> GetEmailIdentityPoliciesResponse)
-> Lens
GetEmailIdentityPoliciesResponse
GetEmailIdentityPoliciesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEmailIdentityPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEmailIdentityPoliciesResponse' :: GetEmailIdentityPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEmailIdentityPoliciesResponse
s@GetEmailIdentityPoliciesResponse' {} Int
a -> GetEmailIdentityPoliciesResponse
s {$sel:httpStatus:GetEmailIdentityPoliciesResponse' :: Int
httpStatus = Int
a} :: GetEmailIdentityPoliciesResponse)
instance
Prelude.NFData
GetEmailIdentityPoliciesResponse