{-# 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.AppStream.CreateUsageReportSubscription
(
CreateUsageReportSubscription (..),
newCreateUsageReportSubscription,
CreateUsageReportSubscriptionResponse (..),
newCreateUsageReportSubscriptionResponse,
createUsageReportSubscriptionResponse_s3BucketName,
createUsageReportSubscriptionResponse_schedule,
createUsageReportSubscriptionResponse_httpStatus,
)
where
import Amazonka.AppStream.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 CreateUsageReportSubscription = CreateUsageReportSubscription'
{
}
deriving (CreateUsageReportSubscription
-> CreateUsageReportSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUsageReportSubscription
-> CreateUsageReportSubscription -> Bool
$c/= :: CreateUsageReportSubscription
-> CreateUsageReportSubscription -> Bool
== :: CreateUsageReportSubscription
-> CreateUsageReportSubscription -> Bool
$c== :: CreateUsageReportSubscription
-> CreateUsageReportSubscription -> Bool
Prelude.Eq, ReadPrec [CreateUsageReportSubscription]
ReadPrec CreateUsageReportSubscription
Int -> ReadS CreateUsageReportSubscription
ReadS [CreateUsageReportSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUsageReportSubscription]
$creadListPrec :: ReadPrec [CreateUsageReportSubscription]
readPrec :: ReadPrec CreateUsageReportSubscription
$creadPrec :: ReadPrec CreateUsageReportSubscription
readList :: ReadS [CreateUsageReportSubscription]
$creadList :: ReadS [CreateUsageReportSubscription]
readsPrec :: Int -> ReadS CreateUsageReportSubscription
$creadsPrec :: Int -> ReadS CreateUsageReportSubscription
Prelude.Read, Int -> CreateUsageReportSubscription -> ShowS
[CreateUsageReportSubscription] -> ShowS
CreateUsageReportSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUsageReportSubscription] -> ShowS
$cshowList :: [CreateUsageReportSubscription] -> ShowS
show :: CreateUsageReportSubscription -> String
$cshow :: CreateUsageReportSubscription -> String
showsPrec :: Int -> CreateUsageReportSubscription -> ShowS
$cshowsPrec :: Int -> CreateUsageReportSubscription -> ShowS
Prelude.Show, forall x.
Rep CreateUsageReportSubscription x
-> CreateUsageReportSubscription
forall x.
CreateUsageReportSubscription
-> Rep CreateUsageReportSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateUsageReportSubscription x
-> CreateUsageReportSubscription
$cfrom :: forall x.
CreateUsageReportSubscription
-> Rep CreateUsageReportSubscription x
Prelude.Generic)
newCreateUsageReportSubscription ::
CreateUsageReportSubscription
newCreateUsageReportSubscription :: CreateUsageReportSubscription
newCreateUsageReportSubscription =
CreateUsageReportSubscription
CreateUsageReportSubscription'
instance
Core.AWSRequest
CreateUsageReportSubscription
where
type
AWSResponse CreateUsageReportSubscription =
CreateUsageReportSubscriptionResponse
request :: (Service -> Service)
-> CreateUsageReportSubscription
-> Request CreateUsageReportSubscription
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 CreateUsageReportSubscription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateUsageReportSubscription)))
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 Text
-> Maybe UsageReportSchedule
-> Int
-> CreateUsageReportSubscriptionResponse
CreateUsageReportSubscriptionResponse'
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
"S3BucketName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Schedule")
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
CreateUsageReportSubscription
where
hashWithSalt :: Int -> CreateUsageReportSubscription -> Int
hashWithSalt Int
_salt CreateUsageReportSubscription
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData CreateUsageReportSubscription where
rnf :: CreateUsageReportSubscription -> ()
rnf CreateUsageReportSubscription
_ = ()
instance Data.ToHeaders CreateUsageReportSubscription where
toHeaders :: CreateUsageReportSubscription -> 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
"PhotonAdminProxyService.CreateUsageReportSubscription" ::
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 CreateUsageReportSubscription where
toJSON :: CreateUsageReportSubscription -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath CreateUsageReportSubscription where
toPath :: CreateUsageReportSubscription -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateUsageReportSubscription where
toQuery :: CreateUsageReportSubscription -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateUsageReportSubscriptionResponse = CreateUsageReportSubscriptionResponse'
{
CreateUsageReportSubscriptionResponse -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text,
CreateUsageReportSubscriptionResponse -> Maybe UsageReportSchedule
schedule :: Prelude.Maybe UsageReportSchedule,
CreateUsageReportSubscriptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateUsageReportSubscriptionResponse
-> CreateUsageReportSubscriptionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUsageReportSubscriptionResponse
-> CreateUsageReportSubscriptionResponse -> Bool
$c/= :: CreateUsageReportSubscriptionResponse
-> CreateUsageReportSubscriptionResponse -> Bool
== :: CreateUsageReportSubscriptionResponse
-> CreateUsageReportSubscriptionResponse -> Bool
$c== :: CreateUsageReportSubscriptionResponse
-> CreateUsageReportSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [CreateUsageReportSubscriptionResponse]
ReadPrec CreateUsageReportSubscriptionResponse
Int -> ReadS CreateUsageReportSubscriptionResponse
ReadS [CreateUsageReportSubscriptionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUsageReportSubscriptionResponse]
$creadListPrec :: ReadPrec [CreateUsageReportSubscriptionResponse]
readPrec :: ReadPrec CreateUsageReportSubscriptionResponse
$creadPrec :: ReadPrec CreateUsageReportSubscriptionResponse
readList :: ReadS [CreateUsageReportSubscriptionResponse]
$creadList :: ReadS [CreateUsageReportSubscriptionResponse]
readsPrec :: Int -> ReadS CreateUsageReportSubscriptionResponse
$creadsPrec :: Int -> ReadS CreateUsageReportSubscriptionResponse
Prelude.Read, Int -> CreateUsageReportSubscriptionResponse -> ShowS
[CreateUsageReportSubscriptionResponse] -> ShowS
CreateUsageReportSubscriptionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUsageReportSubscriptionResponse] -> ShowS
$cshowList :: [CreateUsageReportSubscriptionResponse] -> ShowS
show :: CreateUsageReportSubscriptionResponse -> String
$cshow :: CreateUsageReportSubscriptionResponse -> String
showsPrec :: Int -> CreateUsageReportSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> CreateUsageReportSubscriptionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateUsageReportSubscriptionResponse x
-> CreateUsageReportSubscriptionResponse
forall x.
CreateUsageReportSubscriptionResponse
-> Rep CreateUsageReportSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateUsageReportSubscriptionResponse x
-> CreateUsageReportSubscriptionResponse
$cfrom :: forall x.
CreateUsageReportSubscriptionResponse
-> Rep CreateUsageReportSubscriptionResponse x
Prelude.Generic)
newCreateUsageReportSubscriptionResponse ::
Prelude.Int ->
CreateUsageReportSubscriptionResponse
newCreateUsageReportSubscriptionResponse :: Int -> CreateUsageReportSubscriptionResponse
newCreateUsageReportSubscriptionResponse Int
pHttpStatus_ =
CreateUsageReportSubscriptionResponse'
{ $sel:s3BucketName:CreateUsageReportSubscriptionResponse' :: Maybe Text
s3BucketName =
forall a. Maybe a
Prelude.Nothing,
$sel:schedule:CreateUsageReportSubscriptionResponse' :: Maybe UsageReportSchedule
schedule = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateUsageReportSubscriptionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createUsageReportSubscriptionResponse_s3BucketName :: Lens.Lens' CreateUsageReportSubscriptionResponse (Prelude.Maybe Prelude.Text)
createUsageReportSubscriptionResponse_s3BucketName :: Lens' CreateUsageReportSubscriptionResponse (Maybe Text)
createUsageReportSubscriptionResponse_s3BucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUsageReportSubscriptionResponse' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: CreateUsageReportSubscriptionResponse
s@CreateUsageReportSubscriptionResponse' {} Maybe Text
a -> CreateUsageReportSubscriptionResponse
s {$sel:s3BucketName:CreateUsageReportSubscriptionResponse' :: Maybe Text
s3BucketName = Maybe Text
a} :: CreateUsageReportSubscriptionResponse)
createUsageReportSubscriptionResponse_schedule :: Lens.Lens' CreateUsageReportSubscriptionResponse (Prelude.Maybe UsageReportSchedule)
createUsageReportSubscriptionResponse_schedule :: Lens'
CreateUsageReportSubscriptionResponse (Maybe UsageReportSchedule)
createUsageReportSubscriptionResponse_schedule = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUsageReportSubscriptionResponse' {Maybe UsageReportSchedule
schedule :: Maybe UsageReportSchedule
$sel:schedule:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Maybe UsageReportSchedule
schedule} -> Maybe UsageReportSchedule
schedule) (\s :: CreateUsageReportSubscriptionResponse
s@CreateUsageReportSubscriptionResponse' {} Maybe UsageReportSchedule
a -> CreateUsageReportSubscriptionResponse
s {$sel:schedule:CreateUsageReportSubscriptionResponse' :: Maybe UsageReportSchedule
schedule = Maybe UsageReportSchedule
a} :: CreateUsageReportSubscriptionResponse)
createUsageReportSubscriptionResponse_httpStatus :: Lens.Lens' CreateUsageReportSubscriptionResponse Prelude.Int
createUsageReportSubscriptionResponse_httpStatus :: Lens' CreateUsageReportSubscriptionResponse Int
createUsageReportSubscriptionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUsageReportSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateUsageReportSubscriptionResponse
s@CreateUsageReportSubscriptionResponse' {} Int
a -> CreateUsageReportSubscriptionResponse
s {$sel:httpStatus:CreateUsageReportSubscriptionResponse' :: Int
httpStatus = Int
a} :: CreateUsageReportSubscriptionResponse)
instance
Prelude.NFData
CreateUsageReportSubscriptionResponse
where
rnf :: CreateUsageReportSubscriptionResponse -> ()
rnf CreateUsageReportSubscriptionResponse' {Int
Maybe Text
Maybe UsageReportSchedule
httpStatus :: Int
schedule :: Maybe UsageReportSchedule
s3BucketName :: Maybe Text
$sel:httpStatus:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Int
$sel:schedule:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Maybe UsageReportSchedule
$sel:s3BucketName:CreateUsageReportSubscriptionResponse' :: CreateUsageReportSubscriptionResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3BucketName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UsageReportSchedule
schedule
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus