{-# 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.DescribeFpgaImages
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes the Amazon FPGA Images (AFIs) available to you. These include
-- public AFIs, private AFIs that you own, and AFIs owned by other Amazon
-- Web Services accounts for which you have load permissions.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeFpgaImages
  ( -- * Creating a Request
    DescribeFpgaImages (..),
    newDescribeFpgaImages,

    -- * Request Lenses
    describeFpgaImages_dryRun,
    describeFpgaImages_filters,
    describeFpgaImages_fpgaImageIds,
    describeFpgaImages_maxResults,
    describeFpgaImages_nextToken,
    describeFpgaImages_owners,

    -- * Destructuring the Response
    DescribeFpgaImagesResponse (..),
    newDescribeFpgaImagesResponse,

    -- * Response Lenses
    describeFpgaImagesResponse_fpgaImages,
    describeFpgaImagesResponse_nextToken,
    describeFpgaImagesResponse_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:/ 'newDescribeFpgaImages' smart constructor.
data DescribeFpgaImages = DescribeFpgaImages'
  { -- | 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@.
    DescribeFpgaImages -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The filters.
    --
    -- -   @create-time@ - The creation time of the AFI.
    --
    -- -   @fpga-image-id@ - The FPGA image identifier (AFI ID).
    --
    -- -   @fpga-image-global-id@ - The global FPGA image identifier (AGFI ID).
    --
    -- -   @name@ - The name of the AFI.
    --
    -- -   @owner-id@ - The Amazon Web Services account ID of the AFI owner.
    --
    -- -   @product-code@ - The product code.
    --
    -- -   @shell-version@ - The version of the Amazon Web Services Shell that
    --     was used to create the bitstream.
    --
    -- -   @state@ - The state of the AFI (@pending@ | @failed@ | @available@ |
    --     @unavailable@).
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources assigned a tag with a specific key,
    --     regardless of the tag value.
    --
    -- -   @update-time@ - The time of the most recent update.
    DescribeFpgaImages -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The AFI IDs.
    DescribeFpgaImages -> Maybe [Text]
fpgaImageIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return in a single call.
    DescribeFpgaImages -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to retrieve the next page of results.
    DescribeFpgaImages -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters the AFI by owner. Specify an Amazon Web Services account ID,
    -- @self@ (owner is the sender of the request), or an Amazon Web Services
    -- owner alias (valid values are @amazon@ | @aws-marketplace@).
    DescribeFpgaImages -> Maybe [Text]
owners :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeFpgaImages -> DescribeFpgaImages -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFpgaImages -> DescribeFpgaImages -> Bool
$c/= :: DescribeFpgaImages -> DescribeFpgaImages -> Bool
== :: DescribeFpgaImages -> DescribeFpgaImages -> Bool
$c== :: DescribeFpgaImages -> DescribeFpgaImages -> Bool
Prelude.Eq, ReadPrec [DescribeFpgaImages]
ReadPrec DescribeFpgaImages
Int -> ReadS DescribeFpgaImages
ReadS [DescribeFpgaImages]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFpgaImages]
$creadListPrec :: ReadPrec [DescribeFpgaImages]
readPrec :: ReadPrec DescribeFpgaImages
$creadPrec :: ReadPrec DescribeFpgaImages
readList :: ReadS [DescribeFpgaImages]
$creadList :: ReadS [DescribeFpgaImages]
readsPrec :: Int -> ReadS DescribeFpgaImages
$creadsPrec :: Int -> ReadS DescribeFpgaImages
Prelude.Read, Int -> DescribeFpgaImages -> ShowS
[DescribeFpgaImages] -> ShowS
DescribeFpgaImages -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFpgaImages] -> ShowS
$cshowList :: [DescribeFpgaImages] -> ShowS
show :: DescribeFpgaImages -> String
$cshow :: DescribeFpgaImages -> String
showsPrec :: Int -> DescribeFpgaImages -> ShowS
$cshowsPrec :: Int -> DescribeFpgaImages -> ShowS
Prelude.Show, forall x. Rep DescribeFpgaImages x -> DescribeFpgaImages
forall x. DescribeFpgaImages -> Rep DescribeFpgaImages x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFpgaImages x -> DescribeFpgaImages
$cfrom :: forall x. DescribeFpgaImages -> Rep DescribeFpgaImages x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFpgaImages' 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:
--
-- 'dryRun', 'describeFpgaImages_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@.
--
-- 'filters', 'describeFpgaImages_filters' - The filters.
--
-- -   @create-time@ - The creation time of the AFI.
--
-- -   @fpga-image-id@ - The FPGA image identifier (AFI ID).
--
-- -   @fpga-image-global-id@ - The global FPGA image identifier (AGFI ID).
--
-- -   @name@ - The name of the AFI.
--
-- -   @owner-id@ - The Amazon Web Services account ID of the AFI owner.
--
-- -   @product-code@ - The product code.
--
-- -   @shell-version@ - The version of the Amazon Web Services Shell that
--     was used to create the bitstream.
--
-- -   @state@ - The state of the AFI (@pending@ | @failed@ | @available@ |
--     @unavailable@).
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @update-time@ - The time of the most recent update.
--
-- 'fpgaImageIds', 'describeFpgaImages_fpgaImageIds' - The AFI IDs.
--
-- 'maxResults', 'describeFpgaImages_maxResults' - The maximum number of results to return in a single call.
--
-- 'nextToken', 'describeFpgaImages_nextToken' - The token to retrieve the next page of results.
--
-- 'owners', 'describeFpgaImages_owners' - Filters the AFI by owner. Specify an Amazon Web Services account ID,
-- @self@ (owner is the sender of the request), or an Amazon Web Services
-- owner alias (valid values are @amazon@ | @aws-marketplace@).
newDescribeFpgaImages ::
  DescribeFpgaImages
newDescribeFpgaImages :: DescribeFpgaImages
newDescribeFpgaImages =
  DescribeFpgaImages'
    { $sel:dryRun:DescribeFpgaImages' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeFpgaImages' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:fpgaImageIds:DescribeFpgaImages' :: Maybe [Text]
fpgaImageIds = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeFpgaImages' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeFpgaImages' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:owners:DescribeFpgaImages' :: Maybe [Text]
owners = forall a. Maybe a
Prelude.Nothing
    }

-- | 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@.
describeFpgaImages_dryRun :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe Prelude.Bool)
describeFpgaImages_dryRun :: Lens' DescribeFpgaImages (Maybe Bool)
describeFpgaImages_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe Bool
a -> DescribeFpgaImages
s {$sel:dryRun:DescribeFpgaImages' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeFpgaImages)

-- | The filters.
--
-- -   @create-time@ - The creation time of the AFI.
--
-- -   @fpga-image-id@ - The FPGA image identifier (AFI ID).
--
-- -   @fpga-image-global-id@ - The global FPGA image identifier (AGFI ID).
--
-- -   @name@ - The name of the AFI.
--
-- -   @owner-id@ - The Amazon Web Services account ID of the AFI owner.
--
-- -   @product-code@ - The product code.
--
-- -   @shell-version@ - The version of the Amazon Web Services Shell that
--     was used to create the bitstream.
--
-- -   @state@ - The state of the AFI (@pending@ | @failed@ | @available@ |
--     @unavailable@).
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @update-time@ - The time of the most recent update.
describeFpgaImages_filters :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe [Filter])
describeFpgaImages_filters :: Lens' DescribeFpgaImages (Maybe [Filter])
describeFpgaImages_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe [Filter]
a -> DescribeFpgaImages
s {$sel:filters:DescribeFpgaImages' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeFpgaImages) 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 AFI IDs.
describeFpgaImages_fpgaImageIds :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe [Prelude.Text])
describeFpgaImages_fpgaImageIds :: Lens' DescribeFpgaImages (Maybe [Text])
describeFpgaImages_fpgaImageIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe [Text]
fpgaImageIds :: Maybe [Text]
$sel:fpgaImageIds:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
fpgaImageIds} -> Maybe [Text]
fpgaImageIds) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe [Text]
a -> DescribeFpgaImages
s {$sel:fpgaImageIds:DescribeFpgaImages' :: Maybe [Text]
fpgaImageIds = Maybe [Text]
a} :: DescribeFpgaImages) 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 maximum number of results to return in a single call.
describeFpgaImages_maxResults :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe Prelude.Natural)
describeFpgaImages_maxResults :: Lens' DescribeFpgaImages (Maybe Natural)
describeFpgaImages_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe Natural
a -> DescribeFpgaImages
s {$sel:maxResults:DescribeFpgaImages' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeFpgaImages)

-- | The token to retrieve the next page of results.
describeFpgaImages_nextToken :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe Prelude.Text)
describeFpgaImages_nextToken :: Lens' DescribeFpgaImages (Maybe Text)
describeFpgaImages_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe Text
a -> DescribeFpgaImages
s {$sel:nextToken:DescribeFpgaImages' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFpgaImages)

-- | Filters the AFI by owner. Specify an Amazon Web Services account ID,
-- @self@ (owner is the sender of the request), or an Amazon Web Services
-- owner alias (valid values are @amazon@ | @aws-marketplace@).
describeFpgaImages_owners :: Lens.Lens' DescribeFpgaImages (Prelude.Maybe [Prelude.Text])
describeFpgaImages_owners :: Lens' DescribeFpgaImages (Maybe [Text])
describeFpgaImages_owners = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImages' {Maybe [Text]
owners :: Maybe [Text]
$sel:owners:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
owners} -> Maybe [Text]
owners) (\s :: DescribeFpgaImages
s@DescribeFpgaImages' {} Maybe [Text]
a -> DescribeFpgaImages
s {$sel:owners:DescribeFpgaImages' :: Maybe [Text]
owners = Maybe [Text]
a} :: DescribeFpgaImages) 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

instance Core.AWSPager DescribeFpgaImages where
  page :: DescribeFpgaImages
-> AWSResponse DescribeFpgaImages -> Maybe DescribeFpgaImages
page DescribeFpgaImages
rq AWSResponse DescribeFpgaImages
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeFpgaImages
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFpgaImagesResponse (Maybe Text)
describeFpgaImagesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeFpgaImages
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFpgaImagesResponse (Maybe [FpgaImage])
describeFpgaImagesResponse_fpgaImages
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeFpgaImages
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeFpgaImages (Maybe Text)
describeFpgaImages_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeFpgaImages
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeFpgaImagesResponse (Maybe Text)
describeFpgaImagesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeFpgaImages where
  type
    AWSResponse DescribeFpgaImages =
      DescribeFpgaImagesResponse
  request :: (Service -> Service)
-> DescribeFpgaImages -> Request DescribeFpgaImages
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 DescribeFpgaImages
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeFpgaImages)))
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 [FpgaImage]
-> Maybe Text -> Int -> DescribeFpgaImagesResponse
DescribeFpgaImagesResponse'
            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
"fpgaImageSet"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                            forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                        )
            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
"nextToken")
            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 DescribeFpgaImages where
  hashWithSalt :: Int -> DescribeFpgaImages -> Int
hashWithSalt Int
_salt DescribeFpgaImages' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
owners :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
fpgaImageIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:owners:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:nextToken:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Text
$sel:maxResults:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Natural
$sel:fpgaImageIds:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:filters:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Filter]
$sel:dryRun:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
fpgaImageIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
owners

instance Prelude.NFData DescribeFpgaImages where
  rnf :: DescribeFpgaImages -> ()
rnf DescribeFpgaImages' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
owners :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
fpgaImageIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:owners:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:nextToken:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Text
$sel:maxResults:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Natural
$sel:fpgaImageIds:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:filters:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Filter]
$sel:dryRun:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Bool
..} =
    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 [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
fpgaImageIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
owners

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

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

instance Data.ToQuery DescribeFpgaImages where
  toQuery :: DescribeFpgaImages -> QueryString
toQuery DescribeFpgaImages' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [Filter]
Maybe Text
owners :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
fpgaImageIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:owners:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:nextToken:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Text
$sel:maxResults:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Natural
$sel:fpgaImageIds:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Text]
$sel:filters:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe [Filter]
$sel:dryRun:DescribeFpgaImages' :: DescribeFpgaImages -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeFpgaImages" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"FpgaImageId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
fpgaImageIds
          ),
        ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Owner" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
owners)
      ]

-- | /See:/ 'newDescribeFpgaImagesResponse' smart constructor.
data DescribeFpgaImagesResponse = DescribeFpgaImagesResponse'
  { -- | Information about the FPGA images.
    DescribeFpgaImagesResponse -> Maybe [FpgaImage]
fpgaImages :: Prelude.Maybe [FpgaImage],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeFpgaImagesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeFpgaImagesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeFpgaImagesResponse -> DescribeFpgaImagesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFpgaImagesResponse -> DescribeFpgaImagesResponse -> Bool
$c/= :: DescribeFpgaImagesResponse -> DescribeFpgaImagesResponse -> Bool
== :: DescribeFpgaImagesResponse -> DescribeFpgaImagesResponse -> Bool
$c== :: DescribeFpgaImagesResponse -> DescribeFpgaImagesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFpgaImagesResponse]
ReadPrec DescribeFpgaImagesResponse
Int -> ReadS DescribeFpgaImagesResponse
ReadS [DescribeFpgaImagesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFpgaImagesResponse]
$creadListPrec :: ReadPrec [DescribeFpgaImagesResponse]
readPrec :: ReadPrec DescribeFpgaImagesResponse
$creadPrec :: ReadPrec DescribeFpgaImagesResponse
readList :: ReadS [DescribeFpgaImagesResponse]
$creadList :: ReadS [DescribeFpgaImagesResponse]
readsPrec :: Int -> ReadS DescribeFpgaImagesResponse
$creadsPrec :: Int -> ReadS DescribeFpgaImagesResponse
Prelude.Read, Int -> DescribeFpgaImagesResponse -> ShowS
[DescribeFpgaImagesResponse] -> ShowS
DescribeFpgaImagesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFpgaImagesResponse] -> ShowS
$cshowList :: [DescribeFpgaImagesResponse] -> ShowS
show :: DescribeFpgaImagesResponse -> String
$cshow :: DescribeFpgaImagesResponse -> String
showsPrec :: Int -> DescribeFpgaImagesResponse -> ShowS
$cshowsPrec :: Int -> DescribeFpgaImagesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeFpgaImagesResponse x -> DescribeFpgaImagesResponse
forall x.
DescribeFpgaImagesResponse -> Rep DescribeFpgaImagesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFpgaImagesResponse x -> DescribeFpgaImagesResponse
$cfrom :: forall x.
DescribeFpgaImagesResponse -> Rep DescribeFpgaImagesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeFpgaImagesResponse' 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:
--
-- 'fpgaImages', 'describeFpgaImagesResponse_fpgaImages' - Information about the FPGA images.
--
-- 'nextToken', 'describeFpgaImagesResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeFpgaImagesResponse_httpStatus' - The response's http status code.
newDescribeFpgaImagesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeFpgaImagesResponse
newDescribeFpgaImagesResponse :: Int -> DescribeFpgaImagesResponse
newDescribeFpgaImagesResponse Int
pHttpStatus_ =
  DescribeFpgaImagesResponse'
    { $sel:fpgaImages:DescribeFpgaImagesResponse' :: Maybe [FpgaImage]
fpgaImages =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeFpgaImagesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeFpgaImagesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the FPGA images.
describeFpgaImagesResponse_fpgaImages :: Lens.Lens' DescribeFpgaImagesResponse (Prelude.Maybe [FpgaImage])
describeFpgaImagesResponse_fpgaImages :: Lens' DescribeFpgaImagesResponse (Maybe [FpgaImage])
describeFpgaImagesResponse_fpgaImages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImagesResponse' {Maybe [FpgaImage]
fpgaImages :: Maybe [FpgaImage]
$sel:fpgaImages:DescribeFpgaImagesResponse' :: DescribeFpgaImagesResponse -> Maybe [FpgaImage]
fpgaImages} -> Maybe [FpgaImage]
fpgaImages) (\s :: DescribeFpgaImagesResponse
s@DescribeFpgaImagesResponse' {} Maybe [FpgaImage]
a -> DescribeFpgaImagesResponse
s {$sel:fpgaImages:DescribeFpgaImagesResponse' :: Maybe [FpgaImage]
fpgaImages = Maybe [FpgaImage]
a} :: DescribeFpgaImagesResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeFpgaImagesResponse_nextToken :: Lens.Lens' DescribeFpgaImagesResponse (Prelude.Maybe Prelude.Text)
describeFpgaImagesResponse_nextToken :: Lens' DescribeFpgaImagesResponse (Maybe Text)
describeFpgaImagesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFpgaImagesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeFpgaImagesResponse' :: DescribeFpgaImagesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeFpgaImagesResponse
s@DescribeFpgaImagesResponse' {} Maybe Text
a -> DescribeFpgaImagesResponse
s {$sel:nextToken:DescribeFpgaImagesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeFpgaImagesResponse)

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

instance Prelude.NFData DescribeFpgaImagesResponse where
  rnf :: DescribeFpgaImagesResponse -> ()
rnf DescribeFpgaImagesResponse' {Int
Maybe [FpgaImage]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
fpgaImages :: Maybe [FpgaImage]
$sel:httpStatus:DescribeFpgaImagesResponse' :: DescribeFpgaImagesResponse -> Int
$sel:nextToken:DescribeFpgaImagesResponse' :: DescribeFpgaImagesResponse -> Maybe Text
$sel:fpgaImages:DescribeFpgaImagesResponse' :: DescribeFpgaImagesResponse -> Maybe [FpgaImage]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [FpgaImage]
fpgaImages
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus