{-# 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.SMS.LaunchApp
(
LaunchApp (..),
newLaunchApp,
launchApp_appId,
LaunchAppResponse (..),
newLaunchAppResponse,
launchAppResponse_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 qualified Amazonka.Response as Response
import Amazonka.SMS.Types
data LaunchApp = LaunchApp'
{
LaunchApp -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
}
deriving (LaunchApp -> LaunchApp -> Bool
(LaunchApp -> LaunchApp -> Bool)
-> (LaunchApp -> LaunchApp -> Bool) -> Eq LaunchApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchApp -> LaunchApp -> Bool
$c/= :: LaunchApp -> LaunchApp -> Bool
== :: LaunchApp -> LaunchApp -> Bool
$c== :: LaunchApp -> LaunchApp -> Bool
Prelude.Eq, ReadPrec [LaunchApp]
ReadPrec LaunchApp
Int -> ReadS LaunchApp
ReadS [LaunchApp]
(Int -> ReadS LaunchApp)
-> ReadS [LaunchApp]
-> ReadPrec LaunchApp
-> ReadPrec [LaunchApp]
-> Read LaunchApp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchApp]
$creadListPrec :: ReadPrec [LaunchApp]
readPrec :: ReadPrec LaunchApp
$creadPrec :: ReadPrec LaunchApp
readList :: ReadS [LaunchApp]
$creadList :: ReadS [LaunchApp]
readsPrec :: Int -> ReadS LaunchApp
$creadsPrec :: Int -> ReadS LaunchApp
Prelude.Read, Int -> LaunchApp -> ShowS
[LaunchApp] -> ShowS
LaunchApp -> String
(Int -> LaunchApp -> ShowS)
-> (LaunchApp -> String)
-> ([LaunchApp] -> ShowS)
-> Show LaunchApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchApp] -> ShowS
$cshowList :: [LaunchApp] -> ShowS
show :: LaunchApp -> String
$cshow :: LaunchApp -> String
showsPrec :: Int -> LaunchApp -> ShowS
$cshowsPrec :: Int -> LaunchApp -> ShowS
Prelude.Show, (forall x. LaunchApp -> Rep LaunchApp x)
-> (forall x. Rep LaunchApp x -> LaunchApp) -> Generic LaunchApp
forall x. Rep LaunchApp x -> LaunchApp
forall x. LaunchApp -> Rep LaunchApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchApp x -> LaunchApp
$cfrom :: forall x. LaunchApp -> Rep LaunchApp x
Prelude.Generic)
newLaunchApp ::
LaunchApp
newLaunchApp :: LaunchApp
newLaunchApp = LaunchApp' :: Maybe Text -> LaunchApp
LaunchApp' {$sel:appId:LaunchApp' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
launchApp_appId :: Lens.Lens' LaunchApp (Prelude.Maybe Prelude.Text)
launchApp_appId :: (Maybe Text -> f (Maybe Text)) -> LaunchApp -> f LaunchApp
launchApp_appId = (LaunchApp -> Maybe Text)
-> (LaunchApp -> Maybe Text -> LaunchApp)
-> Lens LaunchApp LaunchApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchApp' {Maybe Text
appId :: Maybe Text
$sel:appId:LaunchApp' :: LaunchApp -> Maybe Text
appId} -> Maybe Text
appId) (\s :: LaunchApp
s@LaunchApp' {} Maybe Text
a -> LaunchApp
s {$sel:appId:LaunchApp' :: Maybe Text
appId = Maybe Text
a} :: LaunchApp)
instance Core.AWSRequest LaunchApp where
type AWSResponse LaunchApp = LaunchAppResponse
request :: LaunchApp -> Request LaunchApp
request = Service -> LaunchApp -> Request LaunchApp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy LaunchApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse LaunchApp)))
response =
(Int
-> ResponseHeaders -> () -> Either String (AWSResponse LaunchApp))
-> Logger
-> Service
-> Proxy LaunchApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse LaunchApp)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> LaunchAppResponse
LaunchAppResponse'
(Int -> LaunchAppResponse)
-> Either String Int -> Either String LaunchAppResponse
forall (f :: * -> *) a b. Functor 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 LaunchApp
instance Prelude.NFData LaunchApp
instance Core.ToHeaders LaunchApp where
toHeaders :: LaunchApp -> ResponseHeaders
toHeaders =
ResponseHeaders -> LaunchApp -> 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
"AWSServerMigrationService_V2016_10_24.LaunchApp" ::
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 LaunchApp where
toJSON :: LaunchApp -> Value
toJSON LaunchApp' {Maybe Text
appId :: Maybe Text
$sel:appId:LaunchApp' :: LaunchApp -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"appId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
)
instance Core.ToPath LaunchApp where
toPath :: LaunchApp -> ByteString
toPath = ByteString -> LaunchApp -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery LaunchApp where
toQuery :: LaunchApp -> QueryString
toQuery = QueryString -> LaunchApp -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data LaunchAppResponse = LaunchAppResponse'
{
LaunchAppResponse -> Int
httpStatus :: Prelude.Int
}
deriving (LaunchAppResponse -> LaunchAppResponse -> Bool
(LaunchAppResponse -> LaunchAppResponse -> Bool)
-> (LaunchAppResponse -> LaunchAppResponse -> Bool)
-> Eq LaunchAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchAppResponse -> LaunchAppResponse -> Bool
$c/= :: LaunchAppResponse -> LaunchAppResponse -> Bool
== :: LaunchAppResponse -> LaunchAppResponse -> Bool
$c== :: LaunchAppResponse -> LaunchAppResponse -> Bool
Prelude.Eq, ReadPrec [LaunchAppResponse]
ReadPrec LaunchAppResponse
Int -> ReadS LaunchAppResponse
ReadS [LaunchAppResponse]
(Int -> ReadS LaunchAppResponse)
-> ReadS [LaunchAppResponse]
-> ReadPrec LaunchAppResponse
-> ReadPrec [LaunchAppResponse]
-> Read LaunchAppResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchAppResponse]
$creadListPrec :: ReadPrec [LaunchAppResponse]
readPrec :: ReadPrec LaunchAppResponse
$creadPrec :: ReadPrec LaunchAppResponse
readList :: ReadS [LaunchAppResponse]
$creadList :: ReadS [LaunchAppResponse]
readsPrec :: Int -> ReadS LaunchAppResponse
$creadsPrec :: Int -> ReadS LaunchAppResponse
Prelude.Read, Int -> LaunchAppResponse -> ShowS
[LaunchAppResponse] -> ShowS
LaunchAppResponse -> String
(Int -> LaunchAppResponse -> ShowS)
-> (LaunchAppResponse -> String)
-> ([LaunchAppResponse] -> ShowS)
-> Show LaunchAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchAppResponse] -> ShowS
$cshowList :: [LaunchAppResponse] -> ShowS
show :: LaunchAppResponse -> String
$cshow :: LaunchAppResponse -> String
showsPrec :: Int -> LaunchAppResponse -> ShowS
$cshowsPrec :: Int -> LaunchAppResponse -> ShowS
Prelude.Show, (forall x. LaunchAppResponse -> Rep LaunchAppResponse x)
-> (forall x. Rep LaunchAppResponse x -> LaunchAppResponse)
-> Generic LaunchAppResponse
forall x. Rep LaunchAppResponse x -> LaunchAppResponse
forall x. LaunchAppResponse -> Rep LaunchAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LaunchAppResponse x -> LaunchAppResponse
$cfrom :: forall x. LaunchAppResponse -> Rep LaunchAppResponse x
Prelude.Generic)
newLaunchAppResponse ::
Prelude.Int ->
LaunchAppResponse
newLaunchAppResponse :: Int -> LaunchAppResponse
newLaunchAppResponse Int
pHttpStatus_ =
LaunchAppResponse' :: Int -> LaunchAppResponse
LaunchAppResponse' {$sel:httpStatus:LaunchAppResponse' :: Int
httpStatus = Int
pHttpStatus_}
launchAppResponse_httpStatus :: Lens.Lens' LaunchAppResponse Prelude.Int
launchAppResponse_httpStatus :: (Int -> f Int) -> LaunchAppResponse -> f LaunchAppResponse
launchAppResponse_httpStatus = (LaunchAppResponse -> Int)
-> (LaunchAppResponse -> Int -> LaunchAppResponse)
-> Lens LaunchAppResponse LaunchAppResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchAppResponse' {Int
httpStatus :: Int
$sel:httpStatus:LaunchAppResponse' :: LaunchAppResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: LaunchAppResponse
s@LaunchAppResponse' {} Int
a -> LaunchAppResponse
s {$sel:httpStatus:LaunchAppResponse' :: Int
httpStatus = Int
a} :: LaunchAppResponse)
instance Prelude.NFData LaunchAppResponse