{-# 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.CodeDeploy.Types.TrafficRoute 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 TrafficRoute = TrafficRoute'
{
TrafficRoute -> Maybe [Text]
listenerArns :: Prelude.Maybe [Prelude.Text]
}
deriving (TrafficRoute -> TrafficRoute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrafficRoute -> TrafficRoute -> Bool
$c/= :: TrafficRoute -> TrafficRoute -> Bool
== :: TrafficRoute -> TrafficRoute -> Bool
$c== :: TrafficRoute -> TrafficRoute -> Bool
Prelude.Eq, ReadPrec [TrafficRoute]
ReadPrec TrafficRoute
Int -> ReadS TrafficRoute
ReadS [TrafficRoute]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrafficRoute]
$creadListPrec :: ReadPrec [TrafficRoute]
readPrec :: ReadPrec TrafficRoute
$creadPrec :: ReadPrec TrafficRoute
readList :: ReadS [TrafficRoute]
$creadList :: ReadS [TrafficRoute]
readsPrec :: Int -> ReadS TrafficRoute
$creadsPrec :: Int -> ReadS TrafficRoute
Prelude.Read, Int -> TrafficRoute -> ShowS
[TrafficRoute] -> ShowS
TrafficRoute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrafficRoute] -> ShowS
$cshowList :: [TrafficRoute] -> ShowS
show :: TrafficRoute -> String
$cshow :: TrafficRoute -> String
showsPrec :: Int -> TrafficRoute -> ShowS
$cshowsPrec :: Int -> TrafficRoute -> ShowS
Prelude.Show, forall x. Rep TrafficRoute x -> TrafficRoute
forall x. TrafficRoute -> Rep TrafficRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrafficRoute x -> TrafficRoute
$cfrom :: forall x. TrafficRoute -> Rep TrafficRoute x
Prelude.Generic)
newTrafficRoute ::
TrafficRoute
newTrafficRoute :: TrafficRoute
newTrafficRoute =
TrafficRoute' {$sel:listenerArns:TrafficRoute' :: Maybe [Text]
listenerArns = forall a. Maybe a
Prelude.Nothing}
trafficRoute_listenerArns :: Lens.Lens' TrafficRoute (Prelude.Maybe [Prelude.Text])
trafficRoute_listenerArns :: Lens' TrafficRoute (Maybe [Text])
trafficRoute_listenerArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrafficRoute' {Maybe [Text]
listenerArns :: Maybe [Text]
$sel:listenerArns:TrafficRoute' :: TrafficRoute -> Maybe [Text]
listenerArns} -> Maybe [Text]
listenerArns) (\s :: TrafficRoute
s@TrafficRoute' {} Maybe [Text]
a -> TrafficRoute
s {$sel:listenerArns:TrafficRoute' :: Maybe [Text]
listenerArns = Maybe [Text]
a} :: TrafficRoute) 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
instance Data.FromJSON TrafficRoute where
parseJSON :: Value -> Parser TrafficRoute
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"TrafficRoute"
( \Object
x ->
Maybe [Text] -> TrafficRoute
TrafficRoute'
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
"listenerArns" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable TrafficRoute where
hashWithSalt :: Int -> TrafficRoute -> Int
hashWithSalt Int
_salt TrafficRoute' {Maybe [Text]
listenerArns :: Maybe [Text]
$sel:listenerArns:TrafficRoute' :: TrafficRoute -> Maybe [Text]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
listenerArns
instance Prelude.NFData TrafficRoute where
rnf :: TrafficRoute -> ()
rnf TrafficRoute' {Maybe [Text]
listenerArns :: Maybe [Text]
$sel:listenerArns:TrafficRoute' :: TrafficRoute -> Maybe [Text]
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
listenerArns
instance Data.ToJSON TrafficRoute where
toJSON :: TrafficRoute -> Value
toJSON TrafficRoute' {Maybe [Text]
listenerArns :: Maybe [Text]
$sel:listenerArns:TrafficRoute' :: TrafficRoute -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"listenerArns" 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]
listenerArns]
)