{-# 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.AMP.Types.WorkspaceSummary
-- 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.AMP.Types.WorkspaceSummary where

import Amazonka.AMP.Types.WorkspaceStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents a summary of the properties of a workspace.
--
-- /See:/ 'newWorkspaceSummary' smart constructor.
data WorkspaceSummary = WorkspaceSummary'
  { -- | Alias of this workspace.
    WorkspaceSummary -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
    -- | The tags of this workspace.
    WorkspaceSummary -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The AmazonResourceName of this workspace.
    WorkspaceSummary -> Text
arn :: Prelude.Text,
    -- | The time when the workspace was created.
    WorkspaceSummary -> POSIX
createdAt :: Core.POSIX,
    -- | The status of this workspace.
    WorkspaceSummary -> WorkspaceStatus
status :: WorkspaceStatus,
    -- | Unique string identifying this workspace.
    WorkspaceSummary -> Text
workspaceId :: Prelude.Text
  }
  deriving (WorkspaceSummary -> WorkspaceSummary -> Bool
(WorkspaceSummary -> WorkspaceSummary -> Bool)
-> (WorkspaceSummary -> WorkspaceSummary -> Bool)
-> Eq WorkspaceSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkspaceSummary -> WorkspaceSummary -> Bool
$c/= :: WorkspaceSummary -> WorkspaceSummary -> Bool
== :: WorkspaceSummary -> WorkspaceSummary -> Bool
$c== :: WorkspaceSummary -> WorkspaceSummary -> Bool
Prelude.Eq, ReadPrec [WorkspaceSummary]
ReadPrec WorkspaceSummary
Int -> ReadS WorkspaceSummary
ReadS [WorkspaceSummary]
(Int -> ReadS WorkspaceSummary)
-> ReadS [WorkspaceSummary]
-> ReadPrec WorkspaceSummary
-> ReadPrec [WorkspaceSummary]
-> Read WorkspaceSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkspaceSummary]
$creadListPrec :: ReadPrec [WorkspaceSummary]
readPrec :: ReadPrec WorkspaceSummary
$creadPrec :: ReadPrec WorkspaceSummary
readList :: ReadS [WorkspaceSummary]
$creadList :: ReadS [WorkspaceSummary]
readsPrec :: Int -> ReadS WorkspaceSummary
$creadsPrec :: Int -> ReadS WorkspaceSummary
Prelude.Read, Int -> WorkspaceSummary -> ShowS
[WorkspaceSummary] -> ShowS
WorkspaceSummary -> String
(Int -> WorkspaceSummary -> ShowS)
-> (WorkspaceSummary -> String)
-> ([WorkspaceSummary] -> ShowS)
-> Show WorkspaceSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkspaceSummary] -> ShowS
$cshowList :: [WorkspaceSummary] -> ShowS
show :: WorkspaceSummary -> String
$cshow :: WorkspaceSummary -> String
showsPrec :: Int -> WorkspaceSummary -> ShowS
$cshowsPrec :: Int -> WorkspaceSummary -> ShowS
Prelude.Show, (forall x. WorkspaceSummary -> Rep WorkspaceSummary x)
-> (forall x. Rep WorkspaceSummary x -> WorkspaceSummary)
-> Generic WorkspaceSummary
forall x. Rep WorkspaceSummary x -> WorkspaceSummary
forall x. WorkspaceSummary -> Rep WorkspaceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkspaceSummary x -> WorkspaceSummary
$cfrom :: forall x. WorkspaceSummary -> Rep WorkspaceSummary x
Prelude.Generic)

-- |
-- Create a value of 'WorkspaceSummary' 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:
--
-- 'alias', 'workspaceSummary_alias' - Alias of this workspace.
--
-- 'tags', 'workspaceSummary_tags' - The tags of this workspace.
--
-- 'arn', 'workspaceSummary_arn' - The AmazonResourceName of this workspace.
--
-- 'createdAt', 'workspaceSummary_createdAt' - The time when the workspace was created.
--
-- 'status', 'workspaceSummary_status' - The status of this workspace.
--
-- 'workspaceId', 'workspaceSummary_workspaceId' - Unique string identifying this workspace.
newWorkspaceSummary ::
  -- | 'arn'
  Prelude.Text ->
  -- | 'createdAt'
  Prelude.UTCTime ->
  -- | 'status'
  WorkspaceStatus ->
  -- | 'workspaceId'
  Prelude.Text ->
  WorkspaceSummary
newWorkspaceSummary :: Text -> UTCTime -> WorkspaceStatus -> Text -> WorkspaceSummary
newWorkspaceSummary
  Text
pArn_
  UTCTime
pCreatedAt_
  WorkspaceStatus
pStatus_
  Text
pWorkspaceId_ =
    WorkspaceSummary' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> POSIX
-> WorkspaceStatus
-> Text
-> WorkspaceSummary
WorkspaceSummary'
      { $sel:alias:WorkspaceSummary' :: Maybe Text
alias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:WorkspaceSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:arn:WorkspaceSummary' :: Text
arn = Text
pArn_,
        $sel:createdAt:WorkspaceSummary' :: 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:status:WorkspaceSummary' :: WorkspaceStatus
status = WorkspaceStatus
pStatus_,
        $sel:workspaceId:WorkspaceSummary' :: Text
workspaceId = Text
pWorkspaceId_
      }

-- | Alias of this workspace.
workspaceSummary_alias :: Lens.Lens' WorkspaceSummary (Prelude.Maybe Prelude.Text)
workspaceSummary_alias :: (Maybe Text -> f (Maybe Text))
-> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_alias = (WorkspaceSummary -> Maybe Text)
-> (WorkspaceSummary -> Maybe Text -> WorkspaceSummary)
-> Lens WorkspaceSummary WorkspaceSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {Maybe Text
alias :: Maybe Text
$sel:alias:WorkspaceSummary' :: WorkspaceSummary -> Maybe Text
alias} -> Maybe Text
alias) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} Maybe Text
a -> WorkspaceSummary
s {$sel:alias:WorkspaceSummary' :: Maybe Text
alias = Maybe Text
a} :: WorkspaceSummary)

-- | The tags of this workspace.
workspaceSummary_tags :: Lens.Lens' WorkspaceSummary (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
workspaceSummary_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_tags = (WorkspaceSummary -> Maybe (HashMap Text Text))
-> (WorkspaceSummary
    -> Maybe (HashMap Text Text) -> WorkspaceSummary)
-> Lens
     WorkspaceSummary
     WorkspaceSummary
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:WorkspaceSummary' :: WorkspaceSummary -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} Maybe (HashMap Text Text)
a -> WorkspaceSummary
s {$sel:tags:WorkspaceSummary' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: WorkspaceSummary) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> WorkspaceSummary -> f WorkspaceSummary)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> WorkspaceSummary
-> f WorkspaceSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The AmazonResourceName of this workspace.
workspaceSummary_arn :: Lens.Lens' WorkspaceSummary Prelude.Text
workspaceSummary_arn :: (Text -> f Text) -> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_arn = (WorkspaceSummary -> Text)
-> (WorkspaceSummary -> Text -> WorkspaceSummary)
-> Lens WorkspaceSummary WorkspaceSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {Text
arn :: Text
$sel:arn:WorkspaceSummary' :: WorkspaceSummary -> Text
arn} -> Text
arn) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} Text
a -> WorkspaceSummary
s {$sel:arn:WorkspaceSummary' :: Text
arn = Text
a} :: WorkspaceSummary)

-- | The time when the workspace was created.
workspaceSummary_createdAt :: Lens.Lens' WorkspaceSummary Prelude.UTCTime
workspaceSummary_createdAt :: (UTCTime -> f UTCTime) -> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_createdAt = (WorkspaceSummary -> POSIX)
-> (WorkspaceSummary -> POSIX -> WorkspaceSummary)
-> Lens WorkspaceSummary WorkspaceSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {POSIX
createdAt :: POSIX
$sel:createdAt:WorkspaceSummary' :: WorkspaceSummary -> POSIX
createdAt} -> POSIX
createdAt) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} POSIX
a -> WorkspaceSummary
s {$sel:createdAt:WorkspaceSummary' :: POSIX
createdAt = POSIX
a} :: WorkspaceSummary) ((POSIX -> f POSIX) -> WorkspaceSummary -> f WorkspaceSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> WorkspaceSummary
-> f WorkspaceSummary
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 status of this workspace.
workspaceSummary_status :: Lens.Lens' WorkspaceSummary WorkspaceStatus
workspaceSummary_status :: (WorkspaceStatus -> f WorkspaceStatus)
-> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_status = (WorkspaceSummary -> WorkspaceStatus)
-> (WorkspaceSummary -> WorkspaceStatus -> WorkspaceSummary)
-> Lens
     WorkspaceSummary WorkspaceSummary WorkspaceStatus WorkspaceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {WorkspaceStatus
status :: WorkspaceStatus
$sel:status:WorkspaceSummary' :: WorkspaceSummary -> WorkspaceStatus
status} -> WorkspaceStatus
status) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} WorkspaceStatus
a -> WorkspaceSummary
s {$sel:status:WorkspaceSummary' :: WorkspaceStatus
status = WorkspaceStatus
a} :: WorkspaceSummary)

-- | Unique string identifying this workspace.
workspaceSummary_workspaceId :: Lens.Lens' WorkspaceSummary Prelude.Text
workspaceSummary_workspaceId :: (Text -> f Text) -> WorkspaceSummary -> f WorkspaceSummary
workspaceSummary_workspaceId = (WorkspaceSummary -> Text)
-> (WorkspaceSummary -> Text -> WorkspaceSummary)
-> Lens WorkspaceSummary WorkspaceSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkspaceSummary' {Text
workspaceId :: Text
$sel:workspaceId:WorkspaceSummary' :: WorkspaceSummary -> Text
workspaceId} -> Text
workspaceId) (\s :: WorkspaceSummary
s@WorkspaceSummary' {} Text
a -> WorkspaceSummary
s {$sel:workspaceId:WorkspaceSummary' :: Text
workspaceId = Text
a} :: WorkspaceSummary)

instance Core.FromJSON WorkspaceSummary where
  parseJSON :: Value -> Parser WorkspaceSummary
parseJSON =
    String
-> (Object -> Parser WorkspaceSummary)
-> Value
-> Parser WorkspaceSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"WorkspaceSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> POSIX
-> WorkspaceStatus
-> Text
-> WorkspaceSummary
WorkspaceSummary'
            (Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> POSIX
 -> WorkspaceStatus
 -> Text
 -> WorkspaceSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> POSIX -> WorkspaceStatus -> Text -> WorkspaceSummary)
forall (f :: * -> *) a b. Functor 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
"alias")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> POSIX -> WorkspaceStatus -> Text -> WorkspaceSummary)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Text -> POSIX -> WorkspaceStatus -> Text -> WorkspaceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Text -> POSIX -> WorkspaceStatus -> Text -> WorkspaceSummary)
-> Parser Text
-> Parser (POSIX -> WorkspaceStatus -> Text -> WorkspaceSummary)
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 -> WorkspaceStatus -> Text -> WorkspaceSummary)
-> Parser POSIX
-> Parser (WorkspaceStatus -> Text -> WorkspaceSummary)
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 (WorkspaceStatus -> Text -> WorkspaceSummary)
-> Parser WorkspaceStatus -> Parser (Text -> WorkspaceSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser WorkspaceStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
            Parser (Text -> WorkspaceSummary)
-> Parser Text -> Parser WorkspaceSummary
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
"workspaceId")
      )

instance Prelude.Hashable WorkspaceSummary

instance Prelude.NFData WorkspaceSummary