{-# 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.SnowDeviceManagement.Types.PhysicalNetworkInterface
-- 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.SnowDeviceManagement.Types.PhysicalNetworkInterface where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SnowDeviceManagement.Types.IpAddressAssignment
import Amazonka.SnowDeviceManagement.Types.PhysicalConnectorType

-- | The details about the physical network interface for the device.
--
-- /See:/ 'newPhysicalNetworkInterface' smart constructor.
data PhysicalNetworkInterface = PhysicalNetworkInterface'
  { -- | The default gateway of the device.
    PhysicalNetworkInterface -> Maybe Text
defaultGateway :: Prelude.Maybe Prelude.Text,
    -- | The IP address of the device.
    PhysicalNetworkInterface -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | A value that describes whether the IP address is dynamic or persistent.
    PhysicalNetworkInterface -> Maybe IpAddressAssignment
ipAddressAssignment :: Prelude.Maybe IpAddressAssignment,
    -- | The MAC address of the device.
    PhysicalNetworkInterface -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text,
    -- | The netmask used to divide the IP address into subnets.
    PhysicalNetworkInterface -> Maybe Text
netmask :: Prelude.Maybe Prelude.Text,
    -- | The physical connector type.
    PhysicalNetworkInterface -> Maybe PhysicalConnectorType
physicalConnectorType :: Prelude.Maybe PhysicalConnectorType,
    -- | The physical network interface ID.
    PhysicalNetworkInterface -> Maybe Text
physicalNetworkInterfaceId :: Prelude.Maybe Prelude.Text
  }
  deriving (PhysicalNetworkInterface -> PhysicalNetworkInterface -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalNetworkInterface -> PhysicalNetworkInterface -> Bool
$c/= :: PhysicalNetworkInterface -> PhysicalNetworkInterface -> Bool
== :: PhysicalNetworkInterface -> PhysicalNetworkInterface -> Bool
$c== :: PhysicalNetworkInterface -> PhysicalNetworkInterface -> Bool
Prelude.Eq, ReadPrec [PhysicalNetworkInterface]
ReadPrec PhysicalNetworkInterface
Int -> ReadS PhysicalNetworkInterface
ReadS [PhysicalNetworkInterface]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhysicalNetworkInterface]
$creadListPrec :: ReadPrec [PhysicalNetworkInterface]
readPrec :: ReadPrec PhysicalNetworkInterface
$creadPrec :: ReadPrec PhysicalNetworkInterface
readList :: ReadS [PhysicalNetworkInterface]
$creadList :: ReadS [PhysicalNetworkInterface]
readsPrec :: Int -> ReadS PhysicalNetworkInterface
$creadsPrec :: Int -> ReadS PhysicalNetworkInterface
Prelude.Read, Int -> PhysicalNetworkInterface -> ShowS
[PhysicalNetworkInterface] -> ShowS
PhysicalNetworkInterface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhysicalNetworkInterface] -> ShowS
$cshowList :: [PhysicalNetworkInterface] -> ShowS
show :: PhysicalNetworkInterface -> String
$cshow :: PhysicalNetworkInterface -> String
showsPrec :: Int -> PhysicalNetworkInterface -> ShowS
$cshowsPrec :: Int -> PhysicalNetworkInterface -> ShowS
Prelude.Show, forall x.
Rep PhysicalNetworkInterface x -> PhysicalNetworkInterface
forall x.
PhysicalNetworkInterface -> Rep PhysicalNetworkInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PhysicalNetworkInterface x -> PhysicalNetworkInterface
$cfrom :: forall x.
PhysicalNetworkInterface -> Rep PhysicalNetworkInterface x
Prelude.Generic)

-- |
-- Create a value of 'PhysicalNetworkInterface' 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:
--
-- 'defaultGateway', 'physicalNetworkInterface_defaultGateway' - The default gateway of the device.
--
-- 'ipAddress', 'physicalNetworkInterface_ipAddress' - The IP address of the device.
--
-- 'ipAddressAssignment', 'physicalNetworkInterface_ipAddressAssignment' - A value that describes whether the IP address is dynamic or persistent.
--
-- 'macAddress', 'physicalNetworkInterface_macAddress' - The MAC address of the device.
--
-- 'netmask', 'physicalNetworkInterface_netmask' - The netmask used to divide the IP address into subnets.
--
-- 'physicalConnectorType', 'physicalNetworkInterface_physicalConnectorType' - The physical connector type.
--
-- 'physicalNetworkInterfaceId', 'physicalNetworkInterface_physicalNetworkInterfaceId' - The physical network interface ID.
newPhysicalNetworkInterface ::
  PhysicalNetworkInterface
newPhysicalNetworkInterface :: PhysicalNetworkInterface
newPhysicalNetworkInterface =
  PhysicalNetworkInterface'
    { $sel:defaultGateway:PhysicalNetworkInterface' :: Maybe Text
defaultGateway =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:PhysicalNetworkInterface' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddressAssignment:PhysicalNetworkInterface' :: Maybe IpAddressAssignment
ipAddressAssignment = forall a. Maybe a
Prelude.Nothing,
      $sel:macAddress:PhysicalNetworkInterface' :: Maybe Text
macAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:netmask:PhysicalNetworkInterface' :: Maybe Text
netmask = forall a. Maybe a
Prelude.Nothing,
      $sel:physicalConnectorType:PhysicalNetworkInterface' :: Maybe PhysicalConnectorType
physicalConnectorType = forall a. Maybe a
Prelude.Nothing,
      $sel:physicalNetworkInterfaceId:PhysicalNetworkInterface' :: Maybe Text
physicalNetworkInterfaceId = forall a. Maybe a
Prelude.Nothing
    }

-- | The default gateway of the device.
physicalNetworkInterface_defaultGateway :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe Prelude.Text)
physicalNetworkInterface_defaultGateway :: Lens' PhysicalNetworkInterface (Maybe Text)
physicalNetworkInterface_defaultGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe Text
defaultGateway :: Maybe Text
$sel:defaultGateway:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
defaultGateway} -> Maybe Text
defaultGateway) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe Text
a -> PhysicalNetworkInterface
s {$sel:defaultGateway:PhysicalNetworkInterface' :: Maybe Text
defaultGateway = Maybe Text
a} :: PhysicalNetworkInterface)

-- | The IP address of the device.
physicalNetworkInterface_ipAddress :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe Prelude.Text)
physicalNetworkInterface_ipAddress :: Lens' PhysicalNetworkInterface (Maybe Text)
physicalNetworkInterface_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe Text
a -> PhysicalNetworkInterface
s {$sel:ipAddress:PhysicalNetworkInterface' :: Maybe Text
ipAddress = Maybe Text
a} :: PhysicalNetworkInterface)

-- | A value that describes whether the IP address is dynamic or persistent.
physicalNetworkInterface_ipAddressAssignment :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe IpAddressAssignment)
physicalNetworkInterface_ipAddressAssignment :: Lens' PhysicalNetworkInterface (Maybe IpAddressAssignment)
physicalNetworkInterface_ipAddressAssignment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe IpAddressAssignment
ipAddressAssignment :: Maybe IpAddressAssignment
$sel:ipAddressAssignment:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe IpAddressAssignment
ipAddressAssignment} -> Maybe IpAddressAssignment
ipAddressAssignment) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe IpAddressAssignment
a -> PhysicalNetworkInterface
s {$sel:ipAddressAssignment:PhysicalNetworkInterface' :: Maybe IpAddressAssignment
ipAddressAssignment = Maybe IpAddressAssignment
a} :: PhysicalNetworkInterface)

-- | The MAC address of the device.
physicalNetworkInterface_macAddress :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe Prelude.Text)
physicalNetworkInterface_macAddress :: Lens' PhysicalNetworkInterface (Maybe Text)
physicalNetworkInterface_macAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe Text
macAddress :: Maybe Text
$sel:macAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
macAddress} -> Maybe Text
macAddress) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe Text
a -> PhysicalNetworkInterface
s {$sel:macAddress:PhysicalNetworkInterface' :: Maybe Text
macAddress = Maybe Text
a} :: PhysicalNetworkInterface)

-- | The netmask used to divide the IP address into subnets.
physicalNetworkInterface_netmask :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe Prelude.Text)
physicalNetworkInterface_netmask :: Lens' PhysicalNetworkInterface (Maybe Text)
physicalNetworkInterface_netmask = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe Text
netmask :: Maybe Text
$sel:netmask:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
netmask} -> Maybe Text
netmask) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe Text
a -> PhysicalNetworkInterface
s {$sel:netmask:PhysicalNetworkInterface' :: Maybe Text
netmask = Maybe Text
a} :: PhysicalNetworkInterface)

-- | The physical connector type.
physicalNetworkInterface_physicalConnectorType :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe PhysicalConnectorType)
physicalNetworkInterface_physicalConnectorType :: Lens' PhysicalNetworkInterface (Maybe PhysicalConnectorType)
physicalNetworkInterface_physicalConnectorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe PhysicalConnectorType
physicalConnectorType :: Maybe PhysicalConnectorType
$sel:physicalConnectorType:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe PhysicalConnectorType
physicalConnectorType} -> Maybe PhysicalConnectorType
physicalConnectorType) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe PhysicalConnectorType
a -> PhysicalNetworkInterface
s {$sel:physicalConnectorType:PhysicalNetworkInterface' :: Maybe PhysicalConnectorType
physicalConnectorType = Maybe PhysicalConnectorType
a} :: PhysicalNetworkInterface)

-- | The physical network interface ID.
physicalNetworkInterface_physicalNetworkInterfaceId :: Lens.Lens' PhysicalNetworkInterface (Prelude.Maybe Prelude.Text)
physicalNetworkInterface_physicalNetworkInterfaceId :: Lens' PhysicalNetworkInterface (Maybe Text)
physicalNetworkInterface_physicalNetworkInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhysicalNetworkInterface' {Maybe Text
physicalNetworkInterfaceId :: Maybe Text
$sel:physicalNetworkInterfaceId:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
physicalNetworkInterfaceId} -> Maybe Text
physicalNetworkInterfaceId) (\s :: PhysicalNetworkInterface
s@PhysicalNetworkInterface' {} Maybe Text
a -> PhysicalNetworkInterface
s {$sel:physicalNetworkInterfaceId:PhysicalNetworkInterface' :: Maybe Text
physicalNetworkInterfaceId = Maybe Text
a} :: PhysicalNetworkInterface)

instance Data.FromJSON PhysicalNetworkInterface where
  parseJSON :: Value -> Parser PhysicalNetworkInterface
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"PhysicalNetworkInterface"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe IpAddressAssignment
-> Maybe Text
-> Maybe Text
-> Maybe PhysicalConnectorType
-> Maybe Text
-> PhysicalNetworkInterface
PhysicalNetworkInterface'
            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
"defaultGateway")
            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
"ipAddress")
            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
"ipAddressAssignment")
            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
"macAddress")
            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
"netmask")
            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
"physicalConnectorType")
            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
"physicalNetworkInterfaceId")
      )

instance Prelude.Hashable PhysicalNetworkInterface where
  hashWithSalt :: Int -> PhysicalNetworkInterface -> Int
hashWithSalt Int
_salt PhysicalNetworkInterface' {Maybe Text
Maybe IpAddressAssignment
Maybe PhysicalConnectorType
physicalNetworkInterfaceId :: Maybe Text
physicalConnectorType :: Maybe PhysicalConnectorType
netmask :: Maybe Text
macAddress :: Maybe Text
ipAddressAssignment :: Maybe IpAddressAssignment
ipAddress :: Maybe Text
defaultGateway :: Maybe Text
$sel:physicalNetworkInterfaceId:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:physicalConnectorType:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe PhysicalConnectorType
$sel:netmask:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:macAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:ipAddressAssignment:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe IpAddressAssignment
$sel:ipAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:defaultGateway:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultGateway
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpAddressAssignment
ipAddressAssignment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
macAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
netmask
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PhysicalConnectorType
physicalConnectorType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
physicalNetworkInterfaceId

instance Prelude.NFData PhysicalNetworkInterface where
  rnf :: PhysicalNetworkInterface -> ()
rnf PhysicalNetworkInterface' {Maybe Text
Maybe IpAddressAssignment
Maybe PhysicalConnectorType
physicalNetworkInterfaceId :: Maybe Text
physicalConnectorType :: Maybe PhysicalConnectorType
netmask :: Maybe Text
macAddress :: Maybe Text
ipAddressAssignment :: Maybe IpAddressAssignment
ipAddress :: Maybe Text
defaultGateway :: Maybe Text
$sel:physicalNetworkInterfaceId:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:physicalConnectorType:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe PhysicalConnectorType
$sel:netmask:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:macAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:ipAddressAssignment:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe IpAddressAssignment
$sel:ipAddress:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
$sel:defaultGateway:PhysicalNetworkInterface' :: PhysicalNetworkInterface -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultGateway
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressAssignment
ipAddressAssignment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
macAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
netmask
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PhysicalConnectorType
physicalConnectorType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
physicalNetworkInterfaceId