{-# 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.Shield.CreateSubscription
(
CreateSubscription (..),
newCreateSubscription,
CreateSubscriptionResponse (..),
newCreateSubscriptionResponse,
createSubscriptionResponse_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 qualified Amazonka.Response as Response
import Amazonka.Shield.Types
data CreateSubscription = CreateSubscription'
{
}
deriving (CreateSubscription -> CreateSubscription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubscription -> CreateSubscription -> Bool
$c/= :: CreateSubscription -> CreateSubscription -> Bool
== :: CreateSubscription -> CreateSubscription -> Bool
$c== :: CreateSubscription -> CreateSubscription -> Bool
Prelude.Eq, ReadPrec [CreateSubscription]
ReadPrec CreateSubscription
Int -> ReadS CreateSubscription
ReadS [CreateSubscription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubscription]
$creadListPrec :: ReadPrec [CreateSubscription]
readPrec :: ReadPrec CreateSubscription
$creadPrec :: ReadPrec CreateSubscription
readList :: ReadS [CreateSubscription]
$creadList :: ReadS [CreateSubscription]
readsPrec :: Int -> ReadS CreateSubscription
$creadsPrec :: Int -> ReadS CreateSubscription
Prelude.Read, Int -> CreateSubscription -> ShowS
[CreateSubscription] -> ShowS
CreateSubscription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubscription] -> ShowS
$cshowList :: [CreateSubscription] -> ShowS
show :: CreateSubscription -> String
$cshow :: CreateSubscription -> String
showsPrec :: Int -> CreateSubscription -> ShowS
$cshowsPrec :: Int -> CreateSubscription -> ShowS
Prelude.Show, forall x. Rep CreateSubscription x -> CreateSubscription
forall x. CreateSubscription -> Rep CreateSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSubscription x -> CreateSubscription
$cfrom :: forall x. CreateSubscription -> Rep CreateSubscription x
Prelude.Generic)
newCreateSubscription ::
CreateSubscription
newCreateSubscription :: CreateSubscription
newCreateSubscription = CreateSubscription
CreateSubscription'
instance Core.AWSRequest CreateSubscription where
type
AWSResponse CreateSubscription =
CreateSubscriptionResponse
request :: (Service -> Service)
-> CreateSubscription -> Request CreateSubscription
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 CreateSubscription
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse CreateSubscription)))
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 -> CreateSubscriptionResponse
CreateSubscriptionResponse'
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 CreateSubscription where
hashWithSalt :: Int -> CreateSubscription -> Int
hashWithSalt Int
_salt CreateSubscription
_ =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()
instance Prelude.NFData CreateSubscription where
rnf :: CreateSubscription -> ()
rnf CreateSubscription
_ = ()
instance Data.ToHeaders CreateSubscription where
toHeaders :: CreateSubscription -> 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
"AWSShield_20160616.CreateSubscription" ::
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 CreateSubscription where
toJSON :: CreateSubscription -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)
instance Data.ToPath CreateSubscription where
toPath :: CreateSubscription -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery CreateSubscription where
toQuery :: CreateSubscription -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data CreateSubscriptionResponse = CreateSubscriptionResponse'
{
CreateSubscriptionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateSubscriptionResponse -> CreateSubscriptionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSubscriptionResponse -> CreateSubscriptionResponse -> Bool
$c/= :: CreateSubscriptionResponse -> CreateSubscriptionResponse -> Bool
== :: CreateSubscriptionResponse -> CreateSubscriptionResponse -> Bool
$c== :: CreateSubscriptionResponse -> CreateSubscriptionResponse -> Bool
Prelude.Eq, ReadPrec [CreateSubscriptionResponse]
ReadPrec CreateSubscriptionResponse
Int -> ReadS CreateSubscriptionResponse
ReadS [CreateSubscriptionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSubscriptionResponse]
$creadListPrec :: ReadPrec [CreateSubscriptionResponse]
readPrec :: ReadPrec CreateSubscriptionResponse
$creadPrec :: ReadPrec CreateSubscriptionResponse
readList :: ReadS [CreateSubscriptionResponse]
$creadList :: ReadS [CreateSubscriptionResponse]
readsPrec :: Int -> ReadS CreateSubscriptionResponse
$creadsPrec :: Int -> ReadS CreateSubscriptionResponse
Prelude.Read, Int -> CreateSubscriptionResponse -> ShowS
[CreateSubscriptionResponse] -> ShowS
CreateSubscriptionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSubscriptionResponse] -> ShowS
$cshowList :: [CreateSubscriptionResponse] -> ShowS
show :: CreateSubscriptionResponse -> String
$cshow :: CreateSubscriptionResponse -> String
showsPrec :: Int -> CreateSubscriptionResponse -> ShowS
$cshowsPrec :: Int -> CreateSubscriptionResponse -> ShowS
Prelude.Show, forall x.
Rep CreateSubscriptionResponse x -> CreateSubscriptionResponse
forall x.
CreateSubscriptionResponse -> Rep CreateSubscriptionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSubscriptionResponse x -> CreateSubscriptionResponse
$cfrom :: forall x.
CreateSubscriptionResponse -> Rep CreateSubscriptionResponse x
Prelude.Generic)
newCreateSubscriptionResponse ::
Prelude.Int ->
CreateSubscriptionResponse
newCreateSubscriptionResponse :: Int -> CreateSubscriptionResponse
newCreateSubscriptionResponse Int
pHttpStatus_ =
CreateSubscriptionResponse'
{ $sel:httpStatus:CreateSubscriptionResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
createSubscriptionResponse_httpStatus :: Lens.Lens' CreateSubscriptionResponse Prelude.Int
createSubscriptionResponse_httpStatus :: Lens' CreateSubscriptionResponse Int
createSubscriptionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSubscriptionResponse' :: CreateSubscriptionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSubscriptionResponse
s@CreateSubscriptionResponse' {} Int
a -> CreateSubscriptionResponse
s {$sel:httpStatus:CreateSubscriptionResponse' :: Int
httpStatus = Int
a} :: CreateSubscriptionResponse)
instance Prelude.NFData CreateSubscriptionResponse where
rnf :: CreateSubscriptionResponse -> ()
rnf CreateSubscriptionResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSubscriptionResponse' :: CreateSubscriptionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus