{-# 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.SimSpaceWeaver.StopApp
(
StopApp (..),
newStopApp,
stopApp_app,
stopApp_domain,
stopApp_simulation,
StopAppResponse (..),
newStopAppResponse,
stopAppResponse_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.SimSpaceWeaver.Types
data StopApp = StopApp'
{
StopApp -> Text
app :: Prelude.Text,
StopApp -> Text
domain :: Prelude.Text,
StopApp -> Text
simulation :: Prelude.Text
}
deriving (StopApp -> StopApp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopApp -> StopApp -> Bool
$c/= :: StopApp -> StopApp -> Bool
== :: StopApp -> StopApp -> Bool
$c== :: StopApp -> StopApp -> Bool
Prelude.Eq, ReadPrec [StopApp]
ReadPrec StopApp
Int -> ReadS StopApp
ReadS [StopApp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopApp]
$creadListPrec :: ReadPrec [StopApp]
readPrec :: ReadPrec StopApp
$creadPrec :: ReadPrec StopApp
readList :: ReadS [StopApp]
$creadList :: ReadS [StopApp]
readsPrec :: Int -> ReadS StopApp
$creadsPrec :: Int -> ReadS StopApp
Prelude.Read, Int -> StopApp -> ShowS
[StopApp] -> ShowS
StopApp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopApp] -> ShowS
$cshowList :: [StopApp] -> ShowS
show :: StopApp -> String
$cshow :: StopApp -> String
showsPrec :: Int -> StopApp -> ShowS
$cshowsPrec :: Int -> StopApp -> ShowS
Prelude.Show, forall x. Rep StopApp x -> StopApp
forall x. StopApp -> Rep StopApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopApp x -> StopApp
$cfrom :: forall x. StopApp -> Rep StopApp x
Prelude.Generic)
newStopApp ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StopApp
newStopApp :: Text -> Text -> Text -> StopApp
newStopApp Text
pApp_ Text
pDomain_ Text
pSimulation_ =
StopApp'
{ $sel:app:StopApp' :: Text
app = Text
pApp_,
$sel:domain:StopApp' :: Text
domain = Text
pDomain_,
$sel:simulation:StopApp' :: Text
simulation = Text
pSimulation_
}
stopApp_app :: Lens.Lens' StopApp Prelude.Text
stopApp_app :: Lens' StopApp Text
stopApp_app = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopApp' {Text
app :: Text
$sel:app:StopApp' :: StopApp -> Text
app} -> Text
app) (\s :: StopApp
s@StopApp' {} Text
a -> StopApp
s {$sel:app:StopApp' :: Text
app = Text
a} :: StopApp)
stopApp_domain :: Lens.Lens' StopApp Prelude.Text
stopApp_domain :: Lens' StopApp Text
stopApp_domain = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopApp' {Text
domain :: Text
$sel:domain:StopApp' :: StopApp -> Text
domain} -> Text
domain) (\s :: StopApp
s@StopApp' {} Text
a -> StopApp
s {$sel:domain:StopApp' :: Text
domain = Text
a} :: StopApp)
stopApp_simulation :: Lens.Lens' StopApp Prelude.Text
stopApp_simulation :: Lens' StopApp Text
stopApp_simulation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopApp' {Text
simulation :: Text
$sel:simulation:StopApp' :: StopApp -> Text
simulation} -> Text
simulation) (\s :: StopApp
s@StopApp' {} Text
a -> StopApp
s {$sel:simulation:StopApp' :: Text
simulation = Text
a} :: StopApp)
instance Core.AWSRequest StopApp where
type AWSResponse StopApp = StopAppResponse
request :: (Service -> Service) -> StopApp -> Request StopApp
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 StopApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopApp)))
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 -> StopAppResponse
StopAppResponse'
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 StopApp where
hashWithSalt :: Int -> StopApp -> Int
hashWithSalt Int
_salt StopApp' {Text
simulation :: Text
domain :: Text
app :: Text
$sel:simulation:StopApp' :: StopApp -> Text
$sel:domain:StopApp' :: StopApp -> Text
$sel:app:StopApp' :: StopApp -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
app
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
simulation
instance Prelude.NFData StopApp where
rnf :: StopApp -> ()
rnf StopApp' {Text
simulation :: Text
domain :: Text
app :: Text
$sel:simulation:StopApp' :: StopApp -> Text
$sel:domain:StopApp' :: StopApp -> Text
$sel:app:StopApp' :: StopApp -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
app
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
simulation
instance Data.ToHeaders StopApp where
toHeaders :: StopApp -> 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.ToJSON StopApp where
toJSON :: StopApp -> Value
toJSON StopApp' {Text
simulation :: Text
domain :: Text
app :: Text
$sel:simulation:StopApp' :: StopApp -> Text
$sel:domain:StopApp' :: StopApp -> Text
$sel:app:StopApp' :: StopApp -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"App" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
app),
forall a. a -> Maybe a
Prelude.Just (Key
"Domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain),
forall a. a -> Maybe a
Prelude.Just (Key
"Simulation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
simulation)
]
)
instance Data.ToPath StopApp where
toPath :: StopApp -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/stopapp"
instance Data.ToQuery StopApp where
toQuery :: StopApp -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopAppResponse = StopAppResponse'
{
StopAppResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopAppResponse -> StopAppResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopAppResponse -> StopAppResponse -> Bool
$c/= :: StopAppResponse -> StopAppResponse -> Bool
== :: StopAppResponse -> StopAppResponse -> Bool
$c== :: StopAppResponse -> StopAppResponse -> Bool
Prelude.Eq, ReadPrec [StopAppResponse]
ReadPrec StopAppResponse
Int -> ReadS StopAppResponse
ReadS [StopAppResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopAppResponse]
$creadListPrec :: ReadPrec [StopAppResponse]
readPrec :: ReadPrec StopAppResponse
$creadPrec :: ReadPrec StopAppResponse
readList :: ReadS [StopAppResponse]
$creadList :: ReadS [StopAppResponse]
readsPrec :: Int -> ReadS StopAppResponse
$creadsPrec :: Int -> ReadS StopAppResponse
Prelude.Read, Int -> StopAppResponse -> ShowS
[StopAppResponse] -> ShowS
StopAppResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopAppResponse] -> ShowS
$cshowList :: [StopAppResponse] -> ShowS
show :: StopAppResponse -> String
$cshow :: StopAppResponse -> String
showsPrec :: Int -> StopAppResponse -> ShowS
$cshowsPrec :: Int -> StopAppResponse -> ShowS
Prelude.Show, forall x. Rep StopAppResponse x -> StopAppResponse
forall x. StopAppResponse -> Rep StopAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopAppResponse x -> StopAppResponse
$cfrom :: forall x. StopAppResponse -> Rep StopAppResponse x
Prelude.Generic)
newStopAppResponse ::
Prelude.Int ->
StopAppResponse
newStopAppResponse :: Int -> StopAppResponse
newStopAppResponse Int
pHttpStatus_ =
StopAppResponse' {$sel:httpStatus:StopAppResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopAppResponse_httpStatus :: Lens.Lens' StopAppResponse Prelude.Int
stopAppResponse_httpStatus :: Lens' StopAppResponse Int
stopAppResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopAppResponse' :: StopAppResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopAppResponse
s@StopAppResponse' {} Int
a -> StopAppResponse
s {$sel:httpStatus:StopAppResponse' :: Int
httpStatus = Int
a} :: StopAppResponse)
instance Prelude.NFData StopAppResponse where
rnf :: StopAppResponse -> ()
rnf StopAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopAppResponse' :: StopAppResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus