{-# 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.GetInlinePolicyForPermissionSet
(
GetInlinePolicyForPermissionSet (..),
newGetInlinePolicyForPermissionSet,
getInlinePolicyForPermissionSet_instanceArn,
getInlinePolicyForPermissionSet_permissionSetArn,
GetInlinePolicyForPermissionSetResponse (..),
newGetInlinePolicyForPermissionSetResponse,
getInlinePolicyForPermissionSetResponse_inlinePolicy,
getInlinePolicyForPermissionSetResponse_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 GetInlinePolicyForPermissionSet = GetInlinePolicyForPermissionSet'
{
GetInlinePolicyForPermissionSet -> Text
instanceArn :: Prelude.Text,
GetInlinePolicyForPermissionSet -> Text
permissionSetArn :: Prelude.Text
}
deriving (GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool
(GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool)
-> (GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool)
-> Eq GetInlinePolicyForPermissionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool
$c/= :: GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool
== :: GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool
$c== :: GetInlinePolicyForPermissionSet
-> GetInlinePolicyForPermissionSet -> Bool
Prelude.Eq, ReadPrec [GetInlinePolicyForPermissionSet]
ReadPrec GetInlinePolicyForPermissionSet
Int -> ReadS GetInlinePolicyForPermissionSet
ReadS [GetInlinePolicyForPermissionSet]
(Int -> ReadS GetInlinePolicyForPermissionSet)
-> ReadS [GetInlinePolicyForPermissionSet]
-> ReadPrec GetInlinePolicyForPermissionSet
-> ReadPrec [GetInlinePolicyForPermissionSet]
-> Read GetInlinePolicyForPermissionSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInlinePolicyForPermissionSet]
$creadListPrec :: ReadPrec [GetInlinePolicyForPermissionSet]
readPrec :: ReadPrec GetInlinePolicyForPermissionSet
$creadPrec :: ReadPrec GetInlinePolicyForPermissionSet
readList :: ReadS [GetInlinePolicyForPermissionSet]
$creadList :: ReadS [GetInlinePolicyForPermissionSet]
readsPrec :: Int -> ReadS GetInlinePolicyForPermissionSet
$creadsPrec :: Int -> ReadS GetInlinePolicyForPermissionSet
Prelude.Read, Int -> GetInlinePolicyForPermissionSet -> ShowS
[GetInlinePolicyForPermissionSet] -> ShowS
GetInlinePolicyForPermissionSet -> String
(Int -> GetInlinePolicyForPermissionSet -> ShowS)
-> (GetInlinePolicyForPermissionSet -> String)
-> ([GetInlinePolicyForPermissionSet] -> ShowS)
-> Show GetInlinePolicyForPermissionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInlinePolicyForPermissionSet] -> ShowS
$cshowList :: [GetInlinePolicyForPermissionSet] -> ShowS
show :: GetInlinePolicyForPermissionSet -> String
$cshow :: GetInlinePolicyForPermissionSet -> String
showsPrec :: Int -> GetInlinePolicyForPermissionSet -> ShowS
$cshowsPrec :: Int -> GetInlinePolicyForPermissionSet -> ShowS
Prelude.Show, (forall x.
GetInlinePolicyForPermissionSet
-> Rep GetInlinePolicyForPermissionSet x)
-> (forall x.
Rep GetInlinePolicyForPermissionSet x
-> GetInlinePolicyForPermissionSet)
-> Generic GetInlinePolicyForPermissionSet
forall x.
Rep GetInlinePolicyForPermissionSet x
-> GetInlinePolicyForPermissionSet
forall x.
GetInlinePolicyForPermissionSet
-> Rep GetInlinePolicyForPermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInlinePolicyForPermissionSet x
-> GetInlinePolicyForPermissionSet
$cfrom :: forall x.
GetInlinePolicyForPermissionSet
-> Rep GetInlinePolicyForPermissionSet x
Prelude.Generic)
newGetInlinePolicyForPermissionSet ::
Prelude.Text ->
Prelude.Text ->
GetInlinePolicyForPermissionSet
newGetInlinePolicyForPermissionSet :: Text -> Text -> GetInlinePolicyForPermissionSet
newGetInlinePolicyForPermissionSet
Text
pInstanceArn_
Text
pPermissionSetArn_ =
GetInlinePolicyForPermissionSet' :: Text -> Text -> GetInlinePolicyForPermissionSet
GetInlinePolicyForPermissionSet'
{ $sel:instanceArn:GetInlinePolicyForPermissionSet' :: Text
instanceArn =
Text
pInstanceArn_,
$sel:permissionSetArn:GetInlinePolicyForPermissionSet' :: Text
permissionSetArn = Text
pPermissionSetArn_
}
getInlinePolicyForPermissionSet_instanceArn :: Lens.Lens' GetInlinePolicyForPermissionSet Prelude.Text
getInlinePolicyForPermissionSet_instanceArn :: (Text -> f Text)
-> GetInlinePolicyForPermissionSet
-> f GetInlinePolicyForPermissionSet
getInlinePolicyForPermissionSet_instanceArn = (GetInlinePolicyForPermissionSet -> Text)
-> (GetInlinePolicyForPermissionSet
-> Text -> GetInlinePolicyForPermissionSet)
-> Lens
GetInlinePolicyForPermissionSet
GetInlinePolicyForPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInlinePolicyForPermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:GetInlinePolicyForPermissionSet' :: GetInlinePolicyForPermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: GetInlinePolicyForPermissionSet
s@GetInlinePolicyForPermissionSet' {} Text
a -> GetInlinePolicyForPermissionSet
s {$sel:instanceArn:GetInlinePolicyForPermissionSet' :: Text
instanceArn = Text
a} :: GetInlinePolicyForPermissionSet)
getInlinePolicyForPermissionSet_permissionSetArn :: Lens.Lens' GetInlinePolicyForPermissionSet Prelude.Text
getInlinePolicyForPermissionSet_permissionSetArn :: (Text -> f Text)
-> GetInlinePolicyForPermissionSet
-> f GetInlinePolicyForPermissionSet
getInlinePolicyForPermissionSet_permissionSetArn = (GetInlinePolicyForPermissionSet -> Text)
-> (GetInlinePolicyForPermissionSet
-> Text -> GetInlinePolicyForPermissionSet)
-> Lens
GetInlinePolicyForPermissionSet
GetInlinePolicyForPermissionSet
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInlinePolicyForPermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:GetInlinePolicyForPermissionSet' :: GetInlinePolicyForPermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: GetInlinePolicyForPermissionSet
s@GetInlinePolicyForPermissionSet' {} Text
a -> GetInlinePolicyForPermissionSet
s {$sel:permissionSetArn:GetInlinePolicyForPermissionSet' :: Text
permissionSetArn = Text
a} :: GetInlinePolicyForPermissionSet)
instance
Core.AWSRequest
GetInlinePolicyForPermissionSet
where
type
AWSResponse GetInlinePolicyForPermissionSet =
GetInlinePolicyForPermissionSetResponse
request :: GetInlinePolicyForPermissionSet
-> Request GetInlinePolicyForPermissionSet
request = Service
-> GetInlinePolicyForPermissionSet
-> Request GetInlinePolicyForPermissionSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetInlinePolicyForPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetInlinePolicyForPermissionSet)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetInlinePolicyForPermissionSet))
-> Logger
-> Service
-> Proxy GetInlinePolicyForPermissionSet
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetInlinePolicyForPermissionSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe (Sensitive Text)
-> Int -> GetInlinePolicyForPermissionSetResponse
GetInlinePolicyForPermissionSetResponse'
(Maybe (Sensitive Text)
-> Int -> GetInlinePolicyForPermissionSetResponse)
-> Either String (Maybe (Sensitive Text))
-> Either String (Int -> GetInlinePolicyForPermissionSetResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InlinePolicy")
Either String (Int -> GetInlinePolicyForPermissionSetResponse)
-> Either String Int
-> Either String GetInlinePolicyForPermissionSetResponse
forall (f :: * -> *) a b. Applicative f => 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
GetInlinePolicyForPermissionSet
instance
Prelude.NFData
GetInlinePolicyForPermissionSet
instance
Core.ToHeaders
GetInlinePolicyForPermissionSet
where
toHeaders :: GetInlinePolicyForPermissionSet -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetInlinePolicyForPermissionSet -> 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.GetInlinePolicyForPermissionSet" ::
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 GetInlinePolicyForPermissionSet where
toJSON :: GetInlinePolicyForPermissionSet -> Value
toJSON GetInlinePolicyForPermissionSet' {Text
permissionSetArn :: Text
instanceArn :: Text
$sel:permissionSetArn:GetInlinePolicyForPermissionSet' :: GetInlinePolicyForPermissionSet -> Text
$sel:instanceArn:GetInlinePolicyForPermissionSet' :: GetInlinePolicyForPermissionSet -> 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)
]
)
instance Core.ToPath GetInlinePolicyForPermissionSet where
toPath :: GetInlinePolicyForPermissionSet -> ByteString
toPath = ByteString -> GetInlinePolicyForPermissionSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetInlinePolicyForPermissionSet where
toQuery :: GetInlinePolicyForPermissionSet -> QueryString
toQuery = QueryString -> GetInlinePolicyForPermissionSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetInlinePolicyForPermissionSetResponse = GetInlinePolicyForPermissionSetResponse'
{
GetInlinePolicyForPermissionSetResponse -> Maybe (Sensitive Text)
inlinePolicy :: Prelude.Maybe (Core.Sensitive Prelude.Text),
GetInlinePolicyForPermissionSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool
(GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool)
-> (GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool)
-> Eq GetInlinePolicyForPermissionSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool
$c/= :: GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool
== :: GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool
$c== :: GetInlinePolicyForPermissionSetResponse
-> GetInlinePolicyForPermissionSetResponse -> Bool
Prelude.Eq, Int -> GetInlinePolicyForPermissionSetResponse -> ShowS
[GetInlinePolicyForPermissionSetResponse] -> ShowS
GetInlinePolicyForPermissionSetResponse -> String
(Int -> GetInlinePolicyForPermissionSetResponse -> ShowS)
-> (GetInlinePolicyForPermissionSetResponse -> String)
-> ([GetInlinePolicyForPermissionSetResponse] -> ShowS)
-> Show GetInlinePolicyForPermissionSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInlinePolicyForPermissionSetResponse] -> ShowS
$cshowList :: [GetInlinePolicyForPermissionSetResponse] -> ShowS
show :: GetInlinePolicyForPermissionSetResponse -> String
$cshow :: GetInlinePolicyForPermissionSetResponse -> String
showsPrec :: Int -> GetInlinePolicyForPermissionSetResponse -> ShowS
$cshowsPrec :: Int -> GetInlinePolicyForPermissionSetResponse -> ShowS
Prelude.Show, (forall x.
GetInlinePolicyForPermissionSetResponse
-> Rep GetInlinePolicyForPermissionSetResponse x)
-> (forall x.
Rep GetInlinePolicyForPermissionSetResponse x
-> GetInlinePolicyForPermissionSetResponse)
-> Generic GetInlinePolicyForPermissionSetResponse
forall x.
Rep GetInlinePolicyForPermissionSetResponse x
-> GetInlinePolicyForPermissionSetResponse
forall x.
GetInlinePolicyForPermissionSetResponse
-> Rep GetInlinePolicyForPermissionSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInlinePolicyForPermissionSetResponse x
-> GetInlinePolicyForPermissionSetResponse
$cfrom :: forall x.
GetInlinePolicyForPermissionSetResponse
-> Rep GetInlinePolicyForPermissionSetResponse x
Prelude.Generic)
newGetInlinePolicyForPermissionSetResponse ::
Prelude.Int ->
GetInlinePolicyForPermissionSetResponse
newGetInlinePolicyForPermissionSetResponse :: Int -> GetInlinePolicyForPermissionSetResponse
newGetInlinePolicyForPermissionSetResponse
Int
pHttpStatus_ =
GetInlinePolicyForPermissionSetResponse' :: Maybe (Sensitive Text)
-> Int -> GetInlinePolicyForPermissionSetResponse
GetInlinePolicyForPermissionSetResponse'
{ $sel:inlinePolicy:GetInlinePolicyForPermissionSetResponse' :: Maybe (Sensitive Text)
inlinePolicy =
Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetInlinePolicyForPermissionSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getInlinePolicyForPermissionSetResponse_inlinePolicy :: Lens.Lens' GetInlinePolicyForPermissionSetResponse (Prelude.Maybe Prelude.Text)
getInlinePolicyForPermissionSetResponse_inlinePolicy :: (Maybe Text -> f (Maybe Text))
-> GetInlinePolicyForPermissionSetResponse
-> f GetInlinePolicyForPermissionSetResponse
getInlinePolicyForPermissionSetResponse_inlinePolicy = (GetInlinePolicyForPermissionSetResponse -> Maybe (Sensitive Text))
-> (GetInlinePolicyForPermissionSetResponse
-> Maybe (Sensitive Text)
-> GetInlinePolicyForPermissionSetResponse)
-> Lens
GetInlinePolicyForPermissionSetResponse
GetInlinePolicyForPermissionSetResponse
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInlinePolicyForPermissionSetResponse' {Maybe (Sensitive Text)
inlinePolicy :: Maybe (Sensitive Text)
$sel:inlinePolicy:GetInlinePolicyForPermissionSetResponse' :: GetInlinePolicyForPermissionSetResponse -> Maybe (Sensitive Text)
inlinePolicy} -> Maybe (Sensitive Text)
inlinePolicy) (\s :: GetInlinePolicyForPermissionSetResponse
s@GetInlinePolicyForPermissionSetResponse' {} Maybe (Sensitive Text)
a -> GetInlinePolicyForPermissionSetResponse
s {$sel:inlinePolicy:GetInlinePolicyForPermissionSetResponse' :: Maybe (Sensitive Text)
inlinePolicy = Maybe (Sensitive Text)
a} :: GetInlinePolicyForPermissionSetResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> GetInlinePolicyForPermissionSetResponse
-> f GetInlinePolicyForPermissionSetResponse)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> GetInlinePolicyForPermissionSetResponse
-> f GetInlinePolicyForPermissionSetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
getInlinePolicyForPermissionSetResponse_httpStatus :: Lens.Lens' GetInlinePolicyForPermissionSetResponse Prelude.Int
getInlinePolicyForPermissionSetResponse_httpStatus :: (Int -> f Int)
-> GetInlinePolicyForPermissionSetResponse
-> f GetInlinePolicyForPermissionSetResponse
getInlinePolicyForPermissionSetResponse_httpStatus = (GetInlinePolicyForPermissionSetResponse -> Int)
-> (GetInlinePolicyForPermissionSetResponse
-> Int -> GetInlinePolicyForPermissionSetResponse)
-> Lens
GetInlinePolicyForPermissionSetResponse
GetInlinePolicyForPermissionSetResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInlinePolicyForPermissionSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetInlinePolicyForPermissionSetResponse' :: GetInlinePolicyForPermissionSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetInlinePolicyForPermissionSetResponse
s@GetInlinePolicyForPermissionSetResponse' {} Int
a -> GetInlinePolicyForPermissionSetResponse
s {$sel:httpStatus:GetInlinePolicyForPermissionSetResponse' :: Int
httpStatus = Int
a} :: GetInlinePolicyForPermissionSetResponse)
instance
Prelude.NFData
GetInlinePolicyForPermissionSetResponse