{-# 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.PutInlinePolicyToPermissionSet
(
PutInlinePolicyToPermissionSet (..),
newPutInlinePolicyToPermissionSet,
putInlinePolicyToPermissionSet_instanceArn,
putInlinePolicyToPermissionSet_permissionSetArn,
putInlinePolicyToPermissionSet_inlinePolicy,
PutInlinePolicyToPermissionSetResponse (..),
newPutInlinePolicyToPermissionSetResponse,
putInlinePolicyToPermissionSetResponse_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 PutInlinePolicyToPermissionSet = PutInlinePolicyToPermissionSet'
{
PutInlinePolicyToPermissionSet -> Text
instanceArn :: Prelude.Text,
PutInlinePolicyToPermissionSet -> Text
permissionSetArn :: Prelude.Text,
PutInlinePolicyToPermissionSet -> Sensitive Text
inlinePolicy :: Core.Sensitive Prelude.Text
}
deriving (PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool
(PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool)
-> (PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool)
-> Eq PutInlinePolicyToPermissionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool
$c/= :: PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool
== :: PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool
$c== :: PutInlinePolicyToPermissionSet
-> PutInlinePolicyToPermissionSet -> Bool
Prelude.Eq, Int -> PutInlinePolicyToPermissionSet -> ShowS
[PutInlinePolicyToPermissionSet] -> ShowS
PutInlinePolicyToPermissionSet -> String
(Int -> PutInlinePolicyToPermissionSet -> ShowS)
-> (PutInlinePolicyToPermissionSet -> String)
-> ([PutInlinePolicyToPermissionSet] -> ShowS)
-> Show PutInlinePolicyToPermissionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutInlinePolicyToPermissionSet] -> ShowS
$cshowList :: [PutInlinePolicyToPermissionSet] -> ShowS
show :: PutInlinePolicyToPermissionSet -> String
$cshow :: PutInlinePolicyToPermissionSet -> String
showsPrec :: Int -> PutInlinePolicyToPermissionSet -> ShowS
$cshowsPrec :: Int -> PutInlinePolicyToPermissionSet -> ShowS
Prelude.Show, (forall x.
PutInlinePolicyToPermissionSet
-> Rep PutInlinePolicyToPermissionSet x)
-> (forall x.
Rep PutInlinePolicyToPermissionSet x
-> PutInlinePolicyToPermissionSet)
-> Generic PutInlinePolicyToPermissionSet
forall x.
Rep PutInlinePolicyToPermissionSet x
-> PutInlinePolicyToPermissionSet
forall x.
PutInlinePolicyToPermissionSet
-> Rep PutInlinePolicyToPermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutInlinePolicyToPermissionSet x
-> PutInlinePolicyToPermissionSet
$cfrom :: forall x.
PutInlinePolicyToPermissionSet
-> Rep PutInlinePolicyToPermissionSet x
Prelude.Generic)
newPutInlinePolicyToPermissionSet ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PutInlinePolicyToPermissionSet
newPutInlinePolicyToPermissionSet :: Text -> Text -> Text -> PutInlinePolicyToPermissionSet
newPutInlinePolicyToPermissionSet
Text
pInstanceArn_
Text
pPermissionSetArn_
Text
pInlinePolicy_ =
PutInlinePolicyToPermissionSet' :: Text -> Text -> Sensitive Text -> PutInlinePolicyToPermissionSet
PutInlinePolicyToPermissionSet'
{ $sel:instanceArn:PutInlinePolicyToPermissionSet' :: Text
instanceArn =
Text
pInstanceArn_,
$sel:permissionSetArn:PutInlinePolicyToPermissionSet' :: Text
permissionSetArn = Text
pPermissionSetArn_,
$sel:inlinePolicy:PutInlinePolicyToPermissionSet' :: Sensitive Text
inlinePolicy =
Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pInlinePolicy_
}
putInlinePolicyToPermissionSet_instanceArn :: Lens.Lens' PutInlinePolicyToPermissionSet Prelude.Text
putInlinePolicyToPermissionSet_instanceArn :: (Text -> f Text)
-> PutInlinePolicyToPermissionSet
-> f PutInlinePolicyToPermissionSet
putInlinePolicyToPermissionSet_instanceArn = (PutInlinePolicyToPermissionSet -> Text)
-> (PutInlinePolicyToPermissionSet
-> Text -> PutInlinePolicyToPermissionSet)
-> Lens
PutInlinePolicyToPermissionSet
PutInlinePolicyToPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInlinePolicyToPermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: PutInlinePolicyToPermissionSet
s@PutInlinePolicyToPermissionSet' {} Text
a -> PutInlinePolicyToPermissionSet
s {$sel:instanceArn:PutInlinePolicyToPermissionSet' :: Text
instanceArn = Text
a} :: PutInlinePolicyToPermissionSet)
putInlinePolicyToPermissionSet_permissionSetArn :: Lens.Lens' PutInlinePolicyToPermissionSet Prelude.Text
putInlinePolicyToPermissionSet_permissionSetArn :: (Text -> f Text)
-> PutInlinePolicyToPermissionSet
-> f PutInlinePolicyToPermissionSet
putInlinePolicyToPermissionSet_permissionSetArn = (PutInlinePolicyToPermissionSet -> Text)
-> (PutInlinePolicyToPermissionSet
-> Text -> PutInlinePolicyToPermissionSet)
-> Lens
PutInlinePolicyToPermissionSet
PutInlinePolicyToPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInlinePolicyToPermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: PutInlinePolicyToPermissionSet
s@PutInlinePolicyToPermissionSet' {} Text
a -> PutInlinePolicyToPermissionSet
s {$sel:permissionSetArn:PutInlinePolicyToPermissionSet' :: Text
permissionSetArn = Text
a} :: PutInlinePolicyToPermissionSet)
putInlinePolicyToPermissionSet_inlinePolicy :: Lens.Lens' PutInlinePolicyToPermissionSet Prelude.Text
putInlinePolicyToPermissionSet_inlinePolicy :: (Text -> f Text)
-> PutInlinePolicyToPermissionSet
-> f PutInlinePolicyToPermissionSet
putInlinePolicyToPermissionSet_inlinePolicy = (PutInlinePolicyToPermissionSet -> Sensitive Text)
-> (PutInlinePolicyToPermissionSet
-> Sensitive Text -> PutInlinePolicyToPermissionSet)
-> Lens
PutInlinePolicyToPermissionSet
PutInlinePolicyToPermissionSet
(Sensitive Text)
(Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInlinePolicyToPermissionSet' {Sensitive Text
inlinePolicy :: Sensitive Text
$sel:inlinePolicy:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> Sensitive Text
inlinePolicy} -> Sensitive Text
inlinePolicy) (\s :: PutInlinePolicyToPermissionSet
s@PutInlinePolicyToPermissionSet' {} Sensitive Text
a -> PutInlinePolicyToPermissionSet
s {$sel:inlinePolicy:PutInlinePolicyToPermissionSet' :: Sensitive Text
inlinePolicy = Sensitive Text
a} :: PutInlinePolicyToPermissionSet) ((Sensitive Text -> f (Sensitive Text))
-> PutInlinePolicyToPermissionSet
-> f PutInlinePolicyToPermissionSet)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> PutInlinePolicyToPermissionSet
-> f PutInlinePolicyToPermissionSet
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance
Core.AWSRequest
PutInlinePolicyToPermissionSet
where
type
AWSResponse PutInlinePolicyToPermissionSet =
PutInlinePolicyToPermissionSetResponse
request :: PutInlinePolicyToPermissionSet
-> Request PutInlinePolicyToPermissionSet
request = Service
-> PutInlinePolicyToPermissionSet
-> Request PutInlinePolicyToPermissionSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutInlinePolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutInlinePolicyToPermissionSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutInlinePolicyToPermissionSet))
-> Logger
-> Service
-> Proxy PutInlinePolicyToPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutInlinePolicyToPermissionSet)))
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 -> PutInlinePolicyToPermissionSetResponse
PutInlinePolicyToPermissionSetResponse'
(Int -> PutInlinePolicyToPermissionSetResponse)
-> Either String Int
-> Either String PutInlinePolicyToPermissionSetResponse
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
PutInlinePolicyToPermissionSet
instance
Prelude.NFData
PutInlinePolicyToPermissionSet
instance
Core.ToHeaders
PutInlinePolicyToPermissionSet
where
toHeaders :: PutInlinePolicyToPermissionSet -> ResponseHeaders
toHeaders =
ResponseHeaders
-> PutInlinePolicyToPermissionSet -> 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.PutInlinePolicyToPermissionSet" ::
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 PutInlinePolicyToPermissionSet where
toJSON :: PutInlinePolicyToPermissionSet -> Value
toJSON PutInlinePolicyToPermissionSet' {Text
Sensitive Text
inlinePolicy :: Sensitive Text
permissionSetArn :: Text
instanceArn :: Text
$sel:inlinePolicy:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> Sensitive Text
$sel:permissionSetArn:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> Text
$sel:instanceArn:PutInlinePolicyToPermissionSet' :: PutInlinePolicyToPermissionSet -> 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
"InlinePolicy" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
inlinePolicy)
]
)
instance Core.ToPath PutInlinePolicyToPermissionSet where
toPath :: PutInlinePolicyToPermissionSet -> ByteString
toPath = ByteString -> PutInlinePolicyToPermissionSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutInlinePolicyToPermissionSet where
toQuery :: PutInlinePolicyToPermissionSet -> QueryString
toQuery = QueryString -> PutInlinePolicyToPermissionSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutInlinePolicyToPermissionSetResponse = PutInlinePolicyToPermissionSetResponse'
{
PutInlinePolicyToPermissionSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool
(PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool)
-> (PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool)
-> Eq PutInlinePolicyToPermissionSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool
$c/= :: PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool
== :: PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool
$c== :: PutInlinePolicyToPermissionSetResponse
-> PutInlinePolicyToPermissionSetResponse -> Bool
Prelude.Eq, ReadPrec [PutInlinePolicyToPermissionSetResponse]
ReadPrec PutInlinePolicyToPermissionSetResponse
Int -> ReadS PutInlinePolicyToPermissionSetResponse
ReadS [PutInlinePolicyToPermissionSetResponse]
(Int -> ReadS PutInlinePolicyToPermissionSetResponse)
-> ReadS [PutInlinePolicyToPermissionSetResponse]
-> ReadPrec PutInlinePolicyToPermissionSetResponse
-> ReadPrec [PutInlinePolicyToPermissionSetResponse]
-> Read PutInlinePolicyToPermissionSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutInlinePolicyToPermissionSetResponse]
$creadListPrec :: ReadPrec [PutInlinePolicyToPermissionSetResponse]
readPrec :: ReadPrec PutInlinePolicyToPermissionSetResponse
$creadPrec :: ReadPrec PutInlinePolicyToPermissionSetResponse
readList :: ReadS [PutInlinePolicyToPermissionSetResponse]
$creadList :: ReadS [PutInlinePolicyToPermissionSetResponse]
readsPrec :: Int -> ReadS PutInlinePolicyToPermissionSetResponse
$creadsPrec :: Int -> ReadS PutInlinePolicyToPermissionSetResponse
Prelude.Read, Int -> PutInlinePolicyToPermissionSetResponse -> ShowS
[PutInlinePolicyToPermissionSetResponse] -> ShowS
PutInlinePolicyToPermissionSetResponse -> String
(Int -> PutInlinePolicyToPermissionSetResponse -> ShowS)
-> (PutInlinePolicyToPermissionSetResponse -> String)
-> ([PutInlinePolicyToPermissionSetResponse] -> ShowS)
-> Show PutInlinePolicyToPermissionSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutInlinePolicyToPermissionSetResponse] -> ShowS
$cshowList :: [PutInlinePolicyToPermissionSetResponse] -> ShowS
show :: PutInlinePolicyToPermissionSetResponse -> String
$cshow :: PutInlinePolicyToPermissionSetResponse -> String
showsPrec :: Int -> PutInlinePolicyToPermissionSetResponse -> ShowS
$cshowsPrec :: Int -> PutInlinePolicyToPermissionSetResponse -> ShowS
Prelude.Show, (forall x.
PutInlinePolicyToPermissionSetResponse
-> Rep PutInlinePolicyToPermissionSetResponse x)
-> (forall x.
Rep PutInlinePolicyToPermissionSetResponse x
-> PutInlinePolicyToPermissionSetResponse)
-> Generic PutInlinePolicyToPermissionSetResponse
forall x.
Rep PutInlinePolicyToPermissionSetResponse x
-> PutInlinePolicyToPermissionSetResponse
forall x.
PutInlinePolicyToPermissionSetResponse
-> Rep PutInlinePolicyToPermissionSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutInlinePolicyToPermissionSetResponse x
-> PutInlinePolicyToPermissionSetResponse
$cfrom :: forall x.
PutInlinePolicyToPermissionSetResponse
-> Rep PutInlinePolicyToPermissionSetResponse x
Prelude.Generic)
newPutInlinePolicyToPermissionSetResponse ::
Prelude.Int ->
PutInlinePolicyToPermissionSetResponse
newPutInlinePolicyToPermissionSetResponse :: Int -> PutInlinePolicyToPermissionSetResponse
newPutInlinePolicyToPermissionSetResponse
Int
pHttpStatus_ =
PutInlinePolicyToPermissionSetResponse' :: Int -> PutInlinePolicyToPermissionSetResponse
PutInlinePolicyToPermissionSetResponse'
{ $sel:httpStatus:PutInlinePolicyToPermissionSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putInlinePolicyToPermissionSetResponse_httpStatus :: Lens.Lens' PutInlinePolicyToPermissionSetResponse Prelude.Int
putInlinePolicyToPermissionSetResponse_httpStatus :: (Int -> f Int)
-> PutInlinePolicyToPermissionSetResponse
-> f PutInlinePolicyToPermissionSetResponse
putInlinePolicyToPermissionSetResponse_httpStatus = (PutInlinePolicyToPermissionSetResponse -> Int)
-> (PutInlinePolicyToPermissionSetResponse
-> Int -> PutInlinePolicyToPermissionSetResponse)
-> Lens
PutInlinePolicyToPermissionSetResponse
PutInlinePolicyToPermissionSetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutInlinePolicyToPermissionSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutInlinePolicyToPermissionSetResponse' :: PutInlinePolicyToPermissionSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutInlinePolicyToPermissionSetResponse
s@PutInlinePolicyToPermissionSetResponse' {} Int
a -> PutInlinePolicyToPermissionSetResponse
s {$sel:httpStatus:PutInlinePolicyToPermissionSetResponse' :: Int
httpStatus = Int
a} :: PutInlinePolicyToPermissionSetResponse)
instance
Prelude.NFData
PutInlinePolicyToPermissionSetResponse