{-# 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.AMP.CreateWorkspace
-- 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)
--
-- Creates a new AMP workspace.
module Amazonka.AMP.CreateWorkspace
  ( -- * Creating a Request
    CreateWorkspace (..),
    newCreateWorkspace,

    -- * Request Lenses
    createWorkspace_clientToken,
    createWorkspace_alias,
    createWorkspace_tags,

    -- * Destructuring the Response
    CreateWorkspaceResponse (..),
    newCreateWorkspaceResponse,

    -- * Response Lenses
    createWorkspaceResponse_tags,
    createWorkspaceResponse_httpStatus,
    createWorkspaceResponse_arn,
    createWorkspaceResponse_status,
    createWorkspaceResponse_workspaceId,
  )
where

import Amazonka.AMP.Types
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

-- | Represents the input of a CreateWorkspace operation.
--
-- /See:/ 'newCreateWorkspace' smart constructor.
data CreateWorkspace = CreateWorkspace'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    CreateWorkspace -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | An optional user-assigned alias for this workspace. This alias is for
    -- user reference and does not need to be unique.
    CreateWorkspace -> Maybe Text
alias :: Prelude.Maybe Prelude.Text,
    -- | Optional, user-provided tags for this workspace.
    CreateWorkspace -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (CreateWorkspace -> CreateWorkspace -> Bool
(CreateWorkspace -> CreateWorkspace -> Bool)
-> (CreateWorkspace -> CreateWorkspace -> Bool)
-> Eq CreateWorkspace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkspace -> CreateWorkspace -> Bool
$c/= :: CreateWorkspace -> CreateWorkspace -> Bool
== :: CreateWorkspace -> CreateWorkspace -> Bool
$c== :: CreateWorkspace -> CreateWorkspace -> Bool
Prelude.Eq, ReadPrec [CreateWorkspace]
ReadPrec CreateWorkspace
Int -> ReadS CreateWorkspace
ReadS [CreateWorkspace]
(Int -> ReadS CreateWorkspace)
-> ReadS [CreateWorkspace]
-> ReadPrec CreateWorkspace
-> ReadPrec [CreateWorkspace]
-> Read CreateWorkspace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkspace]
$creadListPrec :: ReadPrec [CreateWorkspace]
readPrec :: ReadPrec CreateWorkspace
$creadPrec :: ReadPrec CreateWorkspace
readList :: ReadS [CreateWorkspace]
$creadList :: ReadS [CreateWorkspace]
readsPrec :: Int -> ReadS CreateWorkspace
$creadsPrec :: Int -> ReadS CreateWorkspace
Prelude.Read, Int -> CreateWorkspace -> ShowS
[CreateWorkspace] -> ShowS
CreateWorkspace -> String
(Int -> CreateWorkspace -> ShowS)
-> (CreateWorkspace -> String)
-> ([CreateWorkspace] -> ShowS)
-> Show CreateWorkspace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkspace] -> ShowS
$cshowList :: [CreateWorkspace] -> ShowS
show :: CreateWorkspace -> String
$cshow :: CreateWorkspace -> String
showsPrec :: Int -> CreateWorkspace -> ShowS
$cshowsPrec :: Int -> CreateWorkspace -> ShowS
Prelude.Show, (forall x. CreateWorkspace -> Rep CreateWorkspace x)
-> (forall x. Rep CreateWorkspace x -> CreateWorkspace)
-> Generic CreateWorkspace
forall x. Rep CreateWorkspace x -> CreateWorkspace
forall x. CreateWorkspace -> Rep CreateWorkspace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkspace x -> CreateWorkspace
$cfrom :: forall x. CreateWorkspace -> Rep CreateWorkspace x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkspace' 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', 'createWorkspace_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'alias', 'createWorkspace_alias' - An optional user-assigned alias for this workspace. This alias is for
-- user reference and does not need to be unique.
--
-- 'tags', 'createWorkspace_tags' - Optional, user-provided tags for this workspace.
newCreateWorkspace ::
  CreateWorkspace
newCreateWorkspace :: CreateWorkspace
newCreateWorkspace =
  CreateWorkspace' :: Maybe Text
-> Maybe Text -> Maybe (HashMap Text Text) -> CreateWorkspace
CreateWorkspace'
    { $sel:clientToken:CreateWorkspace' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:alias:CreateWorkspace' :: Maybe Text
alias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWorkspace' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
createWorkspace_clientToken :: Lens.Lens' CreateWorkspace (Prelude.Maybe Prelude.Text)
createWorkspace_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateWorkspace -> f CreateWorkspace
createWorkspace_clientToken = (CreateWorkspace -> Maybe Text)
-> (CreateWorkspace -> Maybe Text -> CreateWorkspace)
-> Lens CreateWorkspace CreateWorkspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspace' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateWorkspace' :: CreateWorkspace -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateWorkspace
s@CreateWorkspace' {} Maybe Text
a -> CreateWorkspace
s {$sel:clientToken:CreateWorkspace' :: Maybe Text
clientToken = Maybe Text
a} :: CreateWorkspace)

-- | An optional user-assigned alias for this workspace. This alias is for
-- user reference and does not need to be unique.
createWorkspace_alias :: Lens.Lens' CreateWorkspace (Prelude.Maybe Prelude.Text)
createWorkspace_alias :: (Maybe Text -> f (Maybe Text))
-> CreateWorkspace -> f CreateWorkspace
createWorkspace_alias = (CreateWorkspace -> Maybe Text)
-> (CreateWorkspace -> Maybe Text -> CreateWorkspace)
-> Lens CreateWorkspace CreateWorkspace (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspace' {Maybe Text
alias :: Maybe Text
$sel:alias:CreateWorkspace' :: CreateWorkspace -> Maybe Text
alias} -> Maybe Text
alias) (\s :: CreateWorkspace
s@CreateWorkspace' {} Maybe Text
a -> CreateWorkspace
s {$sel:alias:CreateWorkspace' :: Maybe Text
alias = Maybe Text
a} :: CreateWorkspace)

-- | Optional, user-provided tags for this workspace.
createWorkspace_tags :: Lens.Lens' CreateWorkspace (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorkspace_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkspace -> f CreateWorkspace
createWorkspace_tags = (CreateWorkspace -> Maybe (HashMap Text Text))
-> (CreateWorkspace
    -> Maybe (HashMap Text Text) -> CreateWorkspace)
-> Lens
     CreateWorkspace
     CreateWorkspace
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspace' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorkspace' :: CreateWorkspace -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorkspace
s@CreateWorkspace' {} Maybe (HashMap Text Text)
a -> CreateWorkspace
s {$sel:tags:CreateWorkspace' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorkspace) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorkspace -> f CreateWorkspace)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkspace
-> f CreateWorkspace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateWorkspace where
  type
    AWSResponse CreateWorkspace =
      CreateWorkspaceResponse
  request :: CreateWorkspace -> Request CreateWorkspace
request = Service -> CreateWorkspace -> Request CreateWorkspace
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorkspace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkspace)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorkspace))
-> Logger
-> Service
-> Proxy CreateWorkspace
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkspace)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (HashMap Text Text)
-> Int
-> Text
-> WorkspaceStatus
-> Text
-> CreateWorkspaceResponse
CreateWorkspaceResponse'
            (Maybe (HashMap Text Text)
 -> Int
 -> Text
 -> WorkspaceStatus
 -> Text
 -> CreateWorkspaceResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Int -> Text -> WorkspaceStatus -> Text -> CreateWorkspaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Int -> Text -> WorkspaceStatus -> Text -> CreateWorkspaceResponse)
-> Either String Int
-> Either
     String (Text -> WorkspaceStatus -> Text -> CreateWorkspaceResponse)
forall (f :: * -> *) a b. Applicative f => 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))
            Either
  String (Text -> WorkspaceStatus -> Text -> CreateWorkspaceResponse)
-> Either String Text
-> Either
     String (WorkspaceStatus -> Text -> CreateWorkspaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"arn")
            Either String (WorkspaceStatus -> Text -> CreateWorkspaceResponse)
-> Either String WorkspaceStatus
-> Either String (Text -> CreateWorkspaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String WorkspaceStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
            Either String (Text -> CreateWorkspaceResponse)
-> Either String Text -> Either String CreateWorkspaceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"workspaceId")
      )

instance Prelude.Hashable CreateWorkspace

instance Prelude.NFData CreateWorkspace

instance Core.ToHeaders CreateWorkspace where
  toHeaders :: CreateWorkspace -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkspace -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateWorkspace where
  toJSON :: CreateWorkspace -> Value
toJSON CreateWorkspace' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
alias :: Maybe Text
clientToken :: Maybe Text
$sel:tags:CreateWorkspace' :: CreateWorkspace -> Maybe (HashMap Text Text)
$sel:alias:CreateWorkspace' :: CreateWorkspace -> Maybe Text
$sel:clientToken:CreateWorkspace' :: CreateWorkspace -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"alias" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
alias,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags
          ]
      )

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

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

-- | Represents the output of a CreateWorkspace operation.
--
-- /See:/ 'newCreateWorkspaceResponse' smart constructor.
data CreateWorkspaceResponse = CreateWorkspaceResponse'
  { -- | The tags of this workspace.
    CreateWorkspaceResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    CreateWorkspaceResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ARN of the workspace that was just created.
    CreateWorkspaceResponse -> Text
arn :: Prelude.Text,
    -- | The status of the workspace that was just created (usually CREATING).
    CreateWorkspaceResponse -> WorkspaceStatus
status :: WorkspaceStatus,
    -- | The generated ID of the workspace that was just created.
    CreateWorkspaceResponse -> Text
workspaceId :: Prelude.Text
  }
  deriving (CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool
(CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool)
-> (CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool)
-> Eq CreateWorkspaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool
$c/= :: CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool
== :: CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool
$c== :: CreateWorkspaceResponse -> CreateWorkspaceResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkspaceResponse]
ReadPrec CreateWorkspaceResponse
Int -> ReadS CreateWorkspaceResponse
ReadS [CreateWorkspaceResponse]
(Int -> ReadS CreateWorkspaceResponse)
-> ReadS [CreateWorkspaceResponse]
-> ReadPrec CreateWorkspaceResponse
-> ReadPrec [CreateWorkspaceResponse]
-> Read CreateWorkspaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkspaceResponse]
$creadListPrec :: ReadPrec [CreateWorkspaceResponse]
readPrec :: ReadPrec CreateWorkspaceResponse
$creadPrec :: ReadPrec CreateWorkspaceResponse
readList :: ReadS [CreateWorkspaceResponse]
$creadList :: ReadS [CreateWorkspaceResponse]
readsPrec :: Int -> ReadS CreateWorkspaceResponse
$creadsPrec :: Int -> ReadS CreateWorkspaceResponse
Prelude.Read, Int -> CreateWorkspaceResponse -> ShowS
[CreateWorkspaceResponse] -> ShowS
CreateWorkspaceResponse -> String
(Int -> CreateWorkspaceResponse -> ShowS)
-> (CreateWorkspaceResponse -> String)
-> ([CreateWorkspaceResponse] -> ShowS)
-> Show CreateWorkspaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkspaceResponse] -> ShowS
$cshowList :: [CreateWorkspaceResponse] -> ShowS
show :: CreateWorkspaceResponse -> String
$cshow :: CreateWorkspaceResponse -> String
showsPrec :: Int -> CreateWorkspaceResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkspaceResponse -> ShowS
Prelude.Show, (forall x.
 CreateWorkspaceResponse -> Rep CreateWorkspaceResponse x)
-> (forall x.
    Rep CreateWorkspaceResponse x -> CreateWorkspaceResponse)
-> Generic CreateWorkspaceResponse
forall x. Rep CreateWorkspaceResponse x -> CreateWorkspaceResponse
forall x. CreateWorkspaceResponse -> Rep CreateWorkspaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkspaceResponse x -> CreateWorkspaceResponse
$cfrom :: forall x. CreateWorkspaceResponse -> Rep CreateWorkspaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkspaceResponse' 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:
--
-- 'tags', 'createWorkspaceResponse_tags' - The tags of this workspace.
--
-- 'httpStatus', 'createWorkspaceResponse_httpStatus' - The response's http status code.
--
-- 'arn', 'createWorkspaceResponse_arn' - The ARN of the workspace that was just created.
--
-- 'status', 'createWorkspaceResponse_status' - The status of the workspace that was just created (usually CREATING).
--
-- 'workspaceId', 'createWorkspaceResponse_workspaceId' - The generated ID of the workspace that was just created.
newCreateWorkspaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'status'
  WorkspaceStatus ->
  -- | 'workspaceId'
  Prelude.Text ->
  CreateWorkspaceResponse
newCreateWorkspaceResponse :: Int -> Text -> WorkspaceStatus -> Text -> CreateWorkspaceResponse
newCreateWorkspaceResponse
  Int
pHttpStatus_
  Text
pArn_
  WorkspaceStatus
pStatus_
  Text
pWorkspaceId_ =
    CreateWorkspaceResponse' :: Maybe (HashMap Text Text)
-> Int
-> Text
-> WorkspaceStatus
-> Text
-> CreateWorkspaceResponse
CreateWorkspaceResponse'
      { $sel:tags:CreateWorkspaceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateWorkspaceResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:arn:CreateWorkspaceResponse' :: Text
arn = Text
pArn_,
        $sel:status:CreateWorkspaceResponse' :: WorkspaceStatus
status = WorkspaceStatus
pStatus_,
        $sel:workspaceId:CreateWorkspaceResponse' :: Text
workspaceId = Text
pWorkspaceId_
      }

-- | The tags of this workspace.
createWorkspaceResponse_tags :: Lens.Lens' CreateWorkspaceResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createWorkspaceResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkspaceResponse -> f CreateWorkspaceResponse
createWorkspaceResponse_tags = (CreateWorkspaceResponse -> Maybe (HashMap Text Text))
-> (CreateWorkspaceResponse
    -> Maybe (HashMap Text Text) -> CreateWorkspaceResponse)
-> Lens
     CreateWorkspaceResponse
     CreateWorkspaceResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspaceResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateWorkspaceResponse' :: CreateWorkspaceResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateWorkspaceResponse
s@CreateWorkspaceResponse' {} Maybe (HashMap Text Text)
a -> CreateWorkspaceResponse
s {$sel:tags:CreateWorkspaceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateWorkspaceResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateWorkspaceResponse -> f CreateWorkspaceResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateWorkspaceResponse
-> f CreateWorkspaceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The ARN of the workspace that was just created.
createWorkspaceResponse_arn :: Lens.Lens' CreateWorkspaceResponse Prelude.Text
createWorkspaceResponse_arn :: (Text -> f Text)
-> CreateWorkspaceResponse -> f CreateWorkspaceResponse
createWorkspaceResponse_arn = (CreateWorkspaceResponse -> Text)
-> (CreateWorkspaceResponse -> Text -> CreateWorkspaceResponse)
-> Lens CreateWorkspaceResponse CreateWorkspaceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspaceResponse' {Text
arn :: Text
$sel:arn:CreateWorkspaceResponse' :: CreateWorkspaceResponse -> Text
arn} -> Text
arn) (\s :: CreateWorkspaceResponse
s@CreateWorkspaceResponse' {} Text
a -> CreateWorkspaceResponse
s {$sel:arn:CreateWorkspaceResponse' :: Text
arn = Text
a} :: CreateWorkspaceResponse)

-- | The status of the workspace that was just created (usually CREATING).
createWorkspaceResponse_status :: Lens.Lens' CreateWorkspaceResponse WorkspaceStatus
createWorkspaceResponse_status :: (WorkspaceStatus -> f WorkspaceStatus)
-> CreateWorkspaceResponse -> f CreateWorkspaceResponse
createWorkspaceResponse_status = (CreateWorkspaceResponse -> WorkspaceStatus)
-> (CreateWorkspaceResponse
    -> WorkspaceStatus -> CreateWorkspaceResponse)
-> Lens
     CreateWorkspaceResponse
     CreateWorkspaceResponse
     WorkspaceStatus
     WorkspaceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspaceResponse' {WorkspaceStatus
status :: WorkspaceStatus
$sel:status:CreateWorkspaceResponse' :: CreateWorkspaceResponse -> WorkspaceStatus
status} -> WorkspaceStatus
status) (\s :: CreateWorkspaceResponse
s@CreateWorkspaceResponse' {} WorkspaceStatus
a -> CreateWorkspaceResponse
s {$sel:status:CreateWorkspaceResponse' :: WorkspaceStatus
status = WorkspaceStatus
a} :: CreateWorkspaceResponse)

-- | The generated ID of the workspace that was just created.
createWorkspaceResponse_workspaceId :: Lens.Lens' CreateWorkspaceResponse Prelude.Text
createWorkspaceResponse_workspaceId :: (Text -> f Text)
-> CreateWorkspaceResponse -> f CreateWorkspaceResponse
createWorkspaceResponse_workspaceId = (CreateWorkspaceResponse -> Text)
-> (CreateWorkspaceResponse -> Text -> CreateWorkspaceResponse)
-> Lens CreateWorkspaceResponse CreateWorkspaceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspaceResponse' {Text
workspaceId :: Text
$sel:workspaceId:CreateWorkspaceResponse' :: CreateWorkspaceResponse -> Text
workspaceId} -> Text
workspaceId) (\s :: CreateWorkspaceResponse
s@CreateWorkspaceResponse' {} Text
a -> CreateWorkspaceResponse
s {$sel:workspaceId:CreateWorkspaceResponse' :: Text
workspaceId = Text
a} :: CreateWorkspaceResponse)

instance Prelude.NFData CreateWorkspaceResponse