{-# 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.QuerySchemaVersionMetadata
-- 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)
--
-- Queries for the schema version metadata information.
module Amazonka.Glue.QuerySchemaVersionMetadata
  ( -- * Creating a Request
    QuerySchemaVersionMetadata (..),
    newQuerySchemaVersionMetadata,

    -- * Request Lenses
    querySchemaVersionMetadata_schemaVersionId,
    querySchemaVersionMetadata_schemaId,
    querySchemaVersionMetadata_nextToken,
    querySchemaVersionMetadata_metadataList,
    querySchemaVersionMetadata_schemaVersionNumber,
    querySchemaVersionMetadata_maxResults,

    -- * Destructuring the Response
    QuerySchemaVersionMetadataResponse (..),
    newQuerySchemaVersionMetadataResponse,

    -- * Response Lenses
    querySchemaVersionMetadataResponse_schemaVersionId,
    querySchemaVersionMetadataResponse_nextToken,
    querySchemaVersionMetadataResponse_metadataInfoMap,
    querySchemaVersionMetadataResponse_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:/ 'newQuerySchemaVersionMetadata' smart constructor.
data QuerySchemaVersionMetadata = QuerySchemaVersionMetadata'
  { -- | The unique version ID of the schema version.
    QuerySchemaVersionMetadata -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | A wrapper structure that may contain the schema name and Amazon Resource
    -- Name (ARN).
    QuerySchemaVersionMetadata -> Maybe SchemaId
schemaId :: Prelude.Maybe SchemaId,
    -- | A continuation token, if this is a continuation call.
    QuerySchemaVersionMetadata -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Search key-value pairs for metadata, if they are not provided all the
    -- metadata information will be fetched.
    QuerySchemaVersionMetadata -> Maybe [MetadataKeyValuePair]
metadataList :: Prelude.Maybe [MetadataKeyValuePair],
    -- | The version number of the schema.
    QuerySchemaVersionMetadata -> Maybe SchemaVersionNumber
schemaVersionNumber :: Prelude.Maybe SchemaVersionNumber,
    -- | Maximum number of results required per page. If the value is not
    -- supplied, this will be defaulted to 25 per page.
    QuerySchemaVersionMetadata -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool
(QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool)
-> (QuerySchemaVersionMetadata
    -> QuerySchemaVersionMetadata -> Bool)
-> Eq QuerySchemaVersionMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool
$c/= :: QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool
== :: QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool
$c== :: QuerySchemaVersionMetadata -> QuerySchemaVersionMetadata -> Bool
Prelude.Eq, ReadPrec [QuerySchemaVersionMetadata]
ReadPrec QuerySchemaVersionMetadata
Int -> ReadS QuerySchemaVersionMetadata
ReadS [QuerySchemaVersionMetadata]
(Int -> ReadS QuerySchemaVersionMetadata)
-> ReadS [QuerySchemaVersionMetadata]
-> ReadPrec QuerySchemaVersionMetadata
-> ReadPrec [QuerySchemaVersionMetadata]
-> Read QuerySchemaVersionMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuerySchemaVersionMetadata]
$creadListPrec :: ReadPrec [QuerySchemaVersionMetadata]
readPrec :: ReadPrec QuerySchemaVersionMetadata
$creadPrec :: ReadPrec QuerySchemaVersionMetadata
readList :: ReadS [QuerySchemaVersionMetadata]
$creadList :: ReadS [QuerySchemaVersionMetadata]
readsPrec :: Int -> ReadS QuerySchemaVersionMetadata
$creadsPrec :: Int -> ReadS QuerySchemaVersionMetadata
Prelude.Read, Int -> QuerySchemaVersionMetadata -> ShowS
[QuerySchemaVersionMetadata] -> ShowS
QuerySchemaVersionMetadata -> String
(Int -> QuerySchemaVersionMetadata -> ShowS)
-> (QuerySchemaVersionMetadata -> String)
-> ([QuerySchemaVersionMetadata] -> ShowS)
-> Show QuerySchemaVersionMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuerySchemaVersionMetadata] -> ShowS
$cshowList :: [QuerySchemaVersionMetadata] -> ShowS
show :: QuerySchemaVersionMetadata -> String
$cshow :: QuerySchemaVersionMetadata -> String
showsPrec :: Int -> QuerySchemaVersionMetadata -> ShowS
$cshowsPrec :: Int -> QuerySchemaVersionMetadata -> ShowS
Prelude.Show, (forall x.
 QuerySchemaVersionMetadata -> Rep QuerySchemaVersionMetadata x)
-> (forall x.
    Rep QuerySchemaVersionMetadata x -> QuerySchemaVersionMetadata)
-> Generic QuerySchemaVersionMetadata
forall x.
Rep QuerySchemaVersionMetadata x -> QuerySchemaVersionMetadata
forall x.
QuerySchemaVersionMetadata -> Rep QuerySchemaVersionMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep QuerySchemaVersionMetadata x -> QuerySchemaVersionMetadata
$cfrom :: forall x.
QuerySchemaVersionMetadata -> Rep QuerySchemaVersionMetadata x
Prelude.Generic)

-- |
-- Create a value of 'QuerySchemaVersionMetadata' 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:
--
-- 'schemaVersionId', 'querySchemaVersionMetadata_schemaVersionId' - The unique version ID of the schema version.
--
-- 'schemaId', 'querySchemaVersionMetadata_schemaId' - A wrapper structure that may contain the schema name and Amazon Resource
-- Name (ARN).
--
-- 'nextToken', 'querySchemaVersionMetadata_nextToken' - A continuation token, if this is a continuation call.
--
-- 'metadataList', 'querySchemaVersionMetadata_metadataList' - Search key-value pairs for metadata, if they are not provided all the
-- metadata information will be fetched.
--
-- 'schemaVersionNumber', 'querySchemaVersionMetadata_schemaVersionNumber' - The version number of the schema.
--
-- 'maxResults', 'querySchemaVersionMetadata_maxResults' - Maximum number of results required per page. If the value is not
-- supplied, this will be defaulted to 25 per page.
newQuerySchemaVersionMetadata ::
  QuerySchemaVersionMetadata
newQuerySchemaVersionMetadata :: QuerySchemaVersionMetadata
newQuerySchemaVersionMetadata =
  QuerySchemaVersionMetadata' :: Maybe Text
-> Maybe SchemaId
-> Maybe Text
-> Maybe [MetadataKeyValuePair]
-> Maybe SchemaVersionNumber
-> Maybe Natural
-> QuerySchemaVersionMetadata
QuerySchemaVersionMetadata'
    { $sel:schemaVersionId:QuerySchemaVersionMetadata' :: Maybe Text
schemaVersionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaId:QuerySchemaVersionMetadata' :: Maybe SchemaId
schemaId = Maybe SchemaId
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:QuerySchemaVersionMetadata' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metadataList:QuerySchemaVersionMetadata' :: Maybe [MetadataKeyValuePair]
metadataList = Maybe [MetadataKeyValuePair]
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersionNumber:QuerySchemaVersionMetadata' :: Maybe SchemaVersionNumber
schemaVersionNumber = Maybe SchemaVersionNumber
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:QuerySchemaVersionMetadata' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique version ID of the schema version.
querySchemaVersionMetadata_schemaVersionId :: Lens.Lens' QuerySchemaVersionMetadata (Prelude.Maybe Prelude.Text)
querySchemaVersionMetadata_schemaVersionId :: (Maybe Text -> f (Maybe Text))
-> QuerySchemaVersionMetadata -> f QuerySchemaVersionMetadata
querySchemaVersionMetadata_schemaVersionId = (QuerySchemaVersionMetadata -> Maybe Text)
-> (QuerySchemaVersionMetadata
    -> Maybe Text -> QuerySchemaVersionMetadata)
-> Lens
     QuerySchemaVersionMetadata
     QuerySchemaVersionMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadata' {Maybe Text
schemaVersionId :: Maybe Text
$sel:schemaVersionId:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe Text
schemaVersionId} -> Maybe Text
schemaVersionId) (\s :: QuerySchemaVersionMetadata
s@QuerySchemaVersionMetadata' {} Maybe Text
a -> QuerySchemaVersionMetadata
s {$sel:schemaVersionId:QuerySchemaVersionMetadata' :: Maybe Text
schemaVersionId = Maybe Text
a} :: QuerySchemaVersionMetadata)

-- | A wrapper structure that may contain the schema name and Amazon Resource
-- Name (ARN).
querySchemaVersionMetadata_schemaId :: Lens.Lens' QuerySchemaVersionMetadata (Prelude.Maybe SchemaId)
querySchemaVersionMetadata_schemaId :: (Maybe SchemaId -> f (Maybe SchemaId))
-> QuerySchemaVersionMetadata -> f QuerySchemaVersionMetadata
querySchemaVersionMetadata_schemaId = (QuerySchemaVersionMetadata -> Maybe SchemaId)
-> (QuerySchemaVersionMetadata
    -> Maybe SchemaId -> QuerySchemaVersionMetadata)
-> Lens
     QuerySchemaVersionMetadata
     QuerySchemaVersionMetadata
     (Maybe SchemaId)
     (Maybe SchemaId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadata' {Maybe SchemaId
schemaId :: Maybe SchemaId
$sel:schemaId:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe SchemaId
schemaId} -> Maybe SchemaId
schemaId) (\s :: QuerySchemaVersionMetadata
s@QuerySchemaVersionMetadata' {} Maybe SchemaId
a -> QuerySchemaVersionMetadata
s {$sel:schemaId:QuerySchemaVersionMetadata' :: Maybe SchemaId
schemaId = Maybe SchemaId
a} :: QuerySchemaVersionMetadata)

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

-- | Search key-value pairs for metadata, if they are not provided all the
-- metadata information will be fetched.
querySchemaVersionMetadata_metadataList :: Lens.Lens' QuerySchemaVersionMetadata (Prelude.Maybe [MetadataKeyValuePair])
querySchemaVersionMetadata_metadataList :: (Maybe [MetadataKeyValuePair] -> f (Maybe [MetadataKeyValuePair]))
-> QuerySchemaVersionMetadata -> f QuerySchemaVersionMetadata
querySchemaVersionMetadata_metadataList = (QuerySchemaVersionMetadata -> Maybe [MetadataKeyValuePair])
-> (QuerySchemaVersionMetadata
    -> Maybe [MetadataKeyValuePair] -> QuerySchemaVersionMetadata)
-> Lens
     QuerySchemaVersionMetadata
     QuerySchemaVersionMetadata
     (Maybe [MetadataKeyValuePair])
     (Maybe [MetadataKeyValuePair])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadata' {Maybe [MetadataKeyValuePair]
metadataList :: Maybe [MetadataKeyValuePair]
$sel:metadataList:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe [MetadataKeyValuePair]
metadataList} -> Maybe [MetadataKeyValuePair]
metadataList) (\s :: QuerySchemaVersionMetadata
s@QuerySchemaVersionMetadata' {} Maybe [MetadataKeyValuePair]
a -> QuerySchemaVersionMetadata
s {$sel:metadataList:QuerySchemaVersionMetadata' :: Maybe [MetadataKeyValuePair]
metadataList = Maybe [MetadataKeyValuePair]
a} :: QuerySchemaVersionMetadata) ((Maybe [MetadataKeyValuePair] -> f (Maybe [MetadataKeyValuePair]))
 -> QuerySchemaVersionMetadata -> f QuerySchemaVersionMetadata)
-> ((Maybe [MetadataKeyValuePair]
     -> f (Maybe [MetadataKeyValuePair]))
    -> Maybe [MetadataKeyValuePair]
    -> f (Maybe [MetadataKeyValuePair]))
-> (Maybe [MetadataKeyValuePair]
    -> f (Maybe [MetadataKeyValuePair]))
-> QuerySchemaVersionMetadata
-> f QuerySchemaVersionMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
-> Iso
     (Maybe [MetadataKeyValuePair])
     (Maybe [MetadataKeyValuePair])
     (Maybe [MetadataKeyValuePair])
     (Maybe [MetadataKeyValuePair])
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
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
  [MetadataKeyValuePair]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The version number of the schema.
querySchemaVersionMetadata_schemaVersionNumber :: Lens.Lens' QuerySchemaVersionMetadata (Prelude.Maybe SchemaVersionNumber)
querySchemaVersionMetadata_schemaVersionNumber :: (Maybe SchemaVersionNumber -> f (Maybe SchemaVersionNumber))
-> QuerySchemaVersionMetadata -> f QuerySchemaVersionMetadata
querySchemaVersionMetadata_schemaVersionNumber = (QuerySchemaVersionMetadata -> Maybe SchemaVersionNumber)
-> (QuerySchemaVersionMetadata
    -> Maybe SchemaVersionNumber -> QuerySchemaVersionMetadata)
-> Lens
     QuerySchemaVersionMetadata
     QuerySchemaVersionMetadata
     (Maybe SchemaVersionNumber)
     (Maybe SchemaVersionNumber)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadata' {Maybe SchemaVersionNumber
schemaVersionNumber :: Maybe SchemaVersionNumber
$sel:schemaVersionNumber:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe SchemaVersionNumber
schemaVersionNumber} -> Maybe SchemaVersionNumber
schemaVersionNumber) (\s :: QuerySchemaVersionMetadata
s@QuerySchemaVersionMetadata' {} Maybe SchemaVersionNumber
a -> QuerySchemaVersionMetadata
s {$sel:schemaVersionNumber:QuerySchemaVersionMetadata' :: Maybe SchemaVersionNumber
schemaVersionNumber = Maybe SchemaVersionNumber
a} :: QuerySchemaVersionMetadata)

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

instance Core.AWSRequest QuerySchemaVersionMetadata where
  type
    AWSResponse QuerySchemaVersionMetadata =
      QuerySchemaVersionMetadataResponse
  request :: QuerySchemaVersionMetadata -> Request QuerySchemaVersionMetadata
request = Service
-> QuerySchemaVersionMetadata -> Request QuerySchemaVersionMetadata
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy QuerySchemaVersionMetadata
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse QuerySchemaVersionMetadata)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse QuerySchemaVersionMetadata))
-> Logger
-> Service
-> Proxy QuerySchemaVersionMetadata
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse QuerySchemaVersionMetadata)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe (HashMap Text MetadataInfo)
-> Int
-> QuerySchemaVersionMetadataResponse
QuerySchemaVersionMetadataResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text MetadataInfo)
 -> Int
 -> QuerySchemaVersionMetadataResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text MetadataInfo)
      -> Int
      -> QuerySchemaVersionMetadataResponse)
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
"SchemaVersionId")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text MetadataInfo)
   -> Int
   -> QuerySchemaVersionMetadataResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text MetadataInfo)
      -> Int -> QuerySchemaVersionMetadataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe (HashMap Text MetadataInfo)
   -> Int -> QuerySchemaVersionMetadataResponse)
-> Either String (Maybe (HashMap Text MetadataInfo))
-> Either String (Int -> QuerySchemaVersionMetadataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text MetadataInfo)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MetadataInfoMap"
                            Either String (Maybe (Maybe (HashMap Text MetadataInfo)))
-> Maybe (HashMap Text MetadataInfo)
-> Either String (Maybe (HashMap Text MetadataInfo))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text MetadataInfo)
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> QuerySchemaVersionMetadataResponse)
-> Either String Int
-> Either String QuerySchemaVersionMetadataResponse
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 QuerySchemaVersionMetadata

instance Prelude.NFData QuerySchemaVersionMetadata

instance Core.ToHeaders QuerySchemaVersionMetadata where
  toHeaders :: QuerySchemaVersionMetadata -> ResponseHeaders
toHeaders =
    ResponseHeaders -> QuerySchemaVersionMetadata -> 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.QuerySchemaVersionMetadata" ::
                          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 QuerySchemaVersionMetadata where
  toJSON :: QuerySchemaVersionMetadata -> Value
toJSON QuerySchemaVersionMetadata' {Maybe Natural
Maybe [MetadataKeyValuePair]
Maybe Text
Maybe SchemaId
Maybe SchemaVersionNumber
maxResults :: Maybe Natural
schemaVersionNumber :: Maybe SchemaVersionNumber
metadataList :: Maybe [MetadataKeyValuePair]
nextToken :: Maybe Text
schemaId :: Maybe SchemaId
schemaVersionId :: Maybe Text
$sel:maxResults:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe Natural
$sel:schemaVersionNumber:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe SchemaVersionNumber
$sel:metadataList:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe [MetadataKeyValuePair]
$sel:nextToken:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe Text
$sel:schemaId:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe SchemaId
$sel:schemaVersionId:QuerySchemaVersionMetadata' :: QuerySchemaVersionMetadata -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SchemaVersionId" 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
schemaVersionId,
            (Text
"SchemaId" Text -> SchemaId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SchemaId -> Pair) -> Maybe SchemaId -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SchemaId
schemaId,
            (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
"MetadataList" Text -> [MetadataKeyValuePair] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([MetadataKeyValuePair] -> Pair)
-> Maybe [MetadataKeyValuePair] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [MetadataKeyValuePair]
metadataList,
            (Text
"SchemaVersionNumber" Text -> SchemaVersionNumber -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SchemaVersionNumber -> Pair)
-> Maybe SchemaVersionNumber -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SchemaVersionNumber
schemaVersionNumber,
            (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
          ]
      )

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

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

-- | /See:/ 'newQuerySchemaVersionMetadataResponse' smart constructor.
data QuerySchemaVersionMetadataResponse = QuerySchemaVersionMetadataResponse'
  { -- | The unique version ID of the schema version.
    QuerySchemaVersionMetadataResponse -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | A continuation token for paginating the returned list of tokens,
    -- returned if the current segment of the list is not the last.
    QuerySchemaVersionMetadataResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A map of a metadata key and associated values.
    QuerySchemaVersionMetadataResponse
-> Maybe (HashMap Text MetadataInfo)
metadataInfoMap :: Prelude.Maybe (Prelude.HashMap Prelude.Text MetadataInfo),
    -- | The response's http status code.
    QuerySchemaVersionMetadataResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (QuerySchemaVersionMetadataResponse
-> QuerySchemaVersionMetadataResponse -> Bool
(QuerySchemaVersionMetadataResponse
 -> QuerySchemaVersionMetadataResponse -> Bool)
-> (QuerySchemaVersionMetadataResponse
    -> QuerySchemaVersionMetadataResponse -> Bool)
-> Eq QuerySchemaVersionMetadataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QuerySchemaVersionMetadataResponse
-> QuerySchemaVersionMetadataResponse -> Bool
$c/= :: QuerySchemaVersionMetadataResponse
-> QuerySchemaVersionMetadataResponse -> Bool
== :: QuerySchemaVersionMetadataResponse
-> QuerySchemaVersionMetadataResponse -> Bool
$c== :: QuerySchemaVersionMetadataResponse
-> QuerySchemaVersionMetadataResponse -> Bool
Prelude.Eq, ReadPrec [QuerySchemaVersionMetadataResponse]
ReadPrec QuerySchemaVersionMetadataResponse
Int -> ReadS QuerySchemaVersionMetadataResponse
ReadS [QuerySchemaVersionMetadataResponse]
(Int -> ReadS QuerySchemaVersionMetadataResponse)
-> ReadS [QuerySchemaVersionMetadataResponse]
-> ReadPrec QuerySchemaVersionMetadataResponse
-> ReadPrec [QuerySchemaVersionMetadataResponse]
-> Read QuerySchemaVersionMetadataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QuerySchemaVersionMetadataResponse]
$creadListPrec :: ReadPrec [QuerySchemaVersionMetadataResponse]
readPrec :: ReadPrec QuerySchemaVersionMetadataResponse
$creadPrec :: ReadPrec QuerySchemaVersionMetadataResponse
readList :: ReadS [QuerySchemaVersionMetadataResponse]
$creadList :: ReadS [QuerySchemaVersionMetadataResponse]
readsPrec :: Int -> ReadS QuerySchemaVersionMetadataResponse
$creadsPrec :: Int -> ReadS QuerySchemaVersionMetadataResponse
Prelude.Read, Int -> QuerySchemaVersionMetadataResponse -> ShowS
[QuerySchemaVersionMetadataResponse] -> ShowS
QuerySchemaVersionMetadataResponse -> String
(Int -> QuerySchemaVersionMetadataResponse -> ShowS)
-> (QuerySchemaVersionMetadataResponse -> String)
-> ([QuerySchemaVersionMetadataResponse] -> ShowS)
-> Show QuerySchemaVersionMetadataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QuerySchemaVersionMetadataResponse] -> ShowS
$cshowList :: [QuerySchemaVersionMetadataResponse] -> ShowS
show :: QuerySchemaVersionMetadataResponse -> String
$cshow :: QuerySchemaVersionMetadataResponse -> String
showsPrec :: Int -> QuerySchemaVersionMetadataResponse -> ShowS
$cshowsPrec :: Int -> QuerySchemaVersionMetadataResponse -> ShowS
Prelude.Show, (forall x.
 QuerySchemaVersionMetadataResponse
 -> Rep QuerySchemaVersionMetadataResponse x)
-> (forall x.
    Rep QuerySchemaVersionMetadataResponse x
    -> QuerySchemaVersionMetadataResponse)
-> Generic QuerySchemaVersionMetadataResponse
forall x.
Rep QuerySchemaVersionMetadataResponse x
-> QuerySchemaVersionMetadataResponse
forall x.
QuerySchemaVersionMetadataResponse
-> Rep QuerySchemaVersionMetadataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep QuerySchemaVersionMetadataResponse x
-> QuerySchemaVersionMetadataResponse
$cfrom :: forall x.
QuerySchemaVersionMetadataResponse
-> Rep QuerySchemaVersionMetadataResponse x
Prelude.Generic)

-- |
-- Create a value of 'QuerySchemaVersionMetadataResponse' 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:
--
-- 'schemaVersionId', 'querySchemaVersionMetadataResponse_schemaVersionId' - The unique version ID of the schema version.
--
-- 'nextToken', 'querySchemaVersionMetadataResponse_nextToken' - A continuation token for paginating the returned list of tokens,
-- returned if the current segment of the list is not the last.
--
-- 'metadataInfoMap', 'querySchemaVersionMetadataResponse_metadataInfoMap' - A map of a metadata key and associated values.
--
-- 'httpStatus', 'querySchemaVersionMetadataResponse_httpStatus' - The response's http status code.
newQuerySchemaVersionMetadataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  QuerySchemaVersionMetadataResponse
newQuerySchemaVersionMetadataResponse :: Int -> QuerySchemaVersionMetadataResponse
newQuerySchemaVersionMetadataResponse Int
pHttpStatus_ =
  QuerySchemaVersionMetadataResponse' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text MetadataInfo)
-> Int
-> QuerySchemaVersionMetadataResponse
QuerySchemaVersionMetadataResponse'
    { $sel:schemaVersionId:QuerySchemaVersionMetadataResponse' :: Maybe Text
schemaVersionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:QuerySchemaVersionMetadataResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metadataInfoMap:QuerySchemaVersionMetadataResponse' :: Maybe (HashMap Text MetadataInfo)
metadataInfoMap = Maybe (HashMap Text MetadataInfo)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:QuerySchemaVersionMetadataResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The unique version ID of the schema version.
querySchemaVersionMetadataResponse_schemaVersionId :: Lens.Lens' QuerySchemaVersionMetadataResponse (Prelude.Maybe Prelude.Text)
querySchemaVersionMetadataResponse_schemaVersionId :: (Maybe Text -> f (Maybe Text))
-> QuerySchemaVersionMetadataResponse
-> f QuerySchemaVersionMetadataResponse
querySchemaVersionMetadataResponse_schemaVersionId = (QuerySchemaVersionMetadataResponse -> Maybe Text)
-> (QuerySchemaVersionMetadataResponse
    -> Maybe Text -> QuerySchemaVersionMetadataResponse)
-> Lens
     QuerySchemaVersionMetadataResponse
     QuerySchemaVersionMetadataResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadataResponse' {Maybe Text
schemaVersionId :: Maybe Text
$sel:schemaVersionId:QuerySchemaVersionMetadataResponse' :: QuerySchemaVersionMetadataResponse -> Maybe Text
schemaVersionId} -> Maybe Text
schemaVersionId) (\s :: QuerySchemaVersionMetadataResponse
s@QuerySchemaVersionMetadataResponse' {} Maybe Text
a -> QuerySchemaVersionMetadataResponse
s {$sel:schemaVersionId:QuerySchemaVersionMetadataResponse' :: Maybe Text
schemaVersionId = Maybe Text
a} :: QuerySchemaVersionMetadataResponse)

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

-- | A map of a metadata key and associated values.
querySchemaVersionMetadataResponse_metadataInfoMap :: Lens.Lens' QuerySchemaVersionMetadataResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text MetadataInfo))
querySchemaVersionMetadataResponse_metadataInfoMap :: (Maybe (HashMap Text MetadataInfo)
 -> f (Maybe (HashMap Text MetadataInfo)))
-> QuerySchemaVersionMetadataResponse
-> f QuerySchemaVersionMetadataResponse
querySchemaVersionMetadataResponse_metadataInfoMap = (QuerySchemaVersionMetadataResponse
 -> Maybe (HashMap Text MetadataInfo))
-> (QuerySchemaVersionMetadataResponse
    -> Maybe (HashMap Text MetadataInfo)
    -> QuerySchemaVersionMetadataResponse)
-> Lens
     QuerySchemaVersionMetadataResponse
     QuerySchemaVersionMetadataResponse
     (Maybe (HashMap Text MetadataInfo))
     (Maybe (HashMap Text MetadataInfo))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QuerySchemaVersionMetadataResponse' {Maybe (HashMap Text MetadataInfo)
metadataInfoMap :: Maybe (HashMap Text MetadataInfo)
$sel:metadataInfoMap:QuerySchemaVersionMetadataResponse' :: QuerySchemaVersionMetadataResponse
-> Maybe (HashMap Text MetadataInfo)
metadataInfoMap} -> Maybe (HashMap Text MetadataInfo)
metadataInfoMap) (\s :: QuerySchemaVersionMetadataResponse
s@QuerySchemaVersionMetadataResponse' {} Maybe (HashMap Text MetadataInfo)
a -> QuerySchemaVersionMetadataResponse
s {$sel:metadataInfoMap:QuerySchemaVersionMetadataResponse' :: Maybe (HashMap Text MetadataInfo)
metadataInfoMap = Maybe (HashMap Text MetadataInfo)
a} :: QuerySchemaVersionMetadataResponse) ((Maybe (HashMap Text MetadataInfo)
  -> f (Maybe (HashMap Text MetadataInfo)))
 -> QuerySchemaVersionMetadataResponse
 -> f QuerySchemaVersionMetadataResponse)
-> ((Maybe (HashMap Text MetadataInfo)
     -> f (Maybe (HashMap Text MetadataInfo)))
    -> Maybe (HashMap Text MetadataInfo)
    -> f (Maybe (HashMap Text MetadataInfo)))
-> (Maybe (HashMap Text MetadataInfo)
    -> f (Maybe (HashMap Text MetadataInfo)))
-> QuerySchemaVersionMetadataResponse
-> f QuerySchemaVersionMetadataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
-> Iso
     (Maybe (HashMap Text MetadataInfo))
     (Maybe (HashMap Text MetadataInfo))
     (Maybe (HashMap Text MetadataInfo))
     (Maybe (HashMap Text MetadataInfo))
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
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
  (HashMap Text MetadataInfo)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    QuerySchemaVersionMetadataResponse