{-# 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.WorkSpaces.ModifyWorkspaceCreationProperties
-- 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)
--
-- Modify the default properties used to create WorkSpaces.
module Amazonka.WorkSpaces.ModifyWorkspaceCreationProperties
  ( -- * Creating a Request
    ModifyWorkspaceCreationProperties (..),
    newModifyWorkspaceCreationProperties,

    -- * Request Lenses
    modifyWorkspaceCreationProperties_resourceId,
    modifyWorkspaceCreationProperties_workspaceCreationProperties,

    -- * Destructuring the Response
    ModifyWorkspaceCreationPropertiesResponse (..),
    newModifyWorkspaceCreationPropertiesResponse,

    -- * Response Lenses
    modifyWorkspaceCreationPropertiesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.WorkSpaces.Types

-- | /See:/ 'newModifyWorkspaceCreationProperties' smart constructor.
data ModifyWorkspaceCreationProperties = ModifyWorkspaceCreationProperties'
  { -- | The identifier of the directory.
    ModifyWorkspaceCreationProperties -> Text
resourceId :: Prelude.Text,
    -- | The default properties for creating WorkSpaces.
    ModifyWorkspaceCreationProperties -> WorkspaceCreationProperties
workspaceCreationProperties :: WorkspaceCreationProperties
  }
  deriving (ModifyWorkspaceCreationProperties
-> ModifyWorkspaceCreationProperties -> Bool
(ModifyWorkspaceCreationProperties
 -> ModifyWorkspaceCreationProperties -> Bool)
-> (ModifyWorkspaceCreationProperties
    -> ModifyWorkspaceCreationProperties -> Bool)
-> Eq ModifyWorkspaceCreationProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyWorkspaceCreationProperties
-> ModifyWorkspaceCreationProperties -> Bool
$c/= :: ModifyWorkspaceCreationProperties
-> ModifyWorkspaceCreationProperties -> Bool
== :: ModifyWorkspaceCreationProperties
-> ModifyWorkspaceCreationProperties -> Bool
$c== :: ModifyWorkspaceCreationProperties
-> ModifyWorkspaceCreationProperties -> Bool
Prelude.Eq, ReadPrec [ModifyWorkspaceCreationProperties]
ReadPrec ModifyWorkspaceCreationProperties
Int -> ReadS ModifyWorkspaceCreationProperties
ReadS [ModifyWorkspaceCreationProperties]
(Int -> ReadS ModifyWorkspaceCreationProperties)
-> ReadS [ModifyWorkspaceCreationProperties]
-> ReadPrec ModifyWorkspaceCreationProperties
-> ReadPrec [ModifyWorkspaceCreationProperties]
-> Read ModifyWorkspaceCreationProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyWorkspaceCreationProperties]
$creadListPrec :: ReadPrec [ModifyWorkspaceCreationProperties]
readPrec :: ReadPrec ModifyWorkspaceCreationProperties
$creadPrec :: ReadPrec ModifyWorkspaceCreationProperties
readList :: ReadS [ModifyWorkspaceCreationProperties]
$creadList :: ReadS [ModifyWorkspaceCreationProperties]
readsPrec :: Int -> ReadS ModifyWorkspaceCreationProperties
$creadsPrec :: Int -> ReadS ModifyWorkspaceCreationProperties
Prelude.Read, Int -> ModifyWorkspaceCreationProperties -> ShowS
[ModifyWorkspaceCreationProperties] -> ShowS
ModifyWorkspaceCreationProperties -> String
(Int -> ModifyWorkspaceCreationProperties -> ShowS)
-> (ModifyWorkspaceCreationProperties -> String)
-> ([ModifyWorkspaceCreationProperties] -> ShowS)
-> Show ModifyWorkspaceCreationProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyWorkspaceCreationProperties] -> ShowS
$cshowList :: [ModifyWorkspaceCreationProperties] -> ShowS
show :: ModifyWorkspaceCreationProperties -> String
$cshow :: ModifyWorkspaceCreationProperties -> String
showsPrec :: Int -> ModifyWorkspaceCreationProperties -> ShowS
$cshowsPrec :: Int -> ModifyWorkspaceCreationProperties -> ShowS
Prelude.Show, (forall x.
 ModifyWorkspaceCreationProperties
 -> Rep ModifyWorkspaceCreationProperties x)
-> (forall x.
    Rep ModifyWorkspaceCreationProperties x
    -> ModifyWorkspaceCreationProperties)
-> Generic ModifyWorkspaceCreationProperties
forall x.
Rep ModifyWorkspaceCreationProperties x
-> ModifyWorkspaceCreationProperties
forall x.
ModifyWorkspaceCreationProperties
-> Rep ModifyWorkspaceCreationProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyWorkspaceCreationProperties x
-> ModifyWorkspaceCreationProperties
$cfrom :: forall x.
ModifyWorkspaceCreationProperties
-> Rep ModifyWorkspaceCreationProperties x
Prelude.Generic)

-- |
-- Create a value of 'ModifyWorkspaceCreationProperties' 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:
--
-- 'resourceId', 'modifyWorkspaceCreationProperties_resourceId' - The identifier of the directory.
--
-- 'workspaceCreationProperties', 'modifyWorkspaceCreationProperties_workspaceCreationProperties' - The default properties for creating WorkSpaces.
newModifyWorkspaceCreationProperties ::
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'workspaceCreationProperties'
  WorkspaceCreationProperties ->
  ModifyWorkspaceCreationProperties
newModifyWorkspaceCreationProperties :: Text
-> WorkspaceCreationProperties -> ModifyWorkspaceCreationProperties
newModifyWorkspaceCreationProperties
  Text
pResourceId_
  WorkspaceCreationProperties
pWorkspaceCreationProperties_ =
    ModifyWorkspaceCreationProperties' :: Text
-> WorkspaceCreationProperties -> ModifyWorkspaceCreationProperties
ModifyWorkspaceCreationProperties'
      { $sel:resourceId:ModifyWorkspaceCreationProperties' :: Text
resourceId =
          Text
pResourceId_,
        $sel:workspaceCreationProperties:ModifyWorkspaceCreationProperties' :: WorkspaceCreationProperties
workspaceCreationProperties =
          WorkspaceCreationProperties
pWorkspaceCreationProperties_
      }

-- | The identifier of the directory.
modifyWorkspaceCreationProperties_resourceId :: Lens.Lens' ModifyWorkspaceCreationProperties Prelude.Text
modifyWorkspaceCreationProperties_resourceId :: (Text -> f Text)
-> ModifyWorkspaceCreationProperties
-> f ModifyWorkspaceCreationProperties
modifyWorkspaceCreationProperties_resourceId = (ModifyWorkspaceCreationProperties -> Text)
-> (ModifyWorkspaceCreationProperties
    -> Text -> ModifyWorkspaceCreationProperties)
-> Lens
     ModifyWorkspaceCreationProperties
     ModifyWorkspaceCreationProperties
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyWorkspaceCreationProperties' {Text
resourceId :: Text
$sel:resourceId:ModifyWorkspaceCreationProperties' :: ModifyWorkspaceCreationProperties -> Text
resourceId} -> Text
resourceId) (\s :: ModifyWorkspaceCreationProperties
s@ModifyWorkspaceCreationProperties' {} Text
a -> ModifyWorkspaceCreationProperties
s {$sel:resourceId:ModifyWorkspaceCreationProperties' :: Text
resourceId = Text
a} :: ModifyWorkspaceCreationProperties)

-- | The default properties for creating WorkSpaces.
modifyWorkspaceCreationProperties_workspaceCreationProperties :: Lens.Lens' ModifyWorkspaceCreationProperties WorkspaceCreationProperties
modifyWorkspaceCreationProperties_workspaceCreationProperties :: (WorkspaceCreationProperties -> f WorkspaceCreationProperties)
-> ModifyWorkspaceCreationProperties
-> f ModifyWorkspaceCreationProperties
modifyWorkspaceCreationProperties_workspaceCreationProperties = (ModifyWorkspaceCreationProperties -> WorkspaceCreationProperties)
-> (ModifyWorkspaceCreationProperties
    -> WorkspaceCreationProperties
    -> ModifyWorkspaceCreationProperties)
-> Lens
     ModifyWorkspaceCreationProperties
     ModifyWorkspaceCreationProperties
     WorkspaceCreationProperties
     WorkspaceCreationProperties
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyWorkspaceCreationProperties' {WorkspaceCreationProperties
workspaceCreationProperties :: WorkspaceCreationProperties
$sel:workspaceCreationProperties:ModifyWorkspaceCreationProperties' :: ModifyWorkspaceCreationProperties -> WorkspaceCreationProperties
workspaceCreationProperties} -> WorkspaceCreationProperties
workspaceCreationProperties) (\s :: ModifyWorkspaceCreationProperties
s@ModifyWorkspaceCreationProperties' {} WorkspaceCreationProperties
a -> ModifyWorkspaceCreationProperties
s {$sel:workspaceCreationProperties:ModifyWorkspaceCreationProperties' :: WorkspaceCreationProperties
workspaceCreationProperties = WorkspaceCreationProperties
a} :: ModifyWorkspaceCreationProperties)

instance
  Core.AWSRequest
    ModifyWorkspaceCreationProperties
  where
  type
    AWSResponse ModifyWorkspaceCreationProperties =
      ModifyWorkspaceCreationPropertiesResponse
  request :: ModifyWorkspaceCreationProperties
-> Request ModifyWorkspaceCreationProperties
request = Service
-> ModifyWorkspaceCreationProperties
-> Request ModifyWorkspaceCreationProperties
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyWorkspaceCreationProperties
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ModifyWorkspaceCreationProperties)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse ModifyWorkspaceCreationProperties))
-> Logger
-> Service
-> Proxy ModifyWorkspaceCreationProperties
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse ModifyWorkspaceCreationProperties)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> ModifyWorkspaceCreationPropertiesResponse
ModifyWorkspaceCreationPropertiesResponse'
            (Int -> ModifyWorkspaceCreationPropertiesResponse)
-> Either String Int
-> Either String ModifyWorkspaceCreationPropertiesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    ModifyWorkspaceCreationProperties

instance
  Prelude.NFData
    ModifyWorkspaceCreationProperties

instance
  Core.ToHeaders
    ModifyWorkspaceCreationProperties
  where
  toHeaders :: ModifyWorkspaceCreationProperties -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ModifyWorkspaceCreationProperties -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkspacesService.ModifyWorkspaceCreationProperties" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    ModifyWorkspaceCreationProperties
  where
  toJSON :: ModifyWorkspaceCreationProperties -> Value
toJSON ModifyWorkspaceCreationProperties' {Text
WorkspaceCreationProperties
workspaceCreationProperties :: WorkspaceCreationProperties
resourceId :: Text
$sel:workspaceCreationProperties:ModifyWorkspaceCreationProperties' :: ModifyWorkspaceCreationProperties -> WorkspaceCreationProperties
$sel:resourceId:ModifyWorkspaceCreationProperties' :: ModifyWorkspaceCreationProperties -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"WorkspaceCreationProperties"
                  Text -> WorkspaceCreationProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WorkspaceCreationProperties
workspaceCreationProperties
              )
          ]
      )

instance
  Core.ToPath
    ModifyWorkspaceCreationProperties
  where
  toPath :: ModifyWorkspaceCreationProperties -> ByteString
toPath = ByteString -> ModifyWorkspaceCreationProperties -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

-- |
-- Create a value of 'ModifyWorkspaceCreationPropertiesResponse' 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', 'modifyWorkspaceCreationPropertiesResponse_httpStatus' - The response's http status code.
newModifyWorkspaceCreationPropertiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyWorkspaceCreationPropertiesResponse
newModifyWorkspaceCreationPropertiesResponse :: Int -> ModifyWorkspaceCreationPropertiesResponse
newModifyWorkspaceCreationPropertiesResponse
  Int
pHttpStatus_ =
    ModifyWorkspaceCreationPropertiesResponse' :: Int -> ModifyWorkspaceCreationPropertiesResponse
ModifyWorkspaceCreationPropertiesResponse'
      { $sel:httpStatus:ModifyWorkspaceCreationPropertiesResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

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

instance
  Prelude.NFData
    ModifyWorkspaceCreationPropertiesResponse