{-# 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.MediaConnect.Types.Interface
-- 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.MediaConnect.Types.Interface 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

-- | The VPC interface that is used for the media stream associated with the
-- source or output.
--
-- /See:/ 'newInterface' smart constructor.
data Interface = Interface'
  { -- | The name of the VPC interface.
    Interface -> Text
name :: Prelude.Text
  }
  deriving (Interface -> Interface -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Interface -> Interface -> Bool
$c/= :: Interface -> Interface -> Bool
== :: Interface -> Interface -> Bool
$c== :: Interface -> Interface -> Bool
Prelude.Eq, ReadPrec [Interface]
ReadPrec Interface
Int -> ReadS Interface
ReadS [Interface]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Interface]
$creadListPrec :: ReadPrec [Interface]
readPrec :: ReadPrec Interface
$creadPrec :: ReadPrec Interface
readList :: ReadS [Interface]
$creadList :: ReadS [Interface]
readsPrec :: Int -> ReadS Interface
$creadsPrec :: Int -> ReadS Interface
Prelude.Read, Int -> Interface -> ShowS
[Interface] -> ShowS
Interface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Interface] -> ShowS
$cshowList :: [Interface] -> ShowS
show :: Interface -> String
$cshow :: Interface -> String
showsPrec :: Int -> Interface -> ShowS
$cshowsPrec :: Int -> Interface -> ShowS
Prelude.Show, forall x. Rep Interface x -> Interface
forall x. Interface -> Rep Interface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Interface x -> Interface
$cfrom :: forall x. Interface -> Rep Interface x
Prelude.Generic)

-- |
-- Create a value of 'Interface' 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:
--
-- 'name', 'interface_name' - The name of the VPC interface.
newInterface ::
  -- | 'name'
  Prelude.Text ->
  Interface
newInterface :: Text -> Interface
newInterface Text
pName_ = Interface' {$sel:name:Interface' :: Text
name = Text
pName_}

-- | The name of the VPC interface.
interface_name :: Lens.Lens' Interface Prelude.Text
interface_name :: Lens' Interface Text
interface_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interface' {Text
name :: Text
$sel:name:Interface' :: Interface -> Text
name} -> Text
name) (\s :: Interface
s@Interface' {} Text
a -> Interface
s {$sel:name:Interface' :: Text
name = Text
a} :: Interface)

instance Data.FromJSON Interface where
  parseJSON :: Value -> Parser Interface
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Interface"
      (\Object
x -> Text -> Interface
Interface' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name"))

instance Prelude.Hashable Interface where
  hashWithSalt :: Int -> Interface -> Int
hashWithSalt Int
_salt Interface' {Text
name :: Text
$sel:name:Interface' :: Interface -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData Interface where
  rnf :: Interface -> ()
rnf Interface' {Text
name :: Text
$sel:name:Interface' :: Interface -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
name