{-# 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.ImportWorkspaceImage
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Imports the specified Windows 10 Bring Your Own License (BYOL) or
-- Windows Server 2016 BYOL image into Amazon WorkSpaces. The image must be
-- an already licensed Amazon EC2 image that is in your Amazon Web Services
-- account, and you must own the image. For more information about creating
-- BYOL images, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html Bring Your Own Windows Desktop Licenses>.
module Amazonka.WorkSpaces.ImportWorkspaceImage
  ( -- * Creating a Request
    ImportWorkspaceImage (..),
    newImportWorkspaceImage,

    -- * Request Lenses
    importWorkspaceImage_applications,
    importWorkspaceImage_tags,
    importWorkspaceImage_ec2ImageId,
    importWorkspaceImage_ingestionProcess,
    importWorkspaceImage_imageName,
    importWorkspaceImage_imageDescription,

    -- * Destructuring the Response
    ImportWorkspaceImageResponse (..),
    newImportWorkspaceImageResponse,

    -- * Response Lenses
    importWorkspaceImageResponse_imageId,
    importWorkspaceImageResponse_httpStatus,
  )
where

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

-- | /See:/ 'newImportWorkspaceImage' smart constructor.
data ImportWorkspaceImage = ImportWorkspaceImage'
  { -- | If specified, the version of Microsoft Office to subscribe to. Valid
    -- only for Windows 10 BYOL images. For more information about subscribing
    -- to Office for BYOL images, see
    -- <https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html Bring Your Own Windows Desktop Licenses>.
    --
    -- Although this parameter is an array, only one item is allowed at this
    -- time.
    ImportWorkspaceImage -> Maybe (NonEmpty Application)
applications :: Prelude.Maybe (Prelude.NonEmpty Application),
    -- | The tags. Each WorkSpaces resource can have a maximum of 50 tags.
    ImportWorkspaceImage -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The identifier of the EC2 image.
    ImportWorkspaceImage -> Text
ec2ImageId :: Prelude.Text,
    -- | The ingestion process to be used when importing the image, depending on
    -- which protocol you want to use for your BYOL Workspace image, either
    -- PCoIP, WorkSpaces Streaming Protocol (WSP), or bring your own protocol
    -- (BYOP). To use WSP, specify a value that ends in @_WSP@. To use PCoIP,
    -- specify a value that does not end in @_WSP@. To use BYOP, specify a
    -- value that ends in @_BYOP@.
    --
    -- For non-GPU-enabled bundles (bundles other than Graphics or
    -- GraphicsPro), specify @BYOL_REGULAR@, @BYOL_REGULAR_WSP@, or
    -- @BYOL_REGULAR_BYOP@, depending on the protocol.
    --
    -- The @BYOL_REGULAR_BYOP@ and @BYOL_GRAPHICS_G4DN_BYOP@ values are only
    -- supported by Amazon WorkSpaces Core. Contact your account team to be
    -- allow-listed to use these values. For more information, see
    -- <http://aws.amazon.com/workspaces/core/ Amazon WorkSpaces Core>.
    ImportWorkspaceImage -> WorkspaceImageIngestionProcess
ingestionProcess :: WorkspaceImageIngestionProcess,
    -- | The name of the WorkSpace image.
    ImportWorkspaceImage -> Text
imageName :: Prelude.Text,
    -- | The description of the WorkSpace image.
    ImportWorkspaceImage -> Text
imageDescription :: Prelude.Text
  }
  deriving (ImportWorkspaceImage -> ImportWorkspaceImage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportWorkspaceImage -> ImportWorkspaceImage -> Bool
$c/= :: ImportWorkspaceImage -> ImportWorkspaceImage -> Bool
== :: ImportWorkspaceImage -> ImportWorkspaceImage -> Bool
$c== :: ImportWorkspaceImage -> ImportWorkspaceImage -> Bool
Prelude.Eq, ReadPrec [ImportWorkspaceImage]
ReadPrec ImportWorkspaceImage
Int -> ReadS ImportWorkspaceImage
ReadS [ImportWorkspaceImage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportWorkspaceImage]
$creadListPrec :: ReadPrec [ImportWorkspaceImage]
readPrec :: ReadPrec ImportWorkspaceImage
$creadPrec :: ReadPrec ImportWorkspaceImage
readList :: ReadS [ImportWorkspaceImage]
$creadList :: ReadS [ImportWorkspaceImage]
readsPrec :: Int -> ReadS ImportWorkspaceImage
$creadsPrec :: Int -> ReadS ImportWorkspaceImage
Prelude.Read, Int -> ImportWorkspaceImage -> ShowS
[ImportWorkspaceImage] -> ShowS
ImportWorkspaceImage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportWorkspaceImage] -> ShowS
$cshowList :: [ImportWorkspaceImage] -> ShowS
show :: ImportWorkspaceImage -> String
$cshow :: ImportWorkspaceImage -> String
showsPrec :: Int -> ImportWorkspaceImage -> ShowS
$cshowsPrec :: Int -> ImportWorkspaceImage -> ShowS
Prelude.Show, forall x. Rep ImportWorkspaceImage x -> ImportWorkspaceImage
forall x. ImportWorkspaceImage -> Rep ImportWorkspaceImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportWorkspaceImage x -> ImportWorkspaceImage
$cfrom :: forall x. ImportWorkspaceImage -> Rep ImportWorkspaceImage x
Prelude.Generic)

-- |
-- Create a value of 'ImportWorkspaceImage' 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:
--
-- 'applications', 'importWorkspaceImage_applications' - If specified, the version of Microsoft Office to subscribe to. Valid
-- only for Windows 10 BYOL images. For more information about subscribing
-- to Office for BYOL images, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html Bring Your Own Windows Desktop Licenses>.
--
-- Although this parameter is an array, only one item is allowed at this
-- time.
--
-- 'tags', 'importWorkspaceImage_tags' - The tags. Each WorkSpaces resource can have a maximum of 50 tags.
--
-- 'ec2ImageId', 'importWorkspaceImage_ec2ImageId' - The identifier of the EC2 image.
--
-- 'ingestionProcess', 'importWorkspaceImage_ingestionProcess' - The ingestion process to be used when importing the image, depending on
-- which protocol you want to use for your BYOL Workspace image, either
-- PCoIP, WorkSpaces Streaming Protocol (WSP), or bring your own protocol
-- (BYOP). To use WSP, specify a value that ends in @_WSP@. To use PCoIP,
-- specify a value that does not end in @_WSP@. To use BYOP, specify a
-- value that ends in @_BYOP@.
--
-- For non-GPU-enabled bundles (bundles other than Graphics or
-- GraphicsPro), specify @BYOL_REGULAR@, @BYOL_REGULAR_WSP@, or
-- @BYOL_REGULAR_BYOP@, depending on the protocol.
--
-- The @BYOL_REGULAR_BYOP@ and @BYOL_GRAPHICS_G4DN_BYOP@ values are only
-- supported by Amazon WorkSpaces Core. Contact your account team to be
-- allow-listed to use these values. For more information, see
-- <http://aws.amazon.com/workspaces/core/ Amazon WorkSpaces Core>.
--
-- 'imageName', 'importWorkspaceImage_imageName' - The name of the WorkSpace image.
--
-- 'imageDescription', 'importWorkspaceImage_imageDescription' - The description of the WorkSpace image.
newImportWorkspaceImage ::
  -- | 'ec2ImageId'
  Prelude.Text ->
  -- | 'ingestionProcess'
  WorkspaceImageIngestionProcess ->
  -- | 'imageName'
  Prelude.Text ->
  -- | 'imageDescription'
  Prelude.Text ->
  ImportWorkspaceImage
newImportWorkspaceImage :: Text
-> WorkspaceImageIngestionProcess
-> Text
-> Text
-> ImportWorkspaceImage
newImportWorkspaceImage
  Text
pEc2ImageId_
  WorkspaceImageIngestionProcess
pIngestionProcess_
  Text
pImageName_
  Text
pImageDescription_ =
    ImportWorkspaceImage'
      { $sel:applications:ImportWorkspaceImage' :: Maybe (NonEmpty Application)
applications =
          forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ImportWorkspaceImage' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:ec2ImageId:ImportWorkspaceImage' :: Text
ec2ImageId = Text
pEc2ImageId_,
        $sel:ingestionProcess:ImportWorkspaceImage' :: WorkspaceImageIngestionProcess
ingestionProcess = WorkspaceImageIngestionProcess
pIngestionProcess_,
        $sel:imageName:ImportWorkspaceImage' :: Text
imageName = Text
pImageName_,
        $sel:imageDescription:ImportWorkspaceImage' :: Text
imageDescription = Text
pImageDescription_
      }

-- | If specified, the version of Microsoft Office to subscribe to. Valid
-- only for Windows 10 BYOL images. For more information about subscribing
-- to Office for BYOL images, see
-- <https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html Bring Your Own Windows Desktop Licenses>.
--
-- Although this parameter is an array, only one item is allowed at this
-- time.
importWorkspaceImage_applications :: Lens.Lens' ImportWorkspaceImage (Prelude.Maybe (Prelude.NonEmpty Application))
importWorkspaceImage_applications :: Lens' ImportWorkspaceImage (Maybe (NonEmpty Application))
importWorkspaceImage_applications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {Maybe (NonEmpty Application)
applications :: Maybe (NonEmpty Application)
$sel:applications:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe (NonEmpty Application)
applications} -> Maybe (NonEmpty Application)
applications) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} Maybe (NonEmpty Application)
a -> ImportWorkspaceImage
s {$sel:applications:ImportWorkspaceImage' :: Maybe (NonEmpty Application)
applications = Maybe (NonEmpty Application)
a} :: ImportWorkspaceImage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags. Each WorkSpaces resource can have a maximum of 50 tags.
importWorkspaceImage_tags :: Lens.Lens' ImportWorkspaceImage (Prelude.Maybe [Tag])
importWorkspaceImage_tags :: Lens' ImportWorkspaceImage (Maybe [Tag])
importWorkspaceImage_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} Maybe [Tag]
a -> ImportWorkspaceImage
s {$sel:tags:ImportWorkspaceImage' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ImportWorkspaceImage) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier of the EC2 image.
importWorkspaceImage_ec2ImageId :: Lens.Lens' ImportWorkspaceImage Prelude.Text
importWorkspaceImage_ec2ImageId :: Lens' ImportWorkspaceImage Text
importWorkspaceImage_ec2ImageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {Text
ec2ImageId :: Text
$sel:ec2ImageId:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
ec2ImageId} -> Text
ec2ImageId) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} Text
a -> ImportWorkspaceImage
s {$sel:ec2ImageId:ImportWorkspaceImage' :: Text
ec2ImageId = Text
a} :: ImportWorkspaceImage)

-- | The ingestion process to be used when importing the image, depending on
-- which protocol you want to use for your BYOL Workspace image, either
-- PCoIP, WorkSpaces Streaming Protocol (WSP), or bring your own protocol
-- (BYOP). To use WSP, specify a value that ends in @_WSP@. To use PCoIP,
-- specify a value that does not end in @_WSP@. To use BYOP, specify a
-- value that ends in @_BYOP@.
--
-- For non-GPU-enabled bundles (bundles other than Graphics or
-- GraphicsPro), specify @BYOL_REGULAR@, @BYOL_REGULAR_WSP@, or
-- @BYOL_REGULAR_BYOP@, depending on the protocol.
--
-- The @BYOL_REGULAR_BYOP@ and @BYOL_GRAPHICS_G4DN_BYOP@ values are only
-- supported by Amazon WorkSpaces Core. Contact your account team to be
-- allow-listed to use these values. For more information, see
-- <http://aws.amazon.com/workspaces/core/ Amazon WorkSpaces Core>.
importWorkspaceImage_ingestionProcess :: Lens.Lens' ImportWorkspaceImage WorkspaceImageIngestionProcess
importWorkspaceImage_ingestionProcess :: Lens' ImportWorkspaceImage WorkspaceImageIngestionProcess
importWorkspaceImage_ingestionProcess = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {WorkspaceImageIngestionProcess
ingestionProcess :: WorkspaceImageIngestionProcess
$sel:ingestionProcess:ImportWorkspaceImage' :: ImportWorkspaceImage -> WorkspaceImageIngestionProcess
ingestionProcess} -> WorkspaceImageIngestionProcess
ingestionProcess) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} WorkspaceImageIngestionProcess
a -> ImportWorkspaceImage
s {$sel:ingestionProcess:ImportWorkspaceImage' :: WorkspaceImageIngestionProcess
ingestionProcess = WorkspaceImageIngestionProcess
a} :: ImportWorkspaceImage)

-- | The name of the WorkSpace image.
importWorkspaceImage_imageName :: Lens.Lens' ImportWorkspaceImage Prelude.Text
importWorkspaceImage_imageName :: Lens' ImportWorkspaceImage Text
importWorkspaceImage_imageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {Text
imageName :: Text
$sel:imageName:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
imageName} -> Text
imageName) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} Text
a -> ImportWorkspaceImage
s {$sel:imageName:ImportWorkspaceImage' :: Text
imageName = Text
a} :: ImportWorkspaceImage)

-- | The description of the WorkSpace image.
importWorkspaceImage_imageDescription :: Lens.Lens' ImportWorkspaceImage Prelude.Text
importWorkspaceImage_imageDescription :: Lens' ImportWorkspaceImage Text
importWorkspaceImage_imageDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportWorkspaceImage' {Text
imageDescription :: Text
$sel:imageDescription:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
imageDescription} -> Text
imageDescription) (\s :: ImportWorkspaceImage
s@ImportWorkspaceImage' {} Text
a -> ImportWorkspaceImage
s {$sel:imageDescription:ImportWorkspaceImage' :: Text
imageDescription = Text
a} :: ImportWorkspaceImage)

instance Core.AWSRequest ImportWorkspaceImage where
  type
    AWSResponse ImportWorkspaceImage =
      ImportWorkspaceImageResponse
  request :: (Service -> Service)
-> ImportWorkspaceImage -> Request ImportWorkspaceImage
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ImportWorkspaceImage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportWorkspaceImage)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> ImportWorkspaceImageResponse
ImportWorkspaceImageResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ImageId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ImportWorkspaceImage where
  hashWithSalt :: Int -> ImportWorkspaceImage -> Int
hashWithSalt Int
_salt ImportWorkspaceImage' {Maybe [Tag]
Maybe (NonEmpty Application)
Text
WorkspaceImageIngestionProcess
imageDescription :: Text
imageName :: Text
ingestionProcess :: WorkspaceImageIngestionProcess
ec2ImageId :: Text
tags :: Maybe [Tag]
applications :: Maybe (NonEmpty Application)
$sel:imageDescription:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:imageName:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:ingestionProcess:ImportWorkspaceImage' :: ImportWorkspaceImage -> WorkspaceImageIngestionProcess
$sel:ec2ImageId:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:tags:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe [Tag]
$sel:applications:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe (NonEmpty Application)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Application)
applications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ec2ImageId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` WorkspaceImageIngestionProcess
ingestionProcess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
imageName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
imageDescription

instance Prelude.NFData ImportWorkspaceImage where
  rnf :: ImportWorkspaceImage -> ()
rnf ImportWorkspaceImage' {Maybe [Tag]
Maybe (NonEmpty Application)
Text
WorkspaceImageIngestionProcess
imageDescription :: Text
imageName :: Text
ingestionProcess :: WorkspaceImageIngestionProcess
ec2ImageId :: Text
tags :: Maybe [Tag]
applications :: Maybe (NonEmpty Application)
$sel:imageDescription:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:imageName:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:ingestionProcess:ImportWorkspaceImage' :: ImportWorkspaceImage -> WorkspaceImageIngestionProcess
$sel:ec2ImageId:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:tags:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe [Tag]
$sel:applications:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe (NonEmpty Application)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Application)
applications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ec2ImageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf WorkspaceImageIngestionProcess
ingestionProcess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
imageName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
imageDescription

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

instance Data.ToJSON ImportWorkspaceImage where
  toJSON :: ImportWorkspaceImage -> Value
toJSON ImportWorkspaceImage' {Maybe [Tag]
Maybe (NonEmpty Application)
Text
WorkspaceImageIngestionProcess
imageDescription :: Text
imageName :: Text
ingestionProcess :: WorkspaceImageIngestionProcess
ec2ImageId :: Text
tags :: Maybe [Tag]
applications :: Maybe (NonEmpty Application)
$sel:imageDescription:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:imageName:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:ingestionProcess:ImportWorkspaceImage' :: ImportWorkspaceImage -> WorkspaceImageIngestionProcess
$sel:ec2ImageId:ImportWorkspaceImage' :: ImportWorkspaceImage -> Text
$sel:tags:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe [Tag]
$sel:applications:ImportWorkspaceImage' :: ImportWorkspaceImage -> Maybe (NonEmpty Application)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Applications" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Application)
applications,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"Ec2ImageId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ec2ImageId),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"IngestionProcess" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= WorkspaceImageIngestionProcess
ingestionProcess),
            forall a. a -> Maybe a
Prelude.Just (Key
"ImageName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
imageName),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ImageDescription" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
imageDescription)
          ]
      )

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

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

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

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

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

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

instance Prelude.NFData ImportWorkspaceImageResponse where
  rnf :: ImportWorkspaceImageResponse -> ()
rnf ImportWorkspaceImageResponse' {Int
Maybe Text
httpStatus :: Int
imageId :: Maybe Text
$sel:httpStatus:ImportWorkspaceImageResponse' :: ImportWorkspaceImageResponse -> Int
$sel:imageId:ImportWorkspaceImageResponse' :: ImportWorkspaceImageResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus