{-# 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.SecurityHub.Types.AwsElbLoadBalancerBackendServerDescription where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsElbLoadBalancerBackendServerDescription = AwsElbLoadBalancerBackendServerDescription'
{
AwsElbLoadBalancerBackendServerDescription -> Maybe [Text]
policyNames :: Prelude.Maybe [Prelude.Text],
AwsElbLoadBalancerBackendServerDescription -> Maybe Int
instancePort :: Prelude.Maybe Prelude.Int
}
deriving (AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool
(AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool)
-> (AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool)
-> Eq AwsElbLoadBalancerBackendServerDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool
$c/= :: AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool
== :: AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool
$c== :: AwsElbLoadBalancerBackendServerDescription
-> AwsElbLoadBalancerBackendServerDescription -> Bool
Prelude.Eq, ReadPrec [AwsElbLoadBalancerBackendServerDescription]
ReadPrec AwsElbLoadBalancerBackendServerDescription
Int -> ReadS AwsElbLoadBalancerBackendServerDescription
ReadS [AwsElbLoadBalancerBackendServerDescription]
(Int -> ReadS AwsElbLoadBalancerBackendServerDescription)
-> ReadS [AwsElbLoadBalancerBackendServerDescription]
-> ReadPrec AwsElbLoadBalancerBackendServerDescription
-> ReadPrec [AwsElbLoadBalancerBackendServerDescription]
-> Read AwsElbLoadBalancerBackendServerDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsElbLoadBalancerBackendServerDescription]
$creadListPrec :: ReadPrec [AwsElbLoadBalancerBackendServerDescription]
readPrec :: ReadPrec AwsElbLoadBalancerBackendServerDescription
$creadPrec :: ReadPrec AwsElbLoadBalancerBackendServerDescription
readList :: ReadS [AwsElbLoadBalancerBackendServerDescription]
$creadList :: ReadS [AwsElbLoadBalancerBackendServerDescription]
readsPrec :: Int -> ReadS AwsElbLoadBalancerBackendServerDescription
$creadsPrec :: Int -> ReadS AwsElbLoadBalancerBackendServerDescription
Prelude.Read, Int -> AwsElbLoadBalancerBackendServerDescription -> ShowS
[AwsElbLoadBalancerBackendServerDescription] -> ShowS
AwsElbLoadBalancerBackendServerDescription -> String
(Int -> AwsElbLoadBalancerBackendServerDescription -> ShowS)
-> (AwsElbLoadBalancerBackendServerDescription -> String)
-> ([AwsElbLoadBalancerBackendServerDescription] -> ShowS)
-> Show AwsElbLoadBalancerBackendServerDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsElbLoadBalancerBackendServerDescription] -> ShowS
$cshowList :: [AwsElbLoadBalancerBackendServerDescription] -> ShowS
show :: AwsElbLoadBalancerBackendServerDescription -> String
$cshow :: AwsElbLoadBalancerBackendServerDescription -> String
showsPrec :: Int -> AwsElbLoadBalancerBackendServerDescription -> ShowS
$cshowsPrec :: Int -> AwsElbLoadBalancerBackendServerDescription -> ShowS
Prelude.Show, (forall x.
AwsElbLoadBalancerBackendServerDescription
-> Rep AwsElbLoadBalancerBackendServerDescription x)
-> (forall x.
Rep AwsElbLoadBalancerBackendServerDescription x
-> AwsElbLoadBalancerBackendServerDescription)
-> Generic AwsElbLoadBalancerBackendServerDescription
forall x.
Rep AwsElbLoadBalancerBackendServerDescription x
-> AwsElbLoadBalancerBackendServerDescription
forall x.
AwsElbLoadBalancerBackendServerDescription
-> Rep AwsElbLoadBalancerBackendServerDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsElbLoadBalancerBackendServerDescription x
-> AwsElbLoadBalancerBackendServerDescription
$cfrom :: forall x.
AwsElbLoadBalancerBackendServerDescription
-> Rep AwsElbLoadBalancerBackendServerDescription x
Prelude.Generic)
newAwsElbLoadBalancerBackendServerDescription ::
AwsElbLoadBalancerBackendServerDescription
newAwsElbLoadBalancerBackendServerDescription :: AwsElbLoadBalancerBackendServerDescription
newAwsElbLoadBalancerBackendServerDescription =
AwsElbLoadBalancerBackendServerDescription' :: Maybe [Text]
-> Maybe Int -> AwsElbLoadBalancerBackendServerDescription
AwsElbLoadBalancerBackendServerDescription'
{ $sel:policyNames:AwsElbLoadBalancerBackendServerDescription' :: Maybe [Text]
policyNames =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:instancePort:AwsElbLoadBalancerBackendServerDescription' :: Maybe Int
instancePort = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
awsElbLoadBalancerBackendServerDescription_policyNames :: Lens.Lens' AwsElbLoadBalancerBackendServerDescription (Prelude.Maybe [Prelude.Text])
awsElbLoadBalancerBackendServerDescription_policyNames :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsElbLoadBalancerBackendServerDescription
-> f AwsElbLoadBalancerBackendServerDescription
awsElbLoadBalancerBackendServerDescription_policyNames = (AwsElbLoadBalancerBackendServerDescription -> Maybe [Text])
-> (AwsElbLoadBalancerBackendServerDescription
-> Maybe [Text] -> AwsElbLoadBalancerBackendServerDescription)
-> Lens
AwsElbLoadBalancerBackendServerDescription
AwsElbLoadBalancerBackendServerDescription
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElbLoadBalancerBackendServerDescription' {Maybe [Text]
policyNames :: Maybe [Text]
$sel:policyNames:AwsElbLoadBalancerBackendServerDescription' :: AwsElbLoadBalancerBackendServerDescription -> Maybe [Text]
policyNames} -> Maybe [Text]
policyNames) (\s :: AwsElbLoadBalancerBackendServerDescription
s@AwsElbLoadBalancerBackendServerDescription' {} Maybe [Text]
a -> AwsElbLoadBalancerBackendServerDescription
s {$sel:policyNames:AwsElbLoadBalancerBackendServerDescription' :: Maybe [Text]
policyNames = Maybe [Text]
a} :: AwsElbLoadBalancerBackendServerDescription) ((Maybe [Text] -> f (Maybe [Text]))
-> AwsElbLoadBalancerBackendServerDescription
-> f AwsElbLoadBalancerBackendServerDescription)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsElbLoadBalancerBackendServerDescription
-> f AwsElbLoadBalancerBackendServerDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
awsElbLoadBalancerBackendServerDescription_instancePort :: Lens.Lens' AwsElbLoadBalancerBackendServerDescription (Prelude.Maybe Prelude.Int)
awsElbLoadBalancerBackendServerDescription_instancePort :: (Maybe Int -> f (Maybe Int))
-> AwsElbLoadBalancerBackendServerDescription
-> f AwsElbLoadBalancerBackendServerDescription
awsElbLoadBalancerBackendServerDescription_instancePort = (AwsElbLoadBalancerBackendServerDescription -> Maybe Int)
-> (AwsElbLoadBalancerBackendServerDescription
-> Maybe Int -> AwsElbLoadBalancerBackendServerDescription)
-> Lens
AwsElbLoadBalancerBackendServerDescription
AwsElbLoadBalancerBackendServerDescription
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsElbLoadBalancerBackendServerDescription' {Maybe Int
instancePort :: Maybe Int
$sel:instancePort:AwsElbLoadBalancerBackendServerDescription' :: AwsElbLoadBalancerBackendServerDescription -> Maybe Int
instancePort} -> Maybe Int
instancePort) (\s :: AwsElbLoadBalancerBackendServerDescription
s@AwsElbLoadBalancerBackendServerDescription' {} Maybe Int
a -> AwsElbLoadBalancerBackendServerDescription
s {$sel:instancePort:AwsElbLoadBalancerBackendServerDescription' :: Maybe Int
instancePort = Maybe Int
a} :: AwsElbLoadBalancerBackendServerDescription)
instance
Core.FromJSON
AwsElbLoadBalancerBackendServerDescription
where
parseJSON :: Value -> Parser AwsElbLoadBalancerBackendServerDescription
parseJSON =
String
-> (Object -> Parser AwsElbLoadBalancerBackendServerDescription)
-> Value
-> Parser AwsElbLoadBalancerBackendServerDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsElbLoadBalancerBackendServerDescription"
( \Object
x ->
Maybe [Text]
-> Maybe Int -> AwsElbLoadBalancerBackendServerDescription
AwsElbLoadBalancerBackendServerDescription'
(Maybe [Text]
-> Maybe Int -> AwsElbLoadBalancerBackendServerDescription)
-> Parser (Maybe [Text])
-> Parser (Maybe Int -> AwsElbLoadBalancerBackendServerDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PolicyNames" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe Int -> AwsElbLoadBalancerBackendServerDescription)
-> Parser (Maybe Int)
-> Parser AwsElbLoadBalancerBackendServerDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstancePort")
)
instance
Prelude.Hashable
AwsElbLoadBalancerBackendServerDescription
instance
Prelude.NFData
AwsElbLoadBalancerBackendServerDescription
instance
Core.ToJSON
AwsElbLoadBalancerBackendServerDescription
where
toJSON :: AwsElbLoadBalancerBackendServerDescription -> Value
toJSON
AwsElbLoadBalancerBackendServerDescription' {Maybe Int
Maybe [Text]
instancePort :: Maybe Int
policyNames :: Maybe [Text]
$sel:instancePort:AwsElbLoadBalancerBackendServerDescription' :: AwsElbLoadBalancerBackendServerDescription -> Maybe Int
$sel:policyNames:AwsElbLoadBalancerBackendServerDescription' :: AwsElbLoadBalancerBackendServerDescription -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PolicyNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
policyNames,
(Text
"InstancePort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instancePort
]
)