{-# 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.ServiceInfo
-- 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.ServiceInfo 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 the specified service.
--
-- /See:/ 'newServiceInfo' smart constructor.
data ServiceInfo = ServiceInfo'
  { -- | 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.
    ServiceInfo -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) that Cloud Map assigns to the service
    -- when you create it.
    ServiceInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | /Public DNS and HTTP namespaces only./ A complex type that contains
    -- 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@.
    --
    -- For information about the charges for health checks, see
    -- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
    ServiceInfo -> Maybe HealthCheckConfig
healthCheckConfig :: Prelude.Maybe HealthCheckConfig,
    -- | A unique string that identifies the request and that allows failed
    -- requests to be retried without the risk of running the operation twice.
    -- @CreatorRequestId@ can be any unique string (for example, a
    -- date\/timestamp).
    ServiceInfo -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the service was created, in Unix format and
    -- Coordinated Universal Time (UTC). The value of @CreateDate@ is accurate
    -- to milliseconds. For example, the value @1516925490.087@ represents
    -- Friday, January 26, 2018 12:11:30.087 AM.
    ServiceInfo -> Maybe POSIX
createDate :: Prelude.Maybe Core.POSIX,
    -- | A complex type that contains information about an optional custom health
    -- check.
    --
    -- If you specify a health check configuration, you can specify either
    -- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
    ServiceInfo -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig :: Prelude.Maybe HealthCheckCustomConfig,
    -- | The ID of the namespace that was used to create the service.
    ServiceInfo -> Maybe Text
namespaceId :: Prelude.Maybe Prelude.Text,
    -- | The name of the service.
    ServiceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID that Cloud Map assigned to the service when you created it.
    ServiceInfo -> 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.
    ServiceInfo -> Maybe ServiceType
type' :: Prelude.Maybe ServiceType,
    -- | A complex type that contains information about the Route 53 DNS records
    -- that you want Cloud Map to create when you register an instance.
    ServiceInfo -> Maybe DnsConfig
dnsConfig :: Prelude.Maybe DnsConfig,
    -- | The description of the service.
    ServiceInfo -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceInfo -> ServiceInfo -> Bool
(ServiceInfo -> ServiceInfo -> Bool)
-> (ServiceInfo -> ServiceInfo -> Bool) -> Eq ServiceInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceInfo -> ServiceInfo -> Bool
$c/= :: ServiceInfo -> ServiceInfo -> Bool
== :: ServiceInfo -> ServiceInfo -> Bool
$c== :: ServiceInfo -> ServiceInfo -> Bool
Prelude.Eq, ReadPrec [ServiceInfo]
ReadPrec ServiceInfo
Int -> ReadS ServiceInfo
ReadS [ServiceInfo]
(Int -> ReadS ServiceInfo)
-> ReadS [ServiceInfo]
-> ReadPrec ServiceInfo
-> ReadPrec [ServiceInfo]
-> Read ServiceInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceInfo]
$creadListPrec :: ReadPrec [ServiceInfo]
readPrec :: ReadPrec ServiceInfo
$creadPrec :: ReadPrec ServiceInfo
readList :: ReadS [ServiceInfo]
$creadList :: ReadS [ServiceInfo]
readsPrec :: Int -> ReadS ServiceInfo
$creadsPrec :: Int -> ReadS ServiceInfo
Prelude.Read, Int -> ServiceInfo -> ShowS
[ServiceInfo] -> ShowS
ServiceInfo -> String
(Int -> ServiceInfo -> ShowS)
-> (ServiceInfo -> String)
-> ([ServiceInfo] -> ShowS)
-> Show ServiceInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceInfo] -> ShowS
$cshowList :: [ServiceInfo] -> ShowS
show :: ServiceInfo -> String
$cshow :: ServiceInfo -> String
showsPrec :: Int -> ServiceInfo -> ShowS
$cshowsPrec :: Int -> ServiceInfo -> ShowS
Prelude.Show, (forall x. ServiceInfo -> Rep ServiceInfo x)
-> (forall x. Rep ServiceInfo x -> ServiceInfo)
-> Generic ServiceInfo
forall x. Rep ServiceInfo x -> ServiceInfo
forall x. ServiceInfo -> Rep ServiceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceInfo x -> ServiceInfo
$cfrom :: forall x. ServiceInfo -> Rep ServiceInfo x
Prelude.Generic)

-- |
-- Create a value of 'ServiceInfo' 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', 'serviceInfo_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', 'serviceInfo_arn' - The Amazon Resource Name (ARN) that Cloud Map assigns to the service
-- when you create it.
--
-- 'healthCheckConfig', 'serviceInfo_healthCheckConfig' - /Public DNS and HTTP namespaces only./ A complex type that contains
-- 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@.
--
-- For information about the charges for health checks, see
-- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
--
-- 'creatorRequestId', 'serviceInfo_creatorRequestId' - A unique string that identifies the request and that allows failed
-- requests to be retried without the risk of running the operation twice.
-- @CreatorRequestId@ can be any unique string (for example, a
-- date\/timestamp).
--
-- 'createDate', 'serviceInfo_createDate' - The date and time that the service was created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreateDate@ is accurate
-- to milliseconds. For example, the value @1516925490.087@ represents
-- Friday, January 26, 2018 12:11:30.087 AM.
--
-- 'healthCheckCustomConfig', 'serviceInfo_healthCheckCustomConfig' - A complex type that contains information about an optional custom health
-- check.
--
-- If you specify a health check configuration, you can specify either
-- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
--
-- 'namespaceId', 'serviceInfo_namespaceId' - The ID of the namespace that was used to create the service.
--
-- 'name', 'serviceInfo_name' - The name of the service.
--
-- 'id', 'serviceInfo_id' - The ID that Cloud Map assigned to the service when you created it.
--
-- 'type'', 'serviceInfo_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', 'serviceInfo_dnsConfig' - A complex type that contains information about the Route 53 DNS records
-- that you want Cloud Map to create when you register an instance.
--
-- 'description', 'serviceInfo_description' - The description of the service.
newServiceInfo ::
  ServiceInfo
newServiceInfo :: ServiceInfo
newServiceInfo =
  ServiceInfo' :: Maybe Int
-> Maybe Text
-> Maybe HealthCheckConfig
-> Maybe Text
-> Maybe POSIX
-> Maybe HealthCheckCustomConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ServiceType
-> Maybe DnsConfig
-> Maybe Text
-> ServiceInfo
ServiceInfo'
    { $sel:instanceCount:ServiceInfo' :: Maybe Int
instanceCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ServiceInfo' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckConfig:ServiceInfo' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:ServiceInfo' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createDate:ServiceInfo' :: Maybe POSIX
createDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:healthCheckCustomConfig:ServiceInfo' :: Maybe HealthCheckCustomConfig
healthCheckCustomConfig = Maybe HealthCheckCustomConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:namespaceId:ServiceInfo' :: Maybe Text
namespaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ServiceInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ServiceInfo' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':ServiceInfo' :: Maybe ServiceType
type' = Maybe ServiceType
forall a. Maybe a
Prelude.Nothing,
      $sel:dnsConfig:ServiceInfo' :: Maybe DnsConfig
dnsConfig = Maybe DnsConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:description:ServiceInfo' :: 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.
serviceInfo_instanceCount :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Int)
serviceInfo_instanceCount :: (Maybe Int -> f (Maybe Int)) -> ServiceInfo -> f ServiceInfo
serviceInfo_instanceCount = (ServiceInfo -> Maybe Int)
-> (ServiceInfo -> Maybe Int -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:ServiceInfo' :: ServiceInfo -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Int
a -> ServiceInfo
s {$sel:instanceCount:ServiceInfo' :: Maybe Int
instanceCount = Maybe Int
a} :: ServiceInfo)

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

-- | /Public DNS and HTTP namespaces only./ A complex type that contains
-- 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@.
--
-- For information about the charges for health checks, see
-- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
serviceInfo_healthCheckConfig :: Lens.Lens' ServiceInfo (Prelude.Maybe HealthCheckConfig)
serviceInfo_healthCheckConfig :: (Maybe HealthCheckConfig -> f (Maybe HealthCheckConfig))
-> ServiceInfo -> f ServiceInfo
serviceInfo_healthCheckConfig = (ServiceInfo -> Maybe HealthCheckConfig)
-> (ServiceInfo -> Maybe HealthCheckConfig -> ServiceInfo)
-> Lens
     ServiceInfo
     ServiceInfo
     (Maybe HealthCheckConfig)
     (Maybe HealthCheckConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe HealthCheckConfig
healthCheckConfig :: Maybe HealthCheckConfig
$sel:healthCheckConfig:ServiceInfo' :: ServiceInfo -> Maybe HealthCheckConfig
healthCheckConfig} -> Maybe HealthCheckConfig
healthCheckConfig) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe HealthCheckConfig
a -> ServiceInfo
s {$sel:healthCheckConfig:ServiceInfo' :: Maybe HealthCheckConfig
healthCheckConfig = Maybe HealthCheckConfig
a} :: ServiceInfo)

-- | A unique string that identifies the request and that allows failed
-- requests to be retried without the risk of running the operation twice.
-- @CreatorRequestId@ can be any unique string (for example, a
-- date\/timestamp).
serviceInfo_creatorRequestId :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_creatorRequestId :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_creatorRequestId = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:ServiceInfo' :: ServiceInfo -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:creatorRequestId:ServiceInfo' :: Maybe Text
creatorRequestId = Maybe Text
a} :: ServiceInfo)

-- | The date and time that the service was created, in Unix format and
-- Coordinated Universal Time (UTC). The value of @CreateDate@ is accurate
-- to milliseconds. For example, the value @1516925490.087@ represents
-- Friday, January 26, 2018 12:11:30.087 AM.
serviceInfo_createDate :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.UTCTime)
serviceInfo_createDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceInfo -> f ServiceInfo
serviceInfo_createDate = (ServiceInfo -> Maybe POSIX)
-> (ServiceInfo -> Maybe POSIX -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe POSIX
createDate :: Maybe POSIX
$sel:createDate:ServiceInfo' :: ServiceInfo -> Maybe POSIX
createDate} -> Maybe POSIX
createDate) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe POSIX
a -> ServiceInfo
s {$sel:createDate:ServiceInfo' :: Maybe POSIX
createDate = Maybe POSIX
a} :: ServiceInfo) ((Maybe POSIX -> f (Maybe POSIX)) -> ServiceInfo -> f ServiceInfo)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ServiceInfo
-> f ServiceInfo
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

-- | A complex type that contains information about an optional custom health
-- check.
--
-- If you specify a health check configuration, you can specify either
-- @HealthCheckCustomConfig@ or @HealthCheckConfig@ but not both.
serviceInfo_healthCheckCustomConfig :: Lens.Lens' ServiceInfo (Prelude.Maybe HealthCheckCustomConfig)
serviceInfo_healthCheckCustomConfig :: (Maybe HealthCheckCustomConfig
 -> f (Maybe HealthCheckCustomConfig))
-> ServiceInfo -> f ServiceInfo
serviceInfo_healthCheckCustomConfig = (ServiceInfo -> Maybe HealthCheckCustomConfig)
-> (ServiceInfo -> Maybe HealthCheckCustomConfig -> ServiceInfo)
-> Lens
     ServiceInfo
     ServiceInfo
     (Maybe HealthCheckCustomConfig)
     (Maybe HealthCheckCustomConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe HealthCheckCustomConfig
healthCheckCustomConfig :: Maybe HealthCheckCustomConfig
$sel:healthCheckCustomConfig:ServiceInfo' :: ServiceInfo -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig} -> Maybe HealthCheckCustomConfig
healthCheckCustomConfig) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe HealthCheckCustomConfig
a -> ServiceInfo
s {$sel:healthCheckCustomConfig:ServiceInfo' :: Maybe HealthCheckCustomConfig
healthCheckCustomConfig = Maybe HealthCheckCustomConfig
a} :: ServiceInfo)

-- | The ID of the namespace that was used to create the service.
serviceInfo_namespaceId :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_namespaceId :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_namespaceId = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
namespaceId :: Maybe Text
$sel:namespaceId:ServiceInfo' :: ServiceInfo -> Maybe Text
namespaceId} -> Maybe Text
namespaceId) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:namespaceId:ServiceInfo' :: Maybe Text
namespaceId = Maybe Text
a} :: ServiceInfo)

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

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

-- | 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.
serviceInfo_type :: Lens.Lens' ServiceInfo (Prelude.Maybe ServiceType)
serviceInfo_type :: (Maybe ServiceType -> f (Maybe ServiceType))
-> ServiceInfo -> f ServiceInfo
serviceInfo_type = (ServiceInfo -> Maybe ServiceType)
-> (ServiceInfo -> Maybe ServiceType -> ServiceInfo)
-> Lens
     ServiceInfo ServiceInfo (Maybe ServiceType) (Maybe ServiceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe ServiceType
type' :: Maybe ServiceType
$sel:type':ServiceInfo' :: ServiceInfo -> Maybe ServiceType
type'} -> Maybe ServiceType
type') (\s :: ServiceInfo
s@ServiceInfo' {} Maybe ServiceType
a -> ServiceInfo
s {$sel:type':ServiceInfo' :: Maybe ServiceType
type' = Maybe ServiceType
a} :: ServiceInfo)

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

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

instance Core.FromJSON ServiceInfo where
  parseJSON :: Value -> Parser ServiceInfo
parseJSON =
    String
-> (Object -> Parser ServiceInfo) -> Value -> Parser ServiceInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceInfo"
      ( \Object
x ->
          Maybe Int
-> Maybe Text
-> Maybe HealthCheckConfig
-> Maybe Text
-> Maybe POSIX
-> Maybe HealthCheckCustomConfig
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ServiceType
-> Maybe DnsConfig
-> Maybe Text
-> ServiceInfo
ServiceInfo'
            (Maybe Int
 -> Maybe Text
 -> Maybe HealthCheckConfig
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe HealthCheckCustomConfig
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ServiceType
 -> Maybe DnsConfig
 -> Maybe Text
 -> ServiceInfo)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe HealthCheckConfig
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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 Text
   -> Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe HealthCheckConfig
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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 Text
   -> Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe HealthCheckConfig)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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 Text
   -> Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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
"CreatorRequestId")
            Parser
  (Maybe POSIX
   -> Maybe HealthCheckCustomConfig
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe HealthCheckCustomConfig
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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 Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe HealthCheckCustomConfig)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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 Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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
"NamespaceId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ServiceType
   -> Maybe DnsConfig
   -> Maybe Text
   -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ServiceType
      -> Maybe DnsConfig
      -> Maybe Text
      -> ServiceInfo)
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
   -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
     (Maybe ServiceType -> Maybe DnsConfig -> Maybe Text -> ServiceInfo)
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 -> ServiceInfo)
-> Parser (Maybe ServiceType)
-> Parser (Maybe DnsConfig -> Maybe Text -> ServiceInfo)
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 -> ServiceInfo)
-> Parser (Maybe DnsConfig) -> Parser (Maybe Text -> ServiceInfo)
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 -> ServiceInfo)
-> Parser (Maybe Text) -> Parser ServiceInfo
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 ServiceInfo

instance Prelude.NFData ServiceInfo