{-# 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.Route53AutoNaming.Types.ServiceSummary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53AutoNaming.Types.ServiceSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53AutoNaming.Types.DnsConfig
import Amazonka.Route53AutoNaming.Types.HealthCheckConfig
import Amazonka.Route53AutoNaming.Types.HealthCheckCustomConfig
import Amazonka.Route53AutoNaming.Types.ServiceType

-- | A complex type that contains information about a specified service.
--
-- /See:/ 'newServiceSummary' smart constructor.
data ServiceSummary = ServiceSummary'
  { -- | The number of instances that are currently associated with the service.
    -- Instances that were previously associated with the service but that are
    -- deleted aren\'t included in the count. The count might not reflect
    -- pending registrations and deregistrations.
    ServiceSummary -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) that Cloud Map assigns to the service
    -- when you create it.
    ServiceSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | /Public DNS and HTTP namespaces only./ Settings for an optional health
    -- check. If you specify settings for a health check, Cloud Map associates
    -- the health check with the records that you specify in @DnsConfig@.
    ServiceSummary -> Maybe HealthCheckConfig
healthCheckConfig :: Prelude.Maybe HealthCheckConfig,
    -- | The date and time that the service was created.
    ServiceSummary -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
    -- | Information about an optional custom health check. A custom health
    -- check, which requires that you use a third-party health checker to
    -- evaluate the health of your resources, is useful in the following
    -- circumstances:
    --
    -- -   You can\'t use a health check that\'s defined by @HealthCheckConfig@
    --     because the resource isn\'t available over the internet. For
    --     example, you can use a custom health check when the instance is in
    --     an Amazon VPC. (To check the health of resources in a VPC, the
    --     health checker must also be in the VPC.)
    --
    -- -   You want to use a third-party health checker regardless of where
    --     your resources are located.
    --
    -- If you specify a health check configuration, you can specify either
    -- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
    ServiceSummary -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig :: Prelude.Maybe HealthCheckCustomConfig,
    -- | The name of the service.
    ServiceSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID that Cloud Map assigned to the service when you created it.
    ServiceSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | Describes the systems that can be used to discover the service
    -- instances.
    --
    -- [DNS_HTTP]
    --     The service instances can be discovered using either DNS queries or
    --     the @DiscoverInstances@ API operation.
    --
    -- [HTTP]
    --     The service instances can only be discovered using the
    --     @DiscoverInstances@ API operation.
    --
    -- [DNS]
    --     Reserved.
    ServiceSummary -> Maybe ServiceType
type' :: Prelude.Maybe ServiceType,
    -- | Information about the Route 53 DNS records that you want Cloud Map to
    -- create when you register an instance.
    ServiceSummary -> Maybe DnsConfig
dnsConfig :: Prelude.Maybe DnsConfig,
    -- | The description that you specify when you create the service.
    ServiceSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceSummary -> ServiceSummary -> Bool
(ServiceSummary -> ServiceSummary -> Bool)
-> (ServiceSummary -> ServiceSummary -> Bool) -> Eq ServiceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceSummary -> ServiceSummary -> Bool
$c/= :: ServiceSummary -> ServiceSummary -> Bool
== :: ServiceSummary -> ServiceSummary -> Bool
$c== :: ServiceSummary -> ServiceSummary -> Bool
Prelude.Eq, ReadPrec [ServiceSummary]
ReadPrec ServiceSummary
Int -> ReadS ServiceSummary
ReadS [ServiceSummary]
(Int -> ReadS ServiceSummary)
-> ReadS [ServiceSummary]
-> ReadPrec ServiceSummary
-> ReadPrec [ServiceSummary]
-> Read ServiceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceSummary]
$creadListPrec :: ReadPrec [ServiceSummary]
readPrec :: ReadPrec ServiceSummary
$creadPrec :: ReadPrec ServiceSummary
readList :: ReadS [ServiceSummary]
$creadList :: ReadS [ServiceSummary]
readsPrec :: Int -> ReadS ServiceSummary
$creadsPrec :: Int -> ReadS ServiceSummary
Prelude.Read, Int -> ServiceSummary -> ShowS
[ServiceSummary] -> ShowS
ServiceSummary -> String
(Int -> ServiceSummary -> ShowS)
-> (ServiceSummary -> String)
-> ([ServiceSummary] -> ShowS)
-> Show ServiceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceSummary] -> ShowS
$cshowList :: [ServiceSummary] -> ShowS
show :: ServiceSummary -> String
$cshow :: ServiceSummary -> String
showsPrec :: Int -> ServiceSummary -> ShowS
$cshowsPrec :: Int -> ServiceSummary -> ShowS
Prelude.Show, (forall x. ServiceSummary -> Rep ServiceSummary x)
-> (forall x. Rep ServiceSummary x -> ServiceSummary)
-> Generic ServiceSummary
forall x. Rep ServiceSummary x -> ServiceSummary
forall x. ServiceSummary -> Rep ServiceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceSummary x -> ServiceSummary
$cfrom :: forall x. ServiceSummary -> Rep ServiceSummary x
Prelude.Generic)

-- |
-- Create a value of 'ServiceSummary' 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:
--
-- 'instanceCount', 'serviceSummary_instanceCount' - The number of instances that are currently associated with the service.
-- Instances that were previously associated with the service but that are
-- deleted aren\'t included in the count. The count might not reflect
-- pending registrations and deregistrations.
--
-- 'arn', 'serviceSummary_arn' - The Amazon Resource Name (ARN) that Cloud Map assigns to the service
-- when you create it.
--
-- 'healthCheckConfig', 'serviceSummary_healthCheckConfig' - /Public DNS and HTTP namespaces only./ Settings for an optional health
-- check. If you specify settings for a health check, Cloud Map associates
-- the health check with the records that you specify in @DnsConfig@.
--
-- 'createDate', 'serviceSummary_createDate' - The date and time that the service was created.
--
-- 'healthCheckCustomConfig', 'serviceSummary_healthCheckCustomConfig' - Information about an optional custom health check. A custom health
-- check, which requires that you use a third-party health checker to
-- evaluate the health of your resources, is useful in the following
-- circumstances:
--
-- -   You can\'t use a health check that\'s defined by @HealthCheckConfig@
--     because the resource isn\'t available over the internet. For
--     example, you can use a custom health check when the instance is in
--     an Amazon VPC. (To check the health of resources in a VPC, the
--     health checker must also be in the VPC.)
--
-- -   You want to use a third-party health checker regardless of where
--     your resources are located.
--
-- If you specify a health check configuration, you can specify either
-- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
--
-- 'name', 'serviceSummary_name' - The name of the service.
--
-- 'id', 'serviceSummary_id' - The ID that Cloud Map assigned to the service when you created it.
--
-- 'type'', 'serviceSummary_type' - Describes the systems that can be used to discover the service
-- instances.
--
-- [DNS_HTTP]
--     The service instances can be discovered using either DNS queries or
--     the @DiscoverInstances@ API operation.
--
-- [HTTP]
--     The service instances can only be discovered using the
--     @DiscoverInstances@ API operation.
--
-- [DNS]
--     Reserved.
--
-- 'dnsConfig', 'serviceSummary_dnsConfig' - Information about the Route 53 DNS records that you want Cloud Map to
-- create when you register an instance.
--
-- 'description', 'serviceSummary_description' - The description that you specify when you create the service.
newServiceSummary ::
  ServiceSummary
newServiceSummary :: ServiceSummary
newServiceSummary =
  ServiceSummary' :: Maybe Int
-> Maybe Text
-> Maybe HealthCheckConfig
-> Maybe POSIX
-> Maybe HealthCheckCustomConfig
-> Maybe Text
-> Maybe Text
-> Maybe ServiceType
-> Maybe DnsConfig
-> Maybe Text
-> ServiceSummary
ServiceSummary'
    { $sel:instanceCount:ServiceSummary' :: Maybe Int
instanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ServiceSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckConfig:ServiceSummary' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:ServiceSummary' :: Maybe POSIX
createDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckCustomConfig:ServiceSummary' :: Maybe HealthCheckCustomConfig
healthCheckCustomConfig = Maybe HealthCheckCustomConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ServiceSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ServiceSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ServiceSummary' :: Maybe ServiceType
type' = Maybe ServiceType
forall a. Maybe a
Prelude.Nothing,
      $sel:dnsConfig:ServiceSummary' :: Maybe DnsConfig
dnsConfig = Maybe DnsConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ServiceSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of instances that are currently associated with the service.
-- Instances that were previously associated with the service but that are
-- deleted aren\'t included in the count. The count might not reflect
-- pending registrations and deregistrations.
serviceSummary_instanceCount :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Int)
serviceSummary_instanceCount :: (Maybe Int -> f (Maybe Int)) -> ServiceSummary -> f ServiceSummary
serviceSummary_instanceCount = (ServiceSummary -> Maybe Int)
-> (ServiceSummary -> Maybe Int -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ServiceSummary' :: ServiceSummary -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe Int
a -> ServiceSummary
s {$sel:instanceCount:ServiceSummary' :: Maybe Int
instanceCount = Maybe Int
a} :: ServiceSummary)

-- | The Amazon Resource Name (ARN) that Cloud Map assigns to the service
-- when you create it.
serviceSummary_arn :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_arn :: (Maybe Text -> f (Maybe Text))
-> ServiceSummary -> f ServiceSummary
serviceSummary_arn = (ServiceSummary -> Maybe Text)
-> (ServiceSummary -> Maybe Text -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ServiceSummary' :: ServiceSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe Text
a -> ServiceSummary
s {$sel:arn:ServiceSummary' :: Maybe Text
arn = Maybe Text
a} :: ServiceSummary)

-- | /Public DNS and HTTP namespaces only./ Settings for an optional health
-- check. If you specify settings for a health check, Cloud Map associates
-- the health check with the records that you specify in @DnsConfig@.
serviceSummary_healthCheckConfig :: Lens.Lens' ServiceSummary (Prelude.Maybe HealthCheckConfig)
serviceSummary_healthCheckConfig :: (Maybe HealthCheckConfig -> f (Maybe HealthCheckConfig))
-> ServiceSummary -> f ServiceSummary
serviceSummary_healthCheckConfig = (ServiceSummary -> Maybe HealthCheckConfig)
-> (ServiceSummary -> Maybe HealthCheckConfig -> ServiceSummary)
-> Lens
     ServiceSummary
     ServiceSummary
     (Maybe HealthCheckConfig)
     (Maybe HealthCheckConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe HealthCheckConfig
healthCheckConfig :: Maybe HealthCheckConfig
$sel:healthCheckConfig:ServiceSummary' :: ServiceSummary -> Maybe HealthCheckConfig
healthCheckConfig} -> Maybe HealthCheckConfig
healthCheckConfig) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe HealthCheckConfig
a -> ServiceSummary
s {$sel:healthCheckConfig:ServiceSummary' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
a} :: ServiceSummary)

-- | The date and time that the service was created.
serviceSummary_createDate :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.UTCTime)
serviceSummary_createDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceSummary -> f ServiceSummary
serviceSummary_createDate = (ServiceSummary -> Maybe POSIX)
-> (ServiceSummary -> Maybe POSIX -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe POSIX
createDate :: Maybe POSIX
$sel:createDate:ServiceSummary' :: ServiceSummary -> Maybe POSIX
createDate} -> Maybe POSIX
createDate) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe POSIX
a -> ServiceSummary
s {$sel:createDate:ServiceSummary' :: Maybe POSIX
createDate = Maybe POSIX
a} :: ServiceSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> ServiceSummary -> f ServiceSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceSummary
-> f ServiceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Information about an optional custom health check. A custom health
-- check, which requires that you use a third-party health checker to
-- evaluate the health of your resources, is useful in the following
-- circumstances:
--
-- -   You can\'t use a health check that\'s defined by @HealthCheckConfig@
--     because the resource isn\'t available over the internet. For
--     example, you can use a custom health check when the instance is in
--     an Amazon VPC. (To check the health of resources in a VPC, the
--     health checker must also be in the VPC.)
--
-- -   You want to use a third-party health checker regardless of where
--     your resources are located.
--
-- If you specify a health check configuration, you can specify either
-- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
serviceSummary_healthCheckCustomConfig :: Lens.Lens' ServiceSummary (Prelude.Maybe HealthCheckCustomConfig)
serviceSummary_healthCheckCustomConfig :: (Maybe HealthCheckCustomConfig
 -> f (Maybe HealthCheckCustomConfig))
-> ServiceSummary -> f ServiceSummary
serviceSummary_healthCheckCustomConfig = (ServiceSummary -> Maybe HealthCheckCustomConfig)
-> (ServiceSummary
    -> Maybe HealthCheckCustomConfig -> ServiceSummary)
-> Lens
     ServiceSummary
     ServiceSummary
     (Maybe HealthCheckCustomConfig)
     (Maybe HealthCheckCustomConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe HealthCheckCustomConfig
healthCheckCustomConfig :: Maybe HealthCheckCustomConfig
$sel:healthCheckCustomConfig:ServiceSummary' :: ServiceSummary -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig} -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe HealthCheckCustomConfig
a -> ServiceSummary
s {$sel:healthCheckCustomConfig:ServiceSummary' :: Maybe HealthCheckCustomConfig
healthCheckCustomConfig = Maybe HealthCheckCustomConfig
a} :: ServiceSummary)

-- | The name of the service.
serviceSummary_name :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_name :: (Maybe Text -> f (Maybe Text))
-> ServiceSummary -> f ServiceSummary
serviceSummary_name = (ServiceSummary -> Maybe Text)
-> (ServiceSummary -> Maybe Text -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe Text
name :: Maybe Text
$sel:name:ServiceSummary' :: ServiceSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe Text
a -> ServiceSummary
s {$sel:name:ServiceSummary' :: Maybe Text
name = Maybe Text
a} :: ServiceSummary)

-- | The ID that Cloud Map assigned to the service when you created it.
serviceSummary_id :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_id :: (Maybe Text -> f (Maybe Text))
-> ServiceSummary -> f ServiceSummary
serviceSummary_id = (ServiceSummary -> Maybe Text)
-> (ServiceSummary -> Maybe Text -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe Text
id :: Maybe Text
$sel:id:ServiceSummary' :: ServiceSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe Text
a -> ServiceSummary
s {$sel:id:ServiceSummary' :: Maybe Text
id = Maybe Text
a} :: ServiceSummary)

-- | Describes the systems that can be used to discover the service
-- instances.
--
-- [DNS_HTTP]
--     The service instances can be discovered using either DNS queries or
--     the @DiscoverInstances@ API operation.
--
-- [HTTP]
--     The service instances can only be discovered using the
--     @DiscoverInstances@ API operation.
--
-- [DNS]
--     Reserved.
serviceSummary_type :: Lens.Lens' ServiceSummary (Prelude.Maybe ServiceType)
serviceSummary_type :: (Maybe ServiceType -> f (Maybe ServiceType))
-> ServiceSummary -> f ServiceSummary
serviceSummary_type = (ServiceSummary -> Maybe ServiceType)
-> (ServiceSummary -> Maybe ServiceType -> ServiceSummary)
-> Lens
     ServiceSummary
     ServiceSummary
     (Maybe ServiceType)
     (Maybe ServiceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe ServiceType
type' :: Maybe ServiceType
$sel:type':ServiceSummary' :: ServiceSummary -> Maybe ServiceType
type'} -> Maybe ServiceType
type') (\s :: ServiceSummary
s@ServiceSummary' {} Maybe ServiceType
a -> ServiceSummary
s {$sel:type':ServiceSummary' :: Maybe ServiceType
type' = Maybe ServiceType
a} :: ServiceSummary)

-- | Information about the Route 53 DNS records that you want Cloud Map to
-- create when you register an instance.
serviceSummary_dnsConfig :: Lens.Lens' ServiceSummary (Prelude.Maybe DnsConfig)
serviceSummary_dnsConfig :: (Maybe DnsConfig -> f (Maybe DnsConfig))
-> ServiceSummary -> f ServiceSummary
serviceSummary_dnsConfig = (ServiceSummary -> Maybe DnsConfig)
-> (ServiceSummary -> Maybe DnsConfig -> ServiceSummary)
-> Lens
     ServiceSummary ServiceSummary (Maybe DnsConfig) (Maybe DnsConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe DnsConfig
dnsConfig :: Maybe DnsConfig
$sel:dnsConfig:ServiceSummary' :: ServiceSummary -> Maybe DnsConfig
dnsConfig} -> Maybe DnsConfig
dnsConfig) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe DnsConfig
a -> ServiceSummary
s {$sel:dnsConfig:ServiceSummary' :: Maybe DnsConfig
dnsConfig = Maybe DnsConfig
a} :: ServiceSummary)

-- | The description that you specify when you create the service.
serviceSummary_description :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_description :: (Maybe Text -> f (Maybe Text))
-> ServiceSummary -> f ServiceSummary
serviceSummary_description = (ServiceSummary -> Maybe Text)
-> (ServiceSummary -> Maybe Text -> ServiceSummary)
-> Lens ServiceSummary ServiceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe Text
description :: Maybe Text
$sel:description:ServiceSummary' :: ServiceSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe Text
a -> ServiceSummary
s {$sel:description:ServiceSummary' :: Maybe Text
description = Maybe Text
a} :: ServiceSummary)

instance Core.FromJSON ServiceSummary where
  parseJSON :: Value -> Parser ServiceSummary
parseJSON =
    String
-> (Object -> Parser ServiceSummary)
-> Value
-> Parser ServiceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceSummary"
      ( \Object
x ->
          Maybe Int
-> Maybe Text
-> Maybe HealthCheckConfig
-> Maybe POSIX
-> Maybe HealthCheckCustomConfig
-> Maybe Text
-> Maybe Text
-> Maybe ServiceType
-> Maybe DnsConfig
-> Maybe Text
-> ServiceSummary
ServiceSummary'
            (Maybe Int
 -> Maybe Text
 -> Maybe HealthCheckConfig
 -> Maybe POSIX
 -> Maybe HealthCheckCustomConfig
 -> Maybe Text
 -> Maybe Text
 -> Maybe ServiceType
 -> Maybe DnsConfig
 -> Maybe Text
 -> ServiceSummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe HealthCheckConfig
      -> Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Functor 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
"InstanceCount")
            Parser
  (Maybe Text
   -> Maybe HealthCheckConfig
   -> Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe HealthCheckConfig
      -> Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe HealthCheckConfig
   -> Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe HealthCheckConfig)
-> Parser
     (Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthCheckConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthCheckConfig")
            Parser
  (Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateDate")
            Parser
  (Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe HealthCheckCustomConfig)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthCheckCustomConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthCheckCustomConfig")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServiceType
      -> Maybe DnsConfig -> Maybe Text -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser
  (Maybe ServiceType
   -> Maybe DnsConfig -> Maybe Text -> ServiceSummary)
-> Parser (Maybe ServiceType)
-> Parser (Maybe DnsConfig -> Maybe Text -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser (Maybe DnsConfig -> Maybe Text -> ServiceSummary)
-> Parser (Maybe DnsConfig)
-> Parser (Maybe Text -> ServiceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DnsConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DnsConfig")
            Parser (Maybe Text -> ServiceSummary)
-> Parser (Maybe Text) -> Parser ServiceSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable ServiceSummary

instance Prelude.NFData ServiceSummary