{-# 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.RegisterSchemaVersion
-- 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)
--
-- Adds a new version to the existing schema. Returns an error if new
-- version of schema does not meet the compatibility requirements of the
-- schema set. This API will not create a new schema set and will return a
-- 404 error if the schema set is not already present in the Schema
-- Registry.
--
-- If this is the first schema definition to be registered in the Schema
-- Registry, this API will store the schema version and return immediately.
-- Otherwise, this call has the potential to run longer than other
-- operations due to compatibility modes. You can call the
-- @GetSchemaVersion@ API with the @SchemaVersionId@ to check compatibility
-- modes.
--
-- If the same schema definition is already stored in Schema Registry as a
-- version, the schema ID of the existing schema is returned to the caller.
module Amazonka.Glue.RegisterSchemaVersion
  ( -- * Creating a Request
    RegisterSchemaVersion (..),
    newRegisterSchemaVersion,

    -- * Request Lenses
    registerSchemaVersion_schemaId,
    registerSchemaVersion_schemaDefinition,

    -- * Destructuring the Response
    RegisterSchemaVersionResponse (..),
    newRegisterSchemaVersionResponse,

    -- * Response Lenses
    registerSchemaVersionResponse_status,
    registerSchemaVersionResponse_schemaVersionId,
    registerSchemaVersionResponse_versionNumber,
    registerSchemaVersionResponse_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:/ 'newRegisterSchemaVersion' smart constructor.
data RegisterSchemaVersion = RegisterSchemaVersion'
  { -- | 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.
    RegisterSchemaVersion -> SchemaId
schemaId :: SchemaId,
    -- | The schema definition using the @DataFormat@ setting for the
    -- @SchemaName@.
    RegisterSchemaVersion -> Text
schemaDefinition :: Prelude.Text
  }
  deriving (RegisterSchemaVersion -> RegisterSchemaVersion -> Bool
(RegisterSchemaVersion -> RegisterSchemaVersion -> Bool)
-> (RegisterSchemaVersion -> RegisterSchemaVersion -> Bool)
-> Eq RegisterSchemaVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterSchemaVersion -> RegisterSchemaVersion -> Bool
$c/= :: RegisterSchemaVersion -> RegisterSchemaVersion -> Bool
== :: RegisterSchemaVersion -> RegisterSchemaVersion -> Bool
$c== :: RegisterSchemaVersion -> RegisterSchemaVersion -> Bool
Prelude.Eq, ReadPrec [RegisterSchemaVersion]
ReadPrec RegisterSchemaVersion
Int -> ReadS RegisterSchemaVersion
ReadS [RegisterSchemaVersion]
(Int -> ReadS RegisterSchemaVersion)
-> ReadS [RegisterSchemaVersion]
-> ReadPrec RegisterSchemaVersion
-> ReadPrec [RegisterSchemaVersion]
-> Read RegisterSchemaVersion
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterSchemaVersion]
$creadListPrec :: ReadPrec [RegisterSchemaVersion]
readPrec :: ReadPrec RegisterSchemaVersion
$creadPrec :: ReadPrec RegisterSchemaVersion
readList :: ReadS [RegisterSchemaVersion]
$creadList :: ReadS [RegisterSchemaVersion]
readsPrec :: Int -> ReadS RegisterSchemaVersion
$creadsPrec :: Int -> ReadS RegisterSchemaVersion
Prelude.Read, Int -> RegisterSchemaVersion -> ShowS
[RegisterSchemaVersion] -> ShowS
RegisterSchemaVersion -> String
(Int -> RegisterSchemaVersion -> ShowS)
-> (RegisterSchemaVersion -> String)
-> ([RegisterSchemaVersion] -> ShowS)
-> Show RegisterSchemaVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterSchemaVersion] -> ShowS
$cshowList :: [RegisterSchemaVersion] -> ShowS
show :: RegisterSchemaVersion -> String
$cshow :: RegisterSchemaVersion -> String
showsPrec :: Int -> RegisterSchemaVersion -> ShowS
$cshowsPrec :: Int -> RegisterSchemaVersion -> ShowS
Prelude.Show, (forall x. RegisterSchemaVersion -> Rep RegisterSchemaVersion x)
-> (forall x. Rep RegisterSchemaVersion x -> RegisterSchemaVersion)
-> Generic RegisterSchemaVersion
forall x. Rep RegisterSchemaVersion x -> RegisterSchemaVersion
forall x. RegisterSchemaVersion -> Rep RegisterSchemaVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegisterSchemaVersion x -> RegisterSchemaVersion
$cfrom :: forall x. RegisterSchemaVersion -> Rep RegisterSchemaVersion x
Prelude.Generic)

-- |
-- Create a value of 'RegisterSchemaVersion' 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:
--
-- 'schemaId', 'registerSchemaVersion_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.
--
-- 'schemaDefinition', 'registerSchemaVersion_schemaDefinition' - The schema definition using the @DataFormat@ setting for the
-- @SchemaName@.
newRegisterSchemaVersion ::
  -- | 'schemaId'
  SchemaId ->
  -- | 'schemaDefinition'
  Prelude.Text ->
  RegisterSchemaVersion
newRegisterSchemaVersion :: SchemaId -> Text -> RegisterSchemaVersion
newRegisterSchemaVersion
  SchemaId
pSchemaId_
  Text
pSchemaDefinition_ =
    RegisterSchemaVersion' :: SchemaId -> Text -> RegisterSchemaVersion
RegisterSchemaVersion'
      { $sel:schemaId:RegisterSchemaVersion' :: SchemaId
schemaId = SchemaId
pSchemaId_,
        $sel:schemaDefinition:RegisterSchemaVersion' :: Text
schemaDefinition = Text
pSchemaDefinition_
      }

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

-- | The schema definition using the @DataFormat@ setting for the
-- @SchemaName@.
registerSchemaVersion_schemaDefinition :: Lens.Lens' RegisterSchemaVersion Prelude.Text
registerSchemaVersion_schemaDefinition :: (Text -> f Text)
-> RegisterSchemaVersion -> f RegisterSchemaVersion
registerSchemaVersion_schemaDefinition = (RegisterSchemaVersion -> Text)
-> (RegisterSchemaVersion -> Text -> RegisterSchemaVersion)
-> Lens RegisterSchemaVersion RegisterSchemaVersion Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterSchemaVersion' {Text
schemaDefinition :: Text
$sel:schemaDefinition:RegisterSchemaVersion' :: RegisterSchemaVersion -> Text
schemaDefinition} -> Text
schemaDefinition) (\s :: RegisterSchemaVersion
s@RegisterSchemaVersion' {} Text
a -> RegisterSchemaVersion
s {$sel:schemaDefinition:RegisterSchemaVersion' :: Text
schemaDefinition = Text
a} :: RegisterSchemaVersion)

instance Core.AWSRequest RegisterSchemaVersion where
  type
    AWSResponse RegisterSchemaVersion =
      RegisterSchemaVersionResponse
  request :: RegisterSchemaVersion -> Request RegisterSchemaVersion
request = Service -> RegisterSchemaVersion -> Request RegisterSchemaVersion
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy RegisterSchemaVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RegisterSchemaVersion)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse RegisterSchemaVersion))
-> Logger
-> Service
-> Proxy RegisterSchemaVersion
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RegisterSchemaVersion)))
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 Natural
-> Int
-> RegisterSchemaVersionResponse
RegisterSchemaVersionResponse'
            (Maybe SchemaVersionStatus
 -> Maybe Text
 -> Maybe Natural
 -> Int
 -> RegisterSchemaVersionResponse)
-> Either String (Maybe SchemaVersionStatus)
-> Either
     String
     (Maybe Text
      -> Maybe Natural -> Int -> RegisterSchemaVersionResponse)
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 Natural -> Int -> RegisterSchemaVersionResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Natural -> Int -> RegisterSchemaVersionResponse)
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 -> Int -> RegisterSchemaVersionResponse)
-> Either String (Maybe Natural)
-> Either String (Int -> RegisterSchemaVersionResponse)
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 (Int -> RegisterSchemaVersionResponse)
-> Either String Int -> Either String RegisterSchemaVersionResponse
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 RegisterSchemaVersion

instance Prelude.NFData RegisterSchemaVersion

instance Core.ToHeaders RegisterSchemaVersion where
  toHeaders :: RegisterSchemaVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> RegisterSchemaVersion -> 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.RegisterSchemaVersion" ::
                          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 RegisterSchemaVersion where
  toJSON :: RegisterSchemaVersion -> Value
toJSON RegisterSchemaVersion' {Text
SchemaId
schemaDefinition :: Text
schemaId :: SchemaId
$sel:schemaDefinition:RegisterSchemaVersion' :: RegisterSchemaVersion -> Text
$sel:schemaId:RegisterSchemaVersion' :: RegisterSchemaVersion -> SchemaId
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ 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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SchemaDefinition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
schemaDefinition)
          ]
      )

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

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

-- | /See:/ 'newRegisterSchemaVersionResponse' smart constructor.
data RegisterSchemaVersionResponse = RegisterSchemaVersionResponse'
  { -- | The status of the schema version.
    RegisterSchemaVersionResponse -> Maybe SchemaVersionStatus
status :: Prelude.Maybe SchemaVersionStatus,
    -- | The unique ID that represents the version of this schema.
    RegisterSchemaVersionResponse -> Maybe Text
schemaVersionId :: Prelude.Maybe Prelude.Text,
    -- | The version of this schema (for sync flow only, in case this is the
    -- first version).
    RegisterSchemaVersionResponse -> Maybe Natural
versionNumber :: Prelude.Maybe Prelude.Natural,
    -- | The response's http status code.
    RegisterSchemaVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RegisterSchemaVersionResponse
-> RegisterSchemaVersionResponse -> Bool
(RegisterSchemaVersionResponse
 -> RegisterSchemaVersionResponse -> Bool)
-> (RegisterSchemaVersionResponse
    -> RegisterSchemaVersionResponse -> Bool)
-> Eq RegisterSchemaVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterSchemaVersionResponse
-> RegisterSchemaVersionResponse -> Bool
$c/= :: RegisterSchemaVersionResponse
-> RegisterSchemaVersionResponse -> Bool
== :: RegisterSchemaVersionResponse
-> RegisterSchemaVersionResponse -> Bool
$c== :: RegisterSchemaVersionResponse
-> RegisterSchemaVersionResponse -> Bool
Prelude.Eq, ReadPrec [RegisterSchemaVersionResponse]
ReadPrec RegisterSchemaVersionResponse
Int -> ReadS RegisterSchemaVersionResponse
ReadS [RegisterSchemaVersionResponse]
(Int -> ReadS RegisterSchemaVersionResponse)
-> ReadS [RegisterSchemaVersionResponse]
-> ReadPrec RegisterSchemaVersionResponse
-> ReadPrec [RegisterSchemaVersionResponse]
-> Read RegisterSchemaVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterSchemaVersionResponse]
$creadListPrec :: ReadPrec [RegisterSchemaVersionResponse]
readPrec :: ReadPrec RegisterSchemaVersionResponse
$creadPrec :: ReadPrec RegisterSchemaVersionResponse
readList :: ReadS [RegisterSchemaVersionResponse]
$creadList :: ReadS [RegisterSchemaVersionResponse]
readsPrec :: Int -> ReadS RegisterSchemaVersionResponse
$creadsPrec :: Int -> ReadS RegisterSchemaVersionResponse
Prelude.Read, Int -> RegisterSchemaVersionResponse -> ShowS
[RegisterSchemaVersionResponse] -> ShowS
RegisterSchemaVersionResponse -> String
(Int -> RegisterSchemaVersionResponse -> ShowS)
-> (RegisterSchemaVersionResponse -> String)
-> ([RegisterSchemaVersionResponse] -> ShowS)
-> Show RegisterSchemaVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterSchemaVersionResponse] -> ShowS
$cshowList :: [RegisterSchemaVersionResponse] -> ShowS
show :: RegisterSchemaVersionResponse -> String
$cshow :: RegisterSchemaVersionResponse -> String
showsPrec :: Int -> RegisterSchemaVersionResponse -> ShowS
$cshowsPrec :: Int -> RegisterSchemaVersionResponse -> ShowS
Prelude.Show, (forall x.
 RegisterSchemaVersionResponse
 -> Rep RegisterSchemaVersionResponse x)
-> (forall x.
    Rep RegisterSchemaVersionResponse x
    -> RegisterSchemaVersionResponse)
-> Generic RegisterSchemaVersionResponse
forall x.
Rep RegisterSchemaVersionResponse x
-> RegisterSchemaVersionResponse
forall x.
RegisterSchemaVersionResponse
-> Rep RegisterSchemaVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterSchemaVersionResponse x
-> RegisterSchemaVersionResponse
$cfrom :: forall x.
RegisterSchemaVersionResponse
-> Rep RegisterSchemaVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'RegisterSchemaVersionResponse' 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', 'registerSchemaVersionResponse_status' - The status of the schema version.
--
-- 'schemaVersionId', 'registerSchemaVersionResponse_schemaVersionId' - The unique ID that represents the version of this schema.
--
-- 'versionNumber', 'registerSchemaVersionResponse_versionNumber' - The version of this schema (for sync flow only, in case this is the
-- first version).
--
-- 'httpStatus', 'registerSchemaVersionResponse_httpStatus' - The response's http status code.
newRegisterSchemaVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RegisterSchemaVersionResponse
newRegisterSchemaVersionResponse :: Int -> RegisterSchemaVersionResponse
newRegisterSchemaVersionResponse Int
pHttpStatus_ =
  RegisterSchemaVersionResponse' :: Maybe SchemaVersionStatus
-> Maybe Text
-> Maybe Natural
-> Int
-> RegisterSchemaVersionResponse
RegisterSchemaVersionResponse'
    { $sel:status:RegisterSchemaVersionResponse' :: Maybe SchemaVersionStatus
status =
        Maybe SchemaVersionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersionId:RegisterSchemaVersionResponse' :: Maybe Text
schemaVersionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:versionNumber:RegisterSchemaVersionResponse' :: Maybe Natural
versionNumber = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RegisterSchemaVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

-- | The version of this schema (for sync flow only, in case this is the
-- first version).
registerSchemaVersionResponse_versionNumber :: Lens.Lens' RegisterSchemaVersionResponse (Prelude.Maybe Prelude.Natural)
registerSchemaVersionResponse_versionNumber :: (Maybe Natural -> f (Maybe Natural))
-> RegisterSchemaVersionResponse -> f RegisterSchemaVersionResponse
registerSchemaVersionResponse_versionNumber = (RegisterSchemaVersionResponse -> Maybe Natural)
-> (RegisterSchemaVersionResponse
    -> Maybe Natural -> RegisterSchemaVersionResponse)
-> Lens
     RegisterSchemaVersionResponse
     RegisterSchemaVersionResponse
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterSchemaVersionResponse' {Maybe Natural
versionNumber :: Maybe Natural
$sel:versionNumber:RegisterSchemaVersionResponse' :: RegisterSchemaVersionResponse -> Maybe Natural
versionNumber} -> Maybe Natural
versionNumber) (\s :: RegisterSchemaVersionResponse
s@RegisterSchemaVersionResponse' {} Maybe Natural
a -> RegisterSchemaVersionResponse
s {$sel:versionNumber:RegisterSchemaVersionResponse' :: Maybe Natural
versionNumber = Maybe Natural
a} :: RegisterSchemaVersionResponse)

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

instance Prelude.NFData RegisterSchemaVersionResponse