{-# 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.WorkSpaces.Types.Workspace
-- 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.WorkSpaces.Types.Workspace where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.ModificationState
import Amazonka.WorkSpaces.Types.WorkspaceProperties
import Amazonka.WorkSpaces.Types.WorkspaceState

-- | Describes a WorkSpace.
--
-- /See:/ 'newWorkspace' smart constructor.
data Workspace = Workspace'
  { -- | The identifier of the Directory Service directory for the WorkSpace.
    Workspace -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The operational state of the WorkSpace.
    --
    -- After a WorkSpace is terminated, the @TERMINATED@ state is returned only
    -- briefly before the WorkSpace directory metadata is cleaned up, so this
    -- state is rarely returned. To confirm that a WorkSpace is terminated,
    -- check for the WorkSpace ID by using
    -- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaces.html DescribeWorkSpaces>.
    -- If the WorkSpace ID isn\'t returned, then the WorkSpace has been
    -- successfully terminated.
    Workspace -> Maybe WorkspaceState
state :: Prelude.Maybe WorkspaceState,
    -- | The IP address of the WorkSpace.
    Workspace -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | The modification states of the WorkSpace.
    Workspace -> Maybe [ModificationState]
modificationStates :: Prelude.Maybe [ModificationState],
    -- | The user for the WorkSpace.
    Workspace -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the subnet for the WorkSpace.
    Workspace -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the bundle used to create the WorkSpace.
    Workspace -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
    -- | The properties of the WorkSpace.
    Workspace -> Maybe WorkspaceProperties
workspaceProperties :: Prelude.Maybe WorkspaceProperties,
    -- | Indicates whether the data stored on the root volume is encrypted.
    Workspace -> Maybe Bool
rootVolumeEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The error code that is returned if the WorkSpace cannot be created.
    Workspace -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The symmetric KMS key used to encrypt data stored on your WorkSpace.
    -- Amazon WorkSpaces does not support asymmetric KMS keys.
    Workspace -> Maybe Text
volumeEncryptionKey :: Prelude.Maybe Prelude.Text,
    -- | The name of the WorkSpace, as seen by the operating system. The format
    -- of this name varies. For more information, see
    -- <https://docs.aws.amazon.com/workspaces/latest/adminguide/launch-workspaces-tutorials.html Launch a WorkSpace>.
    Workspace -> Maybe Text
computerName :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the WorkSpace.
    Workspace -> Maybe Text
workspaceId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the data stored on the user volume is encrypted.
    Workspace -> Maybe Bool
userVolumeEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | The text of the error message that is returned if the WorkSpace cannot
    -- be created.
    Workspace -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (Workspace -> Workspace -> Bool
(Workspace -> Workspace -> Bool)
-> (Workspace -> Workspace -> Bool) -> Eq Workspace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Workspace -> Workspace -> Bool
$c/= :: Workspace -> Workspace -> Bool
== :: Workspace -> Workspace -> Bool
$c== :: Workspace -> Workspace -> Bool
Prelude.Eq, ReadPrec [Workspace]
ReadPrec Workspace
Int -> ReadS Workspace
ReadS [Workspace]
(Int -> ReadS Workspace)
-> ReadS [Workspace]
-> ReadPrec Workspace
-> ReadPrec [Workspace]
-> Read Workspace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Workspace]
$creadListPrec :: ReadPrec [Workspace]
readPrec :: ReadPrec Workspace
$creadPrec :: ReadPrec Workspace
readList :: ReadS [Workspace]
$creadList :: ReadS [Workspace]
readsPrec :: Int -> ReadS Workspace
$creadsPrec :: Int -> ReadS Workspace
Prelude.Read, Int -> Workspace -> ShowS
[Workspace] -> ShowS
Workspace -> String
(Int -> Workspace -> ShowS)
-> (Workspace -> String)
-> ([Workspace] -> ShowS)
-> Show Workspace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Workspace] -> ShowS
$cshowList :: [Workspace] -> ShowS
show :: Workspace -> String
$cshow :: Workspace -> String
showsPrec :: Int -> Workspace -> ShowS
$cshowsPrec :: Int -> Workspace -> ShowS
Prelude.Show, (forall x. Workspace -> Rep Workspace x)
-> (forall x. Rep Workspace x -> Workspace) -> Generic Workspace
forall x. Rep Workspace x -> Workspace
forall x. Workspace -> Rep Workspace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Workspace x -> Workspace
$cfrom :: forall x. Workspace -> Rep Workspace x
Prelude.Generic)

-- |
-- Create a value of 'Workspace' 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:
--
-- 'directoryId', 'workspace_directoryId' - The identifier of the Directory Service directory for the WorkSpace.
--
-- 'state', 'workspace_state' - The operational state of the WorkSpace.
--
-- After a WorkSpace is terminated, the @TERMINATED@ state is returned only
-- briefly before the WorkSpace directory metadata is cleaned up, so this
-- state is rarely returned. To confirm that a WorkSpace is terminated,
-- check for the WorkSpace ID by using
-- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaces.html DescribeWorkSpaces>.
-- If the WorkSpace ID isn\'t returned, then the WorkSpace has been
-- successfully terminated.
--
-- 'ipAddress', 'workspace_ipAddress' - The IP address of the WorkSpace.
--
-- 'modificationStates', 'workspace_modificationStates' - The modification states of the WorkSpace.
--
-- 'userName', 'workspace_userName' - The user for the WorkSpace.
--
-- 'subnetId', 'workspace_subnetId' - The identifier of the subnet for the WorkSpace.
--
-- 'bundleId', 'workspace_bundleId' - The identifier of the bundle used to create the WorkSpace.
--
-- 'workspaceProperties', 'workspace_workspaceProperties' - The properties of the WorkSpace.
--
-- 'rootVolumeEncryptionEnabled', 'workspace_rootVolumeEncryptionEnabled' - Indicates whether the data stored on the root volume is encrypted.
--
-- 'errorCode', 'workspace_errorCode' - The error code that is returned if the WorkSpace cannot be created.
--
-- 'volumeEncryptionKey', 'workspace_volumeEncryptionKey' - The symmetric KMS key used to encrypt data stored on your WorkSpace.
-- Amazon WorkSpaces does not support asymmetric KMS keys.
--
-- 'computerName', 'workspace_computerName' - The name of the WorkSpace, as seen by the operating system. The format
-- of this name varies. For more information, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/launch-workspaces-tutorials.html Launch a WorkSpace>.
--
-- 'workspaceId', 'workspace_workspaceId' - The identifier of the WorkSpace.
--
-- 'userVolumeEncryptionEnabled', 'workspace_userVolumeEncryptionEnabled' - Indicates whether the data stored on the user volume is encrypted.
--
-- 'errorMessage', 'workspace_errorMessage' - The text of the error message that is returned if the WorkSpace cannot
-- be created.
newWorkspace ::
  Workspace
newWorkspace :: Workspace
newWorkspace =
  Workspace' :: Maybe Text
-> Maybe WorkspaceState
-> Maybe Text
-> Maybe [ModificationState]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkspaceProperties
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Workspace
Workspace'
    { $sel:directoryId:Workspace' :: Maybe Text
directoryId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:state:Workspace' :: Maybe WorkspaceState
state = Maybe WorkspaceState
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:Workspace' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:modificationStates:Workspace' :: Maybe [ModificationState]
modificationStates = Maybe [ModificationState]
forall a. Maybe a
Prelude.Nothing,
      $sel:userName:Workspace' :: Maybe Text
userName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:Workspace' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bundleId:Workspace' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceProperties:Workspace' :: Maybe WorkspaceProperties
workspaceProperties = Maybe WorkspaceProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:rootVolumeEncryptionEnabled:Workspace' :: Maybe Bool
rootVolumeEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:Workspace' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:volumeEncryptionKey:Workspace' :: Maybe Text
volumeEncryptionKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:computerName:Workspace' :: Maybe Text
computerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceId:Workspace' :: Maybe Text
workspaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userVolumeEncryptionEnabled:Workspace' :: Maybe Bool
userVolumeEncryptionEnabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:Workspace' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the Directory Service directory for the WorkSpace.
workspace_directoryId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_directoryId :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_directoryId = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
directoryId :: Maybe Text
$sel:directoryId:Workspace' :: Workspace -> Maybe Text
directoryId} -> Maybe Text
directoryId) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:directoryId:Workspace' :: Maybe Text
directoryId = Maybe Text
a} :: Workspace)

-- | The operational state of the WorkSpace.
--
-- After a WorkSpace is terminated, the @TERMINATED@ state is returned only
-- briefly before the WorkSpace directory metadata is cleaned up, so this
-- state is rarely returned. To confirm that a WorkSpace is terminated,
-- check for the WorkSpace ID by using
-- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaces.html DescribeWorkSpaces>.
-- If the WorkSpace ID isn\'t returned, then the WorkSpace has been
-- successfully terminated.
workspace_state :: Lens.Lens' Workspace (Prelude.Maybe WorkspaceState)
workspace_state :: (Maybe WorkspaceState -> f (Maybe WorkspaceState))
-> Workspace -> f Workspace
workspace_state = (Workspace -> Maybe WorkspaceState)
-> (Workspace -> Maybe WorkspaceState -> Workspace)
-> Lens
     Workspace Workspace (Maybe WorkspaceState) (Maybe WorkspaceState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe WorkspaceState
state :: Maybe WorkspaceState
$sel:state:Workspace' :: Workspace -> Maybe WorkspaceState
state} -> Maybe WorkspaceState
state) (\s :: Workspace
s@Workspace' {} Maybe WorkspaceState
a -> Workspace
s {$sel:state:Workspace' :: Maybe WorkspaceState
state = Maybe WorkspaceState
a} :: Workspace)

-- | The IP address of the WorkSpace.
workspace_ipAddress :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_ipAddress :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_ipAddress = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:Workspace' :: Workspace -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:ipAddress:Workspace' :: Maybe Text
ipAddress = Maybe Text
a} :: Workspace)

-- | The modification states of the WorkSpace.
workspace_modificationStates :: Lens.Lens' Workspace (Prelude.Maybe [ModificationState])
workspace_modificationStates :: (Maybe [ModificationState] -> f (Maybe [ModificationState]))
-> Workspace -> f Workspace
workspace_modificationStates = (Workspace -> Maybe [ModificationState])
-> (Workspace -> Maybe [ModificationState] -> Workspace)
-> Lens
     Workspace
     Workspace
     (Maybe [ModificationState])
     (Maybe [ModificationState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe [ModificationState]
modificationStates :: Maybe [ModificationState]
$sel:modificationStates:Workspace' :: Workspace -> Maybe [ModificationState]
modificationStates} -> Maybe [ModificationState]
modificationStates) (\s :: Workspace
s@Workspace' {} Maybe [ModificationState]
a -> Workspace
s {$sel:modificationStates:Workspace' :: Maybe [ModificationState]
modificationStates = Maybe [ModificationState]
a} :: Workspace) ((Maybe [ModificationState] -> f (Maybe [ModificationState]))
 -> Workspace -> f Workspace)
-> ((Maybe [ModificationState] -> f (Maybe [ModificationState]))
    -> Maybe [ModificationState] -> f (Maybe [ModificationState]))
-> (Maybe [ModificationState] -> f (Maybe [ModificationState]))
-> Workspace
-> f Workspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ModificationState]
  [ModificationState]
  [ModificationState]
  [ModificationState]
-> Iso
     (Maybe [ModificationState])
     (Maybe [ModificationState])
     (Maybe [ModificationState])
     (Maybe [ModificationState])
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
  [ModificationState]
  [ModificationState]
  [ModificationState]
  [ModificationState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The user for the WorkSpace.
workspace_userName :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_userName :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_userName = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
userName :: Maybe Text
$sel:userName:Workspace' :: Workspace -> Maybe Text
userName} -> Maybe Text
userName) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:userName:Workspace' :: Maybe Text
userName = Maybe Text
a} :: Workspace)

-- | The identifier of the subnet for the WorkSpace.
workspace_subnetId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_subnetId :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_subnetId = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:Workspace' :: Workspace -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:subnetId:Workspace' :: Maybe Text
subnetId = Maybe Text
a} :: Workspace)

-- | The identifier of the bundle used to create the WorkSpace.
workspace_bundleId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_bundleId :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_bundleId = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:Workspace' :: Workspace -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:bundleId:Workspace' :: Maybe Text
bundleId = Maybe Text
a} :: Workspace)

-- | The properties of the WorkSpace.
workspace_workspaceProperties :: Lens.Lens' Workspace (Prelude.Maybe WorkspaceProperties)
workspace_workspaceProperties :: (Maybe WorkspaceProperties -> f (Maybe WorkspaceProperties))
-> Workspace -> f Workspace
workspace_workspaceProperties = (Workspace -> Maybe WorkspaceProperties)
-> (Workspace -> Maybe WorkspaceProperties -> Workspace)
-> Lens
     Workspace
     Workspace
     (Maybe WorkspaceProperties)
     (Maybe WorkspaceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe WorkspaceProperties
workspaceProperties :: Maybe WorkspaceProperties
$sel:workspaceProperties:Workspace' :: Workspace -> Maybe WorkspaceProperties
workspaceProperties} -> Maybe WorkspaceProperties
workspaceProperties) (\s :: Workspace
s@Workspace' {} Maybe WorkspaceProperties
a -> Workspace
s {$sel:workspaceProperties:Workspace' :: Maybe WorkspaceProperties
workspaceProperties = Maybe WorkspaceProperties
a} :: Workspace)

-- | Indicates whether the data stored on the root volume is encrypted.
workspace_rootVolumeEncryptionEnabled :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Bool)
workspace_rootVolumeEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Workspace -> f Workspace
workspace_rootVolumeEncryptionEnabled = (Workspace -> Maybe Bool)
-> (Workspace -> Maybe Bool -> Workspace)
-> Lens Workspace Workspace (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Bool
rootVolumeEncryptionEnabled :: Maybe Bool
$sel:rootVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
rootVolumeEncryptionEnabled} -> Maybe Bool
rootVolumeEncryptionEnabled) (\s :: Workspace
s@Workspace' {} Maybe Bool
a -> Workspace
s {$sel:rootVolumeEncryptionEnabled:Workspace' :: Maybe Bool
rootVolumeEncryptionEnabled = Maybe Bool
a} :: Workspace)

-- | The error code that is returned if the WorkSpace cannot be created.
workspace_errorCode :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_errorCode :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_errorCode = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:Workspace' :: Workspace -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:errorCode:Workspace' :: Maybe Text
errorCode = Maybe Text
a} :: Workspace)

-- | The symmetric KMS key used to encrypt data stored on your WorkSpace.
-- Amazon WorkSpaces does not support asymmetric KMS keys.
workspace_volumeEncryptionKey :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_volumeEncryptionKey :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_volumeEncryptionKey = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
volumeEncryptionKey :: Maybe Text
$sel:volumeEncryptionKey:Workspace' :: Workspace -> Maybe Text
volumeEncryptionKey} -> Maybe Text
volumeEncryptionKey) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:volumeEncryptionKey:Workspace' :: Maybe Text
volumeEncryptionKey = Maybe Text
a} :: Workspace)

-- | The name of the WorkSpace, as seen by the operating system. The format
-- of this name varies. For more information, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/launch-workspaces-tutorials.html Launch a WorkSpace>.
workspace_computerName :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_computerName :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_computerName = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
computerName :: Maybe Text
$sel:computerName:Workspace' :: Workspace -> Maybe Text
computerName} -> Maybe Text
computerName) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:computerName:Workspace' :: Maybe Text
computerName = Maybe Text
a} :: Workspace)

-- | The identifier of the WorkSpace.
workspace_workspaceId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_workspaceId :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_workspaceId = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
workspaceId :: Maybe Text
$sel:workspaceId:Workspace' :: Workspace -> Maybe Text
workspaceId} -> Maybe Text
workspaceId) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:workspaceId:Workspace' :: Maybe Text
workspaceId = Maybe Text
a} :: Workspace)

-- | Indicates whether the data stored on the user volume is encrypted.
workspace_userVolumeEncryptionEnabled :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Bool)
workspace_userVolumeEncryptionEnabled :: (Maybe Bool -> f (Maybe Bool)) -> Workspace -> f Workspace
workspace_userVolumeEncryptionEnabled = (Workspace -> Maybe Bool)
-> (Workspace -> Maybe Bool -> Workspace)
-> Lens Workspace Workspace (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Bool
userVolumeEncryptionEnabled :: Maybe Bool
$sel:userVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
userVolumeEncryptionEnabled} -> Maybe Bool
userVolumeEncryptionEnabled) (\s :: Workspace
s@Workspace' {} Maybe Bool
a -> Workspace
s {$sel:userVolumeEncryptionEnabled:Workspace' :: Maybe Bool
userVolumeEncryptionEnabled = Maybe Bool
a} :: Workspace)

-- | The text of the error message that is returned if the WorkSpace cannot
-- be created.
workspace_errorMessage :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_errorMessage :: (Maybe Text -> f (Maybe Text)) -> Workspace -> f Workspace
workspace_errorMessage = (Workspace -> Maybe Text)
-> (Workspace -> Maybe Text -> Workspace)
-> Lens Workspace Workspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:Workspace' :: Workspace -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: Workspace
s@Workspace' {} Maybe Text
a -> Workspace
s {$sel:errorMessage:Workspace' :: Maybe Text
errorMessage = Maybe Text
a} :: Workspace)

instance Core.FromJSON Workspace where
  parseJSON :: Value -> Parser Workspace
parseJSON =
    String -> (Object -> Parser Workspace) -> Value -> Parser Workspace
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Workspace"
      ( \Object
x ->
          Maybe Text
-> Maybe WorkspaceState
-> Maybe Text
-> Maybe [ModificationState]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe WorkspaceProperties
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Workspace
Workspace'
            (Maybe Text
 -> Maybe WorkspaceState
 -> Maybe Text
 -> Maybe [ModificationState]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe WorkspaceProperties
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe WorkspaceState
      -> Maybe Text
      -> Maybe [ModificationState]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
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
"DirectoryId")
            Parser
  (Maybe WorkspaceState
   -> Maybe Text
   -> Maybe [ModificationState]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe WorkspaceState)
-> Parser
     (Maybe Text
      -> Maybe [ModificationState]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkspaceState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe [ModificationState]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ModificationState]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpAddress")
            Parser
  (Maybe [ModificationState]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe [ModificationState])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ModificationState]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ModificationStates"
                            Parser (Maybe (Maybe [ModificationState]))
-> Maybe [ModificationState] -> Parser (Maybe [ModificationState])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ModificationState]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetId")
            Parser
  (Maybe Text
   -> Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe WorkspaceProperties
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BundleId")
            Parser
  (Maybe WorkspaceProperties
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe WorkspaceProperties)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe WorkspaceProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkspaceProperties")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RootVolumeEncryptionEnabled")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorCode")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Workspace)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Text -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VolumeEncryptionKey")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Bool -> Maybe Text -> Workspace)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> Maybe Text -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ComputerName")
            Parser (Maybe Text -> Maybe Bool -> Maybe Text -> Workspace)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Text -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"WorkspaceId")
            Parser (Maybe Bool -> Maybe Text -> Workspace)
-> Parser (Maybe Bool) -> Parser (Maybe Text -> Workspace)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UserVolumeEncryptionEnabled")
            Parser (Maybe Text -> Workspace)
-> Parser (Maybe Text) -> Parser Workspace
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorMessage")
      )

instance Prelude.Hashable Workspace

instance Prelude.NFData Workspace