{-# 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.OpsWorksCM.Types.Server
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.OpsWorksCM.Types.Server where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types.EngineAttribute
import Amazonka.OpsWorksCM.Types.MaintenanceStatus
import Amazonka.OpsWorksCM.Types.ServerStatus
import qualified Amazonka.Prelude as Prelude

-- | Describes a configuration management server.
--
-- /See:/ 'newServer' smart constructor.
data Server = Server'
  { -- | The engine version of the server. For a Chef server, the valid value for
    -- EngineVersion is currently @2@. For a Puppet server, specify either
    -- @2019@ or @2017@.
    Server -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The service role ARN used to create the server.
    Server -> Maybe Text
serviceRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Disables automated backups. The number of stored backups is dependent on
    -- the value of PreferredBackupCount.
    Server -> Maybe Bool
disableAutomatedBackup :: Prelude.Maybe Prelude.Bool,
    -- | The server\'s status. This field displays the states of actions in
    -- progress, such as creating, running, or backing up the server, as well
    -- as the server\'s health state.
    Server -> Maybe ServerStatus
status :: Prelude.Maybe ServerStatus,
    -- | The instance profile ARN of the server.
    Server -> Maybe Text
instanceProfileArn :: Prelude.Maybe Prelude.Text,
    -- | The security group IDs for the server, as specified in the
    -- CloudFormation stack. These might not be the same security groups that
    -- are shown in the EC2 console.
    Server -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | Associate a public IP address with a server that you are launching.
    Server -> Maybe Bool
associatePublicIpAddress :: Prelude.Maybe Prelude.Bool,
    -- | The name of the server.
    Server -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | The subnet IDs specified in a CreateServer request.
    Server -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
    -- | The key pair associated with the server.
    Server -> Maybe Text
keyPair :: Prelude.Maybe Prelude.Text,
    -- | Time stamp of server creation. Example @2016-07-29T13:38:47.520Z@
    Server -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The ARN of the server.
    Server -> Maybe Text
serverArn :: Prelude.Maybe Prelude.Text,
    -- | An optional public endpoint of a server, such as
    -- @https:\/\/aws.my-company.com@. You cannot access the server by using
    -- the @Endpoint@ value if the server has a @CustomDomain@ specified.
    Server -> Maybe Text
customDomain :: Prelude.Maybe Prelude.Text,
    -- | The engine type of the server. Valid values in this release include
    -- @ChefAutomate@ and @Puppet@.
    Server -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The status of the most recent server maintenance run. Shows @SUCCESS@ or
    -- @FAILED@.
    Server -> Maybe MaintenanceStatus
maintenanceStatus :: Prelude.Maybe MaintenanceStatus,
    -- | The instance type for the server, as specified in the CloudFormation
    -- stack. This might not be the same instance type that is shown in the EC2
    -- console.
    Server -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The engine model of the server. Valid values in this release include
    -- @Monolithic@ for Puppet and @Single@ for Chef.
    Server -> Maybe Text
engineModel :: Prelude.Maybe Prelude.Text,
    -- | The response of a createServer() request returns the master credential
    -- to access the server in EngineAttributes. These credentials are not
    -- stored by AWS OpsWorks CM; they are returned only as part of the result
    -- of createServer().
    --
    -- __Attributes returned in a createServer response for Chef__
    --
    -- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA private key that
    --     is generated by AWS OpsWorks for Chef Automate. This private key is
    --     required to access the Chef API.
    --
    -- -   @CHEF_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file contains
    --     a Chef starter kit, which includes a README, a configuration file,
    --     and the required RSA private key. Save this file, unzip it, and then
    --     change to the directory where you\'ve unzipped the file contents.
    --     From this directory, you can run Knife commands.
    --
    -- __Attributes returned in a createServer response for Puppet__
    --
    -- -   @PUPPET_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file
    --     contains a Puppet starter kit, including a README and a required
    --     private key. Save this file, unzip it, and then change to the
    --     directory where you\'ve unzipped the file contents.
    --
    -- -   @PUPPET_ADMIN_PASSWORD@: An administrator password that you can use
    --     to sign in to the Puppet Enterprise console after the server is
    --     online.
    Server -> Maybe [EngineAttribute]
engineAttributes :: Prelude.Maybe [EngineAttribute],
    -- | The preferred maintenance period specified for the server.
    Server -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    -- | The preferred backup period specified for the server.
    Server -> Maybe Text
preferredBackupWindow :: Prelude.Maybe Prelude.Text,
    -- | Depending on the server status, this field has either a human-readable
    -- message (such as a create or backup error), or an escaped block of JSON
    -- (used for health check results).
    Server -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | A DNS name that can be used to access the engine. Example:
    -- @myserver-asdfghjkl.us-east-1.opsworks.io@. You cannot access the server
    -- by using the @Endpoint@ value if the server has a @CustomDomain@
    -- specified.
    Server -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the CloudFormation stack that was used to create the server.
    Server -> Maybe Text
cloudFormationStackArn :: Prelude.Maybe Prelude.Text,
    -- | The number of automated backups to keep.
    Server -> Maybe Int
backupRetentionCount :: Prelude.Maybe Prelude.Int
  }
  deriving (Server -> Server -> Bool
(Server -> Server -> Bool)
-> (Server -> Server -> Bool) -> Eq Server
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Server -> Server -> Bool
$c/= :: Server -> Server -> Bool
== :: Server -> Server -> Bool
$c== :: Server -> Server -> Bool
Prelude.Eq, Int -> Server -> ShowS
[Server] -> ShowS
Server -> String
(Int -> Server -> ShowS)
-> (Server -> String) -> ([Server] -> ShowS) -> Show Server
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Server] -> ShowS
$cshowList :: [Server] -> ShowS
show :: Server -> String
$cshow :: Server -> String
showsPrec :: Int -> Server -> ShowS
$cshowsPrec :: Int -> Server -> ShowS
Prelude.Show, (forall x. Server -> Rep Server x)
-> (forall x. Rep Server x -> Server) -> Generic Server
forall x. Rep Server x -> Server
forall x. Server -> Rep Server x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Server x -> Server
$cfrom :: forall x. Server -> Rep Server x
Prelude.Generic)

-- |
-- Create a value of 'Server' 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:
--
-- 'engineVersion', 'server_engineVersion' - The engine version of the server. For a Chef server, the valid value for
-- EngineVersion is currently @2@. For a Puppet server, specify either
-- @2019@ or @2017@.
--
-- 'serviceRoleArn', 'server_serviceRoleArn' - The service role ARN used to create the server.
--
-- 'disableAutomatedBackup', 'server_disableAutomatedBackup' - Disables automated backups. The number of stored backups is dependent on
-- the value of PreferredBackupCount.
--
-- 'status', 'server_status' - The server\'s status. This field displays the states of actions in
-- progress, such as creating, running, or backing up the server, as well
-- as the server\'s health state.
--
-- 'instanceProfileArn', 'server_instanceProfileArn' - The instance profile ARN of the server.
--
-- 'securityGroupIds', 'server_securityGroupIds' - The security group IDs for the server, as specified in the
-- CloudFormation stack. These might not be the same security groups that
-- are shown in the EC2 console.
--
-- 'associatePublicIpAddress', 'server_associatePublicIpAddress' - Associate a public IP address with a server that you are launching.
--
-- 'serverName', 'server_serverName' - The name of the server.
--
-- 'subnetIds', 'server_subnetIds' - The subnet IDs specified in a CreateServer request.
--
-- 'keyPair', 'server_keyPair' - The key pair associated with the server.
--
-- 'createdAt', 'server_createdAt' - Time stamp of server creation. Example @2016-07-29T13:38:47.520Z@
--
-- 'serverArn', 'server_serverArn' - The ARN of the server.
--
-- 'customDomain', 'server_customDomain' - An optional public endpoint of a server, such as
-- @https:\/\/aws.my-company.com@. You cannot access the server by using
-- the @Endpoint@ value if the server has a @CustomDomain@ specified.
--
-- 'engine', 'server_engine' - The engine type of the server. Valid values in this release include
-- @ChefAutomate@ and @Puppet@.
--
-- 'maintenanceStatus', 'server_maintenanceStatus' - The status of the most recent server maintenance run. Shows @SUCCESS@ or
-- @FAILED@.
--
-- 'instanceType', 'server_instanceType' - The instance type for the server, as specified in the CloudFormation
-- stack. This might not be the same instance type that is shown in the EC2
-- console.
--
-- 'engineModel', 'server_engineModel' - The engine model of the server. Valid values in this release include
-- @Monolithic@ for Puppet and @Single@ for Chef.
--
-- 'engineAttributes', 'server_engineAttributes' - The response of a createServer() request returns the master credential
-- to access the server in EngineAttributes. These credentials are not
-- stored by AWS OpsWorks CM; they are returned only as part of the result
-- of createServer().
--
-- __Attributes returned in a createServer response for Chef__
--
-- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA private key that
--     is generated by AWS OpsWorks for Chef Automate. This private key is
--     required to access the Chef API.
--
-- -   @CHEF_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file contains
--     a Chef starter kit, which includes a README, a configuration file,
--     and the required RSA private key. Save this file, unzip it, and then
--     change to the directory where you\'ve unzipped the file contents.
--     From this directory, you can run Knife commands.
--
-- __Attributes returned in a createServer response for Puppet__
--
-- -   @PUPPET_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file
--     contains a Puppet starter kit, including a README and a required
--     private key. Save this file, unzip it, and then change to the
--     directory where you\'ve unzipped the file contents.
--
-- -   @PUPPET_ADMIN_PASSWORD@: An administrator password that you can use
--     to sign in to the Puppet Enterprise console after the server is
--     online.
--
-- 'preferredMaintenanceWindow', 'server_preferredMaintenanceWindow' - The preferred maintenance period specified for the server.
--
-- 'preferredBackupWindow', 'server_preferredBackupWindow' - The preferred backup period specified for the server.
--
-- 'statusReason', 'server_statusReason' - Depending on the server status, this field has either a human-readable
-- message (such as a create or backup error), or an escaped block of JSON
-- (used for health check results).
--
-- 'endpoint', 'server_endpoint' - A DNS name that can be used to access the engine. Example:
-- @myserver-asdfghjkl.us-east-1.opsworks.io@. You cannot access the server
-- by using the @Endpoint@ value if the server has a @CustomDomain@
-- specified.
--
-- 'cloudFormationStackArn', 'server_cloudFormationStackArn' - The ARN of the CloudFormation stack that was used to create the server.
--
-- 'backupRetentionCount', 'server_backupRetentionCount' - The number of automated backups to keep.
newServer ::
  Server
newServer :: Server
newServer =
  Server' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ServerStatus
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MaintenanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe [EngineAttribute]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Server
Server'
    { $sel:engineVersion:Server' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceRoleArn:Server' :: Maybe Text
serviceRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:disableAutomatedBackup:Server' :: Maybe Bool
disableAutomatedBackup = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:status:Server' :: Maybe ServerStatus
status = Maybe ServerStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceProfileArn:Server' :: Maybe Text
instanceProfileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:Server' :: Maybe [Text]
securityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:associatePublicIpAddress:Server' :: Maybe Bool
associatePublicIpAddress = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:Server' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:Server' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:keyPair:Server' :: Maybe Text
keyPair = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Server' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:serverArn:Server' :: Maybe Text
serverArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customDomain:Server' :: Maybe Text
customDomain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:Server' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maintenanceStatus:Server' :: Maybe MaintenanceStatus
maintenanceStatus = Maybe MaintenanceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:Server' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engineModel:Server' :: Maybe Text
engineModel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engineAttributes:Server' :: Maybe [EngineAttribute]
engineAttributes = Maybe [EngineAttribute]
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:Server' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredBackupWindow:Server' :: Maybe Text
preferredBackupWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:Server' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoint:Server' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cloudFormationStackArn:Server' :: Maybe Text
cloudFormationStackArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupRetentionCount:Server' :: Maybe Int
backupRetentionCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The engine version of the server. For a Chef server, the valid value for
-- EngineVersion is currently @2@. For a Puppet server, specify either
-- @2019@ or @2017@.
server_engineVersion :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_engineVersion :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_engineVersion = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:Server' :: Server -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:engineVersion:Server' :: Maybe Text
engineVersion = Maybe Text
a} :: Server)

-- | The service role ARN used to create the server.
server_serviceRoleArn :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_serviceRoleArn :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_serviceRoleArn = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
serviceRoleArn :: Maybe Text
$sel:serviceRoleArn:Server' :: Server -> Maybe Text
serviceRoleArn} -> Maybe Text
serviceRoleArn) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:serviceRoleArn:Server' :: Maybe Text
serviceRoleArn = Maybe Text
a} :: Server)

-- | Disables automated backups. The number of stored backups is dependent on
-- the value of PreferredBackupCount.
server_disableAutomatedBackup :: Lens.Lens' Server (Prelude.Maybe Prelude.Bool)
server_disableAutomatedBackup :: (Maybe Bool -> f (Maybe Bool)) -> Server -> f Server
server_disableAutomatedBackup = (Server -> Maybe Bool)
-> (Server -> Maybe Bool -> Server)
-> Lens Server Server (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Bool
disableAutomatedBackup :: Maybe Bool
$sel:disableAutomatedBackup:Server' :: Server -> Maybe Bool
disableAutomatedBackup} -> Maybe Bool
disableAutomatedBackup) (\s :: Server
s@Server' {} Maybe Bool
a -> Server
s {$sel:disableAutomatedBackup:Server' :: Maybe Bool
disableAutomatedBackup = Maybe Bool
a} :: Server)

-- | The server\'s status. This field displays the states of actions in
-- progress, such as creating, running, or backing up the server, as well
-- as the server\'s health state.
server_status :: Lens.Lens' Server (Prelude.Maybe ServerStatus)
server_status :: (Maybe ServerStatus -> f (Maybe ServerStatus))
-> Server -> f Server
server_status = (Server -> Maybe ServerStatus)
-> (Server -> Maybe ServerStatus -> Server)
-> Lens Server Server (Maybe ServerStatus) (Maybe ServerStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe ServerStatus
status :: Maybe ServerStatus
$sel:status:Server' :: Server -> Maybe ServerStatus
status} -> Maybe ServerStatus
status) (\s :: Server
s@Server' {} Maybe ServerStatus
a -> Server
s {$sel:status:Server' :: Maybe ServerStatus
status = Maybe ServerStatus
a} :: Server)

-- | The instance profile ARN of the server.
server_instanceProfileArn :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_instanceProfileArn :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_instanceProfileArn = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
instanceProfileArn :: Maybe Text
$sel:instanceProfileArn:Server' :: Server -> Maybe Text
instanceProfileArn} -> Maybe Text
instanceProfileArn) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:instanceProfileArn:Server' :: Maybe Text
instanceProfileArn = Maybe Text
a} :: Server)

-- | The security group IDs for the server, as specified in the
-- CloudFormation stack. These might not be the same security groups that
-- are shown in the EC2 console.
server_securityGroupIds :: Lens.Lens' Server (Prelude.Maybe [Prelude.Text])
server_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text])) -> Server -> f Server
server_securityGroupIds = (Server -> Maybe [Text])
-> (Server -> Maybe [Text] -> Server)
-> Lens Server Server (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:Server' :: Server -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: Server
s@Server' {} Maybe [Text]
a -> Server
s {$sel:securityGroupIds:Server' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: Server) ((Maybe [Text] -> f (Maybe [Text])) -> Server -> f Server)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Server
-> f Server
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Associate a public IP address with a server that you are launching.
server_associatePublicIpAddress :: Lens.Lens' Server (Prelude.Maybe Prelude.Bool)
server_associatePublicIpAddress :: (Maybe Bool -> f (Maybe Bool)) -> Server -> f Server
server_associatePublicIpAddress = (Server -> Maybe Bool)
-> (Server -> Maybe Bool -> Server)
-> Lens Server Server (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Bool
associatePublicIpAddress :: Maybe Bool
$sel:associatePublicIpAddress:Server' :: Server -> Maybe Bool
associatePublicIpAddress} -> Maybe Bool
associatePublicIpAddress) (\s :: Server
s@Server' {} Maybe Bool
a -> Server
s {$sel:associatePublicIpAddress:Server' :: Maybe Bool
associatePublicIpAddress = Maybe Bool
a} :: Server)

-- | The name of the server.
server_serverName :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_serverName :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_serverName = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
serverName :: Maybe Text
$sel:serverName:Server' :: Server -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:serverName:Server' :: Maybe Text
serverName = Maybe Text
a} :: Server)

-- | The subnet IDs specified in a CreateServer request.
server_subnetIds :: Lens.Lens' Server (Prelude.Maybe [Prelude.Text])
server_subnetIds :: (Maybe [Text] -> f (Maybe [Text])) -> Server -> f Server
server_subnetIds = (Server -> Maybe [Text])
-> (Server -> Maybe [Text] -> Server)
-> Lens Server Server (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:Server' :: Server -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: Server
s@Server' {} Maybe [Text]
a -> Server
s {$sel:subnetIds:Server' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: Server) ((Maybe [Text] -> f (Maybe [Text])) -> Server -> f Server)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Server
-> f Server
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The key pair associated with the server.
server_keyPair :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_keyPair :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_keyPair = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
keyPair :: Maybe Text
$sel:keyPair:Server' :: Server -> Maybe Text
keyPair} -> Maybe Text
keyPair) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:keyPair:Server' :: Maybe Text
keyPair = Maybe Text
a} :: Server)

-- | Time stamp of server creation. Example @2016-07-29T13:38:47.520Z@
server_createdAt :: Lens.Lens' Server (Prelude.Maybe Prelude.UTCTime)
server_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Server -> f Server
server_createdAt = (Server -> Maybe POSIX)
-> (Server -> Maybe POSIX -> Server)
-> Lens Server Server (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Server' :: Server -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Server
s@Server' {} Maybe POSIX
a -> Server
s {$sel:createdAt:Server' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Server) ((Maybe POSIX -> f (Maybe POSIX)) -> Server -> f Server)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Server
-> f Server
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ARN of the server.
server_serverArn :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_serverArn :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_serverArn = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
serverArn :: Maybe Text
$sel:serverArn:Server' :: Server -> Maybe Text
serverArn} -> Maybe Text
serverArn) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:serverArn:Server' :: Maybe Text
serverArn = Maybe Text
a} :: Server)

-- | An optional public endpoint of a server, such as
-- @https:\/\/aws.my-company.com@. You cannot access the server by using
-- the @Endpoint@ value if the server has a @CustomDomain@ specified.
server_customDomain :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_customDomain :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_customDomain = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
customDomain :: Maybe Text
$sel:customDomain:Server' :: Server -> Maybe Text
customDomain} -> Maybe Text
customDomain) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:customDomain:Server' :: Maybe Text
customDomain = Maybe Text
a} :: Server)

-- | The engine type of the server. Valid values in this release include
-- @ChefAutomate@ and @Puppet@.
server_engine :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_engine :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_engine = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
engine :: Maybe Text
$sel:engine:Server' :: Server -> Maybe Text
engine} -> Maybe Text
engine) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:engine:Server' :: Maybe Text
engine = Maybe Text
a} :: Server)

-- | The status of the most recent server maintenance run. Shows @SUCCESS@ or
-- @FAILED@.
server_maintenanceStatus :: Lens.Lens' Server (Prelude.Maybe MaintenanceStatus)
server_maintenanceStatus :: (Maybe MaintenanceStatus -> f (Maybe MaintenanceStatus))
-> Server -> f Server
server_maintenanceStatus = (Server -> Maybe MaintenanceStatus)
-> (Server -> Maybe MaintenanceStatus -> Server)
-> Lens
     Server Server (Maybe MaintenanceStatus) (Maybe MaintenanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe MaintenanceStatus
maintenanceStatus :: Maybe MaintenanceStatus
$sel:maintenanceStatus:Server' :: Server -> Maybe MaintenanceStatus
maintenanceStatus} -> Maybe MaintenanceStatus
maintenanceStatus) (\s :: Server
s@Server' {} Maybe MaintenanceStatus
a -> Server
s {$sel:maintenanceStatus:Server' :: Maybe MaintenanceStatus
maintenanceStatus = Maybe MaintenanceStatus
a} :: Server)

-- | The instance type for the server, as specified in the CloudFormation
-- stack. This might not be the same instance type that is shown in the EC2
-- console.
server_instanceType :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_instanceType :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_instanceType = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:Server' :: Server -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:instanceType:Server' :: Maybe Text
instanceType = Maybe Text
a} :: Server)

-- | The engine model of the server. Valid values in this release include
-- @Monolithic@ for Puppet and @Single@ for Chef.
server_engineModel :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_engineModel :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_engineModel = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
engineModel :: Maybe Text
$sel:engineModel:Server' :: Server -> Maybe Text
engineModel} -> Maybe Text
engineModel) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:engineModel:Server' :: Maybe Text
engineModel = Maybe Text
a} :: Server)

-- | The response of a createServer() request returns the master credential
-- to access the server in EngineAttributes. These credentials are not
-- stored by AWS OpsWorks CM; they are returned only as part of the result
-- of createServer().
--
-- __Attributes returned in a createServer response for Chef__
--
-- -   @CHEF_AUTOMATE_PIVOTAL_KEY@: A base64-encoded RSA private key that
--     is generated by AWS OpsWorks for Chef Automate. This private key is
--     required to access the Chef API.
--
-- -   @CHEF_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file contains
--     a Chef starter kit, which includes a README, a configuration file,
--     and the required RSA private key. Save this file, unzip it, and then
--     change to the directory where you\'ve unzipped the file contents.
--     From this directory, you can run Knife commands.
--
-- __Attributes returned in a createServer response for Puppet__
--
-- -   @PUPPET_STARTER_KIT@: A base64-encoded ZIP file. The ZIP file
--     contains a Puppet starter kit, including a README and a required
--     private key. Save this file, unzip it, and then change to the
--     directory where you\'ve unzipped the file contents.
--
-- -   @PUPPET_ADMIN_PASSWORD@: An administrator password that you can use
--     to sign in to the Puppet Enterprise console after the server is
--     online.
server_engineAttributes :: Lens.Lens' Server (Prelude.Maybe [EngineAttribute])
server_engineAttributes :: (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> Server -> f Server
server_engineAttributes = (Server -> Maybe [EngineAttribute])
-> (Server -> Maybe [EngineAttribute] -> Server)
-> Lens
     Server Server (Maybe [EngineAttribute]) (Maybe [EngineAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe [EngineAttribute]
engineAttributes :: Maybe [EngineAttribute]
$sel:engineAttributes:Server' :: Server -> Maybe [EngineAttribute]
engineAttributes} -> Maybe [EngineAttribute]
engineAttributes) (\s :: Server
s@Server' {} Maybe [EngineAttribute]
a -> Server
s {$sel:engineAttributes:Server' :: Maybe [EngineAttribute]
engineAttributes = Maybe [EngineAttribute]
a} :: Server) ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
 -> Server -> f Server)
-> ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
    -> Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> Server
-> f Server
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
-> Iso
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
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 AnIso
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The preferred maintenance period specified for the server.
server_preferredMaintenanceWindow :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_preferredMaintenanceWindow = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:Server' :: Server -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:preferredMaintenanceWindow:Server' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: Server)

-- | The preferred backup period specified for the server.
server_preferredBackupWindow :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_preferredBackupWindow :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_preferredBackupWindow = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
preferredBackupWindow :: Maybe Text
$sel:preferredBackupWindow:Server' :: Server -> Maybe Text
preferredBackupWindow} -> Maybe Text
preferredBackupWindow) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:preferredBackupWindow:Server' :: Maybe Text
preferredBackupWindow = Maybe Text
a} :: Server)

-- | Depending on the server status, this field has either a human-readable
-- message (such as a create or backup error), or an escaped block of JSON
-- (used for health check results).
server_statusReason :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_statusReason :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_statusReason = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:Server' :: Server -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:statusReason:Server' :: Maybe Text
statusReason = Maybe Text
a} :: Server)

-- | A DNS name that can be used to access the engine. Example:
-- @myserver-asdfghjkl.us-east-1.opsworks.io@. You cannot access the server
-- by using the @Endpoint@ value if the server has a @CustomDomain@
-- specified.
server_endpoint :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_endpoint :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_endpoint = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:Server' :: Server -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:endpoint:Server' :: Maybe Text
endpoint = Maybe Text
a} :: Server)

-- | The ARN of the CloudFormation stack that was used to create the server.
server_cloudFormationStackArn :: Lens.Lens' Server (Prelude.Maybe Prelude.Text)
server_cloudFormationStackArn :: (Maybe Text -> f (Maybe Text)) -> Server -> f Server
server_cloudFormationStackArn = (Server -> Maybe Text)
-> (Server -> Maybe Text -> Server)
-> Lens Server Server (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Text
cloudFormationStackArn :: Maybe Text
$sel:cloudFormationStackArn:Server' :: Server -> Maybe Text
cloudFormationStackArn} -> Maybe Text
cloudFormationStackArn) (\s :: Server
s@Server' {} Maybe Text
a -> Server
s {$sel:cloudFormationStackArn:Server' :: Maybe Text
cloudFormationStackArn = Maybe Text
a} :: Server)

-- | The number of automated backups to keep.
server_backupRetentionCount :: Lens.Lens' Server (Prelude.Maybe Prelude.Int)
server_backupRetentionCount :: (Maybe Int -> f (Maybe Int)) -> Server -> f Server
server_backupRetentionCount = (Server -> Maybe Int)
-> (Server -> Maybe Int -> Server)
-> Lens Server Server (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Server' {Maybe Int
backupRetentionCount :: Maybe Int
$sel:backupRetentionCount:Server' :: Server -> Maybe Int
backupRetentionCount} -> Maybe Int
backupRetentionCount) (\s :: Server
s@Server' {} Maybe Int
a -> Server
s {$sel:backupRetentionCount:Server' :: Maybe Int
backupRetentionCount = Maybe Int
a} :: Server)

instance Core.FromJSON Server where
  parseJSON :: Value -> Parser Server
parseJSON =
    String -> (Object -> Parser Server) -> Value -> Parser Server
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Server"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ServerStatus
-> Maybe Text
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe MaintenanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe [EngineAttribute]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Server
Server'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe ServerStatus
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe MaintenanceStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe [EngineAttribute]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe ServerStatus
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineVersion")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe ServerStatus
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe ServerStatus
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceRoleArn")
            Parser
  (Maybe Bool
   -> Maybe ServerStatus
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Bool)
-> Parser
     (Maybe ServerStatus
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisableAutomatedBackup")
            Parser
  (Maybe ServerStatus
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe ServerStatus)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServerStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceProfileArn")
            Parser
  (Maybe [Text]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroupIds"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssociatePublicIpAddress")
            Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServerName")
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KeyPair")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServerArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CustomDomain")
            Parser
  (Maybe Text
   -> Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe MaintenanceStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Engine")
            Parser
  (Maybe MaintenanceStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe MaintenanceStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MaintenanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaintenanceStatus")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceType")
            Parser
  (Maybe Text
   -> Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe [EngineAttribute]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineModel")
            Parser
  (Maybe [EngineAttribute]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe [EngineAttribute])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [EngineAttribute]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EngineAttributes"
                            Parser (Maybe (Maybe [EngineAttribute]))
-> Maybe [EngineAttribute] -> Parser (Maybe [EngineAttribute])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EngineAttribute]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreferredMaintenanceWindow")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Server)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreferredBackupWindow")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Int -> Server)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Int -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusReason")
            Parser (Maybe Text -> Maybe Text -> Maybe Int -> Server)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Endpoint")
            Parser (Maybe Text -> Maybe Int -> Server)
-> Parser (Maybe Text) -> Parser (Maybe Int -> Server)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CloudFormationStackArn")
            Parser (Maybe Int -> Server) -> Parser (Maybe Int) -> Parser Server
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BackupRetentionCount")
      )

instance Prelude.Hashable Server

instance Prelude.NFData Server