{-# 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.CopyWorkspaceImage
-- 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)
--
-- Copies the specified image from the specified Region to the current
-- Region. For more information about copying images, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/copy-custom-image.html Copy a Custom WorkSpaces Image>.
--
-- In the China (Ningxia) Region, you can copy images only within the same
-- Region.
--
-- In Amazon Web Services GovCloud (US), to copy images to and from other
-- Regions, contact Amazon Web Services Support.
--
-- Before copying a shared image, be sure to verify that it has been shared
-- from the correct Amazon Web Services account. To determine if an image
-- has been shared and to see the ID of the Amazon Web Services account
-- that owns an image, use the
-- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImages.html DescribeWorkSpaceImages>
-- and
-- <https://docs.aws.amazon.com/workspaces/latest/api/API_DescribeWorkspaceImagePermissions.html DescribeWorkspaceImagePermissions>
-- API operations.
module Amazonka.WorkSpaces.CopyWorkspaceImage
  ( -- * Creating a Request
    CopyWorkspaceImage (..),
    newCopyWorkspaceImage,

    -- * Request Lenses
    copyWorkspaceImage_description,
    copyWorkspaceImage_tags,
    copyWorkspaceImage_name,
    copyWorkspaceImage_sourceImageId,
    copyWorkspaceImage_sourceRegion,

    -- * Destructuring the Response
    CopyWorkspaceImageResponse (..),
    newCopyWorkspaceImageResponse,

    -- * Response Lenses
    copyWorkspaceImageResponse_imageId,
    copyWorkspaceImageResponse_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:/ 'newCopyWorkspaceImage' smart constructor.
data CopyWorkspaceImage = CopyWorkspaceImage'
  { -- | A description of the image.
    CopyWorkspaceImage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags for the image.
    CopyWorkspaceImage -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the image.
    CopyWorkspaceImage -> Text
name :: Prelude.Text,
    -- | The identifier of the source image.
    CopyWorkspaceImage -> Text
sourceImageId :: Prelude.Text,
    -- | The identifier of the source Region.
    CopyWorkspaceImage -> Text
sourceRegion :: Prelude.Text
  }
  deriving (CopyWorkspaceImage -> CopyWorkspaceImage -> Bool
(CopyWorkspaceImage -> CopyWorkspaceImage -> Bool)
-> (CopyWorkspaceImage -> CopyWorkspaceImage -> Bool)
-> Eq CopyWorkspaceImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyWorkspaceImage -> CopyWorkspaceImage -> Bool
$c/= :: CopyWorkspaceImage -> CopyWorkspaceImage -> Bool
== :: CopyWorkspaceImage -> CopyWorkspaceImage -> Bool
$c== :: CopyWorkspaceImage -> CopyWorkspaceImage -> Bool
Prelude.Eq, ReadPrec [CopyWorkspaceImage]
ReadPrec CopyWorkspaceImage
Int -> ReadS CopyWorkspaceImage
ReadS [CopyWorkspaceImage]
(Int -> ReadS CopyWorkspaceImage)
-> ReadS [CopyWorkspaceImage]
-> ReadPrec CopyWorkspaceImage
-> ReadPrec [CopyWorkspaceImage]
-> Read CopyWorkspaceImage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyWorkspaceImage]
$creadListPrec :: ReadPrec [CopyWorkspaceImage]
readPrec :: ReadPrec CopyWorkspaceImage
$creadPrec :: ReadPrec CopyWorkspaceImage
readList :: ReadS [CopyWorkspaceImage]
$creadList :: ReadS [CopyWorkspaceImage]
readsPrec :: Int -> ReadS CopyWorkspaceImage
$creadsPrec :: Int -> ReadS CopyWorkspaceImage
Prelude.Read, Int -> CopyWorkspaceImage -> ShowS
[CopyWorkspaceImage] -> ShowS
CopyWorkspaceImage -> String
(Int -> CopyWorkspaceImage -> ShowS)
-> (CopyWorkspaceImage -> String)
-> ([CopyWorkspaceImage] -> ShowS)
-> Show CopyWorkspaceImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyWorkspaceImage] -> ShowS
$cshowList :: [CopyWorkspaceImage] -> ShowS
show :: CopyWorkspaceImage -> String
$cshow :: CopyWorkspaceImage -> String
showsPrec :: Int -> CopyWorkspaceImage -> ShowS
$cshowsPrec :: Int -> CopyWorkspaceImage -> ShowS
Prelude.Show, (forall x. CopyWorkspaceImage -> Rep CopyWorkspaceImage x)
-> (forall x. Rep CopyWorkspaceImage x -> CopyWorkspaceImage)
-> Generic CopyWorkspaceImage
forall x. Rep CopyWorkspaceImage x -> CopyWorkspaceImage
forall x. CopyWorkspaceImage -> Rep CopyWorkspaceImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyWorkspaceImage x -> CopyWorkspaceImage
$cfrom :: forall x. CopyWorkspaceImage -> Rep CopyWorkspaceImage x
Prelude.Generic)

-- |
-- Create a value of 'CopyWorkspaceImage' 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:
--
-- 'description', 'copyWorkspaceImage_description' - A description of the image.
--
-- 'tags', 'copyWorkspaceImage_tags' - The tags for the image.
--
-- 'name', 'copyWorkspaceImage_name' - The name of the image.
--
-- 'sourceImageId', 'copyWorkspaceImage_sourceImageId' - The identifier of the source image.
--
-- 'sourceRegion', 'copyWorkspaceImage_sourceRegion' - The identifier of the source Region.
newCopyWorkspaceImage ::
  -- | 'name'
  Prelude.Text ->
  -- | 'sourceImageId'
  Prelude.Text ->
  -- | 'sourceRegion'
  Prelude.Text ->
  CopyWorkspaceImage
newCopyWorkspaceImage :: Text -> Text -> Text -> CopyWorkspaceImage
newCopyWorkspaceImage
  Text
pName_
  Text
pSourceImageId_
  Text
pSourceRegion_ =
    CopyWorkspaceImage' :: Maybe Text
-> Maybe [Tag] -> Text -> Text -> Text -> CopyWorkspaceImage
CopyWorkspaceImage'
      { $sel:description:CopyWorkspaceImage' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CopyWorkspaceImage' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CopyWorkspaceImage' :: Text
name = Text
pName_,
        $sel:sourceImageId:CopyWorkspaceImage' :: Text
sourceImageId = Text
pSourceImageId_,
        $sel:sourceRegion:CopyWorkspaceImage' :: Text
sourceRegion = Text
pSourceRegion_
      }

-- | A description of the image.
copyWorkspaceImage_description :: Lens.Lens' CopyWorkspaceImage (Prelude.Maybe Prelude.Text)
copyWorkspaceImage_description :: (Maybe Text -> f (Maybe Text))
-> CopyWorkspaceImage -> f CopyWorkspaceImage
copyWorkspaceImage_description = (CopyWorkspaceImage -> Maybe Text)
-> (CopyWorkspaceImage -> Maybe Text -> CopyWorkspaceImage)
-> Lens
     CopyWorkspaceImage CopyWorkspaceImage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyWorkspaceImage' {Maybe Text
description :: Maybe Text
$sel:description:CopyWorkspaceImage' :: CopyWorkspaceImage -> Maybe Text
description} -> Maybe Text
description) (\s :: CopyWorkspaceImage
s@CopyWorkspaceImage' {} Maybe Text
a -> CopyWorkspaceImage
s {$sel:description:CopyWorkspaceImage' :: Maybe Text
description = Maybe Text
a} :: CopyWorkspaceImage)

-- | The tags for the image.
copyWorkspaceImage_tags :: Lens.Lens' CopyWorkspaceImage (Prelude.Maybe [Tag])
copyWorkspaceImage_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CopyWorkspaceImage -> f CopyWorkspaceImage
copyWorkspaceImage_tags = (CopyWorkspaceImage -> Maybe [Tag])
-> (CopyWorkspaceImage -> Maybe [Tag] -> CopyWorkspaceImage)
-> Lens
     CopyWorkspaceImage CopyWorkspaceImage (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyWorkspaceImage' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CopyWorkspaceImage' :: CopyWorkspaceImage -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CopyWorkspaceImage
s@CopyWorkspaceImage' {} Maybe [Tag]
a -> CopyWorkspaceImage
s {$sel:tags:CopyWorkspaceImage' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CopyWorkspaceImage) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CopyWorkspaceImage -> f CopyWorkspaceImage)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CopyWorkspaceImage
-> f CopyWorkspaceImage
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 image.
copyWorkspaceImage_name :: Lens.Lens' CopyWorkspaceImage Prelude.Text
copyWorkspaceImage_name :: (Text -> f Text) -> CopyWorkspaceImage -> f CopyWorkspaceImage
copyWorkspaceImage_name = (CopyWorkspaceImage -> Text)
-> (CopyWorkspaceImage -> Text -> CopyWorkspaceImage)
-> Lens CopyWorkspaceImage CopyWorkspaceImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyWorkspaceImage' {Text
name :: Text
$sel:name:CopyWorkspaceImage' :: CopyWorkspaceImage -> Text
name} -> Text
name) (\s :: CopyWorkspaceImage
s@CopyWorkspaceImage' {} Text
a -> CopyWorkspaceImage
s {$sel:name:CopyWorkspaceImage' :: Text
name = Text
a} :: CopyWorkspaceImage)

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

-- | The identifier of the source Region.
copyWorkspaceImage_sourceRegion :: Lens.Lens' CopyWorkspaceImage Prelude.Text
copyWorkspaceImage_sourceRegion :: (Text -> f Text) -> CopyWorkspaceImage -> f CopyWorkspaceImage
copyWorkspaceImage_sourceRegion = (CopyWorkspaceImage -> Text)
-> (CopyWorkspaceImage -> Text -> CopyWorkspaceImage)
-> Lens CopyWorkspaceImage CopyWorkspaceImage Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyWorkspaceImage' {Text
sourceRegion :: Text
$sel:sourceRegion:CopyWorkspaceImage' :: CopyWorkspaceImage -> Text
sourceRegion} -> Text
sourceRegion) (\s :: CopyWorkspaceImage
s@CopyWorkspaceImage' {} Text
a -> CopyWorkspaceImage
s {$sel:sourceRegion:CopyWorkspaceImage' :: Text
sourceRegion = Text
a} :: CopyWorkspaceImage)

instance Core.AWSRequest CopyWorkspaceImage where
  type
    AWSResponse CopyWorkspaceImage =
      CopyWorkspaceImageResponse
  request :: CopyWorkspaceImage -> Request CopyWorkspaceImage
request = Service -> CopyWorkspaceImage -> Request CopyWorkspaceImage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CopyWorkspaceImage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CopyWorkspaceImage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CopyWorkspaceImage))
-> Logger
-> Service
-> Proxy CopyWorkspaceImage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CopyWorkspaceImage)))
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 -> CopyWorkspaceImageResponse
CopyWorkspaceImageResponse'
            (Maybe Text -> Int -> CopyWorkspaceImageResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CopyWorkspaceImageResponse)
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 -> CopyWorkspaceImageResponse)
-> Either String Int -> Either String CopyWorkspaceImageResponse
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 CopyWorkspaceImage

instance Prelude.NFData CopyWorkspaceImage

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

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

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

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

-- |
-- Create a value of 'CopyWorkspaceImageResponse' 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', 'copyWorkspaceImageResponse_imageId' - The identifier of the image.
--
-- 'httpStatus', 'copyWorkspaceImageResponse_httpStatus' - The response's http status code.
newCopyWorkspaceImageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CopyWorkspaceImageResponse
newCopyWorkspaceImageResponse :: Int -> CopyWorkspaceImageResponse
newCopyWorkspaceImageResponse Int
pHttpStatus_ =
  CopyWorkspaceImageResponse' :: Maybe Text -> Int -> CopyWorkspaceImageResponse
CopyWorkspaceImageResponse'
    { $sel:imageId:CopyWorkspaceImageResponse' :: Maybe Text
imageId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CopyWorkspaceImageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CopyWorkspaceImageResponse