{-# 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.VpcInterfaceRequest 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 VpcInterfaceRequest = VpcInterfaceRequest'
{
VpcInterfaceRequest -> Maybe NetworkInterfaceType
networkInterfaceType :: Prelude.Maybe NetworkInterfaceType,
VpcInterfaceRequest -> Text
subnetId :: Prelude.Text,
VpcInterfaceRequest -> [Text]
securityGroupIds :: [Prelude.Text],
VpcInterfaceRequest -> Text
roleArn :: Prelude.Text,
VpcInterfaceRequest -> Text
name :: Prelude.Text
}
deriving (VpcInterfaceRequest -> VpcInterfaceRequest -> Bool
(VpcInterfaceRequest -> VpcInterfaceRequest -> Bool)
-> (VpcInterfaceRequest -> VpcInterfaceRequest -> Bool)
-> Eq VpcInterfaceRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcInterfaceRequest -> VpcInterfaceRequest -> Bool
$c/= :: VpcInterfaceRequest -> VpcInterfaceRequest -> Bool
== :: VpcInterfaceRequest -> VpcInterfaceRequest -> Bool
$c== :: VpcInterfaceRequest -> VpcInterfaceRequest -> Bool
Prelude.Eq, ReadPrec [VpcInterfaceRequest]
ReadPrec VpcInterfaceRequest
Int -> ReadS VpcInterfaceRequest
ReadS [VpcInterfaceRequest]
(Int -> ReadS VpcInterfaceRequest)
-> ReadS [VpcInterfaceRequest]
-> ReadPrec VpcInterfaceRequest
-> ReadPrec [VpcInterfaceRequest]
-> Read VpcInterfaceRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcInterfaceRequest]
$creadListPrec :: ReadPrec [VpcInterfaceRequest]
readPrec :: ReadPrec VpcInterfaceRequest
$creadPrec :: ReadPrec VpcInterfaceRequest
readList :: ReadS [VpcInterfaceRequest]
$creadList :: ReadS [VpcInterfaceRequest]
readsPrec :: Int -> ReadS VpcInterfaceRequest
$creadsPrec :: Int -> ReadS VpcInterfaceRequest
Prelude.Read, Int -> VpcInterfaceRequest -> ShowS
[VpcInterfaceRequest] -> ShowS
VpcInterfaceRequest -> String
(Int -> VpcInterfaceRequest -> ShowS)
-> (VpcInterfaceRequest -> String)
-> ([VpcInterfaceRequest] -> ShowS)
-> Show VpcInterfaceRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcInterfaceRequest] -> ShowS
$cshowList :: [VpcInterfaceRequest] -> ShowS
show :: VpcInterfaceRequest -> String
$cshow :: VpcInterfaceRequest -> String
showsPrec :: Int -> VpcInterfaceRequest -> ShowS
$cshowsPrec :: Int -> VpcInterfaceRequest -> ShowS
Prelude.Show, (forall x. VpcInterfaceRequest -> Rep VpcInterfaceRequest x)
-> (forall x. Rep VpcInterfaceRequest x -> VpcInterfaceRequest)
-> Generic VpcInterfaceRequest
forall x. Rep VpcInterfaceRequest x -> VpcInterfaceRequest
forall x. VpcInterfaceRequest -> Rep VpcInterfaceRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcInterfaceRequest x -> VpcInterfaceRequest
$cfrom :: forall x. VpcInterfaceRequest -> Rep VpcInterfaceRequest x
Prelude.Generic)
newVpcInterfaceRequest ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VpcInterfaceRequest
newVpcInterfaceRequest :: Text -> Text -> Text -> VpcInterfaceRequest
newVpcInterfaceRequest Text
pSubnetId_ Text
pRoleArn_ Text
pName_ =
VpcInterfaceRequest' :: Maybe NetworkInterfaceType
-> Text -> [Text] -> Text -> Text -> VpcInterfaceRequest
VpcInterfaceRequest'
{ $sel:networkInterfaceType:VpcInterfaceRequest' :: Maybe NetworkInterfaceType
networkInterfaceType =
Maybe NetworkInterfaceType
forall a. Maybe a
Prelude.Nothing,
$sel:subnetId:VpcInterfaceRequest' :: Text
subnetId = Text
pSubnetId_,
$sel:securityGroupIds:VpcInterfaceRequest' :: [Text]
securityGroupIds = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:roleArn:VpcInterfaceRequest' :: Text
roleArn = Text
pRoleArn_,
$sel:name:VpcInterfaceRequest' :: Text
name = Text
pName_
}
vpcInterfaceRequest_networkInterfaceType :: Lens.Lens' VpcInterfaceRequest (Prelude.Maybe NetworkInterfaceType)
vpcInterfaceRequest_networkInterfaceType :: (Maybe NetworkInterfaceType -> f (Maybe NetworkInterfaceType))
-> VpcInterfaceRequest -> f VpcInterfaceRequest
vpcInterfaceRequest_networkInterfaceType = (VpcInterfaceRequest -> Maybe NetworkInterfaceType)
-> (VpcInterfaceRequest
-> Maybe NetworkInterfaceType -> VpcInterfaceRequest)
-> Lens
VpcInterfaceRequest
VpcInterfaceRequest
(Maybe NetworkInterfaceType)
(Maybe NetworkInterfaceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceRequest' {Maybe NetworkInterfaceType
networkInterfaceType :: Maybe NetworkInterfaceType
$sel:networkInterfaceType:VpcInterfaceRequest' :: VpcInterfaceRequest -> Maybe NetworkInterfaceType
networkInterfaceType} -> Maybe NetworkInterfaceType
networkInterfaceType) (\s :: VpcInterfaceRequest
s@VpcInterfaceRequest' {} Maybe NetworkInterfaceType
a -> VpcInterfaceRequest
s {$sel:networkInterfaceType:VpcInterfaceRequest' :: Maybe NetworkInterfaceType
networkInterfaceType = Maybe NetworkInterfaceType
a} :: VpcInterfaceRequest)
vpcInterfaceRequest_subnetId :: Lens.Lens' VpcInterfaceRequest Prelude.Text
vpcInterfaceRequest_subnetId :: (Text -> f Text) -> VpcInterfaceRequest -> f VpcInterfaceRequest
vpcInterfaceRequest_subnetId = (VpcInterfaceRequest -> Text)
-> (VpcInterfaceRequest -> Text -> VpcInterfaceRequest)
-> Lens VpcInterfaceRequest VpcInterfaceRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceRequest' {Text
subnetId :: Text
$sel:subnetId:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
subnetId} -> Text
subnetId) (\s :: VpcInterfaceRequest
s@VpcInterfaceRequest' {} Text
a -> VpcInterfaceRequest
s {$sel:subnetId:VpcInterfaceRequest' :: Text
subnetId = Text
a} :: VpcInterfaceRequest)
vpcInterfaceRequest_securityGroupIds :: Lens.Lens' VpcInterfaceRequest [Prelude.Text]
vpcInterfaceRequest_securityGroupIds :: ([Text] -> f [Text])
-> VpcInterfaceRequest -> f VpcInterfaceRequest
vpcInterfaceRequest_securityGroupIds = (VpcInterfaceRequest -> [Text])
-> (VpcInterfaceRequest -> [Text] -> VpcInterfaceRequest)
-> Lens VpcInterfaceRequest VpcInterfaceRequest [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceRequest' {[Text]
securityGroupIds :: [Text]
$sel:securityGroupIds:VpcInterfaceRequest' :: VpcInterfaceRequest -> [Text]
securityGroupIds} -> [Text]
securityGroupIds) (\s :: VpcInterfaceRequest
s@VpcInterfaceRequest' {} [Text]
a -> VpcInterfaceRequest
s {$sel:securityGroupIds:VpcInterfaceRequest' :: [Text]
securityGroupIds = [Text]
a} :: VpcInterfaceRequest) (([Text] -> f [Text])
-> VpcInterfaceRequest -> f VpcInterfaceRequest)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> VpcInterfaceRequest
-> f VpcInterfaceRequest
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
vpcInterfaceRequest_roleArn :: Lens.Lens' VpcInterfaceRequest Prelude.Text
vpcInterfaceRequest_roleArn :: (Text -> f Text) -> VpcInterfaceRequest -> f VpcInterfaceRequest
vpcInterfaceRequest_roleArn = (VpcInterfaceRequest -> Text)
-> (VpcInterfaceRequest -> Text -> VpcInterfaceRequest)
-> Lens VpcInterfaceRequest VpcInterfaceRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceRequest' {Text
roleArn :: Text
$sel:roleArn:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
roleArn} -> Text
roleArn) (\s :: VpcInterfaceRequest
s@VpcInterfaceRequest' {} Text
a -> VpcInterfaceRequest
s {$sel:roleArn:VpcInterfaceRequest' :: Text
roleArn = Text
a} :: VpcInterfaceRequest)
vpcInterfaceRequest_name :: Lens.Lens' VpcInterfaceRequest Prelude.Text
vpcInterfaceRequest_name :: (Text -> f Text) -> VpcInterfaceRequest -> f VpcInterfaceRequest
vpcInterfaceRequest_name = (VpcInterfaceRequest -> Text)
-> (VpcInterfaceRequest -> Text -> VpcInterfaceRequest)
-> Lens VpcInterfaceRequest VpcInterfaceRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcInterfaceRequest' {Text
name :: Text
$sel:name:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
name} -> Text
name) (\s :: VpcInterfaceRequest
s@VpcInterfaceRequest' {} Text
a -> VpcInterfaceRequest
s {$sel:name:VpcInterfaceRequest' :: Text
name = Text
a} :: VpcInterfaceRequest)
instance Prelude.Hashable VpcInterfaceRequest
instance Prelude.NFData VpcInterfaceRequest
instance Core.ToJSON VpcInterfaceRequest where
toJSON :: VpcInterfaceRequest -> Value
toJSON VpcInterfaceRequest' {[Text]
Maybe NetworkInterfaceType
Text
name :: Text
roleArn :: Text
securityGroupIds :: [Text]
subnetId :: Text
networkInterfaceType :: Maybe NetworkInterfaceType
$sel:name:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
$sel:roleArn:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
$sel:securityGroupIds:VpcInterfaceRequest' :: VpcInterfaceRequest -> [Text]
$sel:subnetId:VpcInterfaceRequest' :: VpcInterfaceRequest -> Text
$sel:networkInterfaceType:VpcInterfaceRequest' :: VpcInterfaceRequest -> Maybe NetworkInterfaceType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"networkInterfaceType" Text -> NetworkInterfaceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NetworkInterfaceType -> Pair)
-> Maybe NetworkInterfaceType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkInterfaceType
networkInterfaceType,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"subnetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subnetId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"securityGroupIds" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
securityGroupIds),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn),
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)
]
)