{-# 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.EFS.DescribeFileSystemPolicy
(
DescribeFileSystemPolicy (..),
newDescribeFileSystemPolicy,
describeFileSystemPolicy_fileSystemId,
FileSystemPolicyDescription (..),
newFileSystemPolicyDescription,
fileSystemPolicyDescription_fileSystemId,
fileSystemPolicyDescription_policy,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EFS.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 DescribeFileSystemPolicy = DescribeFileSystemPolicy'
{
DescribeFileSystemPolicy -> Text
fileSystemId :: Prelude.Text
}
deriving (DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool
(DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool)
-> (DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool)
-> Eq DescribeFileSystemPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool
$c/= :: DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool
== :: DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool
$c== :: DescribeFileSystemPolicy -> DescribeFileSystemPolicy -> Bool
Prelude.Eq, ReadPrec [DescribeFileSystemPolicy]
ReadPrec DescribeFileSystemPolicy
Int -> ReadS DescribeFileSystemPolicy
ReadS [DescribeFileSystemPolicy]
(Int -> ReadS DescribeFileSystemPolicy)
-> ReadS [DescribeFileSystemPolicy]
-> ReadPrec DescribeFileSystemPolicy
-> ReadPrec [DescribeFileSystemPolicy]
-> Read DescribeFileSystemPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFileSystemPolicy]
$creadListPrec :: ReadPrec [DescribeFileSystemPolicy]
readPrec :: ReadPrec DescribeFileSystemPolicy
$creadPrec :: ReadPrec DescribeFileSystemPolicy
readList :: ReadS [DescribeFileSystemPolicy]
$creadList :: ReadS [DescribeFileSystemPolicy]
readsPrec :: Int -> ReadS DescribeFileSystemPolicy
$creadsPrec :: Int -> ReadS DescribeFileSystemPolicy
Prelude.Read, Int -> DescribeFileSystemPolicy -> ShowS
[DescribeFileSystemPolicy] -> ShowS
DescribeFileSystemPolicy -> String
(Int -> DescribeFileSystemPolicy -> ShowS)
-> (DescribeFileSystemPolicy -> String)
-> ([DescribeFileSystemPolicy] -> ShowS)
-> Show DescribeFileSystemPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFileSystemPolicy] -> ShowS
$cshowList :: [DescribeFileSystemPolicy] -> ShowS
show :: DescribeFileSystemPolicy -> String
$cshow :: DescribeFileSystemPolicy -> String
showsPrec :: Int -> DescribeFileSystemPolicy -> ShowS
$cshowsPrec :: Int -> DescribeFileSystemPolicy -> ShowS
Prelude.Show, (forall x.
DescribeFileSystemPolicy -> Rep DescribeFileSystemPolicy x)
-> (forall x.
Rep DescribeFileSystemPolicy x -> DescribeFileSystemPolicy)
-> Generic DescribeFileSystemPolicy
forall x.
Rep DescribeFileSystemPolicy x -> DescribeFileSystemPolicy
forall x.
DescribeFileSystemPolicy -> Rep DescribeFileSystemPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFileSystemPolicy x -> DescribeFileSystemPolicy
$cfrom :: forall x.
DescribeFileSystemPolicy -> Rep DescribeFileSystemPolicy x
Prelude.Generic)
newDescribeFileSystemPolicy ::
Prelude.Text ->
DescribeFileSystemPolicy
newDescribeFileSystemPolicy :: Text -> DescribeFileSystemPolicy
newDescribeFileSystemPolicy Text
pFileSystemId_ =
DescribeFileSystemPolicy' :: Text -> DescribeFileSystemPolicy
DescribeFileSystemPolicy'
{ $sel:fileSystemId:DescribeFileSystemPolicy' :: Text
fileSystemId =
Text
pFileSystemId_
}
describeFileSystemPolicy_fileSystemId :: Lens.Lens' DescribeFileSystemPolicy Prelude.Text
describeFileSystemPolicy_fileSystemId :: (Text -> f Text)
-> DescribeFileSystemPolicy -> f DescribeFileSystemPolicy
describeFileSystemPolicy_fileSystemId = (DescribeFileSystemPolicy -> Text)
-> (DescribeFileSystemPolicy -> Text -> DescribeFileSystemPolicy)
-> Lens DescribeFileSystemPolicy DescribeFileSystemPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFileSystemPolicy' {Text
fileSystemId :: Text
$sel:fileSystemId:DescribeFileSystemPolicy' :: DescribeFileSystemPolicy -> Text
fileSystemId} -> Text
fileSystemId) (\s :: DescribeFileSystemPolicy
s@DescribeFileSystemPolicy' {} Text
a -> DescribeFileSystemPolicy
s {$sel:fileSystemId:DescribeFileSystemPolicy' :: Text
fileSystemId = Text
a} :: DescribeFileSystemPolicy)
instance Core.AWSRequest DescribeFileSystemPolicy where
type
AWSResponse DescribeFileSystemPolicy =
FileSystemPolicyDescription
request :: DescribeFileSystemPolicy -> Request DescribeFileSystemPolicy
request = Service
-> DescribeFileSystemPolicy -> Request DescribeFileSystemPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFileSystemPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFileSystemPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFileSystemPolicy))
-> Logger
-> Service
-> Proxy DescribeFileSystemPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeFileSystemPolicy)))
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 -> Object -> Either String FileSystemPolicyDescription
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable DescribeFileSystemPolicy
instance Prelude.NFData DescribeFileSystemPolicy
instance Core.ToHeaders DescribeFileSystemPolicy where
toHeaders :: DescribeFileSystemPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeFileSystemPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeFileSystemPolicy where
toPath :: DescribeFileSystemPolicy -> ByteString
toPath DescribeFileSystemPolicy' {Text
fileSystemId :: Text
$sel:fileSystemId:DescribeFileSystemPolicy' :: DescribeFileSystemPolicy -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2015-02-01/file-systems/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
fileSystemId,
ByteString
"/policy"
]
instance Core.ToQuery DescribeFileSystemPolicy where
toQuery :: DescribeFileSystemPolicy -> QueryString
toQuery = QueryString -> DescribeFileSystemPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty