{-# 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.PutAppLaunchConfiguration
(
PutAppLaunchConfiguration (..),
newPutAppLaunchConfiguration,
putAppLaunchConfiguration_appId,
putAppLaunchConfiguration_autoLaunch,
putAppLaunchConfiguration_roleName,
putAppLaunchConfiguration_serverGroupLaunchConfigurations,
PutAppLaunchConfigurationResponse (..),
newPutAppLaunchConfigurationResponse,
putAppLaunchConfigurationResponse_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 PutAppLaunchConfiguration = PutAppLaunchConfiguration'
{
PutAppLaunchConfiguration -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
PutAppLaunchConfiguration -> Maybe Bool
autoLaunch :: Prelude.Maybe Prelude.Bool,
PutAppLaunchConfiguration -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
PutAppLaunchConfiguration -> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations :: Prelude.Maybe [ServerGroupLaunchConfiguration]
}
deriving (PutAppLaunchConfiguration -> PutAppLaunchConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAppLaunchConfiguration -> PutAppLaunchConfiguration -> Bool
$c/= :: PutAppLaunchConfiguration -> PutAppLaunchConfiguration -> Bool
== :: PutAppLaunchConfiguration -> PutAppLaunchConfiguration -> Bool
$c== :: PutAppLaunchConfiguration -> PutAppLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [PutAppLaunchConfiguration]
ReadPrec PutAppLaunchConfiguration
Int -> ReadS PutAppLaunchConfiguration
ReadS [PutAppLaunchConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAppLaunchConfiguration]
$creadListPrec :: ReadPrec [PutAppLaunchConfiguration]
readPrec :: ReadPrec PutAppLaunchConfiguration
$creadPrec :: ReadPrec PutAppLaunchConfiguration
readList :: ReadS [PutAppLaunchConfiguration]
$creadList :: ReadS [PutAppLaunchConfiguration]
readsPrec :: Int -> ReadS PutAppLaunchConfiguration
$creadsPrec :: Int -> ReadS PutAppLaunchConfiguration
Prelude.Read, Int -> PutAppLaunchConfiguration -> ShowS
[PutAppLaunchConfiguration] -> ShowS
PutAppLaunchConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAppLaunchConfiguration] -> ShowS
$cshowList :: [PutAppLaunchConfiguration] -> ShowS
show :: PutAppLaunchConfiguration -> String
$cshow :: PutAppLaunchConfiguration -> String
showsPrec :: Int -> PutAppLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> PutAppLaunchConfiguration -> ShowS
Prelude.Show, forall x.
Rep PutAppLaunchConfiguration x -> PutAppLaunchConfiguration
forall x.
PutAppLaunchConfiguration -> Rep PutAppLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAppLaunchConfiguration x -> PutAppLaunchConfiguration
$cfrom :: forall x.
PutAppLaunchConfiguration -> Rep PutAppLaunchConfiguration x
Prelude.Generic)
newPutAppLaunchConfiguration ::
PutAppLaunchConfiguration
newPutAppLaunchConfiguration :: PutAppLaunchConfiguration
newPutAppLaunchConfiguration =
PutAppLaunchConfiguration'
{ $sel:appId:PutAppLaunchConfiguration' :: Maybe Text
appId = forall a. Maybe a
Prelude.Nothing,
$sel:autoLaunch:PutAppLaunchConfiguration' :: Maybe Bool
autoLaunch = forall a. Maybe a
Prelude.Nothing,
$sel:roleName:PutAppLaunchConfiguration' :: Maybe Text
roleName = forall a. Maybe a
Prelude.Nothing,
$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations =
forall a. Maybe a
Prelude.Nothing
}
putAppLaunchConfiguration_appId :: Lens.Lens' PutAppLaunchConfiguration (Prelude.Maybe Prelude.Text)
putAppLaunchConfiguration_appId :: Lens' PutAppLaunchConfiguration (Maybe Text)
putAppLaunchConfiguration_appId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppLaunchConfiguration' {Maybe Text
appId :: Maybe Text
$sel:appId:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
appId} -> Maybe Text
appId) (\s :: PutAppLaunchConfiguration
s@PutAppLaunchConfiguration' {} Maybe Text
a -> PutAppLaunchConfiguration
s {$sel:appId:PutAppLaunchConfiguration' :: Maybe Text
appId = Maybe Text
a} :: PutAppLaunchConfiguration)
putAppLaunchConfiguration_autoLaunch :: Lens.Lens' PutAppLaunchConfiguration (Prelude.Maybe Prelude.Bool)
putAppLaunchConfiguration_autoLaunch :: Lens' PutAppLaunchConfiguration (Maybe Bool)
putAppLaunchConfiguration_autoLaunch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppLaunchConfiguration' {Maybe Bool
autoLaunch :: Maybe Bool
$sel:autoLaunch:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Bool
autoLaunch} -> Maybe Bool
autoLaunch) (\s :: PutAppLaunchConfiguration
s@PutAppLaunchConfiguration' {} Maybe Bool
a -> PutAppLaunchConfiguration
s {$sel:autoLaunch:PutAppLaunchConfiguration' :: Maybe Bool
autoLaunch = Maybe Bool
a} :: PutAppLaunchConfiguration)
putAppLaunchConfiguration_roleName :: Lens.Lens' PutAppLaunchConfiguration (Prelude.Maybe Prelude.Text)
putAppLaunchConfiguration_roleName :: Lens' PutAppLaunchConfiguration (Maybe Text)
putAppLaunchConfiguration_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppLaunchConfiguration' {Maybe Text
roleName :: Maybe Text
$sel:roleName:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: PutAppLaunchConfiguration
s@PutAppLaunchConfiguration' {} Maybe Text
a -> PutAppLaunchConfiguration
s {$sel:roleName:PutAppLaunchConfiguration' :: Maybe Text
roleName = Maybe Text
a} :: PutAppLaunchConfiguration)
putAppLaunchConfiguration_serverGroupLaunchConfigurations :: Lens.Lens' PutAppLaunchConfiguration (Prelude.Maybe [ServerGroupLaunchConfiguration])
putAppLaunchConfiguration_serverGroupLaunchConfigurations :: Lens'
PutAppLaunchConfiguration (Maybe [ServerGroupLaunchConfiguration])
putAppLaunchConfiguration_serverGroupLaunchConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppLaunchConfiguration' {Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations} -> Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations) (\s :: PutAppLaunchConfiguration
s@PutAppLaunchConfiguration' {} Maybe [ServerGroupLaunchConfiguration]
a -> PutAppLaunchConfiguration
s {$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations = Maybe [ServerGroupLaunchConfiguration]
a} :: PutAppLaunchConfiguration) 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
instance Core.AWSRequest PutAppLaunchConfiguration where
type
AWSResponse PutAppLaunchConfiguration =
PutAppLaunchConfigurationResponse
request :: (Service -> Service)
-> PutAppLaunchConfiguration -> Request PutAppLaunchConfiguration
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 PutAppLaunchConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAppLaunchConfiguration)))
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 -> PutAppLaunchConfigurationResponse
PutAppLaunchConfigurationResponse'
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 PutAppLaunchConfiguration where
hashWithSalt :: Int -> PutAppLaunchConfiguration -> Int
hashWithSalt Int
_salt PutAppLaunchConfiguration' {Maybe Bool
Maybe [ServerGroupLaunchConfiguration]
Maybe Text
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
roleName :: Maybe Text
autoLaunch :: Maybe Bool
appId :: Maybe Text
$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe [ServerGroupLaunchConfiguration]
$sel:roleName:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
$sel:autoLaunch:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Bool
$sel:appId:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
autoLaunch
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations
instance Prelude.NFData PutAppLaunchConfiguration where
rnf :: PutAppLaunchConfiguration -> ()
rnf PutAppLaunchConfiguration' {Maybe Bool
Maybe [ServerGroupLaunchConfiguration]
Maybe Text
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
roleName :: Maybe Text
autoLaunch :: Maybe Bool
appId :: Maybe Text
$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe [ServerGroupLaunchConfiguration]
$sel:roleName:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
$sel:autoLaunch:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Bool
$sel:appId:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> 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
instance Data.ToHeaders PutAppLaunchConfiguration where
toHeaders :: PutAppLaunchConfiguration -> 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.PutAppLaunchConfiguration" ::
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 PutAppLaunchConfiguration where
toJSON :: PutAppLaunchConfiguration -> Value
toJSON PutAppLaunchConfiguration' {Maybe Bool
Maybe [ServerGroupLaunchConfiguration]
Maybe Text
serverGroupLaunchConfigurations :: Maybe [ServerGroupLaunchConfiguration]
roleName :: Maybe Text
autoLaunch :: Maybe Bool
appId :: Maybe Text
$sel:serverGroupLaunchConfigurations:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe [ServerGroupLaunchConfiguration]
$sel:roleName:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Text
$sel:autoLaunch:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> Maybe Bool
$sel:appId:PutAppLaunchConfiguration' :: PutAppLaunchConfiguration -> 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,
(Key
"autoLaunch" 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 Bool
autoLaunch,
(Key
"roleName" 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
roleName,
(Key
"serverGroupLaunchConfigurations" 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 [ServerGroupLaunchConfiguration]
serverGroupLaunchConfigurations
]
)
instance Data.ToPath PutAppLaunchConfiguration where
toPath :: PutAppLaunchConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutAppLaunchConfiguration where
toQuery :: PutAppLaunchConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutAppLaunchConfigurationResponse = PutAppLaunchConfigurationResponse'
{
PutAppLaunchConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAppLaunchConfigurationResponse
-> PutAppLaunchConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAppLaunchConfigurationResponse
-> PutAppLaunchConfigurationResponse -> Bool
$c/= :: PutAppLaunchConfigurationResponse
-> PutAppLaunchConfigurationResponse -> Bool
== :: PutAppLaunchConfigurationResponse
-> PutAppLaunchConfigurationResponse -> Bool
$c== :: PutAppLaunchConfigurationResponse
-> PutAppLaunchConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutAppLaunchConfigurationResponse]
ReadPrec PutAppLaunchConfigurationResponse
Int -> ReadS PutAppLaunchConfigurationResponse
ReadS [PutAppLaunchConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAppLaunchConfigurationResponse]
$creadListPrec :: ReadPrec [PutAppLaunchConfigurationResponse]
readPrec :: ReadPrec PutAppLaunchConfigurationResponse
$creadPrec :: ReadPrec PutAppLaunchConfigurationResponse
readList :: ReadS [PutAppLaunchConfigurationResponse]
$creadList :: ReadS [PutAppLaunchConfigurationResponse]
readsPrec :: Int -> ReadS PutAppLaunchConfigurationResponse
$creadsPrec :: Int -> ReadS PutAppLaunchConfigurationResponse
Prelude.Read, Int -> PutAppLaunchConfigurationResponse -> ShowS
[PutAppLaunchConfigurationResponse] -> ShowS
PutAppLaunchConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAppLaunchConfigurationResponse] -> ShowS
$cshowList :: [PutAppLaunchConfigurationResponse] -> ShowS
show :: PutAppLaunchConfigurationResponse -> String
$cshow :: PutAppLaunchConfigurationResponse -> String
showsPrec :: Int -> PutAppLaunchConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutAppLaunchConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep PutAppLaunchConfigurationResponse x
-> PutAppLaunchConfigurationResponse
forall x.
PutAppLaunchConfigurationResponse
-> Rep PutAppLaunchConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAppLaunchConfigurationResponse x
-> PutAppLaunchConfigurationResponse
$cfrom :: forall x.
PutAppLaunchConfigurationResponse
-> Rep PutAppLaunchConfigurationResponse x
Prelude.Generic)
newPutAppLaunchConfigurationResponse ::
Prelude.Int ->
PutAppLaunchConfigurationResponse
newPutAppLaunchConfigurationResponse :: Int -> PutAppLaunchConfigurationResponse
newPutAppLaunchConfigurationResponse Int
pHttpStatus_ =
PutAppLaunchConfigurationResponse'
{ $sel:httpStatus:PutAppLaunchConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putAppLaunchConfigurationResponse_httpStatus :: Lens.Lens' PutAppLaunchConfigurationResponse Prelude.Int
putAppLaunchConfigurationResponse_httpStatus :: Lens' PutAppLaunchConfigurationResponse Int
putAppLaunchConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAppLaunchConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAppLaunchConfigurationResponse' :: PutAppLaunchConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAppLaunchConfigurationResponse
s@PutAppLaunchConfigurationResponse' {} Int
a -> PutAppLaunchConfigurationResponse
s {$sel:httpStatus:PutAppLaunchConfigurationResponse' :: Int
httpStatus = Int
a} :: PutAppLaunchConfigurationResponse)
instance
Prelude.NFData
PutAppLaunchConfigurationResponse
where
rnf :: PutAppLaunchConfigurationResponse -> ()
rnf PutAppLaunchConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAppLaunchConfigurationResponse' :: PutAppLaunchConfigurationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus