{-# 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.EC2.Types.InstanceNetworkInterfaceAssociation
-- 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.EC2.Types.InstanceNetworkInterfaceAssociation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes association information for an Elastic IP address (IPv4).
--
-- /See:/ 'newInstanceNetworkInterfaceAssociation' smart constructor.
data InstanceNetworkInterfaceAssociation = InstanceNetworkInterfaceAssociation'
  { -- | The carrier IP address associated with the network interface.
    InstanceNetworkInterfaceAssociation -> Maybe Text
carrierIp :: Prelude.Maybe Prelude.Text,
    -- | The customer-owned IP address associated with the network interface.
    InstanceNetworkInterfaceAssociation -> Maybe Text
customerOwnedIp :: Prelude.Maybe Prelude.Text,
    -- | The ID of the owner of the Elastic IP address.
    InstanceNetworkInterfaceAssociation -> Maybe Text
ipOwnerId :: Prelude.Maybe Prelude.Text,
    -- | The public DNS name.
    InstanceNetworkInterfaceAssociation -> Maybe Text
publicDnsName :: Prelude.Maybe Prelude.Text,
    -- | The public IP address or Elastic IP address bound to the network
    -- interface.
    InstanceNetworkInterfaceAssociation -> Maybe Text
publicIp :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceNetworkInterfaceAssociation
-> InstanceNetworkInterfaceAssociation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceNetworkInterfaceAssociation
-> InstanceNetworkInterfaceAssociation -> Bool
$c/= :: InstanceNetworkInterfaceAssociation
-> InstanceNetworkInterfaceAssociation -> Bool
== :: InstanceNetworkInterfaceAssociation
-> InstanceNetworkInterfaceAssociation -> Bool
$c== :: InstanceNetworkInterfaceAssociation
-> InstanceNetworkInterfaceAssociation -> Bool
Prelude.Eq, ReadPrec [InstanceNetworkInterfaceAssociation]
ReadPrec InstanceNetworkInterfaceAssociation
Int -> ReadS InstanceNetworkInterfaceAssociation
ReadS [InstanceNetworkInterfaceAssociation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceNetworkInterfaceAssociation]
$creadListPrec :: ReadPrec [InstanceNetworkInterfaceAssociation]
readPrec :: ReadPrec InstanceNetworkInterfaceAssociation
$creadPrec :: ReadPrec InstanceNetworkInterfaceAssociation
readList :: ReadS [InstanceNetworkInterfaceAssociation]
$creadList :: ReadS [InstanceNetworkInterfaceAssociation]
readsPrec :: Int -> ReadS InstanceNetworkInterfaceAssociation
$creadsPrec :: Int -> ReadS InstanceNetworkInterfaceAssociation
Prelude.Read, Int -> InstanceNetworkInterfaceAssociation -> ShowS
[InstanceNetworkInterfaceAssociation] -> ShowS
InstanceNetworkInterfaceAssociation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceNetworkInterfaceAssociation] -> ShowS
$cshowList :: [InstanceNetworkInterfaceAssociation] -> ShowS
show :: InstanceNetworkInterfaceAssociation -> String
$cshow :: InstanceNetworkInterfaceAssociation -> String
showsPrec :: Int -> InstanceNetworkInterfaceAssociation -> ShowS
$cshowsPrec :: Int -> InstanceNetworkInterfaceAssociation -> ShowS
Prelude.Show, forall x.
Rep InstanceNetworkInterfaceAssociation x
-> InstanceNetworkInterfaceAssociation
forall x.
InstanceNetworkInterfaceAssociation
-> Rep InstanceNetworkInterfaceAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstanceNetworkInterfaceAssociation x
-> InstanceNetworkInterfaceAssociation
$cfrom :: forall x.
InstanceNetworkInterfaceAssociation
-> Rep InstanceNetworkInterfaceAssociation x
Prelude.Generic)

-- |
-- Create a value of 'InstanceNetworkInterfaceAssociation' 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:
--
-- 'carrierIp', 'instanceNetworkInterfaceAssociation_carrierIp' - The carrier IP address associated with the network interface.
--
-- 'customerOwnedIp', 'instanceNetworkInterfaceAssociation_customerOwnedIp' - The customer-owned IP address associated with the network interface.
--
-- 'ipOwnerId', 'instanceNetworkInterfaceAssociation_ipOwnerId' - The ID of the owner of the Elastic IP address.
--
-- 'publicDnsName', 'instanceNetworkInterfaceAssociation_publicDnsName' - The public DNS name.
--
-- 'publicIp', 'instanceNetworkInterfaceAssociation_publicIp' - The public IP address or Elastic IP address bound to the network
-- interface.
newInstanceNetworkInterfaceAssociation ::
  InstanceNetworkInterfaceAssociation
newInstanceNetworkInterfaceAssociation :: InstanceNetworkInterfaceAssociation
newInstanceNetworkInterfaceAssociation =
  InstanceNetworkInterfaceAssociation'
    { $sel:carrierIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
carrierIp =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customerOwnedIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
customerOwnedIp = forall a. Maybe a
Prelude.Nothing,
      $sel:ipOwnerId:InstanceNetworkInterfaceAssociation' :: Maybe Text
ipOwnerId = forall a. Maybe a
Prelude.Nothing,
      $sel:publicDnsName:InstanceNetworkInterfaceAssociation' :: Maybe Text
publicDnsName = forall a. Maybe a
Prelude.Nothing,
      $sel:publicIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
publicIp = forall a. Maybe a
Prelude.Nothing
    }

-- | The carrier IP address associated with the network interface.
instanceNetworkInterfaceAssociation_carrierIp :: Lens.Lens' InstanceNetworkInterfaceAssociation (Prelude.Maybe Prelude.Text)
instanceNetworkInterfaceAssociation_carrierIp :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
instanceNetworkInterfaceAssociation_carrierIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworkInterfaceAssociation' {Maybe Text
carrierIp :: Maybe Text
$sel:carrierIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
carrierIp} -> Maybe Text
carrierIp) (\s :: InstanceNetworkInterfaceAssociation
s@InstanceNetworkInterfaceAssociation' {} Maybe Text
a -> InstanceNetworkInterfaceAssociation
s {$sel:carrierIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
carrierIp = Maybe Text
a} :: InstanceNetworkInterfaceAssociation)

-- | The customer-owned IP address associated with the network interface.
instanceNetworkInterfaceAssociation_customerOwnedIp :: Lens.Lens' InstanceNetworkInterfaceAssociation (Prelude.Maybe Prelude.Text)
instanceNetworkInterfaceAssociation_customerOwnedIp :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
instanceNetworkInterfaceAssociation_customerOwnedIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworkInterfaceAssociation' {Maybe Text
customerOwnedIp :: Maybe Text
$sel:customerOwnedIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
customerOwnedIp} -> Maybe Text
customerOwnedIp) (\s :: InstanceNetworkInterfaceAssociation
s@InstanceNetworkInterfaceAssociation' {} Maybe Text
a -> InstanceNetworkInterfaceAssociation
s {$sel:customerOwnedIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
customerOwnedIp = Maybe Text
a} :: InstanceNetworkInterfaceAssociation)

-- | The ID of the owner of the Elastic IP address.
instanceNetworkInterfaceAssociation_ipOwnerId :: Lens.Lens' InstanceNetworkInterfaceAssociation (Prelude.Maybe Prelude.Text)
instanceNetworkInterfaceAssociation_ipOwnerId :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
instanceNetworkInterfaceAssociation_ipOwnerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworkInterfaceAssociation' {Maybe Text
ipOwnerId :: Maybe Text
$sel:ipOwnerId:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
ipOwnerId} -> Maybe Text
ipOwnerId) (\s :: InstanceNetworkInterfaceAssociation
s@InstanceNetworkInterfaceAssociation' {} Maybe Text
a -> InstanceNetworkInterfaceAssociation
s {$sel:ipOwnerId:InstanceNetworkInterfaceAssociation' :: Maybe Text
ipOwnerId = Maybe Text
a} :: InstanceNetworkInterfaceAssociation)

-- | The public DNS name.
instanceNetworkInterfaceAssociation_publicDnsName :: Lens.Lens' InstanceNetworkInterfaceAssociation (Prelude.Maybe Prelude.Text)
instanceNetworkInterfaceAssociation_publicDnsName :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
instanceNetworkInterfaceAssociation_publicDnsName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworkInterfaceAssociation' {Maybe Text
publicDnsName :: Maybe Text
$sel:publicDnsName:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
publicDnsName} -> Maybe Text
publicDnsName) (\s :: InstanceNetworkInterfaceAssociation
s@InstanceNetworkInterfaceAssociation' {} Maybe Text
a -> InstanceNetworkInterfaceAssociation
s {$sel:publicDnsName:InstanceNetworkInterfaceAssociation' :: Maybe Text
publicDnsName = Maybe Text
a} :: InstanceNetworkInterfaceAssociation)

-- | The public IP address or Elastic IP address bound to the network
-- interface.
instanceNetworkInterfaceAssociation_publicIp :: Lens.Lens' InstanceNetworkInterfaceAssociation (Prelude.Maybe Prelude.Text)
instanceNetworkInterfaceAssociation_publicIp :: Lens' InstanceNetworkInterfaceAssociation (Maybe Text)
instanceNetworkInterfaceAssociation_publicIp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworkInterfaceAssociation' {Maybe Text
publicIp :: Maybe Text
$sel:publicIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
publicIp} -> Maybe Text
publicIp) (\s :: InstanceNetworkInterfaceAssociation
s@InstanceNetworkInterfaceAssociation' {} Maybe Text
a -> InstanceNetworkInterfaceAssociation
s {$sel:publicIp:InstanceNetworkInterfaceAssociation' :: Maybe Text
publicIp = Maybe Text
a} :: InstanceNetworkInterfaceAssociation)

instance
  Data.FromXML
    InstanceNetworkInterfaceAssociation
  where
  parseXML :: [Node] -> Either String InstanceNetworkInterfaceAssociation
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> InstanceNetworkInterfaceAssociation
InstanceNetworkInterfaceAssociation'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"carrierIp")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"customerOwnedIp")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipOwnerId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"publicDnsName")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"publicIp")

instance
  Prelude.Hashable
    InstanceNetworkInterfaceAssociation
  where
  hashWithSalt :: Int -> InstanceNetworkInterfaceAssociation -> Int
hashWithSalt
    Int
_salt
    InstanceNetworkInterfaceAssociation' {Maybe Text
publicIp :: Maybe Text
publicDnsName :: Maybe Text
ipOwnerId :: Maybe Text
customerOwnedIp :: Maybe Text
carrierIp :: Maybe Text
$sel:publicIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:publicDnsName:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:ipOwnerId:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:customerOwnedIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:carrierIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
carrierIp
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerOwnedIp
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipOwnerId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicDnsName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
publicIp

instance
  Prelude.NFData
    InstanceNetworkInterfaceAssociation
  where
  rnf :: InstanceNetworkInterfaceAssociation -> ()
rnf InstanceNetworkInterfaceAssociation' {Maybe Text
publicIp :: Maybe Text
publicDnsName :: Maybe Text
ipOwnerId :: Maybe Text
customerOwnedIp :: Maybe Text
carrierIp :: Maybe Text
$sel:publicIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:publicDnsName:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:ipOwnerId:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:customerOwnedIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
$sel:carrierIp:InstanceNetworkInterfaceAssociation' :: InstanceNetworkInterfaceAssociation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
carrierIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerOwnedIp
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipOwnerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicDnsName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
publicIp