{-# 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.Backup.DescribeReportPlan
(
DescribeReportPlan (..),
newDescribeReportPlan,
describeReportPlan_reportPlanName,
DescribeReportPlanResponse (..),
newDescribeReportPlanResponse,
describeReportPlanResponse_reportPlan,
describeReportPlanResponse_httpStatus,
)
where
import Amazonka.Backup.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeReportPlan = DescribeReportPlan'
{
DescribeReportPlan -> Text
reportPlanName :: Prelude.Text
}
deriving (DescribeReportPlan -> DescribeReportPlan -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportPlan -> DescribeReportPlan -> Bool
$c/= :: DescribeReportPlan -> DescribeReportPlan -> Bool
== :: DescribeReportPlan -> DescribeReportPlan -> Bool
$c== :: DescribeReportPlan -> DescribeReportPlan -> Bool
Prelude.Eq, ReadPrec [DescribeReportPlan]
ReadPrec DescribeReportPlan
Int -> ReadS DescribeReportPlan
ReadS [DescribeReportPlan]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportPlan]
$creadListPrec :: ReadPrec [DescribeReportPlan]
readPrec :: ReadPrec DescribeReportPlan
$creadPrec :: ReadPrec DescribeReportPlan
readList :: ReadS [DescribeReportPlan]
$creadList :: ReadS [DescribeReportPlan]
readsPrec :: Int -> ReadS DescribeReportPlan
$creadsPrec :: Int -> ReadS DescribeReportPlan
Prelude.Read, Int -> DescribeReportPlan -> ShowS
[DescribeReportPlan] -> ShowS
DescribeReportPlan -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportPlan] -> ShowS
$cshowList :: [DescribeReportPlan] -> ShowS
show :: DescribeReportPlan -> String
$cshow :: DescribeReportPlan -> String
showsPrec :: Int -> DescribeReportPlan -> ShowS
$cshowsPrec :: Int -> DescribeReportPlan -> ShowS
Prelude.Show, forall x. Rep DescribeReportPlan x -> DescribeReportPlan
forall x. DescribeReportPlan -> Rep DescribeReportPlan x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReportPlan x -> DescribeReportPlan
$cfrom :: forall x. DescribeReportPlan -> Rep DescribeReportPlan x
Prelude.Generic)
newDescribeReportPlan ::
Prelude.Text ->
DescribeReportPlan
newDescribeReportPlan :: Text -> DescribeReportPlan
newDescribeReportPlan Text
pReportPlanName_ =
DescribeReportPlan'
{ $sel:reportPlanName:DescribeReportPlan' :: Text
reportPlanName =
Text
pReportPlanName_
}
describeReportPlan_reportPlanName :: Lens.Lens' DescribeReportPlan Prelude.Text
describeReportPlan_reportPlanName :: Lens' DescribeReportPlan Text
describeReportPlan_reportPlanName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DescribeReportPlan' :: DescribeReportPlan -> Text
reportPlanName} -> Text
reportPlanName) (\s :: DescribeReportPlan
s@DescribeReportPlan' {} Text
a -> DescribeReportPlan
s {$sel:reportPlanName:DescribeReportPlan' :: Text
reportPlanName = Text
a} :: DescribeReportPlan)
instance Core.AWSRequest DescribeReportPlan where
type
AWSResponse DescribeReportPlan =
DescribeReportPlanResponse
request :: (Service -> Service)
-> DescribeReportPlan -> Request DescribeReportPlan
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeReportPlan
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReportPlan)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ReportPlan -> Int -> DescribeReportPlanResponse
DescribeReportPlanResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReportPlan")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DescribeReportPlan where
hashWithSalt :: Int -> DescribeReportPlan -> Int
hashWithSalt Int
_salt DescribeReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DescribeReportPlan' :: DescribeReportPlan -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportPlanName
instance Prelude.NFData DescribeReportPlan where
rnf :: DescribeReportPlan -> ()
rnf DescribeReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DescribeReportPlan' :: DescribeReportPlan -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
reportPlanName
instance Data.ToHeaders DescribeReportPlan where
toHeaders :: DescribeReportPlan -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DescribeReportPlan where
toPath :: DescribeReportPlan -> ByteString
toPath DescribeReportPlan' {Text
reportPlanName :: Text
$sel:reportPlanName:DescribeReportPlan' :: DescribeReportPlan -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/audit/report-plans/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
reportPlanName]
instance Data.ToQuery DescribeReportPlan where
toQuery :: DescribeReportPlan -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeReportPlanResponse = DescribeReportPlanResponse'
{
DescribeReportPlanResponse -> Maybe ReportPlan
reportPlan :: Prelude.Maybe ReportPlan,
DescribeReportPlanResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReportPlanResponse -> DescribeReportPlanResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportPlanResponse -> DescribeReportPlanResponse -> Bool
$c/= :: DescribeReportPlanResponse -> DescribeReportPlanResponse -> Bool
== :: DescribeReportPlanResponse -> DescribeReportPlanResponse -> Bool
$c== :: DescribeReportPlanResponse -> DescribeReportPlanResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReportPlanResponse]
ReadPrec DescribeReportPlanResponse
Int -> ReadS DescribeReportPlanResponse
ReadS [DescribeReportPlanResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportPlanResponse]
$creadListPrec :: ReadPrec [DescribeReportPlanResponse]
readPrec :: ReadPrec DescribeReportPlanResponse
$creadPrec :: ReadPrec DescribeReportPlanResponse
readList :: ReadS [DescribeReportPlanResponse]
$creadList :: ReadS [DescribeReportPlanResponse]
readsPrec :: Int -> ReadS DescribeReportPlanResponse
$creadsPrec :: Int -> ReadS DescribeReportPlanResponse
Prelude.Read, Int -> DescribeReportPlanResponse -> ShowS
[DescribeReportPlanResponse] -> ShowS
DescribeReportPlanResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportPlanResponse] -> ShowS
$cshowList :: [DescribeReportPlanResponse] -> ShowS
show :: DescribeReportPlanResponse -> String
$cshow :: DescribeReportPlanResponse -> String
showsPrec :: Int -> DescribeReportPlanResponse -> ShowS
$cshowsPrec :: Int -> DescribeReportPlanResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeReportPlanResponse x -> DescribeReportPlanResponse
forall x.
DescribeReportPlanResponse -> Rep DescribeReportPlanResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReportPlanResponse x -> DescribeReportPlanResponse
$cfrom :: forall x.
DescribeReportPlanResponse -> Rep DescribeReportPlanResponse x
Prelude.Generic)
newDescribeReportPlanResponse ::
Prelude.Int ->
DescribeReportPlanResponse
newDescribeReportPlanResponse :: Int -> DescribeReportPlanResponse
newDescribeReportPlanResponse Int
pHttpStatus_ =
DescribeReportPlanResponse'
{ $sel:reportPlan:DescribeReportPlanResponse' :: Maybe ReportPlan
reportPlan =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReportPlanResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReportPlanResponse_reportPlan :: Lens.Lens' DescribeReportPlanResponse (Prelude.Maybe ReportPlan)
describeReportPlanResponse_reportPlan :: Lens' DescribeReportPlanResponse (Maybe ReportPlan)
describeReportPlanResponse_reportPlan = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportPlanResponse' {Maybe ReportPlan
reportPlan :: Maybe ReportPlan
$sel:reportPlan:DescribeReportPlanResponse' :: DescribeReportPlanResponse -> Maybe ReportPlan
reportPlan} -> Maybe ReportPlan
reportPlan) (\s :: DescribeReportPlanResponse
s@DescribeReportPlanResponse' {} Maybe ReportPlan
a -> DescribeReportPlanResponse
s {$sel:reportPlan:DescribeReportPlanResponse' :: Maybe ReportPlan
reportPlan = Maybe ReportPlan
a} :: DescribeReportPlanResponse)
describeReportPlanResponse_httpStatus :: Lens.Lens' DescribeReportPlanResponse Prelude.Int
describeReportPlanResponse_httpStatus :: Lens' DescribeReportPlanResponse Int
describeReportPlanResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportPlanResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReportPlanResponse' :: DescribeReportPlanResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReportPlanResponse
s@DescribeReportPlanResponse' {} Int
a -> DescribeReportPlanResponse
s {$sel:httpStatus:DescribeReportPlanResponse' :: Int
httpStatus = Int
a} :: DescribeReportPlanResponse)
instance Prelude.NFData DescribeReportPlanResponse where
rnf :: DescribeReportPlanResponse -> ()
rnf DescribeReportPlanResponse' {Int
Maybe ReportPlan
httpStatus :: Int
reportPlan :: Maybe ReportPlan
$sel:httpStatus:DescribeReportPlanResponse' :: DescribeReportPlanResponse -> Int
$sel:reportPlan:DescribeReportPlanResponse' :: DescribeReportPlanResponse -> Maybe ReportPlan
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportPlan
reportPlan
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus