{-# 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.InterfaceRequest
-- 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.InterfaceRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The VPC interface that you want to designate where the media stream is
-- coming from or going to.
--
-- /See:/ 'newInterfaceRequest' smart constructor.
data InterfaceRequest = InterfaceRequest'
  { -- | The name of the VPC interface.
    InterfaceRequest -> Text
name :: Prelude.Text
  }
  deriving (InterfaceRequest -> InterfaceRequest -> Bool
(InterfaceRequest -> InterfaceRequest -> Bool)
-> (InterfaceRequest -> InterfaceRequest -> Bool)
-> Eq InterfaceRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InterfaceRequest -> InterfaceRequest -> Bool
$c/= :: InterfaceRequest -> InterfaceRequest -> Bool
== :: InterfaceRequest -> InterfaceRequest -> Bool
$c== :: InterfaceRequest -> InterfaceRequest -> Bool
Prelude.Eq, ReadPrec [InterfaceRequest]
ReadPrec InterfaceRequest
Int -> ReadS InterfaceRequest
ReadS [InterfaceRequest]
(Int -> ReadS InterfaceRequest)
-> ReadS [InterfaceRequest]
-> ReadPrec InterfaceRequest
-> ReadPrec [InterfaceRequest]
-> Read InterfaceRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InterfaceRequest]
$creadListPrec :: ReadPrec [InterfaceRequest]
readPrec :: ReadPrec InterfaceRequest
$creadPrec :: ReadPrec InterfaceRequest
readList :: ReadS [InterfaceRequest]
$creadList :: ReadS [InterfaceRequest]
readsPrec :: Int -> ReadS InterfaceRequest
$creadsPrec :: Int -> ReadS InterfaceRequest
Prelude.Read, Int -> InterfaceRequest -> ShowS
[InterfaceRequest] -> ShowS
InterfaceRequest -> String
(Int -> InterfaceRequest -> ShowS)
-> (InterfaceRequest -> String)
-> ([InterfaceRequest] -> ShowS)
-> Show InterfaceRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InterfaceRequest] -> ShowS
$cshowList :: [InterfaceRequest] -> ShowS
show :: InterfaceRequest -> String
$cshow :: InterfaceRequest -> String
showsPrec :: Int -> InterfaceRequest -> ShowS
$cshowsPrec :: Int -> InterfaceRequest -> ShowS
Prelude.Show, (forall x. InterfaceRequest -> Rep InterfaceRequest x)
-> (forall x. Rep InterfaceRequest x -> InterfaceRequest)
-> Generic InterfaceRequest
forall x. Rep InterfaceRequest x -> InterfaceRequest
forall x. InterfaceRequest -> Rep InterfaceRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InterfaceRequest x -> InterfaceRequest
$cfrom :: forall x. InterfaceRequest -> Rep InterfaceRequest x
Prelude.Generic)

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

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

instance Prelude.Hashable InterfaceRequest

instance Prelude.NFData InterfaceRequest

instance Core.ToJSON InterfaceRequest where
  toJSON :: InterfaceRequest -> Value
toJSON InterfaceRequest' {Text
name :: Text
$sel:name:InterfaceRequest' :: InterfaceRequest -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)]
      )