{-# 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.AppRunner.Types.Service
-- 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.AppRunner.Types.Service where

import Amazonka.AppRunner.Types.AutoScalingConfigurationSummary
import Amazonka.AppRunner.Types.EncryptionConfiguration
import Amazonka.AppRunner.Types.HealthCheckConfiguration
import Amazonka.AppRunner.Types.InstanceConfiguration
import Amazonka.AppRunner.Types.ServiceStatus
import Amazonka.AppRunner.Types.SourceConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes an App Runner service. It can describe a service in any state,
-- including deleted services.
--
-- This type contains the full information about a service, including
-- configuration details. It\'s returned by the
-- <https://docs.aws.amazon.com/apprunner/latest/api/API_CreateService.html CreateService>,
-- <https://docs.aws.amazon.com/apprunner/latest/api/API_DescribeService.html DescribeService>,
-- and
-- <https://docs.aws.amazon.com/apprunner/latest/api/API_DeleteService.html DeleteService>
-- actions. A subset of this information is returned by the
-- <https://docs.aws.amazon.com/apprunner/latest/api/API_ListServices.html ListServices>
-- action using the
-- <https://docs.aws.amazon.com/apprunner/latest/api/API_ServiceSummary.html ServiceSummary>
-- type.
--
-- /See:/ 'newService' smart constructor.
data Service = Service'
  { -- | The encryption key that App Runner uses to encrypt the service logs and
    -- the copy of the source repository that App Runner maintains for the
    -- service. It can be either a customer-provided encryption key or an
    -- Amazon Web Services managed CMK.
    Service -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
    -- | The settings for the health check that App Runner performs to monitor
    -- the health of this service.
    Service -> Maybe HealthCheckConfiguration
healthCheckConfiguration :: Prelude.Maybe HealthCheckConfiguration,
    -- | The time when the App Runner service was deleted. It\'s in the Unix time
    -- stamp format.
    Service -> Maybe POSIX
deletedAt :: Prelude.Maybe Core.POSIX,
    -- | The customer-provided service name.
    Service -> Text
serviceName :: Prelude.Text,
    -- | An ID that App Runner generated for this service. It\'s unique within
    -- the Amazon Web Services Region.
    Service -> Text
serviceId :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of this service.
    Service -> Text
serviceArn :: Prelude.Text,
    -- | A subdomain URL that App Runner generated for this service. You can use
    -- this URL to access your service web application.
    Service -> Text
serviceUrl :: Prelude.Text,
    -- | The time when the App Runner service was created. It\'s in the Unix time
    -- stamp format.
    Service -> POSIX
createdAt :: Core.POSIX,
    -- | The time when the App Runner service was last updated at. It\'s in the
    -- Unix time stamp format.
    Service -> POSIX
updatedAt :: Core.POSIX,
    -- | The current state of the App Runner service. These particular values
    -- mean the following.
    --
    -- -   @CREATE_FAILED@ – The service failed to create. To troubleshoot this
    --     failure, read the failure events and logs, change any parameters
    --     that need to be fixed, and retry the call to create the service.
    --
    --     The failed service isn\'t usable, and still counts towards your
    --     service quota. When you\'re done analyzing the failure, delete the
    --     service.
    --
    -- -   @DELETE_FAILED@ – The service failed to delete and can\'t be
    --     successfully recovered. Retry the service deletion call to ensure
    --     that all related resources are removed.
    Service -> ServiceStatus
status :: ServiceStatus,
    -- | The source deployed to the App Runner service. It can be a code or an
    -- image repository.
    Service -> SourceConfiguration
sourceConfiguration :: SourceConfiguration,
    -- | The runtime configuration of instances (scaling units) of this service.
    Service -> InstanceConfiguration
instanceConfiguration :: InstanceConfiguration,
    -- | Summary information for the App Runner automatic scaling configuration
    -- resource that\'s associated with this service.
    Service -> AutoScalingConfigurationSummary
autoScalingConfigurationSummary :: AutoScalingConfigurationSummary
  }
  deriving (Service -> Service -> Bool
(Service -> Service -> Bool)
-> (Service -> Service -> Bool) -> Eq Service
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Service -> Service -> Bool
$c/= :: Service -> Service -> Bool
== :: Service -> Service -> Bool
$c== :: Service -> Service -> Bool
Prelude.Eq, Int -> Service -> ShowS
[Service] -> ShowS
Service -> String
(Int -> Service -> ShowS)
-> (Service -> String) -> ([Service] -> ShowS) -> Show Service
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Service] -> ShowS
$cshowList :: [Service] -> ShowS
show :: Service -> String
$cshow :: Service -> String
showsPrec :: Int -> Service -> ShowS
$cshowsPrec :: Int -> Service -> ShowS
Prelude.Show, (forall x. Service -> Rep Service x)
-> (forall x. Rep Service x -> Service) -> Generic Service
forall x. Rep Service x -> Service
forall x. Service -> Rep Service x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Service x -> Service
$cfrom :: forall x. Service -> Rep Service x
Prelude.Generic)

-- |
-- Create a value of 'Service' 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:
--
-- 'encryptionConfiguration', 'service_encryptionConfiguration' - The encryption key that App Runner uses to encrypt the service logs and
-- the copy of the source repository that App Runner maintains for the
-- service. It can be either a customer-provided encryption key or an
-- Amazon Web Services managed CMK.
--
-- 'healthCheckConfiguration', 'service_healthCheckConfiguration' - The settings for the health check that App Runner performs to monitor
-- the health of this service.
--
-- 'deletedAt', 'service_deletedAt' - The time when the App Runner service was deleted. It\'s in the Unix time
-- stamp format.
--
-- 'serviceName', 'service_serviceName' - The customer-provided service name.
--
-- 'serviceId', 'service_serviceId' - An ID that App Runner generated for this service. It\'s unique within
-- the Amazon Web Services Region.
--
-- 'serviceArn', 'service_serviceArn' - The Amazon Resource Name (ARN) of this service.
--
-- 'serviceUrl', 'service_serviceUrl' - A subdomain URL that App Runner generated for this service. You can use
-- this URL to access your service web application.
--
-- 'createdAt', 'service_createdAt' - The time when the App Runner service was created. It\'s in the Unix time
-- stamp format.
--
-- 'updatedAt', 'service_updatedAt' - The time when the App Runner service was last updated at. It\'s in the
-- Unix time stamp format.
--
-- 'status', 'service_status' - The current state of the App Runner service. These particular values
-- mean the following.
--
-- -   @CREATE_FAILED@ – The service failed to create. To troubleshoot this
--     failure, read the failure events and logs, change any parameters
--     that need to be fixed, and retry the call to create the service.
--
--     The failed service isn\'t usable, and still counts towards your
--     service quota. When you\'re done analyzing the failure, delete the
--     service.
--
-- -   @DELETE_FAILED@ – The service failed to delete and can\'t be
--     successfully recovered. Retry the service deletion call to ensure
--     that all related resources are removed.
--
-- 'sourceConfiguration', 'service_sourceConfiguration' - The source deployed to the App Runner service. It can be a code or an
-- image repository.
--
-- 'instanceConfiguration', 'service_instanceConfiguration' - The runtime configuration of instances (scaling units) of this service.
--
-- 'autoScalingConfigurationSummary', 'service_autoScalingConfigurationSummary' - Summary information for the App Runner automatic scaling configuration
-- resource that\'s associated with this service.
newService ::
  -- | 'serviceName'
  Prelude.Text ->
  -- | 'serviceId'
  Prelude.Text ->
  -- | 'serviceArn'
  Prelude.Text ->
  -- | 'serviceUrl'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'updatedAt'
  Prelude.UTCTime ->
  -- | 'status'
  ServiceStatus ->
  -- | 'sourceConfiguration'
  SourceConfiguration ->
  -- | 'instanceConfiguration'
  InstanceConfiguration ->
  -- | 'autoScalingConfigurationSummary'
  AutoScalingConfigurationSummary ->
  Service
newService :: Text
-> Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> ServiceStatus
-> SourceConfiguration
-> InstanceConfiguration
-> AutoScalingConfigurationSummary
-> Service
newService
  Text
pServiceName_
  Text
pServiceId_
  Text
pServiceArn_
  Text
pServiceUrl_
  UTCTime
pCreatedAt_
  UTCTime
pUpdatedAt_
  ServiceStatus
pStatus_
  SourceConfiguration
pSourceConfiguration_
  InstanceConfiguration
pInstanceConfiguration_
  AutoScalingConfigurationSummary
pAutoScalingConfigurationSummary_ =
    Service' :: Maybe EncryptionConfiguration
-> Maybe HealthCheckConfiguration
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> ServiceStatus
-> SourceConfiguration
-> InstanceConfiguration
-> AutoScalingConfigurationSummary
-> Service
Service'
      { $sel:encryptionConfiguration:Service' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:healthCheckConfiguration:Service' :: Maybe HealthCheckConfiguration
healthCheckConfiguration = Maybe HealthCheckConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:deletedAt:Service' :: Maybe POSIX
deletedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:serviceName:Service' :: Text
serviceName = Text
pServiceName_,
        $sel:serviceId:Service' :: Text
serviceId = Text
pServiceId_,
        $sel:serviceArn:Service' :: Text
serviceArn = Text
pServiceArn_,
        $sel:serviceUrl:Service' :: Text
serviceUrl = Text
pServiceUrl_,
        $sel:createdAt:Service' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:updatedAt:Service' :: POSIX
updatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_,
        $sel:status:Service' :: ServiceStatus
status = ServiceStatus
pStatus_,
        $sel:sourceConfiguration:Service' :: SourceConfiguration
sourceConfiguration = SourceConfiguration
pSourceConfiguration_,
        $sel:instanceConfiguration:Service' :: InstanceConfiguration
instanceConfiguration = InstanceConfiguration
pInstanceConfiguration_,
        $sel:autoScalingConfigurationSummary:Service' :: AutoScalingConfigurationSummary
autoScalingConfigurationSummary =
          AutoScalingConfigurationSummary
pAutoScalingConfigurationSummary_
      }

-- | The encryption key that App Runner uses to encrypt the service logs and
-- the copy of the source repository that App Runner maintains for the
-- service. It can be either a customer-provided encryption key or an
-- Amazon Web Services managed CMK.
service_encryptionConfiguration :: Lens.Lens' Service (Prelude.Maybe EncryptionConfiguration)
service_encryptionConfiguration :: (Maybe EncryptionConfiguration
 -> f (Maybe EncryptionConfiguration))
-> Service -> f Service
service_encryptionConfiguration = (Service -> Maybe EncryptionConfiguration)
-> (Service -> Maybe EncryptionConfiguration -> Service)
-> Lens
     Service
     Service
     (Maybe EncryptionConfiguration)
     (Maybe EncryptionConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:Service' :: Service -> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: Service
s@Service' {} Maybe EncryptionConfiguration
a -> Service
s {$sel:encryptionConfiguration:Service' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: Service)

-- | The settings for the health check that App Runner performs to monitor
-- the health of this service.
service_healthCheckConfiguration :: Lens.Lens' Service (Prelude.Maybe HealthCheckConfiguration)
service_healthCheckConfiguration :: (Maybe HealthCheckConfiguration
 -> f (Maybe HealthCheckConfiguration))
-> Service -> f Service
service_healthCheckConfiguration = (Service -> Maybe HealthCheckConfiguration)
-> (Service -> Maybe HealthCheckConfiguration -> Service)
-> Lens
     Service
     Service
     (Maybe HealthCheckConfiguration)
     (Maybe HealthCheckConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Maybe HealthCheckConfiguration
healthCheckConfiguration :: Maybe HealthCheckConfiguration
$sel:healthCheckConfiguration:Service' :: Service -> Maybe HealthCheckConfiguration
healthCheckConfiguration} -> Maybe HealthCheckConfiguration
healthCheckConfiguration) (\s :: Service
s@Service' {} Maybe HealthCheckConfiguration
a -> Service
s {$sel:healthCheckConfiguration:Service' :: Maybe HealthCheckConfiguration
healthCheckConfiguration = Maybe HealthCheckConfiguration
a} :: Service)

-- | The time when the App Runner service was deleted. It\'s in the Unix time
-- stamp format.
service_deletedAt :: Lens.Lens' Service (Prelude.Maybe Prelude.UTCTime)
service_deletedAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Service -> f Service
service_deletedAt = (Service -> Maybe POSIX)
-> (Service -> Maybe POSIX -> Service)
-> Lens Service Service (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Maybe POSIX
deletedAt :: Maybe POSIX
$sel:deletedAt:Service' :: Service -> Maybe POSIX
deletedAt} -> Maybe POSIX
deletedAt) (\s :: Service
s@Service' {} Maybe POSIX
a -> Service
s {$sel:deletedAt:Service' :: Maybe POSIX
deletedAt = Maybe POSIX
a} :: Service) ((Maybe POSIX -> f (Maybe POSIX)) -> Service -> f Service)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Service
-> f Service
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

-- | The customer-provided service name.
service_serviceName :: Lens.Lens' Service Prelude.Text
service_serviceName :: (Text -> f Text) -> Service -> f Service
service_serviceName = (Service -> Text)
-> (Service -> Text -> Service) -> Lens Service Service Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Text
serviceName :: Text
$sel:serviceName:Service' :: Service -> Text
serviceName} -> Text
serviceName) (\s :: Service
s@Service' {} Text
a -> Service
s {$sel:serviceName:Service' :: Text
serviceName = Text
a} :: Service)

-- | An ID that App Runner generated for this service. It\'s unique within
-- the Amazon Web Services Region.
service_serviceId :: Lens.Lens' Service Prelude.Text
service_serviceId :: (Text -> f Text) -> Service -> f Service
service_serviceId = (Service -> Text)
-> (Service -> Text -> Service) -> Lens Service Service Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Text
serviceId :: Text
$sel:serviceId:Service' :: Service -> Text
serviceId} -> Text
serviceId) (\s :: Service
s@Service' {} Text
a -> Service
s {$sel:serviceId:Service' :: Text
serviceId = Text
a} :: Service)

-- | The Amazon Resource Name (ARN) of this service.
service_serviceArn :: Lens.Lens' Service Prelude.Text
service_serviceArn :: (Text -> f Text) -> Service -> f Service
service_serviceArn = (Service -> Text)
-> (Service -> Text -> Service) -> Lens Service Service Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Text
serviceArn :: Text
$sel:serviceArn:Service' :: Service -> Text
serviceArn} -> Text
serviceArn) (\s :: Service
s@Service' {} Text
a -> Service
s {$sel:serviceArn:Service' :: Text
serviceArn = Text
a} :: Service)

-- | A subdomain URL that App Runner generated for this service. You can use
-- this URL to access your service web application.
service_serviceUrl :: Lens.Lens' Service Prelude.Text
service_serviceUrl :: (Text -> f Text) -> Service -> f Service
service_serviceUrl = (Service -> Text)
-> (Service -> Text -> Service) -> Lens Service Service Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {Text
serviceUrl :: Text
$sel:serviceUrl:Service' :: Service -> Text
serviceUrl} -> Text
serviceUrl) (\s :: Service
s@Service' {} Text
a -> Service
s {$sel:serviceUrl:Service' :: Text
serviceUrl = Text
a} :: Service)

-- | The time when the App Runner service was created. It\'s in the Unix time
-- stamp format.
service_createdAt :: Lens.Lens' Service Prelude.UTCTime
service_createdAt :: (UTCTime -> f UTCTime) -> Service -> f Service
service_createdAt = (Service -> POSIX)
-> (Service -> POSIX -> Service)
-> Lens Service Service POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {POSIX
createdAt :: POSIX
$sel:createdAt:Service' :: Service -> POSIX
createdAt} -> POSIX
createdAt) (\s :: Service
s@Service' {} POSIX
a -> Service
s {$sel:createdAt:Service' :: POSIX
createdAt = POSIX
a} :: Service) ((POSIX -> f POSIX) -> Service -> f Service)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Service
-> f Service
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The time when the App Runner service was last updated at. It\'s in the
-- Unix time stamp format.
service_updatedAt :: Lens.Lens' Service Prelude.UTCTime
service_updatedAt :: (UTCTime -> f UTCTime) -> Service -> f Service
service_updatedAt = (Service -> POSIX)
-> (Service -> POSIX -> Service)
-> Lens Service Service POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {POSIX
updatedAt :: POSIX
$sel:updatedAt:Service' :: Service -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: Service
s@Service' {} POSIX
a -> Service
s {$sel:updatedAt:Service' :: POSIX
updatedAt = POSIX
a} :: Service) ((POSIX -> f POSIX) -> Service -> f Service)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> Service
-> f Service
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The current state of the App Runner service. These particular values
-- mean the following.
--
-- -   @CREATE_FAILED@ – The service failed to create. To troubleshoot this
--     failure, read the failure events and logs, change any parameters
--     that need to be fixed, and retry the call to create the service.
--
--     The failed service isn\'t usable, and still counts towards your
--     service quota. When you\'re done analyzing the failure, delete the
--     service.
--
-- -   @DELETE_FAILED@ – The service failed to delete and can\'t be
--     successfully recovered. Retry the service deletion call to ensure
--     that all related resources are removed.
service_status :: Lens.Lens' Service ServiceStatus
service_status :: (ServiceStatus -> f ServiceStatus) -> Service -> f Service
service_status = (Service -> ServiceStatus)
-> (Service -> ServiceStatus -> Service)
-> Lens Service Service ServiceStatus ServiceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {ServiceStatus
status :: ServiceStatus
$sel:status:Service' :: Service -> ServiceStatus
status} -> ServiceStatus
status) (\s :: Service
s@Service' {} ServiceStatus
a -> Service
s {$sel:status:Service' :: ServiceStatus
status = ServiceStatus
a} :: Service)

-- | The source deployed to the App Runner service. It can be a code or an
-- image repository.
service_sourceConfiguration :: Lens.Lens' Service SourceConfiguration
service_sourceConfiguration :: (SourceConfiguration -> f SourceConfiguration)
-> Service -> f Service
service_sourceConfiguration = (Service -> SourceConfiguration)
-> (Service -> SourceConfiguration -> Service)
-> Lens Service Service SourceConfiguration SourceConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {SourceConfiguration
sourceConfiguration :: SourceConfiguration
$sel:sourceConfiguration:Service' :: Service -> SourceConfiguration
sourceConfiguration} -> SourceConfiguration
sourceConfiguration) (\s :: Service
s@Service' {} SourceConfiguration
a -> Service
s {$sel:sourceConfiguration:Service' :: SourceConfiguration
sourceConfiguration = SourceConfiguration
a} :: Service)

-- | The runtime configuration of instances (scaling units) of this service.
service_instanceConfiguration :: Lens.Lens' Service InstanceConfiguration
service_instanceConfiguration :: (InstanceConfiguration -> f InstanceConfiguration)
-> Service -> f Service
service_instanceConfiguration = (Service -> InstanceConfiguration)
-> (Service -> InstanceConfiguration -> Service)
-> Lens Service Service InstanceConfiguration InstanceConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {InstanceConfiguration
instanceConfiguration :: InstanceConfiguration
$sel:instanceConfiguration:Service' :: Service -> InstanceConfiguration
instanceConfiguration} -> InstanceConfiguration
instanceConfiguration) (\s :: Service
s@Service' {} InstanceConfiguration
a -> Service
s {$sel:instanceConfiguration:Service' :: InstanceConfiguration
instanceConfiguration = InstanceConfiguration
a} :: Service)

-- | Summary information for the App Runner automatic scaling configuration
-- resource that\'s associated with this service.
service_autoScalingConfigurationSummary :: Lens.Lens' Service AutoScalingConfigurationSummary
service_autoScalingConfigurationSummary :: (AutoScalingConfigurationSummary
 -> f AutoScalingConfigurationSummary)
-> Service -> f Service
service_autoScalingConfigurationSummary = (Service -> AutoScalingConfigurationSummary)
-> (Service -> AutoScalingConfigurationSummary -> Service)
-> Lens
     Service
     Service
     AutoScalingConfigurationSummary
     AutoScalingConfigurationSummary
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Service' {AutoScalingConfigurationSummary
autoScalingConfigurationSummary :: AutoScalingConfigurationSummary
$sel:autoScalingConfigurationSummary:Service' :: Service -> AutoScalingConfigurationSummary
autoScalingConfigurationSummary} -> AutoScalingConfigurationSummary
autoScalingConfigurationSummary) (\s :: Service
s@Service' {} AutoScalingConfigurationSummary
a -> Service
s {$sel:autoScalingConfigurationSummary:Service' :: AutoScalingConfigurationSummary
autoScalingConfigurationSummary = AutoScalingConfigurationSummary
a} :: Service)

instance Core.FromJSON Service where
  parseJSON :: Value -> Parser Service
parseJSON =
    String -> (Object -> Parser Service) -> Value -> Parser Service
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Service"
      ( \Object
x ->
          Maybe EncryptionConfiguration
-> Maybe HealthCheckConfiguration
-> Maybe POSIX
-> Text
-> Text
-> Text
-> Text
-> POSIX
-> POSIX
-> ServiceStatus
-> SourceConfiguration
-> InstanceConfiguration
-> AutoScalingConfigurationSummary
-> Service
Service'
            (Maybe EncryptionConfiguration
 -> Maybe HealthCheckConfiguration
 -> Maybe POSIX
 -> Text
 -> Text
 -> Text
 -> Text
 -> POSIX
 -> POSIX
 -> ServiceStatus
 -> SourceConfiguration
 -> InstanceConfiguration
 -> AutoScalingConfigurationSummary
 -> Service)
-> Parser (Maybe EncryptionConfiguration)
-> Parser
     (Maybe HealthCheckConfiguration
      -> Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EncryptionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EncryptionConfiguration")
            Parser
  (Maybe HealthCheckConfiguration
   -> Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser (Maybe HealthCheckConfiguration)
-> Parser
     (Maybe POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthCheckConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthCheckConfiguration")
            Parser
  (Maybe POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser (Maybe POSIX)
-> Parser
     (Text
      -> Text
      -> Text
      -> Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
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
"DeletedAt")
            Parser
  (Text
   -> Text
   -> Text
   -> Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceName")
            Parser
  (Text
   -> Text
   -> Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser Text
-> Parser
     (Text
      -> Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceId")
            Parser
  (Text
   -> Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser Text
-> Parser
     (Text
      -> POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceArn")
            Parser
  (Text
   -> POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser Text
-> Parser
     (POSIX
      -> POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ServiceUrl")
            Parser
  (POSIX
   -> POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser POSIX
-> Parser
     (POSIX
      -> ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"CreatedAt")
            Parser
  (POSIX
   -> ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser POSIX
-> Parser
     (ServiceStatus
      -> SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"UpdatedAt")
            Parser
  (ServiceStatus
   -> SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser ServiceStatus
-> Parser
     (SourceConfiguration
      -> InstanceConfiguration
      -> AutoScalingConfigurationSummary
      -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ServiceStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
            Parser
  (SourceConfiguration
   -> InstanceConfiguration
   -> AutoScalingConfigurationSummary
   -> Service)
-> Parser SourceConfiguration
-> Parser
     (InstanceConfiguration
      -> AutoScalingConfigurationSummary -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SourceConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceConfiguration")
            Parser
  (InstanceConfiguration
   -> AutoScalingConfigurationSummary -> Service)
-> Parser InstanceConfiguration
-> Parser (AutoScalingConfigurationSummary -> Service)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser InstanceConfiguration
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"InstanceConfiguration")
            Parser (AutoScalingConfigurationSummary -> Service)
-> Parser AutoScalingConfigurationSummary -> Parser Service
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AutoScalingConfigurationSummary
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"AutoScalingConfigurationSummary")
      )

instance Prelude.Hashable Service

instance Prelude.NFData Service