{-# 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.CreateWorkspaces
-- 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 one or more WorkSpaces.
--
-- This operation is asynchronous and returns before the WorkSpaces are
-- created.
module Amazonka.WorkSpaces.CreateWorkspaces
  ( -- * Creating a Request
    CreateWorkspaces (..),
    newCreateWorkspaces,

    -- * Request Lenses
    createWorkspaces_workspaces,

    -- * Destructuring the Response
    CreateWorkspacesResponse (..),
    newCreateWorkspacesResponse,

    -- * Response Lenses
    createWorkspacesResponse_failedRequests,
    createWorkspacesResponse_pendingRequests,
    createWorkspacesResponse_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:/ 'newCreateWorkspaces' smart constructor.
data CreateWorkspaces = CreateWorkspaces'
  { -- | The WorkSpaces to create. You can specify up to 25 WorkSpaces.
    CreateWorkspaces -> NonEmpty WorkspaceRequest
workspaces :: Prelude.NonEmpty WorkspaceRequest
  }
  deriving (CreateWorkspaces -> CreateWorkspaces -> Bool
(CreateWorkspaces -> CreateWorkspaces -> Bool)
-> (CreateWorkspaces -> CreateWorkspaces -> Bool)
-> Eq CreateWorkspaces
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkspaces -> CreateWorkspaces -> Bool
$c/= :: CreateWorkspaces -> CreateWorkspaces -> Bool
== :: CreateWorkspaces -> CreateWorkspaces -> Bool
$c== :: CreateWorkspaces -> CreateWorkspaces -> Bool
Prelude.Eq, ReadPrec [CreateWorkspaces]
ReadPrec CreateWorkspaces
Int -> ReadS CreateWorkspaces
ReadS [CreateWorkspaces]
(Int -> ReadS CreateWorkspaces)
-> ReadS [CreateWorkspaces]
-> ReadPrec CreateWorkspaces
-> ReadPrec [CreateWorkspaces]
-> Read CreateWorkspaces
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkspaces]
$creadListPrec :: ReadPrec [CreateWorkspaces]
readPrec :: ReadPrec CreateWorkspaces
$creadPrec :: ReadPrec CreateWorkspaces
readList :: ReadS [CreateWorkspaces]
$creadList :: ReadS [CreateWorkspaces]
readsPrec :: Int -> ReadS CreateWorkspaces
$creadsPrec :: Int -> ReadS CreateWorkspaces
Prelude.Read, Int -> CreateWorkspaces -> ShowS
[CreateWorkspaces] -> ShowS
CreateWorkspaces -> String
(Int -> CreateWorkspaces -> ShowS)
-> (CreateWorkspaces -> String)
-> ([CreateWorkspaces] -> ShowS)
-> Show CreateWorkspaces
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkspaces] -> ShowS
$cshowList :: [CreateWorkspaces] -> ShowS
show :: CreateWorkspaces -> String
$cshow :: CreateWorkspaces -> String
showsPrec :: Int -> CreateWorkspaces -> ShowS
$cshowsPrec :: Int -> CreateWorkspaces -> ShowS
Prelude.Show, (forall x. CreateWorkspaces -> Rep CreateWorkspaces x)
-> (forall x. Rep CreateWorkspaces x -> CreateWorkspaces)
-> Generic CreateWorkspaces
forall x. Rep CreateWorkspaces x -> CreateWorkspaces
forall x. CreateWorkspaces -> Rep CreateWorkspaces x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkspaces x -> CreateWorkspaces
$cfrom :: forall x. CreateWorkspaces -> Rep CreateWorkspaces x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkspaces' 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:
--
-- 'workspaces', 'createWorkspaces_workspaces' - The WorkSpaces to create. You can specify up to 25 WorkSpaces.
newCreateWorkspaces ::
  -- | 'workspaces'
  Prelude.NonEmpty WorkspaceRequest ->
  CreateWorkspaces
newCreateWorkspaces :: NonEmpty WorkspaceRequest -> CreateWorkspaces
newCreateWorkspaces NonEmpty WorkspaceRequest
pWorkspaces_ =
  CreateWorkspaces' :: NonEmpty WorkspaceRequest -> CreateWorkspaces
CreateWorkspaces'
    { $sel:workspaces:CreateWorkspaces' :: NonEmpty WorkspaceRequest
workspaces =
        Tagged
  (NonEmpty WorkspaceRequest) (Identity (NonEmpty WorkspaceRequest))
-> Tagged
     (NonEmpty WorkspaceRequest) (Identity (NonEmpty WorkspaceRequest))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty WorkspaceRequest) (Identity (NonEmpty WorkspaceRequest))
 -> Tagged
      (NonEmpty WorkspaceRequest) (Identity (NonEmpty WorkspaceRequest)))
-> NonEmpty WorkspaceRequest -> NonEmpty WorkspaceRequest
forall t b. AReview t b -> b -> t
Lens.# NonEmpty WorkspaceRequest
pWorkspaces_
    }

-- | The WorkSpaces to create. You can specify up to 25 WorkSpaces.
createWorkspaces_workspaces :: Lens.Lens' CreateWorkspaces (Prelude.NonEmpty WorkspaceRequest)
createWorkspaces_workspaces :: (NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
-> CreateWorkspaces -> f CreateWorkspaces
createWorkspaces_workspaces = (CreateWorkspaces -> NonEmpty WorkspaceRequest)
-> (CreateWorkspaces
    -> NonEmpty WorkspaceRequest -> CreateWorkspaces)
-> Lens
     CreateWorkspaces
     CreateWorkspaces
     (NonEmpty WorkspaceRequest)
     (NonEmpty WorkspaceRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspaces' {NonEmpty WorkspaceRequest
workspaces :: NonEmpty WorkspaceRequest
$sel:workspaces:CreateWorkspaces' :: CreateWorkspaces -> NonEmpty WorkspaceRequest
workspaces} -> NonEmpty WorkspaceRequest
workspaces) (\s :: CreateWorkspaces
s@CreateWorkspaces' {} NonEmpty WorkspaceRequest
a -> CreateWorkspaces
s {$sel:workspaces:CreateWorkspaces' :: NonEmpty WorkspaceRequest
workspaces = NonEmpty WorkspaceRequest
a} :: CreateWorkspaces) ((NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
 -> CreateWorkspaces -> f CreateWorkspaces)
-> ((NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
    -> NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
-> (NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
-> CreateWorkspaces
-> f CreateWorkspaces
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest))
-> NonEmpty WorkspaceRequest -> f (NonEmpty WorkspaceRequest)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateWorkspaces where
  type
    AWSResponse CreateWorkspaces =
      CreateWorkspacesResponse
  request :: CreateWorkspaces -> Request CreateWorkspaces
request = Service -> CreateWorkspaces -> Request CreateWorkspaces
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWorkspaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkspaces)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWorkspaces))
-> Logger
-> Service
-> Proxy CreateWorkspaces
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateWorkspaces)))
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 [FailedCreateWorkspaceRequest]
-> Maybe [Workspace] -> Int -> CreateWorkspacesResponse
CreateWorkspacesResponse'
            (Maybe [FailedCreateWorkspaceRequest]
 -> Maybe [Workspace] -> Int -> CreateWorkspacesResponse)
-> Either String (Maybe [FailedCreateWorkspaceRequest])
-> Either
     String (Maybe [Workspace] -> Int -> CreateWorkspacesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Key
-> Either String (Maybe (Maybe [FailedCreateWorkspaceRequest]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"FailedRequests" Either String (Maybe (Maybe [FailedCreateWorkspaceRequest]))
-> Maybe [FailedCreateWorkspaceRequest]
-> Either String (Maybe [FailedCreateWorkspaceRequest])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FailedCreateWorkspaceRequest]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe [Workspace] -> Int -> CreateWorkspacesResponse)
-> Either String (Maybe [Workspace])
-> Either String (Int -> CreateWorkspacesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Key -> Either String (Maybe (Maybe [Workspace]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"PendingRequests"
                            Either String (Maybe (Maybe [Workspace]))
-> Maybe [Workspace] -> Either String (Maybe [Workspace])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Workspace]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> CreateWorkspacesResponse)
-> Either String Int -> Either String CreateWorkspacesResponse
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))
      )

instance Prelude.Hashable CreateWorkspaces

instance Prelude.NFData CreateWorkspaces

instance Core.ToHeaders CreateWorkspaces where
  toHeaders :: CreateWorkspaces -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkspaces -> 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.CreateWorkspaces" ::
                          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 CreateWorkspaces where
  toJSON :: CreateWorkspaces -> Value
toJSON CreateWorkspaces' {NonEmpty WorkspaceRequest
workspaces :: NonEmpty WorkspaceRequest
$sel:workspaces:CreateWorkspaces' :: CreateWorkspaces -> NonEmpty WorkspaceRequest
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"Workspaces" Key -> NonEmpty WorkspaceRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= NonEmpty WorkspaceRequest
workspaces)]
      )

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

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

-- | /See:/ 'newCreateWorkspacesResponse' smart constructor.
data CreateWorkspacesResponse = CreateWorkspacesResponse'
  { -- | Information about the WorkSpaces that could not be created.
    CreateWorkspacesResponse -> Maybe [FailedCreateWorkspaceRequest]
failedRequests :: Prelude.Maybe [FailedCreateWorkspaceRequest],
    -- | Information about the WorkSpaces that were created.
    --
    -- Because this operation is asynchronous, the identifier returned is not
    -- immediately available for use with other operations. For example, if you
    -- call DescribeWorkspaces before the WorkSpace is created, the information
    -- returned can be incomplete.
    CreateWorkspacesResponse -> Maybe [Workspace]
pendingRequests :: Prelude.Maybe [Workspace],
    -- | The response's http status code.
    CreateWorkspacesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool
(CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool)
-> (CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool)
-> Eq CreateWorkspacesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool
$c/= :: CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool
== :: CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool
$c== :: CreateWorkspacesResponse -> CreateWorkspacesResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkspacesResponse]
ReadPrec CreateWorkspacesResponse
Int -> ReadS CreateWorkspacesResponse
ReadS [CreateWorkspacesResponse]
(Int -> ReadS CreateWorkspacesResponse)
-> ReadS [CreateWorkspacesResponse]
-> ReadPrec CreateWorkspacesResponse
-> ReadPrec [CreateWorkspacesResponse]
-> Read CreateWorkspacesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkspacesResponse]
$creadListPrec :: ReadPrec [CreateWorkspacesResponse]
readPrec :: ReadPrec CreateWorkspacesResponse
$creadPrec :: ReadPrec CreateWorkspacesResponse
readList :: ReadS [CreateWorkspacesResponse]
$creadList :: ReadS [CreateWorkspacesResponse]
readsPrec :: Int -> ReadS CreateWorkspacesResponse
$creadsPrec :: Int -> ReadS CreateWorkspacesResponse
Prelude.Read, Int -> CreateWorkspacesResponse -> ShowS
[CreateWorkspacesResponse] -> ShowS
CreateWorkspacesResponse -> String
(Int -> CreateWorkspacesResponse -> ShowS)
-> (CreateWorkspacesResponse -> String)
-> ([CreateWorkspacesResponse] -> ShowS)
-> Show CreateWorkspacesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkspacesResponse] -> ShowS
$cshowList :: [CreateWorkspacesResponse] -> ShowS
show :: CreateWorkspacesResponse -> String
$cshow :: CreateWorkspacesResponse -> String
showsPrec :: Int -> CreateWorkspacesResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkspacesResponse -> ShowS
Prelude.Show, (forall x.
 CreateWorkspacesResponse -> Rep CreateWorkspacesResponse x)
-> (forall x.
    Rep CreateWorkspacesResponse x -> CreateWorkspacesResponse)
-> Generic CreateWorkspacesResponse
forall x.
Rep CreateWorkspacesResponse x -> CreateWorkspacesResponse
forall x.
CreateWorkspacesResponse -> Rep CreateWorkspacesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorkspacesResponse x -> CreateWorkspacesResponse
$cfrom :: forall x.
CreateWorkspacesResponse -> Rep CreateWorkspacesResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkspacesResponse' 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:
--
-- 'failedRequests', 'createWorkspacesResponse_failedRequests' - Information about the WorkSpaces that could not be created.
--
-- 'pendingRequests', 'createWorkspacesResponse_pendingRequests' - Information about the WorkSpaces that were created.
--
-- Because this operation is asynchronous, the identifier returned is not
-- immediately available for use with other operations. For example, if you
-- call DescribeWorkspaces before the WorkSpace is created, the information
-- returned can be incomplete.
--
-- 'httpStatus', 'createWorkspacesResponse_httpStatus' - The response's http status code.
newCreateWorkspacesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkspacesResponse
newCreateWorkspacesResponse :: Int -> CreateWorkspacesResponse
newCreateWorkspacesResponse Int
pHttpStatus_ =
  CreateWorkspacesResponse' :: Maybe [FailedCreateWorkspaceRequest]
-> Maybe [Workspace] -> Int -> CreateWorkspacesResponse
CreateWorkspacesResponse'
    { $sel:failedRequests:CreateWorkspacesResponse' :: Maybe [FailedCreateWorkspaceRequest]
failedRequests =
        Maybe [FailedCreateWorkspaceRequest]
forall a. Maybe a
Prelude.Nothing,
      $sel:pendingRequests:CreateWorkspacesResponse' :: Maybe [Workspace]
pendingRequests = Maybe [Workspace]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkspacesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the WorkSpaces that could not be created.
createWorkspacesResponse_failedRequests :: Lens.Lens' CreateWorkspacesResponse (Prelude.Maybe [FailedCreateWorkspaceRequest])
createWorkspacesResponse_failedRequests :: (Maybe [FailedCreateWorkspaceRequest]
 -> f (Maybe [FailedCreateWorkspaceRequest]))
-> CreateWorkspacesResponse -> f CreateWorkspacesResponse
createWorkspacesResponse_failedRequests = (CreateWorkspacesResponse -> Maybe [FailedCreateWorkspaceRequest])
-> (CreateWorkspacesResponse
    -> Maybe [FailedCreateWorkspaceRequest]
    -> CreateWorkspacesResponse)
-> Lens
     CreateWorkspacesResponse
     CreateWorkspacesResponse
     (Maybe [FailedCreateWorkspaceRequest])
     (Maybe [FailedCreateWorkspaceRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspacesResponse' {Maybe [FailedCreateWorkspaceRequest]
failedRequests :: Maybe [FailedCreateWorkspaceRequest]
$sel:failedRequests:CreateWorkspacesResponse' :: CreateWorkspacesResponse -> Maybe [FailedCreateWorkspaceRequest]
failedRequests} -> Maybe [FailedCreateWorkspaceRequest]
failedRequests) (\s :: CreateWorkspacesResponse
s@CreateWorkspacesResponse' {} Maybe [FailedCreateWorkspaceRequest]
a -> CreateWorkspacesResponse
s {$sel:failedRequests:CreateWorkspacesResponse' :: Maybe [FailedCreateWorkspaceRequest]
failedRequests = Maybe [FailedCreateWorkspaceRequest]
a} :: CreateWorkspacesResponse) ((Maybe [FailedCreateWorkspaceRequest]
  -> f (Maybe [FailedCreateWorkspaceRequest]))
 -> CreateWorkspacesResponse -> f CreateWorkspacesResponse)
-> ((Maybe [FailedCreateWorkspaceRequest]
     -> f (Maybe [FailedCreateWorkspaceRequest]))
    -> Maybe [FailedCreateWorkspaceRequest]
    -> f (Maybe [FailedCreateWorkspaceRequest]))
-> (Maybe [FailedCreateWorkspaceRequest]
    -> f (Maybe [FailedCreateWorkspaceRequest]))
-> CreateWorkspacesResponse
-> f CreateWorkspacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
-> Iso
     (Maybe [FailedCreateWorkspaceRequest])
     (Maybe [FailedCreateWorkspaceRequest])
     (Maybe [FailedCreateWorkspaceRequest])
     (Maybe [FailedCreateWorkspaceRequest])
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
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
  [FailedCreateWorkspaceRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the WorkSpaces that were created.
--
-- Because this operation is asynchronous, the identifier returned is not
-- immediately available for use with other operations. For example, if you
-- call DescribeWorkspaces before the WorkSpace is created, the information
-- returned can be incomplete.
createWorkspacesResponse_pendingRequests :: Lens.Lens' CreateWorkspacesResponse (Prelude.Maybe [Workspace])
createWorkspacesResponse_pendingRequests :: (Maybe [Workspace] -> f (Maybe [Workspace]))
-> CreateWorkspacesResponse -> f CreateWorkspacesResponse
createWorkspacesResponse_pendingRequests = (CreateWorkspacesResponse -> Maybe [Workspace])
-> (CreateWorkspacesResponse
    -> Maybe [Workspace] -> CreateWorkspacesResponse)
-> Lens
     CreateWorkspacesResponse
     CreateWorkspacesResponse
     (Maybe [Workspace])
     (Maybe [Workspace])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkspacesResponse' {Maybe [Workspace]
pendingRequests :: Maybe [Workspace]
$sel:pendingRequests:CreateWorkspacesResponse' :: CreateWorkspacesResponse -> Maybe [Workspace]
pendingRequests} -> Maybe [Workspace]
pendingRequests) (\s :: CreateWorkspacesResponse
s@CreateWorkspacesResponse' {} Maybe [Workspace]
a -> CreateWorkspacesResponse
s {$sel:pendingRequests:CreateWorkspacesResponse' :: Maybe [Workspace]
pendingRequests = Maybe [Workspace]
a} :: CreateWorkspacesResponse) ((Maybe [Workspace] -> f (Maybe [Workspace]))
 -> CreateWorkspacesResponse -> f CreateWorkspacesResponse)
-> ((Maybe [Workspace] -> f (Maybe [Workspace]))
    -> Maybe [Workspace] -> f (Maybe [Workspace]))
-> (Maybe [Workspace] -> f (Maybe [Workspace]))
-> CreateWorkspacesResponse
-> f CreateWorkspacesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Workspace] [Workspace] [Workspace] [Workspace]
-> Iso
     (Maybe [Workspace])
     (Maybe [Workspace])
     (Maybe [Workspace])
     (Maybe [Workspace])
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 [Workspace] [Workspace] [Workspace] [Workspace]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateWorkspacesResponse