{-# 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.ResourceGroupsTagging.DescribeReportCreation
(
DescribeReportCreation (..),
newDescribeReportCreation,
DescribeReportCreationResponse (..),
newDescribeReportCreationResponse,
describeReportCreationResponse_status,
describeReportCreationResponse_s3Location,
describeReportCreationResponse_errorMessage,
describeReportCreationResponse_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 Amazonka.ResourceGroupsTagging.Types
import qualified Amazonka.Response as Response
data DescribeReportCreation = DescribeReportCreation'
{
}
deriving (DescribeReportCreation -> DescribeReportCreation -> Bool
(DescribeReportCreation -> DescribeReportCreation -> Bool)
-> (DescribeReportCreation -> DescribeReportCreation -> Bool)
-> Eq DescribeReportCreation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportCreation -> DescribeReportCreation -> Bool
$c/= :: DescribeReportCreation -> DescribeReportCreation -> Bool
== :: DescribeReportCreation -> DescribeReportCreation -> Bool
$c== :: DescribeReportCreation -> DescribeReportCreation -> Bool
Prelude.Eq, ReadPrec [DescribeReportCreation]
ReadPrec DescribeReportCreation
Int -> ReadS DescribeReportCreation
ReadS [DescribeReportCreation]
(Int -> ReadS DescribeReportCreation)
-> ReadS [DescribeReportCreation]
-> ReadPrec DescribeReportCreation
-> ReadPrec [DescribeReportCreation]
-> Read DescribeReportCreation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportCreation]
$creadListPrec :: ReadPrec [DescribeReportCreation]
readPrec :: ReadPrec DescribeReportCreation
$creadPrec :: ReadPrec DescribeReportCreation
readList :: ReadS [DescribeReportCreation]
$creadList :: ReadS [DescribeReportCreation]
readsPrec :: Int -> ReadS DescribeReportCreation
$creadsPrec :: Int -> ReadS DescribeReportCreation
Prelude.Read, Int -> DescribeReportCreation -> ShowS
[DescribeReportCreation] -> ShowS
DescribeReportCreation -> String
(Int -> DescribeReportCreation -> ShowS)
-> (DescribeReportCreation -> String)
-> ([DescribeReportCreation] -> ShowS)
-> Show DescribeReportCreation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportCreation] -> ShowS
$cshowList :: [DescribeReportCreation] -> ShowS
show :: DescribeReportCreation -> String
$cshow :: DescribeReportCreation -> String
showsPrec :: Int -> DescribeReportCreation -> ShowS
$cshowsPrec :: Int -> DescribeReportCreation -> ShowS
Prelude.Show, (forall x. DescribeReportCreation -> Rep DescribeReportCreation x)
-> (forall x.
Rep DescribeReportCreation x -> DescribeReportCreation)
-> Generic DescribeReportCreation
forall x. Rep DescribeReportCreation x -> DescribeReportCreation
forall x. DescribeReportCreation -> Rep DescribeReportCreation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeReportCreation x -> DescribeReportCreation
$cfrom :: forall x. DescribeReportCreation -> Rep DescribeReportCreation x
Prelude.Generic)
newDescribeReportCreation ::
DescribeReportCreation
newDescribeReportCreation :: DescribeReportCreation
newDescribeReportCreation = DescribeReportCreation
DescribeReportCreation'
instance Core.AWSRequest DescribeReportCreation where
type
AWSResponse DescribeReportCreation =
DescribeReportCreationResponse
request :: DescribeReportCreation -> Request DescribeReportCreation
request = Service -> DescribeReportCreation -> Request DescribeReportCreation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeReportCreation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReportCreation)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeReportCreation))
-> Logger
-> Service
-> Proxy DescribeReportCreation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeReportCreation)))
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 Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeReportCreationResponse
DescribeReportCreationResponse'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeReportCreationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> DescribeReportCreationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
Either
String
(Maybe Text -> Maybe Text -> Int -> DescribeReportCreationResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> DescribeReportCreationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"S3Location")
Either String (Maybe Text -> Int -> DescribeReportCreationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeReportCreationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ErrorMessage")
Either String (Int -> DescribeReportCreationResponse)
-> Either String Int
-> Either String DescribeReportCreationResponse
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 DescribeReportCreation
instance Prelude.NFData DescribeReportCreation
instance Core.ToHeaders DescribeReportCreation where
toHeaders :: DescribeReportCreation -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeReportCreation -> 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
"ResourceGroupsTaggingAPI_20170126.DescribeReportCreation" ::
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 DescribeReportCreation where
toJSON :: DescribeReportCreation -> Value
toJSON = Value -> DescribeReportCreation -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeReportCreation where
toPath :: DescribeReportCreation -> ByteString
toPath = ByteString -> DescribeReportCreation -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeReportCreation where
toQuery :: DescribeReportCreation -> QueryString
toQuery = QueryString -> DescribeReportCreation -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeReportCreationResponse = DescribeReportCreationResponse'
{
DescribeReportCreationResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
DescribeReportCreationResponse -> Maybe Text
s3Location :: Prelude.Maybe Prelude.Text,
DescribeReportCreationResponse -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
DescribeReportCreationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool
(DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool)
-> (DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool)
-> Eq DescribeReportCreationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool
$c/= :: DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool
== :: DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool
$c== :: DescribeReportCreationResponse
-> DescribeReportCreationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeReportCreationResponse]
ReadPrec DescribeReportCreationResponse
Int -> ReadS DescribeReportCreationResponse
ReadS [DescribeReportCreationResponse]
(Int -> ReadS DescribeReportCreationResponse)
-> ReadS [DescribeReportCreationResponse]
-> ReadPrec DescribeReportCreationResponse
-> ReadPrec [DescribeReportCreationResponse]
-> Read DescribeReportCreationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeReportCreationResponse]
$creadListPrec :: ReadPrec [DescribeReportCreationResponse]
readPrec :: ReadPrec DescribeReportCreationResponse
$creadPrec :: ReadPrec DescribeReportCreationResponse
readList :: ReadS [DescribeReportCreationResponse]
$creadList :: ReadS [DescribeReportCreationResponse]
readsPrec :: Int -> ReadS DescribeReportCreationResponse
$creadsPrec :: Int -> ReadS DescribeReportCreationResponse
Prelude.Read, Int -> DescribeReportCreationResponse -> ShowS
[DescribeReportCreationResponse] -> ShowS
DescribeReportCreationResponse -> String
(Int -> DescribeReportCreationResponse -> ShowS)
-> (DescribeReportCreationResponse -> String)
-> ([DescribeReportCreationResponse] -> ShowS)
-> Show DescribeReportCreationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeReportCreationResponse] -> ShowS
$cshowList :: [DescribeReportCreationResponse] -> ShowS
show :: DescribeReportCreationResponse -> String
$cshow :: DescribeReportCreationResponse -> String
showsPrec :: Int -> DescribeReportCreationResponse -> ShowS
$cshowsPrec :: Int -> DescribeReportCreationResponse -> ShowS
Prelude.Show, (forall x.
DescribeReportCreationResponse
-> Rep DescribeReportCreationResponse x)
-> (forall x.
Rep DescribeReportCreationResponse x
-> DescribeReportCreationResponse)
-> Generic DescribeReportCreationResponse
forall x.
Rep DescribeReportCreationResponse x
-> DescribeReportCreationResponse
forall x.
DescribeReportCreationResponse
-> Rep DescribeReportCreationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeReportCreationResponse x
-> DescribeReportCreationResponse
$cfrom :: forall x.
DescribeReportCreationResponse
-> Rep DescribeReportCreationResponse x
Prelude.Generic)
newDescribeReportCreationResponse ::
Prelude.Int ->
DescribeReportCreationResponse
newDescribeReportCreationResponse :: Int -> DescribeReportCreationResponse
newDescribeReportCreationResponse Int
pHttpStatus_ =
DescribeReportCreationResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> DescribeReportCreationResponse
DescribeReportCreationResponse'
{ $sel:status:DescribeReportCreationResponse' :: Maybe Text
status =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3Location:DescribeReportCreationResponse' :: Maybe Text
s3Location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:DescribeReportCreationResponse' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeReportCreationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeReportCreationResponse_status :: Lens.Lens' DescribeReportCreationResponse (Prelude.Maybe Prelude.Text)
describeReportCreationResponse_status :: (Maybe Text -> f (Maybe Text))
-> DescribeReportCreationResponse
-> f DescribeReportCreationResponse
describeReportCreationResponse_status = (DescribeReportCreationResponse -> Maybe Text)
-> (DescribeReportCreationResponse
-> Maybe Text -> DescribeReportCreationResponse)
-> Lens
DescribeReportCreationResponse
DescribeReportCreationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportCreationResponse' {Maybe Text
status :: Maybe Text
$sel:status:DescribeReportCreationResponse' :: DescribeReportCreationResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: DescribeReportCreationResponse
s@DescribeReportCreationResponse' {} Maybe Text
a -> DescribeReportCreationResponse
s {$sel:status:DescribeReportCreationResponse' :: Maybe Text
status = Maybe Text
a} :: DescribeReportCreationResponse)
describeReportCreationResponse_s3Location :: Lens.Lens' DescribeReportCreationResponse (Prelude.Maybe Prelude.Text)
describeReportCreationResponse_s3Location :: (Maybe Text -> f (Maybe Text))
-> DescribeReportCreationResponse
-> f DescribeReportCreationResponse
describeReportCreationResponse_s3Location = (DescribeReportCreationResponse -> Maybe Text)
-> (DescribeReportCreationResponse
-> Maybe Text -> DescribeReportCreationResponse)
-> Lens
DescribeReportCreationResponse
DescribeReportCreationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportCreationResponse' {Maybe Text
s3Location :: Maybe Text
$sel:s3Location:DescribeReportCreationResponse' :: DescribeReportCreationResponse -> Maybe Text
s3Location} -> Maybe Text
s3Location) (\s :: DescribeReportCreationResponse
s@DescribeReportCreationResponse' {} Maybe Text
a -> DescribeReportCreationResponse
s {$sel:s3Location:DescribeReportCreationResponse' :: Maybe Text
s3Location = Maybe Text
a} :: DescribeReportCreationResponse)
describeReportCreationResponse_errorMessage :: Lens.Lens' DescribeReportCreationResponse (Prelude.Maybe Prelude.Text)
describeReportCreationResponse_errorMessage :: (Maybe Text -> f (Maybe Text))
-> DescribeReportCreationResponse
-> f DescribeReportCreationResponse
describeReportCreationResponse_errorMessage = (DescribeReportCreationResponse -> Maybe Text)
-> (DescribeReportCreationResponse
-> Maybe Text -> DescribeReportCreationResponse)
-> Lens
DescribeReportCreationResponse
DescribeReportCreationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportCreationResponse' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:DescribeReportCreationResponse' :: DescribeReportCreationResponse -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: DescribeReportCreationResponse
s@DescribeReportCreationResponse' {} Maybe Text
a -> DescribeReportCreationResponse
s {$sel:errorMessage:DescribeReportCreationResponse' :: Maybe Text
errorMessage = Maybe Text
a} :: DescribeReportCreationResponse)
describeReportCreationResponse_httpStatus :: Lens.Lens' DescribeReportCreationResponse Prelude.Int
describeReportCreationResponse_httpStatus :: (Int -> f Int)
-> DescribeReportCreationResponse
-> f DescribeReportCreationResponse
describeReportCreationResponse_httpStatus = (DescribeReportCreationResponse -> Int)
-> (DescribeReportCreationResponse
-> Int -> DescribeReportCreationResponse)
-> Lens
DescribeReportCreationResponse
DescribeReportCreationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeReportCreationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeReportCreationResponse' :: DescribeReportCreationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeReportCreationResponse
s@DescribeReportCreationResponse' {} Int
a -> DescribeReportCreationResponse
s {$sel:httpStatus:DescribeReportCreationResponse' :: Int
httpStatus = Int
a} :: DescribeReportCreationResponse)
instance
Prelude.NFData
DescribeReportCreationResponse