{-# 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.GuardDuty.Types.InstanceDetails
-- 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.GuardDuty.Types.InstanceDetails where

import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.IamInstanceProfile
import Amazonka.GuardDuty.Types.NetworkInterface
import Amazonka.GuardDuty.Types.ProductCode
import Amazonka.GuardDuty.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the details of an instance.
--
-- /See:/ 'newInstanceDetails' smart constructor.
data InstanceDetails = InstanceDetails'
  { -- | The ID of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | The platform of the EC2 instance.
    InstanceDetails -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
    -- | The launch time of the EC2 instance.
    InstanceDetails -> Maybe Text
launchTime :: Prelude.Maybe Prelude.Text,
    -- | The elastic network interface information of the EC2 instance.
    InstanceDetails -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
    -- | The Amazon Resource Name (ARN) of the AWS Outpost. Only applicable to
    -- AWS Outposts instances.
    InstanceDetails -> Maybe Text
outpostArn :: Prelude.Maybe Prelude.Text,
    -- | The type of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone of the EC2 instance.
    InstanceDetails -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The profile information of the EC2 instance.
    InstanceDetails -> Maybe IamInstanceProfile
iamInstanceProfile :: Prelude.Maybe IamInstanceProfile,
    -- | The image ID of the EC2 instance.
    InstanceDetails -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | The product code of the EC2 instance.
    InstanceDetails -> Maybe [ProductCode]
productCodes :: Prelude.Maybe [ProductCode],
    -- | The state of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceState :: Prelude.Maybe Prelude.Text,
    -- | The tags of the EC2 instance.
    InstanceDetails -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The image description of the EC2 instance.
    InstanceDetails -> Maybe Text
imageDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceDetails -> InstanceDetails -> Bool
(InstanceDetails -> InstanceDetails -> Bool)
-> (InstanceDetails -> InstanceDetails -> Bool)
-> Eq InstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceDetails -> InstanceDetails -> Bool
$c/= :: InstanceDetails -> InstanceDetails -> Bool
== :: InstanceDetails -> InstanceDetails -> Bool
$c== :: InstanceDetails -> InstanceDetails -> Bool
Prelude.Eq, ReadPrec [InstanceDetails]
ReadPrec InstanceDetails
Int -> ReadS InstanceDetails
ReadS [InstanceDetails]
(Int -> ReadS InstanceDetails)
-> ReadS [InstanceDetails]
-> ReadPrec InstanceDetails
-> ReadPrec [InstanceDetails]
-> Read InstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceDetails]
$creadListPrec :: ReadPrec [InstanceDetails]
readPrec :: ReadPrec InstanceDetails
$creadPrec :: ReadPrec InstanceDetails
readList :: ReadS [InstanceDetails]
$creadList :: ReadS [InstanceDetails]
readsPrec :: Int -> ReadS InstanceDetails
$creadsPrec :: Int -> ReadS InstanceDetails
Prelude.Read, Int -> InstanceDetails -> ShowS
[InstanceDetails] -> ShowS
InstanceDetails -> String
(Int -> InstanceDetails -> ShowS)
-> (InstanceDetails -> String)
-> ([InstanceDetails] -> ShowS)
-> Show InstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceDetails] -> ShowS
$cshowList :: [InstanceDetails] -> ShowS
show :: InstanceDetails -> String
$cshow :: InstanceDetails -> String
showsPrec :: Int -> InstanceDetails -> ShowS
$cshowsPrec :: Int -> InstanceDetails -> ShowS
Prelude.Show, (forall x. InstanceDetails -> Rep InstanceDetails x)
-> (forall x. Rep InstanceDetails x -> InstanceDetails)
-> Generic InstanceDetails
forall x. Rep InstanceDetails x -> InstanceDetails
forall x. InstanceDetails -> Rep InstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceDetails x -> InstanceDetails
$cfrom :: forall x. InstanceDetails -> Rep InstanceDetails x
Prelude.Generic)

-- |
-- Create a value of 'InstanceDetails' 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:
--
-- 'instanceId', 'instanceDetails_instanceId' - The ID of the EC2 instance.
--
-- 'platform', 'instanceDetails_platform' - The platform of the EC2 instance.
--
-- 'launchTime', 'instanceDetails_launchTime' - The launch time of the EC2 instance.
--
-- 'networkInterfaces', 'instanceDetails_networkInterfaces' - The elastic network interface information of the EC2 instance.
--
-- 'outpostArn', 'instanceDetails_outpostArn' - The Amazon Resource Name (ARN) of the AWS Outpost. Only applicable to
-- AWS Outposts instances.
--
-- 'instanceType', 'instanceDetails_instanceType' - The type of the EC2 instance.
--
-- 'availabilityZone', 'instanceDetails_availabilityZone' - The Availability Zone of the EC2 instance.
--
-- 'iamInstanceProfile', 'instanceDetails_iamInstanceProfile' - The profile information of the EC2 instance.
--
-- 'imageId', 'instanceDetails_imageId' - The image ID of the EC2 instance.
--
-- 'productCodes', 'instanceDetails_productCodes' - The product code of the EC2 instance.
--
-- 'instanceState', 'instanceDetails_instanceState' - The state of the EC2 instance.
--
-- 'tags', 'instanceDetails_tags' - The tags of the EC2 instance.
--
-- 'imageDescription', 'instanceDetails_imageDescription' - The image description of the EC2 instance.
newInstanceDetails ::
  InstanceDetails
newInstanceDetails :: InstanceDetails
newInstanceDetails =
  InstanceDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IamInstanceProfile
-> Maybe Text
-> Maybe [ProductCode]
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> InstanceDetails
InstanceDetails'
    { $sel:instanceId:InstanceDetails' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:InstanceDetails' :: Maybe Text
platform = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:launchTime:InstanceDetails' :: Maybe Text
launchTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:InstanceDetails' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
forall a. Maybe a
Prelude.Nothing,
      $sel:outpostArn:InstanceDetails' :: Maybe Text
outpostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceDetails' :: Maybe Text
instanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:InstanceDetails' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:iamInstanceProfile:InstanceDetails' :: Maybe IamInstanceProfile
iamInstanceProfile = Maybe IamInstanceProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:imageId:InstanceDetails' :: Maybe Text
imageId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:productCodes:InstanceDetails' :: Maybe [ProductCode]
productCodes = Maybe [ProductCode]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceState:InstanceDetails' :: Maybe Text
instanceState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:InstanceDetails' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:imageDescription:InstanceDetails' :: Maybe Text
imageDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the EC2 instance.
instanceDetails_instanceId :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceId :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_instanceId = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:InstanceDetails' :: InstanceDetails -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:instanceId:InstanceDetails' :: Maybe Text
instanceId = Maybe Text
a} :: InstanceDetails)

-- | The platform of the EC2 instance.
instanceDetails_platform :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_platform :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_platform = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
platform :: Maybe Text
$sel:platform:InstanceDetails' :: InstanceDetails -> Maybe Text
platform} -> Maybe Text
platform) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:platform:InstanceDetails' :: Maybe Text
platform = Maybe Text
a} :: InstanceDetails)

-- | The launch time of the EC2 instance.
instanceDetails_launchTime :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_launchTime :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_launchTime = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
launchTime :: Maybe Text
$sel:launchTime:InstanceDetails' :: InstanceDetails -> Maybe Text
launchTime} -> Maybe Text
launchTime) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:launchTime:InstanceDetails' :: Maybe Text
launchTime = Maybe Text
a} :: InstanceDetails)

-- | The elastic network interface information of the EC2 instance.
instanceDetails_networkInterfaces :: Lens.Lens' InstanceDetails (Prelude.Maybe [NetworkInterface])
instanceDetails_networkInterfaces :: (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> InstanceDetails -> f InstanceDetails
instanceDetails_networkInterfaces = (InstanceDetails -> Maybe [NetworkInterface])
-> (InstanceDetails -> Maybe [NetworkInterface] -> InstanceDetails)
-> Lens
     InstanceDetails
     InstanceDetails
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:InstanceDetails' :: InstanceDetails -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe [NetworkInterface]
a -> InstanceDetails
s {$sel:networkInterfaces:InstanceDetails' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: InstanceDetails) ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
 -> InstanceDetails -> f InstanceDetails)
-> ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
    -> Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> InstanceDetails
-> f InstanceDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
-> Iso
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
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
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) of the AWS Outpost. Only applicable to
-- AWS Outposts instances.
instanceDetails_outpostArn :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_outpostArn :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_outpostArn = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
outpostArn :: Maybe Text
$sel:outpostArn:InstanceDetails' :: InstanceDetails -> Maybe Text
outpostArn} -> Maybe Text
outpostArn) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:outpostArn:InstanceDetails' :: Maybe Text
outpostArn = Maybe Text
a} :: InstanceDetails)

-- | The type of the EC2 instance.
instanceDetails_instanceType :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceType :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_instanceType = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:InstanceDetails' :: InstanceDetails -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:instanceType:InstanceDetails' :: Maybe Text
instanceType = Maybe Text
a} :: InstanceDetails)

-- | The Availability Zone of the EC2 instance.
instanceDetails_availabilityZone :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_availabilityZone :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_availabilityZone = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:InstanceDetails' :: InstanceDetails -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:availabilityZone:InstanceDetails' :: Maybe Text
availabilityZone = Maybe Text
a} :: InstanceDetails)

-- | The profile information of the EC2 instance.
instanceDetails_iamInstanceProfile :: Lens.Lens' InstanceDetails (Prelude.Maybe IamInstanceProfile)
instanceDetails_iamInstanceProfile :: (Maybe IamInstanceProfile -> f (Maybe IamInstanceProfile))
-> InstanceDetails -> f InstanceDetails
instanceDetails_iamInstanceProfile = (InstanceDetails -> Maybe IamInstanceProfile)
-> (InstanceDetails -> Maybe IamInstanceProfile -> InstanceDetails)
-> Lens
     InstanceDetails
     InstanceDetails
     (Maybe IamInstanceProfile)
     (Maybe IamInstanceProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe IamInstanceProfile
iamInstanceProfile :: Maybe IamInstanceProfile
$sel:iamInstanceProfile:InstanceDetails' :: InstanceDetails -> Maybe IamInstanceProfile
iamInstanceProfile} -> Maybe IamInstanceProfile
iamInstanceProfile) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe IamInstanceProfile
a -> InstanceDetails
s {$sel:iamInstanceProfile:InstanceDetails' :: Maybe IamInstanceProfile
iamInstanceProfile = Maybe IamInstanceProfile
a} :: InstanceDetails)

-- | The image ID of the EC2 instance.
instanceDetails_imageId :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_imageId :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_imageId = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
imageId :: Maybe Text
$sel:imageId:InstanceDetails' :: InstanceDetails -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:imageId:InstanceDetails' :: Maybe Text
imageId = Maybe Text
a} :: InstanceDetails)

-- | The product code of the EC2 instance.
instanceDetails_productCodes :: Lens.Lens' InstanceDetails (Prelude.Maybe [ProductCode])
instanceDetails_productCodes :: (Maybe [ProductCode] -> f (Maybe [ProductCode]))
-> InstanceDetails -> f InstanceDetails
instanceDetails_productCodes = (InstanceDetails -> Maybe [ProductCode])
-> (InstanceDetails -> Maybe [ProductCode] -> InstanceDetails)
-> Lens
     InstanceDetails
     InstanceDetails
     (Maybe [ProductCode])
     (Maybe [ProductCode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe [ProductCode]
productCodes :: Maybe [ProductCode]
$sel:productCodes:InstanceDetails' :: InstanceDetails -> Maybe [ProductCode]
productCodes} -> Maybe [ProductCode]
productCodes) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe [ProductCode]
a -> InstanceDetails
s {$sel:productCodes:InstanceDetails' :: Maybe [ProductCode]
productCodes = Maybe [ProductCode]
a} :: InstanceDetails) ((Maybe [ProductCode] -> f (Maybe [ProductCode]))
 -> InstanceDetails -> f InstanceDetails)
-> ((Maybe [ProductCode] -> f (Maybe [ProductCode]))
    -> Maybe [ProductCode] -> f (Maybe [ProductCode]))
-> (Maybe [ProductCode] -> f (Maybe [ProductCode]))
-> InstanceDetails
-> f InstanceDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ProductCode] [ProductCode] [ProductCode] [ProductCode]
-> Iso
     (Maybe [ProductCode])
     (Maybe [ProductCode])
     (Maybe [ProductCode])
     (Maybe [ProductCode])
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 [ProductCode] [ProductCode] [ProductCode] [ProductCode]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The state of the EC2 instance.
instanceDetails_instanceState :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceState :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_instanceState = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
instanceState :: Maybe Text
$sel:instanceState:InstanceDetails' :: InstanceDetails -> Maybe Text
instanceState} -> Maybe Text
instanceState) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:instanceState:InstanceDetails' :: Maybe Text
instanceState = Maybe Text
a} :: InstanceDetails)

-- | The tags of the EC2 instance.
instanceDetails_tags :: Lens.Lens' InstanceDetails (Prelude.Maybe [Tag])
instanceDetails_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> InstanceDetails -> f InstanceDetails
instanceDetails_tags = (InstanceDetails -> Maybe [Tag])
-> (InstanceDetails -> Maybe [Tag] -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:InstanceDetails' :: InstanceDetails -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe [Tag]
a -> InstanceDetails
s {$sel:tags:InstanceDetails' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: InstanceDetails) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> InstanceDetails -> f InstanceDetails)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> InstanceDetails
-> f InstanceDetails
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

-- | The image description of the EC2 instance.
instanceDetails_imageDescription :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_imageDescription :: (Maybe Text -> f (Maybe Text))
-> InstanceDetails -> f InstanceDetails
instanceDetails_imageDescription = (InstanceDetails -> Maybe Text)
-> (InstanceDetails -> Maybe Text -> InstanceDetails)
-> Lens InstanceDetails InstanceDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceDetails' {Maybe Text
imageDescription :: Maybe Text
$sel:imageDescription:InstanceDetails' :: InstanceDetails -> Maybe Text
imageDescription} -> Maybe Text
imageDescription) (\s :: InstanceDetails
s@InstanceDetails' {} Maybe Text
a -> InstanceDetails
s {$sel:imageDescription:InstanceDetails' :: Maybe Text
imageDescription = Maybe Text
a} :: InstanceDetails)

instance Core.FromJSON InstanceDetails where
  parseJSON :: Value -> Parser InstanceDetails
parseJSON =
    String
-> (Object -> Parser InstanceDetails)
-> Value
-> Parser InstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InstanceDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IamInstanceProfile
-> Maybe Text
-> Maybe [ProductCode]
-> Maybe Text
-> Maybe [Tag]
-> Maybe Text
-> InstanceDetails
InstanceDetails'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [NetworkInterface]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe IamInstanceProfile
 -> Maybe Text
 -> Maybe [ProductCode]
 -> Maybe Text
 -> Maybe [Tag]
 -> Maybe Text
 -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [NetworkInterface]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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
"instanceId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [NetworkInterface]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [NetworkInterface]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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
"platform")
            Parser
  (Maybe Text
   -> Maybe [NetworkInterface]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [NetworkInterface]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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
"launchTime")
            Parser
  (Maybe [NetworkInterface]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe [NetworkInterface])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [NetworkInterface]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkInterfaces"
                            Parser (Maybe (Maybe [NetworkInterface]))
-> Maybe [NetworkInterface] -> Parser (Maybe [NetworkInterface])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [NetworkInterface]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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
"outpostArn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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 IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe IamInstanceProfile
      -> Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
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
"availabilityZone")
            Parser
  (Maybe IamInstanceProfile
   -> Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe IamInstanceProfile)
-> Parser
     (Maybe Text
      -> Maybe [ProductCode]
      -> Maybe Text
      -> Maybe [Tag]
      -> Maybe Text
      -> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe IamInstanceProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"iamInstanceProfile")
            Parser
  (Maybe Text
   -> Maybe [ProductCode]
   -> Maybe Text
   -> Maybe [Tag]
   -> Maybe Text
   -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ProductCode]
      -> Maybe Text -> Maybe [Tag] -> Maybe Text -> InstanceDetails)
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
"imageId")
            Parser
  (Maybe [ProductCode]
   -> Maybe Text -> Maybe [Tag] -> Maybe Text -> InstanceDetails)
-> Parser (Maybe [ProductCode])
-> Parser
     (Maybe Text -> Maybe [Tag] -> Maybe Text -> InstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ProductCode]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"productCodes" Parser (Maybe (Maybe [ProductCode]))
-> Maybe [ProductCode] -> Parser (Maybe [ProductCode])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ProductCode]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> Maybe [Tag] -> Maybe Text -> InstanceDetails)
-> Parser (Maybe Text)
-> Parser (Maybe [Tag] -> Maybe Text -> InstanceDetails)
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
"instanceState")
            Parser (Maybe [Tag] -> Maybe Text -> InstanceDetails)
-> Parser (Maybe [Tag]) -> Parser (Maybe Text -> InstanceDetails)
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)
            Parser (Maybe Text -> InstanceDetails)
-> Parser (Maybe Text) -> Parser InstanceDetails
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
"imageDescription")
      )

instance Prelude.Hashable InstanceDetails

instance Prelude.NFData InstanceDetails