{-# 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.Lightsail.Types.ContainerServiceEndpoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.ContainerServiceHealthCheckConfig
import qualified Amazonka.Prelude as Prelude
data ContainerServiceEndpoint = ContainerServiceEndpoint'
{
ContainerServiceEndpoint -> Maybe Text
containerName :: Prelude.Maybe Prelude.Text,
ContainerServiceEndpoint -> Maybe Int
containerPort :: Prelude.Maybe Prelude.Int,
ContainerServiceEndpoint -> Maybe ContainerServiceHealthCheckConfig
healthCheck :: Prelude.Maybe ContainerServiceHealthCheckConfig
}
deriving (ContainerServiceEndpoint -> ContainerServiceEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerServiceEndpoint -> ContainerServiceEndpoint -> Bool
$c/= :: ContainerServiceEndpoint -> ContainerServiceEndpoint -> Bool
== :: ContainerServiceEndpoint -> ContainerServiceEndpoint -> Bool
$c== :: ContainerServiceEndpoint -> ContainerServiceEndpoint -> Bool
Prelude.Eq, ReadPrec [ContainerServiceEndpoint]
ReadPrec ContainerServiceEndpoint
Int -> ReadS ContainerServiceEndpoint
ReadS [ContainerServiceEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerServiceEndpoint]
$creadListPrec :: ReadPrec [ContainerServiceEndpoint]
readPrec :: ReadPrec ContainerServiceEndpoint
$creadPrec :: ReadPrec ContainerServiceEndpoint
readList :: ReadS [ContainerServiceEndpoint]
$creadList :: ReadS [ContainerServiceEndpoint]
readsPrec :: Int -> ReadS ContainerServiceEndpoint
$creadsPrec :: Int -> ReadS ContainerServiceEndpoint
Prelude.Read, Int -> ContainerServiceEndpoint -> ShowS
[ContainerServiceEndpoint] -> ShowS
ContainerServiceEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerServiceEndpoint] -> ShowS
$cshowList :: [ContainerServiceEndpoint] -> ShowS
show :: ContainerServiceEndpoint -> String
$cshow :: ContainerServiceEndpoint -> String
showsPrec :: Int -> ContainerServiceEndpoint -> ShowS
$cshowsPrec :: Int -> ContainerServiceEndpoint -> ShowS
Prelude.Show, forall x.
Rep ContainerServiceEndpoint x -> ContainerServiceEndpoint
forall x.
ContainerServiceEndpoint -> Rep ContainerServiceEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContainerServiceEndpoint x -> ContainerServiceEndpoint
$cfrom :: forall x.
ContainerServiceEndpoint -> Rep ContainerServiceEndpoint x
Prelude.Generic)
newContainerServiceEndpoint ::
ContainerServiceEndpoint
newContainerServiceEndpoint :: ContainerServiceEndpoint
newContainerServiceEndpoint =
ContainerServiceEndpoint'
{ $sel:containerName:ContainerServiceEndpoint' :: Maybe Text
containerName =
forall a. Maybe a
Prelude.Nothing,
$sel:containerPort:ContainerServiceEndpoint' :: Maybe Int
containerPort = forall a. Maybe a
Prelude.Nothing,
$sel:healthCheck:ContainerServiceEndpoint' :: Maybe ContainerServiceHealthCheckConfig
healthCheck = forall a. Maybe a
Prelude.Nothing
}
containerServiceEndpoint_containerName :: Lens.Lens' ContainerServiceEndpoint (Prelude.Maybe Prelude.Text)
containerServiceEndpoint_containerName :: Lens' ContainerServiceEndpoint (Maybe Text)
containerServiceEndpoint_containerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceEndpoint' {Maybe Text
containerName :: Maybe Text
$sel:containerName:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Text
containerName} -> Maybe Text
containerName) (\s :: ContainerServiceEndpoint
s@ContainerServiceEndpoint' {} Maybe Text
a -> ContainerServiceEndpoint
s {$sel:containerName:ContainerServiceEndpoint' :: Maybe Text
containerName = Maybe Text
a} :: ContainerServiceEndpoint)
containerServiceEndpoint_containerPort :: Lens.Lens' ContainerServiceEndpoint (Prelude.Maybe Prelude.Int)
containerServiceEndpoint_containerPort :: Lens' ContainerServiceEndpoint (Maybe Int)
containerServiceEndpoint_containerPort = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceEndpoint' {Maybe Int
containerPort :: Maybe Int
$sel:containerPort:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Int
containerPort} -> Maybe Int
containerPort) (\s :: ContainerServiceEndpoint
s@ContainerServiceEndpoint' {} Maybe Int
a -> ContainerServiceEndpoint
s {$sel:containerPort:ContainerServiceEndpoint' :: Maybe Int
containerPort = Maybe Int
a} :: ContainerServiceEndpoint)
containerServiceEndpoint_healthCheck :: Lens.Lens' ContainerServiceEndpoint (Prelude.Maybe ContainerServiceHealthCheckConfig)
containerServiceEndpoint_healthCheck :: Lens'
ContainerServiceEndpoint (Maybe ContainerServiceHealthCheckConfig)
containerServiceEndpoint_healthCheck = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceEndpoint' {Maybe ContainerServiceHealthCheckConfig
healthCheck :: Maybe ContainerServiceHealthCheckConfig
$sel:healthCheck:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe ContainerServiceHealthCheckConfig
healthCheck} -> Maybe ContainerServiceHealthCheckConfig
healthCheck) (\s :: ContainerServiceEndpoint
s@ContainerServiceEndpoint' {} Maybe ContainerServiceHealthCheckConfig
a -> ContainerServiceEndpoint
s {$sel:healthCheck:ContainerServiceEndpoint' :: Maybe ContainerServiceHealthCheckConfig
healthCheck = Maybe ContainerServiceHealthCheckConfig
a} :: ContainerServiceEndpoint)
instance Data.FromJSON ContainerServiceEndpoint where
parseJSON :: Value -> Parser ContainerServiceEndpoint
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ContainerServiceEndpoint"
( \Object
x ->
Maybe Text
-> Maybe Int
-> Maybe ContainerServiceHealthCheckConfig
-> ContainerServiceEndpoint
ContainerServiceEndpoint'
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
"containerName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"containerPort")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"healthCheck")
)
instance Prelude.Hashable ContainerServiceEndpoint where
hashWithSalt :: Int -> ContainerServiceEndpoint -> Int
hashWithSalt Int
_salt ContainerServiceEndpoint' {Maybe Int
Maybe Text
Maybe ContainerServiceHealthCheckConfig
healthCheck :: Maybe ContainerServiceHealthCheckConfig
containerPort :: Maybe Int
containerName :: Maybe Text
$sel:healthCheck:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe ContainerServiceHealthCheckConfig
$sel:containerPort:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Int
$sel:containerName:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
containerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
containerPort
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContainerServiceHealthCheckConfig
healthCheck
instance Prelude.NFData ContainerServiceEndpoint where
rnf :: ContainerServiceEndpoint -> ()
rnf ContainerServiceEndpoint' {Maybe Int
Maybe Text
Maybe ContainerServiceHealthCheckConfig
healthCheck :: Maybe ContainerServiceHealthCheckConfig
containerPort :: Maybe Int
containerName :: Maybe Text
$sel:healthCheck:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe ContainerServiceHealthCheckConfig
$sel:containerPort:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Int
$sel:containerName:ContainerServiceEndpoint' :: ContainerServiceEndpoint -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
containerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
containerPort
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContainerServiceHealthCheckConfig
healthCheck