{-# 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.SecurityHub.Types.AwsEc2NetworkInterfaceAttachment
-- 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.SecurityHub.Types.AwsEc2NetworkInterfaceAttachment where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the network interface attachment.
--
-- /See:/ 'newAwsEc2NetworkInterfaceAttachment' smart constructor.
data AwsEc2NetworkInterfaceAttachment = AwsEc2NetworkInterfaceAttachment'
  { -- | The ID of the instance.
    AwsEc2NetworkInterfaceAttachment -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | The attachment state.
    --
    -- Valid values: @attaching@ | @attached@ | @detaching@ | @detached@
    AwsEc2NetworkInterfaceAttachment -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the network interface is deleted when the instance is
    -- terminated.
    AwsEc2NetworkInterfaceAttachment -> Maybe Bool
deleteOnTermination :: Prelude.Maybe Prelude.Bool,
    -- | The identifier of the network interface attachment
    AwsEc2NetworkInterfaceAttachment -> Maybe Text
attachmentId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account ID of the owner of the instance.
    AwsEc2NetworkInterfaceAttachment -> Maybe Text
instanceOwnerId :: Prelude.Maybe Prelude.Text,
    -- | Indicates when the attachment initiated.
    --
    -- Uses the @date-time@ format specified in
    -- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
    -- The value cannot contain spaces. For example,
    -- @2020-03-22T13:22:13.933Z@.
    AwsEc2NetworkInterfaceAttachment -> Maybe Text
attachTime :: Prelude.Maybe Prelude.Text,
    -- | The device index of the network interface attachment on the instance.
    AwsEc2NetworkInterfaceAttachment -> Maybe Int
deviceIndex :: Prelude.Maybe Prelude.Int
  }
  deriving (AwsEc2NetworkInterfaceAttachment
-> AwsEc2NetworkInterfaceAttachment -> Bool
(AwsEc2NetworkInterfaceAttachment
 -> AwsEc2NetworkInterfaceAttachment -> Bool)
-> (AwsEc2NetworkInterfaceAttachment
    -> AwsEc2NetworkInterfaceAttachment -> Bool)
-> Eq AwsEc2NetworkInterfaceAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2NetworkInterfaceAttachment
-> AwsEc2NetworkInterfaceAttachment -> Bool
$c/= :: AwsEc2NetworkInterfaceAttachment
-> AwsEc2NetworkInterfaceAttachment -> Bool
== :: AwsEc2NetworkInterfaceAttachment
-> AwsEc2NetworkInterfaceAttachment -> Bool
$c== :: AwsEc2NetworkInterfaceAttachment
-> AwsEc2NetworkInterfaceAttachment -> Bool
Prelude.Eq, ReadPrec [AwsEc2NetworkInterfaceAttachment]
ReadPrec AwsEc2NetworkInterfaceAttachment
Int -> ReadS AwsEc2NetworkInterfaceAttachment
ReadS [AwsEc2NetworkInterfaceAttachment]
(Int -> ReadS AwsEc2NetworkInterfaceAttachment)
-> ReadS [AwsEc2NetworkInterfaceAttachment]
-> ReadPrec AwsEc2NetworkInterfaceAttachment
-> ReadPrec [AwsEc2NetworkInterfaceAttachment]
-> Read AwsEc2NetworkInterfaceAttachment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2NetworkInterfaceAttachment]
$creadListPrec :: ReadPrec [AwsEc2NetworkInterfaceAttachment]
readPrec :: ReadPrec AwsEc2NetworkInterfaceAttachment
$creadPrec :: ReadPrec AwsEc2NetworkInterfaceAttachment
readList :: ReadS [AwsEc2NetworkInterfaceAttachment]
$creadList :: ReadS [AwsEc2NetworkInterfaceAttachment]
readsPrec :: Int -> ReadS AwsEc2NetworkInterfaceAttachment
$creadsPrec :: Int -> ReadS AwsEc2NetworkInterfaceAttachment
Prelude.Read, Int -> AwsEc2NetworkInterfaceAttachment -> ShowS
[AwsEc2NetworkInterfaceAttachment] -> ShowS
AwsEc2NetworkInterfaceAttachment -> String
(Int -> AwsEc2NetworkInterfaceAttachment -> ShowS)
-> (AwsEc2NetworkInterfaceAttachment -> String)
-> ([AwsEc2NetworkInterfaceAttachment] -> ShowS)
-> Show AwsEc2NetworkInterfaceAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2NetworkInterfaceAttachment] -> ShowS
$cshowList :: [AwsEc2NetworkInterfaceAttachment] -> ShowS
show :: AwsEc2NetworkInterfaceAttachment -> String
$cshow :: AwsEc2NetworkInterfaceAttachment -> String
showsPrec :: Int -> AwsEc2NetworkInterfaceAttachment -> ShowS
$cshowsPrec :: Int -> AwsEc2NetworkInterfaceAttachment -> ShowS
Prelude.Show, (forall x.
 AwsEc2NetworkInterfaceAttachment
 -> Rep AwsEc2NetworkInterfaceAttachment x)
-> (forall x.
    Rep AwsEc2NetworkInterfaceAttachment x
    -> AwsEc2NetworkInterfaceAttachment)
-> Generic AwsEc2NetworkInterfaceAttachment
forall x.
Rep AwsEc2NetworkInterfaceAttachment x
-> AwsEc2NetworkInterfaceAttachment
forall x.
AwsEc2NetworkInterfaceAttachment
-> Rep AwsEc2NetworkInterfaceAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2NetworkInterfaceAttachment x
-> AwsEc2NetworkInterfaceAttachment
$cfrom :: forall x.
AwsEc2NetworkInterfaceAttachment
-> Rep AwsEc2NetworkInterfaceAttachment x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2NetworkInterfaceAttachment' 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', 'awsEc2NetworkInterfaceAttachment_instanceId' - The ID of the instance.
--
-- 'status', 'awsEc2NetworkInterfaceAttachment_status' - The attachment state.
--
-- Valid values: @attaching@ | @attached@ | @detaching@ | @detached@
--
-- 'deleteOnTermination', 'awsEc2NetworkInterfaceAttachment_deleteOnTermination' - Indicates whether the network interface is deleted when the instance is
-- terminated.
--
-- 'attachmentId', 'awsEc2NetworkInterfaceAttachment_attachmentId' - The identifier of the network interface attachment
--
-- 'instanceOwnerId', 'awsEc2NetworkInterfaceAttachment_instanceOwnerId' - The Amazon Web Services account ID of the owner of the instance.
--
-- 'attachTime', 'awsEc2NetworkInterfaceAttachment_attachTime' - Indicates when the attachment initiated.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
--
-- 'deviceIndex', 'awsEc2NetworkInterfaceAttachment_deviceIndex' - The device index of the network interface attachment on the instance.
newAwsEc2NetworkInterfaceAttachment ::
  AwsEc2NetworkInterfaceAttachment
newAwsEc2NetworkInterfaceAttachment :: AwsEc2NetworkInterfaceAttachment
newAwsEc2NetworkInterfaceAttachment =
  AwsEc2NetworkInterfaceAttachment' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AwsEc2NetworkInterfaceAttachment
AwsEc2NetworkInterfaceAttachment'
    { $sel:instanceId:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
instanceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deleteOnTermination:AwsEc2NetworkInterfaceAttachment' :: Maybe Bool
deleteOnTermination = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:attachmentId:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
attachmentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceOwnerId:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
instanceOwnerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attachTime:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
attachTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceIndex:AwsEc2NetworkInterfaceAttachment' :: Maybe Int
deviceIndex = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The attachment state.
--
-- Valid values: @attaching@ | @attached@ | @detaching@ | @detached@
awsEc2NetworkInterfaceAttachment_status :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Text)
awsEc2NetworkInterfaceAttachment_status :: (Maybe Text -> f (Maybe Text))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_status = (AwsEc2NetworkInterfaceAttachment -> Maybe Text)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Text -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Text
status :: Maybe Text
$sel:status:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
status} -> Maybe Text
status) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Text
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:status:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
status = Maybe Text
a} :: AwsEc2NetworkInterfaceAttachment)

-- | Indicates whether the network interface is deleted when the instance is
-- terminated.
awsEc2NetworkInterfaceAttachment_deleteOnTermination :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Bool)
awsEc2NetworkInterfaceAttachment_deleteOnTermination :: (Maybe Bool -> f (Maybe Bool))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_deleteOnTermination = (AwsEc2NetworkInterfaceAttachment -> Maybe Bool)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Bool -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Bool
deleteOnTermination :: Maybe Bool
$sel:deleteOnTermination:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Bool
deleteOnTermination} -> Maybe Bool
deleteOnTermination) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Bool
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:deleteOnTermination:AwsEc2NetworkInterfaceAttachment' :: Maybe Bool
deleteOnTermination = Maybe Bool
a} :: AwsEc2NetworkInterfaceAttachment)

-- | The identifier of the network interface attachment
awsEc2NetworkInterfaceAttachment_attachmentId :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Text)
awsEc2NetworkInterfaceAttachment_attachmentId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_attachmentId = (AwsEc2NetworkInterfaceAttachment -> Maybe Text)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Text -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Text
attachmentId :: Maybe Text
$sel:attachmentId:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
attachmentId} -> Maybe Text
attachmentId) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Text
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:attachmentId:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
attachmentId = Maybe Text
a} :: AwsEc2NetworkInterfaceAttachment)

-- | The Amazon Web Services account ID of the owner of the instance.
awsEc2NetworkInterfaceAttachment_instanceOwnerId :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Text)
awsEc2NetworkInterfaceAttachment_instanceOwnerId :: (Maybe Text -> f (Maybe Text))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_instanceOwnerId = (AwsEc2NetworkInterfaceAttachment -> Maybe Text)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Text -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Text
instanceOwnerId :: Maybe Text
$sel:instanceOwnerId:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
instanceOwnerId} -> Maybe Text
instanceOwnerId) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Text
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:instanceOwnerId:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
instanceOwnerId = Maybe Text
a} :: AwsEc2NetworkInterfaceAttachment)

-- | Indicates when the attachment initiated.
--
-- Uses the @date-time@ format specified in
-- <https://tools.ietf.org/html/rfc3339#section-5.6 RFC 3339 section 5.6, Internet Date\/Time Format>.
-- The value cannot contain spaces. For example,
-- @2020-03-22T13:22:13.933Z@.
awsEc2NetworkInterfaceAttachment_attachTime :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Text)
awsEc2NetworkInterfaceAttachment_attachTime :: (Maybe Text -> f (Maybe Text))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_attachTime = (AwsEc2NetworkInterfaceAttachment -> Maybe Text)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Text -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Text
attachTime :: Maybe Text
$sel:attachTime:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
attachTime} -> Maybe Text
attachTime) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Text
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:attachTime:AwsEc2NetworkInterfaceAttachment' :: Maybe Text
attachTime = Maybe Text
a} :: AwsEc2NetworkInterfaceAttachment)

-- | The device index of the network interface attachment on the instance.
awsEc2NetworkInterfaceAttachment_deviceIndex :: Lens.Lens' AwsEc2NetworkInterfaceAttachment (Prelude.Maybe Prelude.Int)
awsEc2NetworkInterfaceAttachment_deviceIndex :: (Maybe Int -> f (Maybe Int))
-> AwsEc2NetworkInterfaceAttachment
-> f AwsEc2NetworkInterfaceAttachment
awsEc2NetworkInterfaceAttachment_deviceIndex = (AwsEc2NetworkInterfaceAttachment -> Maybe Int)
-> (AwsEc2NetworkInterfaceAttachment
    -> Maybe Int -> AwsEc2NetworkInterfaceAttachment)
-> Lens
     AwsEc2NetworkInterfaceAttachment
     AwsEc2NetworkInterfaceAttachment
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceAttachment' {Maybe Int
deviceIndex :: Maybe Int
$sel:deviceIndex:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Int
deviceIndex} -> Maybe Int
deviceIndex) (\s :: AwsEc2NetworkInterfaceAttachment
s@AwsEc2NetworkInterfaceAttachment' {} Maybe Int
a -> AwsEc2NetworkInterfaceAttachment
s {$sel:deviceIndex:AwsEc2NetworkInterfaceAttachment' :: Maybe Int
deviceIndex = Maybe Int
a} :: AwsEc2NetworkInterfaceAttachment)

instance
  Core.FromJSON
    AwsEc2NetworkInterfaceAttachment
  where
  parseJSON :: Value -> Parser AwsEc2NetworkInterfaceAttachment
parseJSON =
    String
-> (Object -> Parser AwsEc2NetworkInterfaceAttachment)
-> Value
-> Parser AwsEc2NetworkInterfaceAttachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2NetworkInterfaceAttachment"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> AwsEc2NetworkInterfaceAttachment
AwsEc2NetworkInterfaceAttachment'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> AwsEc2NetworkInterfaceAttachment)
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 Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> AwsEc2NetworkInterfaceAttachment)
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
"Status")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> AwsEc2NetworkInterfaceAttachment)
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
"DeleteOnTermination")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Int -> AwsEc2NetworkInterfaceAttachment)
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
"AttachmentId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Int -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Int -> AwsEc2NetworkInterfaceAttachment)
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
"InstanceOwnerId")
            Parser
  (Maybe Text -> Maybe Int -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> AwsEc2NetworkInterfaceAttachment)
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
"AttachTime")
            Parser (Maybe Int -> AwsEc2NetworkInterfaceAttachment)
-> Parser (Maybe Int) -> Parser AwsEc2NetworkInterfaceAttachment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceIndex")
      )

instance
  Prelude.Hashable
    AwsEc2NetworkInterfaceAttachment

instance
  Prelude.NFData
    AwsEc2NetworkInterfaceAttachment

instance Core.ToJSON AwsEc2NetworkInterfaceAttachment where
  toJSON :: AwsEc2NetworkInterfaceAttachment -> Value
toJSON AwsEc2NetworkInterfaceAttachment' {Maybe Bool
Maybe Int
Maybe Text
deviceIndex :: Maybe Int
attachTime :: Maybe Text
instanceOwnerId :: Maybe Text
attachmentId :: Maybe Text
deleteOnTermination :: Maybe Bool
status :: Maybe Text
instanceId :: Maybe Text
$sel:deviceIndex:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Int
$sel:attachTime:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
$sel:instanceOwnerId:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
$sel:attachmentId:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
$sel:deleteOnTermination:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Bool
$sel:status:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
$sel:instanceId:AwsEc2NetworkInterfaceAttachment' :: AwsEc2NetworkInterfaceAttachment -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
instanceId,
            (Text
"Status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
status,
            (Text
"DeleteOnTermination" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deleteOnTermination,
            (Text
"AttachmentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attachmentId,
            (Text
"InstanceOwnerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
instanceOwnerId,
            (Text
"AttachTime" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
attachTime,
            (Text
"DeviceIndex" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
deviceIndex
          ]
      )