{-# 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.ListImagesInRecycleBin
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists one or more AMIs that are currently in the Recycle Bin. For more
-- information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recycle-bin.html Recycle Bin>
-- in the /Amazon EC2 User Guide/.
--
-- This operation returns paginated results.
module Amazonka.EC2.ListImagesInRecycleBin
  ( -- * Creating a Request
    ListImagesInRecycleBin (..),
    newListImagesInRecycleBin,

    -- * Request Lenses
    listImagesInRecycleBin_dryRun,
    listImagesInRecycleBin_imageIds,
    listImagesInRecycleBin_maxResults,
    listImagesInRecycleBin_nextToken,

    -- * Destructuring the Response
    ListImagesInRecycleBinResponse (..),
    newListImagesInRecycleBinResponse,

    -- * Response Lenses
    listImagesInRecycleBinResponse_images,
    listImagesInRecycleBinResponse_nextToken,
    listImagesInRecycleBinResponse_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:/ 'newListImagesInRecycleBin' smart constructor.
data ListImagesInRecycleBin = ListImagesInRecycleBin'
  { -- | 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@.
    ListImagesInRecycleBin -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The IDs of the AMIs to list. Omit this parameter to list all of the AMIs
    -- that are in the Recycle Bin. You can specify up to 20 IDs in a single
    -- request.
    ListImagesInRecycleBin -> Maybe [Text]
imageIds :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    --
    -- If you do not specify a value for /MaxResults/, the request returns
    -- 1,000 items per page by default. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination Pagination>.
    ListImagesInRecycleBin -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    ListImagesInRecycleBin -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (ListImagesInRecycleBin -> ListImagesInRecycleBin -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListImagesInRecycleBin -> ListImagesInRecycleBin -> Bool
$c/= :: ListImagesInRecycleBin -> ListImagesInRecycleBin -> Bool
== :: ListImagesInRecycleBin -> ListImagesInRecycleBin -> Bool
$c== :: ListImagesInRecycleBin -> ListImagesInRecycleBin -> Bool
Prelude.Eq, ReadPrec [ListImagesInRecycleBin]
ReadPrec ListImagesInRecycleBin
Int -> ReadS ListImagesInRecycleBin
ReadS [ListImagesInRecycleBin]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListImagesInRecycleBin]
$creadListPrec :: ReadPrec [ListImagesInRecycleBin]
readPrec :: ReadPrec ListImagesInRecycleBin
$creadPrec :: ReadPrec ListImagesInRecycleBin
readList :: ReadS [ListImagesInRecycleBin]
$creadList :: ReadS [ListImagesInRecycleBin]
readsPrec :: Int -> ReadS ListImagesInRecycleBin
$creadsPrec :: Int -> ReadS ListImagesInRecycleBin
Prelude.Read, Int -> ListImagesInRecycleBin -> ShowS
[ListImagesInRecycleBin] -> ShowS
ListImagesInRecycleBin -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListImagesInRecycleBin] -> ShowS
$cshowList :: [ListImagesInRecycleBin] -> ShowS
show :: ListImagesInRecycleBin -> String
$cshow :: ListImagesInRecycleBin -> String
showsPrec :: Int -> ListImagesInRecycleBin -> ShowS
$cshowsPrec :: Int -> ListImagesInRecycleBin -> ShowS
Prelude.Show, forall x. Rep ListImagesInRecycleBin x -> ListImagesInRecycleBin
forall x. ListImagesInRecycleBin -> Rep ListImagesInRecycleBin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListImagesInRecycleBin x -> ListImagesInRecycleBin
$cfrom :: forall x. ListImagesInRecycleBin -> Rep ListImagesInRecycleBin x
Prelude.Generic)

-- |
-- Create a value of 'ListImagesInRecycleBin' 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', 'listImagesInRecycleBin_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@.
--
-- 'imageIds', 'listImagesInRecycleBin_imageIds' - The IDs of the AMIs to list. Omit this parameter to list all of the AMIs
-- that are in the Recycle Bin. You can specify up to 20 IDs in a single
-- request.
--
-- 'maxResults', 'listImagesInRecycleBin_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If you do not specify a value for /MaxResults/, the request returns
-- 1,000 items per page by default. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination Pagination>.
--
-- 'nextToken', 'listImagesInRecycleBin_nextToken' - The token for the next page of results.
newListImagesInRecycleBin ::
  ListImagesInRecycleBin
newListImagesInRecycleBin :: ListImagesInRecycleBin
newListImagesInRecycleBin =
  ListImagesInRecycleBin'
    { $sel:dryRun:ListImagesInRecycleBin' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:imageIds:ListImagesInRecycleBin' :: Maybe [Text]
imageIds = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListImagesInRecycleBin' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListImagesInRecycleBin' :: Maybe Text
nextToken = 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@.
listImagesInRecycleBin_dryRun :: Lens.Lens' ListImagesInRecycleBin (Prelude.Maybe Prelude.Bool)
listImagesInRecycleBin_dryRun :: Lens' ListImagesInRecycleBin (Maybe Bool)
listImagesInRecycleBin_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImagesInRecycleBin' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: ListImagesInRecycleBin
s@ListImagesInRecycleBin' {} Maybe Bool
a -> ListImagesInRecycleBin
s {$sel:dryRun:ListImagesInRecycleBin' :: Maybe Bool
dryRun = Maybe Bool
a} :: ListImagesInRecycleBin)

-- | The IDs of the AMIs to list. Omit this parameter to list all of the AMIs
-- that are in the Recycle Bin. You can specify up to 20 IDs in a single
-- request.
listImagesInRecycleBin_imageIds :: Lens.Lens' ListImagesInRecycleBin (Prelude.Maybe [Prelude.Text])
listImagesInRecycleBin_imageIds :: Lens' ListImagesInRecycleBin (Maybe [Text])
listImagesInRecycleBin_imageIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImagesInRecycleBin' {Maybe [Text]
imageIds :: Maybe [Text]
$sel:imageIds:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe [Text]
imageIds} -> Maybe [Text]
imageIds) (\s :: ListImagesInRecycleBin
s@ListImagesInRecycleBin' {} Maybe [Text]
a -> ListImagesInRecycleBin
s {$sel:imageIds:ListImagesInRecycleBin' :: Maybe [Text]
imageIds = Maybe [Text]
a} :: ListImagesInRecycleBin) 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 with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- If you do not specify a value for /MaxResults/, the request returns
-- 1,000 items per page by default. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination Pagination>.
listImagesInRecycleBin_maxResults :: Lens.Lens' ListImagesInRecycleBin (Prelude.Maybe Prelude.Natural)
listImagesInRecycleBin_maxResults :: Lens' ListImagesInRecycleBin (Maybe Natural)
listImagesInRecycleBin_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImagesInRecycleBin' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListImagesInRecycleBin
s@ListImagesInRecycleBin' {} Maybe Natural
a -> ListImagesInRecycleBin
s {$sel:maxResults:ListImagesInRecycleBin' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListImagesInRecycleBin)

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

instance Core.AWSPager ListImagesInRecycleBin where
  page :: ListImagesInRecycleBin
-> AWSResponse ListImagesInRecycleBin
-> Maybe ListImagesInRecycleBin
page ListImagesInRecycleBin
rq AWSResponse ListImagesInRecycleBin
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListImagesInRecycleBin
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListImagesInRecycleBinResponse (Maybe Text)
listImagesInRecycleBinResponse_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 ListImagesInRecycleBin
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListImagesInRecycleBinResponse (Maybe [ImageRecycleBinInfo])
listImagesInRecycleBinResponse_images
            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.$ ListImagesInRecycleBin
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListImagesInRecycleBin (Maybe Text)
listImagesInRecycleBin_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListImagesInRecycleBin
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListImagesInRecycleBinResponse (Maybe Text)
listImagesInRecycleBinResponse_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 ListImagesInRecycleBin where
  type
    AWSResponse ListImagesInRecycleBin =
      ListImagesInRecycleBinResponse
  request :: (Service -> Service)
-> ListImagesInRecycleBin -> Request ListImagesInRecycleBin
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 ListImagesInRecycleBin
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListImagesInRecycleBin)))
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 [ImageRecycleBinInfo]
-> Maybe Text -> Int -> ListImagesInRecycleBinResponse
ListImagesInRecycleBinResponse'
            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
"imageSet"
                            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 ListImagesInRecycleBin where
  hashWithSalt :: Int -> ListImagesInRecycleBin -> Int
hashWithSalt Int
_salt ListImagesInRecycleBin' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
imageIds :: Maybe [Text]
dryRun :: Maybe Bool
$sel:nextToken:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Text
$sel:maxResults:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Natural
$sel:imageIds:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe [Text]
$sel:dryRun:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> 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 [Text]
imageIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData ListImagesInRecycleBin where
  rnf :: ListImagesInRecycleBin -> ()
rnf ListImagesInRecycleBin' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
imageIds :: Maybe [Text]
dryRun :: Maybe Bool
$sel:nextToken:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Text
$sel:maxResults:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Natural
$sel:imageIds:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe [Text]
$sel:dryRun:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> 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 [Text]
imageIds
      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

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

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

instance Data.ToQuery ListImagesInRecycleBin where
  toQuery :: ListImagesInRecycleBin -> QueryString
toQuery ListImagesInRecycleBin' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
imageIds :: Maybe [Text]
dryRun :: Maybe Bool
$sel:nextToken:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Text
$sel:maxResults:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Natural
$sel:imageIds:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe [Text]
$sel:dryRun:ListImagesInRecycleBin' :: ListImagesInRecycleBin -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"ListImagesInRecycleBin" :: 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
"ImageId" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
imageIds),
        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
      ]

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

-- |
-- Create a value of 'ListImagesInRecycleBinResponse' 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:
--
-- 'images', 'listImagesInRecycleBinResponse_images' - Information about the AMIs.
--
-- 'nextToken', 'listImagesInRecycleBinResponse_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', 'listImagesInRecycleBinResponse_httpStatus' - The response's http status code.
newListImagesInRecycleBinResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListImagesInRecycleBinResponse
newListImagesInRecycleBinResponse :: Int -> ListImagesInRecycleBinResponse
newListImagesInRecycleBinResponse Int
pHttpStatus_ =
  ListImagesInRecycleBinResponse'
    { $sel:images:ListImagesInRecycleBinResponse' :: Maybe [ImageRecycleBinInfo]
images =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListImagesInRecycleBinResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListImagesInRecycleBinResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the AMIs.
listImagesInRecycleBinResponse_images :: Lens.Lens' ListImagesInRecycleBinResponse (Prelude.Maybe [ImageRecycleBinInfo])
listImagesInRecycleBinResponse_images :: Lens' ListImagesInRecycleBinResponse (Maybe [ImageRecycleBinInfo])
listImagesInRecycleBinResponse_images = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImagesInRecycleBinResponse' {Maybe [ImageRecycleBinInfo]
images :: Maybe [ImageRecycleBinInfo]
$sel:images:ListImagesInRecycleBinResponse' :: ListImagesInRecycleBinResponse -> Maybe [ImageRecycleBinInfo]
images} -> Maybe [ImageRecycleBinInfo]
images) (\s :: ListImagesInRecycleBinResponse
s@ListImagesInRecycleBinResponse' {} Maybe [ImageRecycleBinInfo]
a -> ListImagesInRecycleBinResponse
s {$sel:images:ListImagesInRecycleBinResponse' :: Maybe [ImageRecycleBinInfo]
images = Maybe [ImageRecycleBinInfo]
a} :: ListImagesInRecycleBinResponse) 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.
listImagesInRecycleBinResponse_nextToken :: Lens.Lens' ListImagesInRecycleBinResponse (Prelude.Maybe Prelude.Text)
listImagesInRecycleBinResponse_nextToken :: Lens' ListImagesInRecycleBinResponse (Maybe Text)
listImagesInRecycleBinResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImagesInRecycleBinResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListImagesInRecycleBinResponse' :: ListImagesInRecycleBinResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListImagesInRecycleBinResponse
s@ListImagesInRecycleBinResponse' {} Maybe Text
a -> ListImagesInRecycleBinResponse
s {$sel:nextToken:ListImagesInRecycleBinResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListImagesInRecycleBinResponse)

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

instance
  Prelude.NFData
    ListImagesInRecycleBinResponse
  where
  rnf :: ListImagesInRecycleBinResponse -> ()
rnf ListImagesInRecycleBinResponse' {Int
Maybe [ImageRecycleBinInfo]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
images :: Maybe [ImageRecycleBinInfo]
$sel:httpStatus:ListImagesInRecycleBinResponse' :: ListImagesInRecycleBinResponse -> Int
$sel:nextToken:ListImagesInRecycleBinResponse' :: ListImagesInRecycleBinResponse -> Maybe Text
$sel:images:ListImagesInRecycleBinResponse' :: ListImagesInRecycleBinResponse -> Maybe [ImageRecycleBinInfo]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [ImageRecycleBinInfo]
images
      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