{-# 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.VpcInterface where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.NetworkInterfaceType
import qualified Amazonka.Prelude as Prelude
data VpcInterface = VpcInterface'
{
VpcInterface -> NetworkInterfaceType
networkInterfaceType :: NetworkInterfaceType,
VpcInterface -> [Text]
networkInterfaceIds :: [Prelude.Text],
VpcInterface -> Text
subnetId :: Prelude.Text,
VpcInterface -> [Text]
securityGroupIds :: [Prelude.Text],
VpcInterface -> Text
roleArn :: Prelude.Text,
VpcInterface -> Text
name :: Prelude.Text
}
deriving (VpcInterface -> VpcInterface -> Bool
(VpcInterface -> VpcInterface -> Bool)
-> (VpcInterface -> VpcInterface -> Bool) -> Eq VpcInterface
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcInterface -> VpcInterface -> Bool
$c/= :: VpcInterface -> VpcInterface -> Bool
== :: VpcInterface -> VpcInterface -> Bool
$c== :: VpcInterface -> VpcInterface -> Bool
Prelude.Eq, ReadPrec [VpcInterface]
ReadPrec VpcInterface
Int -> ReadS VpcInterface
ReadS [VpcInterface]
(Int -> ReadS VpcInterface)
-> ReadS [VpcInterface]
-> ReadPrec VpcInterface
-> ReadPrec [VpcInterface]
-> Read VpcInterface
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcInterface]
$creadListPrec :: ReadPrec [VpcInterface]
readPrec :: ReadPrec VpcInterface
$creadPrec :: ReadPrec VpcInterface
readList :: ReadS [VpcInterface]
$creadList :: ReadS [VpcInterface]
readsPrec :: Int -> ReadS VpcInterface
$creadsPrec :: Int -> ReadS VpcInterface
Prelude.Read, Int -> VpcInterface -> ShowS
[VpcInterface] -> ShowS
VpcInterface -> String
(Int -> VpcInterface -> ShowS)
-> (VpcInterface -> String)
-> ([VpcInterface] -> ShowS)
-> Show VpcInterface
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcInterface] -> ShowS
$cshowList :: [VpcInterface] -> ShowS
show :: VpcInterface -> String
$cshow :: VpcInterface -> String
showsPrec :: Int -> VpcInterface -> ShowS
$cshowsPrec :: Int -> VpcInterface -> ShowS
Prelude.Show, (forall x. VpcInterface -> Rep VpcInterface x)
-> (forall x. Rep VpcInterface x -> VpcInterface)
-> Generic VpcInterface
forall x. Rep VpcInterface x -> VpcInterface
forall x. VpcInterface -> Rep VpcInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcInterface x -> VpcInterface
$cfrom :: forall x. VpcInterface -> Rep VpcInterface x
Prelude.Generic)
newVpcInterface ::
NetworkInterfaceType ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VpcInterface
newVpcInterface :: NetworkInterfaceType -> Text -> Text -> Text -> VpcInterface
newVpcInterface
NetworkInterfaceType
pNetworkInterfaceType_
Text
pSubnetId_
Text
pRoleArn_
Text
pName_ =
VpcInterface' :: NetworkInterfaceType
-> [Text] -> Text -> [Text] -> Text -> Text -> VpcInterface
VpcInterface'
{ $sel:networkInterfaceType:VpcInterface' :: NetworkInterfaceType
networkInterfaceType =
NetworkInterfaceType
pNetworkInterfaceType_,
$sel:networkInterfaceIds:VpcInterface' :: [Text]
networkInterfaceIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:subnetId:VpcInterface' :: Text
subnetId = Text
pSubnetId_,
$sel:securityGroupIds:VpcInterface' :: [Text]
securityGroupIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:roleArn:VpcInterface' :: Text
roleArn = Text
pRoleArn_,
$sel:name:VpcInterface' :: Text
name = Text
pName_
}
vpcInterface_networkInterfaceType :: Lens.Lens' VpcInterface NetworkInterfaceType
vpcInterface_networkInterfaceType :: (NetworkInterfaceType -> f NetworkInterfaceType)
-> VpcInterface -> f VpcInterface
vpcInterface_networkInterfaceType = (VpcInterface -> NetworkInterfaceType)
-> (VpcInterface -> NetworkInterfaceType -> VpcInterface)
-> Lens
VpcInterface VpcInterface NetworkInterfaceType NetworkInterfaceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {NetworkInterfaceType
networkInterfaceType :: NetworkInterfaceType
$sel:networkInterfaceType:VpcInterface' :: VpcInterface -> NetworkInterfaceType
networkInterfaceType} -> NetworkInterfaceType
networkInterfaceType) (\s :: VpcInterface
s@VpcInterface' {} NetworkInterfaceType
a -> VpcInterface
s {$sel:networkInterfaceType:VpcInterface' :: NetworkInterfaceType
networkInterfaceType = NetworkInterfaceType
a} :: VpcInterface)
vpcInterface_networkInterfaceIds :: Lens.Lens' VpcInterface [Prelude.Text]
vpcInterface_networkInterfaceIds :: ([Text] -> f [Text]) -> VpcInterface -> f VpcInterface
vpcInterface_networkInterfaceIds = (VpcInterface -> [Text])
-> (VpcInterface -> [Text] -> VpcInterface)
-> Lens VpcInterface VpcInterface [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {[Text]
networkInterfaceIds :: [Text]
$sel:networkInterfaceIds:VpcInterface' :: VpcInterface -> [Text]
networkInterfaceIds} -> [Text]
networkInterfaceIds) (\s :: VpcInterface
s@VpcInterface' {} [Text]
a -> VpcInterface
s {$sel:networkInterfaceIds:VpcInterface' :: [Text]
networkInterfaceIds = [Text]
a} :: VpcInterface) (([Text] -> f [Text]) -> VpcInterface -> f VpcInterface)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VpcInterface
-> f VpcInterface
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vpcInterface_subnetId :: Lens.Lens' VpcInterface Prelude.Text
vpcInterface_subnetId :: (Text -> f Text) -> VpcInterface -> f VpcInterface
vpcInterface_subnetId = (VpcInterface -> Text)
-> (VpcInterface -> Text -> VpcInterface)
-> Lens VpcInterface VpcInterface Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {Text
subnetId :: Text
$sel:subnetId:VpcInterface' :: VpcInterface -> Text
subnetId} -> Text
subnetId) (\s :: VpcInterface
s@VpcInterface' {} Text
a -> VpcInterface
s {$sel:subnetId:VpcInterface' :: Text
subnetId = Text
a} :: VpcInterface)
vpcInterface_securityGroupIds :: Lens.Lens' VpcInterface [Prelude.Text]
vpcInterface_securityGroupIds :: ([Text] -> f [Text]) -> VpcInterface -> f VpcInterface
vpcInterface_securityGroupIds = (VpcInterface -> [Text])
-> (VpcInterface -> [Text] -> VpcInterface)
-> Lens VpcInterface VpcInterface [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {[Text]
securityGroupIds :: [Text]
$sel:securityGroupIds:VpcInterface' :: VpcInterface -> [Text]
securityGroupIds} -> [Text]
securityGroupIds) (\s :: VpcInterface
s@VpcInterface' {} [Text]
a -> VpcInterface
s {$sel:securityGroupIds:VpcInterface' :: [Text]
securityGroupIds = [Text]
a} :: VpcInterface) (([Text] -> f [Text]) -> VpcInterface -> f VpcInterface)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VpcInterface
-> f VpcInterface
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vpcInterface_roleArn :: Lens.Lens' VpcInterface Prelude.Text
vpcInterface_roleArn :: (Text -> f Text) -> VpcInterface -> f VpcInterface
vpcInterface_roleArn = (VpcInterface -> Text)
-> (VpcInterface -> Text -> VpcInterface)
-> Lens VpcInterface VpcInterface Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {Text
roleArn :: Text
$sel:roleArn:VpcInterface' :: VpcInterface -> Text
roleArn} -> Text
roleArn) (\s :: VpcInterface
s@VpcInterface' {} Text
a -> VpcInterface
s {$sel:roleArn:VpcInterface' :: Text
roleArn = Text
a} :: VpcInterface)
vpcInterface_name :: Lens.Lens' VpcInterface Prelude.Text
vpcInterface_name :: (Text -> f Text) -> VpcInterface -> f VpcInterface
vpcInterface_name = (VpcInterface -> Text)
-> (VpcInterface -> Text -> VpcInterface)
-> Lens VpcInterface VpcInterface Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterface' {Text
name :: Text
$sel:name:VpcInterface' :: VpcInterface -> Text
name} -> Text
name) (\s :: VpcInterface
s@VpcInterface' {} Text
a -> VpcInterface
s {$sel:name:VpcInterface' :: Text
name = Text
a} :: VpcInterface)
instance Core.FromJSON VpcInterface where
parseJSON :: Value -> Parser VpcInterface
parseJSON =
String
-> (Object -> Parser VpcInterface) -> Value -> Parser VpcInterface
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VpcInterface"
( \Object
x ->
NetworkInterfaceType
-> [Text] -> Text -> [Text] -> Text -> Text -> VpcInterface
VpcInterface'
(NetworkInterfaceType
-> [Text] -> Text -> [Text] -> Text -> Text -> VpcInterface)
-> Parser NetworkInterfaceType
-> Parser
([Text] -> Text -> [Text] -> Text -> Text -> VpcInterface)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser NetworkInterfaceType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"networkInterfaceType")
Parser ([Text] -> Text -> [Text] -> Text -> Text -> VpcInterface)
-> Parser [Text]
-> Parser (Text -> [Text] -> Text -> Text -> VpcInterface)
forall (f :: * -> *) a b. Applicative f => 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
"networkInterfaceIds"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Text -> [Text] -> Text -> Text -> VpcInterface)
-> Parser Text -> Parser ([Text] -> Text -> Text -> VpcInterface)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"subnetId")
Parser ([Text] -> Text -> Text -> VpcInterface)
-> Parser [Text] -> Parser (Text -> Text -> VpcInterface)
forall (f :: * -> *) a b. Applicative f => 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
"securityGroupIds"
Parser (Maybe [Text]) -> [Text] -> Parser [Text]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Text -> Text -> VpcInterface)
-> Parser Text -> Parser (Text -> VpcInterface)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"roleArn")
Parser (Text -> VpcInterface) -> Parser Text -> Parser VpcInterface
forall (f :: * -> *) a b. Applicative f => 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 VpcInterface
instance Prelude.NFData VpcInterface