{-# 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.IAM.GetAccountPasswordPolicy
(
GetAccountPasswordPolicy (..),
newGetAccountPasswordPolicy,
GetAccountPasswordPolicyResponse (..),
newGetAccountPasswordPolicyResponse,
getAccountPasswordPolicyResponse_httpStatus,
getAccountPasswordPolicyResponse_passwordPolicy,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IAM.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetAccountPasswordPolicy = GetAccountPasswordPolicy'
{
}
deriving (GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool
(GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool)
-> (GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool)
-> Eq GetAccountPasswordPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool
$c/= :: GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool
== :: GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool
$c== :: GetAccountPasswordPolicy -> GetAccountPasswordPolicy -> Bool
Prelude.Eq, ReadPrec [GetAccountPasswordPolicy]
ReadPrec GetAccountPasswordPolicy
Int -> ReadS GetAccountPasswordPolicy
ReadS [GetAccountPasswordPolicy]
(Int -> ReadS GetAccountPasswordPolicy)
-> ReadS [GetAccountPasswordPolicy]
-> ReadPrec GetAccountPasswordPolicy
-> ReadPrec [GetAccountPasswordPolicy]
-> Read GetAccountPasswordPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccountPasswordPolicy]
$creadListPrec :: ReadPrec [GetAccountPasswordPolicy]
readPrec :: ReadPrec GetAccountPasswordPolicy
$creadPrec :: ReadPrec GetAccountPasswordPolicy
readList :: ReadS [GetAccountPasswordPolicy]
$creadList :: ReadS [GetAccountPasswordPolicy]
readsPrec :: Int -> ReadS GetAccountPasswordPolicy
$creadsPrec :: Int -> ReadS GetAccountPasswordPolicy
Prelude.Read, Int -> GetAccountPasswordPolicy -> ShowS
[GetAccountPasswordPolicy] -> ShowS
GetAccountPasswordPolicy -> String
(Int -> GetAccountPasswordPolicy -> ShowS)
-> (GetAccountPasswordPolicy -> String)
-> ([GetAccountPasswordPolicy] -> ShowS)
-> Show GetAccountPasswordPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccountPasswordPolicy] -> ShowS
$cshowList :: [GetAccountPasswordPolicy] -> ShowS
show :: GetAccountPasswordPolicy -> String
$cshow :: GetAccountPasswordPolicy -> String
showsPrec :: Int -> GetAccountPasswordPolicy -> ShowS
$cshowsPrec :: Int -> GetAccountPasswordPolicy -> ShowS
Prelude.Show, (forall x.
GetAccountPasswordPolicy -> Rep GetAccountPasswordPolicy x)
-> (forall x.
Rep GetAccountPasswordPolicy x -> GetAccountPasswordPolicy)
-> Generic GetAccountPasswordPolicy
forall x.
Rep GetAccountPasswordPolicy x -> GetAccountPasswordPolicy
forall x.
GetAccountPasswordPolicy -> Rep GetAccountPasswordPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccountPasswordPolicy x -> GetAccountPasswordPolicy
$cfrom :: forall x.
GetAccountPasswordPolicy -> Rep GetAccountPasswordPolicy x
Prelude.Generic)
newGetAccountPasswordPolicy ::
GetAccountPasswordPolicy
newGetAccountPasswordPolicy :: GetAccountPasswordPolicy
newGetAccountPasswordPolicy =
GetAccountPasswordPolicy
GetAccountPasswordPolicy'
instance Core.AWSRequest GetAccountPasswordPolicy where
type
AWSResponse GetAccountPasswordPolicy =
GetAccountPasswordPolicyResponse
request :: GetAccountPasswordPolicy -> Request GetAccountPasswordPolicy
request = Service
-> GetAccountPasswordPolicy -> Request GetAccountPasswordPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy GetAccountPasswordPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAccountPasswordPolicy)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetAccountPasswordPolicy))
-> Logger
-> Service
-> Proxy GetAccountPasswordPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAccountPasswordPolicy)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetAccountPasswordPolicyResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Int -> PasswordPolicy -> GetAccountPasswordPolicyResponse
GetAccountPasswordPolicyResponse'
(Int -> PasswordPolicy -> GetAccountPasswordPolicyResponse)
-> Either String Int
-> Either
String (PasswordPolicy -> GetAccountPasswordPolicyResponse)
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))
Either String (PasswordPolicy -> GetAccountPasswordPolicyResponse)
-> Either String PasswordPolicy
-> Either String GetAccountPasswordPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String PasswordPolicy
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"PasswordPolicy")
)
instance Prelude.Hashable GetAccountPasswordPolicy
instance Prelude.NFData GetAccountPasswordPolicy
instance Core.ToHeaders GetAccountPasswordPolicy where
toHeaders :: GetAccountPasswordPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> GetAccountPasswordPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetAccountPasswordPolicy where
toPath :: GetAccountPasswordPolicy -> ByteString
toPath = ByteString -> GetAccountPasswordPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetAccountPasswordPolicy where
toQuery :: GetAccountPasswordPolicy -> QueryString
toQuery =
QueryString -> GetAccountPasswordPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const
( [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"GetAccountPasswordPolicy" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString)
]
)
data GetAccountPasswordPolicyResponse = GetAccountPasswordPolicyResponse'
{
GetAccountPasswordPolicyResponse -> Int
httpStatus :: Prelude.Int,
GetAccountPasswordPolicyResponse -> PasswordPolicy
passwordPolicy :: PasswordPolicy
}
deriving (GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool
(GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool)
-> (GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool)
-> Eq GetAccountPasswordPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool
$c/= :: GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool
== :: GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool
$c== :: GetAccountPasswordPolicyResponse
-> GetAccountPasswordPolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetAccountPasswordPolicyResponse]
ReadPrec GetAccountPasswordPolicyResponse
Int -> ReadS GetAccountPasswordPolicyResponse
ReadS [GetAccountPasswordPolicyResponse]
(Int -> ReadS GetAccountPasswordPolicyResponse)
-> ReadS [GetAccountPasswordPolicyResponse]
-> ReadPrec GetAccountPasswordPolicyResponse
-> ReadPrec [GetAccountPasswordPolicyResponse]
-> Read GetAccountPasswordPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAccountPasswordPolicyResponse]
$creadListPrec :: ReadPrec [GetAccountPasswordPolicyResponse]
readPrec :: ReadPrec GetAccountPasswordPolicyResponse
$creadPrec :: ReadPrec GetAccountPasswordPolicyResponse
readList :: ReadS [GetAccountPasswordPolicyResponse]
$creadList :: ReadS [GetAccountPasswordPolicyResponse]
readsPrec :: Int -> ReadS GetAccountPasswordPolicyResponse
$creadsPrec :: Int -> ReadS GetAccountPasswordPolicyResponse
Prelude.Read, Int -> GetAccountPasswordPolicyResponse -> ShowS
[GetAccountPasswordPolicyResponse] -> ShowS
GetAccountPasswordPolicyResponse -> String
(Int -> GetAccountPasswordPolicyResponse -> ShowS)
-> (GetAccountPasswordPolicyResponse -> String)
-> ([GetAccountPasswordPolicyResponse] -> ShowS)
-> Show GetAccountPasswordPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAccountPasswordPolicyResponse] -> ShowS
$cshowList :: [GetAccountPasswordPolicyResponse] -> ShowS
show :: GetAccountPasswordPolicyResponse -> String
$cshow :: GetAccountPasswordPolicyResponse -> String
showsPrec :: Int -> GetAccountPasswordPolicyResponse -> ShowS
$cshowsPrec :: Int -> GetAccountPasswordPolicyResponse -> ShowS
Prelude.Show, (forall x.
GetAccountPasswordPolicyResponse
-> Rep GetAccountPasswordPolicyResponse x)
-> (forall x.
Rep GetAccountPasswordPolicyResponse x
-> GetAccountPasswordPolicyResponse)
-> Generic GetAccountPasswordPolicyResponse
forall x.
Rep GetAccountPasswordPolicyResponse x
-> GetAccountPasswordPolicyResponse
forall x.
GetAccountPasswordPolicyResponse
-> Rep GetAccountPasswordPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAccountPasswordPolicyResponse x
-> GetAccountPasswordPolicyResponse
$cfrom :: forall x.
GetAccountPasswordPolicyResponse
-> Rep GetAccountPasswordPolicyResponse x
Prelude.Generic)
newGetAccountPasswordPolicyResponse ::
Prelude.Int ->
PasswordPolicy ->
GetAccountPasswordPolicyResponse
newGetAccountPasswordPolicyResponse :: Int -> PasswordPolicy -> GetAccountPasswordPolicyResponse
newGetAccountPasswordPolicyResponse
Int
pHttpStatus_
PasswordPolicy
pPasswordPolicy_ =
GetAccountPasswordPolicyResponse' :: Int -> PasswordPolicy -> GetAccountPasswordPolicyResponse
GetAccountPasswordPolicyResponse'
{ $sel:httpStatus:GetAccountPasswordPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:passwordPolicy:GetAccountPasswordPolicyResponse' :: PasswordPolicy
passwordPolicy = PasswordPolicy
pPasswordPolicy_
}
getAccountPasswordPolicyResponse_httpStatus :: Lens.Lens' GetAccountPasswordPolicyResponse Prelude.Int
getAccountPasswordPolicyResponse_httpStatus :: (Int -> f Int)
-> GetAccountPasswordPolicyResponse
-> f GetAccountPasswordPolicyResponse
getAccountPasswordPolicyResponse_httpStatus = (GetAccountPasswordPolicyResponse -> Int)
-> (GetAccountPasswordPolicyResponse
-> Int -> GetAccountPasswordPolicyResponse)
-> Lens
GetAccountPasswordPolicyResponse
GetAccountPasswordPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountPasswordPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAccountPasswordPolicyResponse' :: GetAccountPasswordPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAccountPasswordPolicyResponse
s@GetAccountPasswordPolicyResponse' {} Int
a -> GetAccountPasswordPolicyResponse
s {$sel:httpStatus:GetAccountPasswordPolicyResponse' :: Int
httpStatus = Int
a} :: GetAccountPasswordPolicyResponse)
getAccountPasswordPolicyResponse_passwordPolicy :: Lens.Lens' GetAccountPasswordPolicyResponse PasswordPolicy
getAccountPasswordPolicyResponse_passwordPolicy :: (PasswordPolicy -> f PasswordPolicy)
-> GetAccountPasswordPolicyResponse
-> f GetAccountPasswordPolicyResponse
getAccountPasswordPolicyResponse_passwordPolicy = (GetAccountPasswordPolicyResponse -> PasswordPolicy)
-> (GetAccountPasswordPolicyResponse
-> PasswordPolicy -> GetAccountPasswordPolicyResponse)
-> Lens
GetAccountPasswordPolicyResponse
GetAccountPasswordPolicyResponse
PasswordPolicy
PasswordPolicy
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAccountPasswordPolicyResponse' {PasswordPolicy
passwordPolicy :: PasswordPolicy
$sel:passwordPolicy:GetAccountPasswordPolicyResponse' :: GetAccountPasswordPolicyResponse -> PasswordPolicy
passwordPolicy} -> PasswordPolicy
passwordPolicy) (\s :: GetAccountPasswordPolicyResponse
s@GetAccountPasswordPolicyResponse' {} PasswordPolicy
a -> GetAccountPasswordPolicyResponse
s {$sel:passwordPolicy:GetAccountPasswordPolicyResponse' :: PasswordPolicy
passwordPolicy = PasswordPolicy
a} :: GetAccountPasswordPolicyResponse)
instance
Prelude.NFData
GetAccountPasswordPolicyResponse