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

    -- * Request Lenses
    listCoreDefinitionVersions_nextToken,
    listCoreDefinitionVersions_maxResults,
    listCoreDefinitionVersions_coreDefinitionId,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Greengrass.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:/ 'newListCoreDefinitionVersions' smart constructor.
data ListCoreDefinitionVersions = ListCoreDefinitionVersions'
  { -- | 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 maximum number of results to be returned per request.
    ListCoreDefinitionVersions -> Maybe Text
maxResults :: Prelude.Maybe Prelude.Text,
    -- | The ID of the core definition.
    ListCoreDefinitionVersions -> Text
coreDefinitionId :: Prelude.Text
  }
  deriving (ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool
(ListCoreDefinitionVersions -> ListCoreDefinitionVersions -> Bool)
-> (ListCoreDefinitionVersions
    -> ListCoreDefinitionVersions -> Bool)
-> Eq ListCoreDefinitionVersions
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]
(Int -> ReadS ListCoreDefinitionVersions)
-> ReadS [ListCoreDefinitionVersions]
-> ReadPrec ListCoreDefinitionVersions
-> ReadPrec [ListCoreDefinitionVersions]
-> Read 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
(Int -> ListCoreDefinitionVersions -> ShowS)
-> (ListCoreDefinitionVersions -> String)
-> ([ListCoreDefinitionVersions] -> ShowS)
-> Show ListCoreDefinitionVersions
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.
 ListCoreDefinitionVersions -> Rep ListCoreDefinitionVersions x)
-> (forall x.
    Rep ListCoreDefinitionVersions x -> ListCoreDefinitionVersions)
-> Generic ListCoreDefinitionVersions
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:
--
-- 'nextToken', 'listCoreDefinitionVersions_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'maxResults', 'listCoreDefinitionVersions_maxResults' - The maximum number of results to be returned per request.
--
-- 'coreDefinitionId', 'listCoreDefinitionVersions_coreDefinitionId' - The ID of the core definition.
newListCoreDefinitionVersions ::
  -- | 'coreDefinitionId'
  Prelude.Text ->
  ListCoreDefinitionVersions
newListCoreDefinitionVersions :: Text -> ListCoreDefinitionVersions
newListCoreDefinitionVersions Text
pCoreDefinitionId_ =
  ListCoreDefinitionVersions' :: Maybe Text -> Maybe Text -> Text -> ListCoreDefinitionVersions
ListCoreDefinitionVersions'
    { $sel:nextToken:ListCoreDefinitionVersions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCoreDefinitionVersions' :: Maybe Text
maxResults = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:coreDefinitionId:ListCoreDefinitionVersions' :: Text
coreDefinitionId = Text
pCoreDefinitionId_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListCoreDefinitionVersions -> f ListCoreDefinitionVersions
listCoreDefinitionVersions_nextToken = (ListCoreDefinitionVersions -> Maybe Text)
-> (ListCoreDefinitionVersions
    -> Maybe Text -> ListCoreDefinitionVersions)
-> Lens
     ListCoreDefinitionVersions
     ListCoreDefinitionVersions
     (Maybe Text)
     (Maybe Text)
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 maximum number of results to be returned per request.
listCoreDefinitionVersions_maxResults :: Lens.Lens' ListCoreDefinitionVersions (Prelude.Maybe Prelude.Text)
listCoreDefinitionVersions_maxResults :: (Maybe Text -> f (Maybe Text))
-> ListCoreDefinitionVersions -> f ListCoreDefinitionVersions
listCoreDefinitionVersions_maxResults = (ListCoreDefinitionVersions -> Maybe Text)
-> (ListCoreDefinitionVersions
    -> Maybe Text -> ListCoreDefinitionVersions)
-> Lens
     ListCoreDefinitionVersions
     ListCoreDefinitionVersions
     (Maybe Text)
     (Maybe Text)
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 ID of the core definition.
listCoreDefinitionVersions_coreDefinitionId :: Lens.Lens' ListCoreDefinitionVersions Prelude.Text
listCoreDefinitionVersions_coreDefinitionId :: (Text -> f Text)
-> ListCoreDefinitionVersions -> f ListCoreDefinitionVersions
listCoreDefinitionVersions_coreDefinitionId = (ListCoreDefinitionVersions -> Text)
-> (ListCoreDefinitionVersions
    -> Text -> ListCoreDefinitionVersions)
-> Lens
     ListCoreDefinitionVersions ListCoreDefinitionVersions Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCoreDefinitionVersions
ListCoreDefinitionVersionsResponse
rs
            ListCoreDefinitionVersionsResponse
-> Getting (First Text) ListCoreDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCoreDefinitionVersionsResponse
-> Const (First Text) ListCoreDefinitionVersionsResponse
Lens' ListCoreDefinitionVersionsResponse (Maybe Text)
listCoreDefinitionVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCoreDefinitionVersionsResponse
 -> Const (First Text) ListCoreDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCoreDefinitionVersionsResponse 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 ListCoreDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [VersionInformation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCoreDefinitionVersions
ListCoreDefinitionVersionsResponse
rs
            ListCoreDefinitionVersionsResponse
-> Getting
     (First [VersionInformation])
     ListCoreDefinitionVersionsResponse
     [VersionInformation]
-> Maybe [VersionInformation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [VersionInformation]
 -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> ListCoreDefinitionVersionsResponse
-> Const
     (First [VersionInformation]) ListCoreDefinitionVersionsResponse
Lens'
  ListCoreDefinitionVersionsResponse (Maybe [VersionInformation])
listCoreDefinitionVersionsResponse_versions
              ((Maybe [VersionInformation]
  -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
 -> ListCoreDefinitionVersionsResponse
 -> Const
      (First [VersionInformation]) ListCoreDefinitionVersionsResponse)
-> (([VersionInformation]
     -> Const (First [VersionInformation]) [VersionInformation])
    -> Maybe [VersionInformation]
    -> Const (First [VersionInformation]) (Maybe [VersionInformation]))
-> Getting
     (First [VersionInformation])
     ListCoreDefinitionVersionsResponse
     [VersionInformation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([VersionInformation]
 -> Const (First [VersionInformation]) [VersionInformation])
-> Maybe [VersionInformation]
-> Const (First [VersionInformation]) (Maybe [VersionInformation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListCoreDefinitionVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCoreDefinitionVersions -> Maybe ListCoreDefinitionVersions
forall a. a -> Maybe a
Prelude.Just (ListCoreDefinitionVersions -> Maybe ListCoreDefinitionVersions)
-> ListCoreDefinitionVersions -> Maybe ListCoreDefinitionVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCoreDefinitionVersions
rq
          ListCoreDefinitionVersions
-> (ListCoreDefinitionVersions -> ListCoreDefinitionVersions)
-> ListCoreDefinitionVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCoreDefinitionVersions
-> Identity ListCoreDefinitionVersions
Lens
  ListCoreDefinitionVersions
  ListCoreDefinitionVersions
  (Maybe Text)
  (Maybe Text)
listCoreDefinitionVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCoreDefinitionVersions
 -> Identity ListCoreDefinitionVersions)
-> Maybe Text
-> ListCoreDefinitionVersions
-> ListCoreDefinitionVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCoreDefinitionVersions
ListCoreDefinitionVersionsResponse
rs
          ListCoreDefinitionVersionsResponse
-> Getting (First Text) ListCoreDefinitionVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCoreDefinitionVersionsResponse
-> Const (First Text) ListCoreDefinitionVersionsResponse
Lens' ListCoreDefinitionVersionsResponse (Maybe Text)
listCoreDefinitionVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCoreDefinitionVersionsResponse
 -> Const (First Text) ListCoreDefinitionVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCoreDefinitionVersionsResponse 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 ListCoreDefinitionVersions where
  type
    AWSResponse ListCoreDefinitionVersions =
      ListCoreDefinitionVersionsResponse
  request :: ListCoreDefinitionVersions -> Request ListCoreDefinitionVersions
request = Service
-> ListCoreDefinitionVersions -> Request ListCoreDefinitionVersions
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCoreDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCoreDefinitionVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCoreDefinitionVersions))
-> Logger
-> Service
-> Proxy ListCoreDefinitionVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCoreDefinitionVersions)))
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 [VersionInformation]
-> Maybe Text -> Int -> ListCoreDefinitionVersionsResponse
ListCoreDefinitionVersionsResponse'
            (Maybe [VersionInformation]
 -> Maybe Text -> Int -> ListCoreDefinitionVersionsResponse)
-> Either String (Maybe [VersionInformation])
-> Either
     String (Maybe Text -> Int -> ListCoreDefinitionVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [VersionInformation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Versions" Either String (Maybe (Maybe [VersionInformation]))
-> Maybe [VersionInformation]
-> Either String (Maybe [VersionInformation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VersionInformation]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListCoreDefinitionVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListCoreDefinitionVersionsResponse)
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 (Int -> ListCoreDefinitionVersionsResponse)
-> Either String Int
-> Either String ListCoreDefinitionVersionsResponse
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 ListCoreDefinitionVersions

instance Prelude.NFData ListCoreDefinitionVersions

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

instance Core.ToQuery ListCoreDefinitionVersions where
  toQuery :: ListCoreDefinitionVersions -> QueryString
toQuery ListCoreDefinitionVersions' {Maybe Text
Text
coreDefinitionId :: Text
maxResults :: Maybe Text
nextToken :: Maybe Text
$sel:coreDefinitionId:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Text
$sel:maxResults:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> Maybe Text
$sel:nextToken:ListCoreDefinitionVersions' :: ListCoreDefinitionVersions -> 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 Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxResults
      ]

-- | /See:/ 'newListCoreDefinitionVersionsResponse' smart constructor.
data ListCoreDefinitionVersionsResponse = ListCoreDefinitionVersionsResponse'
  { -- | Information about a version.
    ListCoreDefinitionVersionsResponse -> Maybe [VersionInformation]
versions :: Prelude.Maybe [VersionInformation],
    -- | The token for the next set of results, or \'\'null\'\' if there are no
    -- additional results.
    ListCoreDefinitionVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCoreDefinitionVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCoreDefinitionVersionsResponse
-> ListCoreDefinitionVersionsResponse -> Bool
(ListCoreDefinitionVersionsResponse
 -> ListCoreDefinitionVersionsResponse -> Bool)
-> (ListCoreDefinitionVersionsResponse
    -> ListCoreDefinitionVersionsResponse -> Bool)
-> Eq ListCoreDefinitionVersionsResponse
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]
(Int -> ReadS ListCoreDefinitionVersionsResponse)
-> ReadS [ListCoreDefinitionVersionsResponse]
-> ReadPrec ListCoreDefinitionVersionsResponse
-> ReadPrec [ListCoreDefinitionVersionsResponse]
-> Read 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
(Int -> ListCoreDefinitionVersionsResponse -> ShowS)
-> (ListCoreDefinitionVersionsResponse -> String)
-> ([ListCoreDefinitionVersionsResponse] -> ShowS)
-> Show ListCoreDefinitionVersionsResponse
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.
 ListCoreDefinitionVersionsResponse
 -> Rep ListCoreDefinitionVersionsResponse x)
-> (forall x.
    Rep ListCoreDefinitionVersionsResponse x
    -> ListCoreDefinitionVersionsResponse)
-> Generic ListCoreDefinitionVersionsResponse
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:
--
-- 'versions', 'listCoreDefinitionVersionsResponse_versions' - Information about a version.
--
-- 'nextToken', 'listCoreDefinitionVersionsResponse_nextToken' - The token for the next set of results, or \'\'null\'\' if there are no
-- additional results.
--
-- 'httpStatus', 'listCoreDefinitionVersionsResponse_httpStatus' - The response's http status code.
newListCoreDefinitionVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCoreDefinitionVersionsResponse
newListCoreDefinitionVersionsResponse :: Int -> ListCoreDefinitionVersionsResponse
newListCoreDefinitionVersionsResponse Int
pHttpStatus_ =
  ListCoreDefinitionVersionsResponse' :: Maybe [VersionInformation]
-> Maybe Text -> Int -> ListCoreDefinitionVersionsResponse
ListCoreDefinitionVersionsResponse'
    { $sel:versions:ListCoreDefinitionVersionsResponse' :: Maybe [VersionInformation]
versions =
        Maybe [VersionInformation]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCoreDefinitionVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCoreDefinitionVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about a version.
listCoreDefinitionVersionsResponse_versions :: Lens.Lens' ListCoreDefinitionVersionsResponse (Prelude.Maybe [VersionInformation])
listCoreDefinitionVersionsResponse_versions :: (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListCoreDefinitionVersionsResponse
-> f ListCoreDefinitionVersionsResponse
listCoreDefinitionVersionsResponse_versions = (ListCoreDefinitionVersionsResponse -> Maybe [VersionInformation])
-> (ListCoreDefinitionVersionsResponse
    -> Maybe [VersionInformation]
    -> ListCoreDefinitionVersionsResponse)
-> Lens'
     ListCoreDefinitionVersionsResponse (Maybe [VersionInformation])
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) ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
 -> ListCoreDefinitionVersionsResponse
 -> f ListCoreDefinitionVersionsResponse)
-> ((Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
    -> Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> (Maybe [VersionInformation] -> f (Maybe [VersionInformation]))
-> ListCoreDefinitionVersionsResponse
-> f ListCoreDefinitionVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
-> Iso
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
     (Maybe [VersionInformation])
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
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
  [VersionInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListCoreDefinitionVersionsResponse
-> f ListCoreDefinitionVersionsResponse
listCoreDefinitionVersionsResponse_nextToken = (ListCoreDefinitionVersionsResponse -> Maybe Text)
-> (ListCoreDefinitionVersionsResponse
    -> Maybe Text -> ListCoreDefinitionVersionsResponse)
-> Lens' ListCoreDefinitionVersionsResponse (Maybe Text)
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)

-- | The response's http status code.
listCoreDefinitionVersionsResponse_httpStatus :: Lens.Lens' ListCoreDefinitionVersionsResponse Prelude.Int
listCoreDefinitionVersionsResponse_httpStatus :: (Int -> f Int)
-> ListCoreDefinitionVersionsResponse
-> f ListCoreDefinitionVersionsResponse
listCoreDefinitionVersionsResponse_httpStatus = (ListCoreDefinitionVersionsResponse -> Int)
-> (ListCoreDefinitionVersionsResponse
    -> Int -> ListCoreDefinitionVersionsResponse)
-> Lens
     ListCoreDefinitionVersionsResponse
     ListCoreDefinitionVersionsResponse
     Int
     Int
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