{-# 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.Glue.ListSchemaVersions
-- 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 schema versions that you have created, with minimal
-- information. Schema versions in Deleted status will not be included in
-- the results. Empty results will be returned if there are no schema
-- versions available.
--
-- This operation returns paginated results.
module Amazonka.Glue.ListSchemaVersions
  ( -- * Creating a Request
    ListSchemaVersions (..),
    newListSchemaVersions,

    -- * Request Lenses
    listSchemaVersions_nextToken,
    listSchemaVersions_maxResults,
    listSchemaVersions_schemaId,

    -- * Destructuring the Response
    ListSchemaVersionsResponse (..),
    newListSchemaVersionsResponse,

    -- * Response Lenses
    listSchemaVersionsResponse_schemas,
    listSchemaVersionsResponse_nextToken,
    listSchemaVersionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.Glue.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:/ 'newListSchemaVersions' smart constructor.
data ListSchemaVersions = ListSchemaVersions'
  { -- | A continuation token, if this is a continuation call.
    ListSchemaVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of results required per page. If the value is not
    -- supplied, this will be defaulted to 25 per page.
    ListSchemaVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | This is a wrapper structure to contain schema identity fields. The
    -- structure contains:
    --
    -- -   SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema.
    --     Either @SchemaArn@ or @SchemaName@ and @RegistryName@ has to be
    --     provided.
    --
    -- -   SchemaId$SchemaName: The name of the schema. Either @SchemaArn@ or
    --     @SchemaName@ and @RegistryName@ has to be provided.
    ListSchemaVersions -> SchemaId
schemaId :: SchemaId
  }
  deriving (ListSchemaVersions -> ListSchemaVersions -> Bool
(ListSchemaVersions -> ListSchemaVersions -> Bool)
-> (ListSchemaVersions -> ListSchemaVersions -> Bool)
-> Eq ListSchemaVersions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSchemaVersions -> ListSchemaVersions -> Bool
$c/= :: ListSchemaVersions -> ListSchemaVersions -> Bool
== :: ListSchemaVersions -> ListSchemaVersions -> Bool
$c== :: ListSchemaVersions -> ListSchemaVersions -> Bool
Prelude.Eq, ReadPrec [ListSchemaVersions]
ReadPrec ListSchemaVersions
Int -> ReadS ListSchemaVersions
ReadS [ListSchemaVersions]
(Int -> ReadS ListSchemaVersions)
-> ReadS [ListSchemaVersions]
-> ReadPrec ListSchemaVersions
-> ReadPrec [ListSchemaVersions]
-> Read ListSchemaVersions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSchemaVersions]
$creadListPrec :: ReadPrec [ListSchemaVersions]
readPrec :: ReadPrec ListSchemaVersions
$creadPrec :: ReadPrec ListSchemaVersions
readList :: ReadS [ListSchemaVersions]
$creadList :: ReadS [ListSchemaVersions]
readsPrec :: Int -> ReadS ListSchemaVersions
$creadsPrec :: Int -> ReadS ListSchemaVersions
Prelude.Read, Int -> ListSchemaVersions -> ShowS
[ListSchemaVersions] -> ShowS
ListSchemaVersions -> String
(Int -> ListSchemaVersions -> ShowS)
-> (ListSchemaVersions -> String)
-> ([ListSchemaVersions] -> ShowS)
-> Show ListSchemaVersions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSchemaVersions] -> ShowS
$cshowList :: [ListSchemaVersions] -> ShowS
show :: ListSchemaVersions -> String
$cshow :: ListSchemaVersions -> String
showsPrec :: Int -> ListSchemaVersions -> ShowS
$cshowsPrec :: Int -> ListSchemaVersions -> ShowS
Prelude.Show, (forall x. ListSchemaVersions -> Rep ListSchemaVersions x)
-> (forall x. Rep ListSchemaVersions x -> ListSchemaVersions)
-> Generic ListSchemaVersions
forall x. Rep ListSchemaVersions x -> ListSchemaVersions
forall x. ListSchemaVersions -> Rep ListSchemaVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSchemaVersions x -> ListSchemaVersions
$cfrom :: forall x. ListSchemaVersions -> Rep ListSchemaVersions x
Prelude.Generic)

-- |
-- Create a value of 'ListSchemaVersions' 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', 'listSchemaVersions_nextToken' - A continuation token, if this is a continuation call.
--
-- 'maxResults', 'listSchemaVersions_maxResults' - Maximum number of results required per page. If the value is not
-- supplied, this will be defaulted to 25 per page.
--
-- 'schemaId', 'listSchemaVersions_schemaId' - This is a wrapper structure to contain schema identity fields. The
-- structure contains:
--
-- -   SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema.
--     Either @SchemaArn@ or @SchemaName@ and @RegistryName@ has to be
--     provided.
--
-- -   SchemaId$SchemaName: The name of the schema. Either @SchemaArn@ or
--     @SchemaName@ and @RegistryName@ has to be provided.
newListSchemaVersions ::
  -- | 'schemaId'
  SchemaId ->
  ListSchemaVersions
newListSchemaVersions :: SchemaId -> ListSchemaVersions
newListSchemaVersions SchemaId
pSchemaId_ =
  ListSchemaVersions' :: Maybe Text -> Maybe Natural -> SchemaId -> ListSchemaVersions
ListSchemaVersions'
    { $sel:nextToken:ListSchemaVersions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSchemaVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaId:ListSchemaVersions' :: SchemaId
schemaId = SchemaId
pSchemaId_
    }

-- | A continuation token, if this is a continuation call.
listSchemaVersions_nextToken :: Lens.Lens' ListSchemaVersions (Prelude.Maybe Prelude.Text)
listSchemaVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSchemaVersions -> f ListSchemaVersions
listSchemaVersions_nextToken = (ListSchemaVersions -> Maybe Text)
-> (ListSchemaVersions -> Maybe Text -> ListSchemaVersions)
-> Lens
     ListSchemaVersions ListSchemaVersions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSchemaVersions' :: ListSchemaVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSchemaVersions
s@ListSchemaVersions' {} Maybe Text
a -> ListSchemaVersions
s {$sel:nextToken:ListSchemaVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListSchemaVersions)

-- | Maximum number of results required per page. If the value is not
-- supplied, this will be defaulted to 25 per page.
listSchemaVersions_maxResults :: Lens.Lens' ListSchemaVersions (Prelude.Maybe Prelude.Natural)
listSchemaVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListSchemaVersions -> f ListSchemaVersions
listSchemaVersions_maxResults = (ListSchemaVersions -> Maybe Natural)
-> (ListSchemaVersions -> Maybe Natural -> ListSchemaVersions)
-> Lens
     ListSchemaVersions
     ListSchemaVersions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSchemaVersions' :: ListSchemaVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSchemaVersions
s@ListSchemaVersions' {} Maybe Natural
a -> ListSchemaVersions
s {$sel:maxResults:ListSchemaVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSchemaVersions)

-- | This is a wrapper structure to contain schema identity fields. The
-- structure contains:
--
-- -   SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema.
--     Either @SchemaArn@ or @SchemaName@ and @RegistryName@ has to be
--     provided.
--
-- -   SchemaId$SchemaName: The name of the schema. Either @SchemaArn@ or
--     @SchemaName@ and @RegistryName@ has to be provided.
listSchemaVersions_schemaId :: Lens.Lens' ListSchemaVersions SchemaId
listSchemaVersions_schemaId :: (SchemaId -> f SchemaId)
-> ListSchemaVersions -> f ListSchemaVersions
listSchemaVersions_schemaId = (ListSchemaVersions -> SchemaId)
-> (ListSchemaVersions -> SchemaId -> ListSchemaVersions)
-> Lens ListSchemaVersions ListSchemaVersions SchemaId SchemaId
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaVersions' {SchemaId
schemaId :: SchemaId
$sel:schemaId:ListSchemaVersions' :: ListSchemaVersions -> SchemaId
schemaId} -> SchemaId
schemaId) (\s :: ListSchemaVersions
s@ListSchemaVersions' {} SchemaId
a -> ListSchemaVersions
s {$sel:schemaId:ListSchemaVersions' :: SchemaId
schemaId = SchemaId
a} :: ListSchemaVersions)

instance Core.AWSPager ListSchemaVersions where
  page :: ListSchemaVersions
-> AWSResponse ListSchemaVersions -> Maybe ListSchemaVersions
page ListSchemaVersions
rq AWSResponse ListSchemaVersions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSchemaVersions
ListSchemaVersionsResponse
rs
            ListSchemaVersionsResponse
-> Getting (First Text) ListSchemaVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSchemaVersionsResponse
-> Const (First Text) ListSchemaVersionsResponse
Lens' ListSchemaVersionsResponse (Maybe Text)
listSchemaVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSchemaVersionsResponse
 -> Const (First Text) ListSchemaVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSchemaVersionsResponse 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 ListSchemaVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [SchemaVersionListItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListSchemaVersions
ListSchemaVersionsResponse
rs
            ListSchemaVersionsResponse
-> Getting
     (First [SchemaVersionListItem])
     ListSchemaVersionsResponse
     [SchemaVersionListItem]
-> Maybe [SchemaVersionListItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [SchemaVersionListItem]
 -> Const
      (First [SchemaVersionListItem]) (Maybe [SchemaVersionListItem]))
-> ListSchemaVersionsResponse
-> Const (First [SchemaVersionListItem]) ListSchemaVersionsResponse
Lens' ListSchemaVersionsResponse (Maybe [SchemaVersionListItem])
listSchemaVersionsResponse_schemas
              ((Maybe [SchemaVersionListItem]
  -> Const
       (First [SchemaVersionListItem]) (Maybe [SchemaVersionListItem]))
 -> ListSchemaVersionsResponse
 -> Const
      (First [SchemaVersionListItem]) ListSchemaVersionsResponse)
-> (([SchemaVersionListItem]
     -> Const (First [SchemaVersionListItem]) [SchemaVersionListItem])
    -> Maybe [SchemaVersionListItem]
    -> Const
         (First [SchemaVersionListItem]) (Maybe [SchemaVersionListItem]))
-> Getting
     (First [SchemaVersionListItem])
     ListSchemaVersionsResponse
     [SchemaVersionListItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SchemaVersionListItem]
 -> Const (First [SchemaVersionListItem]) [SchemaVersionListItem])
-> Maybe [SchemaVersionListItem]
-> Const
     (First [SchemaVersionListItem]) (Maybe [SchemaVersionListItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListSchemaVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListSchemaVersions -> Maybe ListSchemaVersions
forall a. a -> Maybe a
Prelude.Just (ListSchemaVersions -> Maybe ListSchemaVersions)
-> ListSchemaVersions -> Maybe ListSchemaVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListSchemaVersions
rq
          ListSchemaVersions
-> (ListSchemaVersions -> ListSchemaVersions) -> ListSchemaVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListSchemaVersions -> Identity ListSchemaVersions
Lens
  ListSchemaVersions ListSchemaVersions (Maybe Text) (Maybe Text)
listSchemaVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListSchemaVersions -> Identity ListSchemaVersions)
-> Maybe Text -> ListSchemaVersions -> ListSchemaVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSchemaVersions
ListSchemaVersionsResponse
rs
          ListSchemaVersionsResponse
-> Getting (First Text) ListSchemaVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListSchemaVersionsResponse
-> Const (First Text) ListSchemaVersionsResponse
Lens' ListSchemaVersionsResponse (Maybe Text)
listSchemaVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListSchemaVersionsResponse
 -> Const (First Text) ListSchemaVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListSchemaVersionsResponse 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 ListSchemaVersions where
  type
    AWSResponse ListSchemaVersions =
      ListSchemaVersionsResponse
  request :: ListSchemaVersions -> Request ListSchemaVersions
request = Service -> ListSchemaVersions -> Request ListSchemaVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListSchemaVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSchemaVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListSchemaVersions))
-> Logger
-> Service
-> Proxy ListSchemaVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListSchemaVersions)))
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 [SchemaVersionListItem]
-> Maybe Text -> Int -> ListSchemaVersionsResponse
ListSchemaVersionsResponse'
            (Maybe [SchemaVersionListItem]
 -> Maybe Text -> Int -> ListSchemaVersionsResponse)
-> Either String (Maybe [SchemaVersionListItem])
-> Either String (Maybe Text -> Int -> ListSchemaVersionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [SchemaVersionListItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Schemas" Either String (Maybe (Maybe [SchemaVersionListItem]))
-> Maybe [SchemaVersionListItem]
-> Either String (Maybe [SchemaVersionListItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SchemaVersionListItem]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> ListSchemaVersionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListSchemaVersionsResponse)
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 -> ListSchemaVersionsResponse)
-> Either String Int -> Either String ListSchemaVersionsResponse
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 ListSchemaVersions

instance Prelude.NFData ListSchemaVersions

instance Core.ToHeaders ListSchemaVersions where
  toHeaders :: ListSchemaVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListSchemaVersions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"AWSGlue.ListSchemaVersions" :: Prelude.ByteString),
            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 ListSchemaVersions where
  toJSON :: ListSchemaVersions -> Value
toJSON ListSchemaVersions' {Maybe Natural
Maybe Text
SchemaId
schemaId :: SchemaId
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:schemaId:ListSchemaVersions' :: ListSchemaVersions -> SchemaId
$sel:maxResults:ListSchemaVersions' :: ListSchemaVersions -> Maybe Natural
$sel:nextToken:ListSchemaVersions' :: ListSchemaVersions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"SchemaId" Text -> SchemaId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaId
schemaId)
          ]
      )

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

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

-- | /See:/ 'newListSchemaVersionsResponse' smart constructor.
data ListSchemaVersionsResponse = ListSchemaVersionsResponse'
  { -- | An array of @SchemaVersionList@ objects containing details of each
    -- schema version.
    ListSchemaVersionsResponse -> Maybe [SchemaVersionListItem]
schemas :: Prelude.Maybe [SchemaVersionListItem],
    -- | A continuation token for paginating the returned list of tokens,
    -- returned if the current segment of the list is not the last.
    ListSchemaVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListSchemaVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool
(ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool)
-> (ListSchemaVersionsResponse
    -> ListSchemaVersionsResponse -> Bool)
-> Eq ListSchemaVersionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool
$c/= :: ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool
== :: ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool
$c== :: ListSchemaVersionsResponse -> ListSchemaVersionsResponse -> Bool
Prelude.Eq, ReadPrec [ListSchemaVersionsResponse]
ReadPrec ListSchemaVersionsResponse
Int -> ReadS ListSchemaVersionsResponse
ReadS [ListSchemaVersionsResponse]
(Int -> ReadS ListSchemaVersionsResponse)
-> ReadS [ListSchemaVersionsResponse]
-> ReadPrec ListSchemaVersionsResponse
-> ReadPrec [ListSchemaVersionsResponse]
-> Read ListSchemaVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSchemaVersionsResponse]
$creadListPrec :: ReadPrec [ListSchemaVersionsResponse]
readPrec :: ReadPrec ListSchemaVersionsResponse
$creadPrec :: ReadPrec ListSchemaVersionsResponse
readList :: ReadS [ListSchemaVersionsResponse]
$creadList :: ReadS [ListSchemaVersionsResponse]
readsPrec :: Int -> ReadS ListSchemaVersionsResponse
$creadsPrec :: Int -> ReadS ListSchemaVersionsResponse
Prelude.Read, Int -> ListSchemaVersionsResponse -> ShowS
[ListSchemaVersionsResponse] -> ShowS
ListSchemaVersionsResponse -> String
(Int -> ListSchemaVersionsResponse -> ShowS)
-> (ListSchemaVersionsResponse -> String)
-> ([ListSchemaVersionsResponse] -> ShowS)
-> Show ListSchemaVersionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSchemaVersionsResponse] -> ShowS
$cshowList :: [ListSchemaVersionsResponse] -> ShowS
show :: ListSchemaVersionsResponse -> String
$cshow :: ListSchemaVersionsResponse -> String
showsPrec :: Int -> ListSchemaVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListSchemaVersionsResponse -> ShowS
Prelude.Show, (forall x.
 ListSchemaVersionsResponse -> Rep ListSchemaVersionsResponse x)
-> (forall x.
    Rep ListSchemaVersionsResponse x -> ListSchemaVersionsResponse)
-> Generic ListSchemaVersionsResponse
forall x.
Rep ListSchemaVersionsResponse x -> ListSchemaVersionsResponse
forall x.
ListSchemaVersionsResponse -> Rep ListSchemaVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSchemaVersionsResponse x -> ListSchemaVersionsResponse
$cfrom :: forall x.
ListSchemaVersionsResponse -> Rep ListSchemaVersionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSchemaVersionsResponse' 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:
--
-- 'schemas', 'listSchemaVersionsResponse_schemas' - An array of @SchemaVersionList@ objects containing details of each
-- schema version.
--
-- 'nextToken', 'listSchemaVersionsResponse_nextToken' - A continuation token for paginating the returned list of tokens,
-- returned if the current segment of the list is not the last.
--
-- 'httpStatus', 'listSchemaVersionsResponse_httpStatus' - The response's http status code.
newListSchemaVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSchemaVersionsResponse
newListSchemaVersionsResponse :: Int -> ListSchemaVersionsResponse
newListSchemaVersionsResponse Int
pHttpStatus_ =
  ListSchemaVersionsResponse' :: Maybe [SchemaVersionListItem]
-> Maybe Text -> Int -> ListSchemaVersionsResponse
ListSchemaVersionsResponse'
    { $sel:schemas:ListSchemaVersionsResponse' :: Maybe [SchemaVersionListItem]
schemas =
        Maybe [SchemaVersionListItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSchemaVersionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSchemaVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @SchemaVersionList@ objects containing details of each
-- schema version.
listSchemaVersionsResponse_schemas :: Lens.Lens' ListSchemaVersionsResponse (Prelude.Maybe [SchemaVersionListItem])
listSchemaVersionsResponse_schemas :: (Maybe [SchemaVersionListItem]
 -> f (Maybe [SchemaVersionListItem]))
-> ListSchemaVersionsResponse -> f ListSchemaVersionsResponse
listSchemaVersionsResponse_schemas = (ListSchemaVersionsResponse -> Maybe [SchemaVersionListItem])
-> (ListSchemaVersionsResponse
    -> Maybe [SchemaVersionListItem] -> ListSchemaVersionsResponse)
-> Lens' ListSchemaVersionsResponse (Maybe [SchemaVersionListItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaVersionsResponse' {Maybe [SchemaVersionListItem]
schemas :: Maybe [SchemaVersionListItem]
$sel:schemas:ListSchemaVersionsResponse' :: ListSchemaVersionsResponse -> Maybe [SchemaVersionListItem]
schemas} -> Maybe [SchemaVersionListItem]
schemas) (\s :: ListSchemaVersionsResponse
s@ListSchemaVersionsResponse' {} Maybe [SchemaVersionListItem]
a -> ListSchemaVersionsResponse
s {$sel:schemas:ListSchemaVersionsResponse' :: Maybe [SchemaVersionListItem]
schemas = Maybe [SchemaVersionListItem]
a} :: ListSchemaVersionsResponse) ((Maybe [SchemaVersionListItem]
  -> f (Maybe [SchemaVersionListItem]))
 -> ListSchemaVersionsResponse -> f ListSchemaVersionsResponse)
-> ((Maybe [SchemaVersionListItem]
     -> f (Maybe [SchemaVersionListItem]))
    -> Maybe [SchemaVersionListItem]
    -> f (Maybe [SchemaVersionListItem]))
-> (Maybe [SchemaVersionListItem]
    -> f (Maybe [SchemaVersionListItem]))
-> ListSchemaVersionsResponse
-> f ListSchemaVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SchemaVersionListItem]
  [SchemaVersionListItem]
  [SchemaVersionListItem]
  [SchemaVersionListItem]
-> Iso
     (Maybe [SchemaVersionListItem])
     (Maybe [SchemaVersionListItem])
     (Maybe [SchemaVersionListItem])
     (Maybe [SchemaVersionListItem])
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
  [SchemaVersionListItem]
  [SchemaVersionListItem]
  [SchemaVersionListItem]
  [SchemaVersionListItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A continuation token for paginating the returned list of tokens,
-- returned if the current segment of the list is not the last.
listSchemaVersionsResponse_nextToken :: Lens.Lens' ListSchemaVersionsResponse (Prelude.Maybe Prelude.Text)
listSchemaVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListSchemaVersionsResponse -> f ListSchemaVersionsResponse
listSchemaVersionsResponse_nextToken = (ListSchemaVersionsResponse -> Maybe Text)
-> (ListSchemaVersionsResponse
    -> Maybe Text -> ListSchemaVersionsResponse)
-> Lens' ListSchemaVersionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSchemaVersionsResponse' :: ListSchemaVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSchemaVersionsResponse
s@ListSchemaVersionsResponse' {} Maybe Text
a -> ListSchemaVersionsResponse
s {$sel:nextToken:ListSchemaVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSchemaVersionsResponse)

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

instance Prelude.NFData ListSchemaVersionsResponse