{-# 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.SetDefaultPolicyVersion
(
SetDefaultPolicyVersion (..),
newSetDefaultPolicyVersion,
setDefaultPolicyVersion_policyArn,
setDefaultPolicyVersion_versionId,
SetDefaultPolicyVersionResponse (..),
newSetDefaultPolicyVersionResponse,
)
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 SetDefaultPolicyVersion = SetDefaultPolicyVersion'
{
SetDefaultPolicyVersion -> Text
policyArn :: Prelude.Text,
SetDefaultPolicyVersion -> Text
versionId :: Prelude.Text
}
deriving (SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool
(SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool)
-> (SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool)
-> Eq SetDefaultPolicyVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool
$c/= :: SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool
== :: SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool
$c== :: SetDefaultPolicyVersion -> SetDefaultPolicyVersion -> Bool
Prelude.Eq, ReadPrec [SetDefaultPolicyVersion]
ReadPrec SetDefaultPolicyVersion
Int -> ReadS SetDefaultPolicyVersion
ReadS [SetDefaultPolicyVersion]
(Int -> ReadS SetDefaultPolicyVersion)
-> ReadS [SetDefaultPolicyVersion]
-> ReadPrec SetDefaultPolicyVersion
-> ReadPrec [SetDefaultPolicyVersion]
-> Read SetDefaultPolicyVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetDefaultPolicyVersion]
$creadListPrec :: ReadPrec [SetDefaultPolicyVersion]
readPrec :: ReadPrec SetDefaultPolicyVersion
$creadPrec :: ReadPrec SetDefaultPolicyVersion
readList :: ReadS [SetDefaultPolicyVersion]
$creadList :: ReadS [SetDefaultPolicyVersion]
readsPrec :: Int -> ReadS SetDefaultPolicyVersion
$creadsPrec :: Int -> ReadS SetDefaultPolicyVersion
Prelude.Read, Int -> SetDefaultPolicyVersion -> ShowS
[SetDefaultPolicyVersion] -> ShowS
SetDefaultPolicyVersion -> String
(Int -> SetDefaultPolicyVersion -> ShowS)
-> (SetDefaultPolicyVersion -> String)
-> ([SetDefaultPolicyVersion] -> ShowS)
-> Show SetDefaultPolicyVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetDefaultPolicyVersion] -> ShowS
$cshowList :: [SetDefaultPolicyVersion] -> ShowS
show :: SetDefaultPolicyVersion -> String
$cshow :: SetDefaultPolicyVersion -> String
showsPrec :: Int -> SetDefaultPolicyVersion -> ShowS
$cshowsPrec :: Int -> SetDefaultPolicyVersion -> ShowS
Prelude.Show, (forall x.
SetDefaultPolicyVersion -> Rep SetDefaultPolicyVersion x)
-> (forall x.
Rep SetDefaultPolicyVersion x -> SetDefaultPolicyVersion)
-> Generic SetDefaultPolicyVersion
forall x. Rep SetDefaultPolicyVersion x -> SetDefaultPolicyVersion
forall x. SetDefaultPolicyVersion -> Rep SetDefaultPolicyVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetDefaultPolicyVersion x -> SetDefaultPolicyVersion
$cfrom :: forall x. SetDefaultPolicyVersion -> Rep SetDefaultPolicyVersion x
Prelude.Generic)
newSetDefaultPolicyVersion ::
Prelude.Text ->
Prelude.Text ->
SetDefaultPolicyVersion
newSetDefaultPolicyVersion :: Text -> Text -> SetDefaultPolicyVersion
newSetDefaultPolicyVersion Text
pPolicyArn_ Text
pVersionId_ =
SetDefaultPolicyVersion' :: Text -> Text -> SetDefaultPolicyVersion
SetDefaultPolicyVersion'
{ $sel:policyArn:SetDefaultPolicyVersion' :: Text
policyArn = Text
pPolicyArn_,
$sel:versionId:SetDefaultPolicyVersion' :: Text
versionId = Text
pVersionId_
}
setDefaultPolicyVersion_policyArn :: Lens.Lens' SetDefaultPolicyVersion Prelude.Text
setDefaultPolicyVersion_policyArn :: (Text -> f Text)
-> SetDefaultPolicyVersion -> f SetDefaultPolicyVersion
setDefaultPolicyVersion_policyArn = (SetDefaultPolicyVersion -> Text)
-> (SetDefaultPolicyVersion -> Text -> SetDefaultPolicyVersion)
-> Lens SetDefaultPolicyVersion SetDefaultPolicyVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetDefaultPolicyVersion' {Text
policyArn :: Text
$sel:policyArn:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
policyArn} -> Text
policyArn) (\s :: SetDefaultPolicyVersion
s@SetDefaultPolicyVersion' {} Text
a -> SetDefaultPolicyVersion
s {$sel:policyArn:SetDefaultPolicyVersion' :: Text
policyArn = Text
a} :: SetDefaultPolicyVersion)
setDefaultPolicyVersion_versionId :: Lens.Lens' SetDefaultPolicyVersion Prelude.Text
setDefaultPolicyVersion_versionId :: (Text -> f Text)
-> SetDefaultPolicyVersion -> f SetDefaultPolicyVersion
setDefaultPolicyVersion_versionId = (SetDefaultPolicyVersion -> Text)
-> (SetDefaultPolicyVersion -> Text -> SetDefaultPolicyVersion)
-> Lens SetDefaultPolicyVersion SetDefaultPolicyVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetDefaultPolicyVersion' {Text
versionId :: Text
$sel:versionId:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
versionId} -> Text
versionId) (\s :: SetDefaultPolicyVersion
s@SetDefaultPolicyVersion' {} Text
a -> SetDefaultPolicyVersion
s {$sel:versionId:SetDefaultPolicyVersion' :: Text
versionId = Text
a} :: SetDefaultPolicyVersion)
instance Core.AWSRequest SetDefaultPolicyVersion where
type
AWSResponse SetDefaultPolicyVersion =
SetDefaultPolicyVersionResponse
request :: SetDefaultPolicyVersion -> Request SetDefaultPolicyVersion
request = Service
-> SetDefaultPolicyVersion -> Request SetDefaultPolicyVersion
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy SetDefaultPolicyVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetDefaultPolicyVersion)))
response =
AWSResponse SetDefaultPolicyVersion
-> Logger
-> Service
-> Proxy SetDefaultPolicyVersion
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SetDefaultPolicyVersion)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse SetDefaultPolicyVersion
SetDefaultPolicyVersionResponse
SetDefaultPolicyVersionResponse'
instance Prelude.Hashable SetDefaultPolicyVersion
instance Prelude.NFData SetDefaultPolicyVersion
instance Core.ToHeaders SetDefaultPolicyVersion where
toHeaders :: SetDefaultPolicyVersion -> [Header]
toHeaders = [Header] -> SetDefaultPolicyVersion -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath SetDefaultPolicyVersion where
toPath :: SetDefaultPolicyVersion -> ByteString
toPath = ByteString -> SetDefaultPolicyVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetDefaultPolicyVersion where
toQuery :: SetDefaultPolicyVersion -> QueryString
toQuery SetDefaultPolicyVersion' {Text
versionId :: Text
policyArn :: Text
$sel:versionId:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
$sel:policyArn:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"SetDefaultPolicyVersion" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"PolicyArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
policyArn,
ByteString
"VersionId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
versionId
]
data SetDefaultPolicyVersionResponse = SetDefaultPolicyVersionResponse'
{
}
deriving (SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool
(SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool)
-> (SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool)
-> Eq SetDefaultPolicyVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool
$c/= :: SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool
== :: SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool
$c== :: SetDefaultPolicyVersionResponse
-> SetDefaultPolicyVersionResponse -> Bool
Prelude.Eq, ReadPrec [SetDefaultPolicyVersionResponse]
ReadPrec SetDefaultPolicyVersionResponse
Int -> ReadS SetDefaultPolicyVersionResponse
ReadS [SetDefaultPolicyVersionResponse]
(Int -> ReadS SetDefaultPolicyVersionResponse)
-> ReadS [SetDefaultPolicyVersionResponse]
-> ReadPrec SetDefaultPolicyVersionResponse
-> ReadPrec [SetDefaultPolicyVersionResponse]
-> Read SetDefaultPolicyVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetDefaultPolicyVersionResponse]
$creadListPrec :: ReadPrec [SetDefaultPolicyVersionResponse]
readPrec :: ReadPrec SetDefaultPolicyVersionResponse
$creadPrec :: ReadPrec SetDefaultPolicyVersionResponse
readList :: ReadS [SetDefaultPolicyVersionResponse]
$creadList :: ReadS [SetDefaultPolicyVersionResponse]
readsPrec :: Int -> ReadS SetDefaultPolicyVersionResponse
$creadsPrec :: Int -> ReadS SetDefaultPolicyVersionResponse
Prelude.Read, Int -> SetDefaultPolicyVersionResponse -> ShowS
[SetDefaultPolicyVersionResponse] -> ShowS
SetDefaultPolicyVersionResponse -> String
(Int -> SetDefaultPolicyVersionResponse -> ShowS)
-> (SetDefaultPolicyVersionResponse -> String)
-> ([SetDefaultPolicyVersionResponse] -> ShowS)
-> Show SetDefaultPolicyVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetDefaultPolicyVersionResponse] -> ShowS
$cshowList :: [SetDefaultPolicyVersionResponse] -> ShowS
show :: SetDefaultPolicyVersionResponse -> String
$cshow :: SetDefaultPolicyVersionResponse -> String
showsPrec :: Int -> SetDefaultPolicyVersionResponse -> ShowS
$cshowsPrec :: Int -> SetDefaultPolicyVersionResponse -> ShowS
Prelude.Show, (forall x.
SetDefaultPolicyVersionResponse
-> Rep SetDefaultPolicyVersionResponse x)
-> (forall x.
Rep SetDefaultPolicyVersionResponse x
-> SetDefaultPolicyVersionResponse)
-> Generic SetDefaultPolicyVersionResponse
forall x.
Rep SetDefaultPolicyVersionResponse x
-> SetDefaultPolicyVersionResponse
forall x.
SetDefaultPolicyVersionResponse
-> Rep SetDefaultPolicyVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SetDefaultPolicyVersionResponse x
-> SetDefaultPolicyVersionResponse
$cfrom :: forall x.
SetDefaultPolicyVersionResponse
-> Rep SetDefaultPolicyVersionResponse x
Prelude.Generic)
newSetDefaultPolicyVersionResponse ::
SetDefaultPolicyVersionResponse
newSetDefaultPolicyVersionResponse :: SetDefaultPolicyVersionResponse
newSetDefaultPolicyVersionResponse =
SetDefaultPolicyVersionResponse
SetDefaultPolicyVersionResponse'
instance
Prelude.NFData
SetDefaultPolicyVersionResponse