{-# 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.GetSchemaVersion
-- 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)
--
-- Get the specified schema by its unique ID assigned when a version of the
-- schema is created or registered. Schema versions in Deleted status will
-- not be included in the results.
module Amazonka.Glue.GetSchemaVersion
  ( -- * Creating a Request
    GetSchemaVersion (..),
    newGetSchemaVersion,

    -- * Request Lenses
    getSchemaVersion_schemaVersionId,
    getSchemaVersion_schemaId,
    getSchemaVersion_schemaVersionNumber,

    -- * Destructuring the Response
    GetSchemaVersionResponse (..),
    newGetSchemaVersionResponse,

    -- * Response Lenses
    getSchemaVersionResponse_status,
    getSchemaVersionResponse_schemaDefinition,
    getSchemaVersionResponse_createdTime,
    getSchemaVersionResponse_dataFormat,
    getSchemaVersionResponse_schemaVersionId,
    getSchemaVersionResponse_versionNumber,
    getSchemaVersionResponse_schemaArn,
    getSchemaVersionResponse_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:/ 'newGetSchemaVersion' smart constructor.
data GetSchemaVersion = GetSchemaVersion'
  { -- | The @SchemaVersionId@ of the schema version. This field is required for
    -- fetching by schema ID. Either this or the @SchemaId@ wrapper has to be
    -- provided.
    GetSchemaVersion -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | 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.
    GetSchemaVersion -> Maybe SchemaId
schemaId :: Prelude.Maybe SchemaId,
    -- | The version number of the schema.
    GetSchemaVersion -> Maybe SchemaVersionNumber
schemaVersionNumber :: Prelude.Maybe SchemaVersionNumber
  }
  deriving (GetSchemaVersion -> GetSchemaVersion -> Bool
(GetSchemaVersion -> GetSchemaVersion -> Bool)
-> (GetSchemaVersion -> GetSchemaVersion -> Bool)
-> Eq GetSchemaVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaVersion -> GetSchemaVersion -> Bool
$c/= :: GetSchemaVersion -> GetSchemaVersion -> Bool
== :: GetSchemaVersion -> GetSchemaVersion -> Bool
$c== :: GetSchemaVersion -> GetSchemaVersion -> Bool
Prelude.Eq, ReadPrec [GetSchemaVersion]
ReadPrec GetSchemaVersion
Int -> ReadS GetSchemaVersion
ReadS [GetSchemaVersion]
(Int -> ReadS GetSchemaVersion)
-> ReadS [GetSchemaVersion]
-> ReadPrec GetSchemaVersion
-> ReadPrec [GetSchemaVersion]
-> Read GetSchemaVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaVersion]
$creadListPrec :: ReadPrec [GetSchemaVersion]
readPrec :: ReadPrec GetSchemaVersion
$creadPrec :: ReadPrec GetSchemaVersion
readList :: ReadS [GetSchemaVersion]
$creadList :: ReadS [GetSchemaVersion]
readsPrec :: Int -> ReadS GetSchemaVersion
$creadsPrec :: Int -> ReadS GetSchemaVersion
Prelude.Read, Int -> GetSchemaVersion -> ShowS
[GetSchemaVersion] -> ShowS
GetSchemaVersion -> String
(Int -> GetSchemaVersion -> ShowS)
-> (GetSchemaVersion -> String)
-> ([GetSchemaVersion] -> ShowS)
-> Show GetSchemaVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaVersion] -> ShowS
$cshowList :: [GetSchemaVersion] -> ShowS
show :: GetSchemaVersion -> String
$cshow :: GetSchemaVersion -> String
showsPrec :: Int -> GetSchemaVersion -> ShowS
$cshowsPrec :: Int -> GetSchemaVersion -> ShowS
Prelude.Show, (forall x. GetSchemaVersion -> Rep GetSchemaVersion x)
-> (forall x. Rep GetSchemaVersion x -> GetSchemaVersion)
-> Generic GetSchemaVersion
forall x. Rep GetSchemaVersion x -> GetSchemaVersion
forall x. GetSchemaVersion -> Rep GetSchemaVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSchemaVersion x -> GetSchemaVersion
$cfrom :: forall x. GetSchemaVersion -> Rep GetSchemaVersion x
Prelude.Generic)

-- |
-- Create a value of 'GetSchemaVersion' 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', 'getSchemaVersion_schemaVersionId' - The @SchemaVersionId@ of the schema version. This field is required for
-- fetching by schema ID. Either this or the @SchemaId@ wrapper has to be
-- provided.
--
-- 'schemaId', 'getSchemaVersion_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.
--
-- 'schemaVersionNumber', 'getSchemaVersion_schemaVersionNumber' - The version number of the schema.
newGetSchemaVersion ::
  GetSchemaVersion
newGetSchemaVersion :: GetSchemaVersion
newGetSchemaVersion =
  GetSchemaVersion' :: Maybe Text
-> Maybe SchemaId -> Maybe SchemaVersionNumber -> GetSchemaVersion
GetSchemaVersion'
    { $sel:schemaVersionId:GetSchemaVersion' :: Maybe Text
schemaVersionId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaId:GetSchemaVersion' :: Maybe SchemaId
schemaId = Maybe SchemaId
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersionNumber:GetSchemaVersion' :: Maybe SchemaVersionNumber
schemaVersionNumber = Maybe SchemaVersionNumber
forall a. Maybe a
Prelude.Nothing
    }

-- | The @SchemaVersionId@ of the schema version. This field is required for
-- fetching by schema ID. Either this or the @SchemaId@ wrapper has to be
-- provided.
getSchemaVersion_schemaVersionId :: Lens.Lens' GetSchemaVersion (Prelude.Maybe Prelude.Text)
getSchemaVersion_schemaVersionId :: (Maybe Text -> f (Maybe Text))
-> GetSchemaVersion -> f GetSchemaVersion
getSchemaVersion_schemaVersionId = (GetSchemaVersion -> Maybe Text)
-> (GetSchemaVersion -> Maybe Text -> GetSchemaVersion)
-> Lens GetSchemaVersion GetSchemaVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersion' {Maybe Text
schemaVersionId :: Maybe Text
$sel:schemaVersionId:GetSchemaVersion' :: GetSchemaVersion -> Maybe Text
schemaVersionId} -> Maybe Text
schemaVersionId) (\s :: GetSchemaVersion
s@GetSchemaVersion' {} Maybe Text
a -> GetSchemaVersion
s {$sel:schemaVersionId:GetSchemaVersion' :: Maybe Text
schemaVersionId = Maybe Text
a} :: GetSchemaVersion)

-- | 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.
getSchemaVersion_schemaId :: Lens.Lens' GetSchemaVersion (Prelude.Maybe SchemaId)
getSchemaVersion_schemaId :: (Maybe SchemaId -> f (Maybe SchemaId))
-> GetSchemaVersion -> f GetSchemaVersion
getSchemaVersion_schemaId = (GetSchemaVersion -> Maybe SchemaId)
-> (GetSchemaVersion -> Maybe SchemaId -> GetSchemaVersion)
-> Lens
     GetSchemaVersion GetSchemaVersion (Maybe SchemaId) (Maybe SchemaId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersion' {Maybe SchemaId
schemaId :: Maybe SchemaId
$sel:schemaId:GetSchemaVersion' :: GetSchemaVersion -> Maybe SchemaId
schemaId} -> Maybe SchemaId
schemaId) (\s :: GetSchemaVersion
s@GetSchemaVersion' {} Maybe SchemaId
a -> GetSchemaVersion
s {$sel:schemaId:GetSchemaVersion' :: Maybe SchemaId
schemaId = Maybe SchemaId
a} :: GetSchemaVersion)

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

instance Core.AWSRequest GetSchemaVersion where
  type
    AWSResponse GetSchemaVersion =
      GetSchemaVersionResponse
  request :: GetSchemaVersion -> Request GetSchemaVersion
request = Service -> GetSchemaVersion -> Request GetSchemaVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSchemaVersion
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSchemaVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSchemaVersion))
-> Logger
-> Service
-> Proxy GetSchemaVersion
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetSchemaVersion)))
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 SchemaVersionStatus
-> Maybe Text
-> Maybe Text
-> Maybe DataFormat
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Int
-> GetSchemaVersionResponse
GetSchemaVersionResponse'
            (Maybe SchemaVersionStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe DataFormat
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Text
 -> Int
 -> GetSchemaVersionResponse)
-> Either String (Maybe SchemaVersionStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe DataFormat
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetSchemaVersionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SchemaVersionStatus)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Status")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe DataFormat
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetSchemaVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe DataFormat
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetSchemaVersionResponse)
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
"SchemaDefinition")
            Either
  String
  (Maybe Text
   -> Maybe DataFormat
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetSchemaVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe DataFormat
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Text
      -> Int
      -> GetSchemaVersionResponse)
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
"CreatedTime")
            Either
  String
  (Maybe DataFormat
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Text
   -> Int
   -> GetSchemaVersionResponse)
-> Either String (Maybe DataFormat)
-> Either
     String
     (Maybe Text
      -> Maybe Natural -> Maybe Text -> Int -> GetSchemaVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe DataFormat)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataFormat")
            Either
  String
  (Maybe Text
   -> Maybe Natural -> Maybe Text -> Int -> GetSchemaVersionResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural -> Maybe Text -> Int -> GetSchemaVersionResponse)
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
"SchemaVersionId")
            Either
  String
  (Maybe Natural -> Maybe Text -> Int -> GetSchemaVersionResponse)
-> Either String (Maybe Natural)
-> Either String (Maybe Text -> Int -> GetSchemaVersionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"VersionNumber")
            Either String (Maybe Text -> Int -> GetSchemaVersionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetSchemaVersionResponse)
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
"SchemaArn")
            Either String (Int -> GetSchemaVersionResponse)
-> Either String Int -> Either String GetSchemaVersionResponse
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 GetSchemaVersion

instance Prelude.NFData GetSchemaVersion

instance Core.ToHeaders GetSchemaVersion where
  toHeaders :: GetSchemaVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSchemaVersion -> 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.GetSchemaVersion" :: 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 GetSchemaVersion where
  toJSON :: GetSchemaVersion -> Value
toJSON GetSchemaVersion' {Maybe Text
Maybe SchemaId
Maybe SchemaVersionNumber
schemaVersionNumber :: Maybe SchemaVersionNumber
schemaId :: Maybe SchemaId
schemaVersionId :: Maybe Text
$sel:schemaVersionNumber:GetSchemaVersion' :: GetSchemaVersion -> Maybe SchemaVersionNumber
$sel:schemaId:GetSchemaVersion' :: GetSchemaVersion -> Maybe SchemaId
$sel:schemaVersionId:GetSchemaVersion' :: GetSchemaVersion -> 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
"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
          ]
      )

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

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

-- | /See:/ 'newGetSchemaVersionResponse' smart constructor.
data GetSchemaVersionResponse = GetSchemaVersionResponse'
  { -- | The status of the schema version.
    GetSchemaVersionResponse -> Maybe SchemaVersionStatus
status :: Prelude.Maybe SchemaVersionStatus,
    -- | The schema definition for the schema ID.
    GetSchemaVersionResponse -> Maybe Text
schemaDefinition :: Prelude.Maybe Prelude.Text,
    -- | The date and time the schema version was created.
    GetSchemaVersionResponse -> Maybe Text
createdTime :: Prelude.Maybe Prelude.Text,
    -- | The data format of the schema definition. Currently @AVRO@ and @JSON@
    -- are supported.
    GetSchemaVersionResponse -> Maybe DataFormat
dataFormat :: Prelude.Maybe DataFormat,
    -- | The @SchemaVersionId@ of the schema version.
    GetSchemaVersionResponse -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | The version number of the schema.
    GetSchemaVersionResponse -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the schema.
    GetSchemaVersionResponse -> Maybe Text
schemaArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSchemaVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool
(GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool)
-> (GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool)
-> Eq GetSchemaVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool
$c/= :: GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool
== :: GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool
$c== :: GetSchemaVersionResponse -> GetSchemaVersionResponse -> Bool
Prelude.Eq, ReadPrec [GetSchemaVersionResponse]
ReadPrec GetSchemaVersionResponse
Int -> ReadS GetSchemaVersionResponse
ReadS [GetSchemaVersionResponse]
(Int -> ReadS GetSchemaVersionResponse)
-> ReadS [GetSchemaVersionResponse]
-> ReadPrec GetSchemaVersionResponse
-> ReadPrec [GetSchemaVersionResponse]
-> Read GetSchemaVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaVersionResponse]
$creadListPrec :: ReadPrec [GetSchemaVersionResponse]
readPrec :: ReadPrec GetSchemaVersionResponse
$creadPrec :: ReadPrec GetSchemaVersionResponse
readList :: ReadS [GetSchemaVersionResponse]
$creadList :: ReadS [GetSchemaVersionResponse]
readsPrec :: Int -> ReadS GetSchemaVersionResponse
$creadsPrec :: Int -> ReadS GetSchemaVersionResponse
Prelude.Read, Int -> GetSchemaVersionResponse -> ShowS
[GetSchemaVersionResponse] -> ShowS
GetSchemaVersionResponse -> String
(Int -> GetSchemaVersionResponse -> ShowS)
-> (GetSchemaVersionResponse -> String)
-> ([GetSchemaVersionResponse] -> ShowS)
-> Show GetSchemaVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaVersionResponse] -> ShowS
$cshowList :: [GetSchemaVersionResponse] -> ShowS
show :: GetSchemaVersionResponse -> String
$cshow :: GetSchemaVersionResponse -> String
showsPrec :: Int -> GetSchemaVersionResponse -> ShowS
$cshowsPrec :: Int -> GetSchemaVersionResponse -> ShowS
Prelude.Show, (forall x.
 GetSchemaVersionResponse -> Rep GetSchemaVersionResponse x)
-> (forall x.
    Rep GetSchemaVersionResponse x -> GetSchemaVersionResponse)
-> Generic GetSchemaVersionResponse
forall x.
Rep GetSchemaVersionResponse x -> GetSchemaVersionResponse
forall x.
GetSchemaVersionResponse -> Rep GetSchemaVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSchemaVersionResponse x -> GetSchemaVersionResponse
$cfrom :: forall x.
GetSchemaVersionResponse -> Rep GetSchemaVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSchemaVersionResponse' 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:
--
-- 'status', 'getSchemaVersionResponse_status' - The status of the schema version.
--
-- 'schemaDefinition', 'getSchemaVersionResponse_schemaDefinition' - The schema definition for the schema ID.
--
-- 'createdTime', 'getSchemaVersionResponse_createdTime' - The date and time the schema version was created.
--
-- 'dataFormat', 'getSchemaVersionResponse_dataFormat' - The data format of the schema definition. Currently @AVRO@ and @JSON@
-- are supported.
--
-- 'schemaVersionId', 'getSchemaVersionResponse_schemaVersionId' - The @SchemaVersionId@ of the schema version.
--
-- 'versionNumber', 'getSchemaVersionResponse_versionNumber' - The version number of the schema.
--
-- 'schemaArn', 'getSchemaVersionResponse_schemaArn' - The Amazon Resource Name (ARN) of the schema.
--
-- 'httpStatus', 'getSchemaVersionResponse_httpStatus' - The response's http status code.
newGetSchemaVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSchemaVersionResponse
newGetSchemaVersionResponse :: Int -> GetSchemaVersionResponse
newGetSchemaVersionResponse Int
pHttpStatus_ =
  GetSchemaVersionResponse' :: Maybe SchemaVersionStatus
-> Maybe Text
-> Maybe Text
-> Maybe DataFormat
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Int
-> GetSchemaVersionResponse
GetSchemaVersionResponse'
    { $sel:status:GetSchemaVersionResponse' :: Maybe SchemaVersionStatus
status = Maybe SchemaVersionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaDefinition:GetSchemaVersionResponse' :: Maybe Text
schemaDefinition = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:GetSchemaVersionResponse' :: Maybe Text
createdTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataFormat:GetSchemaVersionResponse' :: Maybe DataFormat
dataFormat = Maybe DataFormat
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersionId:GetSchemaVersionResponse' :: Maybe Text
schemaVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:GetSchemaVersionResponse' :: Maybe Natural
versionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaArn:GetSchemaVersionResponse' :: Maybe Text
schemaArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSchemaVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The status of the schema version.
getSchemaVersionResponse_status :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe SchemaVersionStatus)
getSchemaVersionResponse_status :: (Maybe SchemaVersionStatus -> f (Maybe SchemaVersionStatus))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_status = (GetSchemaVersionResponse -> Maybe SchemaVersionStatus)
-> (GetSchemaVersionResponse
    -> Maybe SchemaVersionStatus -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe SchemaVersionStatus)
     (Maybe SchemaVersionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe SchemaVersionStatus
status :: Maybe SchemaVersionStatus
$sel:status:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe SchemaVersionStatus
status} -> Maybe SchemaVersionStatus
status) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe SchemaVersionStatus
a -> GetSchemaVersionResponse
s {$sel:status:GetSchemaVersionResponse' :: Maybe SchemaVersionStatus
status = Maybe SchemaVersionStatus
a} :: GetSchemaVersionResponse)

-- | The schema definition for the schema ID.
getSchemaVersionResponse_schemaDefinition :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe Prelude.Text)
getSchemaVersionResponse_schemaDefinition :: (Maybe Text -> f (Maybe Text))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_schemaDefinition = (GetSchemaVersionResponse -> Maybe Text)
-> (GetSchemaVersionResponse
    -> Maybe Text -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe Text
schemaDefinition :: Maybe Text
$sel:schemaDefinition:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe Text
schemaDefinition} -> Maybe Text
schemaDefinition) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe Text
a -> GetSchemaVersionResponse
s {$sel:schemaDefinition:GetSchemaVersionResponse' :: Maybe Text
schemaDefinition = Maybe Text
a} :: GetSchemaVersionResponse)

-- | The date and time the schema version was created.
getSchemaVersionResponse_createdTime :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe Prelude.Text)
getSchemaVersionResponse_createdTime :: (Maybe Text -> f (Maybe Text))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_createdTime = (GetSchemaVersionResponse -> Maybe Text)
-> (GetSchemaVersionResponse
    -> Maybe Text -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe Text
createdTime :: Maybe Text
$sel:createdTime:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe Text
createdTime} -> Maybe Text
createdTime) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe Text
a -> GetSchemaVersionResponse
s {$sel:createdTime:GetSchemaVersionResponse' :: Maybe Text
createdTime = Maybe Text
a} :: GetSchemaVersionResponse)

-- | The data format of the schema definition. Currently @AVRO@ and @JSON@
-- are supported.
getSchemaVersionResponse_dataFormat :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe DataFormat)
getSchemaVersionResponse_dataFormat :: (Maybe DataFormat -> f (Maybe DataFormat))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_dataFormat = (GetSchemaVersionResponse -> Maybe DataFormat)
-> (GetSchemaVersionResponse
    -> Maybe DataFormat -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe DataFormat)
     (Maybe DataFormat)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe DataFormat
dataFormat :: Maybe DataFormat
$sel:dataFormat:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe DataFormat
dataFormat} -> Maybe DataFormat
dataFormat) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe DataFormat
a -> GetSchemaVersionResponse
s {$sel:dataFormat:GetSchemaVersionResponse' :: Maybe DataFormat
dataFormat = Maybe DataFormat
a} :: GetSchemaVersionResponse)

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

-- | The version number of the schema.
getSchemaVersionResponse_versionNumber :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe Prelude.Natural)
getSchemaVersionResponse_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_versionNumber = (GetSchemaVersionResponse -> Maybe Natural)
-> (GetSchemaVersionResponse
    -> Maybe Natural -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe Natural
a -> GetSchemaVersionResponse
s {$sel:versionNumber:GetSchemaVersionResponse' :: Maybe Natural
versionNumber = Maybe Natural
a} :: GetSchemaVersionResponse)

-- | The Amazon Resource Name (ARN) of the schema.
getSchemaVersionResponse_schemaArn :: Lens.Lens' GetSchemaVersionResponse (Prelude.Maybe Prelude.Text)
getSchemaVersionResponse_schemaArn :: (Maybe Text -> f (Maybe Text))
-> GetSchemaVersionResponse -> f GetSchemaVersionResponse
getSchemaVersionResponse_schemaArn = (GetSchemaVersionResponse -> Maybe Text)
-> (GetSchemaVersionResponse
    -> Maybe Text -> GetSchemaVersionResponse)
-> Lens
     GetSchemaVersionResponse
     GetSchemaVersionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionResponse' {Maybe Text
schemaArn :: Maybe Text
$sel:schemaArn:GetSchemaVersionResponse' :: GetSchemaVersionResponse -> Maybe Text
schemaArn} -> Maybe Text
schemaArn) (\s :: GetSchemaVersionResponse
s@GetSchemaVersionResponse' {} Maybe Text
a -> GetSchemaVersionResponse
s {$sel:schemaArn:GetSchemaVersionResponse' :: Maybe Text
schemaArn = Maybe Text
a} :: GetSchemaVersionResponse)

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

instance Prelude.NFData GetSchemaVersionResponse