{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.Types.AnalysisLoadBalancerTarget
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.AnalysisLoadBalancerTarget where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.AnalysisComponent
import qualified Amazonka.Prelude as Prelude

-- | Describes a load balancer target.
--
-- /See:/ 'newAnalysisLoadBalancerTarget' smart constructor.
data AnalysisLoadBalancerTarget = AnalysisLoadBalancerTarget'
  { -- | The IP address.
    AnalysisLoadBalancerTarget -> Maybe Text
address :: Prelude.Maybe Prelude.Text,
    -- | The Availability Zone.
    AnalysisLoadBalancerTarget -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
    -- | Information about the instance.
    AnalysisLoadBalancerTarget -> Maybe AnalysisComponent
instance' :: Prelude.Maybe AnalysisComponent,
    -- | The port on which the target is listening.
    AnalysisLoadBalancerTarget -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
  }
  deriving (AnalysisLoadBalancerTarget -> AnalysisLoadBalancerTarget -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisLoadBalancerTarget -> AnalysisLoadBalancerTarget -> Bool
$c/= :: AnalysisLoadBalancerTarget -> AnalysisLoadBalancerTarget -> Bool
== :: AnalysisLoadBalancerTarget -> AnalysisLoadBalancerTarget -> Bool
$c== :: AnalysisLoadBalancerTarget -> AnalysisLoadBalancerTarget -> Bool
Prelude.Eq, ReadPrec [AnalysisLoadBalancerTarget]
ReadPrec AnalysisLoadBalancerTarget
Int -> ReadS AnalysisLoadBalancerTarget
ReadS [AnalysisLoadBalancerTarget]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisLoadBalancerTarget]
$creadListPrec :: ReadPrec [AnalysisLoadBalancerTarget]
readPrec :: ReadPrec AnalysisLoadBalancerTarget
$creadPrec :: ReadPrec AnalysisLoadBalancerTarget
readList :: ReadS [AnalysisLoadBalancerTarget]
$creadList :: ReadS [AnalysisLoadBalancerTarget]
readsPrec :: Int -> ReadS AnalysisLoadBalancerTarget
$creadsPrec :: Int -> ReadS AnalysisLoadBalancerTarget
Prelude.Read, Int -> AnalysisLoadBalancerTarget -> ShowS
[AnalysisLoadBalancerTarget] -> ShowS
AnalysisLoadBalancerTarget -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisLoadBalancerTarget] -> ShowS
$cshowList :: [AnalysisLoadBalancerTarget] -> ShowS
show :: AnalysisLoadBalancerTarget -> String
$cshow :: AnalysisLoadBalancerTarget -> String
showsPrec :: Int -> AnalysisLoadBalancerTarget -> ShowS
$cshowsPrec :: Int -> AnalysisLoadBalancerTarget -> ShowS
Prelude.Show, forall x.
Rep AnalysisLoadBalancerTarget x -> AnalysisLoadBalancerTarget
forall x.
AnalysisLoadBalancerTarget -> Rep AnalysisLoadBalancerTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AnalysisLoadBalancerTarget x -> AnalysisLoadBalancerTarget
$cfrom :: forall x.
AnalysisLoadBalancerTarget -> Rep AnalysisLoadBalancerTarget x
Prelude.Generic)

-- |
-- Create a value of 'AnalysisLoadBalancerTarget' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'address', 'analysisLoadBalancerTarget_address' - The IP address.
--
-- 'availabilityZone', 'analysisLoadBalancerTarget_availabilityZone' - The Availability Zone.
--
-- 'instance'', 'analysisLoadBalancerTarget_instance' - Information about the instance.
--
-- 'port', 'analysisLoadBalancerTarget_port' - The port on which the target is listening.
newAnalysisLoadBalancerTarget ::
  AnalysisLoadBalancerTarget
newAnalysisLoadBalancerTarget :: AnalysisLoadBalancerTarget
newAnalysisLoadBalancerTarget =
  AnalysisLoadBalancerTarget'
    { $sel:address:AnalysisLoadBalancerTarget' :: Maybe Text
address =
        forall a. Maybe a
Prelude.Nothing,
      $sel:availabilityZone:AnalysisLoadBalancerTarget' :: Maybe Text
availabilityZone = forall a. Maybe a
Prelude.Nothing,
      $sel:instance':AnalysisLoadBalancerTarget' :: Maybe AnalysisComponent
instance' = forall a. Maybe a
Prelude.Nothing,
      $sel:port:AnalysisLoadBalancerTarget' :: Maybe Natural
port = forall a. Maybe a
Prelude.Nothing
    }

-- | The IP address.
analysisLoadBalancerTarget_address :: Lens.Lens' AnalysisLoadBalancerTarget (Prelude.Maybe Prelude.Text)
analysisLoadBalancerTarget_address :: Lens' AnalysisLoadBalancerTarget (Maybe Text)
analysisLoadBalancerTarget_address = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisLoadBalancerTarget' {Maybe Text
address :: Maybe Text
$sel:address:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
address} -> Maybe Text
address) (\s :: AnalysisLoadBalancerTarget
s@AnalysisLoadBalancerTarget' {} Maybe Text
a -> AnalysisLoadBalancerTarget
s {$sel:address:AnalysisLoadBalancerTarget' :: Maybe Text
address = Maybe Text
a} :: AnalysisLoadBalancerTarget)

-- | The Availability Zone.
analysisLoadBalancerTarget_availabilityZone :: Lens.Lens' AnalysisLoadBalancerTarget (Prelude.Maybe Prelude.Text)
analysisLoadBalancerTarget_availabilityZone :: Lens' AnalysisLoadBalancerTarget (Maybe Text)
analysisLoadBalancerTarget_availabilityZone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisLoadBalancerTarget' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: AnalysisLoadBalancerTarget
s@AnalysisLoadBalancerTarget' {} Maybe Text
a -> AnalysisLoadBalancerTarget
s {$sel:availabilityZone:AnalysisLoadBalancerTarget' :: Maybe Text
availabilityZone = Maybe Text
a} :: AnalysisLoadBalancerTarget)

-- | Information about the instance.
analysisLoadBalancerTarget_instance :: Lens.Lens' AnalysisLoadBalancerTarget (Prelude.Maybe AnalysisComponent)
analysisLoadBalancerTarget_instance :: Lens' AnalysisLoadBalancerTarget (Maybe AnalysisComponent)
analysisLoadBalancerTarget_instance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisLoadBalancerTarget' {Maybe AnalysisComponent
instance' :: Maybe AnalysisComponent
$sel:instance':AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe AnalysisComponent
instance'} -> Maybe AnalysisComponent
instance') (\s :: AnalysisLoadBalancerTarget
s@AnalysisLoadBalancerTarget' {} Maybe AnalysisComponent
a -> AnalysisLoadBalancerTarget
s {$sel:instance':AnalysisLoadBalancerTarget' :: Maybe AnalysisComponent
instance' = Maybe AnalysisComponent
a} :: AnalysisLoadBalancerTarget)

-- | The port on which the target is listening.
analysisLoadBalancerTarget_port :: Lens.Lens' AnalysisLoadBalancerTarget (Prelude.Maybe Prelude.Natural)
analysisLoadBalancerTarget_port :: Lens' AnalysisLoadBalancerTarget (Maybe Natural)
analysisLoadBalancerTarget_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisLoadBalancerTarget' {Maybe Natural
port :: Maybe Natural
$sel:port:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Natural
port} -> Maybe Natural
port) (\s :: AnalysisLoadBalancerTarget
s@AnalysisLoadBalancerTarget' {} Maybe Natural
a -> AnalysisLoadBalancerTarget
s {$sel:port:AnalysisLoadBalancerTarget' :: Maybe Natural
port = Maybe Natural
a} :: AnalysisLoadBalancerTarget)

instance Data.FromXML AnalysisLoadBalancerTarget where
  parseXML :: [Node] -> Either String AnalysisLoadBalancerTarget
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe AnalysisComponent
-> Maybe Natural
-> AnalysisLoadBalancerTarget
AnalysisLoadBalancerTarget'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"address")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"availabilityZone")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instance")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"port")

instance Prelude.Hashable AnalysisLoadBalancerTarget where
  hashWithSalt :: Int -> AnalysisLoadBalancerTarget -> Int
hashWithSalt Int
_salt AnalysisLoadBalancerTarget' {Maybe Natural
Maybe Text
Maybe AnalysisComponent
port :: Maybe Natural
instance' :: Maybe AnalysisComponent
availabilityZone :: Maybe Text
address :: Maybe Text
$sel:port:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Natural
$sel:instance':AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe AnalysisComponent
$sel:availabilityZone:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
$sel:address:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
address
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
availabilityZone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AnalysisComponent
instance'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
port

instance Prelude.NFData AnalysisLoadBalancerTarget where
  rnf :: AnalysisLoadBalancerTarget -> ()
rnf AnalysisLoadBalancerTarget' {Maybe Natural
Maybe Text
Maybe AnalysisComponent
port :: Maybe Natural
instance' :: Maybe AnalysisComponent
availabilityZone :: Maybe Text
address :: Maybe Text
$sel:port:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Natural
$sel:instance':AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe AnalysisComponent
$sel:availabilityZone:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
$sel:address:AnalysisLoadBalancerTarget' :: AnalysisLoadBalancerTarget -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
address
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
availabilityZone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalysisComponent
instance'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
port