{-# 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.DescribeReportJob
(
DescribeReportJob (..),
newDescribeReportJob,
describeReportJob_reportJobId,
DescribeReportJobResponse (..),
newDescribeReportJobResponse,
describeReportJobResponse_reportJob,
describeReportJobResponse_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 DescribeReportJob = DescribeReportJob'
{
DescribeReportJob -> Text
reportJobId :: Prelude.Text
}
deriving (DescribeReportJob -> DescribeReportJob -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportJob -> DescribeReportJob -> Bool
$c/= :: DescribeReportJob -> DescribeReportJob -> Bool
== :: DescribeReportJob -> DescribeReportJob -> Bool
$c== :: DescribeReportJob -> DescribeReportJob -> Bool
Prelude.Eq, ReadPrec [DescribeReportJob]
ReadPrec DescribeReportJob
Int -> ReadS DescribeReportJob
ReadS [DescribeReportJob]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportJob]
$creadListPrec :: ReadPrec [DescribeReportJob]
readPrec :: ReadPrec DescribeReportJob
$creadPrec :: ReadPrec DescribeReportJob
readList :: ReadS [DescribeReportJob]
$creadList :: ReadS [DescribeReportJob]
readsPrec :: Int -> ReadS DescribeReportJob
$creadsPrec :: Int -> ReadS DescribeReportJob
Prelude.Read, Int -> DescribeReportJob -> ShowS
[DescribeReportJob] -> ShowS
DescribeReportJob -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportJob] -> ShowS
$cshowList :: [DescribeReportJob] -> ShowS
show :: DescribeReportJob -> String
$cshow :: DescribeReportJob -> String
showsPrec :: Int -> DescribeReportJob -> ShowS
$cshowsPrec :: Int -> DescribeReportJob -> ShowS
Prelude.Show, forall x. Rep DescribeReportJob x -> DescribeReportJob
forall x. DescribeReportJob -> Rep DescribeReportJob x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReportJob x -> DescribeReportJob
$cfrom :: forall x. DescribeReportJob -> Rep DescribeReportJob x
Prelude.Generic)
newDescribeReportJob ::
Prelude.Text ->
DescribeReportJob
newDescribeReportJob :: Text -> DescribeReportJob
newDescribeReportJob Text
pReportJobId_ =
DescribeReportJob' {$sel:reportJobId:DescribeReportJob' :: Text
reportJobId = Text
pReportJobId_}
describeReportJob_reportJobId :: Lens.Lens' DescribeReportJob Prelude.Text
describeReportJob_reportJobId :: Lens' DescribeReportJob Text
describeReportJob_reportJobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportJob' {Text
reportJobId :: Text
$sel:reportJobId:DescribeReportJob' :: DescribeReportJob -> Text
reportJobId} -> Text
reportJobId) (\s :: DescribeReportJob
s@DescribeReportJob' {} Text
a -> DescribeReportJob
s {$sel:reportJobId:DescribeReportJob' :: Text
reportJobId = Text
a} :: DescribeReportJob)
instance Core.AWSRequest DescribeReportJob where
type
AWSResponse DescribeReportJob =
DescribeReportJobResponse
request :: (Service -> Service)
-> DescribeReportJob -> Request DescribeReportJob
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 DescribeReportJob
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReportJob)))
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 ReportJob -> Int -> DescribeReportJobResponse
DescribeReportJobResponse'
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
"ReportJob")
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 DescribeReportJob where
hashWithSalt :: Int -> DescribeReportJob -> Int
hashWithSalt Int
_salt DescribeReportJob' {Text
reportJobId :: Text
$sel:reportJobId:DescribeReportJob' :: DescribeReportJob -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
reportJobId
instance Prelude.NFData DescribeReportJob where
rnf :: DescribeReportJob -> ()
rnf DescribeReportJob' {Text
reportJobId :: Text
$sel:reportJobId:DescribeReportJob' :: DescribeReportJob -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
reportJobId
instance Data.ToHeaders DescribeReportJob where
toHeaders :: DescribeReportJob -> 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 DescribeReportJob where
toPath :: DescribeReportJob -> ByteString
toPath DescribeReportJob' {Text
reportJobId :: Text
$sel:reportJobId:DescribeReportJob' :: DescribeReportJob -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/audit/report-jobs/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
reportJobId]
instance Data.ToQuery DescribeReportJob where
toQuery :: DescribeReportJob -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DescribeReportJobResponse = DescribeReportJobResponse'
{
DescribeReportJobResponse -> Maybe ReportJob
reportJob :: Prelude.Maybe ReportJob,
DescribeReportJobResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReportJobResponse -> DescribeReportJobResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportJobResponse -> DescribeReportJobResponse -> Bool
$c/= :: DescribeReportJobResponse -> DescribeReportJobResponse -> Bool
== :: DescribeReportJobResponse -> DescribeReportJobResponse -> Bool
$c== :: DescribeReportJobResponse -> DescribeReportJobResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReportJobResponse]
ReadPrec DescribeReportJobResponse
Int -> ReadS DescribeReportJobResponse
ReadS [DescribeReportJobResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportJobResponse]
$creadListPrec :: ReadPrec [DescribeReportJobResponse]
readPrec :: ReadPrec DescribeReportJobResponse
$creadPrec :: ReadPrec DescribeReportJobResponse
readList :: ReadS [DescribeReportJobResponse]
$creadList :: ReadS [DescribeReportJobResponse]
readsPrec :: Int -> ReadS DescribeReportJobResponse
$creadsPrec :: Int -> ReadS DescribeReportJobResponse
Prelude.Read, Int -> DescribeReportJobResponse -> ShowS
[DescribeReportJobResponse] -> ShowS
DescribeReportJobResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportJobResponse] -> ShowS
$cshowList :: [DescribeReportJobResponse] -> ShowS
show :: DescribeReportJobResponse -> String
$cshow :: DescribeReportJobResponse -> String
showsPrec :: Int -> DescribeReportJobResponse -> ShowS
$cshowsPrec :: Int -> DescribeReportJobResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeReportJobResponse x -> DescribeReportJobResponse
forall x.
DescribeReportJobResponse -> Rep DescribeReportJobResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReportJobResponse x -> DescribeReportJobResponse
$cfrom :: forall x.
DescribeReportJobResponse -> Rep DescribeReportJobResponse x
Prelude.Generic)
newDescribeReportJobResponse ::
Prelude.Int ->
DescribeReportJobResponse
newDescribeReportJobResponse :: Int -> DescribeReportJobResponse
newDescribeReportJobResponse Int
pHttpStatus_ =
DescribeReportJobResponse'
{ $sel:reportJob:DescribeReportJobResponse' :: Maybe ReportJob
reportJob =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReportJobResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReportJobResponse_reportJob :: Lens.Lens' DescribeReportJobResponse (Prelude.Maybe ReportJob)
describeReportJobResponse_reportJob :: Lens' DescribeReportJobResponse (Maybe ReportJob)
describeReportJobResponse_reportJob = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportJobResponse' {Maybe ReportJob
reportJob :: Maybe ReportJob
$sel:reportJob:DescribeReportJobResponse' :: DescribeReportJobResponse -> Maybe ReportJob
reportJob} -> Maybe ReportJob
reportJob) (\s :: DescribeReportJobResponse
s@DescribeReportJobResponse' {} Maybe ReportJob
a -> DescribeReportJobResponse
s {$sel:reportJob:DescribeReportJobResponse' :: Maybe ReportJob
reportJob = Maybe ReportJob
a} :: DescribeReportJobResponse)
describeReportJobResponse_httpStatus :: Lens.Lens' DescribeReportJobResponse Prelude.Int
describeReportJobResponse_httpStatus :: Lens' DescribeReportJobResponse Int
describeReportJobResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportJobResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReportJobResponse' :: DescribeReportJobResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReportJobResponse
s@DescribeReportJobResponse' {} Int
a -> DescribeReportJobResponse
s {$sel:httpStatus:DescribeReportJobResponse' :: Int
httpStatus = Int
a} :: DescribeReportJobResponse)
instance Prelude.NFData DescribeReportJobResponse where
rnf :: DescribeReportJobResponse -> ()
rnf DescribeReportJobResponse' {Int
Maybe ReportJob
httpStatus :: Int
reportJob :: Maybe ReportJob
$sel:httpStatus:DescribeReportJobResponse' :: DescribeReportJobResponse -> Int
$sel:reportJob:DescribeReportJobResponse' :: DescribeReportJobResponse -> Maybe ReportJob
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReportJob
reportJob
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus