{-# 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.GlobalAccelerator.Types.DestinationPortMapping where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GlobalAccelerator.Types.CustomRoutingDestinationTrafficState
import Amazonka.GlobalAccelerator.Types.IpAddressType
import Amazonka.GlobalAccelerator.Types.SocketAddress
import qualified Amazonka.Prelude as Prelude
data DestinationPortMapping = DestinationPortMapping'
{
DestinationPortMapping -> Maybe Text
acceleratorArn :: Prelude.Maybe Prelude.Text,
DestinationPortMapping -> Maybe [SocketAddress]
acceleratorSocketAddresses :: Prelude.Maybe [SocketAddress],
DestinationPortMapping -> Maybe SocketAddress
destinationSocketAddress :: Prelude.Maybe SocketAddress,
DestinationPortMapping
-> Maybe CustomRoutingDestinationTrafficState
destinationTrafficState :: Prelude.Maybe CustomRoutingDestinationTrafficState,
DestinationPortMapping -> Maybe Text
endpointGroupArn :: Prelude.Maybe Prelude.Text,
DestinationPortMapping -> Maybe Text
endpointGroupRegion :: Prelude.Maybe Prelude.Text,
DestinationPortMapping -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text,
DestinationPortMapping -> Maybe IpAddressType
ipAddressType :: Prelude.Maybe IpAddressType
}
deriving (DestinationPortMapping -> DestinationPortMapping -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DestinationPortMapping -> DestinationPortMapping -> Bool
$c/= :: DestinationPortMapping -> DestinationPortMapping -> Bool
== :: DestinationPortMapping -> DestinationPortMapping -> Bool
$c== :: DestinationPortMapping -> DestinationPortMapping -> Bool
Prelude.Eq, ReadPrec [DestinationPortMapping]
ReadPrec DestinationPortMapping
Int -> ReadS DestinationPortMapping
ReadS [DestinationPortMapping]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DestinationPortMapping]
$creadListPrec :: ReadPrec [DestinationPortMapping]
readPrec :: ReadPrec DestinationPortMapping
$creadPrec :: ReadPrec DestinationPortMapping
readList :: ReadS [DestinationPortMapping]
$creadList :: ReadS [DestinationPortMapping]
readsPrec :: Int -> ReadS DestinationPortMapping
$creadsPrec :: Int -> ReadS DestinationPortMapping
Prelude.Read, Int -> DestinationPortMapping -> ShowS
[DestinationPortMapping] -> ShowS
DestinationPortMapping -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DestinationPortMapping] -> ShowS
$cshowList :: [DestinationPortMapping] -> ShowS
show :: DestinationPortMapping -> String
$cshow :: DestinationPortMapping -> String
showsPrec :: Int -> DestinationPortMapping -> ShowS
$cshowsPrec :: Int -> DestinationPortMapping -> ShowS
Prelude.Show, forall x. Rep DestinationPortMapping x -> DestinationPortMapping
forall x. DestinationPortMapping -> Rep DestinationPortMapping x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DestinationPortMapping x -> DestinationPortMapping
$cfrom :: forall x. DestinationPortMapping -> Rep DestinationPortMapping x
Prelude.Generic)
newDestinationPortMapping ::
DestinationPortMapping
newDestinationPortMapping :: DestinationPortMapping
newDestinationPortMapping =
DestinationPortMapping'
{ $sel:acceleratorArn:DestinationPortMapping' :: Maybe Text
acceleratorArn =
forall a. Maybe a
Prelude.Nothing,
$sel:acceleratorSocketAddresses:DestinationPortMapping' :: Maybe [SocketAddress]
acceleratorSocketAddresses = forall a. Maybe a
Prelude.Nothing,
$sel:destinationSocketAddress:DestinationPortMapping' :: Maybe SocketAddress
destinationSocketAddress = forall a. Maybe a
Prelude.Nothing,
$sel:destinationTrafficState:DestinationPortMapping' :: Maybe CustomRoutingDestinationTrafficState
destinationTrafficState = forall a. Maybe a
Prelude.Nothing,
$sel:endpointGroupArn:DestinationPortMapping' :: Maybe Text
endpointGroupArn = forall a. Maybe a
Prelude.Nothing,
$sel:endpointGroupRegion:DestinationPortMapping' :: Maybe Text
endpointGroupRegion = forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:DestinationPortMapping' :: Maybe Text
endpointId = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddressType:DestinationPortMapping' :: Maybe IpAddressType
ipAddressType = forall a. Maybe a
Prelude.Nothing
}
destinationPortMapping_acceleratorArn :: Lens.Lens' DestinationPortMapping (Prelude.Maybe Prelude.Text)
destinationPortMapping_acceleratorArn :: Lens' DestinationPortMapping (Maybe Text)
destinationPortMapping_acceleratorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe Text
acceleratorArn :: Maybe Text
$sel:acceleratorArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
acceleratorArn} -> Maybe Text
acceleratorArn) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe Text
a -> DestinationPortMapping
s {$sel:acceleratorArn:DestinationPortMapping' :: Maybe Text
acceleratorArn = Maybe Text
a} :: DestinationPortMapping)
destinationPortMapping_acceleratorSocketAddresses :: Lens.Lens' DestinationPortMapping (Prelude.Maybe [SocketAddress])
destinationPortMapping_acceleratorSocketAddresses :: Lens' DestinationPortMapping (Maybe [SocketAddress])
destinationPortMapping_acceleratorSocketAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe [SocketAddress]
acceleratorSocketAddresses :: Maybe [SocketAddress]
$sel:acceleratorSocketAddresses:DestinationPortMapping' :: DestinationPortMapping -> Maybe [SocketAddress]
acceleratorSocketAddresses} -> Maybe [SocketAddress]
acceleratorSocketAddresses) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe [SocketAddress]
a -> DestinationPortMapping
s {$sel:acceleratorSocketAddresses:DestinationPortMapping' :: Maybe [SocketAddress]
acceleratorSocketAddresses = Maybe [SocketAddress]
a} :: DestinationPortMapping) 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
destinationPortMapping_destinationSocketAddress :: Lens.Lens' DestinationPortMapping (Prelude.Maybe SocketAddress)
destinationPortMapping_destinationSocketAddress :: Lens' DestinationPortMapping (Maybe SocketAddress)
destinationPortMapping_destinationSocketAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe SocketAddress
destinationSocketAddress :: Maybe SocketAddress
$sel:destinationSocketAddress:DestinationPortMapping' :: DestinationPortMapping -> Maybe SocketAddress
destinationSocketAddress} -> Maybe SocketAddress
destinationSocketAddress) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe SocketAddress
a -> DestinationPortMapping
s {$sel:destinationSocketAddress:DestinationPortMapping' :: Maybe SocketAddress
destinationSocketAddress = Maybe SocketAddress
a} :: DestinationPortMapping)
destinationPortMapping_destinationTrafficState :: Lens.Lens' DestinationPortMapping (Prelude.Maybe CustomRoutingDestinationTrafficState)
destinationPortMapping_destinationTrafficState :: Lens'
DestinationPortMapping (Maybe CustomRoutingDestinationTrafficState)
destinationPortMapping_destinationTrafficState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe CustomRoutingDestinationTrafficState
destinationTrafficState :: Maybe CustomRoutingDestinationTrafficState
$sel:destinationTrafficState:DestinationPortMapping' :: DestinationPortMapping
-> Maybe CustomRoutingDestinationTrafficState
destinationTrafficState} -> Maybe CustomRoutingDestinationTrafficState
destinationTrafficState) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe CustomRoutingDestinationTrafficState
a -> DestinationPortMapping
s {$sel:destinationTrafficState:DestinationPortMapping' :: Maybe CustomRoutingDestinationTrafficState
destinationTrafficState = Maybe CustomRoutingDestinationTrafficState
a} :: DestinationPortMapping)
destinationPortMapping_endpointGroupArn :: Lens.Lens' DestinationPortMapping (Prelude.Maybe Prelude.Text)
destinationPortMapping_endpointGroupArn :: Lens' DestinationPortMapping (Maybe Text)
destinationPortMapping_endpointGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe Text
endpointGroupArn :: Maybe Text
$sel:endpointGroupArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
endpointGroupArn} -> Maybe Text
endpointGroupArn) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe Text
a -> DestinationPortMapping
s {$sel:endpointGroupArn:DestinationPortMapping' :: Maybe Text
endpointGroupArn = Maybe Text
a} :: DestinationPortMapping)
destinationPortMapping_endpointGroupRegion :: Lens.Lens' DestinationPortMapping (Prelude.Maybe Prelude.Text)
destinationPortMapping_endpointGroupRegion :: Lens' DestinationPortMapping (Maybe Text)
destinationPortMapping_endpointGroupRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe Text
endpointGroupRegion :: Maybe Text
$sel:endpointGroupRegion:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
endpointGroupRegion} -> Maybe Text
endpointGroupRegion) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe Text
a -> DestinationPortMapping
s {$sel:endpointGroupRegion:DestinationPortMapping' :: Maybe Text
endpointGroupRegion = Maybe Text
a} :: DestinationPortMapping)
destinationPortMapping_endpointId :: Lens.Lens' DestinationPortMapping (Prelude.Maybe Prelude.Text)
destinationPortMapping_endpointId :: Lens' DestinationPortMapping (Maybe Text)
destinationPortMapping_endpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe Text
a -> DestinationPortMapping
s {$sel:endpointId:DestinationPortMapping' :: Maybe Text
endpointId = Maybe Text
a} :: DestinationPortMapping)
destinationPortMapping_ipAddressType :: Lens.Lens' DestinationPortMapping (Prelude.Maybe IpAddressType)
destinationPortMapping_ipAddressType :: Lens' DestinationPortMapping (Maybe IpAddressType)
destinationPortMapping_ipAddressType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DestinationPortMapping' {Maybe IpAddressType
ipAddressType :: Maybe IpAddressType
$sel:ipAddressType:DestinationPortMapping' :: DestinationPortMapping -> Maybe IpAddressType
ipAddressType} -> Maybe IpAddressType
ipAddressType) (\s :: DestinationPortMapping
s@DestinationPortMapping' {} Maybe IpAddressType
a -> DestinationPortMapping
s {$sel:ipAddressType:DestinationPortMapping' :: Maybe IpAddressType
ipAddressType = Maybe IpAddressType
a} :: DestinationPortMapping)
instance Data.FromJSON DestinationPortMapping where
parseJSON :: Value -> Parser DestinationPortMapping
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DestinationPortMapping"
( \Object
x ->
Maybe Text
-> Maybe [SocketAddress]
-> Maybe SocketAddress
-> Maybe CustomRoutingDestinationTrafficState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressType
-> DestinationPortMapping
DestinationPortMapping'
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
"AcceleratorArn")
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
"AcceleratorSocketAddresses"
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
"DestinationSocketAddress")
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
"DestinationTrafficState")
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
"EndpointGroupArn")
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
"EndpointGroupRegion")
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
"EndpointId")
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
"IpAddressType")
)
instance Prelude.Hashable DestinationPortMapping where
hashWithSalt :: Int -> DestinationPortMapping -> Int
hashWithSalt Int
_salt DestinationPortMapping' {Maybe [SocketAddress]
Maybe Text
Maybe CustomRoutingDestinationTrafficState
Maybe IpAddressType
Maybe SocketAddress
ipAddressType :: Maybe IpAddressType
endpointId :: Maybe Text
endpointGroupRegion :: Maybe Text
endpointGroupArn :: Maybe Text
destinationTrafficState :: Maybe CustomRoutingDestinationTrafficState
destinationSocketAddress :: Maybe SocketAddress
acceleratorSocketAddresses :: Maybe [SocketAddress]
acceleratorArn :: Maybe Text
$sel:ipAddressType:DestinationPortMapping' :: DestinationPortMapping -> Maybe IpAddressType
$sel:endpointId:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:endpointGroupRegion:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:endpointGroupArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:destinationTrafficState:DestinationPortMapping' :: DestinationPortMapping
-> Maybe CustomRoutingDestinationTrafficState
$sel:destinationSocketAddress:DestinationPortMapping' :: DestinationPortMapping -> Maybe SocketAddress
$sel:acceleratorSocketAddresses:DestinationPortMapping' :: DestinationPortMapping -> Maybe [SocketAddress]
$sel:acceleratorArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceleratorArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SocketAddress]
acceleratorSocketAddresses
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SocketAddress
destinationSocketAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomRoutingDestinationTrafficState
destinationTrafficState
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointGroupArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointGroupRegion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endpointId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpAddressType
ipAddressType
instance Prelude.NFData DestinationPortMapping where
rnf :: DestinationPortMapping -> ()
rnf DestinationPortMapping' {Maybe [SocketAddress]
Maybe Text
Maybe CustomRoutingDestinationTrafficState
Maybe IpAddressType
Maybe SocketAddress
ipAddressType :: Maybe IpAddressType
endpointId :: Maybe Text
endpointGroupRegion :: Maybe Text
endpointGroupArn :: Maybe Text
destinationTrafficState :: Maybe CustomRoutingDestinationTrafficState
destinationSocketAddress :: Maybe SocketAddress
acceleratorSocketAddresses :: Maybe [SocketAddress]
acceleratorArn :: Maybe Text
$sel:ipAddressType:DestinationPortMapping' :: DestinationPortMapping -> Maybe IpAddressType
$sel:endpointId:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:endpointGroupRegion:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:endpointGroupArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
$sel:destinationTrafficState:DestinationPortMapping' :: DestinationPortMapping
-> Maybe CustomRoutingDestinationTrafficState
$sel:destinationSocketAddress:DestinationPortMapping' :: DestinationPortMapping -> Maybe SocketAddress
$sel:acceleratorSocketAddresses:DestinationPortMapping' :: DestinationPortMapping -> Maybe [SocketAddress]
$sel:acceleratorArn:DestinationPortMapping' :: DestinationPortMapping -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceleratorArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SocketAddress]
acceleratorSocketAddresses
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SocketAddress
destinationSocketAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomRoutingDestinationTrafficState
destinationTrafficState
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointGroupArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointGroupRegion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endpointId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressType
ipAddressType