{-# 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.StartReportCreation
(
StartReportCreation (..),
newStartReportCreation,
startReportCreation_s3Bucket,
StartReportCreationResponse (..),
newStartReportCreationResponse,
startReportCreationResponse_httpStatus,
)
where
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 Amazonka.ResourceGroupsTagging.Types
import qualified Amazonka.Response as Response
data StartReportCreation = StartReportCreation'
{
StartReportCreation -> Text
s3Bucket :: Prelude.Text
}
deriving (StartReportCreation -> StartReportCreation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartReportCreation -> StartReportCreation -> Bool
$c/= :: StartReportCreation -> StartReportCreation -> Bool
== :: StartReportCreation -> StartReportCreation -> Bool
$c== :: StartReportCreation -> StartReportCreation -> Bool
Prelude.Eq, ReadPrec [StartReportCreation]
ReadPrec StartReportCreation
Int -> ReadS StartReportCreation
ReadS [StartReportCreation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartReportCreation]
$creadListPrec :: ReadPrec [StartReportCreation]
readPrec :: ReadPrec StartReportCreation
$creadPrec :: ReadPrec StartReportCreation
readList :: ReadS [StartReportCreation]
$creadList :: ReadS [StartReportCreation]
readsPrec :: Int -> ReadS StartReportCreation
$creadsPrec :: Int -> ReadS StartReportCreation
Prelude.Read, Int -> StartReportCreation -> ShowS
[StartReportCreation] -> ShowS
StartReportCreation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartReportCreation] -> ShowS
$cshowList :: [StartReportCreation] -> ShowS
show :: StartReportCreation -> String
$cshow :: StartReportCreation -> String
showsPrec :: Int -> StartReportCreation -> ShowS
$cshowsPrec :: Int -> StartReportCreation -> ShowS
Prelude.Show, forall x. Rep StartReportCreation x -> StartReportCreation
forall x. StartReportCreation -> Rep StartReportCreation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartReportCreation x -> StartReportCreation
$cfrom :: forall x. StartReportCreation -> Rep StartReportCreation x
Prelude.Generic)
newStartReportCreation ::
Prelude.Text ->
StartReportCreation
newStartReportCreation :: Text -> StartReportCreation
newStartReportCreation Text
pS3Bucket_ =
StartReportCreation' {$sel:s3Bucket:StartReportCreation' :: Text
s3Bucket = Text
pS3Bucket_}
startReportCreation_s3Bucket :: Lens.Lens' StartReportCreation Prelude.Text
startReportCreation_s3Bucket :: Lens' StartReportCreation Text
startReportCreation_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartReportCreation' {Text
s3Bucket :: Text
$sel:s3Bucket:StartReportCreation' :: StartReportCreation -> Text
s3Bucket} -> Text
s3Bucket) (\s :: StartReportCreation
s@StartReportCreation' {} Text
a -> StartReportCreation
s {$sel:s3Bucket:StartReportCreation' :: Text
s3Bucket = Text
a} :: StartReportCreation)
instance Core.AWSRequest StartReportCreation where
type
AWSResponse StartReportCreation =
StartReportCreationResponse
request :: (Service -> Service)
-> StartReportCreation -> Request StartReportCreation
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartReportCreation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartReportCreation)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StartReportCreationResponse
StartReportCreationResponse'
forall (f :: * -> *) a b. Functor 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 StartReportCreation where
hashWithSalt :: Int -> StartReportCreation -> Int
hashWithSalt Int
_salt StartReportCreation' {Text
s3Bucket :: Text
$sel:s3Bucket:StartReportCreation' :: StartReportCreation -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Bucket
instance Prelude.NFData StartReportCreation where
rnf :: StartReportCreation -> ()
rnf StartReportCreation' {Text
s3Bucket :: Text
$sel:s3Bucket:StartReportCreation' :: StartReportCreation -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
s3Bucket
instance Data.ToHeaders StartReportCreation where
toHeaders :: StartReportCreation -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"ResourceGroupsTaggingAPI_20170126.StartReportCreation" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StartReportCreation where
toJSON :: StartReportCreation -> Value
toJSON StartReportCreation' {Text
s3Bucket :: Text
$sel:s3Bucket:StartReportCreation' :: StartReportCreation -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"S3Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3Bucket)]
)
instance Data.ToPath StartReportCreation where
toPath :: StartReportCreation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StartReportCreation where
toQuery :: StartReportCreation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartReportCreationResponse = StartReportCreationResponse'
{
StartReportCreationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartReportCreationResponse -> StartReportCreationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartReportCreationResponse -> StartReportCreationResponse -> Bool
$c/= :: StartReportCreationResponse -> StartReportCreationResponse -> Bool
== :: StartReportCreationResponse -> StartReportCreationResponse -> Bool
$c== :: StartReportCreationResponse -> StartReportCreationResponse -> Bool
Prelude.Eq, ReadPrec [StartReportCreationResponse]
ReadPrec StartReportCreationResponse
Int -> ReadS StartReportCreationResponse
ReadS [StartReportCreationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartReportCreationResponse]
$creadListPrec :: ReadPrec [StartReportCreationResponse]
readPrec :: ReadPrec StartReportCreationResponse
$creadPrec :: ReadPrec StartReportCreationResponse
readList :: ReadS [StartReportCreationResponse]
$creadList :: ReadS [StartReportCreationResponse]
readsPrec :: Int -> ReadS StartReportCreationResponse
$creadsPrec :: Int -> ReadS StartReportCreationResponse
Prelude.Read, Int -> StartReportCreationResponse -> ShowS
[StartReportCreationResponse] -> ShowS
StartReportCreationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartReportCreationResponse] -> ShowS
$cshowList :: [StartReportCreationResponse] -> ShowS
show :: StartReportCreationResponse -> String
$cshow :: StartReportCreationResponse -> String
showsPrec :: Int -> StartReportCreationResponse -> ShowS
$cshowsPrec :: Int -> StartReportCreationResponse -> ShowS
Prelude.Show, forall x.
Rep StartReportCreationResponse x -> StartReportCreationResponse
forall x.
StartReportCreationResponse -> Rep StartReportCreationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartReportCreationResponse x -> StartReportCreationResponse
$cfrom :: forall x.
StartReportCreationResponse -> Rep StartReportCreationResponse x
Prelude.Generic)
newStartReportCreationResponse ::
Prelude.Int ->
StartReportCreationResponse
newStartReportCreationResponse :: Int -> StartReportCreationResponse
newStartReportCreationResponse Int
pHttpStatus_ =
StartReportCreationResponse'
{ $sel:httpStatus:StartReportCreationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
startReportCreationResponse_httpStatus :: Lens.Lens' StartReportCreationResponse Prelude.Int
startReportCreationResponse_httpStatus :: Lens' StartReportCreationResponse Int
startReportCreationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartReportCreationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartReportCreationResponse' :: StartReportCreationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartReportCreationResponse
s@StartReportCreationResponse' {} Int
a -> StartReportCreationResponse
s {$sel:httpStatus:StartReportCreationResponse' :: Int
httpStatus = Int
a} :: StartReportCreationResponse)
instance Prelude.NFData StartReportCreationResponse where
rnf :: StartReportCreationResponse -> ()
rnf StartReportCreationResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartReportCreationResponse' :: StartReportCreationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus