{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GuardDuty.Types.InstanceDetails where

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

-- | Contains information about the details of an instance.
--
-- /See:/ 'newInstanceDetails' smart constructor.
data InstanceDetails = InstanceDetails'
  { -- | 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 description of the EC2 instance.
    InstanceDetails -> Maybe Text
imageDescription :: Prelude.Maybe Prelude.Text,
    -- | The image ID of the EC2 instance.
    InstanceDetails -> Maybe Text
imageId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | The state of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceState :: Prelude.Maybe Prelude.Text,
    -- | The type of the EC2 instance.
    InstanceDetails -> Maybe Text
instanceType :: 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 Amazon Web Services Outpost. Only
    -- applicable to Amazon Web Services Outposts instances.
    InstanceDetails -> Maybe Text
outpostArn :: Prelude.Maybe Prelude.Text,
    -- | The platform of the EC2 instance.
    InstanceDetails -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
    -- | The product code of the EC2 instance.
    InstanceDetails -> Maybe [ProductCode]
productCodes :: Prelude.Maybe [ProductCode],
    -- | The tags of the EC2 instance.
    InstanceDetails -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (InstanceDetails -> InstanceDetails -> Bool
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]
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
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. 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:
--
-- 'availabilityZone', 'instanceDetails_availabilityZone' - The Availability Zone of the EC2 instance.
--
-- 'iamInstanceProfile', 'instanceDetails_iamInstanceProfile' - The profile information of the EC2 instance.
--
-- 'imageDescription', 'instanceDetails_imageDescription' - The image description of the EC2 instance.
--
-- 'imageId', 'instanceDetails_imageId' - The image ID of the EC2 instance.
--
-- 'instanceId', 'instanceDetails_instanceId' - The ID of the EC2 instance.
--
-- 'instanceState', 'instanceDetails_instanceState' - The state of the EC2 instance.
--
-- 'instanceType', 'instanceDetails_instanceType' - The type 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 Amazon Web Services Outpost. Only
-- applicable to Amazon Web Services Outposts instances.
--
-- 'platform', 'instanceDetails_platform' - The platform of the EC2 instance.
--
-- 'productCodes', 'instanceDetails_productCodes' - The product code of the EC2 instance.
--
-- 'tags', 'instanceDetails_tags' - The tags of the EC2 instance.
newInstanceDetails ::
  InstanceDetails
newInstanceDetails :: InstanceDetails
newInstanceDetails =
  InstanceDetails'
    { $sel:availabilityZone:InstanceDetails' :: Maybe Text
availabilityZone =
        forall a. Maybe a
Prelude.Nothing,
      $sel:iamInstanceProfile:InstanceDetails' :: Maybe IamInstanceProfile
iamInstanceProfile = forall a. Maybe a
Prelude.Nothing,
      $sel:imageDescription:InstanceDetails' :: Maybe Text
imageDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:imageId:InstanceDetails' :: Maybe Text
imageId = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:InstanceDetails' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceState:InstanceDetails' :: Maybe Text
instanceState = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceType:InstanceDetails' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
      $sel:launchTime:InstanceDetails' :: Maybe Text
launchTime = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:InstanceDetails' :: Maybe [NetworkInterface]
networkInterfaces = forall a. Maybe a
Prelude.Nothing,
      $sel:outpostArn:InstanceDetails' :: Maybe Text
outpostArn = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:InstanceDetails' :: Maybe Text
platform = forall a. Maybe a
Prelude.Nothing,
      $sel:productCodes:InstanceDetails' :: Maybe [ProductCode]
productCodes = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:InstanceDetails' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The Availability Zone of the EC2 instance.
instanceDetails_availabilityZone :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_availabilityZone :: Lens' InstanceDetails (Maybe Text)
instanceDetails_availabilityZone = 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 :: Lens' InstanceDetails (Maybe IamInstanceProfile)
instanceDetails_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 description of the EC2 instance.
instanceDetails_imageDescription :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_imageDescription :: Lens' InstanceDetails (Maybe Text)
instanceDetails_imageDescription = 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)

-- | The image ID of the EC2 instance.
instanceDetails_imageId :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_imageId :: Lens' InstanceDetails (Maybe Text)
instanceDetails_imageId = 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 ID of the EC2 instance.
instanceDetails_instanceId :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceId :: Lens' InstanceDetails (Maybe Text)
instanceDetails_instanceId = 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 state of the EC2 instance.
instanceDetails_instanceState :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceState :: Lens' InstanceDetails (Maybe Text)
instanceDetails_instanceState = 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 type of the EC2 instance.
instanceDetails_instanceType :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_instanceType :: Lens' InstanceDetails (Maybe Text)
instanceDetails_instanceType = 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 launch time of the EC2 instance.
instanceDetails_launchTime :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_launchTime :: Lens' InstanceDetails (Maybe Text)
instanceDetails_launchTime = 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 :: Lens' InstanceDetails (Maybe [NetworkInterface])
instanceDetails_networkInterfaces = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 Amazon Web Services Outpost. Only
-- applicable to Amazon Web Services Outposts instances.
instanceDetails_outpostArn :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_outpostArn :: Lens' InstanceDetails (Maybe Text)
instanceDetails_outpostArn = 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 platform of the EC2 instance.
instanceDetails_platform :: Lens.Lens' InstanceDetails (Prelude.Maybe Prelude.Text)
instanceDetails_platform :: Lens' InstanceDetails (Maybe Text)
instanceDetails_platform = 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 product code of the EC2 instance.
instanceDetails_productCodes :: Lens.Lens' InstanceDetails (Prelude.Maybe [ProductCode])
instanceDetails_productCodes :: Lens' InstanceDetails (Maybe [ProductCode])
instanceDetails_productCodes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags of the EC2 instance.
instanceDetails_tags :: Lens.Lens' InstanceDetails (Prelude.Maybe [Tag])
instanceDetails_tags :: Lens' InstanceDetails (Maybe [Tag])
instanceDetails_tags = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable InstanceDetails where
  hashWithSalt :: Int -> InstanceDetails -> Int
hashWithSalt Int
_salt InstanceDetails' {Maybe [ProductCode]
Maybe [NetworkInterface]
Maybe [Tag]
Maybe Text
Maybe IamInstanceProfile
tags :: Maybe [Tag]
productCodes :: Maybe [ProductCode]
platform :: Maybe Text
outpostArn :: Maybe Text
networkInterfaces :: Maybe [NetworkInterface]
launchTime :: Maybe Text
instanceType :: Maybe Text
instanceState :: Maybe Text
instanceId :: Maybe Text
imageId :: Maybe Text
imageDescription :: Maybe Text
iamInstanceProfile :: Maybe IamInstanceProfile
availabilityZone :: Maybe Text
$sel:tags:InstanceDetails' :: InstanceDetails -> Maybe [Tag]
$sel:productCodes:InstanceDetails' :: InstanceDetails -> Maybe [ProductCode]
$sel:platform:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:outpostArn:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:networkInterfaces:InstanceDetails' :: InstanceDetails -> Maybe [NetworkInterface]
$sel:launchTime:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceType:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceState:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceId:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:imageId:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:imageDescription:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:iamInstanceProfile:InstanceDetails' :: InstanceDetails -> Maybe IamInstanceProfile
$sel:availabilityZone:InstanceDetails' :: InstanceDetails -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IamInstanceProfile
iamInstanceProfile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
launchTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NetworkInterface]
networkInterfaces
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
outpostArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platform
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProductCode]
productCodes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags

instance Prelude.NFData InstanceDetails where
  rnf :: InstanceDetails -> ()
rnf InstanceDetails' {Maybe [ProductCode]
Maybe [NetworkInterface]
Maybe [Tag]
Maybe Text
Maybe IamInstanceProfile
tags :: Maybe [Tag]
productCodes :: Maybe [ProductCode]
platform :: Maybe Text
outpostArn :: Maybe Text
networkInterfaces :: Maybe [NetworkInterface]
launchTime :: Maybe Text
instanceType :: Maybe Text
instanceState :: Maybe Text
instanceId :: Maybe Text
imageId :: Maybe Text
imageDescription :: Maybe Text
iamInstanceProfile :: Maybe IamInstanceProfile
availabilityZone :: Maybe Text
$sel:tags:InstanceDetails' :: InstanceDetails -> Maybe [Tag]
$sel:productCodes:InstanceDetails' :: InstanceDetails -> Maybe [ProductCode]
$sel:platform:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:outpostArn:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:networkInterfaces:InstanceDetails' :: InstanceDetails -> Maybe [NetworkInterface]
$sel:launchTime:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceType:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceState:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:instanceId:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:imageId:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:imageDescription:InstanceDetails' :: InstanceDetails -> Maybe Text
$sel:iamInstanceProfile:InstanceDetails' :: InstanceDetails -> Maybe IamInstanceProfile
$sel:availabilityZone:InstanceDetails' :: InstanceDetails -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IamInstanceProfile
iamInstanceProfile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
launchTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkInterface]
networkInterfaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
outpostArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platform
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProductCode]
productCodes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags