{-# 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.EC2.CreateFpgaImage
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an Amazon FPGA Image (AFI) from the specified design checkpoint
-- (DCP).
--
-- The create operation is asynchronous. To verify that the AFI is ready
-- for use, check the output logs.
--
-- An AFI contains the FPGA bitstream that is ready to download to an FPGA.
-- You can securely deploy an AFI on multiple FPGA-accelerated instances.
-- For more information, see the
-- <https://github.com/aws/aws-fpga/ Amazon Web Services FPGA Hardware Development Kit>.
module Amazonka.EC2.CreateFpgaImage
  ( -- * Creating a Request
    CreateFpgaImage (..),
    newCreateFpgaImage,

    -- * Request Lenses
    createFpgaImage_clientToken,
    createFpgaImage_description,
    createFpgaImage_dryRun,
    createFpgaImage_logsStorageLocation,
    createFpgaImage_name,
    createFpgaImage_tagSpecifications,
    createFpgaImage_inputStorageLocation,

    -- * Destructuring the Response
    CreateFpgaImageResponse (..),
    newCreateFpgaImageResponse,

    -- * Response Lenses
    createFpgaImageResponse_fpgaImageGlobalId,
    createFpgaImageResponse_fpgaImageId,
    createFpgaImageResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateFpgaImage' smart constructor.
data CreateFpgaImage = CreateFpgaImage'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html Ensuring Idempotency>.
    CreateFpgaImage -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | A description for the AFI.
    CreateFpgaImage -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateFpgaImage -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The location in Amazon S3 for the output logs.
    CreateFpgaImage -> Maybe StorageLocation
logsStorageLocation :: Prelude.Maybe StorageLocation,
    -- | A name for the AFI.
    CreateFpgaImage -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The tags to apply to the FPGA image during creation.
    CreateFpgaImage -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification],
    -- | The location of the encrypted design checkpoint in Amazon S3. The input
    -- must be a tarball.
    CreateFpgaImage -> StorageLocation
inputStorageLocation :: StorageLocation
  }
  deriving (CreateFpgaImage -> CreateFpgaImage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateFpgaImage -> CreateFpgaImage -> Bool
$c/= :: CreateFpgaImage -> CreateFpgaImage -> Bool
== :: CreateFpgaImage -> CreateFpgaImage -> Bool
$c== :: CreateFpgaImage -> CreateFpgaImage -> Bool
Prelude.Eq, ReadPrec [CreateFpgaImage]
ReadPrec CreateFpgaImage
Int -> ReadS CreateFpgaImage
ReadS [CreateFpgaImage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateFpgaImage]
$creadListPrec :: ReadPrec [CreateFpgaImage]
readPrec :: ReadPrec CreateFpgaImage
$creadPrec :: ReadPrec CreateFpgaImage
readList :: ReadS [CreateFpgaImage]
$creadList :: ReadS [CreateFpgaImage]
readsPrec :: Int -> ReadS CreateFpgaImage
$creadsPrec :: Int -> ReadS CreateFpgaImage
Prelude.Read, Int -> CreateFpgaImage -> ShowS
[CreateFpgaImage] -> ShowS
CreateFpgaImage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateFpgaImage] -> ShowS
$cshowList :: [CreateFpgaImage] -> ShowS
show :: CreateFpgaImage -> String
$cshow :: CreateFpgaImage -> String
showsPrec :: Int -> CreateFpgaImage -> ShowS
$cshowsPrec :: Int -> CreateFpgaImage -> ShowS
Prelude.Show, forall x. Rep CreateFpgaImage x -> CreateFpgaImage
forall x. CreateFpgaImage -> Rep CreateFpgaImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateFpgaImage x -> CreateFpgaImage
$cfrom :: forall x. CreateFpgaImage -> Rep CreateFpgaImage x
Prelude.Generic)

-- |
-- Create a value of 'CreateFpgaImage' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createFpgaImage_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html Ensuring Idempotency>.
--
-- 'description', 'createFpgaImage_description' - A description for the AFI.
--
-- 'dryRun', 'createFpgaImage_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'logsStorageLocation', 'createFpgaImage_logsStorageLocation' - The location in Amazon S3 for the output logs.
--
-- 'name', 'createFpgaImage_name' - A name for the AFI.
--
-- 'tagSpecifications', 'createFpgaImage_tagSpecifications' - The tags to apply to the FPGA image during creation.
--
-- 'inputStorageLocation', 'createFpgaImage_inputStorageLocation' - The location of the encrypted design checkpoint in Amazon S3. The input
-- must be a tarball.
newCreateFpgaImage ::
  -- | 'inputStorageLocation'
  StorageLocation ->
  CreateFpgaImage
newCreateFpgaImage :: StorageLocation -> CreateFpgaImage
newCreateFpgaImage StorageLocation
pInputStorageLocation_ =
  CreateFpgaImage'
    { $sel:clientToken:CreateFpgaImage' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateFpgaImage' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateFpgaImage' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:logsStorageLocation:CreateFpgaImage' :: Maybe StorageLocation
logsStorageLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateFpgaImage' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:tagSpecifications:CreateFpgaImage' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing,
      $sel:inputStorageLocation:CreateFpgaImage' :: StorageLocation
inputStorageLocation = StorageLocation
pInputStorageLocation_
    }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html Ensuring Idempotency>.
createFpgaImage_clientToken :: Lens.Lens' CreateFpgaImage (Prelude.Maybe Prelude.Text)
createFpgaImage_clientToken :: Lens' CreateFpgaImage (Maybe Text)
createFpgaImage_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe Text
a -> CreateFpgaImage
s {$sel:clientToken:CreateFpgaImage' :: Maybe Text
clientToken = Maybe Text
a} :: CreateFpgaImage)

-- | A description for the AFI.
createFpgaImage_description :: Lens.Lens' CreateFpgaImage (Prelude.Maybe Prelude.Text)
createFpgaImage_description :: Lens' CreateFpgaImage (Maybe Text)
createFpgaImage_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe Text
description :: Maybe Text
$sel:description:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe Text
a -> CreateFpgaImage
s {$sel:description:CreateFpgaImage' :: Maybe Text
description = Maybe Text
a} :: CreateFpgaImage)

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createFpgaImage_dryRun :: Lens.Lens' CreateFpgaImage (Prelude.Maybe Prelude.Bool)
createFpgaImage_dryRun :: Lens' CreateFpgaImage (Maybe Bool)
createFpgaImage_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateFpgaImage' :: CreateFpgaImage -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe Bool
a -> CreateFpgaImage
s {$sel:dryRun:CreateFpgaImage' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateFpgaImage)

-- | The location in Amazon S3 for the output logs.
createFpgaImage_logsStorageLocation :: Lens.Lens' CreateFpgaImage (Prelude.Maybe StorageLocation)
createFpgaImage_logsStorageLocation :: Lens' CreateFpgaImage (Maybe StorageLocation)
createFpgaImage_logsStorageLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe StorageLocation
logsStorageLocation :: Maybe StorageLocation
$sel:logsStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> Maybe StorageLocation
logsStorageLocation} -> Maybe StorageLocation
logsStorageLocation) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe StorageLocation
a -> CreateFpgaImage
s {$sel:logsStorageLocation:CreateFpgaImage' :: Maybe StorageLocation
logsStorageLocation = Maybe StorageLocation
a} :: CreateFpgaImage)

-- | A name for the AFI.
createFpgaImage_name :: Lens.Lens' CreateFpgaImage (Prelude.Maybe Prelude.Text)
createFpgaImage_name :: Lens' CreateFpgaImage (Maybe Text)
createFpgaImage_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe Text
name :: Maybe Text
$sel:name:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe Text
a -> CreateFpgaImage
s {$sel:name:CreateFpgaImage' :: Maybe Text
name = Maybe Text
a} :: CreateFpgaImage)

-- | The tags to apply to the FPGA image during creation.
createFpgaImage_tagSpecifications :: Lens.Lens' CreateFpgaImage (Prelude.Maybe [TagSpecification])
createFpgaImage_tagSpecifications :: Lens' CreateFpgaImage (Maybe [TagSpecification])
createFpgaImage_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateFpgaImage' :: CreateFpgaImage -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} Maybe [TagSpecification]
a -> CreateFpgaImage
s {$sel:tagSpecifications:CreateFpgaImage' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateFpgaImage) 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 location of the encrypted design checkpoint in Amazon S3. The input
-- must be a tarball.
createFpgaImage_inputStorageLocation :: Lens.Lens' CreateFpgaImage StorageLocation
createFpgaImage_inputStorageLocation :: Lens' CreateFpgaImage StorageLocation
createFpgaImage_inputStorageLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImage' {StorageLocation
inputStorageLocation :: StorageLocation
$sel:inputStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> StorageLocation
inputStorageLocation} -> StorageLocation
inputStorageLocation) (\s :: CreateFpgaImage
s@CreateFpgaImage' {} StorageLocation
a -> CreateFpgaImage
s {$sel:inputStorageLocation:CreateFpgaImage' :: StorageLocation
inputStorageLocation = StorageLocation
a} :: CreateFpgaImage)

instance Core.AWSRequest CreateFpgaImage where
  type
    AWSResponse CreateFpgaImage =
      CreateFpgaImageResponse
  request :: (Service -> Service) -> CreateFpgaImage -> Request CreateFpgaImage
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateFpgaImage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateFpgaImage)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe Text -> Int -> CreateFpgaImageResponse
CreateFpgaImageResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"fpgaImageGlobalId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"fpgaImageId")
            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 CreateFpgaImage where
  hashWithSalt :: Int -> CreateFpgaImage -> Int
hashWithSalt Int
_salt CreateFpgaImage' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Maybe StorageLocation
StorageLocation
inputStorageLocation :: StorageLocation
tagSpecifications :: Maybe [TagSpecification]
name :: Maybe Text
logsStorageLocation :: Maybe StorageLocation
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:inputStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> StorageLocation
$sel:tagSpecifications:CreateFpgaImage' :: CreateFpgaImage -> Maybe [TagSpecification]
$sel:name:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:logsStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> Maybe StorageLocation
$sel:dryRun:CreateFpgaImage' :: CreateFpgaImage -> Maybe Bool
$sel:description:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:clientToken:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StorageLocation
logsStorageLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` StorageLocation
inputStorageLocation

instance Prelude.NFData CreateFpgaImage where
  rnf :: CreateFpgaImage -> ()
rnf CreateFpgaImage' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Maybe StorageLocation
StorageLocation
inputStorageLocation :: StorageLocation
tagSpecifications :: Maybe [TagSpecification]
name :: Maybe Text
logsStorageLocation :: Maybe StorageLocation
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:inputStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> StorageLocation
$sel:tagSpecifications:CreateFpgaImage' :: CreateFpgaImage -> Maybe [TagSpecification]
$sel:name:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:logsStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> Maybe StorageLocation
$sel:dryRun:CreateFpgaImage' :: CreateFpgaImage -> Maybe Bool
$sel:description:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:clientToken:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StorageLocation
logsStorageLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagSpecification]
tagSpecifications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StorageLocation
inputStorageLocation

instance Data.ToHeaders CreateFpgaImage where
  toHeaders :: CreateFpgaImage -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

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

instance Data.ToQuery CreateFpgaImage where
  toQuery :: CreateFpgaImage -> QueryString
toQuery CreateFpgaImage' {Maybe Bool
Maybe [TagSpecification]
Maybe Text
Maybe StorageLocation
StorageLocation
inputStorageLocation :: StorageLocation
tagSpecifications :: Maybe [TagSpecification]
name :: Maybe Text
logsStorageLocation :: Maybe StorageLocation
dryRun :: Maybe Bool
description :: Maybe Text
clientToken :: Maybe Text
$sel:inputStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> StorageLocation
$sel:tagSpecifications:CreateFpgaImage' :: CreateFpgaImage -> Maybe [TagSpecification]
$sel:name:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:logsStorageLocation:CreateFpgaImage' :: CreateFpgaImage -> Maybe StorageLocation
$sel:dryRun:CreateFpgaImage' :: CreateFpgaImage -> Maybe Bool
$sel:description:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
$sel:clientToken:CreateFpgaImage' :: CreateFpgaImage -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"CreateFpgaImage" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        ByteString
"Description" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
description,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"LogsStorageLocation" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe StorageLocation
logsStorageLocation,
        ByteString
"Name" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
name,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
          ),
        ByteString
"InputStorageLocation" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: StorageLocation
inputStorageLocation
      ]

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

-- |
-- Create a value of 'CreateFpgaImageResponse' 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:
--
-- 'fpgaImageGlobalId', 'createFpgaImageResponse_fpgaImageGlobalId' - The global FPGA image identifier (AGFI ID).
--
-- 'fpgaImageId', 'createFpgaImageResponse_fpgaImageId' - The FPGA image identifier (AFI ID).
--
-- 'httpStatus', 'createFpgaImageResponse_httpStatus' - The response's http status code.
newCreateFpgaImageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateFpgaImageResponse
newCreateFpgaImageResponse :: Int -> CreateFpgaImageResponse
newCreateFpgaImageResponse Int
pHttpStatus_ =
  CreateFpgaImageResponse'
    { $sel:fpgaImageGlobalId:CreateFpgaImageResponse' :: Maybe Text
fpgaImageGlobalId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:fpgaImageId:CreateFpgaImageResponse' :: Maybe Text
fpgaImageId = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateFpgaImageResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The global FPGA image identifier (AGFI ID).
createFpgaImageResponse_fpgaImageGlobalId :: Lens.Lens' CreateFpgaImageResponse (Prelude.Maybe Prelude.Text)
createFpgaImageResponse_fpgaImageGlobalId :: Lens' CreateFpgaImageResponse (Maybe Text)
createFpgaImageResponse_fpgaImageGlobalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImageResponse' {Maybe Text
fpgaImageGlobalId :: Maybe Text
$sel:fpgaImageGlobalId:CreateFpgaImageResponse' :: CreateFpgaImageResponse -> Maybe Text
fpgaImageGlobalId} -> Maybe Text
fpgaImageGlobalId) (\s :: CreateFpgaImageResponse
s@CreateFpgaImageResponse' {} Maybe Text
a -> CreateFpgaImageResponse
s {$sel:fpgaImageGlobalId:CreateFpgaImageResponse' :: Maybe Text
fpgaImageGlobalId = Maybe Text
a} :: CreateFpgaImageResponse)

-- | The FPGA image identifier (AFI ID).
createFpgaImageResponse_fpgaImageId :: Lens.Lens' CreateFpgaImageResponse (Prelude.Maybe Prelude.Text)
createFpgaImageResponse_fpgaImageId :: Lens' CreateFpgaImageResponse (Maybe Text)
createFpgaImageResponse_fpgaImageId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateFpgaImageResponse' {Maybe Text
fpgaImageId :: Maybe Text
$sel:fpgaImageId:CreateFpgaImageResponse' :: CreateFpgaImageResponse -> Maybe Text
fpgaImageId} -> Maybe Text
fpgaImageId) (\s :: CreateFpgaImageResponse
s@CreateFpgaImageResponse' {} Maybe Text
a -> CreateFpgaImageResponse
s {$sel:fpgaImageId:CreateFpgaImageResponse' :: Maybe Text
fpgaImageId = Maybe Text
a} :: CreateFpgaImageResponse)

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

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