{-# 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.Redshift.Types.VpcEndpoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
import Amazonka.Redshift.Types.NetworkInterface
data VpcEndpoint = VpcEndpoint'
{
VpcEndpoint -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
VpcEndpoint -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
VpcEndpoint -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text
}
deriving (VpcEndpoint -> VpcEndpoint -> Bool
(VpcEndpoint -> VpcEndpoint -> Bool)
-> (VpcEndpoint -> VpcEndpoint -> Bool) -> Eq VpcEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpcEndpoint -> VpcEndpoint -> Bool
$c/= :: VpcEndpoint -> VpcEndpoint -> Bool
== :: VpcEndpoint -> VpcEndpoint -> Bool
$c== :: VpcEndpoint -> VpcEndpoint -> Bool
Prelude.Eq, ReadPrec [VpcEndpoint]
ReadPrec VpcEndpoint
Int -> ReadS VpcEndpoint
ReadS [VpcEndpoint]
(Int -> ReadS VpcEndpoint)
-> ReadS [VpcEndpoint]
-> ReadPrec VpcEndpoint
-> ReadPrec [VpcEndpoint]
-> Read VpcEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpcEndpoint]
$creadListPrec :: ReadPrec [VpcEndpoint]
readPrec :: ReadPrec VpcEndpoint
$creadPrec :: ReadPrec VpcEndpoint
readList :: ReadS [VpcEndpoint]
$creadList :: ReadS [VpcEndpoint]
readsPrec :: Int -> ReadS VpcEndpoint
$creadsPrec :: Int -> ReadS VpcEndpoint
Prelude.Read, Int -> VpcEndpoint -> ShowS
[VpcEndpoint] -> ShowS
VpcEndpoint -> String
(Int -> VpcEndpoint -> ShowS)
-> (VpcEndpoint -> String)
-> ([VpcEndpoint] -> ShowS)
-> Show VpcEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpcEndpoint] -> ShowS
$cshowList :: [VpcEndpoint] -> ShowS
show :: VpcEndpoint -> String
$cshow :: VpcEndpoint -> String
showsPrec :: Int -> VpcEndpoint -> ShowS
$cshowsPrec :: Int -> VpcEndpoint -> ShowS
Prelude.Show, (forall x. VpcEndpoint -> Rep VpcEndpoint x)
-> (forall x. Rep VpcEndpoint x -> VpcEndpoint)
-> Generic VpcEndpoint
forall x. Rep VpcEndpoint x -> VpcEndpoint
forall x. VpcEndpoint -> Rep VpcEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpcEndpoint x -> VpcEndpoint
$cfrom :: forall x. VpcEndpoint -> Rep VpcEndpoint x
Prelude.Generic)
newVpcEndpoint ::
VpcEndpoint
newVpcEndpoint :: VpcEndpoint
newVpcEndpoint =
VpcEndpoint' :: Maybe Text -> Maybe [NetworkInterface] -> Maybe Text -> VpcEndpoint
VpcEndpoint'
{ $sel:vpcId:VpcEndpoint' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:networkInterfaces:VpcEndpoint' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
forall a. Maybe a
Prelude.Nothing,
$sel:vpcEndpointId:VpcEndpoint' :: Maybe Text
vpcEndpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
vpcEndpoint_vpcId :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text)
vpcEndpoint_vpcId :: (Maybe Text -> f (Maybe Text)) -> VpcEndpoint -> f VpcEndpoint
vpcEndpoint_vpcId = (VpcEndpoint -> Maybe Text)
-> (VpcEndpoint -> Maybe Text -> VpcEndpoint)
-> Lens VpcEndpoint VpcEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcEndpoint' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:VpcEndpoint' :: VpcEndpoint -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: VpcEndpoint
s@VpcEndpoint' {} Maybe Text
a -> VpcEndpoint
s {$sel:vpcId:VpcEndpoint' :: Maybe Text
vpcId = Maybe Text
a} :: VpcEndpoint)
vpcEndpoint_networkInterfaces :: Lens.Lens' VpcEndpoint (Prelude.Maybe [NetworkInterface])
vpcEndpoint_networkInterfaces :: (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> VpcEndpoint -> f VpcEndpoint
vpcEndpoint_networkInterfaces = (VpcEndpoint -> Maybe [NetworkInterface])
-> (VpcEndpoint -> Maybe [NetworkInterface] -> VpcEndpoint)
-> Lens
VpcEndpoint
VpcEndpoint
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcEndpoint' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:VpcEndpoint' :: VpcEndpoint -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: VpcEndpoint
s@VpcEndpoint' {} Maybe [NetworkInterface]
a -> VpcEndpoint
s {$sel:networkInterfaces:VpcEndpoint' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: VpcEndpoint) ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> VpcEndpoint -> f VpcEndpoint)
-> ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> VpcEndpoint
-> f VpcEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
-> Iso
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
(Maybe [NetworkInterface])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
[NetworkInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vpcEndpoint_vpcEndpointId :: Lens.Lens' VpcEndpoint (Prelude.Maybe Prelude.Text)
vpcEndpoint_vpcEndpointId :: (Maybe Text -> f (Maybe Text)) -> VpcEndpoint -> f VpcEndpoint
vpcEndpoint_vpcEndpointId = (VpcEndpoint -> Maybe Text)
-> (VpcEndpoint -> Maybe Text -> VpcEndpoint)
-> Lens VpcEndpoint VpcEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpcEndpoint' {Maybe Text
vpcEndpointId :: Maybe Text
$sel:vpcEndpointId:VpcEndpoint' :: VpcEndpoint -> Maybe Text
vpcEndpointId} -> Maybe Text
vpcEndpointId) (\s :: VpcEndpoint
s@VpcEndpoint' {} Maybe Text
a -> VpcEndpoint
s {$sel:vpcEndpointId:VpcEndpoint' :: Maybe Text
vpcEndpointId = Maybe Text
a} :: VpcEndpoint)
instance Core.FromXML VpcEndpoint where
parseXML :: [Node] -> Either String VpcEndpoint
parseXML [Node]
x =
Maybe Text -> Maybe [NetworkInterface] -> Maybe Text -> VpcEndpoint
VpcEndpoint'
(Maybe Text
-> Maybe [NetworkInterface] -> Maybe Text -> VpcEndpoint)
-> Either String (Maybe Text)
-> Either
String (Maybe [NetworkInterface] -> Maybe Text -> VpcEndpoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcId")
Either
String (Maybe [NetworkInterface] -> Maybe Text -> VpcEndpoint)
-> Either String (Maybe [NetworkInterface])
-> Either String (Maybe Text -> VpcEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NetworkInterfaces"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String (Maybe [NetworkInterface]))
-> Either String (Maybe [NetworkInterface])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [NetworkInterface])
-> [Node] -> Either String (Maybe [NetworkInterface])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [NetworkInterface]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"NetworkInterface")
)
Either String (Maybe Text -> VpcEndpoint)
-> Either String (Maybe Text) -> Either String VpcEndpoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcEndpointId")
instance Prelude.Hashable VpcEndpoint
instance Prelude.NFData VpcEndpoint