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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(Interface -> Interface -> Bool)
-> (Interface -> Interface -> Bool) -> Eq Interface
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]
(Int -> ReadS Interface)
-> ReadS [Interface]
-> ReadPrec Interface
-> ReadPrec [Interface]
-> Read 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
(Int -> Interface -> ShowS)
-> (Interface -> String)
-> ([Interface] -> ShowS)
-> Show Interface
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. Interface -> Rep Interface x)
-> (forall x. Rep Interface x -> Interface) -> Generic Interface
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' :: Text -> Interface
Interface' {$sel:name:Interface' :: Text
name = Text
pName_}

-- | The name of the VPC interface.
interface_name :: Lens.Lens' Interface Prelude.Text
interface_name :: (Text -> f Text) -> Interface -> f Interface
interface_name = (Interface -> Text)
-> (Interface -> Text -> Interface)
-> Lens Interface Interface Text Text
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 Core.FromJSON Interface where
  parseJSON :: Value -> Parser Interface
parseJSON =
    String -> (Object -> Parser Interface) -> Value -> Parser Interface
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Interface"
      (\Object
x -> Text -> Interface
Interface' (Text -> Interface) -> Parser Text -> Parser Interface
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name"))

instance Prelude.Hashable Interface

instance Prelude.NFData Interface