{-# 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.Proton.Types.ServiceInstance
-- 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.Proton.Types.ServiceInstance where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types.DeploymentStatus

-- | The service instance detail data.
--
-- /See:/ 'newServiceInstance' smart constructor.
data ServiceInstance = ServiceInstance'
  { -- | A service instance deployment status message.
    ServiceInstance -> Maybe (Sensitive Text)
deploymentStatusMessage :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The service spec that was used to create the service instance.
    ServiceInstance -> Maybe (Sensitive Text)
spec :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the service instance.
    ServiceInstance -> Text
arn :: Prelude.Text,
    -- | The time when the service instance was created.
    ServiceInstance -> POSIX
createdAt :: Core.POSIX,
    -- | The service instance deployment status.
    ServiceInstance -> DeploymentStatus
deploymentStatus :: DeploymentStatus,
    -- | The name of the environment that the service instance was deployed into.
    ServiceInstance -> Text
environmentName :: Prelude.Text,
    -- | The time when a deployment of the service instance was last attempted.
    ServiceInstance -> POSIX
lastDeploymentAttemptedAt :: Core.POSIX,
    -- | The time when the service instance was last deployed successfully.
    ServiceInstance -> POSIX
lastDeploymentSucceededAt :: Core.POSIX,
    -- | The name of the service instance.
    ServiceInstance -> Text
name :: Prelude.Text,
    -- | The name of the service that the service instance belongs to.
    ServiceInstance -> Text
serviceName :: Prelude.Text,
    -- | The ID of the major version of the service template that was used to
    -- create the service instance.
    ServiceInstance -> Text
templateMajorVersion :: Prelude.Text,
    -- | The ID of the minor version of the service template that was used to
    -- create the service instance.
    ServiceInstance -> Text
templateMinorVersion :: Prelude.Text,
    -- | The name of the service template that was used to create the service
    -- instance.
    ServiceInstance -> Text
templateName :: Prelude.Text
  }
  deriving (ServiceInstance -> ServiceInstance -> Bool
(ServiceInstance -> ServiceInstance -> Bool)
-> (ServiceInstance -> ServiceInstance -> Bool)
-> Eq ServiceInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceInstance -> ServiceInstance -> Bool
$c/= :: ServiceInstance -> ServiceInstance -> Bool
== :: ServiceInstance -> ServiceInstance -> Bool
$c== :: ServiceInstance -> ServiceInstance -> Bool
Prelude.Eq, Int -> ServiceInstance -> ShowS
[ServiceInstance] -> ShowS
ServiceInstance -> String
(Int -> ServiceInstance -> ShowS)
-> (ServiceInstance -> String)
-> ([ServiceInstance] -> ShowS)
-> Show ServiceInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceInstance] -> ShowS
$cshowList :: [ServiceInstance] -> ShowS
show :: ServiceInstance -> String
$cshow :: ServiceInstance -> String
showsPrec :: Int -> ServiceInstance -> ShowS
$cshowsPrec :: Int -> ServiceInstance -> ShowS
Prelude.Show, (forall x. ServiceInstance -> Rep ServiceInstance x)
-> (forall x. Rep ServiceInstance x -> ServiceInstance)
-> Generic ServiceInstance
forall x. Rep ServiceInstance x -> ServiceInstance
forall x. ServiceInstance -> Rep ServiceInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceInstance x -> ServiceInstance
$cfrom :: forall x. ServiceInstance -> Rep ServiceInstance x
Prelude.Generic)

-- |
-- Create a value of 'ServiceInstance' 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:
--
-- 'deploymentStatusMessage', 'serviceInstance_deploymentStatusMessage' - A service instance deployment status message.
--
-- 'spec', 'serviceInstance_spec' - The service spec that was used to create the service instance.
--
-- 'arn', 'serviceInstance_arn' - The Amazon Resource Name (ARN) of the service instance.
--
-- 'createdAt', 'serviceInstance_createdAt' - The time when the service instance was created.
--
-- 'deploymentStatus', 'serviceInstance_deploymentStatus' - The service instance deployment status.
--
-- 'environmentName', 'serviceInstance_environmentName' - The name of the environment that the service instance was deployed into.
--
-- 'lastDeploymentAttemptedAt', 'serviceInstance_lastDeploymentAttemptedAt' - The time when a deployment of the service instance was last attempted.
--
-- 'lastDeploymentSucceededAt', 'serviceInstance_lastDeploymentSucceededAt' - The time when the service instance was last deployed successfully.
--
-- 'name', 'serviceInstance_name' - The name of the service instance.
--
-- 'serviceName', 'serviceInstance_serviceName' - The name of the service that the service instance belongs to.
--
-- 'templateMajorVersion', 'serviceInstance_templateMajorVersion' - The ID of the major version of the service template that was used to
-- create the service instance.
--
-- 'templateMinorVersion', 'serviceInstance_templateMinorVersion' - The ID of the minor version of the service template that was used to
-- create the service instance.
--
-- 'templateName', 'serviceInstance_templateName' - The name of the service template that was used to create the service
-- instance.
newServiceInstance ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'deploymentStatus'
  DeploymentStatus ->
  -- | 'environmentName'
  Prelude.Text ->
  -- | 'lastDeploymentAttemptedAt'
  Prelude.UTCTime ->
  -- | 'lastDeploymentSucceededAt'
  Prelude.UTCTime ->
  -- | 'name'
  Prelude.Text ->
  -- | 'serviceName'
  Prelude.Text ->
  -- | 'templateMajorVersion'
  Prelude.Text ->
  -- | 'templateMinorVersion'
  Prelude.Text ->
  -- | 'templateName'
  Prelude.Text ->
  ServiceInstance
newServiceInstance :: Text
-> UTCTime
-> DeploymentStatus
-> Text
-> UTCTime
-> UTCTime
-> Text
-> Text
-> Text
-> Text
-> Text
-> ServiceInstance
newServiceInstance
  Text
pArn_
  UTCTime
pCreatedAt_
  DeploymentStatus
pDeploymentStatus_
  Text
pEnvironmentName_
  UTCTime
pLastDeploymentAttemptedAt_
  UTCTime
pLastDeploymentSucceededAt_
  Text
pName_
  Text
pServiceName_
  Text
pTemplateMajorVersion_
  Text
pTemplateMinorVersion_
  Text
pTemplateName_ =
    ServiceInstance' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> POSIX
-> DeploymentStatus
-> Text
-> POSIX
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Text
-> ServiceInstance
ServiceInstance'
      { $sel:deploymentStatusMessage:ServiceInstance' :: Maybe (Sensitive Text)
deploymentStatusMessage =
          Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:spec:ServiceInstance' :: Maybe (Sensitive Text)
spec = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:ServiceInstance' :: Text
arn = Text
pArn_,
        $sel:createdAt:ServiceInstance' :: 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:deploymentStatus:ServiceInstance' :: DeploymentStatus
deploymentStatus = DeploymentStatus
pDeploymentStatus_,
        $sel:environmentName:ServiceInstance' :: Text
environmentName = Text
pEnvironmentName_,
        $sel:lastDeploymentAttemptedAt:ServiceInstance' :: POSIX
lastDeploymentAttemptedAt =
          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
pLastDeploymentAttemptedAt_,
        $sel:lastDeploymentSucceededAt:ServiceInstance' :: POSIX
lastDeploymentSucceededAt =
          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
pLastDeploymentSucceededAt_,
        $sel:name:ServiceInstance' :: Text
name = Text
pName_,
        $sel:serviceName:ServiceInstance' :: Text
serviceName = Text
pServiceName_,
        $sel:templateMajorVersion:ServiceInstance' :: Text
templateMajorVersion = Text
pTemplateMajorVersion_,
        $sel:templateMinorVersion:ServiceInstance' :: Text
templateMinorVersion = Text
pTemplateMinorVersion_,
        $sel:templateName:ServiceInstance' :: Text
templateName = Text
pTemplateName_
      }

-- | A service instance deployment status message.
serviceInstance_deploymentStatusMessage :: Lens.Lens' ServiceInstance (Prelude.Maybe Prelude.Text)
serviceInstance_deploymentStatusMessage :: (Maybe Text -> f (Maybe Text))
-> ServiceInstance -> f ServiceInstance
serviceInstance_deploymentStatusMessage = (ServiceInstance -> Maybe (Sensitive Text))
-> (ServiceInstance -> Maybe (Sensitive Text) -> ServiceInstance)
-> Lens
     ServiceInstance
     ServiceInstance
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Maybe (Sensitive Text)
deploymentStatusMessage :: Maybe (Sensitive Text)
$sel:deploymentStatusMessage:ServiceInstance' :: ServiceInstance -> Maybe (Sensitive Text)
deploymentStatusMessage} -> Maybe (Sensitive Text)
deploymentStatusMessage) (\s :: ServiceInstance
s@ServiceInstance' {} Maybe (Sensitive Text)
a -> ServiceInstance
s {$sel:deploymentStatusMessage:ServiceInstance' :: Maybe (Sensitive Text)
deploymentStatusMessage = Maybe (Sensitive Text)
a} :: ServiceInstance) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ServiceInstance -> f ServiceInstance)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ServiceInstance
-> f ServiceInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The service spec that was used to create the service instance.
serviceInstance_spec :: Lens.Lens' ServiceInstance (Prelude.Maybe Prelude.Text)
serviceInstance_spec :: (Maybe Text -> f (Maybe Text))
-> ServiceInstance -> f ServiceInstance
serviceInstance_spec = (ServiceInstance -> Maybe (Sensitive Text))
-> (ServiceInstance -> Maybe (Sensitive Text) -> ServiceInstance)
-> Lens
     ServiceInstance
     ServiceInstance
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Maybe (Sensitive Text)
spec :: Maybe (Sensitive Text)
$sel:spec:ServiceInstance' :: ServiceInstance -> Maybe (Sensitive Text)
spec} -> Maybe (Sensitive Text)
spec) (\s :: ServiceInstance
s@ServiceInstance' {} Maybe (Sensitive Text)
a -> ServiceInstance
s {$sel:spec:ServiceInstance' :: Maybe (Sensitive Text)
spec = Maybe (Sensitive Text)
a} :: ServiceInstance) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ServiceInstance -> f ServiceInstance)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ServiceInstance
-> f ServiceInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The Amazon Resource Name (ARN) of the service instance.
serviceInstance_arn :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_arn :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_arn = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
arn :: Text
$sel:arn:ServiceInstance' :: ServiceInstance -> Text
arn} -> Text
arn) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:arn:ServiceInstance' :: Text
arn = Text
a} :: ServiceInstance)

-- | The time when the service instance was created.
serviceInstance_createdAt :: Lens.Lens' ServiceInstance Prelude.UTCTime
serviceInstance_createdAt :: (UTCTime -> f UTCTime) -> ServiceInstance -> f ServiceInstance
serviceInstance_createdAt = (ServiceInstance -> POSIX)
-> (ServiceInstance -> POSIX -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {POSIX
createdAt :: POSIX
$sel:createdAt:ServiceInstance' :: ServiceInstance -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ServiceInstance
s@ServiceInstance' {} POSIX
a -> ServiceInstance
s {$sel:createdAt:ServiceInstance' :: POSIX
createdAt = POSIX
a} :: ServiceInstance) ((POSIX -> f POSIX) -> ServiceInstance -> f ServiceInstance)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ServiceInstance
-> f ServiceInstance
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 service instance deployment status.
serviceInstance_deploymentStatus :: Lens.Lens' ServiceInstance DeploymentStatus
serviceInstance_deploymentStatus :: (DeploymentStatus -> f DeploymentStatus)
-> ServiceInstance -> f ServiceInstance
serviceInstance_deploymentStatus = (ServiceInstance -> DeploymentStatus)
-> (ServiceInstance -> DeploymentStatus -> ServiceInstance)
-> Lens
     ServiceInstance ServiceInstance DeploymentStatus DeploymentStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {DeploymentStatus
deploymentStatus :: DeploymentStatus
$sel:deploymentStatus:ServiceInstance' :: ServiceInstance -> DeploymentStatus
deploymentStatus} -> DeploymentStatus
deploymentStatus) (\s :: ServiceInstance
s@ServiceInstance' {} DeploymentStatus
a -> ServiceInstance
s {$sel:deploymentStatus:ServiceInstance' :: DeploymentStatus
deploymentStatus = DeploymentStatus
a} :: ServiceInstance)

-- | The name of the environment that the service instance was deployed into.
serviceInstance_environmentName :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_environmentName :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_environmentName = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
environmentName :: Text
$sel:environmentName:ServiceInstance' :: ServiceInstance -> Text
environmentName} -> Text
environmentName) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:environmentName:ServiceInstance' :: Text
environmentName = Text
a} :: ServiceInstance)

-- | The time when a deployment of the service instance was last attempted.
serviceInstance_lastDeploymentAttemptedAt :: Lens.Lens' ServiceInstance Prelude.UTCTime
serviceInstance_lastDeploymentAttemptedAt :: (UTCTime -> f UTCTime) -> ServiceInstance -> f ServiceInstance
serviceInstance_lastDeploymentAttemptedAt = (ServiceInstance -> POSIX)
-> (ServiceInstance -> POSIX -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {POSIX
lastDeploymentAttemptedAt :: POSIX
$sel:lastDeploymentAttemptedAt:ServiceInstance' :: ServiceInstance -> POSIX
lastDeploymentAttemptedAt} -> POSIX
lastDeploymentAttemptedAt) (\s :: ServiceInstance
s@ServiceInstance' {} POSIX
a -> ServiceInstance
s {$sel:lastDeploymentAttemptedAt:ServiceInstance' :: POSIX
lastDeploymentAttemptedAt = POSIX
a} :: ServiceInstance) ((POSIX -> f POSIX) -> ServiceInstance -> f ServiceInstance)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ServiceInstance
-> f ServiceInstance
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 service instance was last deployed successfully.
serviceInstance_lastDeploymentSucceededAt :: Lens.Lens' ServiceInstance Prelude.UTCTime
serviceInstance_lastDeploymentSucceededAt :: (UTCTime -> f UTCTime) -> ServiceInstance -> f ServiceInstance
serviceInstance_lastDeploymentSucceededAt = (ServiceInstance -> POSIX)
-> (ServiceInstance -> POSIX -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {POSIX
lastDeploymentSucceededAt :: POSIX
$sel:lastDeploymentSucceededAt:ServiceInstance' :: ServiceInstance -> POSIX
lastDeploymentSucceededAt} -> POSIX
lastDeploymentSucceededAt) (\s :: ServiceInstance
s@ServiceInstance' {} POSIX
a -> ServiceInstance
s {$sel:lastDeploymentSucceededAt:ServiceInstance' :: POSIX
lastDeploymentSucceededAt = POSIX
a} :: ServiceInstance) ((POSIX -> f POSIX) -> ServiceInstance -> f ServiceInstance)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> ServiceInstance
-> f ServiceInstance
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 name of the service instance.
serviceInstance_name :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_name :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_name = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
name :: Text
$sel:name:ServiceInstance' :: ServiceInstance -> Text
name} -> Text
name) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:name:ServiceInstance' :: Text
name = Text
a} :: ServiceInstance)

-- | The name of the service that the service instance belongs to.
serviceInstance_serviceName :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_serviceName :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_serviceName = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
serviceName :: Text
$sel:serviceName:ServiceInstance' :: ServiceInstance -> Text
serviceName} -> Text
serviceName) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:serviceName:ServiceInstance' :: Text
serviceName = Text
a} :: ServiceInstance)

-- | The ID of the major version of the service template that was used to
-- create the service instance.
serviceInstance_templateMajorVersion :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_templateMajorVersion :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_templateMajorVersion = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
templateMajorVersion :: Text
$sel:templateMajorVersion:ServiceInstance' :: ServiceInstance -> Text
templateMajorVersion} -> Text
templateMajorVersion) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:templateMajorVersion:ServiceInstance' :: Text
templateMajorVersion = Text
a} :: ServiceInstance)

-- | The ID of the minor version of the service template that was used to
-- create the service instance.
serviceInstance_templateMinorVersion :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_templateMinorVersion :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_templateMinorVersion = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
templateMinorVersion :: Text
$sel:templateMinorVersion:ServiceInstance' :: ServiceInstance -> Text
templateMinorVersion} -> Text
templateMinorVersion) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:templateMinorVersion:ServiceInstance' :: Text
templateMinorVersion = Text
a} :: ServiceInstance)

-- | The name of the service template that was used to create the service
-- instance.
serviceInstance_templateName :: Lens.Lens' ServiceInstance Prelude.Text
serviceInstance_templateName :: (Text -> f Text) -> ServiceInstance -> f ServiceInstance
serviceInstance_templateName = (ServiceInstance -> Text)
-> (ServiceInstance -> Text -> ServiceInstance)
-> Lens ServiceInstance ServiceInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInstance' {Text
templateName :: Text
$sel:templateName:ServiceInstance' :: ServiceInstance -> Text
templateName} -> Text
templateName) (\s :: ServiceInstance
s@ServiceInstance' {} Text
a -> ServiceInstance
s {$sel:templateName:ServiceInstance' :: Text
templateName = Text
a} :: ServiceInstance)

instance Core.FromJSON ServiceInstance where
  parseJSON :: Value -> Parser ServiceInstance
parseJSON =
    String
-> (Object -> Parser ServiceInstance)
-> Value
-> Parser ServiceInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceInstance"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> POSIX
-> DeploymentStatus
-> Text
-> POSIX
-> POSIX
-> Text
-> Text
-> Text
-> Text
-> Text
-> ServiceInstance
ServiceInstance'
            (Maybe (Sensitive Text)
 -> Maybe (Sensitive Text)
 -> Text
 -> POSIX
 -> DeploymentStatus
 -> Text
 -> POSIX
 -> POSIX
 -> Text
 -> Text
 -> Text
 -> Text
 -> Text
 -> ServiceInstance)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe (Sensitive Text)
      -> Text
      -> POSIX
      -> DeploymentStatus
      -> Text
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"deploymentStatusMessage")
            Parser
  (Maybe (Sensitive Text)
   -> Text
   -> POSIX
   -> DeploymentStatus
   -> Text
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Text
      -> POSIX
      -> DeploymentStatus
      -> Text
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"spec")
            Parser
  (Text
   -> POSIX
   -> DeploymentStatus
   -> Text
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser Text
-> Parser
     (POSIX
      -> DeploymentStatus
      -> Text
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
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
"arn")
            Parser
  (POSIX
   -> DeploymentStatus
   -> Text
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser POSIX
-> Parser
     (DeploymentStatus
      -> Text
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
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
  (DeploymentStatus
   -> Text
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser DeploymentStatus
-> Parser
     (Text
      -> POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DeploymentStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"deploymentStatus")
            Parser
  (Text
   -> POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser Text
-> Parser
     (POSIX
      -> POSIX
      -> Text
      -> Text
      -> Text
      -> Text
      -> Text
      -> ServiceInstance)
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
"environmentName")
            Parser
  (POSIX
   -> POSIX
   -> Text
   -> Text
   -> Text
   -> Text
   -> Text
   -> ServiceInstance)
-> Parser POSIX
-> Parser
     (POSIX -> Text -> Text -> Text -> Text -> Text -> ServiceInstance)
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
"lastDeploymentAttemptedAt")
            Parser
  (POSIX -> Text -> Text -> Text -> Text -> Text -> ServiceInstance)
-> Parser POSIX
-> Parser (Text -> Text -> Text -> Text -> Text -> ServiceInstance)
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
"lastDeploymentSucceededAt")
            Parser (Text -> Text -> Text -> Text -> Text -> ServiceInstance)
-> Parser Text
-> Parser (Text -> Text -> Text -> Text -> ServiceInstance)
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
"name")
            Parser (Text -> Text -> Text -> Text -> ServiceInstance)
-> Parser Text -> Parser (Text -> Text -> Text -> ServiceInstance)
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 -> ServiceInstance)
-> Parser Text -> Parser (Text -> Text -> ServiceInstance)
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
"templateMajorVersion")
            Parser (Text -> Text -> ServiceInstance)
-> Parser Text -> Parser (Text -> ServiceInstance)
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
"templateMinorVersion")
            Parser (Text -> ServiceInstance)
-> Parser Text -> Parser ServiceInstance
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
"templateName")
      )

instance Prelude.Hashable ServiceInstance

instance Prelude.NFData ServiceInstance