{-# 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 #-}
module Amazonka.MediaConnect.Types.VpcInterfaceAttachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data VpcInterfaceAttachment = VpcInterfaceAttachment'
{
VpcInterfaceAttachment -> Maybe Text
vpcInterfaceName :: Prelude.Maybe Prelude.Text
}
deriving (VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool
(VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool)
-> (VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool)
-> Eq VpcInterfaceAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool
$c/= :: VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool
== :: VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool
$c== :: VpcInterfaceAttachment -> VpcInterfaceAttachment -> Bool
Prelude.Eq, ReadPrec [VpcInterfaceAttachment]
ReadPrec VpcInterfaceAttachment
Int -> ReadS VpcInterfaceAttachment
ReadS [VpcInterfaceAttachment]
(Int -> ReadS VpcInterfaceAttachment)
-> ReadS [VpcInterfaceAttachment]
-> ReadPrec VpcInterfaceAttachment
-> ReadPrec [VpcInterfaceAttachment]
-> Read VpcInterfaceAttachment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcInterfaceAttachment]
$creadListPrec :: ReadPrec [VpcInterfaceAttachment]
readPrec :: ReadPrec VpcInterfaceAttachment
$creadPrec :: ReadPrec VpcInterfaceAttachment
readList :: ReadS [VpcInterfaceAttachment]
$creadList :: ReadS [VpcInterfaceAttachment]
readsPrec :: Int -> ReadS VpcInterfaceAttachment
$creadsPrec :: Int -> ReadS VpcInterfaceAttachment
Prelude.Read, Int -> VpcInterfaceAttachment -> ShowS
[VpcInterfaceAttachment] -> ShowS
VpcInterfaceAttachment -> String
(Int -> VpcInterfaceAttachment -> ShowS)
-> (VpcInterfaceAttachment -> String)
-> ([VpcInterfaceAttachment] -> ShowS)
-> Show VpcInterfaceAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcInterfaceAttachment] -> ShowS
$cshowList :: [VpcInterfaceAttachment] -> ShowS
show :: VpcInterfaceAttachment -> String
$cshow :: VpcInterfaceAttachment -> String
showsPrec :: Int -> VpcInterfaceAttachment -> ShowS
$cshowsPrec :: Int -> VpcInterfaceAttachment -> ShowS
Prelude.Show, (forall x. VpcInterfaceAttachment -> Rep VpcInterfaceAttachment x)
-> (forall x.
Rep VpcInterfaceAttachment x -> VpcInterfaceAttachment)
-> Generic VpcInterfaceAttachment
forall x. Rep VpcInterfaceAttachment x -> VpcInterfaceAttachment
forall x. VpcInterfaceAttachment -> Rep VpcInterfaceAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcInterfaceAttachment x -> VpcInterfaceAttachment
$cfrom :: forall x. VpcInterfaceAttachment -> Rep VpcInterfaceAttachment x
Prelude.Generic)
newVpcInterfaceAttachment ::
VpcInterfaceAttachment
newVpcInterfaceAttachment :: VpcInterfaceAttachment
newVpcInterfaceAttachment =
VpcInterfaceAttachment' :: Maybe Text -> VpcInterfaceAttachment
VpcInterfaceAttachment'
{ $sel:vpcInterfaceName:VpcInterfaceAttachment' :: Maybe Text
vpcInterfaceName =
Maybe Text
forall a. Maybe a
Prelude.Nothing
}
vpcInterfaceAttachment_vpcInterfaceName :: Lens.Lens' VpcInterfaceAttachment (Prelude.Maybe Prelude.Text)
vpcInterfaceAttachment_vpcInterfaceName :: (Maybe Text -> f (Maybe Text))
-> VpcInterfaceAttachment -> f VpcInterfaceAttachment
vpcInterfaceAttachment_vpcInterfaceName = (VpcInterfaceAttachment -> Maybe Text)
-> (VpcInterfaceAttachment -> Maybe Text -> VpcInterfaceAttachment)
-> Lens
VpcInterfaceAttachment
VpcInterfaceAttachment
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceAttachment' {Maybe Text
vpcInterfaceName :: Maybe Text
$sel:vpcInterfaceName:VpcInterfaceAttachment' :: VpcInterfaceAttachment -> Maybe Text
vpcInterfaceName} -> Maybe Text
vpcInterfaceName) (\s :: VpcInterfaceAttachment
s@VpcInterfaceAttachment' {} Maybe Text
a -> VpcInterfaceAttachment
s {$sel:vpcInterfaceName:VpcInterfaceAttachment' :: Maybe Text
vpcInterfaceName = Maybe Text
a} :: VpcInterfaceAttachment)
instance Core.FromJSON VpcInterfaceAttachment where
parseJSON :: Value -> Parser VpcInterfaceAttachment
parseJSON =
String
-> (Object -> Parser VpcInterfaceAttachment)
-> Value
-> Parser VpcInterfaceAttachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VpcInterfaceAttachment"
( \Object
x ->
Maybe Text -> VpcInterfaceAttachment
VpcInterfaceAttachment'
(Maybe Text -> VpcInterfaceAttachment)
-> Parser (Maybe Text) -> Parser VpcInterfaceAttachment
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vpcInterfaceName")
)
instance Prelude.Hashable VpcInterfaceAttachment
instance Prelude.NFData VpcInterfaceAttachment
instance Core.ToJSON VpcInterfaceAttachment where
toJSON :: VpcInterfaceAttachment -> Value
toJSON VpcInterfaceAttachment' {Maybe Text
vpcInterfaceName :: Maybe Text
$sel:vpcInterfaceName:VpcInterfaceAttachment' :: VpcInterfaceAttachment -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"vpcInterfaceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcInterfaceName
]
)