{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.WorkSpaces.Types.Workspace 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.WorkSpaces.Types.ModificationState
import Amazonka.WorkSpaces.Types.RelatedWorkspaceProperties
import Amazonka.WorkSpaces.Types.WorkspaceProperties
import Amazonka.WorkSpaces.Types.WorkspaceState

-- | Describes a WorkSpace.
--
-- /See:/ 'newWorkspace' smart constructor.
data Workspace = Workspace'
  { -- | The identifier of the bundle used to create the WorkSpace.
    Workspace -> Maybe Text
bundleId :: 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 Directory Service directory for the WorkSpace.
    Workspace -> Maybe Text
directoryId :: Prelude.Maybe Prelude.Text,
    -- | The error code that is returned if the WorkSpace cannot be created.
    Workspace -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The text of the error message that is returned if the WorkSpace cannot
    -- be created.
    Workspace -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | 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 Standby WorkSpace or Primary WorkSpace related to the specified
    -- WorkSpace.
    Workspace -> Maybe [RelatedWorkspaceProperties]
relatedWorkspaces :: Prelude.Maybe [RelatedWorkspaceProperties],
    -- | Indicates whether the data stored on the root volume is encrypted.
    Workspace -> Maybe Bool
rootVolumeEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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 identifier of the subnet for the WorkSpace.
    Workspace -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
    -- | The user for the WorkSpace.
    Workspace -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the data stored on the user volume is encrypted.
    Workspace -> Maybe Bool
userVolumeEncryptionEnabled :: Prelude.Maybe Prelude.Bool,
    -- | 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 identifier of the WorkSpace.
    Workspace -> Maybe Text
workspaceId :: Prelude.Maybe Prelude.Text,
    -- | The properties of the WorkSpace.
    Workspace -> Maybe WorkspaceProperties
workspaceProperties :: Prelude.Maybe WorkspaceProperties
  }
  deriving (Workspace -> Workspace -> Bool
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]
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
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. 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:
--
-- 'bundleId', 'workspace_bundleId' - The identifier of the bundle used to create the WorkSpace.
--
-- '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>.
--
-- 'directoryId', 'workspace_directoryId' - The identifier of the Directory Service directory for the WorkSpace.
--
-- 'errorCode', 'workspace_errorCode' - The error code that is returned if the WorkSpace cannot be created.
--
-- 'errorMessage', 'workspace_errorMessage' - The text of the error message that is returned if the WorkSpace cannot
-- be created.
--
-- 'ipAddress', 'workspace_ipAddress' - The IP address of the WorkSpace.
--
-- 'modificationStates', 'workspace_modificationStates' - The modification states of the WorkSpace.
--
-- 'relatedWorkspaces', 'workspace_relatedWorkspaces' - The Standby WorkSpace or Primary WorkSpace related to the specified
-- WorkSpace.
--
-- 'rootVolumeEncryptionEnabled', 'workspace_rootVolumeEncryptionEnabled' - Indicates whether the data stored on the root volume is encrypted.
--
-- '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.
--
-- 'subnetId', 'workspace_subnetId' - The identifier of the subnet for the WorkSpace.
--
-- 'userName', 'workspace_userName' - The user for the WorkSpace.
--
-- 'userVolumeEncryptionEnabled', 'workspace_userVolumeEncryptionEnabled' - Indicates whether the data stored on the user volume is encrypted.
--
-- 'volumeEncryptionKey', 'workspace_volumeEncryptionKey' - The symmetric KMS key used to encrypt data stored on your WorkSpace.
-- Amazon WorkSpaces does not support asymmetric KMS keys.
--
-- 'workspaceId', 'workspace_workspaceId' - The identifier of the WorkSpace.
--
-- 'workspaceProperties', 'workspace_workspaceProperties' - The properties of the WorkSpace.
newWorkspace ::
  Workspace
newWorkspace :: Workspace
newWorkspace =
  Workspace'
    { $sel:bundleId:Workspace' :: Maybe Text
bundleId = forall a. Maybe a
Prelude.Nothing,
      $sel:computerName:Workspace' :: Maybe Text
computerName = forall a. Maybe a
Prelude.Nothing,
      $sel:directoryId:Workspace' :: Maybe Text
directoryId = forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:Workspace' :: Maybe Text
errorCode = forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:Workspace' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:Workspace' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:modificationStates:Workspace' :: Maybe [ModificationState]
modificationStates = forall a. Maybe a
Prelude.Nothing,
      $sel:relatedWorkspaces:Workspace' :: Maybe [RelatedWorkspaceProperties]
relatedWorkspaces = forall a. Maybe a
Prelude.Nothing,
      $sel:rootVolumeEncryptionEnabled:Workspace' :: Maybe Bool
rootVolumeEncryptionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:state:Workspace' :: Maybe WorkspaceState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:Workspace' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing,
      $sel:userName:Workspace' :: Maybe Text
userName = forall a. Maybe a
Prelude.Nothing,
      $sel:userVolumeEncryptionEnabled:Workspace' :: Maybe Bool
userVolumeEncryptionEnabled = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeEncryptionKey:Workspace' :: Maybe Text
volumeEncryptionKey = forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceId:Workspace' :: Maybe Text
workspaceId = forall a. Maybe a
Prelude.Nothing,
      $sel:workspaceProperties:Workspace' :: Maybe WorkspaceProperties
workspaceProperties = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the bundle used to create the WorkSpace.
workspace_bundleId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_bundleId :: Lens' Workspace (Maybe Text)
workspace_bundleId = 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 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 :: Lens' Workspace (Maybe Text)
workspace_computerName = 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 Directory Service directory for the WorkSpace.
workspace_directoryId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_directoryId :: Lens' Workspace (Maybe Text)
workspace_directoryId = 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 error code that is returned if the WorkSpace cannot be created.
workspace_errorCode :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_errorCode :: Lens' Workspace (Maybe Text)
workspace_errorCode = 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 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 :: Lens' Workspace (Maybe Text)
workspace_errorMessage = 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)

-- | The IP address of the WorkSpace.
workspace_ipAddress :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_ipAddress :: Lens' Workspace (Maybe Text)
workspace_ipAddress = 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 :: Lens' Workspace (Maybe [ModificationState])
workspace_modificationStates = 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) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Standby WorkSpace or Primary WorkSpace related to the specified
-- WorkSpace.
workspace_relatedWorkspaces :: Lens.Lens' Workspace (Prelude.Maybe [RelatedWorkspaceProperties])
workspace_relatedWorkspaces :: Lens' Workspace (Maybe [RelatedWorkspaceProperties])
workspace_relatedWorkspaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Workspace' {Maybe [RelatedWorkspaceProperties]
relatedWorkspaces :: Maybe [RelatedWorkspaceProperties]
$sel:relatedWorkspaces:Workspace' :: Workspace -> Maybe [RelatedWorkspaceProperties]
relatedWorkspaces} -> Maybe [RelatedWorkspaceProperties]
relatedWorkspaces) (\s :: Workspace
s@Workspace' {} Maybe [RelatedWorkspaceProperties]
a -> Workspace
s {$sel:relatedWorkspaces:Workspace' :: Maybe [RelatedWorkspaceProperties]
relatedWorkspaces = Maybe [RelatedWorkspaceProperties]
a} :: Workspace) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the data stored on the root volume is encrypted.
workspace_rootVolumeEncryptionEnabled :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Bool)
workspace_rootVolumeEncryptionEnabled :: Lens' Workspace (Maybe Bool)
workspace_rootVolumeEncryptionEnabled = 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 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 :: Lens' Workspace (Maybe WorkspaceState)
workspace_state = 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 identifier of the subnet for the WorkSpace.
workspace_subnetId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_subnetId :: Lens' Workspace (Maybe Text)
workspace_subnetId = 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 user for the WorkSpace.
workspace_userName :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_userName :: Lens' Workspace (Maybe Text)
workspace_userName = 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)

-- | Indicates whether the data stored on the user volume is encrypted.
workspace_userVolumeEncryptionEnabled :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Bool)
workspace_userVolumeEncryptionEnabled :: Lens' Workspace (Maybe Bool)
workspace_userVolumeEncryptionEnabled = 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 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 :: Lens' Workspace (Maybe Text)
workspace_volumeEncryptionKey = 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 identifier of the WorkSpace.
workspace_workspaceId :: Lens.Lens' Workspace (Prelude.Maybe Prelude.Text)
workspace_workspaceId :: Lens' Workspace (Maybe Text)
workspace_workspaceId = 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)

-- | The properties of the WorkSpace.
workspace_workspaceProperties :: Lens.Lens' Workspace (Prelude.Maybe WorkspaceProperties)
workspace_workspaceProperties :: Lens' Workspace (Maybe WorkspaceProperties)
workspace_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)

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

instance Prelude.Hashable Workspace where
  hashWithSalt :: Int -> Workspace -> Int
hashWithSalt Int
_salt Workspace' {Maybe Bool
Maybe [ModificationState]
Maybe [RelatedWorkspaceProperties]
Maybe Text
Maybe WorkspaceProperties
Maybe WorkspaceState
workspaceProperties :: Maybe WorkspaceProperties
workspaceId :: Maybe Text
volumeEncryptionKey :: Maybe Text
userVolumeEncryptionEnabled :: Maybe Bool
userName :: Maybe Text
subnetId :: Maybe Text
state :: Maybe WorkspaceState
rootVolumeEncryptionEnabled :: Maybe Bool
relatedWorkspaces :: Maybe [RelatedWorkspaceProperties]
modificationStates :: Maybe [ModificationState]
ipAddress :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
directoryId :: Maybe Text
computerName :: Maybe Text
bundleId :: Maybe Text
$sel:workspaceProperties:Workspace' :: Workspace -> Maybe WorkspaceProperties
$sel:workspaceId:Workspace' :: Workspace -> Maybe Text
$sel:volumeEncryptionKey:Workspace' :: Workspace -> Maybe Text
$sel:userVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
$sel:userName:Workspace' :: Workspace -> Maybe Text
$sel:subnetId:Workspace' :: Workspace -> Maybe Text
$sel:state:Workspace' :: Workspace -> Maybe WorkspaceState
$sel:rootVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
$sel:relatedWorkspaces:Workspace' :: Workspace -> Maybe [RelatedWorkspaceProperties]
$sel:modificationStates:Workspace' :: Workspace -> Maybe [ModificationState]
$sel:ipAddress:Workspace' :: Workspace -> Maybe Text
$sel:errorMessage:Workspace' :: Workspace -> Maybe Text
$sel:errorCode:Workspace' :: Workspace -> Maybe Text
$sel:directoryId:Workspace' :: Workspace -> Maybe Text
$sel:computerName:Workspace' :: Workspace -> Maybe Text
$sel:bundleId:Workspace' :: Workspace -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bundleId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
computerName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
directoryId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ModificationState]
modificationStates
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RelatedWorkspaceProperties]
relatedWorkspaces
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
rootVolumeEncryptionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkspaceState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
userVolumeEncryptionEnabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
volumeEncryptionKey
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
workspaceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WorkspaceProperties
workspaceProperties

instance Prelude.NFData Workspace where
  rnf :: Workspace -> ()
rnf Workspace' {Maybe Bool
Maybe [ModificationState]
Maybe [RelatedWorkspaceProperties]
Maybe Text
Maybe WorkspaceProperties
Maybe WorkspaceState
workspaceProperties :: Maybe WorkspaceProperties
workspaceId :: Maybe Text
volumeEncryptionKey :: Maybe Text
userVolumeEncryptionEnabled :: Maybe Bool
userName :: Maybe Text
subnetId :: Maybe Text
state :: Maybe WorkspaceState
rootVolumeEncryptionEnabled :: Maybe Bool
relatedWorkspaces :: Maybe [RelatedWorkspaceProperties]
modificationStates :: Maybe [ModificationState]
ipAddress :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
directoryId :: Maybe Text
computerName :: Maybe Text
bundleId :: Maybe Text
$sel:workspaceProperties:Workspace' :: Workspace -> Maybe WorkspaceProperties
$sel:workspaceId:Workspace' :: Workspace -> Maybe Text
$sel:volumeEncryptionKey:Workspace' :: Workspace -> Maybe Text
$sel:userVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
$sel:userName:Workspace' :: Workspace -> Maybe Text
$sel:subnetId:Workspace' :: Workspace -> Maybe Text
$sel:state:Workspace' :: Workspace -> Maybe WorkspaceState
$sel:rootVolumeEncryptionEnabled:Workspace' :: Workspace -> Maybe Bool
$sel:relatedWorkspaces:Workspace' :: Workspace -> Maybe [RelatedWorkspaceProperties]
$sel:modificationStates:Workspace' :: Workspace -> Maybe [ModificationState]
$sel:ipAddress:Workspace' :: Workspace -> Maybe Text
$sel:errorMessage:Workspace' :: Workspace -> Maybe Text
$sel:errorCode:Workspace' :: Workspace -> Maybe Text
$sel:directoryId:Workspace' :: Workspace -> Maybe Text
$sel:computerName:Workspace' :: Workspace -> Maybe Text
$sel:bundleId:Workspace' :: Workspace -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bundleId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
computerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
directoryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ModificationState]
modificationStates
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RelatedWorkspaceProperties]
relatedWorkspaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
rootVolumeEncryptionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkspaceState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
userVolumeEncryptionEnabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
volumeEncryptionKey
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
workspaceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WorkspaceProperties
workspaceProperties