{-# 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.CustomRoutingDestinationConfiguration 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.CustomRoutingProtocol
import qualified Amazonka.Prelude as Prelude
data CustomRoutingDestinationConfiguration = CustomRoutingDestinationConfiguration'
{
CustomRoutingDestinationConfiguration -> Natural
fromPort :: Prelude.Natural,
CustomRoutingDestinationConfiguration -> Natural
toPort :: Prelude.Natural,
CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
protocols :: Prelude.NonEmpty CustomRoutingProtocol
}
deriving (CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool
$c/= :: CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool
== :: CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool
$c== :: CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool
Prelude.Eq, ReadPrec [CustomRoutingDestinationConfiguration]
ReadPrec CustomRoutingDestinationConfiguration
Int -> ReadS CustomRoutingDestinationConfiguration
ReadS [CustomRoutingDestinationConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CustomRoutingDestinationConfiguration]
$creadListPrec :: ReadPrec [CustomRoutingDestinationConfiguration]
readPrec :: ReadPrec CustomRoutingDestinationConfiguration
$creadPrec :: ReadPrec CustomRoutingDestinationConfiguration
readList :: ReadS [CustomRoutingDestinationConfiguration]
$creadList :: ReadS [CustomRoutingDestinationConfiguration]
readsPrec :: Int -> ReadS CustomRoutingDestinationConfiguration
$creadsPrec :: Int -> ReadS CustomRoutingDestinationConfiguration
Prelude.Read, Int -> CustomRoutingDestinationConfiguration -> ShowS
[CustomRoutingDestinationConfiguration] -> ShowS
CustomRoutingDestinationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CustomRoutingDestinationConfiguration] -> ShowS
$cshowList :: [CustomRoutingDestinationConfiguration] -> ShowS
show :: CustomRoutingDestinationConfiguration -> String
$cshow :: CustomRoutingDestinationConfiguration -> String
showsPrec :: Int -> CustomRoutingDestinationConfiguration -> ShowS
$cshowsPrec :: Int -> CustomRoutingDestinationConfiguration -> ShowS
Prelude.Show, forall x.
Rep CustomRoutingDestinationConfiguration x
-> CustomRoutingDestinationConfiguration
forall x.
CustomRoutingDestinationConfiguration
-> Rep CustomRoutingDestinationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CustomRoutingDestinationConfiguration x
-> CustomRoutingDestinationConfiguration
$cfrom :: forall x.
CustomRoutingDestinationConfiguration
-> Rep CustomRoutingDestinationConfiguration x
Prelude.Generic)
newCustomRoutingDestinationConfiguration ::
Prelude.Natural ->
Prelude.Natural ->
Prelude.NonEmpty CustomRoutingProtocol ->
CustomRoutingDestinationConfiguration
newCustomRoutingDestinationConfiguration :: Natural
-> Natural
-> NonEmpty CustomRoutingProtocol
-> CustomRoutingDestinationConfiguration
newCustomRoutingDestinationConfiguration
Natural
pFromPort_
Natural
pToPort_
NonEmpty CustomRoutingProtocol
pProtocols_ =
CustomRoutingDestinationConfiguration'
{ $sel:fromPort:CustomRoutingDestinationConfiguration' :: Natural
fromPort =
Natural
pFromPort_,
$sel:toPort:CustomRoutingDestinationConfiguration' :: Natural
toPort = Natural
pToPort_,
$sel:protocols:CustomRoutingDestinationConfiguration' :: NonEmpty CustomRoutingProtocol
protocols =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty CustomRoutingProtocol
pProtocols_
}
customRoutingDestinationConfiguration_fromPort :: Lens.Lens' CustomRoutingDestinationConfiguration Prelude.Natural
customRoutingDestinationConfiguration_fromPort :: Lens' CustomRoutingDestinationConfiguration Natural
customRoutingDestinationConfiguration_fromPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomRoutingDestinationConfiguration' {Natural
fromPort :: Natural
$sel:fromPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
fromPort} -> Natural
fromPort) (\s :: CustomRoutingDestinationConfiguration
s@CustomRoutingDestinationConfiguration' {} Natural
a -> CustomRoutingDestinationConfiguration
s {$sel:fromPort:CustomRoutingDestinationConfiguration' :: Natural
fromPort = Natural
a} :: CustomRoutingDestinationConfiguration)
customRoutingDestinationConfiguration_toPort :: Lens.Lens' CustomRoutingDestinationConfiguration Prelude.Natural
customRoutingDestinationConfiguration_toPort :: Lens' CustomRoutingDestinationConfiguration Natural
customRoutingDestinationConfiguration_toPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomRoutingDestinationConfiguration' {Natural
toPort :: Natural
$sel:toPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
toPort} -> Natural
toPort) (\s :: CustomRoutingDestinationConfiguration
s@CustomRoutingDestinationConfiguration' {} Natural
a -> CustomRoutingDestinationConfiguration
s {$sel:toPort:CustomRoutingDestinationConfiguration' :: Natural
toPort = Natural
a} :: CustomRoutingDestinationConfiguration)
customRoutingDestinationConfiguration_protocols :: Lens.Lens' CustomRoutingDestinationConfiguration (Prelude.NonEmpty CustomRoutingProtocol)
customRoutingDestinationConfiguration_protocols :: Lens'
CustomRoutingDestinationConfiguration
(NonEmpty CustomRoutingProtocol)
customRoutingDestinationConfiguration_protocols = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CustomRoutingDestinationConfiguration' {NonEmpty CustomRoutingProtocol
protocols :: NonEmpty CustomRoutingProtocol
$sel:protocols:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
protocols} -> NonEmpty CustomRoutingProtocol
protocols) (\s :: CustomRoutingDestinationConfiguration
s@CustomRoutingDestinationConfiguration' {} NonEmpty CustomRoutingProtocol
a -> CustomRoutingDestinationConfiguration
s {$sel:protocols:CustomRoutingDestinationConfiguration' :: NonEmpty CustomRoutingProtocol
protocols = NonEmpty CustomRoutingProtocol
a} :: CustomRoutingDestinationConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.Hashable
CustomRoutingDestinationConfiguration
where
hashWithSalt :: Int -> CustomRoutingDestinationConfiguration -> Int
hashWithSalt
Int
_salt
CustomRoutingDestinationConfiguration' {Natural
NonEmpty CustomRoutingProtocol
protocols :: NonEmpty CustomRoutingProtocol
toPort :: Natural
fromPort :: Natural
$sel:protocols:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
$sel:toPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
$sel:fromPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
fromPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
toPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty CustomRoutingProtocol
protocols
instance
Prelude.NFData
CustomRoutingDestinationConfiguration
where
rnf :: CustomRoutingDestinationConfiguration -> ()
rnf CustomRoutingDestinationConfiguration' {Natural
NonEmpty CustomRoutingProtocol
protocols :: NonEmpty CustomRoutingProtocol
toPort :: Natural
fromPort :: Natural
$sel:protocols:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
$sel:toPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
$sel:fromPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Natural
fromPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
toPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty CustomRoutingProtocol
protocols
instance
Data.ToJSON
CustomRoutingDestinationConfiguration
where
toJSON :: CustomRoutingDestinationConfiguration -> Value
toJSON CustomRoutingDestinationConfiguration' {Natural
NonEmpty CustomRoutingProtocol
protocols :: NonEmpty CustomRoutingProtocol
toPort :: Natural
fromPort :: Natural
$sel:protocols:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
$sel:toPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
$sel:fromPort:CustomRoutingDestinationConfiguration' :: CustomRoutingDestinationConfiguration -> Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"FromPort" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
fromPort),
forall a. a -> Maybe a
Prelude.Just (Key
"ToPort" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
toPort),
forall a. a -> Maybe a
Prelude.Just (Key
"Protocols" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty CustomRoutingProtocol
protocols)
]
)