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

import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.EbsVolume
import Amazonka.EMR.Types.InstanceStatus
import Amazonka.EMR.Types.MarketType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents an EC2 instance provisioned as part of cluster.
--
-- /See:/ 'newInstance' smart constructor.
data Instance = Instance'
  { -- | The current status of the instance.
    Instance -> Maybe InstanceStatus
status :: Prelude.Maybe InstanceStatus,
    -- | The public DNS name of the instance.
    Instance -> Maybe Text
publicDnsName :: Prelude.Maybe Prelude.Text,
    -- | The list of Amazon EBS volumes that are attached to this instance.
    Instance -> Maybe [EbsVolume]
ebsVolumes :: Prelude.Maybe [EbsVolume],
    -- | The unique identifier of the instance in Amazon EC2.
    Instance -> Maybe Text
ec2InstanceId :: Prelude.Maybe Prelude.Text,
    -- | The EC2 instance type, for example @m3.xlarge@.
    Instance -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The instance purchasing option. Valid values are @ON_DEMAND@ or @SPOT@.
    Instance -> Maybe MarketType
market :: Prelude.Maybe MarketType,
    -- | The private IP address of the instance.
    Instance -> Maybe Text
privateIpAddress :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the instance fleet to which an EC2 instance
    -- belongs.
    Instance -> Maybe Text
instanceFleetId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the instance in Amazon EMR.
    Instance -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the instance group to which this instance belongs.
    Instance -> Maybe Text
instanceGroupId :: Prelude.Maybe Prelude.Text,
    -- | The private DNS name of the instance.
    Instance -> Maybe Text
privateDnsName :: Prelude.Maybe Prelude.Text,
    -- | The public IP address of the instance.
    Instance -> Maybe Text
publicIpAddress :: Prelude.Maybe Prelude.Text
  }
  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:
--
-- 'status', 'instance_status' - The current status of the instance.
--
-- 'publicDnsName', 'instance_publicDnsName' - The public DNS name of the instance.
--
-- 'ebsVolumes', 'instance_ebsVolumes' - The list of Amazon EBS volumes that are attached to this instance.
--
-- 'ec2InstanceId', 'instance_ec2InstanceId' - The unique identifier of the instance in Amazon EC2.
--
-- 'instanceType', 'instance_instanceType' - The EC2 instance type, for example @m3.xlarge@.
--
-- 'market', 'instance_market' - The instance purchasing option. Valid values are @ON_DEMAND@ or @SPOT@.
--
-- 'privateIpAddress', 'instance_privateIpAddress' - The private IP address of the instance.
--
-- 'instanceFleetId', 'instance_instanceFleetId' - The unique identifier of the instance fleet to which an EC2 instance
-- belongs.
--
-- 'id', 'instance_id' - The unique identifier for the instance in Amazon EMR.
--
-- 'instanceGroupId', 'instance_instanceGroupId' - The identifier of the instance group to which this instance belongs.
--
-- 'privateDnsName', 'instance_privateDnsName' - The private DNS name of the instance.
--
-- 'publicIpAddress', 'instance_publicIpAddress' - The public IP address of the instance.
newInstance ::
  Instance
newInstance :: Instance
newInstance =
  Instance' :: Maybe InstanceStatus
-> Maybe Text
-> Maybe [EbsVolume]
-> Maybe Text
-> Maybe Text
-> Maybe MarketType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Instance
Instance'
    { $sel:status:Instance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:publicDnsName:Instance' :: Maybe Text
publicDnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ebsVolumes:Instance' :: Maybe [EbsVolume]
ebsVolumes = Maybe [EbsVolume]
forall a. Maybe a
Prelude.Nothing,
      $sel:ec2InstanceId:Instance' :: Maybe Text
ec2InstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:Instance' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:market:Instance' :: Maybe MarketType
market = Maybe MarketType
forall a. Maybe a
Prelude.Nothing,
      $sel:privateIpAddress:Instance' :: Maybe Text
privateIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceFleetId:Instance' :: Maybe Text
instanceFleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:Instance' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceGroupId:Instance' :: Maybe Text
instanceGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privateDnsName:Instance' :: Maybe Text
privateDnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:publicIpAddress:Instance' :: Maybe Text
publicIpAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the instance.
instance_status :: Lens.Lens' Instance (Prelude.Maybe InstanceStatus)
instance_status :: (Maybe InstanceStatus -> f (Maybe InstanceStatus))
-> Instance -> f Instance
instance_status = (Instance -> Maybe InstanceStatus)
-> (Instance -> Maybe InstanceStatus -> Instance)
-> Lens
     Instance Instance (Maybe InstanceStatus) (Maybe InstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceStatus
status :: Maybe InstanceStatus
$sel:status:Instance' :: Instance -> Maybe InstanceStatus
status} -> Maybe InstanceStatus
status) (\s :: Instance
s@Instance' {} Maybe InstanceStatus
a -> Instance
s {$sel:status:Instance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
a} :: Instance)

-- | The public DNS name of the instance.
instance_publicDnsName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_publicDnsName :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_publicDnsName = (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
publicDnsName :: Maybe Text
$sel:publicDnsName:Instance' :: Instance -> Maybe Text
publicDnsName} -> Maybe Text
publicDnsName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:publicDnsName:Instance' :: Maybe Text
publicDnsName = Maybe Text
a} :: Instance)

-- | The list of Amazon EBS volumes that are attached to this instance.
instance_ebsVolumes :: Lens.Lens' Instance (Prelude.Maybe [EbsVolume])
instance_ebsVolumes :: (Maybe [EbsVolume] -> f (Maybe [EbsVolume]))
-> Instance -> f Instance
instance_ebsVolumes = (Instance -> Maybe [EbsVolume])
-> (Instance -> Maybe [EbsVolume] -> Instance)
-> Lens Instance Instance (Maybe [EbsVolume]) (Maybe [EbsVolume])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe [EbsVolume]
ebsVolumes :: Maybe [EbsVolume]
$sel:ebsVolumes:Instance' :: Instance -> Maybe [EbsVolume]
ebsVolumes} -> Maybe [EbsVolume]
ebsVolumes) (\s :: Instance
s@Instance' {} Maybe [EbsVolume]
a -> Instance
s {$sel:ebsVolumes:Instance' :: Maybe [EbsVolume]
ebsVolumes = Maybe [EbsVolume]
a} :: Instance) ((Maybe [EbsVolume] -> f (Maybe [EbsVolume]))
 -> Instance -> f Instance)
-> ((Maybe [EbsVolume] -> f (Maybe [EbsVolume]))
    -> Maybe [EbsVolume] -> f (Maybe [EbsVolume]))
-> (Maybe [EbsVolume] -> f (Maybe [EbsVolume]))
-> Instance
-> f Instance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [EbsVolume] [EbsVolume] [EbsVolume] [EbsVolume]
-> Iso
     (Maybe [EbsVolume])
     (Maybe [EbsVolume])
     (Maybe [EbsVolume])
     (Maybe [EbsVolume])
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 [EbsVolume] [EbsVolume] [EbsVolume] [EbsVolume]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The unique identifier of the instance in Amazon EC2.
instance_ec2InstanceId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_ec2InstanceId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_ec2InstanceId = (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
ec2InstanceId :: Maybe Text
$sel:ec2InstanceId:Instance' :: Instance -> Maybe Text
ec2InstanceId} -> Maybe Text
ec2InstanceId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:ec2InstanceId:Instance' :: Maybe Text
ec2InstanceId = Maybe Text
a} :: Instance)

-- | The EC2 instance type, for example @m3.xlarge@.
instance_instanceType :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceType :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_instanceType = (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
instanceType :: Maybe Text
$sel:instanceType:Instance' :: Instance -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:instanceType:Instance' :: Maybe Text
instanceType = Maybe Text
a} :: Instance)

-- | The instance purchasing option. Valid values are @ON_DEMAND@ or @SPOT@.
instance_market :: Lens.Lens' Instance (Prelude.Maybe MarketType)
instance_market :: (Maybe MarketType -> f (Maybe MarketType))
-> Instance -> f Instance
instance_market = (Instance -> Maybe MarketType)
-> (Instance -> Maybe MarketType -> Instance)
-> Lens Instance Instance (Maybe MarketType) (Maybe MarketType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe MarketType
market :: Maybe MarketType
$sel:market:Instance' :: Instance -> Maybe MarketType
market} -> Maybe MarketType
market) (\s :: Instance
s@Instance' {} Maybe MarketType
a -> Instance
s {$sel:market:Instance' :: Maybe MarketType
market = Maybe MarketType
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 unique identifier of the instance fleet to which an EC2 instance
-- belongs.
instance_instanceFleetId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceFleetId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_instanceFleetId = (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
instanceFleetId :: Maybe Text
$sel:instanceFleetId:Instance' :: Instance -> Maybe Text
instanceFleetId} -> Maybe Text
instanceFleetId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:instanceFleetId:Instance' :: Maybe Text
instanceFleetId = Maybe Text
a} :: Instance)

-- | The unique identifier for the instance in Amazon EMR.
instance_id :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_id :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_id = (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
id :: Maybe Text
$sel:id:Instance' :: Instance -> Maybe Text
id} -> Maybe Text
id) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:id:Instance' :: Maybe Text
id = Maybe Text
a} :: Instance)

-- | The identifier of the instance group to which this instance belongs.
instance_instanceGroupId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceGroupId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_instanceGroupId = (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
instanceGroupId :: Maybe Text
$sel:instanceGroupId:Instance' :: Instance -> Maybe Text
instanceGroupId} -> Maybe Text
instanceGroupId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:instanceGroupId:Instance' :: Maybe Text
instanceGroupId = Maybe Text
a} :: Instance)

-- | The private DNS name of the instance.
instance_privateDnsName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_privateDnsName :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_privateDnsName = (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
privateDnsName :: Maybe Text
$sel:privateDnsName:Instance' :: Instance -> Maybe Text
privateDnsName} -> Maybe Text
privateDnsName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:privateDnsName:Instance' :: Maybe Text
privateDnsName = Maybe Text
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)

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 InstanceStatus
-> Maybe Text
-> Maybe [EbsVolume]
-> Maybe Text
-> Maybe Text
-> Maybe MarketType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Instance
Instance'
            (Maybe InstanceStatus
 -> Maybe Text
 -> Maybe [EbsVolume]
 -> Maybe Text
 -> Maybe Text
 -> Maybe MarketType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Instance)
-> Parser (Maybe InstanceStatus)
-> Parser
     (Maybe Text
      -> Maybe [EbsVolume]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Instance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe [EbsVolume]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe [EbsVolume]
      -> Maybe Text
      -> Maybe Text
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> 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
"PublicDnsName")
            Parser
  (Maybe [EbsVolume]
   -> Maybe Text
   -> Maybe Text
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe [EbsVolume])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [EbsVolume]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EbsVolumes" Parser (Maybe (Maybe [EbsVolume]))
-> Maybe [EbsVolume] -> Parser (Maybe [EbsVolume])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EbsVolume]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe MarketType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> 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
"Ec2InstanceId")
            Parser
  (Maybe Text
   -> Maybe MarketType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe MarketType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> 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
"InstanceType")
            Parser
  (Maybe MarketType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe MarketType)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MarketType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Market")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> 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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Instance)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> 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
"InstanceFleetId")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> 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
"Id")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> 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
"InstanceGroupId")
            Parser (Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe Text) -> Parser (Maybe Text -> 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
"PrivateDnsName")
            Parser (Maybe Text -> Instance)
-> Parser (Maybe Text) -> Parser 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")
      )

instance Prelude.Hashable Instance

instance Prelude.NFData Instance