{-# 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.GreengrassV2.ListComponentVersions
-- 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)
--
-- Retrieves a paginated list of all versions for a component. Greater
-- versions are listed first.
--
-- This operation returns paginated results.
module Amazonka.GreengrassV2.ListComponentVersions
  ( -- * Creating a Request
    ListComponentVersions (..),
    newListComponentVersions,

    -- * Request Lenses
    listComponentVersions_nextToken,
    listComponentVersions_maxResults,
    listComponentVersions_arn,

    -- * Destructuring the Response
    ListComponentVersionsResponse (..),
    newListComponentVersionsResponse,

    -- * Response Lenses
    listComponentVersionsResponse_nextToken,
    listComponentVersionsResponse_componentVersions,
    listComponentVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.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:/ 'newListComponentVersions' smart constructor.
data ListComponentVersions = ListComponentVersions'
  { -- | The token to be used for the next set of paginated results.
    ListComponentVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per paginated request.
    ListComponentVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the component version.
    ListComponentVersions -> Text
arn :: Prelude.Text
  }
  deriving (ListComponentVersions -> ListComponentVersions -> Bool
(ListComponentVersions -> ListComponentVersions -> Bool)
-> (ListComponentVersions -> ListComponentVersions -> Bool)
-> Eq ListComponentVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListComponentVersions -> ListComponentVersions -> Bool
$c/= :: ListComponentVersions -> ListComponentVersions -> Bool
== :: ListComponentVersions -> ListComponentVersions -> Bool
$c== :: ListComponentVersions -> ListComponentVersions -> Bool
Prelude.Eq, ReadPrec [ListComponentVersions]
ReadPrec ListComponentVersions
Int -> ReadS ListComponentVersions
ReadS [ListComponentVersions]
(Int -> ReadS ListComponentVersions)
-> ReadS [ListComponentVersions]
-> ReadPrec ListComponentVersions
-> ReadPrec [ListComponentVersions]
-> Read ListComponentVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListComponentVersions]
$creadListPrec :: ReadPrec [ListComponentVersions]
readPrec :: ReadPrec ListComponentVersions
$creadPrec :: ReadPrec ListComponentVersions
readList :: ReadS [ListComponentVersions]
$creadList :: ReadS [ListComponentVersions]
readsPrec :: Int -> ReadS ListComponentVersions
$creadsPrec :: Int -> ReadS ListComponentVersions
Prelude.Read, Int -> ListComponentVersions -> ShowS
[ListComponentVersions] -> ShowS
ListComponentVersions -> String
(Int -> ListComponentVersions -> ShowS)
-> (ListComponentVersions -> String)
-> ([ListComponentVersions] -> ShowS)
-> Show ListComponentVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListComponentVersions] -> ShowS
$cshowList :: [ListComponentVersions] -> ShowS
show :: ListComponentVersions -> String
$cshow :: ListComponentVersions -> String
showsPrec :: Int -> ListComponentVersions -> ShowS
$cshowsPrec :: Int -> ListComponentVersions -> ShowS
Prelude.Show, (forall x. ListComponentVersions -> Rep ListComponentVersions x)
-> (forall x. Rep ListComponentVersions x -> ListComponentVersions)
-> Generic ListComponentVersions
forall x. Rep ListComponentVersions x -> ListComponentVersions
forall x. ListComponentVersions -> Rep ListComponentVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListComponentVersions x -> ListComponentVersions
$cfrom :: forall x. ListComponentVersions -> Rep ListComponentVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListComponentVersions' 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:
--
-- 'nextToken', 'listComponentVersions_nextToken' - The token to be used for the next set of paginated results.
--
-- 'maxResults', 'listComponentVersions_maxResults' - The maximum number of results to be returned per paginated request.
--
-- 'arn', 'listComponentVersions_arn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
newListComponentVersions ::
  -- | 'arn'
  Prelude.Text ->
  ListComponentVersions
newListComponentVersions :: Text -> ListComponentVersions
newListComponentVersions Text
pArn_ =
  ListComponentVersions' :: Maybe Text -> Maybe Natural -> Text -> ListComponentVersions
ListComponentVersions'
    { $sel:nextToken:ListComponentVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListComponentVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:ListComponentVersions' :: Text
arn = Text
pArn_
    }

-- | The token to be used for the next set of paginated results.
listComponentVersions_nextToken :: Lens.Lens' ListComponentVersions (Prelude.Maybe Prelude.Text)
listComponentVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComponentVersions -> f ListComponentVersions
listComponentVersions_nextToken = (ListComponentVersions -> Maybe Text)
-> (ListComponentVersions -> Maybe Text -> ListComponentVersions)
-> Lens
     ListComponentVersions
     ListComponentVersions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComponentVersions' :: ListComponentVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComponentVersions
s@ListComponentVersions' {} Maybe Text
a -> ListComponentVersions
s {$sel:nextToken:ListComponentVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListComponentVersions)

-- | The maximum number of results to be returned per paginated request.
listComponentVersions_maxResults :: Lens.Lens' ListComponentVersions (Prelude.Maybe Prelude.Natural)
listComponentVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListComponentVersions -> f ListComponentVersions
listComponentVersions_maxResults = (ListComponentVersions -> Maybe Natural)
-> (ListComponentVersions
    -> Maybe Natural -> ListComponentVersions)
-> Lens
     ListComponentVersions
     ListComponentVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListComponentVersions' :: ListComponentVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListComponentVersions
s@ListComponentVersions' {} Maybe Natural
a -> ListComponentVersions
s {$sel:maxResults:ListComponentVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListComponentVersions)

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
listComponentVersions_arn :: Lens.Lens' ListComponentVersions Prelude.Text
listComponentVersions_arn :: (Text -> f Text)
-> ListComponentVersions -> f ListComponentVersions
listComponentVersions_arn = (ListComponentVersions -> Text)
-> (ListComponentVersions -> Text -> ListComponentVersions)
-> Lens ListComponentVersions ListComponentVersions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentVersions' {Text
arn :: Text
$sel:arn:ListComponentVersions' :: ListComponentVersions -> Text
arn} -> Text
arn) (\s :: ListComponentVersions
s@ListComponentVersions' {} Text
a -> ListComponentVersions
s {$sel:arn:ListComponentVersions' :: Text
arn = Text
a} :: ListComponentVersions)

instance Core.AWSPager ListComponentVersions where
  page :: ListComponentVersions
-> AWSResponse ListComponentVersions -> Maybe ListComponentVersions
page ListComponentVersions
rq AWSResponse ListComponentVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListComponentVersions
ListComponentVersionsResponse
rs
            ListComponentVersionsResponse
-> Getting (First Text) ListComponentVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListComponentVersionsResponse
-> Const (First Text) ListComponentVersionsResponse
Lens' ListComponentVersionsResponse (Maybe Text)
listComponentVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListComponentVersionsResponse
 -> Const (First Text) ListComponentVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListComponentVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListComponentVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [ComponentVersionListItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListComponentVersions
ListComponentVersionsResponse
rs
            ListComponentVersionsResponse
-> Getting
     (First [ComponentVersionListItem])
     ListComponentVersionsResponse
     [ComponentVersionListItem]
-> Maybe [ComponentVersionListItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ComponentVersionListItem]
 -> Const
      (First [ComponentVersionListItem])
      (Maybe [ComponentVersionListItem]))
-> ListComponentVersionsResponse
-> Const
     (First [ComponentVersionListItem]) ListComponentVersionsResponse
Lens'
  ListComponentVersionsResponse (Maybe [ComponentVersionListItem])
listComponentVersionsResponse_componentVersions
              ((Maybe [ComponentVersionListItem]
  -> Const
       (First [ComponentVersionListItem])
       (Maybe [ComponentVersionListItem]))
 -> ListComponentVersionsResponse
 -> Const
      (First [ComponentVersionListItem]) ListComponentVersionsResponse)
-> (([ComponentVersionListItem]
     -> Const
          (First [ComponentVersionListItem]) [ComponentVersionListItem])
    -> Maybe [ComponentVersionListItem]
    -> Const
         (First [ComponentVersionListItem])
         (Maybe [ComponentVersionListItem]))
-> Getting
     (First [ComponentVersionListItem])
     ListComponentVersionsResponse
     [ComponentVersionListItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ComponentVersionListItem]
 -> Const
      (First [ComponentVersionListItem]) [ComponentVersionListItem])
-> Maybe [ComponentVersionListItem]
-> Const
     (First [ComponentVersionListItem])
     (Maybe [ComponentVersionListItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListComponentVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListComponentVersions -> Maybe ListComponentVersions
forall a. a -> Maybe a
Prelude.Just (ListComponentVersions -> Maybe ListComponentVersions)
-> ListComponentVersions -> Maybe ListComponentVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListComponentVersions
rq
          ListComponentVersions
-> (ListComponentVersions -> ListComponentVersions)
-> ListComponentVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListComponentVersions -> Identity ListComponentVersions
Lens
  ListComponentVersions
  ListComponentVersions
  (Maybe Text)
  (Maybe Text)
listComponentVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListComponentVersions -> Identity ListComponentVersions)
-> Maybe Text -> ListComponentVersions -> ListComponentVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListComponentVersions
ListComponentVersionsResponse
rs
          ListComponentVersionsResponse
-> Getting (First Text) ListComponentVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListComponentVersionsResponse
-> Const (First Text) ListComponentVersionsResponse
Lens' ListComponentVersionsResponse (Maybe Text)
listComponentVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListComponentVersionsResponse
 -> Const (First Text) ListComponentVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListComponentVersionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListComponentVersions where
  type
    AWSResponse ListComponentVersions =
      ListComponentVersionsResponse
  request :: ListComponentVersions -> Request ListComponentVersions
request = Service -> ListComponentVersions -> Request ListComponentVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListComponentVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListComponentVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListComponentVersions))
-> Logger
-> Service
-> Proxy ListComponentVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListComponentVersions)))
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 [ComponentVersionListItem]
-> Int
-> ListComponentVersionsResponse
ListComponentVersionsResponse'
            (Maybe Text
 -> Maybe [ComponentVersionListItem]
 -> Int
 -> ListComponentVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ComponentVersionListItem]
      -> Int -> ListComponentVersionsResponse)
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
"nextToken")
            Either
  String
  (Maybe [ComponentVersionListItem]
   -> Int -> ListComponentVersionsResponse)
-> Either String (Maybe [ComponentVersionListItem])
-> Either String (Int -> ListComponentVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ComponentVersionListItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"componentVersions"
                            Either String (Maybe (Maybe [ComponentVersionListItem]))
-> Maybe [ComponentVersionListItem]
-> Either String (Maybe [ComponentVersionListItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ComponentVersionListItem]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListComponentVersionsResponse)
-> Either String Int -> Either String ListComponentVersionsResponse
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 ListComponentVersions

instance Prelude.NFData ListComponentVersions

instance Core.ToHeaders ListComponentVersions where
  toHeaders :: ListComponentVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListComponentVersions -> 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.ToPath ListComponentVersions where
  toPath :: ListComponentVersions -> ByteString
toPath ListComponentVersions' {Maybe Natural
Maybe Text
Text
arn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:arn:ListComponentVersions' :: ListComponentVersions -> Text
$sel:maxResults:ListComponentVersions' :: ListComponentVersions -> Maybe Natural
$sel:nextToken:ListComponentVersions' :: ListComponentVersions -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/components/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
arn,
        ByteString
"/versions"
      ]

instance Core.ToQuery ListComponentVersions where
  toQuery :: ListComponentVersions -> QueryString
toQuery ListComponentVersions' {Maybe Natural
Maybe Text
Text
arn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:arn:ListComponentVersions' :: ListComponentVersions -> Text
$sel:maxResults:ListComponentVersions' :: ListComponentVersions -> Maybe Natural
$sel:nextToken:ListComponentVersions' :: ListComponentVersions -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListComponentVersionsResponse' smart constructor.
data ListComponentVersionsResponse = ListComponentVersionsResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    ListComponentVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of versions that exist for the component.
    ListComponentVersionsResponse -> Maybe [ComponentVersionListItem]
componentVersions :: Prelude.Maybe [ComponentVersionListItem],
    -- | The response's http status code.
    ListComponentVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListComponentVersionsResponse
-> ListComponentVersionsResponse -> Bool
(ListComponentVersionsResponse
 -> ListComponentVersionsResponse -> Bool)
-> (ListComponentVersionsResponse
    -> ListComponentVersionsResponse -> Bool)
-> Eq ListComponentVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListComponentVersionsResponse
-> ListComponentVersionsResponse -> Bool
$c/= :: ListComponentVersionsResponse
-> ListComponentVersionsResponse -> Bool
== :: ListComponentVersionsResponse
-> ListComponentVersionsResponse -> Bool
$c== :: ListComponentVersionsResponse
-> ListComponentVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListComponentVersionsResponse]
ReadPrec ListComponentVersionsResponse
Int -> ReadS ListComponentVersionsResponse
ReadS [ListComponentVersionsResponse]
(Int -> ReadS ListComponentVersionsResponse)
-> ReadS [ListComponentVersionsResponse]
-> ReadPrec ListComponentVersionsResponse
-> ReadPrec [ListComponentVersionsResponse]
-> Read ListComponentVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListComponentVersionsResponse]
$creadListPrec :: ReadPrec [ListComponentVersionsResponse]
readPrec :: ReadPrec ListComponentVersionsResponse
$creadPrec :: ReadPrec ListComponentVersionsResponse
readList :: ReadS [ListComponentVersionsResponse]
$creadList :: ReadS [ListComponentVersionsResponse]
readsPrec :: Int -> ReadS ListComponentVersionsResponse
$creadsPrec :: Int -> ReadS ListComponentVersionsResponse
Prelude.Read, Int -> ListComponentVersionsResponse -> ShowS
[ListComponentVersionsResponse] -> ShowS
ListComponentVersionsResponse -> String
(Int -> ListComponentVersionsResponse -> ShowS)
-> (ListComponentVersionsResponse -> String)
-> ([ListComponentVersionsResponse] -> ShowS)
-> Show ListComponentVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListComponentVersionsResponse] -> ShowS
$cshowList :: [ListComponentVersionsResponse] -> ShowS
show :: ListComponentVersionsResponse -> String
$cshow :: ListComponentVersionsResponse -> String
showsPrec :: Int -> ListComponentVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListComponentVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListComponentVersionsResponse
 -> Rep ListComponentVersionsResponse x)
-> (forall x.
    Rep ListComponentVersionsResponse x
    -> ListComponentVersionsResponse)
-> Generic ListComponentVersionsResponse
forall x.
Rep ListComponentVersionsResponse x
-> ListComponentVersionsResponse
forall x.
ListComponentVersionsResponse
-> Rep ListComponentVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListComponentVersionsResponse x
-> ListComponentVersionsResponse
$cfrom :: forall x.
ListComponentVersionsResponse
-> Rep ListComponentVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListComponentVersionsResponse' 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:
--
-- 'nextToken', 'listComponentVersionsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'componentVersions', 'listComponentVersionsResponse_componentVersions' - A list of versions that exist for the component.
--
-- 'httpStatus', 'listComponentVersionsResponse_httpStatus' - The response's http status code.
newListComponentVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListComponentVersionsResponse
newListComponentVersionsResponse :: Int -> ListComponentVersionsResponse
newListComponentVersionsResponse Int
pHttpStatus_ =
  ListComponentVersionsResponse' :: Maybe Text
-> Maybe [ComponentVersionListItem]
-> Int
-> ListComponentVersionsResponse
ListComponentVersionsResponse'
    { $sel:nextToken:ListComponentVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:componentVersions:ListComponentVersionsResponse' :: Maybe [ComponentVersionListItem]
componentVersions = Maybe [ComponentVersionListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListComponentVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of results, or null if there are no
-- additional results.
listComponentVersionsResponse_nextToken :: Lens.Lens' ListComponentVersionsResponse (Prelude.Maybe Prelude.Text)
listComponentVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListComponentVersionsResponse -> f ListComponentVersionsResponse
listComponentVersionsResponse_nextToken = (ListComponentVersionsResponse -> Maybe Text)
-> (ListComponentVersionsResponse
    -> Maybe Text -> ListComponentVersionsResponse)
-> Lens' ListComponentVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListComponentVersionsResponse' :: ListComponentVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListComponentVersionsResponse
s@ListComponentVersionsResponse' {} Maybe Text
a -> ListComponentVersionsResponse
s {$sel:nextToken:ListComponentVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListComponentVersionsResponse)

-- | A list of versions that exist for the component.
listComponentVersionsResponse_componentVersions :: Lens.Lens' ListComponentVersionsResponse (Prelude.Maybe [ComponentVersionListItem])
listComponentVersionsResponse_componentVersions :: (Maybe [ComponentVersionListItem]
 -> f (Maybe [ComponentVersionListItem]))
-> ListComponentVersionsResponse -> f ListComponentVersionsResponse
listComponentVersionsResponse_componentVersions = (ListComponentVersionsResponse -> Maybe [ComponentVersionListItem])
-> (ListComponentVersionsResponse
    -> Maybe [ComponentVersionListItem]
    -> ListComponentVersionsResponse)
-> Lens'
     ListComponentVersionsResponse (Maybe [ComponentVersionListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListComponentVersionsResponse' {Maybe [ComponentVersionListItem]
componentVersions :: Maybe [ComponentVersionListItem]
$sel:componentVersions:ListComponentVersionsResponse' :: ListComponentVersionsResponse -> Maybe [ComponentVersionListItem]
componentVersions} -> Maybe [ComponentVersionListItem]
componentVersions) (\s :: ListComponentVersionsResponse
s@ListComponentVersionsResponse' {} Maybe [ComponentVersionListItem]
a -> ListComponentVersionsResponse
s {$sel:componentVersions:ListComponentVersionsResponse' :: Maybe [ComponentVersionListItem]
componentVersions = Maybe [ComponentVersionListItem]
a} :: ListComponentVersionsResponse) ((Maybe [ComponentVersionListItem]
  -> f (Maybe [ComponentVersionListItem]))
 -> ListComponentVersionsResponse
 -> f ListComponentVersionsResponse)
-> ((Maybe [ComponentVersionListItem]
     -> f (Maybe [ComponentVersionListItem]))
    -> Maybe [ComponentVersionListItem]
    -> f (Maybe [ComponentVersionListItem]))
-> (Maybe [ComponentVersionListItem]
    -> f (Maybe [ComponentVersionListItem]))
-> ListComponentVersionsResponse
-> f ListComponentVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ComponentVersionListItem]
  [ComponentVersionListItem]
  [ComponentVersionListItem]
  [ComponentVersionListItem]
-> Iso
     (Maybe [ComponentVersionListItem])
     (Maybe [ComponentVersionListItem])
     (Maybe [ComponentVersionListItem])
     (Maybe [ComponentVersionListItem])
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
  [ComponentVersionListItem]
  [ComponentVersionListItem]
  [ComponentVersionListItem]
  [ComponentVersionListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListComponentVersionsResponse