{-# 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.MGN.Types.NetworkInterface -- 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.MGN.Types.NetworkInterface 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 -- | Network interface. -- -- /See:/ 'newNetworkInterface' smart constructor. data NetworkInterface = NetworkInterface' { -- | Network interface IPs. ips :: Prelude.Maybe [Prelude.Text], -- | Network interface primary IP. isPrimary :: Prelude.Maybe Prelude.Bool, -- | Network interface Mac address. macAddress :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'NetworkInterface' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'ips', 'networkInterface_ips' - Network interface IPs. -- -- 'isPrimary', 'networkInterface_isPrimary' - Network interface primary IP. -- -- 'macAddress', 'networkInterface_macAddress' - Network interface Mac address. newNetworkInterface :: NetworkInterface newNetworkInterface = NetworkInterface' { ips = Prelude.Nothing, isPrimary = Prelude.Nothing, macAddress = Prelude.Nothing } -- | Network interface IPs. networkInterface_ips :: Lens.Lens' NetworkInterface (Prelude.Maybe [Prelude.Text]) networkInterface_ips = Lens.lens (\NetworkInterface' {ips} -> ips) (\s@NetworkInterface' {} a -> s {ips = a} :: NetworkInterface) Prelude.. Lens.mapping Lens.coerced -- | Network interface primary IP. networkInterface_isPrimary :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Bool) networkInterface_isPrimary = Lens.lens (\NetworkInterface' {isPrimary} -> isPrimary) (\s@NetworkInterface' {} a -> s {isPrimary = a} :: NetworkInterface) -- | Network interface Mac address. networkInterface_macAddress :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text) networkInterface_macAddress = Lens.lens (\NetworkInterface' {macAddress} -> macAddress) (\s@NetworkInterface' {} a -> s {macAddress = a} :: NetworkInterface) instance Data.FromJSON NetworkInterface where parseJSON = Data.withObject "NetworkInterface" ( \x -> NetworkInterface' Prelude.<$> (x Data..:? "ips" Data..!= Prelude.mempty) Prelude.<*> (x Data..:? "isPrimary") Prelude.<*> (x Data..:? "macAddress") ) instance Prelude.Hashable NetworkInterface where hashWithSalt _salt NetworkInterface' {..} = _salt `Prelude.hashWithSalt` ips `Prelude.hashWithSalt` isPrimary `Prelude.hashWithSalt` macAddress instance Prelude.NFData NetworkInterface where rnf NetworkInterface' {..} = Prelude.rnf ips `Prelude.seq` Prelude.rnf isPrimary `Prelude.seq` Prelude.rnf macAddress