{-# 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.IoT.SetDefaultPolicyVersion
(
SetDefaultPolicyVersion (..),
newSetDefaultPolicyVersion,
setDefaultPolicyVersion_policyName,
setDefaultPolicyVersion_policyVersionId,
SetDefaultPolicyVersionResponse (..),
newSetDefaultPolicyVersionResponse,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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
policyName :: Prelude.Text,
SetDefaultPolicyVersion -> Text
policyVersionId :: 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
pPolicyName_
Text
pPolicyVersionId_ =
SetDefaultPolicyVersion' :: Text -> Text -> SetDefaultPolicyVersion
SetDefaultPolicyVersion'
{ $sel:policyName:SetDefaultPolicyVersion' :: Text
policyName = Text
pPolicyName_,
$sel:policyVersionId:SetDefaultPolicyVersion' :: Text
policyVersionId = Text
pPolicyVersionId_
}
setDefaultPolicyVersion_policyName :: Lens.Lens' SetDefaultPolicyVersion Prelude.Text
setDefaultPolicyVersion_policyName :: (Text -> f Text)
-> SetDefaultPolicyVersion -> f SetDefaultPolicyVersion
setDefaultPolicyVersion_policyName = (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
policyName :: Text
$sel:policyName:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
policyName} -> Text
policyName) (\s :: SetDefaultPolicyVersion
s@SetDefaultPolicyVersion' {} Text
a -> SetDefaultPolicyVersion
s {$sel:policyName:SetDefaultPolicyVersion' :: Text
policyName = Text
a} :: SetDefaultPolicyVersion)
setDefaultPolicyVersion_policyVersionId :: Lens.Lens' SetDefaultPolicyVersion Prelude.Text
setDefaultPolicyVersion_policyVersionId :: (Text -> f Text)
-> SetDefaultPolicyVersion -> f SetDefaultPolicyVersion
setDefaultPolicyVersion_policyVersionId = (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
policyVersionId :: Text
$sel:policyVersionId:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
policyVersionId} -> Text
policyVersionId) (\s :: SetDefaultPolicyVersion
s@SetDefaultPolicyVersion' {} Text
a -> SetDefaultPolicyVersion
s {$sel:policyVersionId:SetDefaultPolicyVersion' :: Text
policyVersionId = 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, ToJSON a) => Service -> a -> Request a
Request.patchJSON 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.ToJSON SetDefaultPolicyVersion where
toJSON :: SetDefaultPolicyVersion -> Value
toJSON = Value -> SetDefaultPolicyVersion -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath SetDefaultPolicyVersion where
toPath :: SetDefaultPolicyVersion -> ByteString
toPath SetDefaultPolicyVersion' {Text
policyVersionId :: Text
policyName :: Text
$sel:policyVersionId:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
$sel:policyName:SetDefaultPolicyVersion' :: SetDefaultPolicyVersion -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/policies/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
policyName,
ByteString
"/version/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
policyVersionId
]
instance Core.ToQuery SetDefaultPolicyVersion where
toQuery :: SetDefaultPolicyVersion -> QueryString
toQuery = QueryString -> SetDefaultPolicyVersion -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
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