{-# 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.ImageBuilder.ListImageBuildVersions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of image build versions.
module Amazonka.ImageBuilder.ListImageBuildVersions
  ( -- * Creating a Request
    ListImageBuildVersions (..),
    newListImageBuildVersions,

    -- * Request Lenses
    listImageBuildVersions_filters,
    listImageBuildVersions_nextToken,
    listImageBuildVersions_maxResults,
    listImageBuildVersions_imageVersionArn,

    -- * Destructuring the Response
    ListImageBuildVersionsResponse (..),
    newListImageBuildVersionsResponse,

    -- * Response Lenses
    listImageBuildVersionsResponse_requestId,
    listImageBuildVersionsResponse_nextToken,
    listImageBuildVersionsResponse_imageSummaryList,
    listImageBuildVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListImageBuildVersions' smart constructor.
data ListImageBuildVersions = ListImageBuildVersions'
  { -- | Use the following filters to streamline results:
    --
    -- -   @name@
    --
    -- -   @osVersion@
    --
    -- -   @platform@
    --
    -- -   @type@
    --
    -- -   @version@
    ListImageBuildVersions -> Maybe (NonEmpty Filter)
filters :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | A token to specify where to start paginating. This is the NextToken from
    -- a previously truncated response.
    ListImageBuildVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum items to return in a request.
    ListImageBuildVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the image whose build versions you
    -- want to retrieve.
    ListImageBuildVersions -> Text
imageVersionArn :: Prelude.Text
  }
  deriving (ListImageBuildVersions -> ListImageBuildVersions -> Bool
(ListImageBuildVersions -> ListImageBuildVersions -> Bool)
-> (ListImageBuildVersions -> ListImageBuildVersions -> Bool)
-> Eq ListImageBuildVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListImageBuildVersions -> ListImageBuildVersions -> Bool
$c/= :: ListImageBuildVersions -> ListImageBuildVersions -> Bool
== :: ListImageBuildVersions -> ListImageBuildVersions -> Bool
$c== :: ListImageBuildVersions -> ListImageBuildVersions -> Bool
Prelude.Eq, ReadPrec [ListImageBuildVersions]
ReadPrec ListImageBuildVersions
Int -> ReadS ListImageBuildVersions
ReadS [ListImageBuildVersions]
(Int -> ReadS ListImageBuildVersions)
-> ReadS [ListImageBuildVersions]
-> ReadPrec ListImageBuildVersions
-> ReadPrec [ListImageBuildVersions]
-> Read ListImageBuildVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListImageBuildVersions]
$creadListPrec :: ReadPrec [ListImageBuildVersions]
readPrec :: ReadPrec ListImageBuildVersions
$creadPrec :: ReadPrec ListImageBuildVersions
readList :: ReadS [ListImageBuildVersions]
$creadList :: ReadS [ListImageBuildVersions]
readsPrec :: Int -> ReadS ListImageBuildVersions
$creadsPrec :: Int -> ReadS ListImageBuildVersions
Prelude.Read, Int -> ListImageBuildVersions -> ShowS
[ListImageBuildVersions] -> ShowS
ListImageBuildVersions -> String
(Int -> ListImageBuildVersions -> ShowS)
-> (ListImageBuildVersions -> String)
-> ([ListImageBuildVersions] -> ShowS)
-> Show ListImageBuildVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListImageBuildVersions] -> ShowS
$cshowList :: [ListImageBuildVersions] -> ShowS
show :: ListImageBuildVersions -> String
$cshow :: ListImageBuildVersions -> String
showsPrec :: Int -> ListImageBuildVersions -> ShowS
$cshowsPrec :: Int -> ListImageBuildVersions -> ShowS
Prelude.Show, (forall x. ListImageBuildVersions -> Rep ListImageBuildVersions x)
-> (forall x.
    Rep ListImageBuildVersions x -> ListImageBuildVersions)
-> Generic ListImageBuildVersions
forall x. Rep ListImageBuildVersions x -> ListImageBuildVersions
forall x. ListImageBuildVersions -> Rep ListImageBuildVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListImageBuildVersions x -> ListImageBuildVersions
$cfrom :: forall x. ListImageBuildVersions -> Rep ListImageBuildVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListImageBuildVersions' 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:
--
-- 'filters', 'listImageBuildVersions_filters' - Use the following filters to streamline results:
--
-- -   @name@
--
-- -   @osVersion@
--
-- -   @platform@
--
-- -   @type@
--
-- -   @version@
--
-- 'nextToken', 'listImageBuildVersions_nextToken' - A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
--
-- 'maxResults', 'listImageBuildVersions_maxResults' - The maximum items to return in a request.
--
-- 'imageVersionArn', 'listImageBuildVersions_imageVersionArn' - The Amazon Resource Name (ARN) of the image whose build versions you
-- want to retrieve.
newListImageBuildVersions ::
  -- | 'imageVersionArn'
  Prelude.Text ->
  ListImageBuildVersions
newListImageBuildVersions :: Text -> ListImageBuildVersions
newListImageBuildVersions Text
pImageVersionArn_ =
  ListImageBuildVersions' :: Maybe (NonEmpty Filter)
-> Maybe Text -> Maybe Natural -> Text -> ListImageBuildVersions
ListImageBuildVersions'
    { $sel:filters:ListImageBuildVersions' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListImageBuildVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListImageBuildVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:imageVersionArn:ListImageBuildVersions' :: Text
imageVersionArn = Text
pImageVersionArn_
    }

-- | Use the following filters to streamline results:
--
-- -   @name@
--
-- -   @osVersion@
--
-- -   @platform@
--
-- -   @type@
--
-- -   @version@
listImageBuildVersions_filters :: Lens.Lens' ListImageBuildVersions (Prelude.Maybe (Prelude.NonEmpty Filter))
listImageBuildVersions_filters :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListImageBuildVersions -> f ListImageBuildVersions
listImageBuildVersions_filters = (ListImageBuildVersions -> Maybe (NonEmpty Filter))
-> (ListImageBuildVersions
    -> Maybe (NonEmpty Filter) -> ListImageBuildVersions)
-> Lens
     ListImageBuildVersions
     ListImageBuildVersions
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersions' {Maybe (NonEmpty Filter)
filters :: Maybe (NonEmpty Filter)
$sel:filters:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe (NonEmpty Filter)
filters} -> Maybe (NonEmpty Filter)
filters) (\s :: ListImageBuildVersions
s@ListImageBuildVersions' {} Maybe (NonEmpty Filter)
a -> ListImageBuildVersions
s {$sel:filters:ListImageBuildVersions' :: Maybe (NonEmpty Filter)
filters = Maybe (NonEmpty Filter)
a} :: ListImageBuildVersions) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListImageBuildVersions -> f ListImageBuildVersions)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListImageBuildVersions
-> f ListImageBuildVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to specify where to start paginating. This is the NextToken from
-- a previously truncated response.
listImageBuildVersions_nextToken :: Lens.Lens' ListImageBuildVersions (Prelude.Maybe Prelude.Text)
listImageBuildVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListImageBuildVersions -> f ListImageBuildVersions
listImageBuildVersions_nextToken = (ListImageBuildVersions -> Maybe Text)
-> (ListImageBuildVersions -> Maybe Text -> ListImageBuildVersions)
-> Lens
     ListImageBuildVersions
     ListImageBuildVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListImageBuildVersions
s@ListImageBuildVersions' {} Maybe Text
a -> ListImageBuildVersions
s {$sel:nextToken:ListImageBuildVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListImageBuildVersions)

-- | The maximum items to return in a request.
listImageBuildVersions_maxResults :: Lens.Lens' ListImageBuildVersions (Prelude.Maybe Prelude.Natural)
listImageBuildVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListImageBuildVersions -> f ListImageBuildVersions
listImageBuildVersions_maxResults = (ListImageBuildVersions -> Maybe Natural)
-> (ListImageBuildVersions
    -> Maybe Natural -> ListImageBuildVersions)
-> Lens
     ListImageBuildVersions
     ListImageBuildVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListImageBuildVersions
s@ListImageBuildVersions' {} Maybe Natural
a -> ListImageBuildVersions
s {$sel:maxResults:ListImageBuildVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListImageBuildVersions)

-- | The Amazon Resource Name (ARN) of the image whose build versions you
-- want to retrieve.
listImageBuildVersions_imageVersionArn :: Lens.Lens' ListImageBuildVersions Prelude.Text
listImageBuildVersions_imageVersionArn :: (Text -> f Text)
-> ListImageBuildVersions -> f ListImageBuildVersions
listImageBuildVersions_imageVersionArn = (ListImageBuildVersions -> Text)
-> (ListImageBuildVersions -> Text -> ListImageBuildVersions)
-> Lens ListImageBuildVersions ListImageBuildVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersions' {Text
imageVersionArn :: Text
$sel:imageVersionArn:ListImageBuildVersions' :: ListImageBuildVersions -> Text
imageVersionArn} -> Text
imageVersionArn) (\s :: ListImageBuildVersions
s@ListImageBuildVersions' {} Text
a -> ListImageBuildVersions
s {$sel:imageVersionArn:ListImageBuildVersions' :: Text
imageVersionArn = Text
a} :: ListImageBuildVersions)

instance Core.AWSRequest ListImageBuildVersions where
  type
    AWSResponse ListImageBuildVersions =
      ListImageBuildVersionsResponse
  request :: ListImageBuildVersions -> Request ListImageBuildVersions
request = Service -> ListImageBuildVersions -> Request ListImageBuildVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListImageBuildVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListImageBuildVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListImageBuildVersions))
-> Logger
-> Service
-> Proxy ListImageBuildVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListImageBuildVersions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [ImageSummary]
-> Int
-> ListImageBuildVersionsResponse
ListImageBuildVersionsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [ImageSummary]
 -> Int
 -> ListImageBuildVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [ImageSummary] -> Int -> ListImageBuildVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"requestId")
            Either
  String
  (Maybe Text
   -> Maybe [ImageSummary] -> Int -> ListImageBuildVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ImageSummary] -> Int -> ListImageBuildVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Maybe [ImageSummary] -> Int -> ListImageBuildVersionsResponse)
-> Either String (Maybe [ImageSummary])
-> Either String (Int -> ListImageBuildVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ImageSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"imageSummaryList"
                            Either String (Maybe (Maybe [ImageSummary]))
-> Maybe [ImageSummary] -> Either String (Maybe [ImageSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ImageSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListImageBuildVersionsResponse)
-> Either String Int
-> Either String ListImageBuildVersionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListImageBuildVersions

instance Prelude.NFData ListImageBuildVersions

instance Core.ToHeaders ListImageBuildVersions where
  toHeaders :: ListImageBuildVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListImageBuildVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ListImageBuildVersions where
  toJSON :: ListImageBuildVersions -> Value
toJSON ListImageBuildVersions' {Maybe Natural
Maybe (NonEmpty Filter)
Maybe Text
Text
imageVersionArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe (NonEmpty Filter)
$sel:imageVersionArn:ListImageBuildVersions' :: ListImageBuildVersions -> Text
$sel:maxResults:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe Natural
$sel:nextToken:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe Text
$sel:filters:ListImageBuildVersions' :: ListImageBuildVersions -> Maybe (NonEmpty Filter)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"filters" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filters,
            (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"imageVersionArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
imageVersionArn)
          ]
      )

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

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

-- | /See:/ 'newListImageBuildVersionsResponse' smart constructor.
data ListImageBuildVersionsResponse = ListImageBuildVersionsResponse'
  { -- | The request ID that uniquely identifies this request.
    ListImageBuildVersionsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The next token used for paginated responses. When this is not empty,
    -- there are additional elements that the service has not included in this
    -- request. Use this token with the next request to retrieve additional
    -- objects.
    ListImageBuildVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of image build versions.
    ListImageBuildVersionsResponse -> Maybe [ImageSummary]
imageSummaryList :: Prelude.Maybe [ImageSummary],
    -- | The response's http status code.
    ListImageBuildVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListImageBuildVersionsResponse
-> ListImageBuildVersionsResponse -> Bool
(ListImageBuildVersionsResponse
 -> ListImageBuildVersionsResponse -> Bool)
-> (ListImageBuildVersionsResponse
    -> ListImageBuildVersionsResponse -> Bool)
-> Eq ListImageBuildVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListImageBuildVersionsResponse
-> ListImageBuildVersionsResponse -> Bool
$c/= :: ListImageBuildVersionsResponse
-> ListImageBuildVersionsResponse -> Bool
== :: ListImageBuildVersionsResponse
-> ListImageBuildVersionsResponse -> Bool
$c== :: ListImageBuildVersionsResponse
-> ListImageBuildVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListImageBuildVersionsResponse]
ReadPrec ListImageBuildVersionsResponse
Int -> ReadS ListImageBuildVersionsResponse
ReadS [ListImageBuildVersionsResponse]
(Int -> ReadS ListImageBuildVersionsResponse)
-> ReadS [ListImageBuildVersionsResponse]
-> ReadPrec ListImageBuildVersionsResponse
-> ReadPrec [ListImageBuildVersionsResponse]
-> Read ListImageBuildVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListImageBuildVersionsResponse]
$creadListPrec :: ReadPrec [ListImageBuildVersionsResponse]
readPrec :: ReadPrec ListImageBuildVersionsResponse
$creadPrec :: ReadPrec ListImageBuildVersionsResponse
readList :: ReadS [ListImageBuildVersionsResponse]
$creadList :: ReadS [ListImageBuildVersionsResponse]
readsPrec :: Int -> ReadS ListImageBuildVersionsResponse
$creadsPrec :: Int -> ReadS ListImageBuildVersionsResponse
Prelude.Read, Int -> ListImageBuildVersionsResponse -> ShowS
[ListImageBuildVersionsResponse] -> ShowS
ListImageBuildVersionsResponse -> String
(Int -> ListImageBuildVersionsResponse -> ShowS)
-> (ListImageBuildVersionsResponse -> String)
-> ([ListImageBuildVersionsResponse] -> ShowS)
-> Show ListImageBuildVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListImageBuildVersionsResponse] -> ShowS
$cshowList :: [ListImageBuildVersionsResponse] -> ShowS
show :: ListImageBuildVersionsResponse -> String
$cshow :: ListImageBuildVersionsResponse -> String
showsPrec :: Int -> ListImageBuildVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListImageBuildVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListImageBuildVersionsResponse
 -> Rep ListImageBuildVersionsResponse x)
-> (forall x.
    Rep ListImageBuildVersionsResponse x
    -> ListImageBuildVersionsResponse)
-> Generic ListImageBuildVersionsResponse
forall x.
Rep ListImageBuildVersionsResponse x
-> ListImageBuildVersionsResponse
forall x.
ListImageBuildVersionsResponse
-> Rep ListImageBuildVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListImageBuildVersionsResponse x
-> ListImageBuildVersionsResponse
$cfrom :: forall x.
ListImageBuildVersionsResponse
-> Rep ListImageBuildVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListImageBuildVersionsResponse' 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:
--
-- 'requestId', 'listImageBuildVersionsResponse_requestId' - The request ID that uniquely identifies this request.
--
-- 'nextToken', 'listImageBuildVersionsResponse_nextToken' - The next token used for paginated responses. When this is not empty,
-- there are additional elements that the service has not included in this
-- request. Use this token with the next request to retrieve additional
-- objects.
--
-- 'imageSummaryList', 'listImageBuildVersionsResponse_imageSummaryList' - The list of image build versions.
--
-- 'httpStatus', 'listImageBuildVersionsResponse_httpStatus' - The response's http status code.
newListImageBuildVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListImageBuildVersionsResponse
newListImageBuildVersionsResponse :: Int -> ListImageBuildVersionsResponse
newListImageBuildVersionsResponse Int
pHttpStatus_ =
  ListImageBuildVersionsResponse' :: Maybe Text
-> Maybe Text
-> Maybe [ImageSummary]
-> Int
-> ListImageBuildVersionsResponse
ListImageBuildVersionsResponse'
    { $sel:requestId:ListImageBuildVersionsResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListImageBuildVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:imageSummaryList:ListImageBuildVersionsResponse' :: Maybe [ImageSummary]
imageSummaryList = Maybe [ImageSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListImageBuildVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The request ID that uniquely identifies this request.
listImageBuildVersionsResponse_requestId :: Lens.Lens' ListImageBuildVersionsResponse (Prelude.Maybe Prelude.Text)
listImageBuildVersionsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListImageBuildVersionsResponse
-> f ListImageBuildVersionsResponse
listImageBuildVersionsResponse_requestId = (ListImageBuildVersionsResponse -> Maybe Text)
-> (ListImageBuildVersionsResponse
    -> Maybe Text -> ListImageBuildVersionsResponse)
-> Lens
     ListImageBuildVersionsResponse
     ListImageBuildVersionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersionsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListImageBuildVersionsResponse' :: ListImageBuildVersionsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListImageBuildVersionsResponse
s@ListImageBuildVersionsResponse' {} Maybe Text
a -> ListImageBuildVersionsResponse
s {$sel:requestId:ListImageBuildVersionsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListImageBuildVersionsResponse)

-- | The next token used for paginated responses. When this is not empty,
-- there are additional elements that the service has not included in this
-- request. Use this token with the next request to retrieve additional
-- objects.
listImageBuildVersionsResponse_nextToken :: Lens.Lens' ListImageBuildVersionsResponse (Prelude.Maybe Prelude.Text)
listImageBuildVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListImageBuildVersionsResponse
-> f ListImageBuildVersionsResponse
listImageBuildVersionsResponse_nextToken = (ListImageBuildVersionsResponse -> Maybe Text)
-> (ListImageBuildVersionsResponse
    -> Maybe Text -> ListImageBuildVersionsResponse)
-> Lens
     ListImageBuildVersionsResponse
     ListImageBuildVersionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListImageBuildVersionsResponse' :: ListImageBuildVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListImageBuildVersionsResponse
s@ListImageBuildVersionsResponse' {} Maybe Text
a -> ListImageBuildVersionsResponse
s {$sel:nextToken:ListImageBuildVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListImageBuildVersionsResponse)

-- | The list of image build versions.
listImageBuildVersionsResponse_imageSummaryList :: Lens.Lens' ListImageBuildVersionsResponse (Prelude.Maybe [ImageSummary])
listImageBuildVersionsResponse_imageSummaryList :: (Maybe [ImageSummary] -> f (Maybe [ImageSummary]))
-> ListImageBuildVersionsResponse
-> f ListImageBuildVersionsResponse
listImageBuildVersionsResponse_imageSummaryList = (ListImageBuildVersionsResponse -> Maybe [ImageSummary])
-> (ListImageBuildVersionsResponse
    -> Maybe [ImageSummary] -> ListImageBuildVersionsResponse)
-> Lens
     ListImageBuildVersionsResponse
     ListImageBuildVersionsResponse
     (Maybe [ImageSummary])
     (Maybe [ImageSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListImageBuildVersionsResponse' {Maybe [ImageSummary]
imageSummaryList :: Maybe [ImageSummary]
$sel:imageSummaryList:ListImageBuildVersionsResponse' :: ListImageBuildVersionsResponse -> Maybe [ImageSummary]
imageSummaryList} -> Maybe [ImageSummary]
imageSummaryList) (\s :: ListImageBuildVersionsResponse
s@ListImageBuildVersionsResponse' {} Maybe [ImageSummary]
a -> ListImageBuildVersionsResponse
s {$sel:imageSummaryList:ListImageBuildVersionsResponse' :: Maybe [ImageSummary]
imageSummaryList = Maybe [ImageSummary]
a} :: ListImageBuildVersionsResponse) ((Maybe [ImageSummary] -> f (Maybe [ImageSummary]))
 -> ListImageBuildVersionsResponse
 -> f ListImageBuildVersionsResponse)
-> ((Maybe [ImageSummary] -> f (Maybe [ImageSummary]))
    -> Maybe [ImageSummary] -> f (Maybe [ImageSummary]))
-> (Maybe [ImageSummary] -> f (Maybe [ImageSummary]))
-> ListImageBuildVersionsResponse
-> f ListImageBuildVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ImageSummary] [ImageSummary] [ImageSummary] [ImageSummary]
-> Iso
     (Maybe [ImageSummary])
     (Maybe [ImageSummary])
     (Maybe [ImageSummary])
     (Maybe [ImageSummary])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [ImageSummary] [ImageSummary] [ImageSummary] [ImageSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListImageBuildVersionsResponse