{-# 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.Greengrass.ListCoreDefinitionVersions
-- 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 the versions of a core definition.
--
-- This operation returns paginated results.
module Amazonka.Greengrass.ListCoreDefinitionVersions
  ( -- * Creating a Request
    ListCoreDefinitionVersions (..),
    newListCoreDefinitionVersions,

    -- * Request Lenses
    listCoreDefinitionVersions_maxResults,
    listCoreDefinitionVersions_nextToken,
    listCoreDefinitionVersions_coreDefinitionId,

    -- * Destructuring the Response
    ListCoreDefinitionVersionsResponse (..),
    newListCoreDefinitionVersionsResponse,

    -- * Response Lenses
    listCoreDefinitionVersionsResponse_nextToken,
    listCoreDefinitionVersionsResponse_versions,
    listCoreDefinitionVersionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListCoreDefinitionVersions' smart constructor.
data ListCoreDefinitionVersions = ListCoreDefinitionVersions'
  { -- | The maximum number of results to be returned per request.
    ListCoreDefinitionVersions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListCoreDefinitionVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the core definition.
    ListCoreDefinitionVersions -> Text
coreDefinitionId :: Prelude.Text
  }
  deriving (ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
$c/= :: ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
== :: ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
$c== :: ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
Prelude.Eq, ReadPrec [ListCoreDefinitionVersions]
ReadPrec ListCoreDefinitionVersions
Int -> ReadS ListCoreDefinitionVersions
ReadS [ListCoreDefinitionVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCoreDefinitionVersions]
$creadListPrec :: ReadPrec [ListCoreDefinitionVersions]
readPrec :: ReadPrec ListCoreDefinitionVersions
$creadPrec :: ReadPrec ListCoreDefinitionVersions
readList :: ReadS [ListCoreDefinitionVersions]
$creadList :: ReadS [ListCoreDefinitionVersions]
readsPrec :: Int -> ReadS ListCoreDefinitionVersions
$creadsPrec :: Int -> ReadS ListCoreDefinitionVersions
Prelude.Read, Int -> ListCoreDefinitionVersions -> ShowS
[ListCoreDefinitionVersions] -> ShowS
ListCoreDefinitionVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCoreDefinitionVersions] -> ShowS
$cshowList :: [ListCoreDefinitionVersions] -> ShowS
show :: ListCoreDefinitionVersions -> String
$cshow :: ListCoreDefinitionVersions -> String
showsPrec :: Int -> ListCoreDefinitionVersions -> ShowS
$cshowsPrec :: Int -> ListCoreDefinitionVersions -> ShowS
Prelude.Show, forall x.
Rep ListCoreDefinitionVersions x -> ListCoreDefinitionVersions
forall x.
ListCoreDefinitionVersions -> Rep ListCoreDefinitionVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCoreDefinitionVersions x -> ListCoreDefinitionVersions
$cfrom :: forall x.
ListCoreDefinitionVersions -> Rep ListCoreDefinitionVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListCoreDefinitionVersions' 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:
--
-- 'maxResults', 'listCoreDefinitionVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'nextToken', 'listCoreDefinitionVersions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'coreDefinitionId', 'listCoreDefinitionVersions_coreDefinitionId' - The ID of the core definition.
newListCoreDefinitionVersions ::
  -- | 'coreDefinitionId'
  Prelude.Text ->
  ListCoreDefinitionVersions
newListCoreDefinitionVersions :: Text -> ListCoreDefinitionVersions
newListCoreDefinitionVersions Text
pCoreDefinitionId_ =
  ListCoreDefinitionVersions'
    { $sel:maxResults:ListCoreDefinitionVersions' :: Maybe Text
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCoreDefinitionVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:coreDefinitionId:ListCoreDefinitionVersions' :: Text
coreDefinitionId = Text
pCoreDefinitionId_
    }

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

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

-- | The ID of the core definition.
listCoreDefinitionVersions_coreDefinitionId :: Lens.Lens' ListCoreDefinitionVersions Prelude.Text
listCoreDefinitionVersions_coreDefinitionId :: Lens' ListCoreDefinitionVersions Text
listCoreDefinitionVersions_coreDefinitionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCoreDefinitionVersions' {Text
coreDefinitionId :: Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
coreDefinitionId} -> Text
coreDefinitionId) (\s :: ListCoreDefinitionVersions
s@ListCoreDefinitionVersions' {} Text
a -> ListCoreDefinitionVersions
s {$sel:coreDefinitionId:ListCoreDefinitionVersions' :: Text
coreDefinitionId = Text
a} :: ListCoreDefinitionVersions)

instance Core.AWSPager ListCoreDefinitionVersions where
  page :: ListCoreDefinitionVersions
-> AWSResponse ListCoreDefinitionVersions
-> Maybe ListCoreDefinitionVersions
page ListCoreDefinitionVersions
rq AWSResponse ListCoreDefinitionVersions
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCoreDefinitionVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCoreDefinitionVersionsResponse (Maybe Text)
listCoreDefinitionVersionsResponse_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 ListCoreDefinitionVersions
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListCoreDefinitionVersionsResponse (Maybe [VersionInformation])
listCoreDefinitionVersionsResponse_versions
            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.$ ListCoreDefinitionVersions
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCoreDefinitionVersions (Maybe Text)
listCoreDefinitionVersions_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCoreDefinitionVersions
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCoreDefinitionVersionsResponse (Maybe Text)
listCoreDefinitionVersionsResponse_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 ListCoreDefinitionVersions where
  type
    AWSResponse ListCoreDefinitionVersions =
      ListCoreDefinitionVersionsResponse
  request :: (Service -> Service)
-> ListCoreDefinitionVersions -> Request ListCoreDefinitionVersions
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCoreDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCoreDefinitionVersions)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [VersionInformation]
-> Int
-> ListCoreDefinitionVersionsResponse
ListCoreDefinitionVersionsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Versions" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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 ListCoreDefinitionVersions where
  hashWithSalt :: Int -> ListCoreDefinitionVersions -> Int
hashWithSalt Int
_salt ListCoreDefinitionVersions' {Maybe Text
Text
coreDefinitionId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
$sel:nextToken:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
$sel:maxResults:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
coreDefinitionId

instance Prelude.NFData ListCoreDefinitionVersions where
  rnf :: ListCoreDefinitionVersions -> ()
rnf ListCoreDefinitionVersions' {Maybe Text
Text
coreDefinitionId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
$sel:nextToken:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
$sel:maxResults:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
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 Text
coreDefinitionId

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

instance Data.ToPath ListCoreDefinitionVersions where
  toPath :: ListCoreDefinitionVersions -> ByteString
toPath ListCoreDefinitionVersions' {Maybe Text
Text
coreDefinitionId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
$sel:nextToken:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
$sel:maxResults:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/definition/cores/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
coreDefinitionId,
        ByteString
"/versions"
      ]

instance Data.ToQuery ListCoreDefinitionVersions where
  toQuery :: ListCoreDefinitionVersions -> QueryString
toQuery ListCoreDefinitionVersions' {Maybe Text
Text
coreDefinitionId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
$sel:nextToken:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
$sel:maxResults:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxResults,
        ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

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

-- |
-- Create a value of 'ListCoreDefinitionVersionsResponse' 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', 'listCoreDefinitionVersionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'versions', 'listCoreDefinitionVersionsResponse_versions' - Information about a version.
--
-- 'httpStatus', 'listCoreDefinitionVersionsResponse_httpStatus' - The response's http status code.
newListCoreDefinitionVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCoreDefinitionVersionsResponse
newListCoreDefinitionVersionsResponse :: Int -> ListCoreDefinitionVersionsResponse
newListCoreDefinitionVersionsResponse Int
pHttpStatus_ =
  ListCoreDefinitionVersionsResponse'
    { $sel:nextToken:ListCoreDefinitionVersionsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:versions:ListCoreDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCoreDefinitionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | Information about a version.
listCoreDefinitionVersionsResponse_versions :: Lens.Lens' ListCoreDefinitionVersionsResponse (Prelude.Maybe [VersionInformation])
listCoreDefinitionVersionsResponse_versions :: Lens'
  ListCoreDefinitionVersionsResponse (Maybe [VersionInformation])
listCoreDefinitionVersionsResponse_versions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCoreDefinitionVersionsResponse' {Maybe [VersionInformation]
versions :: Maybe [VersionInformation]
$sel:versions:ListCoreDefinitionVersionsResponse' :: ListCoreDefinitionVersionsResponse -> Maybe [VersionInformation]
versions} -> Maybe [VersionInformation]
versions) (\s :: ListCoreDefinitionVersionsResponse
s@ListCoreDefinitionVersionsResponse' {} Maybe [VersionInformation]
a -> ListCoreDefinitionVersionsResponse
s {$sel:versions:ListCoreDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions = Maybe [VersionInformation]
a} :: ListCoreDefinitionVersionsResponse) 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 response's http status code.
listCoreDefinitionVersionsResponse_httpStatus :: Lens.Lens' ListCoreDefinitionVersionsResponse Prelude.Int
listCoreDefinitionVersionsResponse_httpStatus :: Lens' ListCoreDefinitionVersionsResponse Int
listCoreDefinitionVersionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCoreDefinitionVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCoreDefinitionVersionsResponse' :: ListCoreDefinitionVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCoreDefinitionVersionsResponse
s@ListCoreDefinitionVersionsResponse' {} Int
a -> ListCoreDefinitionVersionsResponse
s {$sel:httpStatus:ListCoreDefinitionVersionsResponse' :: Int
httpStatus = Int
a} :: ListCoreDefinitionVersionsResponse)

instance
  Prelude.NFData
    ListCoreDefinitionVersionsResponse
  where
  rnf :: ListCoreDefinitionVersionsResponse -> ()
rnf ListCoreDefinitionVersionsResponse' {Int
Maybe [VersionInformation]
Maybe Text
httpStatus :: Int
versions :: Maybe [VersionInformation]
nextToken :: Maybe Text
$sel:httpStatus:ListCoreDefinitionVersionsResponse' :: ListCoreDefinitionVersionsResponse -> Int
$sel:versions:ListCoreDefinitionVersionsResponse' :: ListCoreDefinitionVersionsResponse -> Maybe [VersionInformation]
$sel:nextToken:ListCoreDefinitionVersionsResponse' :: ListCoreDefinitionVersionsResponse -> Maybe Text
..} =
    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 [VersionInformation]
versions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus