{-# 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.WorkSpacesWeb.Types.UserSettingsSummary
-- 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.WorkSpacesWeb.Types.UserSettingsSummary 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.WorkSpacesWeb.Types.EnabledType

-- | The summary of user settings.
--
-- /See:/ 'newUserSettingsSummary' smart constructor.
data UserSettingsSummary = UserSettingsSummary'
  { -- | Specifies whether the user can copy text from the streaming session to
    -- the local device.
    UserSettingsSummary -> Maybe EnabledType
copyAllowed :: Prelude.Maybe EnabledType,
    -- | The amount of time that a streaming session remains active after users
    -- disconnect.
    UserSettingsSummary -> Maybe Natural
disconnectTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether the user can download files from the streaming session
    -- to the local device.
    UserSettingsSummary -> Maybe EnabledType
downloadAllowed :: Prelude.Maybe EnabledType,
    -- | The amount of time that users can be idle (inactive) before they are
    -- disconnected from their streaming session and the disconnect timeout
    -- interval begins.
    UserSettingsSummary -> Maybe Natural
idleDisconnectTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | Specifies whether the user can paste text from the local device to the
    -- streaming session.
    UserSettingsSummary -> Maybe EnabledType
pasteAllowed :: Prelude.Maybe EnabledType,
    -- | Specifies whether the user can print to the local device.
    UserSettingsSummary -> Maybe EnabledType
printAllowed :: Prelude.Maybe EnabledType,
    -- | Specifies whether the user can upload files from the local device to the
    -- streaming session.
    UserSettingsSummary -> Maybe EnabledType
uploadAllowed :: Prelude.Maybe EnabledType,
    -- | The ARN of the user settings.
    UserSettingsSummary -> Maybe Text
userSettingsArn :: Prelude.Maybe Prelude.Text
  }
  deriving (UserSettingsSummary -> UserSettingsSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserSettingsSummary -> UserSettingsSummary -> Bool
$c/= :: UserSettingsSummary -> UserSettingsSummary -> Bool
== :: UserSettingsSummary -> UserSettingsSummary -> Bool
$c== :: UserSettingsSummary -> UserSettingsSummary -> Bool
Prelude.Eq, ReadPrec [UserSettingsSummary]
ReadPrec UserSettingsSummary
Int -> ReadS UserSettingsSummary
ReadS [UserSettingsSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserSettingsSummary]
$creadListPrec :: ReadPrec [UserSettingsSummary]
readPrec :: ReadPrec UserSettingsSummary
$creadPrec :: ReadPrec UserSettingsSummary
readList :: ReadS [UserSettingsSummary]
$creadList :: ReadS [UserSettingsSummary]
readsPrec :: Int -> ReadS UserSettingsSummary
$creadsPrec :: Int -> ReadS UserSettingsSummary
Prelude.Read, Int -> UserSettingsSummary -> ShowS
[UserSettingsSummary] -> ShowS
UserSettingsSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserSettingsSummary] -> ShowS
$cshowList :: [UserSettingsSummary] -> ShowS
show :: UserSettingsSummary -> String
$cshow :: UserSettingsSummary -> String
showsPrec :: Int -> UserSettingsSummary -> ShowS
$cshowsPrec :: Int -> UserSettingsSummary -> ShowS
Prelude.Show, forall x. Rep UserSettingsSummary x -> UserSettingsSummary
forall x. UserSettingsSummary -> Rep UserSettingsSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserSettingsSummary x -> UserSettingsSummary
$cfrom :: forall x. UserSettingsSummary -> Rep UserSettingsSummary x
Prelude.Generic)

-- |
-- Create a value of 'UserSettingsSummary' 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:
--
-- 'copyAllowed', 'userSettingsSummary_copyAllowed' - Specifies whether the user can copy text from the streaming session to
-- the local device.
--
-- 'disconnectTimeoutInMinutes', 'userSettingsSummary_disconnectTimeoutInMinutes' - The amount of time that a streaming session remains active after users
-- disconnect.
--
-- 'downloadAllowed', 'userSettingsSummary_downloadAllowed' - Specifies whether the user can download files from the streaming session
-- to the local device.
--
-- 'idleDisconnectTimeoutInMinutes', 'userSettingsSummary_idleDisconnectTimeoutInMinutes' - The amount of time that users can be idle (inactive) before they are
-- disconnected from their streaming session and the disconnect timeout
-- interval begins.
--
-- 'pasteAllowed', 'userSettingsSummary_pasteAllowed' - Specifies whether the user can paste text from the local device to the
-- streaming session.
--
-- 'printAllowed', 'userSettingsSummary_printAllowed' - Specifies whether the user can print to the local device.
--
-- 'uploadAllowed', 'userSettingsSummary_uploadAllowed' - Specifies whether the user can upload files from the local device to the
-- streaming session.
--
-- 'userSettingsArn', 'userSettingsSummary_userSettingsArn' - The ARN of the user settings.
newUserSettingsSummary ::
  UserSettingsSummary
newUserSettingsSummary :: UserSettingsSummary
newUserSettingsSummary =
  UserSettingsSummary'
    { $sel:copyAllowed:UserSettingsSummary' :: Maybe EnabledType
copyAllowed = forall a. Maybe a
Prelude.Nothing,
      $sel:disconnectTimeoutInMinutes:UserSettingsSummary' :: Maybe Natural
disconnectTimeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:downloadAllowed:UserSettingsSummary' :: Maybe EnabledType
downloadAllowed = forall a. Maybe a
Prelude.Nothing,
      $sel:idleDisconnectTimeoutInMinutes:UserSettingsSummary' :: Maybe Natural
idleDisconnectTimeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
      $sel:pasteAllowed:UserSettingsSummary' :: Maybe EnabledType
pasteAllowed = forall a. Maybe a
Prelude.Nothing,
      $sel:printAllowed:UserSettingsSummary' :: Maybe EnabledType
printAllowed = forall a. Maybe a
Prelude.Nothing,
      $sel:uploadAllowed:UserSettingsSummary' :: Maybe EnabledType
uploadAllowed = forall a. Maybe a
Prelude.Nothing,
      $sel:userSettingsArn:UserSettingsSummary' :: Maybe Text
userSettingsArn = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether the user can copy text from the streaming session to
-- the local device.
userSettingsSummary_copyAllowed :: Lens.Lens' UserSettingsSummary (Prelude.Maybe EnabledType)
userSettingsSummary_copyAllowed :: Lens' UserSettingsSummary (Maybe EnabledType)
userSettingsSummary_copyAllowed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe EnabledType
copyAllowed :: Maybe EnabledType
$sel:copyAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
copyAllowed} -> Maybe EnabledType
copyAllowed) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe EnabledType
a -> UserSettingsSummary
s {$sel:copyAllowed:UserSettingsSummary' :: Maybe EnabledType
copyAllowed = Maybe EnabledType
a} :: UserSettingsSummary)

-- | The amount of time that a streaming session remains active after users
-- disconnect.
userSettingsSummary_disconnectTimeoutInMinutes :: Lens.Lens' UserSettingsSummary (Prelude.Maybe Prelude.Natural)
userSettingsSummary_disconnectTimeoutInMinutes :: Lens' UserSettingsSummary (Maybe Natural)
userSettingsSummary_disconnectTimeoutInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe Natural
disconnectTimeoutInMinutes :: Maybe Natural
$sel:disconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
disconnectTimeoutInMinutes} -> Maybe Natural
disconnectTimeoutInMinutes) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe Natural
a -> UserSettingsSummary
s {$sel:disconnectTimeoutInMinutes:UserSettingsSummary' :: Maybe Natural
disconnectTimeoutInMinutes = Maybe Natural
a} :: UserSettingsSummary)

-- | Specifies whether the user can download files from the streaming session
-- to the local device.
userSettingsSummary_downloadAllowed :: Lens.Lens' UserSettingsSummary (Prelude.Maybe EnabledType)
userSettingsSummary_downloadAllowed :: Lens' UserSettingsSummary (Maybe EnabledType)
userSettingsSummary_downloadAllowed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe EnabledType
downloadAllowed :: Maybe EnabledType
$sel:downloadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
downloadAllowed} -> Maybe EnabledType
downloadAllowed) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe EnabledType
a -> UserSettingsSummary
s {$sel:downloadAllowed:UserSettingsSummary' :: Maybe EnabledType
downloadAllowed = Maybe EnabledType
a} :: UserSettingsSummary)

-- | The amount of time that users can be idle (inactive) before they are
-- disconnected from their streaming session and the disconnect timeout
-- interval begins.
userSettingsSummary_idleDisconnectTimeoutInMinutes :: Lens.Lens' UserSettingsSummary (Prelude.Maybe Prelude.Natural)
userSettingsSummary_idleDisconnectTimeoutInMinutes :: Lens' UserSettingsSummary (Maybe Natural)
userSettingsSummary_idleDisconnectTimeoutInMinutes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe Natural
idleDisconnectTimeoutInMinutes :: Maybe Natural
$sel:idleDisconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
idleDisconnectTimeoutInMinutes} -> Maybe Natural
idleDisconnectTimeoutInMinutes) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe Natural
a -> UserSettingsSummary
s {$sel:idleDisconnectTimeoutInMinutes:UserSettingsSummary' :: Maybe Natural
idleDisconnectTimeoutInMinutes = Maybe Natural
a} :: UserSettingsSummary)

-- | Specifies whether the user can paste text from the local device to the
-- streaming session.
userSettingsSummary_pasteAllowed :: Lens.Lens' UserSettingsSummary (Prelude.Maybe EnabledType)
userSettingsSummary_pasteAllowed :: Lens' UserSettingsSummary (Maybe EnabledType)
userSettingsSummary_pasteAllowed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe EnabledType
pasteAllowed :: Maybe EnabledType
$sel:pasteAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
pasteAllowed} -> Maybe EnabledType
pasteAllowed) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe EnabledType
a -> UserSettingsSummary
s {$sel:pasteAllowed:UserSettingsSummary' :: Maybe EnabledType
pasteAllowed = Maybe EnabledType
a} :: UserSettingsSummary)

-- | Specifies whether the user can print to the local device.
userSettingsSummary_printAllowed :: Lens.Lens' UserSettingsSummary (Prelude.Maybe EnabledType)
userSettingsSummary_printAllowed :: Lens' UserSettingsSummary (Maybe EnabledType)
userSettingsSummary_printAllowed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe EnabledType
printAllowed :: Maybe EnabledType
$sel:printAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
printAllowed} -> Maybe EnabledType
printAllowed) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe EnabledType
a -> UserSettingsSummary
s {$sel:printAllowed:UserSettingsSummary' :: Maybe EnabledType
printAllowed = Maybe EnabledType
a} :: UserSettingsSummary)

-- | Specifies whether the user can upload files from the local device to the
-- streaming session.
userSettingsSummary_uploadAllowed :: Lens.Lens' UserSettingsSummary (Prelude.Maybe EnabledType)
userSettingsSummary_uploadAllowed :: Lens' UserSettingsSummary (Maybe EnabledType)
userSettingsSummary_uploadAllowed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe EnabledType
uploadAllowed :: Maybe EnabledType
$sel:uploadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
uploadAllowed} -> Maybe EnabledType
uploadAllowed) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe EnabledType
a -> UserSettingsSummary
s {$sel:uploadAllowed:UserSettingsSummary' :: Maybe EnabledType
uploadAllowed = Maybe EnabledType
a} :: UserSettingsSummary)

-- | The ARN of the user settings.
userSettingsSummary_userSettingsArn :: Lens.Lens' UserSettingsSummary (Prelude.Maybe Prelude.Text)
userSettingsSummary_userSettingsArn :: Lens' UserSettingsSummary (Maybe Text)
userSettingsSummary_userSettingsArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettingsSummary' {Maybe Text
userSettingsArn :: Maybe Text
$sel:userSettingsArn:UserSettingsSummary' :: UserSettingsSummary -> Maybe Text
userSettingsArn} -> Maybe Text
userSettingsArn) (\s :: UserSettingsSummary
s@UserSettingsSummary' {} Maybe Text
a -> UserSettingsSummary
s {$sel:userSettingsArn:UserSettingsSummary' :: Maybe Text
userSettingsArn = Maybe Text
a} :: UserSettingsSummary)

instance Data.FromJSON UserSettingsSummary where
  parseJSON :: Value -> Parser UserSettingsSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UserSettingsSummary"
      ( \Object
x ->
          Maybe EnabledType
-> Maybe Natural
-> Maybe EnabledType
-> Maybe Natural
-> Maybe EnabledType
-> Maybe EnabledType
-> Maybe EnabledType
-> Maybe Text
-> UserSettingsSummary
UserSettingsSummary'
            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
"copyAllowed")
            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
"disconnectTimeoutInMinutes")
            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
"downloadAllowed")
            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
"idleDisconnectTimeoutInMinutes")
            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
"pasteAllowed")
            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
"printAllowed")
            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
"uploadAllowed")
            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
"userSettingsArn")
      )

instance Prelude.Hashable UserSettingsSummary where
  hashWithSalt :: Int -> UserSettingsSummary -> Int
hashWithSalt Int
_salt UserSettingsSummary' {Maybe Natural
Maybe Text
Maybe EnabledType
userSettingsArn :: Maybe Text
uploadAllowed :: Maybe EnabledType
printAllowed :: Maybe EnabledType
pasteAllowed :: Maybe EnabledType
idleDisconnectTimeoutInMinutes :: Maybe Natural
downloadAllowed :: Maybe EnabledType
disconnectTimeoutInMinutes :: Maybe Natural
copyAllowed :: Maybe EnabledType
$sel:userSettingsArn:UserSettingsSummary' :: UserSettingsSummary -> Maybe Text
$sel:uploadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:printAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:pasteAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:idleDisconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
$sel:downloadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:disconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
$sel:copyAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnabledType
copyAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
disconnectTimeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnabledType
downloadAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
idleDisconnectTimeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnabledType
pasteAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnabledType
printAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnabledType
uploadAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userSettingsArn

instance Prelude.NFData UserSettingsSummary where
  rnf :: UserSettingsSummary -> ()
rnf UserSettingsSummary' {Maybe Natural
Maybe Text
Maybe EnabledType
userSettingsArn :: Maybe Text
uploadAllowed :: Maybe EnabledType
printAllowed :: Maybe EnabledType
pasteAllowed :: Maybe EnabledType
idleDisconnectTimeoutInMinutes :: Maybe Natural
downloadAllowed :: Maybe EnabledType
disconnectTimeoutInMinutes :: Maybe Natural
copyAllowed :: Maybe EnabledType
$sel:userSettingsArn:UserSettingsSummary' :: UserSettingsSummary -> Maybe Text
$sel:uploadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:printAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:pasteAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:idleDisconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
$sel:downloadAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
$sel:disconnectTimeoutInMinutes:UserSettingsSummary' :: UserSettingsSummary -> Maybe Natural
$sel:copyAllowed:UserSettingsSummary' :: UserSettingsSummary -> Maybe EnabledType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EnabledType
copyAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
disconnectTimeoutInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnabledType
downloadAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
idleDisconnectTimeoutInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnabledType
pasteAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnabledType
printAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EnabledType
uploadAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userSettingsArn