{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EndpointDetails = EndpointDetails'
{
EndpointDetails -> Maybe [Text]
addressAllocationIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe [Text]
securityGroupIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text],
EndpointDetails -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text,
EndpointDetails -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text
}
deriving (EndpointDetails -> EndpointDetails -> Bool
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]
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
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. 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'
{ $sel:addressAllocationIds:EndpointDetails' :: Maybe [Text]
addressAllocationIds =
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroupIds:EndpointDetails' :: Maybe [Text]
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
$sel:subnetIds:EndpointDetails' :: Maybe [Text]
subnetIds = forall a. Maybe a
Prelude.Nothing,
$sel:vpcEndpointId:EndpointDetails' :: Maybe Text
vpcEndpointId = forall a. Maybe a
Prelude.Nothing,
$sel:vpcId:EndpointDetails' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing
}
endpointDetails_addressAllocationIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_addressAllocationIds :: Lens' EndpointDetails (Maybe [Text])
endpointDetails_addressAllocationIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
endpointDetails_securityGroupIds :: Lens.Lens' EndpointDetails (Prelude.Maybe [Prelude.Text])
endpointDetails_securityGroupIds :: Lens' EndpointDetails (Maybe [Text])
endpointDetails_securityGroupIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' EndpointDetails (Maybe [Text])
endpointDetails_subnetIds = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 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 :: Lens' EndpointDetails (Maybe Text)
endpointDetails_vpcEndpointId = 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)
endpointDetails_vpcId :: Lens.Lens' EndpointDetails (Prelude.Maybe Prelude.Text)
endpointDetails_vpcId :: Lens' EndpointDetails (Maybe Text)
endpointDetails_vpcId = 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)
instance Data.FromJSON EndpointDetails where
parseJSON :: Value -> Parser EndpointDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointDetails"
( \Object
x ->
Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> EndpointDetails
EndpointDetails'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AddressAllocationIds"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecurityGroupIds"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SubnetIds" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcEndpointId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcId")
)
instance Prelude.Hashable EndpointDetails where
hashWithSalt :: Int -> EndpointDetails -> Int
hashWithSalt Int
_salt EndpointDetails' {Maybe [Text]
Maybe Text
vpcId :: Maybe Text
vpcEndpointId :: Maybe Text
subnetIds :: Maybe [Text]
securityGroupIds :: Maybe [Text]
addressAllocationIds :: Maybe [Text]
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
addressAllocationIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
securityGroupIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnetIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcEndpointId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId
instance Prelude.NFData EndpointDetails where
rnf :: EndpointDetails -> ()
rnf EndpointDetails' {Maybe [Text]
Maybe Text
vpcId :: Maybe Text
vpcEndpointId :: Maybe Text
subnetIds :: Maybe [Text]
securityGroupIds :: Maybe [Text]
addressAllocationIds :: Maybe [Text]
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
addressAllocationIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
securityGroupIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnetIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcEndpointId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId
instance Data.ToJSON EndpointDetails where
toJSON :: EndpointDetails -> Value
toJSON EndpointDetails' {Maybe [Text]
Maybe Text
vpcId :: Maybe Text
vpcEndpointId :: Maybe Text
subnetIds :: Maybe [Text]
securityGroupIds :: Maybe [Text]
addressAllocationIds :: Maybe [Text]
$sel:vpcId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:vpcEndpointId:EndpointDetails' :: EndpointDetails -> Maybe Text
$sel:subnetIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:securityGroupIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
$sel:addressAllocationIds:EndpointDetails' :: EndpointDetails -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AddressAllocationIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
addressAllocationIds,
(Key
"SecurityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
securityGroupIds,
(Key
"SubnetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
subnetIds,
(Key
"VpcEndpointId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcEndpointId,
(Key
"VpcId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vpcId
]
)