{-# 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.DescribeBackupPolicy
(
DescribeBackupPolicy (..),
newDescribeBackupPolicy,
describeBackupPolicy_fileSystemId,
BackupPolicyDescription (..),
newBackupPolicyDescription,
backupPolicyDescription_backupPolicy,
)
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 DescribeBackupPolicy = DescribeBackupPolicy'
{
DescribeBackupPolicy -> Text
fileSystemId :: Prelude.Text
}
deriving (DescribeBackupPolicy -> DescribeBackupPolicy -> Bool
(DescribeBackupPolicy -> DescribeBackupPolicy -> Bool)
-> (DescribeBackupPolicy -> DescribeBackupPolicy -> Bool)
-> Eq DescribeBackupPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBackupPolicy -> DescribeBackupPolicy -> Bool
$c/= :: DescribeBackupPolicy -> DescribeBackupPolicy -> Bool
== :: DescribeBackupPolicy -> DescribeBackupPolicy -> Bool
$c== :: DescribeBackupPolicy -> DescribeBackupPolicy -> Bool
Prelude.Eq, ReadPrec [DescribeBackupPolicy]
ReadPrec DescribeBackupPolicy
Int -> ReadS DescribeBackupPolicy
ReadS [DescribeBackupPolicy]
(Int -> ReadS DescribeBackupPolicy)
-> ReadS [DescribeBackupPolicy]
-> ReadPrec DescribeBackupPolicy
-> ReadPrec [DescribeBackupPolicy]
-> Read DescribeBackupPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBackupPolicy]
$creadListPrec :: ReadPrec [DescribeBackupPolicy]
readPrec :: ReadPrec DescribeBackupPolicy
$creadPrec :: ReadPrec DescribeBackupPolicy
readList :: ReadS [DescribeBackupPolicy]
$creadList :: ReadS [DescribeBackupPolicy]
readsPrec :: Int -> ReadS DescribeBackupPolicy
$creadsPrec :: Int -> ReadS DescribeBackupPolicy
Prelude.Read, Int -> DescribeBackupPolicy -> ShowS
[DescribeBackupPolicy] -> ShowS
DescribeBackupPolicy -> String
(Int -> DescribeBackupPolicy -> ShowS)
-> (DescribeBackupPolicy -> String)
-> ([DescribeBackupPolicy] -> ShowS)
-> Show DescribeBackupPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBackupPolicy] -> ShowS
$cshowList :: [DescribeBackupPolicy] -> ShowS
show :: DescribeBackupPolicy -> String
$cshow :: DescribeBackupPolicy -> String
showsPrec :: Int -> DescribeBackupPolicy -> ShowS
$cshowsPrec :: Int -> DescribeBackupPolicy -> ShowS
Prelude.Show, (forall x. DescribeBackupPolicy -> Rep DescribeBackupPolicy x)
-> (forall x. Rep DescribeBackupPolicy x -> DescribeBackupPolicy)
-> Generic DescribeBackupPolicy
forall x. Rep DescribeBackupPolicy x -> DescribeBackupPolicy
forall x. DescribeBackupPolicy -> Rep DescribeBackupPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBackupPolicy x -> DescribeBackupPolicy
$cfrom :: forall x. DescribeBackupPolicy -> Rep DescribeBackupPolicy x
Prelude.Generic)
newDescribeBackupPolicy ::
Prelude.Text ->
DescribeBackupPolicy
newDescribeBackupPolicy :: Text -> DescribeBackupPolicy
newDescribeBackupPolicy Text
pFileSystemId_ =
DescribeBackupPolicy' :: Text -> DescribeBackupPolicy
DescribeBackupPolicy'
{ $sel:fileSystemId:DescribeBackupPolicy' :: Text
fileSystemId =
Text
pFileSystemId_
}
describeBackupPolicy_fileSystemId :: Lens.Lens' DescribeBackupPolicy Prelude.Text
describeBackupPolicy_fileSystemId :: (Text -> f Text) -> DescribeBackupPolicy -> f DescribeBackupPolicy
describeBackupPolicy_fileSystemId = (DescribeBackupPolicy -> Text)
-> (DescribeBackupPolicy -> Text -> DescribeBackupPolicy)
-> Lens DescribeBackupPolicy DescribeBackupPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBackupPolicy' {Text
fileSystemId :: Text
$sel:fileSystemId:DescribeBackupPolicy' :: DescribeBackupPolicy -> Text
fileSystemId} -> Text
fileSystemId) (\s :: DescribeBackupPolicy
s@DescribeBackupPolicy' {} Text
a -> DescribeBackupPolicy
s {$sel:fileSystemId:DescribeBackupPolicy' :: Text
fileSystemId = Text
a} :: DescribeBackupPolicy)
instance Core.AWSRequest DescribeBackupPolicy where
type
AWSResponse DescribeBackupPolicy =
BackupPolicyDescription
request :: DescribeBackupPolicy -> Request DescribeBackupPolicy
request = Service -> DescribeBackupPolicy -> Request DescribeBackupPolicy
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeBackupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeBackupPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeBackupPolicy))
-> Logger
-> Service
-> Proxy DescribeBackupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeBackupPolicy)))
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 BackupPolicyDescription
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable DescribeBackupPolicy
instance Prelude.NFData DescribeBackupPolicy
instance Core.ToHeaders DescribeBackupPolicy where
toHeaders :: DescribeBackupPolicy -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeBackupPolicy -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DescribeBackupPolicy where
toPath :: DescribeBackupPolicy -> ByteString
toPath DescribeBackupPolicy' {Text
fileSystemId :: Text
$sel:fileSystemId:DescribeBackupPolicy' :: DescribeBackupPolicy -> 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
"/backup-policy"
]
instance Core.ToQuery DescribeBackupPolicy where
toQuery :: DescribeBackupPolicy -> QueryString
toQuery = QueryString -> DescribeBackupPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty