{-# 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.GetSchemaVersionsDiff
-- 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)
--
-- Fetches the schema version difference in the specified difference type
-- between two stored schema versions in the Schema Registry.
--
-- This API allows you to compare two schema versions between two schema
-- definitions under the same schema.
module Amazonka.Glue.GetSchemaVersionsDiff
  ( -- * Creating a Request
    GetSchemaVersionsDiff (..),
    newGetSchemaVersionsDiff,

    -- * Request Lenses
    getSchemaVersionsDiff_schemaId,
    getSchemaVersionsDiff_firstSchemaVersionNumber,
    getSchemaVersionsDiff_secondSchemaVersionNumber,
    getSchemaVersionsDiff_schemaDiffType,

    -- * Destructuring the Response
    GetSchemaVersionsDiffResponse (..),
    newGetSchemaVersionsDiffResponse,

    -- * Response Lenses
    getSchemaVersionsDiffResponse_diff,
    getSchemaVersionsDiffResponse_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:/ 'newGetSchemaVersionsDiff' smart constructor.
data GetSchemaVersionsDiff = GetSchemaVersionsDiff'
  { -- | This is a wrapper structure to contain schema identity fields. The
    -- structure contains:
    --
    -- -   SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema.
    --     One of @SchemaArn@ or @SchemaName@ has to be provided.
    --
    -- -   SchemaId$SchemaName: The name of the schema. One of @SchemaArn@ or
    --     @SchemaName@ has to be provided.
    GetSchemaVersionsDiff -> SchemaId
schemaId :: SchemaId,
    -- | The first of the two schema versions to be compared.
    GetSchemaVersionsDiff -> SchemaVersionNumber
firstSchemaVersionNumber :: SchemaVersionNumber,
    -- | The second of the two schema versions to be compared.
    GetSchemaVersionsDiff -> SchemaVersionNumber
secondSchemaVersionNumber :: SchemaVersionNumber,
    -- | Refers to @SYNTAX_DIFF@, which is the currently supported diff type.
    GetSchemaVersionsDiff -> SchemaDiffType
schemaDiffType :: SchemaDiffType
  }
  deriving (GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool
(GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool)
-> (GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool)
-> Eq GetSchemaVersionsDiff
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool
$c/= :: GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool
== :: GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool
$c== :: GetSchemaVersionsDiff -> GetSchemaVersionsDiff -> Bool
Prelude.Eq, ReadPrec [GetSchemaVersionsDiff]
ReadPrec GetSchemaVersionsDiff
Int -> ReadS GetSchemaVersionsDiff
ReadS [GetSchemaVersionsDiff]
(Int -> ReadS GetSchemaVersionsDiff)
-> ReadS [GetSchemaVersionsDiff]
-> ReadPrec GetSchemaVersionsDiff
-> ReadPrec [GetSchemaVersionsDiff]
-> Read GetSchemaVersionsDiff
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaVersionsDiff]
$creadListPrec :: ReadPrec [GetSchemaVersionsDiff]
readPrec :: ReadPrec GetSchemaVersionsDiff
$creadPrec :: ReadPrec GetSchemaVersionsDiff
readList :: ReadS [GetSchemaVersionsDiff]
$creadList :: ReadS [GetSchemaVersionsDiff]
readsPrec :: Int -> ReadS GetSchemaVersionsDiff
$creadsPrec :: Int -> ReadS GetSchemaVersionsDiff
Prelude.Read, Int -> GetSchemaVersionsDiff -> ShowS
[GetSchemaVersionsDiff] -> ShowS
GetSchemaVersionsDiff -> String
(Int -> GetSchemaVersionsDiff -> ShowS)
-> (GetSchemaVersionsDiff -> String)
-> ([GetSchemaVersionsDiff] -> ShowS)
-> Show GetSchemaVersionsDiff
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaVersionsDiff] -> ShowS
$cshowList :: [GetSchemaVersionsDiff] -> ShowS
show :: GetSchemaVersionsDiff -> String
$cshow :: GetSchemaVersionsDiff -> String
showsPrec :: Int -> GetSchemaVersionsDiff -> ShowS
$cshowsPrec :: Int -> GetSchemaVersionsDiff -> ShowS
Prelude.Show, (forall x. GetSchemaVersionsDiff -> Rep GetSchemaVersionsDiff x)
-> (forall x. Rep GetSchemaVersionsDiff x -> GetSchemaVersionsDiff)
-> Generic GetSchemaVersionsDiff
forall x. Rep GetSchemaVersionsDiff x -> GetSchemaVersionsDiff
forall x. GetSchemaVersionsDiff -> Rep GetSchemaVersionsDiff x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSchemaVersionsDiff x -> GetSchemaVersionsDiff
$cfrom :: forall x. GetSchemaVersionsDiff -> Rep GetSchemaVersionsDiff x
Prelude.Generic)

-- |
-- Create a value of 'GetSchemaVersionsDiff' 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', 'getSchemaVersionsDiff_schemaId' - This is a wrapper structure to contain schema identity fields. The
-- structure contains:
--
-- -   SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema.
--     One of @SchemaArn@ or @SchemaName@ has to be provided.
--
-- -   SchemaId$SchemaName: The name of the schema. One of @SchemaArn@ or
--     @SchemaName@ has to be provided.
--
-- 'firstSchemaVersionNumber', 'getSchemaVersionsDiff_firstSchemaVersionNumber' - The first of the two schema versions to be compared.
--
-- 'secondSchemaVersionNumber', 'getSchemaVersionsDiff_secondSchemaVersionNumber' - The second of the two schema versions to be compared.
--
-- 'schemaDiffType', 'getSchemaVersionsDiff_schemaDiffType' - Refers to @SYNTAX_DIFF@, which is the currently supported diff type.
newGetSchemaVersionsDiff ::
  -- | 'schemaId'
  SchemaId ->
  -- | 'firstSchemaVersionNumber'
  SchemaVersionNumber ->
  -- | 'secondSchemaVersionNumber'
  SchemaVersionNumber ->
  -- | 'schemaDiffType'
  SchemaDiffType ->
  GetSchemaVersionsDiff
newGetSchemaVersionsDiff :: SchemaId
-> SchemaVersionNumber
-> SchemaVersionNumber
-> SchemaDiffType
-> GetSchemaVersionsDiff
newGetSchemaVersionsDiff
  SchemaId
pSchemaId_
  SchemaVersionNumber
pFirstSchemaVersionNumber_
  SchemaVersionNumber
pSecondSchemaVersionNumber_
  SchemaDiffType
pSchemaDiffType_ =
    GetSchemaVersionsDiff' :: SchemaId
-> SchemaVersionNumber
-> SchemaVersionNumber
-> SchemaDiffType
-> GetSchemaVersionsDiff
GetSchemaVersionsDiff'
      { $sel:schemaId:GetSchemaVersionsDiff' :: SchemaId
schemaId = SchemaId
pSchemaId_,
        $sel:firstSchemaVersionNumber:GetSchemaVersionsDiff' :: SchemaVersionNumber
firstSchemaVersionNumber =
          SchemaVersionNumber
pFirstSchemaVersionNumber_,
        $sel:secondSchemaVersionNumber:GetSchemaVersionsDiff' :: SchemaVersionNumber
secondSchemaVersionNumber =
          SchemaVersionNumber
pSecondSchemaVersionNumber_,
        $sel:schemaDiffType:GetSchemaVersionsDiff' :: SchemaDiffType
schemaDiffType = SchemaDiffType
pSchemaDiffType_
      }

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

-- | The first of the two schema versions to be compared.
getSchemaVersionsDiff_firstSchemaVersionNumber :: Lens.Lens' GetSchemaVersionsDiff SchemaVersionNumber
getSchemaVersionsDiff_firstSchemaVersionNumber :: (SchemaVersionNumber -> f SchemaVersionNumber)
-> GetSchemaVersionsDiff -> f GetSchemaVersionsDiff
getSchemaVersionsDiff_firstSchemaVersionNumber = (GetSchemaVersionsDiff -> SchemaVersionNumber)
-> (GetSchemaVersionsDiff
    -> SchemaVersionNumber -> GetSchemaVersionsDiff)
-> Lens
     GetSchemaVersionsDiff
     GetSchemaVersionsDiff
     SchemaVersionNumber
     SchemaVersionNumber
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionsDiff' {SchemaVersionNumber
firstSchemaVersionNumber :: SchemaVersionNumber
$sel:firstSchemaVersionNumber:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaVersionNumber
firstSchemaVersionNumber} -> SchemaVersionNumber
firstSchemaVersionNumber) (\s :: GetSchemaVersionsDiff
s@GetSchemaVersionsDiff' {} SchemaVersionNumber
a -> GetSchemaVersionsDiff
s {$sel:firstSchemaVersionNumber:GetSchemaVersionsDiff' :: SchemaVersionNumber
firstSchemaVersionNumber = SchemaVersionNumber
a} :: GetSchemaVersionsDiff)

-- | The second of the two schema versions to be compared.
getSchemaVersionsDiff_secondSchemaVersionNumber :: Lens.Lens' GetSchemaVersionsDiff SchemaVersionNumber
getSchemaVersionsDiff_secondSchemaVersionNumber :: (SchemaVersionNumber -> f SchemaVersionNumber)
-> GetSchemaVersionsDiff -> f GetSchemaVersionsDiff
getSchemaVersionsDiff_secondSchemaVersionNumber = (GetSchemaVersionsDiff -> SchemaVersionNumber)
-> (GetSchemaVersionsDiff
    -> SchemaVersionNumber -> GetSchemaVersionsDiff)
-> Lens
     GetSchemaVersionsDiff
     GetSchemaVersionsDiff
     SchemaVersionNumber
     SchemaVersionNumber
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionsDiff' {SchemaVersionNumber
secondSchemaVersionNumber :: SchemaVersionNumber
$sel:secondSchemaVersionNumber:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaVersionNumber
secondSchemaVersionNumber} -> SchemaVersionNumber
secondSchemaVersionNumber) (\s :: GetSchemaVersionsDiff
s@GetSchemaVersionsDiff' {} SchemaVersionNumber
a -> GetSchemaVersionsDiff
s {$sel:secondSchemaVersionNumber:GetSchemaVersionsDiff' :: SchemaVersionNumber
secondSchemaVersionNumber = SchemaVersionNumber
a} :: GetSchemaVersionsDiff)

-- | Refers to @SYNTAX_DIFF@, which is the currently supported diff type.
getSchemaVersionsDiff_schemaDiffType :: Lens.Lens' GetSchemaVersionsDiff SchemaDiffType
getSchemaVersionsDiff_schemaDiffType :: (SchemaDiffType -> f SchemaDiffType)
-> GetSchemaVersionsDiff -> f GetSchemaVersionsDiff
getSchemaVersionsDiff_schemaDiffType = (GetSchemaVersionsDiff -> SchemaDiffType)
-> (GetSchemaVersionsDiff
    -> SchemaDiffType -> GetSchemaVersionsDiff)
-> Lens
     GetSchemaVersionsDiff
     GetSchemaVersionsDiff
     SchemaDiffType
     SchemaDiffType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionsDiff' {SchemaDiffType
schemaDiffType :: SchemaDiffType
$sel:schemaDiffType:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaDiffType
schemaDiffType} -> SchemaDiffType
schemaDiffType) (\s :: GetSchemaVersionsDiff
s@GetSchemaVersionsDiff' {} SchemaDiffType
a -> GetSchemaVersionsDiff
s {$sel:schemaDiffType:GetSchemaVersionsDiff' :: SchemaDiffType
schemaDiffType = SchemaDiffType
a} :: GetSchemaVersionsDiff)

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

instance Prelude.NFData GetSchemaVersionsDiff

instance Core.ToHeaders GetSchemaVersionsDiff where
  toHeaders :: GetSchemaVersionsDiff -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSchemaVersionsDiff -> 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.GetSchemaVersionsDiff" ::
                          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 GetSchemaVersionsDiff where
  toJSON :: GetSchemaVersionsDiff -> Value
toJSON GetSchemaVersionsDiff' {SchemaDiffType
SchemaId
SchemaVersionNumber
schemaDiffType :: SchemaDiffType
secondSchemaVersionNumber :: SchemaVersionNumber
firstSchemaVersionNumber :: SchemaVersionNumber
schemaId :: SchemaId
$sel:schemaDiffType:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaDiffType
$sel:secondSchemaVersionNumber:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaVersionNumber
$sel:firstSchemaVersionNumber:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> SchemaVersionNumber
$sel:schemaId:GetSchemaVersionsDiff' :: GetSchemaVersionsDiff -> 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
"FirstSchemaVersionNumber"
                  Text -> SchemaVersionNumber -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaVersionNumber
firstSchemaVersionNumber
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"SecondSchemaVersionNumber"
                  Text -> SchemaVersionNumber -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaVersionNumber
secondSchemaVersionNumber
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SchemaDiffType" Text -> SchemaDiffType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SchemaDiffType
schemaDiffType)
          ]
      )

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

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

-- | /See:/ 'newGetSchemaVersionsDiffResponse' smart constructor.
data GetSchemaVersionsDiffResponse = GetSchemaVersionsDiffResponse'
  { -- | The difference between schemas as a string in JsonPatch format.
    GetSchemaVersionsDiffResponse -> Maybe Text
diff :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSchemaVersionsDiffResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetSchemaVersionsDiffResponse
-> GetSchemaVersionsDiffResponse -> Bool
(GetSchemaVersionsDiffResponse
 -> GetSchemaVersionsDiffResponse -> Bool)
-> (GetSchemaVersionsDiffResponse
    -> GetSchemaVersionsDiffResponse -> Bool)
-> Eq GetSchemaVersionsDiffResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSchemaVersionsDiffResponse
-> GetSchemaVersionsDiffResponse -> Bool
$c/= :: GetSchemaVersionsDiffResponse
-> GetSchemaVersionsDiffResponse -> Bool
== :: GetSchemaVersionsDiffResponse
-> GetSchemaVersionsDiffResponse -> Bool
$c== :: GetSchemaVersionsDiffResponse
-> GetSchemaVersionsDiffResponse -> Bool
Prelude.Eq, ReadPrec [GetSchemaVersionsDiffResponse]
ReadPrec GetSchemaVersionsDiffResponse
Int -> ReadS GetSchemaVersionsDiffResponse
ReadS [GetSchemaVersionsDiffResponse]
(Int -> ReadS GetSchemaVersionsDiffResponse)
-> ReadS [GetSchemaVersionsDiffResponse]
-> ReadPrec GetSchemaVersionsDiffResponse
-> ReadPrec [GetSchemaVersionsDiffResponse]
-> Read GetSchemaVersionsDiffResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSchemaVersionsDiffResponse]
$creadListPrec :: ReadPrec [GetSchemaVersionsDiffResponse]
readPrec :: ReadPrec GetSchemaVersionsDiffResponse
$creadPrec :: ReadPrec GetSchemaVersionsDiffResponse
readList :: ReadS [GetSchemaVersionsDiffResponse]
$creadList :: ReadS [GetSchemaVersionsDiffResponse]
readsPrec :: Int -> ReadS GetSchemaVersionsDiffResponse
$creadsPrec :: Int -> ReadS GetSchemaVersionsDiffResponse
Prelude.Read, Int -> GetSchemaVersionsDiffResponse -> ShowS
[GetSchemaVersionsDiffResponse] -> ShowS
GetSchemaVersionsDiffResponse -> String
(Int -> GetSchemaVersionsDiffResponse -> ShowS)
-> (GetSchemaVersionsDiffResponse -> String)
-> ([GetSchemaVersionsDiffResponse] -> ShowS)
-> Show GetSchemaVersionsDiffResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSchemaVersionsDiffResponse] -> ShowS
$cshowList :: [GetSchemaVersionsDiffResponse] -> ShowS
show :: GetSchemaVersionsDiffResponse -> String
$cshow :: GetSchemaVersionsDiffResponse -> String
showsPrec :: Int -> GetSchemaVersionsDiffResponse -> ShowS
$cshowsPrec :: Int -> GetSchemaVersionsDiffResponse -> ShowS
Prelude.Show, (forall x.
 GetSchemaVersionsDiffResponse
 -> Rep GetSchemaVersionsDiffResponse x)
-> (forall x.
    Rep GetSchemaVersionsDiffResponse x
    -> GetSchemaVersionsDiffResponse)
-> Generic GetSchemaVersionsDiffResponse
forall x.
Rep GetSchemaVersionsDiffResponse x
-> GetSchemaVersionsDiffResponse
forall x.
GetSchemaVersionsDiffResponse
-> Rep GetSchemaVersionsDiffResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSchemaVersionsDiffResponse x
-> GetSchemaVersionsDiffResponse
$cfrom :: forall x.
GetSchemaVersionsDiffResponse
-> Rep GetSchemaVersionsDiffResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSchemaVersionsDiffResponse' 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:
--
-- 'diff', 'getSchemaVersionsDiffResponse_diff' - The difference between schemas as a string in JsonPatch format.
--
-- 'httpStatus', 'getSchemaVersionsDiffResponse_httpStatus' - The response's http status code.
newGetSchemaVersionsDiffResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSchemaVersionsDiffResponse
newGetSchemaVersionsDiffResponse :: Int -> GetSchemaVersionsDiffResponse
newGetSchemaVersionsDiffResponse Int
pHttpStatus_ =
  GetSchemaVersionsDiffResponse' :: Maybe Text -> Int -> GetSchemaVersionsDiffResponse
GetSchemaVersionsDiffResponse'
    { $sel:diff:GetSchemaVersionsDiffResponse' :: Maybe Text
diff =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSchemaVersionsDiffResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The difference between schemas as a string in JsonPatch format.
getSchemaVersionsDiffResponse_diff :: Lens.Lens' GetSchemaVersionsDiffResponse (Prelude.Maybe Prelude.Text)
getSchemaVersionsDiffResponse_diff :: (Maybe Text -> f (Maybe Text))
-> GetSchemaVersionsDiffResponse -> f GetSchemaVersionsDiffResponse
getSchemaVersionsDiffResponse_diff = (GetSchemaVersionsDiffResponse -> Maybe Text)
-> (GetSchemaVersionsDiffResponse
    -> Maybe Text -> GetSchemaVersionsDiffResponse)
-> Lens
     GetSchemaVersionsDiffResponse
     GetSchemaVersionsDiffResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSchemaVersionsDiffResponse' {Maybe Text
diff :: Maybe Text
$sel:diff:GetSchemaVersionsDiffResponse' :: GetSchemaVersionsDiffResponse -> Maybe Text
diff} -> Maybe Text
diff) (\s :: GetSchemaVersionsDiffResponse
s@GetSchemaVersionsDiffResponse' {} Maybe Text
a -> GetSchemaVersionsDiffResponse
s {$sel:diff:GetSchemaVersionsDiffResponse' :: Maybe Text
diff = Maybe Text
a} :: GetSchemaVersionsDiffResponse)

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

instance Prelude.NFData GetSchemaVersionsDiffResponse