{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SMS.Types.ServerLaunchConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SMS.Types.ServerLaunchConfiguration 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 Amazonka.SMS.Types.S3Location
import Amazonka.SMS.Types.ScriptType
import Amazonka.SMS.Types.Server
import Amazonka.SMS.Types.UserData

-- | Launch configuration for a server.
--
-- /See:/ 'newServerLaunchConfiguration' smart constructor.
data ServerLaunchConfiguration = ServerLaunchConfiguration'
  { -- | Indicates whether a publicly accessible IP address is created when
    -- launching the server.
    ServerLaunchConfiguration -> Maybe Bool
associatePublicIpAddress :: Prelude.Maybe Prelude.Bool,
    ServerLaunchConfiguration -> Maybe S3Location
configureScript :: Prelude.Maybe S3Location,
    -- | The type of configuration script.
    ServerLaunchConfiguration -> Maybe ScriptType
configureScriptType :: Prelude.Maybe ScriptType,
    -- | The name of the Amazon EC2 SSH key to be used for connecting to the
    -- launched server.
    ServerLaunchConfiguration -> Maybe Text
ec2KeyName :: Prelude.Maybe Prelude.Text,
    -- | The name of the IAM instance profile.
    ServerLaunchConfiguration -> Maybe Text
iamInstanceProfileName :: Prelude.Maybe Prelude.Text,
    -- | The instance type to use when launching the server.
    ServerLaunchConfiguration -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The logical ID of the server in the CloudFormation template.
    ServerLaunchConfiguration -> Maybe Text
logicalId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the security group that applies to the launched server.
    ServerLaunchConfiguration -> Maybe Text
securityGroup :: Prelude.Maybe Prelude.Text,
    -- | The ID of the server with which the launch configuration is associated.
    ServerLaunchConfiguration -> Maybe Server
server :: Prelude.Maybe Server,
    -- | The ID of the subnet the server should be launched into.
    ServerLaunchConfiguration -> Maybe Text
subnet :: Prelude.Maybe Prelude.Text,
    -- | Location of the user-data script to be executed when launching the
    -- server.
    ServerLaunchConfiguration -> Maybe UserData
userData :: Prelude.Maybe UserData,
    -- | The ID of the VPC into which the server should be launched.
    ServerLaunchConfiguration -> Maybe Text
vpc :: Prelude.Maybe Prelude.Text
  }
  deriving (ServerLaunchConfiguration -> ServerLaunchConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerLaunchConfiguration -> ServerLaunchConfiguration -> Bool
$c/= :: ServerLaunchConfiguration -> ServerLaunchConfiguration -> Bool
== :: ServerLaunchConfiguration -> ServerLaunchConfiguration -> Bool
$c== :: ServerLaunchConfiguration -> ServerLaunchConfiguration -> Bool
Prelude.Eq, ReadPrec [ServerLaunchConfiguration]
ReadPrec ServerLaunchConfiguration
Int -> ReadS ServerLaunchConfiguration
ReadS [ServerLaunchConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerLaunchConfiguration]
$creadListPrec :: ReadPrec [ServerLaunchConfiguration]
readPrec :: ReadPrec ServerLaunchConfiguration
$creadPrec :: ReadPrec ServerLaunchConfiguration
readList :: ReadS [ServerLaunchConfiguration]
$creadList :: ReadS [ServerLaunchConfiguration]
readsPrec :: Int -> ReadS ServerLaunchConfiguration
$creadsPrec :: Int -> ReadS ServerLaunchConfiguration
Prelude.Read, Int -> ServerLaunchConfiguration -> ShowS
[ServerLaunchConfiguration] -> ShowS
ServerLaunchConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerLaunchConfiguration] -> ShowS
$cshowList :: [ServerLaunchConfiguration] -> ShowS
show :: ServerLaunchConfiguration -> String
$cshow :: ServerLaunchConfiguration -> String
showsPrec :: Int -> ServerLaunchConfiguration -> ShowS
$cshowsPrec :: Int -> ServerLaunchConfiguration -> ShowS
Prelude.Show, forall x.
Rep ServerLaunchConfiguration x -> ServerLaunchConfiguration
forall x.
ServerLaunchConfiguration -> Rep ServerLaunchConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ServerLaunchConfiguration x -> ServerLaunchConfiguration
$cfrom :: forall x.
ServerLaunchConfiguration -> Rep ServerLaunchConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'ServerLaunchConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'associatePublicIpAddress', 'serverLaunchConfiguration_associatePublicIpAddress' - Indicates whether a publicly accessible IP address is created when
-- launching the server.
--
-- 'configureScript', 'serverLaunchConfiguration_configureScript' - Undocumented member.
--
-- 'configureScriptType', 'serverLaunchConfiguration_configureScriptType' - The type of configuration script.
--
-- 'ec2KeyName', 'serverLaunchConfiguration_ec2KeyName' - The name of the Amazon EC2 SSH key to be used for connecting to the
-- launched server.
--
-- 'iamInstanceProfileName', 'serverLaunchConfiguration_iamInstanceProfileName' - The name of the IAM instance profile.
--
-- 'instanceType', 'serverLaunchConfiguration_instanceType' - The instance type to use when launching the server.
--
-- 'logicalId', 'serverLaunchConfiguration_logicalId' - The logical ID of the server in the CloudFormation template.
--
-- 'securityGroup', 'serverLaunchConfiguration_securityGroup' - The ID of the security group that applies to the launched server.
--
-- 'server', 'serverLaunchConfiguration_server' - The ID of the server with which the launch configuration is associated.
--
-- 'subnet', 'serverLaunchConfiguration_subnet' - The ID of the subnet the server should be launched into.
--
-- 'userData', 'serverLaunchConfiguration_userData' - Location of the user-data script to be executed when launching the
-- server.
--
-- 'vpc', 'serverLaunchConfiguration_vpc' - The ID of the VPC into which the server should be launched.
newServerLaunchConfiguration ::
  ServerLaunchConfiguration
newServerLaunchConfiguration :: ServerLaunchConfiguration
newServerLaunchConfiguration =
  ServerLaunchConfiguration'
    { $sel:associatePublicIpAddress:ServerLaunchConfiguration' :: Maybe Bool
associatePublicIpAddress =
        forall a. Maybe a
Prelude.Nothing,
      $sel:configureScript:ServerLaunchConfiguration' :: Maybe S3Location
configureScript = forall a. Maybe a
Prelude.Nothing,
      $sel:configureScriptType:ServerLaunchConfiguration' :: Maybe ScriptType
configureScriptType = forall a. Maybe a
Prelude.Nothing,
      $sel:ec2KeyName:ServerLaunchConfiguration' :: Maybe Text
ec2KeyName = forall a. Maybe a
Prelude.Nothing,
      $sel:iamInstanceProfileName:ServerLaunchConfiguration' :: Maybe Text
iamInstanceProfileName = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:ServerLaunchConfiguration' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:logicalId:ServerLaunchConfiguration' :: Maybe Text
logicalId = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroup:ServerLaunchConfiguration' :: Maybe Text
securityGroup = forall a. Maybe a
Prelude.Nothing,
      $sel:server:ServerLaunchConfiguration' :: Maybe Server
server = forall a. Maybe a
Prelude.Nothing,
      $sel:subnet:ServerLaunchConfiguration' :: Maybe Text
subnet = forall a. Maybe a
Prelude.Nothing,
      $sel:userData:ServerLaunchConfiguration' :: Maybe UserData
userData = forall a. Maybe a
Prelude.Nothing,
      $sel:vpc:ServerLaunchConfiguration' :: Maybe Text
vpc = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether a publicly accessible IP address is created when
-- launching the server.
serverLaunchConfiguration_associatePublicIpAddress :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Bool)
serverLaunchConfiguration_associatePublicIpAddress :: Lens' ServerLaunchConfiguration (Maybe Bool)
serverLaunchConfiguration_associatePublicIpAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Bool
associatePublicIpAddress :: Maybe Bool
$sel:associatePublicIpAddress:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Bool
associatePublicIpAddress} -> Maybe Bool
associatePublicIpAddress) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Bool
a -> ServerLaunchConfiguration
s {$sel:associatePublicIpAddress:ServerLaunchConfiguration' :: Maybe Bool
associatePublicIpAddress = Maybe Bool
a} :: ServerLaunchConfiguration)

-- | Undocumented member.
serverLaunchConfiguration_configureScript :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe S3Location)
serverLaunchConfiguration_configureScript :: Lens' ServerLaunchConfiguration (Maybe S3Location)
serverLaunchConfiguration_configureScript = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe S3Location
configureScript :: Maybe S3Location
$sel:configureScript:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe S3Location
configureScript} -> Maybe S3Location
configureScript) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe S3Location
a -> ServerLaunchConfiguration
s {$sel:configureScript:ServerLaunchConfiguration' :: Maybe S3Location
configureScript = Maybe S3Location
a} :: ServerLaunchConfiguration)

-- | The type of configuration script.
serverLaunchConfiguration_configureScriptType :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe ScriptType)
serverLaunchConfiguration_configureScriptType :: Lens' ServerLaunchConfiguration (Maybe ScriptType)
serverLaunchConfiguration_configureScriptType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe ScriptType
configureScriptType :: Maybe ScriptType
$sel:configureScriptType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe ScriptType
configureScriptType} -> Maybe ScriptType
configureScriptType) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe ScriptType
a -> ServerLaunchConfiguration
s {$sel:configureScriptType:ServerLaunchConfiguration' :: Maybe ScriptType
configureScriptType = Maybe ScriptType
a} :: ServerLaunchConfiguration)

-- | The name of the Amazon EC2 SSH key to be used for connecting to the
-- launched server.
serverLaunchConfiguration_ec2KeyName :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_ec2KeyName :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_ec2KeyName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
ec2KeyName :: Maybe Text
$sel:ec2KeyName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
ec2KeyName} -> Maybe Text
ec2KeyName) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:ec2KeyName:ServerLaunchConfiguration' :: Maybe Text
ec2KeyName = Maybe Text
a} :: ServerLaunchConfiguration)

-- | The name of the IAM instance profile.
serverLaunchConfiguration_iamInstanceProfileName :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_iamInstanceProfileName :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_iamInstanceProfileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
iamInstanceProfileName :: Maybe Text
$sel:iamInstanceProfileName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
iamInstanceProfileName} -> Maybe Text
iamInstanceProfileName) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:iamInstanceProfileName:ServerLaunchConfiguration' :: Maybe Text
iamInstanceProfileName = Maybe Text
a} :: ServerLaunchConfiguration)

-- | The instance type to use when launching the server.
serverLaunchConfiguration_instanceType :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_instanceType :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:instanceType:ServerLaunchConfiguration' :: Maybe Text
instanceType = Maybe Text
a} :: ServerLaunchConfiguration)

-- | The logical ID of the server in the CloudFormation template.
serverLaunchConfiguration_logicalId :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_logicalId :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_logicalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
logicalId :: Maybe Text
$sel:logicalId:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
logicalId} -> Maybe Text
logicalId) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:logicalId:ServerLaunchConfiguration' :: Maybe Text
logicalId = Maybe Text
a} :: ServerLaunchConfiguration)

-- | The ID of the security group that applies to the launched server.
serverLaunchConfiguration_securityGroup :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_securityGroup :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_securityGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
securityGroup :: Maybe Text
$sel:securityGroup:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
securityGroup} -> Maybe Text
securityGroup) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:securityGroup:ServerLaunchConfiguration' :: Maybe Text
securityGroup = Maybe Text
a} :: ServerLaunchConfiguration)

-- | The ID of the server with which the launch configuration is associated.
serverLaunchConfiguration_server :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Server)
serverLaunchConfiguration_server :: Lens' ServerLaunchConfiguration (Maybe Server)
serverLaunchConfiguration_server = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Server
server :: Maybe Server
$sel:server:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Server
server} -> Maybe Server
server) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Server
a -> ServerLaunchConfiguration
s {$sel:server:ServerLaunchConfiguration' :: Maybe Server
server = Maybe Server
a} :: ServerLaunchConfiguration)

-- | The ID of the subnet the server should be launched into.
serverLaunchConfiguration_subnet :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_subnet :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_subnet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
subnet :: Maybe Text
$sel:subnet:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
subnet} -> Maybe Text
subnet) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:subnet:ServerLaunchConfiguration' :: Maybe Text
subnet = Maybe Text
a} :: ServerLaunchConfiguration)

-- | Location of the user-data script to be executed when launching the
-- server.
serverLaunchConfiguration_userData :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe UserData)
serverLaunchConfiguration_userData :: Lens' ServerLaunchConfiguration (Maybe UserData)
serverLaunchConfiguration_userData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe UserData
userData :: Maybe UserData
$sel:userData:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe UserData
userData} -> Maybe UserData
userData) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe UserData
a -> ServerLaunchConfiguration
s {$sel:userData:ServerLaunchConfiguration' :: Maybe UserData
userData = Maybe UserData
a} :: ServerLaunchConfiguration)

-- | The ID of the VPC into which the server should be launched.
serverLaunchConfiguration_vpc :: Lens.Lens' ServerLaunchConfiguration (Prelude.Maybe Prelude.Text)
serverLaunchConfiguration_vpc :: Lens' ServerLaunchConfiguration (Maybe Text)
serverLaunchConfiguration_vpc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerLaunchConfiguration' {Maybe Text
vpc :: Maybe Text
$sel:vpc:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
vpc} -> Maybe Text
vpc) (\s :: ServerLaunchConfiguration
s@ServerLaunchConfiguration' {} Maybe Text
a -> ServerLaunchConfiguration
s {$sel:vpc:ServerLaunchConfiguration' :: Maybe Text
vpc = Maybe Text
a} :: ServerLaunchConfiguration)

instance Data.FromJSON ServerLaunchConfiguration where
  parseJSON :: Value -> Parser ServerLaunchConfiguration
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ServerLaunchConfiguration"
      ( \Object
x ->
          Maybe Bool
-> Maybe S3Location
-> Maybe ScriptType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Server
-> Maybe Text
-> Maybe UserData
-> Maybe Text
-> ServerLaunchConfiguration
ServerLaunchConfiguration'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"associatePublicIpAddress")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"configureScript")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"configureScriptType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ec2KeyName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"iamInstanceProfileName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"instanceType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"logicalId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"securityGroup")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"server")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"subnet")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"userData")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vpc")
      )

instance Prelude.Hashable ServerLaunchConfiguration where
  hashWithSalt :: Int -> ServerLaunchConfiguration -> Int
hashWithSalt Int
_salt ServerLaunchConfiguration' {Maybe Bool
Maybe Text
Maybe S3Location
Maybe ScriptType
Maybe UserData
Maybe Server
vpc :: Maybe Text
userData :: Maybe UserData
subnet :: Maybe Text
server :: Maybe Server
securityGroup :: Maybe Text
logicalId :: Maybe Text
instanceType :: Maybe Text
iamInstanceProfileName :: Maybe Text
ec2KeyName :: Maybe Text
configureScriptType :: Maybe ScriptType
configureScript :: Maybe S3Location
associatePublicIpAddress :: Maybe Bool
$sel:vpc:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:userData:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe UserData
$sel:subnet:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:server:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Server
$sel:securityGroup:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:logicalId:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:instanceType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:iamInstanceProfileName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:ec2KeyName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:configureScriptType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe ScriptType
$sel:configureScript:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe S3Location
$sel:associatePublicIpAddress:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
associatePublicIpAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe S3Location
configureScript
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ScriptType
configureScriptType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ec2KeyName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
iamInstanceProfileName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
logicalId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
securityGroup
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Server
server
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnet
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UserData
userData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpc

instance Prelude.NFData ServerLaunchConfiguration where
  rnf :: ServerLaunchConfiguration -> ()
rnf ServerLaunchConfiguration' {Maybe Bool
Maybe Text
Maybe S3Location
Maybe ScriptType
Maybe UserData
Maybe Server
vpc :: Maybe Text
userData :: Maybe UserData
subnet :: Maybe Text
server :: Maybe Server
securityGroup :: Maybe Text
logicalId :: Maybe Text
instanceType :: Maybe Text
iamInstanceProfileName :: Maybe Text
ec2KeyName :: Maybe Text
configureScriptType :: Maybe ScriptType
configureScript :: Maybe S3Location
associatePublicIpAddress :: Maybe Bool
$sel:vpc:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:userData:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe UserData
$sel:subnet:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:server:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Server
$sel:securityGroup:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:logicalId:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:instanceType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:iamInstanceProfileName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:ec2KeyName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:configureScriptType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe ScriptType
$sel:configureScript:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe S3Location
$sel:associatePublicIpAddress:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
associatePublicIpAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe S3Location
configureScript
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ScriptType
configureScriptType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ec2KeyName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iamInstanceProfileName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
logicalId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
securityGroup
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Server
server
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnet
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UserData
userData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpc

instance Data.ToJSON ServerLaunchConfiguration where
  toJSON :: ServerLaunchConfiguration -> Value
toJSON ServerLaunchConfiguration' {Maybe Bool
Maybe Text
Maybe S3Location
Maybe ScriptType
Maybe UserData
Maybe Server
vpc :: Maybe Text
userData :: Maybe UserData
subnet :: Maybe Text
server :: Maybe Server
securityGroup :: Maybe Text
logicalId :: Maybe Text
instanceType :: Maybe Text
iamInstanceProfileName :: Maybe Text
ec2KeyName :: Maybe Text
configureScriptType :: Maybe ScriptType
configureScript :: Maybe S3Location
associatePublicIpAddress :: Maybe Bool
$sel:vpc:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:userData:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe UserData
$sel:subnet:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:server:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Server
$sel:securityGroup:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:logicalId:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:instanceType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:iamInstanceProfileName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:ec2KeyName:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Text
$sel:configureScriptType:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe ScriptType
$sel:configureScript:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe S3Location
$sel:associatePublicIpAddress:ServerLaunchConfiguration' :: ServerLaunchConfiguration -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"associatePublicIpAddress" 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
associatePublicIpAddress,
            (Key
"configureScript" 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 S3Location
configureScript,
            (Key
"configureScriptType" 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 ScriptType
configureScriptType,
            (Key
"ec2KeyName" 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
ec2KeyName,
            (Key
"iamInstanceProfileName" 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
iamInstanceProfileName,
            (Key
"instanceType" 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
instanceType,
            (Key
"logicalId" 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
logicalId,
            (Key
"securityGroup" 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
securityGroup,
            (Key
"server" 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 Server
server,
            (Key
"subnet" 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
subnet,
            (Key
"userData" 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 UserData
userData,
            (Key
"vpc" 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
vpc
          ]
      )