{-# 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.ServiceSummary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Proton.Types.ServiceSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types.ServiceStatus

-- | Summary data of an Proton service resource.
--
-- /See:/ 'newServiceSummary' smart constructor.
data ServiceSummary = ServiceSummary'
  { -- | A description of the service.
    ServiceSummary -> Maybe (Sensitive Text)
description :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | A service status message.
    ServiceSummary -> Maybe (Sensitive Text)
statusMessage :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The Amazon Resource Name (ARN) of the service.
    ServiceSummary -> Text
arn :: Prelude.Text,
    -- | The time when the service was created.
    ServiceSummary -> POSIX
createdAt :: Data.POSIX,
    -- | The time when the service was last modified.
    ServiceSummary -> POSIX
lastModifiedAt :: Data.POSIX,
    -- | The name of the service.
    ServiceSummary -> Text
name :: Prelude.Text,
    -- | The status of the service.
    ServiceSummary -> ServiceStatus
status :: ServiceStatus,
    -- | The name of the service template.
    ServiceSummary -> Text
templateName :: Prelude.Text
  }
  deriving (ServiceSummary -> ServiceSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceSummary -> ServiceSummary -> Bool
$c/= :: ServiceSummary -> ServiceSummary -> Bool
== :: ServiceSummary -> ServiceSummary -> Bool
$c== :: ServiceSummary -> ServiceSummary -> Bool
Prelude.Eq, Int -> ServiceSummary -> ShowS
[ServiceSummary] -> ShowS
ServiceSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceSummary] -> ShowS
$cshowList :: [ServiceSummary] -> ShowS
show :: ServiceSummary -> String
$cshow :: ServiceSummary -> String
showsPrec :: Int -> ServiceSummary -> ShowS
$cshowsPrec :: Int -> ServiceSummary -> ShowS
Prelude.Show, forall x. Rep ServiceSummary x -> ServiceSummary
forall x. ServiceSummary -> Rep ServiceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceSummary x -> ServiceSummary
$cfrom :: forall x. ServiceSummary -> Rep ServiceSummary x
Prelude.Generic)

-- |
-- Create a value of 'ServiceSummary' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'description', 'serviceSummary_description' - A description of the service.
--
-- 'statusMessage', 'serviceSummary_statusMessage' - A service status message.
--
-- 'arn', 'serviceSummary_arn' - The Amazon Resource Name (ARN) of the service.
--
-- 'createdAt', 'serviceSummary_createdAt' - The time when the service was created.
--
-- 'lastModifiedAt', 'serviceSummary_lastModifiedAt' - The time when the service was last modified.
--
-- 'name', 'serviceSummary_name' - The name of the service.
--
-- 'status', 'serviceSummary_status' - The status of the service.
--
-- 'templateName', 'serviceSummary_templateName' - The name of the service template.
newServiceSummary ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'lastModifiedAt'
  Prelude.UTCTime ->
  -- | 'name'
  Prelude.Text ->
  -- | 'status'
  ServiceStatus ->
  -- | 'templateName'
  Prelude.Text ->
  ServiceSummary
newServiceSummary :: Text
-> UTCTime
-> UTCTime
-> Text
-> ServiceStatus
-> Text
-> ServiceSummary
newServiceSummary
  Text
pArn_
  UTCTime
pCreatedAt_
  UTCTime
pLastModifiedAt_
  Text
pName_
  ServiceStatus
pStatus_
  Text
pTemplateName_ =
    ServiceSummary'
      { $sel:description:ServiceSummary' :: Maybe (Sensitive Text)
description = forall a. Maybe a
Prelude.Nothing,
        $sel:statusMessage:ServiceSummary' :: Maybe (Sensitive Text)
statusMessage = forall a. Maybe a
Prelude.Nothing,
        $sel:arn:ServiceSummary' :: Text
arn = Text
pArn_,
        $sel:createdAt:ServiceSummary' :: POSIX
createdAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
        $sel:lastModifiedAt:ServiceSummary' :: POSIX
lastModifiedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pLastModifiedAt_,
        $sel:name:ServiceSummary' :: Text
name = Text
pName_,
        $sel:status:ServiceSummary' :: ServiceStatus
status = ServiceStatus
pStatus_,
        $sel:templateName:ServiceSummary' :: Text
templateName = Text
pTemplateName_
      }

-- | A description of the service.
serviceSummary_description :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_description :: Lens' ServiceSummary (Maybe Text)
serviceSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:description:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
description} -> Maybe (Sensitive Text)
description) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe (Sensitive Text)
a -> ServiceSummary
s {$sel:description:ServiceSummary' :: Maybe (Sensitive Text)
description = Maybe (Sensitive Text)
a} :: ServiceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | A service status message.
serviceSummary_statusMessage :: Lens.Lens' ServiceSummary (Prelude.Maybe Prelude.Text)
serviceSummary_statusMessage :: Lens' ServiceSummary (Maybe Text)
serviceSummary_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {Maybe (Sensitive Text)
statusMessage :: Maybe (Sensitive Text)
$sel:statusMessage:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
statusMessage} -> Maybe (Sensitive Text)
statusMessage) (\s :: ServiceSummary
s@ServiceSummary' {} Maybe (Sensitive Text)
a -> ServiceSummary
s {$sel:statusMessage:ServiceSummary' :: Maybe (Sensitive Text)
statusMessage = Maybe (Sensitive Text)
a} :: ServiceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

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

-- | The time when the service was created.
serviceSummary_createdAt :: Lens.Lens' ServiceSummary Prelude.UTCTime
serviceSummary_createdAt :: Lens' ServiceSummary UTCTime
serviceSummary_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {POSIX
createdAt :: POSIX
$sel:createdAt:ServiceSummary' :: ServiceSummary -> POSIX
createdAt} -> POSIX
createdAt) (\s :: ServiceSummary
s@ServiceSummary' {} POSIX
a -> ServiceSummary
s {$sel:createdAt:ServiceSummary' :: POSIX
createdAt = POSIX
a} :: ServiceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The time when the service was last modified.
serviceSummary_lastModifiedAt :: Lens.Lens' ServiceSummary Prelude.UTCTime
serviceSummary_lastModifiedAt :: Lens' ServiceSummary UTCTime
serviceSummary_lastModifiedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {POSIX
lastModifiedAt :: POSIX
$sel:lastModifiedAt:ServiceSummary' :: ServiceSummary -> POSIX
lastModifiedAt} -> POSIX
lastModifiedAt) (\s :: ServiceSummary
s@ServiceSummary' {} POSIX
a -> ServiceSummary
s {$sel:lastModifiedAt:ServiceSummary' :: POSIX
lastModifiedAt = POSIX
a} :: ServiceSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

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

-- | The status of the service.
serviceSummary_status :: Lens.Lens' ServiceSummary ServiceStatus
serviceSummary_status :: Lens' ServiceSummary ServiceStatus
serviceSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceSummary' {ServiceStatus
status :: ServiceStatus
$sel:status:ServiceSummary' :: ServiceSummary -> ServiceStatus
status} -> ServiceStatus
status) (\s :: ServiceSummary
s@ServiceSummary' {} ServiceStatus
a -> ServiceSummary
s {$sel:status:ServiceSummary' :: ServiceStatus
status = ServiceStatus
a} :: ServiceSummary)

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

instance Data.FromJSON ServiceSummary where
  parseJSON :: Value -> Parser ServiceSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ServiceSummary"
      ( \Object
x ->
          Maybe (Sensitive Text)
-> Maybe (Sensitive Text)
-> Text
-> POSIX
-> POSIX
-> Text
-> ServiceStatus
-> Text
-> ServiceSummary
ServiceSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"statusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"createdAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"lastModifiedAt")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"templateName")
      )

instance Prelude.Hashable ServiceSummary where
  hashWithSalt :: Int -> ServiceSummary -> Int
hashWithSalt Int
_salt ServiceSummary' {Maybe (Sensitive Text)
Text
POSIX
ServiceStatus
templateName :: Text
status :: ServiceStatus
name :: Text
lastModifiedAt :: POSIX
createdAt :: POSIX
arn :: Text
statusMessage :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:templateName:ServiceSummary' :: ServiceSummary -> Text
$sel:status:ServiceSummary' :: ServiceSummary -> ServiceStatus
$sel:name:ServiceSummary' :: ServiceSummary -> Text
$sel:lastModifiedAt:ServiceSummary' :: ServiceSummary -> POSIX
$sel:createdAt:ServiceSummary' :: ServiceSummary -> POSIX
$sel:arn:ServiceSummary' :: ServiceSummary -> Text
$sel:statusMessage:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
$sel:description:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
statusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
createdAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
lastModifiedAt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ServiceStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateName

instance Prelude.NFData ServiceSummary where
  rnf :: ServiceSummary -> ()
rnf ServiceSummary' {Maybe (Sensitive Text)
Text
POSIX
ServiceStatus
templateName :: Text
status :: ServiceStatus
name :: Text
lastModifiedAt :: POSIX
createdAt :: POSIX
arn :: Text
statusMessage :: Maybe (Sensitive Text)
description :: Maybe (Sensitive Text)
$sel:templateName:ServiceSummary' :: ServiceSummary -> Text
$sel:status:ServiceSummary' :: ServiceSummary -> ServiceStatus
$sel:name:ServiceSummary' :: ServiceSummary -> Text
$sel:lastModifiedAt:ServiceSummary' :: ServiceSummary -> POSIX
$sel:createdAt:ServiceSummary' :: ServiceSummary -> POSIX
$sel:arn:ServiceSummary' :: ServiceSummary -> Text
$sel:statusMessage:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
$sel:description:ServiceSummary' :: ServiceSummary -> Maybe (Sensitive Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
createdAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
lastModifiedAt
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ServiceStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateName