{-# 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.SSOAdmin.AttachManagedPolicyToPermissionSet
(
AttachManagedPolicyToPermissionSet (..),
newAttachManagedPolicyToPermissionSet,
attachManagedPolicyToPermissionSet_instanceArn,
attachManagedPolicyToPermissionSet_permissionSetArn,
attachManagedPolicyToPermissionSet_managedPolicyArn,
AttachManagedPolicyToPermissionSetResponse (..),
newAttachManagedPolicyToPermissionSetResponse,
attachManagedPolicyToPermissionSetResponse_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.SSOAdmin.Types
data AttachManagedPolicyToPermissionSet = AttachManagedPolicyToPermissionSet'
{
AttachManagedPolicyToPermissionSet -> Text
instanceArn :: Prelude.Text,
AttachManagedPolicyToPermissionSet -> Text
permissionSetArn :: Prelude.Text,
AttachManagedPolicyToPermissionSet -> Text
managedPolicyArn :: Prelude.Text
}
deriving (AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
(AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool)
-> (AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool)
-> Eq AttachManagedPolicyToPermissionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
$c/= :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
== :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
$c== :: AttachManagedPolicyToPermissionSet
-> AttachManagedPolicyToPermissionSet -> Bool
Prelude.Eq, ReadPrec [AttachManagedPolicyToPermissionSet]
ReadPrec AttachManagedPolicyToPermissionSet
Int -> ReadS AttachManagedPolicyToPermissionSet
ReadS [AttachManagedPolicyToPermissionSet]
(Int -> ReadS AttachManagedPolicyToPermissionSet)
-> ReadS [AttachManagedPolicyToPermissionSet]
-> ReadPrec AttachManagedPolicyToPermissionSet
-> ReadPrec [AttachManagedPolicyToPermissionSet]
-> Read AttachManagedPolicyToPermissionSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachManagedPolicyToPermissionSet]
$creadListPrec :: ReadPrec [AttachManagedPolicyToPermissionSet]
readPrec :: ReadPrec AttachManagedPolicyToPermissionSet
$creadPrec :: ReadPrec AttachManagedPolicyToPermissionSet
readList :: ReadS [AttachManagedPolicyToPermissionSet]
$creadList :: ReadS [AttachManagedPolicyToPermissionSet]
readsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSet
$creadsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSet
Prelude.Read, Int -> AttachManagedPolicyToPermissionSet -> ShowS
[AttachManagedPolicyToPermissionSet] -> ShowS
AttachManagedPolicyToPermissionSet -> String
(Int -> AttachManagedPolicyToPermissionSet -> ShowS)
-> (AttachManagedPolicyToPermissionSet -> String)
-> ([AttachManagedPolicyToPermissionSet] -> ShowS)
-> Show AttachManagedPolicyToPermissionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachManagedPolicyToPermissionSet] -> ShowS
$cshowList :: [AttachManagedPolicyToPermissionSet] -> ShowS
show :: AttachManagedPolicyToPermissionSet -> String
$cshow :: AttachManagedPolicyToPermissionSet -> String
showsPrec :: Int -> AttachManagedPolicyToPermissionSet -> ShowS
$cshowsPrec :: Int -> AttachManagedPolicyToPermissionSet -> ShowS
Prelude.Show, (forall x.
AttachManagedPolicyToPermissionSet
-> Rep AttachManagedPolicyToPermissionSet x)
-> (forall x.
Rep AttachManagedPolicyToPermissionSet x
-> AttachManagedPolicyToPermissionSet)
-> Generic AttachManagedPolicyToPermissionSet
forall x.
Rep AttachManagedPolicyToPermissionSet x
-> AttachManagedPolicyToPermissionSet
forall x.
AttachManagedPolicyToPermissionSet
-> Rep AttachManagedPolicyToPermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachManagedPolicyToPermissionSet x
-> AttachManagedPolicyToPermissionSet
$cfrom :: forall x.
AttachManagedPolicyToPermissionSet
-> Rep AttachManagedPolicyToPermissionSet x
Prelude.Generic)
newAttachManagedPolicyToPermissionSet ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AttachManagedPolicyToPermissionSet
newAttachManagedPolicyToPermissionSet :: Text -> Text -> Text -> AttachManagedPolicyToPermissionSet
newAttachManagedPolicyToPermissionSet
Text
pInstanceArn_
Text
pPermissionSetArn_
Text
pManagedPolicyArn_ =
AttachManagedPolicyToPermissionSet' :: Text -> Text -> Text -> AttachManagedPolicyToPermissionSet
AttachManagedPolicyToPermissionSet'
{ $sel:instanceArn:AttachManagedPolicyToPermissionSet' :: Text
instanceArn =
Text
pInstanceArn_,
$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: Text
permissionSetArn = Text
pPermissionSetArn_,
$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: Text
managedPolicyArn = Text
pManagedPolicyArn_
}
attachManagedPolicyToPermissionSet_instanceArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_instanceArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_instanceArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
-> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
AttachManagedPolicyToPermissionSet
AttachManagedPolicyToPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: Text
instanceArn = Text
a} :: AttachManagedPolicyToPermissionSet)
attachManagedPolicyToPermissionSet_permissionSetArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_permissionSetArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_permissionSetArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
-> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
AttachManagedPolicyToPermissionSet
AttachManagedPolicyToPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: Text
permissionSetArn = Text
a} :: AttachManagedPolicyToPermissionSet)
attachManagedPolicyToPermissionSet_managedPolicyArn :: Lens.Lens' AttachManagedPolicyToPermissionSet Prelude.Text
attachManagedPolicyToPermissionSet_managedPolicyArn :: (Text -> f Text)
-> AttachManagedPolicyToPermissionSet
-> f AttachManagedPolicyToPermissionSet
attachManagedPolicyToPermissionSet_managedPolicyArn = (AttachManagedPolicyToPermissionSet -> Text)
-> (AttachManagedPolicyToPermissionSet
-> Text -> AttachManagedPolicyToPermissionSet)
-> Lens
AttachManagedPolicyToPermissionSet
AttachManagedPolicyToPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSet' {Text
managedPolicyArn :: Text
$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
managedPolicyArn} -> Text
managedPolicyArn) (\s :: AttachManagedPolicyToPermissionSet
s@AttachManagedPolicyToPermissionSet' {} Text
a -> AttachManagedPolicyToPermissionSet
s {$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: Text
managedPolicyArn = Text
a} :: AttachManagedPolicyToPermissionSet)
instance
Core.AWSRequest
AttachManagedPolicyToPermissionSet
where
type
AWSResponse AttachManagedPolicyToPermissionSet =
AttachManagedPolicyToPermissionSetResponse
request :: AttachManagedPolicyToPermissionSet
-> Request AttachManagedPolicyToPermissionSet
request = Service
-> AttachManagedPolicyToPermissionSet
-> Request AttachManagedPolicyToPermissionSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AttachManagedPolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AttachManagedPolicyToPermissionSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AttachManagedPolicyToPermissionSet))
-> Logger
-> Service
-> Proxy AttachManagedPolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AttachManagedPolicyToPermissionSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AttachManagedPolicyToPermissionSetResponse
AttachManagedPolicyToPermissionSetResponse'
(Int -> AttachManagedPolicyToPermissionSetResponse)
-> Either String Int
-> Either String AttachManagedPolicyToPermissionSetResponse
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))
)
instance
Prelude.Hashable
AttachManagedPolicyToPermissionSet
instance
Prelude.NFData
AttachManagedPolicyToPermissionSet
instance
Core.ToHeaders
AttachManagedPolicyToPermissionSet
where
toHeaders :: AttachManagedPolicyToPermissionSet -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AttachManagedPolicyToPermissionSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SWBExternalService.AttachManagedPolicyToPermissionSet" ::
Prelude.ByteString
),
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.ToJSON
AttachManagedPolicyToPermissionSet
where
toJSON :: AttachManagedPolicyToPermissionSet -> Value
toJSON AttachManagedPolicyToPermissionSet' {Text
managedPolicyArn :: Text
permissionSetArn :: Text
instanceArn :: Text
$sel:managedPolicyArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
$sel:permissionSetArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
$sel:instanceArn:AttachManagedPolicyToPermissionSet' :: AttachManagedPolicyToPermissionSet -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"PermissionSetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissionSetArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ManagedPolicyArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
managedPolicyArn)
]
)
instance
Core.ToPath
AttachManagedPolicyToPermissionSet
where
toPath :: AttachManagedPolicyToPermissionSet -> ByteString
toPath = ByteString -> AttachManagedPolicyToPermissionSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AttachManagedPolicyToPermissionSet
where
toQuery :: AttachManagedPolicyToPermissionSet -> QueryString
toQuery = QueryString -> AttachManagedPolicyToPermissionSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AttachManagedPolicyToPermissionSetResponse = AttachManagedPolicyToPermissionSetResponse'
{
AttachManagedPolicyToPermissionSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool
(AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool)
-> (AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool)
-> Eq AttachManagedPolicyToPermissionSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool
$c/= :: AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool
== :: AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool
$c== :: AttachManagedPolicyToPermissionSetResponse
-> AttachManagedPolicyToPermissionSetResponse -> Bool
Prelude.Eq, ReadPrec [AttachManagedPolicyToPermissionSetResponse]
ReadPrec AttachManagedPolicyToPermissionSetResponse
Int -> ReadS AttachManagedPolicyToPermissionSetResponse
ReadS [AttachManagedPolicyToPermissionSetResponse]
(Int -> ReadS AttachManagedPolicyToPermissionSetResponse)
-> ReadS [AttachManagedPolicyToPermissionSetResponse]
-> ReadPrec AttachManagedPolicyToPermissionSetResponse
-> ReadPrec [AttachManagedPolicyToPermissionSetResponse]
-> Read AttachManagedPolicyToPermissionSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachManagedPolicyToPermissionSetResponse]
$creadListPrec :: ReadPrec [AttachManagedPolicyToPermissionSetResponse]
readPrec :: ReadPrec AttachManagedPolicyToPermissionSetResponse
$creadPrec :: ReadPrec AttachManagedPolicyToPermissionSetResponse
readList :: ReadS [AttachManagedPolicyToPermissionSetResponse]
$creadList :: ReadS [AttachManagedPolicyToPermissionSetResponse]
readsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSetResponse
$creadsPrec :: Int -> ReadS AttachManagedPolicyToPermissionSetResponse
Prelude.Read, Int -> AttachManagedPolicyToPermissionSetResponse -> ShowS
[AttachManagedPolicyToPermissionSetResponse] -> ShowS
AttachManagedPolicyToPermissionSetResponse -> String
(Int -> AttachManagedPolicyToPermissionSetResponse -> ShowS)
-> (AttachManagedPolicyToPermissionSetResponse -> String)
-> ([AttachManagedPolicyToPermissionSetResponse] -> ShowS)
-> Show AttachManagedPolicyToPermissionSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachManagedPolicyToPermissionSetResponse] -> ShowS
$cshowList :: [AttachManagedPolicyToPermissionSetResponse] -> ShowS
show :: AttachManagedPolicyToPermissionSetResponse -> String
$cshow :: AttachManagedPolicyToPermissionSetResponse -> String
showsPrec :: Int -> AttachManagedPolicyToPermissionSetResponse -> ShowS
$cshowsPrec :: Int -> AttachManagedPolicyToPermissionSetResponse -> ShowS
Prelude.Show, (forall x.
AttachManagedPolicyToPermissionSetResponse
-> Rep AttachManagedPolicyToPermissionSetResponse x)
-> (forall x.
Rep AttachManagedPolicyToPermissionSetResponse x
-> AttachManagedPolicyToPermissionSetResponse)
-> Generic AttachManagedPolicyToPermissionSetResponse
forall x.
Rep AttachManagedPolicyToPermissionSetResponse x
-> AttachManagedPolicyToPermissionSetResponse
forall x.
AttachManagedPolicyToPermissionSetResponse
-> Rep AttachManagedPolicyToPermissionSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachManagedPolicyToPermissionSetResponse x
-> AttachManagedPolicyToPermissionSetResponse
$cfrom :: forall x.
AttachManagedPolicyToPermissionSetResponse
-> Rep AttachManagedPolicyToPermissionSetResponse x
Prelude.Generic)
newAttachManagedPolicyToPermissionSetResponse ::
Prelude.Int ->
AttachManagedPolicyToPermissionSetResponse
newAttachManagedPolicyToPermissionSetResponse :: Int -> AttachManagedPolicyToPermissionSetResponse
newAttachManagedPolicyToPermissionSetResponse
Int
pHttpStatus_ =
AttachManagedPolicyToPermissionSetResponse' :: Int -> AttachManagedPolicyToPermissionSetResponse
AttachManagedPolicyToPermissionSetResponse'
{ $sel:httpStatus:AttachManagedPolicyToPermissionSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
attachManagedPolicyToPermissionSetResponse_httpStatus :: Lens.Lens' AttachManagedPolicyToPermissionSetResponse Prelude.Int
attachManagedPolicyToPermissionSetResponse_httpStatus :: (Int -> f Int)
-> AttachManagedPolicyToPermissionSetResponse
-> f AttachManagedPolicyToPermissionSetResponse
attachManagedPolicyToPermissionSetResponse_httpStatus = (AttachManagedPolicyToPermissionSetResponse -> Int)
-> (AttachManagedPolicyToPermissionSetResponse
-> Int -> AttachManagedPolicyToPermissionSetResponse)
-> Lens
AttachManagedPolicyToPermissionSetResponse
AttachManagedPolicyToPermissionSetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachManagedPolicyToPermissionSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:AttachManagedPolicyToPermissionSetResponse' :: AttachManagedPolicyToPermissionSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AttachManagedPolicyToPermissionSetResponse
s@AttachManagedPolicyToPermissionSetResponse' {} Int
a -> AttachManagedPolicyToPermissionSetResponse
s {$sel:httpStatus:AttachManagedPolicyToPermissionSetResponse' :: Int
httpStatus = Int
a} :: AttachManagedPolicyToPermissionSetResponse)
instance
Prelude.NFData
AttachManagedPolicyToPermissionSetResponse