{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateUserSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a user settings resource that can be associated with a web
-- portal. Once associated with a web portal, user settings control how
-- users can transfer data between a streaming session and the their local
-- devices.
module Amazonka.WorkSpacesWeb.CreateUserSettings
  ( -- * Creating a Request
    CreateUserSettings (..),
    newCreateUserSettings,

    -- * Request Lenses
    createUserSettings_clientToken,
    createUserSettings_disconnectTimeoutInMinutes,
    createUserSettings_idleDisconnectTimeoutInMinutes,
    createUserSettings_tags,
    createUserSettings_copyAllowed,
    createUserSettings_downloadAllowed,
    createUserSettings_pasteAllowed,
    createUserSettings_printAllowed,
    createUserSettings_uploadAllowed,

    -- * Destructuring the Response
    CreateUserSettingsResponse (..),
    newCreateUserSettingsResponse,

    -- * Response Lenses
    createUserSettingsResponse_httpStatus,
    createUserSettingsResponse_userSettingsArn,
  )
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkSpacesWeb.Types

-- | /See:/ 'newCreateUserSettings' smart constructor.
data CreateUserSettings = CreateUserSettings'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Idempotency ensures that an API request
    -- completes only once. With an idempotent request, if the original request
    -- completes successfully, subsequent retries with the same client token
    -- returns the result from the original successful request.
    --
    -- If you do not specify a client token, one is automatically generated by
    -- the AWS SDK.
    CreateUserSettings -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The amount of time that a streaming session remains active after users
    -- disconnect.
    CreateUserSettings -> Maybe Natural
disconnectTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The amount of time that users can be idle (inactive) before they are
    -- disconnected from their streaming session and the disconnect timeout
    -- interval begins.
    CreateUserSettings -> Maybe Natural
idleDisconnectTimeoutInMinutes :: Prelude.Maybe Prelude.Natural,
    -- | The tags to add to the user settings resource. A tag is a key-value
    -- pair.
    CreateUserSettings -> Maybe [Sensitive Tag]
tags :: Prelude.Maybe [Data.Sensitive Tag],
    -- | Specifies whether the user can copy text from the streaming session to
    -- the local device.
    CreateUserSettings -> EnabledType
copyAllowed :: EnabledType,
    -- | Specifies whether the user can download files from the streaming session
    -- to the local device.
    CreateUserSettings -> EnabledType
downloadAllowed :: EnabledType,
    -- | Specifies whether the user can paste text from the local device to the
    -- streaming session.
    CreateUserSettings -> EnabledType
pasteAllowed :: EnabledType,
    -- | Specifies whether the user can print to the local device.
    CreateUserSettings -> EnabledType
printAllowed :: EnabledType,
    -- | Specifies whether the user can upload files from the local device to the
    -- streaming session.
    CreateUserSettings -> EnabledType
uploadAllowed :: EnabledType
  }
  deriving (CreateUserSettings -> CreateUserSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserSettings -> CreateUserSettings -> Bool
$c/= :: CreateUserSettings -> CreateUserSettings -> Bool
== :: CreateUserSettings -> CreateUserSettings -> Bool
$c== :: CreateUserSettings -> CreateUserSettings -> Bool
Prelude.Eq, Int -> CreateUserSettings -> ShowS
[CreateUserSettings] -> ShowS
CreateUserSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserSettings] -> ShowS
$cshowList :: [CreateUserSettings] -> ShowS
show :: CreateUserSettings -> String
$cshow :: CreateUserSettings -> String
showsPrec :: Int -> CreateUserSettings -> ShowS
$cshowsPrec :: Int -> CreateUserSettings -> ShowS
Prelude.Show, forall x. Rep CreateUserSettings x -> CreateUserSettings
forall x. CreateUserSettings -> Rep CreateUserSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateUserSettings x -> CreateUserSettings
$cfrom :: forall x. CreateUserSettings -> Rep CreateUserSettings x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserSettings' 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:
--
-- 'clientToken', 'createUserSettings_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Idempotency ensures that an API request
-- completes only once. With an idempotent request, if the original request
-- completes successfully, subsequent retries with the same client token
-- returns the result from the original successful request.
--
-- If you do not specify a client token, one is automatically generated by
-- the AWS SDK.
--
-- 'disconnectTimeoutInMinutes', 'createUserSettings_disconnectTimeoutInMinutes' - The amount of time that a streaming session remains active after users
-- disconnect.
--
-- 'idleDisconnectTimeoutInMinutes', 'createUserSettings_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.
--
-- 'tags', 'createUserSettings_tags' - The tags to add to the user settings resource. A tag is a key-value
-- pair.
--
-- 'copyAllowed', 'createUserSettings_copyAllowed' - Specifies whether the user can copy text from the streaming session to
-- the local device.
--
-- 'downloadAllowed', 'createUserSettings_downloadAllowed' - Specifies whether the user can download files from the streaming session
-- to the local device.
--
-- 'pasteAllowed', 'createUserSettings_pasteAllowed' - Specifies whether the user can paste text from the local device to the
-- streaming session.
--
-- 'printAllowed', 'createUserSettings_printAllowed' - Specifies whether the user can print to the local device.
--
-- 'uploadAllowed', 'createUserSettings_uploadAllowed' - Specifies whether the user can upload files from the local device to the
-- streaming session.
newCreateUserSettings ::
  -- | 'copyAllowed'
  EnabledType ->
  -- | 'downloadAllowed'
  EnabledType ->
  -- | 'pasteAllowed'
  EnabledType ->
  -- | 'printAllowed'
  EnabledType ->
  -- | 'uploadAllowed'
  EnabledType ->
  CreateUserSettings
newCreateUserSettings :: EnabledType
-> EnabledType
-> EnabledType
-> EnabledType
-> EnabledType
-> CreateUserSettings
newCreateUserSettings
  EnabledType
pCopyAllowed_
  EnabledType
pDownloadAllowed_
  EnabledType
pPasteAllowed_
  EnabledType
pPrintAllowed_
  EnabledType
pUploadAllowed_ =
    CreateUserSettings'
      { $sel:clientToken:CreateUserSettings' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
        $sel:disconnectTimeoutInMinutes:CreateUserSettings' :: Maybe Natural
disconnectTimeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
        $sel:idleDisconnectTimeoutInMinutes:CreateUserSettings' :: Maybe Natural
idleDisconnectTimeoutInMinutes = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateUserSettings' :: Maybe [Sensitive Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:copyAllowed:CreateUserSettings' :: EnabledType
copyAllowed = EnabledType
pCopyAllowed_,
        $sel:downloadAllowed:CreateUserSettings' :: EnabledType
downloadAllowed = EnabledType
pDownloadAllowed_,
        $sel:pasteAllowed:CreateUserSettings' :: EnabledType
pasteAllowed = EnabledType
pPasteAllowed_,
        $sel:printAllowed:CreateUserSettings' :: EnabledType
printAllowed = EnabledType
pPrintAllowed_,
        $sel:uploadAllowed:CreateUserSettings' :: EnabledType
uploadAllowed = EnabledType
pUploadAllowed_
      }

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Idempotency ensures that an API request
-- completes only once. With an idempotent request, if the original request
-- completes successfully, subsequent retries with the same client token
-- returns the result from the original successful request.
--
-- If you do not specify a client token, one is automatically generated by
-- the AWS SDK.
createUserSettings_clientToken :: Lens.Lens' CreateUserSettings (Prelude.Maybe Prelude.Text)
createUserSettings_clientToken :: Lens' CreateUserSettings (Maybe Text)
createUserSettings_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserSettings' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateUserSettings' :: CreateUserSettings -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateUserSettings
s@CreateUserSettings' {} Maybe Text
a -> CreateUserSettings
s {$sel:clientToken:CreateUserSettings' :: Maybe Text
clientToken = Maybe Text
a} :: CreateUserSettings)

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

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

-- | The tags to add to the user settings resource. A tag is a key-value
-- pair.
createUserSettings_tags :: Lens.Lens' CreateUserSettings (Prelude.Maybe [Tag])
createUserSettings_tags :: Lens' CreateUserSettings (Maybe [Tag])
createUserSettings_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserSettings' {Maybe [Sensitive Tag]
tags :: Maybe [Sensitive Tag]
$sel:tags:CreateUserSettings' :: CreateUserSettings -> Maybe [Sensitive Tag]
tags} -> Maybe [Sensitive Tag]
tags) (\s :: CreateUserSettings
s@CreateUserSettings' {} Maybe [Sensitive Tag]
a -> CreateUserSettings
s {$sel:tags:CreateUserSettings' :: Maybe [Sensitive Tag]
tags = Maybe [Sensitive Tag]
a} :: CreateUserSettings) 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

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

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

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

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

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

instance Core.AWSRequest CreateUserSettings where
  type
    AWSResponse CreateUserSettings =
      CreateUserSettingsResponse
  request :: (Service -> Service)
-> CreateUserSettings -> Request CreateUserSettings
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateUserSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateUserSettings)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> Text -> CreateUserSettingsResponse
CreateUserSettingsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"userSettingsArn")
      )

instance Prelude.Hashable CreateUserSettings where
  hashWithSalt :: Int -> CreateUserSettings -> Int
hashWithSalt Int
_salt CreateUserSettings' {Maybe Natural
Maybe [Sensitive Tag]
Maybe Text
EnabledType
uploadAllowed :: EnabledType
printAllowed :: EnabledType
pasteAllowed :: EnabledType
downloadAllowed :: EnabledType
copyAllowed :: EnabledType
tags :: Maybe [Sensitive Tag]
idleDisconnectTimeoutInMinutes :: Maybe Natural
disconnectTimeoutInMinutes :: Maybe Natural
clientToken :: Maybe Text
$sel:uploadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:printAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:pasteAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:downloadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:copyAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:tags:CreateUserSettings' :: CreateUserSettings -> Maybe [Sensitive Tag]
$sel:idleDisconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:disconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:clientToken:CreateUserSettings' :: CreateUserSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
disconnectTimeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
idleDisconnectTimeoutInMinutes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sensitive Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EnabledType
copyAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EnabledType
downloadAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EnabledType
pasteAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EnabledType
printAllowed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` EnabledType
uploadAllowed

instance Prelude.NFData CreateUserSettings where
  rnf :: CreateUserSettings -> ()
rnf CreateUserSettings' {Maybe Natural
Maybe [Sensitive Tag]
Maybe Text
EnabledType
uploadAllowed :: EnabledType
printAllowed :: EnabledType
pasteAllowed :: EnabledType
downloadAllowed :: EnabledType
copyAllowed :: EnabledType
tags :: Maybe [Sensitive Tag]
idleDisconnectTimeoutInMinutes :: Maybe Natural
disconnectTimeoutInMinutes :: Maybe Natural
clientToken :: Maybe Text
$sel:uploadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:printAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:pasteAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:downloadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:copyAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:tags:CreateUserSettings' :: CreateUserSettings -> Maybe [Sensitive Tag]
$sel:idleDisconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:disconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:clientToken:CreateUserSettings' :: CreateUserSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      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 Natural
idleDisconnectTimeoutInMinutes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sensitive Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnabledType
copyAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnabledType
downloadAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnabledType
pasteAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnabledType
printAllowed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf EnabledType
uploadAllowed

instance Data.ToHeaders CreateUserSettings where
  toHeaders :: CreateUserSettings -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateUserSettings where
  toJSON :: CreateUserSettings -> Value
toJSON CreateUserSettings' {Maybe Natural
Maybe [Sensitive Tag]
Maybe Text
EnabledType
uploadAllowed :: EnabledType
printAllowed :: EnabledType
pasteAllowed :: EnabledType
downloadAllowed :: EnabledType
copyAllowed :: EnabledType
tags :: Maybe [Sensitive Tag]
idleDisconnectTimeoutInMinutes :: Maybe Natural
disconnectTimeoutInMinutes :: Maybe Natural
clientToken :: Maybe Text
$sel:uploadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:printAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:pasteAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:downloadAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:copyAllowed:CreateUserSettings' :: CreateUserSettings -> EnabledType
$sel:tags:CreateUserSettings' :: CreateUserSettings -> Maybe [Sensitive Tag]
$sel:idleDisconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:disconnectTimeoutInMinutes:CreateUserSettings' :: CreateUserSettings -> Maybe Natural
$sel:clientToken:CreateUserSettings' :: CreateUserSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"disconnectTimeoutInMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
disconnectTimeoutInMinutes,
            (Key
"idleDisconnectTimeoutInMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
idleDisconnectTimeoutInMinutes,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Sensitive Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"copyAllowed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EnabledType
copyAllowed),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"downloadAllowed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EnabledType
downloadAllowed),
            forall a. a -> Maybe a
Prelude.Just (Key
"pasteAllowed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EnabledType
pasteAllowed),
            forall a. a -> Maybe a
Prelude.Just (Key
"printAllowed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EnabledType
printAllowed),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"uploadAllowed" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= EnabledType
uploadAllowed)
          ]
      )

instance Data.ToPath CreateUserSettings where
  toPath :: CreateUserSettings -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/userSettings"

instance Data.ToQuery CreateUserSettings where
  toQuery :: CreateUserSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateUserSettingsResponse' smart constructor.
data CreateUserSettingsResponse = CreateUserSettingsResponse'
  { -- | The response's http status code.
    CreateUserSettingsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ARN of the user settings.
    CreateUserSettingsResponse -> Text
userSettingsArn :: Prelude.Text
  }
  deriving (CreateUserSettingsResponse -> CreateUserSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUserSettingsResponse -> CreateUserSettingsResponse -> Bool
$c/= :: CreateUserSettingsResponse -> CreateUserSettingsResponse -> Bool
== :: CreateUserSettingsResponse -> CreateUserSettingsResponse -> Bool
$c== :: CreateUserSettingsResponse -> CreateUserSettingsResponse -> Bool
Prelude.Eq, ReadPrec [CreateUserSettingsResponse]
ReadPrec CreateUserSettingsResponse
Int -> ReadS CreateUserSettingsResponse
ReadS [CreateUserSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUserSettingsResponse]
$creadListPrec :: ReadPrec [CreateUserSettingsResponse]
readPrec :: ReadPrec CreateUserSettingsResponse
$creadPrec :: ReadPrec CreateUserSettingsResponse
readList :: ReadS [CreateUserSettingsResponse]
$creadList :: ReadS [CreateUserSettingsResponse]
readsPrec :: Int -> ReadS CreateUserSettingsResponse
$creadsPrec :: Int -> ReadS CreateUserSettingsResponse
Prelude.Read, Int -> CreateUserSettingsResponse -> ShowS
[CreateUserSettingsResponse] -> ShowS
CreateUserSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUserSettingsResponse] -> ShowS
$cshowList :: [CreateUserSettingsResponse] -> ShowS
show :: CreateUserSettingsResponse -> String
$cshow :: CreateUserSettingsResponse -> String
showsPrec :: Int -> CreateUserSettingsResponse -> ShowS
$cshowsPrec :: Int -> CreateUserSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep CreateUserSettingsResponse x -> CreateUserSettingsResponse
forall x.
CreateUserSettingsResponse -> Rep CreateUserSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateUserSettingsResponse x -> CreateUserSettingsResponse
$cfrom :: forall x.
CreateUserSettingsResponse -> Rep CreateUserSettingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateUserSettingsResponse' 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:
--
-- 'httpStatus', 'createUserSettingsResponse_httpStatus' - The response's http status code.
--
-- 'userSettingsArn', 'createUserSettingsResponse_userSettingsArn' - The ARN of the user settings.
newCreateUserSettingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'userSettingsArn'
  Prelude.Text ->
  CreateUserSettingsResponse
newCreateUserSettingsResponse :: Int -> Text -> CreateUserSettingsResponse
newCreateUserSettingsResponse
  Int
pHttpStatus_
  Text
pUserSettingsArn_ =
    CreateUserSettingsResponse'
      { $sel:httpStatus:CreateUserSettingsResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:userSettingsArn:CreateUserSettingsResponse' :: Text
userSettingsArn = Text
pUserSettingsArn_
      }

-- | The response's http status code.
createUserSettingsResponse_httpStatus :: Lens.Lens' CreateUserSettingsResponse Prelude.Int
createUserSettingsResponse_httpStatus :: Lens' CreateUserSettingsResponse Int
createUserSettingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUserSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateUserSettingsResponse' :: CreateUserSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateUserSettingsResponse
s@CreateUserSettingsResponse' {} Int
a -> CreateUserSettingsResponse
s {$sel:httpStatus:CreateUserSettingsResponse' :: Int
httpStatus = Int
a} :: CreateUserSettingsResponse)

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

instance Prelude.NFData CreateUserSettingsResponse where
  rnf :: CreateUserSettingsResponse -> ()
rnf CreateUserSettingsResponse' {Int
Text
userSettingsArn :: Text
httpStatus :: Int
$sel:userSettingsArn:CreateUserSettingsResponse' :: CreateUserSettingsResponse -> Text
$sel:httpStatus:CreateUserSettingsResponse' :: CreateUserSettingsResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
userSettingsArn