{-# 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.GetAppLaunchConfiguration
(
GetAppLaunchConfiguration (..),
newGetAppLaunchConfiguration,
getAppLaunchConfiguration_appId,
GetAppLaunchConfigurationResponse (..),
newGetAppLaunchConfigurationResponse,
getAppLaunchConfigurationResponse_appId,
getAppLaunchConfigurationResponse_autoLaunch,
getAppLaunchConfigurationResponse_roleName,
getAppLaunchConfigurationResponse_serverGroupLaunchConfigurations,
getAppLaunchConfigurationResponse_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.SMS.Types
data GetAppLaunchConfiguration = GetAppLaunchConfiguration'
{
GetAppLaunchConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text
}
deriving (GetAppLaunchConfiguration -> GetAppLaunchConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppLaunchConfiguration -> GetAppLaunchConfiguration -> Bool
$c/= :: GetAppLaunchConfiguration -> GetAppLaunchConfiguration -> Bool
== :: GetAppLaunchConfiguration -> GetAppLaunchConfiguration -> Bool
$c== :: GetAppLaunchConfiguration -> GetAppLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [GetAppLaunchConfiguration]
ReadPrec GetAppLaunchConfiguration
Int -> ReadS GetAppLaunchConfiguration
ReadS [GetAppLaunchConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppLaunchConfiguration]
$creadListPrec :: ReadPrec [GetAppLaunchConfiguration]
readPrec :: ReadPrec GetAppLaunchConfiguration
$creadPrec :: ReadPrec GetAppLaunchConfiguration
readList :: ReadS [GetAppLaunchConfiguration]
$creadList :: ReadS [GetAppLaunchConfiguration]
readsPrec :: Int -> ReadS GetAppLaunchConfiguration
$creadsPrec :: Int -> ReadS GetAppLaunchConfiguration
Prelude.Read, Int -> GetAppLaunchConfiguration -> ShowS
[GetAppLaunchConfiguration] -> ShowS
GetAppLaunchConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppLaunchConfiguration] -> ShowS
$cshowList :: [GetAppLaunchConfiguration] -> ShowS
show :: GetAppLaunchConfiguration -> String
$cshow :: GetAppLaunchConfiguration -> String
showsPrec :: Int -> GetAppLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> GetAppLaunchConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetAppLaunchConfiguration x -> GetAppLaunchConfiguration
forall x.
GetAppLaunchConfiguration -> Rep GetAppLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAppLaunchConfiguration x -> GetAppLaunchConfiguration
$cfrom :: forall x.
GetAppLaunchConfiguration -> Rep GetAppLaunchConfiguration x
Prelude.Generic)
newGetAppLaunchConfiguration ::
GetAppLaunchConfiguration
newGetAppLaunchConfiguration :: GetAppLaunchConfiguration
newGetAppLaunchConfiguration =
GetAppLaunchConfiguration' {$sel:appId:GetAppLaunchConfiguration' :: Maybe Text
appId = forall a. Maybe a
Prelude.Nothing}
getAppLaunchConfiguration_appId :: Lens.Lens' GetAppLaunchConfiguration (Prelude.Maybe Prelude.Text)
getAppLaunchConfiguration_appId :: Lens' GetAppLaunchConfiguration (Maybe Text)
getAppLaunchConfiguration_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppLaunchConfiguration' :: GetAppLaunchConfiguration -> Maybe Text
appId} -> Maybe Text
appId) (\s :: GetAppLaunchConfiguration
s@GetAppLaunchConfiguration' {} Maybe Text
a -> GetAppLaunchConfiguration
s {$sel:appId:GetAppLaunchConfiguration' :: Maybe Text
appId = Maybe Text
a} :: GetAppLaunchConfiguration)
instance Core.AWSRequest GetAppLaunchConfiguration where
type
AWSResponse GetAppLaunchConfiguration =
GetAppLaunchConfigurationResponse
request :: (Service -> Service)
-> GetAppLaunchConfiguration -> Request GetAppLaunchConfiguration
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 GetAppLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAppLaunchConfiguration)))
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 Bool
-> Maybe Text
-> Maybe [ServerGroupLaunchConfiguration]
-> Int
-> GetAppLaunchConfigurationResponse
GetAppLaunchConfigurationResponse'
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
"appId")
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
"autoLaunch")
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
"roleName")
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
"serverGroupLaunchConfigurations"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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 GetAppLaunchConfiguration where
hashWithSalt :: Int -> GetAppLaunchConfiguration -> Int
hashWithSalt Int
_salt GetAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppLaunchConfiguration' :: GetAppLaunchConfiguration -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId
instance Prelude.NFData GetAppLaunchConfiguration where
rnf :: GetAppLaunchConfiguration -> ()
rnf GetAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppLaunchConfiguration' :: GetAppLaunchConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appId
instance Data.ToHeaders GetAppLaunchConfiguration where
toHeaders :: GetAppLaunchConfiguration -> 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
"AWSServerMigrationService_V2016_10_24.GetAppLaunchConfiguration" ::
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 GetAppLaunchConfiguration where
toJSON :: GetAppLaunchConfiguration -> Value
toJSON GetAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppLaunchConfiguration' :: GetAppLaunchConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"appId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appId]
)
instance Data.ToPath GetAppLaunchConfiguration where
toPath :: GetAppLaunchConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetAppLaunchConfiguration where
toQuery :: GetAppLaunchConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetAppLaunchConfigurationResponse = GetAppLaunchConfigurationResponse'
{
GetAppLaunchConfigurationResponse -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
GetAppLaunchConfigurationResponse -> Maybe Bool
autoLaunch :: Prelude.Maybe Prelude.Bool,
GetAppLaunchConfigurationResponse -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
GetAppLaunchConfigurationResponse
-> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations :: Prelude.Maybe [ServerGroupLaunchConfiguration],
GetAppLaunchConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAppLaunchConfigurationResponse
-> GetAppLaunchConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAppLaunchConfigurationResponse
-> GetAppLaunchConfigurationResponse -> Bool
$c/= :: GetAppLaunchConfigurationResponse
-> GetAppLaunchConfigurationResponse -> Bool
== :: GetAppLaunchConfigurationResponse
-> GetAppLaunchConfigurationResponse -> Bool
$c== :: GetAppLaunchConfigurationResponse
-> GetAppLaunchConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetAppLaunchConfigurationResponse]
ReadPrec GetAppLaunchConfigurationResponse
Int -> ReadS GetAppLaunchConfigurationResponse
ReadS [GetAppLaunchConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAppLaunchConfigurationResponse]
$creadListPrec :: ReadPrec [GetAppLaunchConfigurationResponse]
readPrec :: ReadPrec GetAppLaunchConfigurationResponse
$creadPrec :: ReadPrec GetAppLaunchConfigurationResponse
readList :: ReadS [GetAppLaunchConfigurationResponse]
$creadList :: ReadS [GetAppLaunchConfigurationResponse]
readsPrec :: Int -> ReadS GetAppLaunchConfigurationResponse
$creadsPrec :: Int -> ReadS GetAppLaunchConfigurationResponse
Prelude.Read, Int -> GetAppLaunchConfigurationResponse -> ShowS
[GetAppLaunchConfigurationResponse] -> ShowS
GetAppLaunchConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAppLaunchConfigurationResponse] -> ShowS
$cshowList :: [GetAppLaunchConfigurationResponse] -> ShowS
show :: GetAppLaunchConfigurationResponse -> String
$cshow :: GetAppLaunchConfigurationResponse -> String
showsPrec :: Int -> GetAppLaunchConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetAppLaunchConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetAppLaunchConfigurationResponse x
-> GetAppLaunchConfigurationResponse
forall x.
GetAppLaunchConfigurationResponse
-> Rep GetAppLaunchConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAppLaunchConfigurationResponse x
-> GetAppLaunchConfigurationResponse
$cfrom :: forall x.
GetAppLaunchConfigurationResponse
-> Rep GetAppLaunchConfigurationResponse x
Prelude.Generic)
newGetAppLaunchConfigurationResponse ::
Prelude.Int ->
GetAppLaunchConfigurationResponse
newGetAppLaunchConfigurationResponse :: Int -> GetAppLaunchConfigurationResponse
newGetAppLaunchConfigurationResponse Int
pHttpStatus_ =
GetAppLaunchConfigurationResponse'
{ $sel:appId:GetAppLaunchConfigurationResponse' :: Maybe Text
appId =
forall a. Maybe a
Prelude.Nothing,
$sel:autoLaunch:GetAppLaunchConfigurationResponse' :: Maybe Bool
autoLaunch = forall a. Maybe a
Prelude.Nothing,
$sel:roleName:GetAppLaunchConfigurationResponse' :: Maybe Text
roleName = forall a. Maybe a
Prelude.Nothing,
$sel:serverGroupLaunchConfigurations:GetAppLaunchConfigurationResponse' :: Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAppLaunchConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAppLaunchConfigurationResponse_appId :: Lens.Lens' GetAppLaunchConfigurationResponse (Prelude.Maybe Prelude.Text)
getAppLaunchConfigurationResponse_appId :: Lens' GetAppLaunchConfigurationResponse (Maybe Text)
getAppLaunchConfigurationResponse_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfigurationResponse' {Maybe Text
appId :: Maybe Text
$sel:appId:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Text
appId} -> Maybe Text
appId) (\s :: GetAppLaunchConfigurationResponse
s@GetAppLaunchConfigurationResponse' {} Maybe Text
a -> GetAppLaunchConfigurationResponse
s {$sel:appId:GetAppLaunchConfigurationResponse' :: Maybe Text
appId = Maybe Text
a} :: GetAppLaunchConfigurationResponse)
getAppLaunchConfigurationResponse_autoLaunch :: Lens.Lens' GetAppLaunchConfigurationResponse (Prelude.Maybe Prelude.Bool)
getAppLaunchConfigurationResponse_autoLaunch :: Lens' GetAppLaunchConfigurationResponse (Maybe Bool)
getAppLaunchConfigurationResponse_autoLaunch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfigurationResponse' {Maybe Bool
autoLaunch :: Maybe Bool
$sel:autoLaunch:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Bool
autoLaunch} -> Maybe Bool
autoLaunch) (\s :: GetAppLaunchConfigurationResponse
s@GetAppLaunchConfigurationResponse' {} Maybe Bool
a -> GetAppLaunchConfigurationResponse
s {$sel:autoLaunch:GetAppLaunchConfigurationResponse' :: Maybe Bool
autoLaunch = Maybe Bool
a} :: GetAppLaunchConfigurationResponse)
getAppLaunchConfigurationResponse_roleName :: Lens.Lens' GetAppLaunchConfigurationResponse (Prelude.Maybe Prelude.Text)
getAppLaunchConfigurationResponse_roleName :: Lens' GetAppLaunchConfigurationResponse (Maybe Text)
getAppLaunchConfigurationResponse_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfigurationResponse' {Maybe Text
roleName :: Maybe Text
$sel:roleName:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: GetAppLaunchConfigurationResponse
s@GetAppLaunchConfigurationResponse' {} Maybe Text
a -> GetAppLaunchConfigurationResponse
s {$sel:roleName:GetAppLaunchConfigurationResponse' :: Maybe Text
roleName = Maybe Text
a} :: GetAppLaunchConfigurationResponse)
getAppLaunchConfigurationResponse_serverGroupLaunchConfigurations :: Lens.Lens' GetAppLaunchConfigurationResponse (Prelude.Maybe [ServerGroupLaunchConfiguration])
getAppLaunchConfigurationResponse_serverGroupLaunchConfigurations :: Lens'
GetAppLaunchConfigurationResponse
(Maybe [ServerGroupLaunchConfiguration])
getAppLaunchConfigurationResponse_serverGroupLaunchConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfigurationResponse' {Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
$sel:serverGroupLaunchConfigurations:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse
-> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations} -> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations) (\s :: GetAppLaunchConfigurationResponse
s@GetAppLaunchConfigurationResponse' {} Maybe [ServerGroupLaunchConfiguration]
a -> GetAppLaunchConfigurationResponse
s {$sel:serverGroupLaunchConfigurations:GetAppLaunchConfigurationResponse' :: Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations = Maybe [ServerGroupLaunchConfiguration]
a} :: GetAppLaunchConfigurationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getAppLaunchConfigurationResponse_httpStatus :: Lens.Lens' GetAppLaunchConfigurationResponse Prelude.Int
getAppLaunchConfigurationResponse_httpStatus :: Lens' GetAppLaunchConfigurationResponse Int
getAppLaunchConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAppLaunchConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAppLaunchConfigurationResponse
s@GetAppLaunchConfigurationResponse' {} Int
a -> GetAppLaunchConfigurationResponse
s {$sel:httpStatus:GetAppLaunchConfigurationResponse' :: Int
httpStatus = Int
a} :: GetAppLaunchConfigurationResponse)
instance
Prelude.NFData
GetAppLaunchConfigurationResponse
where
rnf :: GetAppLaunchConfigurationResponse -> ()
rnf GetAppLaunchConfigurationResponse' {Int
Maybe Bool
Maybe [ServerGroupLaunchConfiguration]
Maybe Text
httpStatus :: Int
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
roleName :: Maybe Text
autoLaunch :: Maybe Bool
appId :: Maybe Text
$sel:httpStatus:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Int
$sel:serverGroupLaunchConfigurations:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse
-> Maybe [ServerGroupLaunchConfiguration]
$sel:roleName:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Text
$sel:autoLaunch:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Bool
$sel:appId:GetAppLaunchConfigurationResponse' :: GetAppLaunchConfigurationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
autoLaunch
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus