{-# 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.Route53AutoNaming.Types.ServiceChange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.DnsConfigChange
import Amazonka.Route53AutoNaming.Types.HealthCheckConfig
data ServiceChange = ServiceChange'
{
ServiceChange -> Maybe HealthCheckConfig
healthCheckConfig :: Prelude.Maybe HealthCheckConfig,
ServiceChange -> Maybe DnsConfigChange
dnsConfig :: Prelude.Maybe DnsConfigChange,
ServiceChange -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ServiceChange -> ServiceChange -> Bool
(ServiceChange -> ServiceChange -> Bool)
-> (ServiceChange -> ServiceChange -> Bool) -> Eq ServiceChange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceChange -> ServiceChange -> Bool
$c/= :: ServiceChange -> ServiceChange -> Bool
== :: ServiceChange -> ServiceChange -> Bool
$c== :: ServiceChange -> ServiceChange -> Bool
Prelude.Eq, ReadPrec [ServiceChange]
ReadPrec ServiceChange
Int -> ReadS ServiceChange
ReadS [ServiceChange]
(Int -> ReadS ServiceChange)
-> ReadS [ServiceChange]
-> ReadPrec ServiceChange
-> ReadPrec [ServiceChange]
-> Read ServiceChange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceChange]
$creadListPrec :: ReadPrec [ServiceChange]
readPrec :: ReadPrec ServiceChange
$creadPrec :: ReadPrec ServiceChange
readList :: ReadS [ServiceChange]
$creadList :: ReadS [ServiceChange]
readsPrec :: Int -> ReadS ServiceChange
$creadsPrec :: Int -> ReadS ServiceChange
Prelude.Read, Int -> ServiceChange -> ShowS
[ServiceChange] -> ShowS
ServiceChange -> String
(Int -> ServiceChange -> ShowS)
-> (ServiceChange -> String)
-> ([ServiceChange] -> ShowS)
-> Show ServiceChange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceChange] -> ShowS
$cshowList :: [ServiceChange] -> ShowS
show :: ServiceChange -> String
$cshow :: ServiceChange -> String
showsPrec :: Int -> ServiceChange -> ShowS
$cshowsPrec :: Int -> ServiceChange -> ShowS
Prelude.Show, (forall x. ServiceChange -> Rep ServiceChange x)
-> (forall x. Rep ServiceChange x -> ServiceChange)
-> Generic ServiceChange
forall x. Rep ServiceChange x -> ServiceChange
forall x. ServiceChange -> Rep ServiceChange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceChange x -> ServiceChange
$cfrom :: forall x. ServiceChange -> Rep ServiceChange x
Prelude.Generic)
newServiceChange ::
ServiceChange
newServiceChange :: ServiceChange
newServiceChange =
ServiceChange' :: Maybe HealthCheckConfig
-> Maybe DnsConfigChange -> Maybe Text -> ServiceChange
ServiceChange'
{ $sel:healthCheckConfig:ServiceChange' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
forall a. Maybe a
Prelude.Nothing,
$sel:dnsConfig:ServiceChange' :: Maybe DnsConfigChange
dnsConfig = Maybe DnsConfigChange
forall a. Maybe a
Prelude.Nothing,
$sel:description:ServiceChange' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
serviceChange_healthCheckConfig :: Lens.Lens' ServiceChange (Prelude.Maybe HealthCheckConfig)
serviceChange_healthCheckConfig :: (Maybe HealthCheckConfig -> f (Maybe HealthCheckConfig))
-> ServiceChange -> f ServiceChange
serviceChange_healthCheckConfig = (ServiceChange -> Maybe HealthCheckConfig)
-> (ServiceChange -> Maybe HealthCheckConfig -> ServiceChange)
-> Lens
ServiceChange
ServiceChange
(Maybe HealthCheckConfig)
(Maybe HealthCheckConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceChange' {Maybe HealthCheckConfig
healthCheckConfig :: Maybe HealthCheckConfig
$sel:healthCheckConfig:ServiceChange' :: ServiceChange -> Maybe HealthCheckConfig
healthCheckConfig} -> Maybe HealthCheckConfig
healthCheckConfig) (\s :: ServiceChange
s@ServiceChange' {} Maybe HealthCheckConfig
a -> ServiceChange
s {$sel:healthCheckConfig:ServiceChange' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
a} :: ServiceChange)
serviceChange_dnsConfig :: Lens.Lens' ServiceChange (Prelude.Maybe DnsConfigChange)
serviceChange_dnsConfig :: (Maybe DnsConfigChange -> f (Maybe DnsConfigChange))
-> ServiceChange -> f ServiceChange
serviceChange_dnsConfig = (ServiceChange -> Maybe DnsConfigChange)
-> (ServiceChange -> Maybe DnsConfigChange -> ServiceChange)
-> Lens
ServiceChange
ServiceChange
(Maybe DnsConfigChange)
(Maybe DnsConfigChange)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceChange' {Maybe DnsConfigChange
dnsConfig :: Maybe DnsConfigChange
$sel:dnsConfig:ServiceChange' :: ServiceChange -> Maybe DnsConfigChange
dnsConfig} -> Maybe DnsConfigChange
dnsConfig) (\s :: ServiceChange
s@ServiceChange' {} Maybe DnsConfigChange
a -> ServiceChange
s {$sel:dnsConfig:ServiceChange' :: Maybe DnsConfigChange
dnsConfig = Maybe DnsConfigChange
a} :: ServiceChange)
serviceChange_description :: Lens.Lens' ServiceChange (Prelude.Maybe Prelude.Text)
serviceChange_description :: (Maybe Text -> f (Maybe Text)) -> ServiceChange -> f ServiceChange
serviceChange_description = (ServiceChange -> Maybe Text)
-> (ServiceChange -> Maybe Text -> ServiceChange)
-> Lens ServiceChange ServiceChange (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceChange' {Maybe Text
description :: Maybe Text
$sel:description:ServiceChange' :: ServiceChange -> Maybe Text
description} -> Maybe Text
description) (\s :: ServiceChange
s@ServiceChange' {} Maybe Text
a -> ServiceChange
s {$sel:description:ServiceChange' :: Maybe Text
description = Maybe Text
a} :: ServiceChange)
instance Prelude.Hashable ServiceChange
instance Prelude.NFData ServiceChange
instance Core.ToJSON ServiceChange where
toJSON :: ServiceChange -> Value
toJSON ServiceChange' {Maybe Text
Maybe HealthCheckConfig
Maybe DnsConfigChange
description :: Maybe Text
dnsConfig :: Maybe DnsConfigChange
healthCheckConfig :: Maybe HealthCheckConfig
$sel:description:ServiceChange' :: ServiceChange -> Maybe Text
$sel:dnsConfig:ServiceChange' :: ServiceChange -> Maybe DnsConfigChange
$sel:healthCheckConfig:ServiceChange' :: ServiceChange -> Maybe HealthCheckConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HealthCheckConfig" Text -> HealthCheckConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HealthCheckConfig -> Pair)
-> Maybe HealthCheckConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HealthCheckConfig
healthCheckConfig,
(Text
"DnsConfig" Text -> DnsConfigChange -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DnsConfigChange -> Pair) -> Maybe DnsConfigChange -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DnsConfigChange
dnsConfig,
(Text
"Description" 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
description
]
)