{-# 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 Amazonka.GlobalAccelerator.Types.CustomRoutingProtocol
import qualified Amazonka.Lens as Lens
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
(CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool)
-> (CustomRoutingDestinationConfiguration
-> CustomRoutingDestinationConfiguration -> Bool)
-> Eq CustomRoutingDestinationConfiguration
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]
(Int -> ReadS CustomRoutingDestinationConfiguration)
-> ReadS [CustomRoutingDestinationConfiguration]
-> ReadPrec CustomRoutingDestinationConfiguration
-> ReadPrec [CustomRoutingDestinationConfiguration]
-> Read 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
(Int -> CustomRoutingDestinationConfiguration -> ShowS)
-> (CustomRoutingDestinationConfiguration -> String)
-> ([CustomRoutingDestinationConfiguration] -> ShowS)
-> Show CustomRoutingDestinationConfiguration
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.
CustomRoutingDestinationConfiguration
-> Rep CustomRoutingDestinationConfiguration x)
-> (forall x.
Rep CustomRoutingDestinationConfiguration x
-> CustomRoutingDestinationConfiguration)
-> Generic CustomRoutingDestinationConfiguration
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' :: Natural
-> Natural
-> NonEmpty CustomRoutingProtocol
-> CustomRoutingDestinationConfiguration
CustomRoutingDestinationConfiguration'
{ $sel:fromPort:CustomRoutingDestinationConfiguration' :: Natural
fromPort =
Natural
pFromPort_,
$sel:toPort:CustomRoutingDestinationConfiguration' :: Natural
toPort = Natural
pToPort_,
$sel:protocols:CustomRoutingDestinationConfiguration' :: NonEmpty CustomRoutingProtocol
protocols =
Tagged
(NonEmpty CustomRoutingProtocol)
(Identity (NonEmpty CustomRoutingProtocol))
-> Tagged
(NonEmpty CustomRoutingProtocol)
(Identity (NonEmpty CustomRoutingProtocol))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
(NonEmpty CustomRoutingProtocol)
(Identity (NonEmpty CustomRoutingProtocol))
-> Tagged
(NonEmpty CustomRoutingProtocol)
(Identity (NonEmpty CustomRoutingProtocol)))
-> NonEmpty CustomRoutingProtocol -> NonEmpty CustomRoutingProtocol
forall t b. AReview t b -> b -> t
Lens.# NonEmpty CustomRoutingProtocol
pProtocols_
}
customRoutingDestinationConfiguration_fromPort :: Lens.Lens' CustomRoutingDestinationConfiguration Prelude.Natural
customRoutingDestinationConfiguration_fromPort :: (Natural -> f Natural)
-> CustomRoutingDestinationConfiguration
-> f CustomRoutingDestinationConfiguration
customRoutingDestinationConfiguration_fromPort = (CustomRoutingDestinationConfiguration -> Natural)
-> (CustomRoutingDestinationConfiguration
-> Natural -> CustomRoutingDestinationConfiguration)
-> Lens
CustomRoutingDestinationConfiguration
CustomRoutingDestinationConfiguration
Natural
Natural
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 :: (Natural -> f Natural)
-> CustomRoutingDestinationConfiguration
-> f CustomRoutingDestinationConfiguration
customRoutingDestinationConfiguration_toPort = (CustomRoutingDestinationConfiguration -> Natural)
-> (CustomRoutingDestinationConfiguration
-> Natural -> CustomRoutingDestinationConfiguration)
-> Lens
CustomRoutingDestinationConfiguration
CustomRoutingDestinationConfiguration
Natural
Natural
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 :: (NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> CustomRoutingDestinationConfiguration
-> f CustomRoutingDestinationConfiguration
customRoutingDestinationConfiguration_protocols = (CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol)
-> (CustomRoutingDestinationConfiguration
-> NonEmpty CustomRoutingProtocol
-> CustomRoutingDestinationConfiguration)
-> Lens
CustomRoutingDestinationConfiguration
CustomRoutingDestinationConfiguration
(NonEmpty CustomRoutingProtocol)
(NonEmpty CustomRoutingProtocol)
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) ((NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> CustomRoutingDestinationConfiguration
-> f CustomRoutingDestinationConfiguration)
-> ((NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> (NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> CustomRoutingDestinationConfiguration
-> f CustomRoutingDestinationConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol))
-> NonEmpty CustomRoutingProtocol
-> f (NonEmpty CustomRoutingProtocol)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.Hashable
CustomRoutingDestinationConfiguration
instance
Prelude.NFData
CustomRoutingDestinationConfiguration
instance
Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FromPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
fromPort),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ToPort" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
toPort),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Protocols" Text -> NonEmpty CustomRoutingProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty CustomRoutingProtocol
protocols)
]
)