{-# 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.Transfer.Types.EndpointDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EndpointDetails = EndpointDetails'
{
EndpointDetails -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
EndpointDetails -> Maybe [Text]
addressAllocationIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text
}
deriving (EndpointDetails -> EndpointDetails -> Bool
(EndpointDetails -> EndpointDetails -> Bool)
-> (EndpointDetails -> EndpointDetails -> Bool)
-> Eq EndpointDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointDetails -> EndpointDetails -> Bool
$c/= :: EndpointDetails -> EndpointDetails -> Bool
== :: EndpointDetails -> EndpointDetails -> Bool
$c== :: EndpointDetails -> EndpointDetails -> Bool
Prelude.Eq, ReadPrec [EndpointDetails]
ReadPrec EndpointDetails
Int -> ReadS EndpointDetails
ReadS [EndpointDetails]
(Int -> ReadS EndpointDetails)
-> ReadS [EndpointDetails]
-> ReadPrec EndpointDetails
-> ReadPrec [EndpointDetails]
-> Read EndpointDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointDetails]
$creadListPrec :: ReadPrec [EndpointDetails]
readPrec :: ReadPrec EndpointDetails
$creadPrec :: ReadPrec EndpointDetails
readList :: ReadS [EndpointDetails]
$creadList :: ReadS [EndpointDetails]
readsPrec :: Int -> ReadS EndpointDetails
$creadsPrec :: Int -> ReadS EndpointDetails
Prelude.Read, Int -> EndpointDetails -> ShowS
[EndpointDetails] -> ShowS
EndpointDetails -> String
(Int -> EndpointDetails -> ShowS)
-> (EndpointDetails -> String)
-> ([EndpointDetails] -> ShowS)
-> Show EndpointDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointDetails] -> ShowS
$cshowList :: [EndpointDetails] -> ShowS
show :: EndpointDetails -> String
$cshow :: EndpointDetails -> String
showsPrec :: Int -> EndpointDetails -> ShowS
$cshowsPrec :: Int -> EndpointDetails -> ShowS
Prelude.Show, (forall x. EndpointDetails -> Rep EndpointDetails x)
-> (forall x. Rep EndpointDetails x -> EndpointDetails)
-> Generic EndpointDetails
forall x. Rep EndpointDetails x -> EndpointDetails
forall x. EndpointDetails -> Rep EndpointDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointDetails x -> EndpointDetails
$cfrom :: forall x. EndpointDetails -> Rep EndpointDetails x
Prelude.Generic)
newEndpointDetails ::
EndpointDetails
newEndpointDetails :: EndpointDetails
newEndpointDetails =
EndpointDetails' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> EndpointDetails
EndpointDetails'
{ $sel:securityGroupIds:EndpointDetails' :: Maybe [Text]
securityGroupIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:subnetIds:EndpointDetails' :: Maybe [Text]
subnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:EndpointDetails' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:addressAllocationIds:EndpointDetails' :: Maybe [Text]
addressAllocationIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:vpcEndpointId:EndpointDetails' :: Maybe Text
vpcEndpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
endpointDetails_securityGroupIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_securityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_securityGroupIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
securityGroupIds} -> Maybe [Text]
securityGroupIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:securityGroupIds:EndpointDetails' :: Maybe [Text]
securityGroupIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
endpointDetails_subnetIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_subnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_subnetIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:subnetIds:EndpointDetails' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
endpointDetails_vpcId :: Lens.Lens' EndpointDetails (Prelude.Maybe Prelude.Text)
endpointDetails_vpcId :: (Maybe Text -> f (Maybe Text))
-> EndpointDetails -> f EndpointDetails
endpointDetails_vpcId = (EndpointDetails -> Maybe Text)
-> (EndpointDetails -> Maybe Text -> EndpointDetails)
-> Lens EndpointDetails EndpointDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe Text
a -> EndpointDetails
s {$sel:vpcId:EndpointDetails' :: Maybe Text
vpcId = Maybe Text
a} :: EndpointDetails)
endpointDetails_addressAllocationIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_addressAllocationIds :: (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails
endpointDetails_addressAllocationIds = (EndpointDetails -> Maybe [Text])
-> (EndpointDetails -> Maybe [Text] -> EndpointDetails)
-> Lens
EndpointDetails EndpointDetails (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe [Text]
addressAllocationIds :: Maybe [Text]
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
addressAllocationIds} -> Maybe [Text]
addressAllocationIds) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe [Text]
a -> EndpointDetails
s {$sel:addressAllocationIds:EndpointDetails' :: Maybe [Text]
addressAllocationIds = Maybe [Text]
a} :: EndpointDetails) ((Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails -> f EndpointDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> EndpointDetails
-> f EndpointDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
endpointDetails_vpcEndpointId :: Lens.Lens' EndpointDetails (Prelude.Maybe Prelude.Text)
endpointDetails_vpcEndpointId :: (Maybe Text -> f (Maybe Text))
-> EndpointDetails -> f EndpointDetails
endpointDetails_vpcEndpointId = (EndpointDetails -> Maybe Text)
-> (EndpointDetails -> Maybe Text -> EndpointDetails)
-> Lens EndpointDetails EndpointDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDetails' {Maybe Text
vpcEndpointId :: Maybe Text
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
vpcEndpointId} -> Maybe Text
vpcEndpointId) (\s :: EndpointDetails
s@EndpointDetails' {} Maybe Text
a -> EndpointDetails
s {$sel:vpcEndpointId:EndpointDetails' :: Maybe Text
vpcEndpointId = Maybe Text
a} :: EndpointDetails)
instance Core.FromJSON EndpointDetails where
parseJSON :: Value -> Parser EndpointDetails
parseJSON =
String
-> (Object -> Parser EndpointDetails)
-> Value
-> Parser EndpointDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EndpointDetails"
( \Object
x ->
Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> EndpointDetails
EndpointDetails'
(Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> EndpointDetails)
-> Parser (Maybe [Text])
-> Parser
(Maybe [Text]
-> Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroupIds"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [Text]
-> Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetIds" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text -> Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> EndpointDetails)
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
"VpcId")
Parser (Maybe [Text] -> Maybe Text -> EndpointDetails)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> EndpointDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AddressAllocationIds"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> EndpointDetails)
-> Parser (Maybe Text) -> Parser EndpointDetails
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
"VpcEndpointId")
)
instance Prelude.Hashable EndpointDetails
instance Prelude.NFData EndpointDetails
instance Core.ToJSON EndpointDetails where
toJSON :: EndpointDetails -> Value
toJSON EndpointDetails' {Maybe [Text]
Maybe Text
vpcEndpointId :: Maybe Text
addressAllocationIds :: Maybe [Text]
vpcId :: Maybe Text
subnetIds :: Maybe [Text]
securityGroupIds :: Maybe [Text]
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SecurityGroupIds" 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]
securityGroupIds,
(Text
"SubnetIds" 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]
subnetIds,
(Text
"VpcId" 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
vpcId,
(Text
"AddressAllocationIds" 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]
addressAllocationIds,
(Text
"VpcEndpointId" 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
vpcEndpointId
]
)