{-# 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.Lightsail.Types.Instance
-- 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.Lightsail.Types.Instance where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.AddOn
import Amazonka.Lightsail.Types.InstanceHardware
import Amazonka.Lightsail.Types.InstanceNetworking
import Amazonka.Lightsail.Types.InstanceState
import Amazonka.Lightsail.Types.IpAddressType
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import Amazonka.Lightsail.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes an instance (a virtual private server).
--
-- /See:/ 'newInstance' smart constructor.
data Instance = Instance'
  { -- | The status code and the state (e.g., @running@) for the instance.
    Instance -> Maybe InstanceState
state :: Prelude.Maybe InstanceState,
    -- | The type of resource (usually @Instance@).
    Instance -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The Amazon Resource Name (ARN) of the instance (e.g.,
    -- @arn:aws:lightsail:us-east-2:123456789101:Instance\/244ad76f-8aad-4741-809f-12345EXAMPLE@).
    Instance -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the instance was created (e.g., @1479734909.17@) in
    -- Unix time format.
    Instance -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The region name and Availability Zone where the instance is located.
    Instance -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The name of the SSH key being used to connect to the instance (e.g.,
    -- @LightsailDefaultKeyPair@).
    Instance -> Maybe Text
sshKeyName :: Prelude.Maybe Prelude.Text,
    -- | An array of objects representing the add-ons enabled on the instance.
    Instance -> Maybe [AddOn]
addOns :: Prelude.Maybe [AddOn],
    -- | The user name for connecting to the instance (e.g., @ec2-user@).
    Instance -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | Information about the public ports and monthly data transfer rates for
    -- the instance.
    Instance -> Maybe InstanceNetworking
networking :: Prelude.Maybe InstanceNetworking,
    -- | The bundle for the instance (e.g., @micro_1_0@).
    Instance -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
    -- | The name the user gave the instance (e.g., @Amazon_Linux-1GB-Ohio-1@).
    Instance -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The IP address type of the instance.
    --
    -- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
    -- and IPv6.
    Instance -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType,
    -- | The support code. Include this code in your email to support when you
    -- have questions about an instance or another resource in Lightsail. This
    -- code enables our support team to look up your Lightsail information more
    -- easily.
    Instance -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
    -- | The blueprint ID (e.g., @os_amlinux_2016_03@).
    Instance -> Maybe Text
blueprintId :: Prelude.Maybe Prelude.Text,
    -- | The private IP address of the instance.
    Instance -> Maybe Text
privateIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The friendly name of the blueprint (e.g., @Amazon Linux@).
    Instance -> Maybe Text
blueprintName :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether this instance has a static IP
    -- assigned to it.
    Instance -> Maybe Bool
isStaticIp :: Prelude.Maybe Prelude.Bool,
    -- | The public IP address of the instance.
    Instance -> Maybe Text
publicIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The size of the vCPU and the amount of RAM for the instance.
    Instance -> Maybe InstanceHardware
hardware :: Prelude.Maybe InstanceHardware,
    -- | The IPv6 addresses of the instance.
    Instance -> Maybe [Text]
ipv6Addresses :: Prelude.Maybe [Prelude.Text],
    -- | The tag keys and optional values for the resource. For more information
    -- about tags in Lightsail, see the
    -- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
    Instance -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (Instance -> Instance -> Bool
(Instance -> Instance -> Bool)
-> (Instance -> Instance -> Bool) -> Eq Instance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c== :: Instance -> Instance -> Bool
Prelude.Eq, ReadPrec [Instance]
ReadPrec Instance
Int -> ReadS Instance
ReadS [Instance]
(Int -> ReadS Instance)
-> ReadS [Instance]
-> ReadPrec Instance
-> ReadPrec [Instance]
-> Read Instance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Instance]
$creadListPrec :: ReadPrec [Instance]
readPrec :: ReadPrec Instance
$creadPrec :: ReadPrec Instance
readList :: ReadS [Instance]
$creadList :: ReadS [Instance]
readsPrec :: Int -> ReadS Instance
$creadsPrec :: Int -> ReadS Instance
Prelude.Read, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
(Int -> Instance -> ShowS)
-> (Instance -> String) -> ([Instance] -> ShowS) -> Show Instance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instance] -> ShowS
$cshowList :: [Instance] -> ShowS
show :: Instance -> String
$cshow :: Instance -> String
showsPrec :: Int -> Instance -> ShowS
$cshowsPrec :: Int -> Instance -> ShowS
Prelude.Show, (forall x. Instance -> Rep Instance x)
-> (forall x. Rep Instance x -> Instance) -> Generic Instance
forall x. Rep Instance x -> Instance
forall x. Instance -> Rep Instance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instance x -> Instance
$cfrom :: forall x. Instance -> Rep Instance x
Prelude.Generic)

-- |
-- Create a value of 'Instance' 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:
--
-- 'state', 'instance_state' - The status code and the state (e.g., @running@) for the instance.
--
-- 'resourceType', 'instance_resourceType' - The type of resource (usually @Instance@).
--
-- 'arn', 'instance_arn' - The Amazon Resource Name (ARN) of the instance (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:Instance\/244ad76f-8aad-4741-809f-12345EXAMPLE@).
--
-- 'createdAt', 'instance_createdAt' - The timestamp when the instance was created (e.g., @1479734909.17@) in
-- Unix time format.
--
-- 'location', 'instance_location' - The region name and Availability Zone where the instance is located.
--
-- 'sshKeyName', 'instance_sshKeyName' - The name of the SSH key being used to connect to the instance (e.g.,
-- @LightsailDefaultKeyPair@).
--
-- 'addOns', 'instance_addOns' - An array of objects representing the add-ons enabled on the instance.
--
-- 'username', 'instance_username' - The user name for connecting to the instance (e.g., @ec2-user@).
--
-- 'networking', 'instance_networking' - Information about the public ports and monthly data transfer rates for
-- the instance.
--
-- 'bundleId', 'instance_bundleId' - The bundle for the instance (e.g., @micro_1_0@).
--
-- 'name', 'instance_name' - The name the user gave the instance (e.g., @Amazon_Linux-1GB-Ohio-1@).
--
-- 'ipAddressType', 'instance_ipAddressType' - The IP address type of the instance.
--
-- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
-- and IPv6.
--
-- 'supportCode', 'instance_supportCode' - The support code. Include this code in your email to support when you
-- have questions about an instance or another resource in Lightsail. This
-- code enables our support team to look up your Lightsail information more
-- easily.
--
-- 'blueprintId', 'instance_blueprintId' - The blueprint ID (e.g., @os_amlinux_2016_03@).
--
-- 'privateIpAddress', 'instance_privateIpAddress' - The private IP address of the instance.
--
-- 'blueprintName', 'instance_blueprintName' - The friendly name of the blueprint (e.g., @Amazon Linux@).
--
-- 'isStaticIp', 'instance_isStaticIp' - A Boolean value indicating whether this instance has a static IP
-- assigned to it.
--
-- 'publicIpAddress', 'instance_publicIpAddress' - The public IP address of the instance.
--
-- 'hardware', 'instance_hardware' - The size of the vCPU and the amount of RAM for the instance.
--
-- 'ipv6Addresses', 'instance_ipv6Addresses' - The IPv6 addresses of the instance.
--
-- 'tags', 'instance_tags' - The tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
newInstance ::
  Instance
newInstance :: Instance
newInstance =
  Instance' :: Maybe InstanceState
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe [AddOn]
-> Maybe Text
-> Maybe InstanceNetworking
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe InstanceHardware
-> Maybe [Text]
-> Maybe [Tag]
-> Instance
Instance'
    { $sel:state:Instance' :: Maybe InstanceState
state = Maybe InstanceState
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:Instance' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Instance' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Instance' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:location:Instance' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:sshKeyName:Instance' :: Maybe Text
sshKeyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:addOns:Instance' :: Maybe [AddOn]
addOns = Maybe [AddOn]
forall a. Maybe a
Prelude.Nothing,
      $sel:username:Instance' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networking:Instance' :: Maybe InstanceNetworking
networking = Maybe InstanceNetworking
forall a. Maybe a
Prelude.Nothing,
      $sel:bundleId:Instance' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Instance' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressType:Instance' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
forall a. Maybe a
Prelude.Nothing,
      $sel:supportCode:Instance' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintId:Instance' :: Maybe Text
blueprintId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privateIpAddress:Instance' :: Maybe Text
privateIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintName:Instance' :: Maybe Text
blueprintName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isStaticIp:Instance' :: Maybe Bool
isStaticIp = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:publicIpAddress:Instance' :: Maybe Text
publicIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hardware:Instance' :: Maybe InstanceHardware
hardware = Maybe InstanceHardware
forall a. Maybe a
Prelude.Nothing,
      $sel:ipv6Addresses:Instance' :: Maybe [Text]
ipv6Addresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Instance' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The status code and the state (e.g., @running@) for the instance.
instance_state :: Lens.Lens' Instance (Prelude.Maybe InstanceState)
instance_state :: (Maybe InstanceState -> f (Maybe InstanceState))
-> Instance -> f Instance
instance_state = (Instance -> Maybe InstanceState)
-> (Instance -> Maybe InstanceState -> Instance)
-> Lens
     Instance Instance (Maybe InstanceState) (Maybe InstanceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceState
state :: Maybe InstanceState
$sel:state:Instance' :: Instance -> Maybe InstanceState
state} -> Maybe InstanceState
state) (\s :: Instance
s@Instance' {} Maybe InstanceState
a -> Instance
s {$sel:state:Instance' :: Maybe InstanceState
state = Maybe InstanceState
a} :: Instance)

-- | The type of resource (usually @Instance@).
instance_resourceType :: Lens.Lens' Instance (Prelude.Maybe ResourceType)
instance_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> Instance -> f Instance
instance_resourceType = (Instance -> Maybe ResourceType)
-> (Instance -> Maybe ResourceType -> Instance)
-> Lens Instance Instance (Maybe ResourceType) (Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:Instance' :: Instance -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: Instance
s@Instance' {} Maybe ResourceType
a -> Instance
s {$sel:resourceType:Instance' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: Instance)

-- | The Amazon Resource Name (ARN) of the instance (e.g.,
-- @arn:aws:lightsail:us-east-2:123456789101:Instance\/244ad76f-8aad-4741-809f-12345EXAMPLE@).
instance_arn :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_arn :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_arn = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
arn :: Maybe Text
$sel:arn:Instance' :: Instance -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:arn:Instance' :: Maybe Text
arn = Maybe Text
a} :: Instance)

-- | The timestamp when the instance was created (e.g., @1479734909.17@) in
-- Unix time format.
instance_createdAt :: Lens.Lens' Instance (Prelude.Maybe Prelude.UTCTime)
instance_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Instance -> f Instance
instance_createdAt = (Instance -> Maybe POSIX)
-> (Instance -> Maybe POSIX -> Instance)
-> Lens Instance Instance (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Instance' :: Instance -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Instance
s@Instance' {} Maybe POSIX
a -> Instance
s {$sel:createdAt:Instance' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Instance) ((Maybe POSIX -> f (Maybe POSIX)) -> Instance -> f Instance)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Instance
-> f Instance
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 region name and Availability Zone where the instance is located.
instance_location :: Lens.Lens' Instance (Prelude.Maybe ResourceLocation)
instance_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> Instance -> f Instance
instance_location = (Instance -> Maybe ResourceLocation)
-> (Instance -> Maybe ResourceLocation -> Instance)
-> Lens
     Instance Instance (Maybe ResourceLocation) (Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:Instance' :: Instance -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: Instance
s@Instance' {} Maybe ResourceLocation
a -> Instance
s {$sel:location:Instance' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: Instance)

-- | The name of the SSH key being used to connect to the instance (e.g.,
-- @LightsailDefaultKeyPair@).
instance_sshKeyName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_sshKeyName :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_sshKeyName = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
sshKeyName :: Maybe Text
$sel:sshKeyName:Instance' :: Instance -> Maybe Text
sshKeyName} -> Maybe Text
sshKeyName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:sshKeyName:Instance' :: Maybe Text
sshKeyName = Maybe Text
a} :: Instance)

-- | An array of objects representing the add-ons enabled on the instance.
instance_addOns :: Lens.Lens' Instance (Prelude.Maybe [AddOn])
instance_addOns :: (Maybe [AddOn] -> f (Maybe [AddOn])) -> Instance -> f Instance
instance_addOns = (Instance -> Maybe [AddOn])
-> (Instance -> Maybe [AddOn] -> Instance)
-> Lens Instance Instance (Maybe [AddOn]) (Maybe [AddOn])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe [AddOn]
addOns :: Maybe [AddOn]
$sel:addOns:Instance' :: Instance -> Maybe [AddOn]
addOns} -> Maybe [AddOn]
addOns) (\s :: Instance
s@Instance' {} Maybe [AddOn]
a -> Instance
s {$sel:addOns:Instance' :: Maybe [AddOn]
addOns = Maybe [AddOn]
a} :: Instance) ((Maybe [AddOn] -> f (Maybe [AddOn])) -> Instance -> f Instance)
-> ((Maybe [AddOn] -> f (Maybe [AddOn]))
    -> Maybe [AddOn] -> f (Maybe [AddOn]))
-> (Maybe [AddOn] -> f (Maybe [AddOn]))
-> Instance
-> f Instance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [AddOn] [AddOn] [AddOn] [AddOn]
-> Iso
     (Maybe [AddOn]) (Maybe [AddOn]) (Maybe [AddOn]) (Maybe [AddOn])
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 [AddOn] [AddOn] [AddOn] [AddOn]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user name for connecting to the instance (e.g., @ec2-user@).
instance_username :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_username :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_username = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
username :: Maybe Text
$sel:username:Instance' :: Instance -> Maybe Text
username} -> Maybe Text
username) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:username:Instance' :: Maybe Text
username = Maybe Text
a} :: Instance)

-- | Information about the public ports and monthly data transfer rates for
-- the instance.
instance_networking :: Lens.Lens' Instance (Prelude.Maybe InstanceNetworking)
instance_networking :: (Maybe InstanceNetworking -> f (Maybe InstanceNetworking))
-> Instance -> f Instance
instance_networking = (Instance -> Maybe InstanceNetworking)
-> (Instance -> Maybe InstanceNetworking -> Instance)
-> Lens
     Instance
     Instance
     (Maybe InstanceNetworking)
     (Maybe InstanceNetworking)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceNetworking
networking :: Maybe InstanceNetworking
$sel:networking:Instance' :: Instance -> Maybe InstanceNetworking
networking} -> Maybe InstanceNetworking
networking) (\s :: Instance
s@Instance' {} Maybe InstanceNetworking
a -> Instance
s {$sel:networking:Instance' :: Maybe InstanceNetworking
networking = Maybe InstanceNetworking
a} :: Instance)

-- | The bundle for the instance (e.g., @micro_1_0@).
instance_bundleId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_bundleId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_bundleId = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:Instance' :: Instance -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:bundleId:Instance' :: Maybe Text
bundleId = Maybe Text
a} :: Instance)

-- | The name the user gave the instance (e.g., @Amazon_Linux-1GB-Ohio-1@).
instance_name :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_name :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_name = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
name :: Maybe Text
$sel:name:Instance' :: Instance -> Maybe Text
name} -> Maybe Text
name) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:name:Instance' :: Maybe Text
name = Maybe Text
a} :: Instance)

-- | The IP address type of the instance.
--
-- The possible values are @ipv4@ for IPv4 only, and @dualstack@ for IPv4
-- and IPv6.
instance_ipAddressType :: Lens.Lens' Instance (Prelude.Maybe IpAddressType)
instance_ipAddressType :: (Maybe IpAddressType -> f (Maybe IpAddressType))
-> Instance -> f Instance
instance_ipAddressType = (Instance -> Maybe IpAddressType)
-> (Instance -> Maybe IpAddressType -> Instance)
-> Lens
     Instance Instance (Maybe IpAddressType) (Maybe IpAddressType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:Instance' :: Instance -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: Instance
s@Instance' {} Maybe IpAddressType
a -> Instance
s {$sel:ipAddressType:Instance' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: Instance)

-- | The support code. Include this code in your email to support when you
-- have questions about an instance or another resource in Lightsail. This
-- code enables our support team to look up your Lightsail information more
-- easily.
instance_supportCode :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_supportCode :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_supportCode = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:Instance' :: Instance -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:supportCode:Instance' :: Maybe Text
supportCode = Maybe Text
a} :: Instance)

-- | The blueprint ID (e.g., @os_amlinux_2016_03@).
instance_blueprintId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_blueprintId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_blueprintId = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
blueprintId :: Maybe Text
$sel:blueprintId:Instance' :: Instance -> Maybe Text
blueprintId} -> Maybe Text
blueprintId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:blueprintId:Instance' :: Maybe Text
blueprintId = Maybe Text
a} :: Instance)

-- | The private IP address of the instance.
instance_privateIpAddress :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_privateIpAddress :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_privateIpAddress = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
privateIpAddress :: Maybe Text
$sel:privateIpAddress:Instance' :: Instance -> Maybe Text
privateIpAddress} -> Maybe Text
privateIpAddress) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:privateIpAddress:Instance' :: Maybe Text
privateIpAddress = Maybe Text
a} :: Instance)

-- | The friendly name of the blueprint (e.g., @Amazon Linux@).
instance_blueprintName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_blueprintName :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_blueprintName = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
blueprintName :: Maybe Text
$sel:blueprintName:Instance' :: Instance -> Maybe Text
blueprintName} -> Maybe Text
blueprintName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:blueprintName:Instance' :: Maybe Text
blueprintName = Maybe Text
a} :: Instance)

-- | A Boolean value indicating whether this instance has a static IP
-- assigned to it.
instance_isStaticIp :: Lens.Lens' Instance (Prelude.Maybe Prelude.Bool)
instance_isStaticIp :: (Maybe Bool -> f (Maybe Bool)) -> Instance -> f Instance
instance_isStaticIp = (Instance -> Maybe Bool)
-> (Instance -> Maybe Bool -> Instance)
-> Lens Instance Instance (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Bool
isStaticIp :: Maybe Bool
$sel:isStaticIp:Instance' :: Instance -> Maybe Bool
isStaticIp} -> Maybe Bool
isStaticIp) (\s :: Instance
s@Instance' {} Maybe Bool
a -> Instance
s {$sel:isStaticIp:Instance' :: Maybe Bool
isStaticIp = Maybe Bool
a} :: Instance)

-- | The public IP address of the instance.
instance_publicIpAddress :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_publicIpAddress :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_publicIpAddress = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
publicIpAddress :: Maybe Text
$sel:publicIpAddress:Instance' :: Instance -> Maybe Text
publicIpAddress} -> Maybe Text
publicIpAddress) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:publicIpAddress:Instance' :: Maybe Text
publicIpAddress = Maybe Text
a} :: Instance)

-- | The size of the vCPU and the amount of RAM for the instance.
instance_hardware :: Lens.Lens' Instance (Prelude.Maybe InstanceHardware)
instance_hardware :: (Maybe InstanceHardware -> f (Maybe InstanceHardware))
-> Instance -> f Instance
instance_hardware = (Instance -> Maybe InstanceHardware)
-> (Instance -> Maybe InstanceHardware -> Instance)
-> Lens
     Instance Instance (Maybe InstanceHardware) (Maybe InstanceHardware)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceHardware
hardware :: Maybe InstanceHardware
$sel:hardware:Instance' :: Instance -> Maybe InstanceHardware
hardware} -> Maybe InstanceHardware
hardware) (\s :: Instance
s@Instance' {} Maybe InstanceHardware
a -> Instance
s {$sel:hardware:Instance' :: Maybe InstanceHardware
hardware = Maybe InstanceHardware
a} :: Instance)

-- | The IPv6 addresses of the instance.
instance_ipv6Addresses :: Lens.Lens' Instance (Prelude.Maybe [Prelude.Text])
instance_ipv6Addresses :: (Maybe [Text] -> f (Maybe [Text])) -> Instance -> f Instance
instance_ipv6Addresses = (Instance -> Maybe [Text])
-> (Instance -> Maybe [Text] -> Instance)
-> Lens Instance Instance (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe [Text]
ipv6Addresses :: Maybe [Text]
$sel:ipv6Addresses:Instance' :: Instance -> Maybe [Text]
ipv6Addresses} -> Maybe [Text]
ipv6Addresses) (\s :: Instance
s@Instance' {} Maybe [Text]
a -> Instance
s {$sel:ipv6Addresses:Instance' :: Maybe [Text]
ipv6Addresses = Maybe [Text]
a} :: Instance) ((Maybe [Text] -> f (Maybe [Text])) -> Instance -> f Instance)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> Instance
-> f Instance
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 tag keys and optional values for the resource. For more information
-- about tags in Lightsail, see the
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-tags Amazon Lightsail Developer Guide>.
instance_tags :: Lens.Lens' Instance (Prelude.Maybe [Tag])
instance_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Instance -> f Instance
instance_tags = (Instance -> Maybe [Tag])
-> (Instance -> Maybe [Tag] -> Instance)
-> Lens Instance Instance (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Instance' :: Instance -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Instance
s@Instance' {} Maybe [Tag]
a -> Instance
s {$sel:tags:Instance' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Instance) ((Maybe [Tag] -> f (Maybe [Tag])) -> Instance -> f Instance)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Instance
-> f Instance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Instance where
  parseJSON :: Value -> Parser Instance
parseJSON =
    String -> (Object -> Parser Instance) -> Value -> Parser Instance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Instance"
      ( \Object
x ->
          Maybe InstanceState
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe [AddOn]
-> Maybe Text
-> Maybe InstanceNetworking
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe InstanceHardware
-> Maybe [Text]
-> Maybe [Tag]
-> Instance
Instance'
            (Maybe InstanceState
 -> Maybe ResourceType
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ResourceLocation
 -> Maybe Text
 -> Maybe [AddOn]
 -> Maybe Text
 -> Maybe InstanceNetworking
 -> Maybe Text
 -> Maybe Text
 -> Maybe IpAddressType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe InstanceHardware
 -> Maybe [Text]
 -> Maybe [Tag]
 -> Instance)
-> Parser (Maybe InstanceState)
-> Parser
     (Maybe ResourceType
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InstanceState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe ResourceType
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe ResourceType)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe ResourceLocation
   -> Maybe Text
   -> Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceLocation
      -> Maybe Text
      -> Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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 ResourceLocation
   -> Maybe Text
   -> Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe ResourceLocation)
-> Parser
     (Maybe Text
      -> Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
            Parser
  (Maybe Text
   -> Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AddOn]
      -> Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"sshKeyName")
            Parser
  (Maybe [AddOn]
   -> Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe [AddOn])
-> Parser
     (Maybe Text
      -> Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AddOn]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"addOns" Parser (Maybe (Maybe [AddOn]))
-> Maybe [AddOn] -> Parser (Maybe [AddOn])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AddOn]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe InstanceNetworking
      -> Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"username")
            Parser
  (Maybe InstanceNetworking
   -> Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe InstanceNetworking)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceNetworking)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networking")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"bundleId")
            Parser
  (Maybe Text
   -> Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe IpAddressType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"name")
            Parser
  (Maybe IpAddressType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe IpAddressType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IpAddressType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ipAddressType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"supportCode")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"blueprintId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"privateIpAddress")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"blueprintName")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe InstanceHardware
      -> Maybe [Text]
      -> Maybe [Tag]
      -> Instance)
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
"isStaticIp")
            Parser
  (Maybe Text
   -> Maybe InstanceHardware
   -> Maybe [Text]
   -> Maybe [Tag]
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe InstanceHardware -> Maybe [Text] -> Maybe [Tag] -> Instance)
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
"publicIpAddress")
            Parser
  (Maybe InstanceHardware -> Maybe [Text] -> Maybe [Tag] -> Instance)
-> Parser (Maybe InstanceHardware)
-> Parser (Maybe [Text] -> Maybe [Tag] -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceHardware)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hardware")
            Parser (Maybe [Text] -> Maybe [Tag] -> Instance)
-> Parser (Maybe [Text]) -> Parser (Maybe [Tag] -> Instance)
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
"ipv6Addresses" 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 [Tag] -> Instance)
-> Parser (Maybe [Tag]) -> Parser Instance
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Instance

instance Prelude.NFData Instance