{-# 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.CreateUpdatedWorkspaceImage
-- 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 updated WorkSpace image based on the specified source
-- image. The new updated WorkSpace image has the latest drivers and other
-- updates required by the Amazon WorkSpaces components.
--
-- To determine which WorkSpace images need to be updated with the latest
-- Amazon WorkSpaces requirements, use
-- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html DescribeWorkspaceImages>.
--
-- -   Only Windows 10 WorkSpace images can be programmatically updated at
--     this time.
--
-- -   Microsoft Windows updates and other application updates are not
--     included in the update process.
--
-- -   The source WorkSpace image is not deleted. You can delete the source
--     image after you\'ve verified your new updated image and created a
--     new bundle.
module Amazonka.WorkSpaces.CreateUpdatedWorkspaceImage
  ( -- * Creating a Request
    CreateUpdatedWorkspaceImage (..),
    newCreateUpdatedWorkspaceImage,

    -- * Request Lenses
    createUpdatedWorkspaceImage_tags,
    createUpdatedWorkspaceImage_name,
    createUpdatedWorkspaceImage_description,
    createUpdatedWorkspaceImage_sourceImageId,

    -- * Destructuring the Response
    CreateUpdatedWorkspaceImageResponse (..),
    newCreateUpdatedWorkspaceImageResponse,

    -- * Response Lenses
    createUpdatedWorkspaceImageResponse_imageId,
    createUpdatedWorkspaceImageResponse_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:/ 'newCreateUpdatedWorkspaceImage' smart constructor.
data CreateUpdatedWorkspaceImage = CreateUpdatedWorkspaceImage'
  { -- | The tags that you want to add to the new updated WorkSpace image.
    --
    -- To add tags at the same time when you\'re creating the updated image,
    -- you must create an IAM policy that grants your IAM user permissions to
    -- use @workspaces:CreateTags@.
    CreateUpdatedWorkspaceImage -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the new updated WorkSpace image.
    CreateUpdatedWorkspaceImage -> Text
name :: Prelude.Text,
    -- | A description of whether updates for the WorkSpace image are available.
    CreateUpdatedWorkspaceImage -> Text
description :: Prelude.Text,
    -- | The identifier of the source WorkSpace image.
    CreateUpdatedWorkspaceImage -> Text
sourceImageId :: Prelude.Text
  }
  deriving (CreateUpdatedWorkspaceImage -> CreateUpdatedWorkspaceImage -> Bool
(CreateUpdatedWorkspaceImage
 -> CreateUpdatedWorkspaceImage -> Bool)
-> (CreateUpdatedWorkspaceImage
    -> CreateUpdatedWorkspaceImage -> Bool)
-> Eq CreateUpdatedWorkspaceImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateUpdatedWorkspaceImage -> CreateUpdatedWorkspaceImage -> Bool
$c/= :: CreateUpdatedWorkspaceImage -> CreateUpdatedWorkspaceImage -> Bool
== :: CreateUpdatedWorkspaceImage -> CreateUpdatedWorkspaceImage -> Bool
$c== :: CreateUpdatedWorkspaceImage -> CreateUpdatedWorkspaceImage -> Bool
Prelude.Eq, ReadPrec [CreateUpdatedWorkspaceImage]
ReadPrec CreateUpdatedWorkspaceImage
Int -> ReadS CreateUpdatedWorkspaceImage
ReadS [CreateUpdatedWorkspaceImage]
(Int -> ReadS CreateUpdatedWorkspaceImage)
-> ReadS [CreateUpdatedWorkspaceImage]
-> ReadPrec CreateUpdatedWorkspaceImage
-> ReadPrec [CreateUpdatedWorkspaceImage]
-> Read CreateUpdatedWorkspaceImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateUpdatedWorkspaceImage]
$creadListPrec :: ReadPrec [CreateUpdatedWorkspaceImage]
readPrec :: ReadPrec CreateUpdatedWorkspaceImage
$creadPrec :: ReadPrec CreateUpdatedWorkspaceImage
readList :: ReadS [CreateUpdatedWorkspaceImage]
$creadList :: ReadS [CreateUpdatedWorkspaceImage]
readsPrec :: Int -> ReadS CreateUpdatedWorkspaceImage
$creadsPrec :: Int -> ReadS CreateUpdatedWorkspaceImage
Prelude.Read, Int -> CreateUpdatedWorkspaceImage -> ShowS
[CreateUpdatedWorkspaceImage] -> ShowS
CreateUpdatedWorkspaceImage -> String
(Int -> CreateUpdatedWorkspaceImage -> ShowS)
-> (CreateUpdatedWorkspaceImage -> String)
-> ([CreateUpdatedWorkspaceImage] -> ShowS)
-> Show CreateUpdatedWorkspaceImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateUpdatedWorkspaceImage] -> ShowS
$cshowList :: [CreateUpdatedWorkspaceImage] -> ShowS
show :: CreateUpdatedWorkspaceImage -> String
$cshow :: CreateUpdatedWorkspaceImage -> String
showsPrec :: Int -> CreateUpdatedWorkspaceImage -> ShowS
$cshowsPrec :: Int -> CreateUpdatedWorkspaceImage -> ShowS
Prelude.Show, (forall x.
 CreateUpdatedWorkspaceImage -> Rep CreateUpdatedWorkspaceImage x)
-> (forall x.
    Rep CreateUpdatedWorkspaceImage x -> CreateUpdatedWorkspaceImage)
-> Generic CreateUpdatedWorkspaceImage
forall x.
Rep CreateUpdatedWorkspaceImage x -> CreateUpdatedWorkspaceImage
forall x.
CreateUpdatedWorkspaceImage -> Rep CreateUpdatedWorkspaceImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateUpdatedWorkspaceImage x -> CreateUpdatedWorkspaceImage
$cfrom :: forall x.
CreateUpdatedWorkspaceImage -> Rep CreateUpdatedWorkspaceImage x
Prelude.Generic)

-- |
-- Create a value of 'CreateUpdatedWorkspaceImage' 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', 'createUpdatedWorkspaceImage_tags' - The tags that you want to add to the new updated WorkSpace image.
--
-- To add tags at the same time when you\'re creating the updated image,
-- you must create an IAM policy that grants your IAM user permissions to
-- use @workspaces:CreateTags@.
--
-- 'name', 'createUpdatedWorkspaceImage_name' - The name of the new updated WorkSpace image.
--
-- 'description', 'createUpdatedWorkspaceImage_description' - A description of whether updates for the WorkSpace image are available.
--
-- 'sourceImageId', 'createUpdatedWorkspaceImage_sourceImageId' - The identifier of the source WorkSpace image.
newCreateUpdatedWorkspaceImage ::
  -- | 'name'
  Prelude.Text ->
  -- | 'description'
  Prelude.Text ->
  -- | 'sourceImageId'
  Prelude.Text ->
  CreateUpdatedWorkspaceImage
newCreateUpdatedWorkspaceImage :: Text -> Text -> Text -> CreateUpdatedWorkspaceImage
newCreateUpdatedWorkspaceImage
  Text
pName_
  Text
pDescription_
  Text
pSourceImageId_ =
    CreateUpdatedWorkspaceImage' :: Maybe [Tag] -> Text -> Text -> Text -> CreateUpdatedWorkspaceImage
CreateUpdatedWorkspaceImage'
      { $sel:tags:CreateUpdatedWorkspaceImage' :: Maybe [Tag]
tags =
          Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateUpdatedWorkspaceImage' :: Text
name = Text
pName_,
        $sel:description:CreateUpdatedWorkspaceImage' :: Text
description = Text
pDescription_,
        $sel:sourceImageId:CreateUpdatedWorkspaceImage' :: Text
sourceImageId = Text
pSourceImageId_
      }

-- | The tags that you want to add to the new updated WorkSpace image.
--
-- To add tags at the same time when you\'re creating the updated image,
-- you must create an IAM policy that grants your IAM user permissions to
-- use @workspaces:CreateTags@.
createUpdatedWorkspaceImage_tags :: Lens.Lens' CreateUpdatedWorkspaceImage (Prelude.Maybe [Tag])
createUpdatedWorkspaceImage_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateUpdatedWorkspaceImage -> f CreateUpdatedWorkspaceImage
createUpdatedWorkspaceImage_tags = (CreateUpdatedWorkspaceImage -> Maybe [Tag])
-> (CreateUpdatedWorkspaceImage
    -> Maybe [Tag] -> CreateUpdatedWorkspaceImage)
-> Lens
     CreateUpdatedWorkspaceImage
     CreateUpdatedWorkspaceImage
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpdatedWorkspaceImage' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateUpdatedWorkspaceImage
s@CreateUpdatedWorkspaceImage' {} Maybe [Tag]
a -> CreateUpdatedWorkspaceImage
s {$sel:tags:CreateUpdatedWorkspaceImage' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateUpdatedWorkspaceImage) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateUpdatedWorkspaceImage -> f CreateUpdatedWorkspaceImage)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateUpdatedWorkspaceImage
-> f CreateUpdatedWorkspaceImage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the new updated WorkSpace image.
createUpdatedWorkspaceImage_name :: Lens.Lens' CreateUpdatedWorkspaceImage Prelude.Text
createUpdatedWorkspaceImage_name :: (Text -> f Text)
-> CreateUpdatedWorkspaceImage -> f CreateUpdatedWorkspaceImage
createUpdatedWorkspaceImage_name = (CreateUpdatedWorkspaceImage -> Text)
-> (CreateUpdatedWorkspaceImage
    -> Text -> CreateUpdatedWorkspaceImage)
-> Lens
     CreateUpdatedWorkspaceImage CreateUpdatedWorkspaceImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpdatedWorkspaceImage' {Text
name :: Text
$sel:name:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
name} -> Text
name) (\s :: CreateUpdatedWorkspaceImage
s@CreateUpdatedWorkspaceImage' {} Text
a -> CreateUpdatedWorkspaceImage
s {$sel:name:CreateUpdatedWorkspaceImage' :: Text
name = Text
a} :: CreateUpdatedWorkspaceImage)

-- | A description of whether updates for the WorkSpace image are available.
createUpdatedWorkspaceImage_description :: Lens.Lens' CreateUpdatedWorkspaceImage Prelude.Text
createUpdatedWorkspaceImage_description :: (Text -> f Text)
-> CreateUpdatedWorkspaceImage -> f CreateUpdatedWorkspaceImage
createUpdatedWorkspaceImage_description = (CreateUpdatedWorkspaceImage -> Text)
-> (CreateUpdatedWorkspaceImage
    -> Text -> CreateUpdatedWorkspaceImage)
-> Lens
     CreateUpdatedWorkspaceImage CreateUpdatedWorkspaceImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpdatedWorkspaceImage' {Text
description :: Text
$sel:description:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
description} -> Text
description) (\s :: CreateUpdatedWorkspaceImage
s@CreateUpdatedWorkspaceImage' {} Text
a -> CreateUpdatedWorkspaceImage
s {$sel:description:CreateUpdatedWorkspaceImage' :: Text
description = Text
a} :: CreateUpdatedWorkspaceImage)

-- | The identifier of the source WorkSpace image.
createUpdatedWorkspaceImage_sourceImageId :: Lens.Lens' CreateUpdatedWorkspaceImage Prelude.Text
createUpdatedWorkspaceImage_sourceImageId :: (Text -> f Text)
-> CreateUpdatedWorkspaceImage -> f CreateUpdatedWorkspaceImage
createUpdatedWorkspaceImage_sourceImageId = (CreateUpdatedWorkspaceImage -> Text)
-> (CreateUpdatedWorkspaceImage
    -> Text -> CreateUpdatedWorkspaceImage)
-> Lens
     CreateUpdatedWorkspaceImage CreateUpdatedWorkspaceImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpdatedWorkspaceImage' {Text
sourceImageId :: Text
$sel:sourceImageId:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
sourceImageId} -> Text
sourceImageId) (\s :: CreateUpdatedWorkspaceImage
s@CreateUpdatedWorkspaceImage' {} Text
a -> CreateUpdatedWorkspaceImage
s {$sel:sourceImageId:CreateUpdatedWorkspaceImage' :: Text
sourceImageId = Text
a} :: CreateUpdatedWorkspaceImage)

instance Core.AWSRequest CreateUpdatedWorkspaceImage where
  type
    AWSResponse CreateUpdatedWorkspaceImage =
      CreateUpdatedWorkspaceImageResponse
  request :: CreateUpdatedWorkspaceImage -> Request CreateUpdatedWorkspaceImage
request = Service
-> CreateUpdatedWorkspaceImage
-> Request CreateUpdatedWorkspaceImage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateUpdatedWorkspaceImage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateUpdatedWorkspaceImage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateUpdatedWorkspaceImage))
-> Logger
-> Service
-> Proxy CreateUpdatedWorkspaceImage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateUpdatedWorkspaceImage)))
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 Text -> Int -> CreateUpdatedWorkspaceImageResponse
CreateUpdatedWorkspaceImageResponse'
            (Maybe Text -> Int -> CreateUpdatedWorkspaceImageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateUpdatedWorkspaceImageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ImageId")
            Either String (Int -> CreateUpdatedWorkspaceImageResponse)
-> Either String Int
-> Either String CreateUpdatedWorkspaceImageResponse
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 CreateUpdatedWorkspaceImage

instance Prelude.NFData CreateUpdatedWorkspaceImage

instance Core.ToHeaders CreateUpdatedWorkspaceImage where
  toHeaders :: CreateUpdatedWorkspaceImage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateUpdatedWorkspaceImage -> 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.CreateUpdatedWorkspaceImage" ::
                          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 CreateUpdatedWorkspaceImage where
  toJSON :: CreateUpdatedWorkspaceImage -> Value
toJSON CreateUpdatedWorkspaceImage' {Maybe [Tag]
Text
sourceImageId :: Text
description :: Text
name :: Text
tags :: Maybe [Tag]
$sel:sourceImageId:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
$sel:description:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
$sel:name:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Text
$sel:tags:CreateUpdatedWorkspaceImage' :: CreateUpdatedWorkspaceImage -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SourceImageId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sourceImageId)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateUpdatedWorkspaceImageResponse' 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:
--
-- 'imageId', 'createUpdatedWorkspaceImageResponse_imageId' - The identifier of the new updated WorkSpace image.
--
-- 'httpStatus', 'createUpdatedWorkspaceImageResponse_httpStatus' - The response's http status code.
newCreateUpdatedWorkspaceImageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateUpdatedWorkspaceImageResponse
newCreateUpdatedWorkspaceImageResponse :: Int -> CreateUpdatedWorkspaceImageResponse
newCreateUpdatedWorkspaceImageResponse Int
pHttpStatus_ =
  CreateUpdatedWorkspaceImageResponse' :: Maybe Text -> Int -> CreateUpdatedWorkspaceImageResponse
CreateUpdatedWorkspaceImageResponse'
    { $sel:imageId:CreateUpdatedWorkspaceImageResponse' :: Maybe Text
imageId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateUpdatedWorkspaceImageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The identifier of the new updated WorkSpace image.
createUpdatedWorkspaceImageResponse_imageId :: Lens.Lens' CreateUpdatedWorkspaceImageResponse (Prelude.Maybe Prelude.Text)
createUpdatedWorkspaceImageResponse_imageId :: (Maybe Text -> f (Maybe Text))
-> CreateUpdatedWorkspaceImageResponse
-> f CreateUpdatedWorkspaceImageResponse
createUpdatedWorkspaceImageResponse_imageId = (CreateUpdatedWorkspaceImageResponse -> Maybe Text)
-> (CreateUpdatedWorkspaceImageResponse
    -> Maybe Text -> CreateUpdatedWorkspaceImageResponse)
-> Lens
     CreateUpdatedWorkspaceImageResponse
     CreateUpdatedWorkspaceImageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateUpdatedWorkspaceImageResponse' {Maybe Text
imageId :: Maybe Text
$sel:imageId:CreateUpdatedWorkspaceImageResponse' :: CreateUpdatedWorkspaceImageResponse -> Maybe Text
imageId} -> Maybe Text
imageId) (\s :: CreateUpdatedWorkspaceImageResponse
s@CreateUpdatedWorkspaceImageResponse' {} Maybe Text
a -> CreateUpdatedWorkspaceImageResponse
s {$sel:imageId:CreateUpdatedWorkspaceImageResponse' :: Maybe Text
imageId = Maybe Text
a} :: CreateUpdatedWorkspaceImageResponse)

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

instance
  Prelude.NFData
    CreateUpdatedWorkspaceImageResponse