{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.DMS.Types.SchemaResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DMS.Types.SchemaResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types.DatabaseShortInfoResponse
import Amazonka.DMS.Types.SchemaShortInfoResponse
import Amazonka.DMS.Types.ServerShortInfoResponse
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Describes a schema in a Fleet Advisor collector inventory.
--
-- /See:/ 'newSchemaResponse' smart constructor.
data SchemaResponse = SchemaResponse'
  { -- | The number of lines of code in a schema in a Fleet Advisor collector
    -- inventory.
    SchemaResponse -> Maybe Integer
codeLineCount :: Prelude.Maybe Prelude.Integer,
    -- | The size level of the code in a schema in a Fleet Advisor collector
    -- inventory.
    SchemaResponse -> Maybe Integer
codeSize :: Prelude.Maybe Prelude.Integer,
    -- | The complexity level of the code in a schema in a Fleet Advisor
    -- collector inventory.
    SchemaResponse -> Maybe Text
complexity :: Prelude.Maybe Prelude.Text,
    -- | The database for a schema in a Fleet Advisor collector inventory.
    SchemaResponse -> Maybe DatabaseShortInfoResponse
databaseInstance :: Prelude.Maybe DatabaseShortInfoResponse,
    SchemaResponse -> Maybe SchemaShortInfoResponse
originalSchema :: Prelude.Maybe SchemaShortInfoResponse,
    -- | The ID of a schema in a Fleet Advisor collector inventory.
    SchemaResponse -> Maybe Text
schemaId :: Prelude.Maybe Prelude.Text,
    -- | The name of a schema in a Fleet Advisor collector inventory.
    SchemaResponse -> Maybe Text
schemaName :: Prelude.Maybe Prelude.Text,
    -- | The database server for a schema in a Fleet Advisor collector inventory.
    SchemaResponse -> Maybe ServerShortInfoResponse
server :: Prelude.Maybe ServerShortInfoResponse,
    -- | The similarity value for a schema in a Fleet Advisor collector
    -- inventory. A higher similarity value indicates that a schema is likely
    -- to be a duplicate.
    SchemaResponse -> Maybe Double
similarity :: Prelude.Maybe Prelude.Double
  }
  deriving (SchemaResponse -> SchemaResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SchemaResponse -> SchemaResponse -> Bool
$c/= :: SchemaResponse -> SchemaResponse -> Bool
== :: SchemaResponse -> SchemaResponse -> Bool
$c== :: SchemaResponse -> SchemaResponse -> Bool
Prelude.Eq, ReadPrec [SchemaResponse]
ReadPrec SchemaResponse
Int -> ReadS SchemaResponse
ReadS [SchemaResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SchemaResponse]
$creadListPrec :: ReadPrec [SchemaResponse]
readPrec :: ReadPrec SchemaResponse
$creadPrec :: ReadPrec SchemaResponse
readList :: ReadS [SchemaResponse]
$creadList :: ReadS [SchemaResponse]
readsPrec :: Int -> ReadS SchemaResponse
$creadsPrec :: Int -> ReadS SchemaResponse
Prelude.Read, Int -> SchemaResponse -> ShowS
[SchemaResponse] -> ShowS
SchemaResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SchemaResponse] -> ShowS
$cshowList :: [SchemaResponse] -> ShowS
show :: SchemaResponse -> String
$cshow :: SchemaResponse -> String
showsPrec :: Int -> SchemaResponse -> ShowS
$cshowsPrec :: Int -> SchemaResponse -> ShowS
Prelude.Show, forall x. Rep SchemaResponse x -> SchemaResponse
forall x. SchemaResponse -> Rep SchemaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SchemaResponse x -> SchemaResponse
$cfrom :: forall x. SchemaResponse -> Rep SchemaResponse x
Prelude.Generic)

-- |
-- Create a value of 'SchemaResponse' 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:
--
-- 'codeLineCount', 'schemaResponse_codeLineCount' - The number of lines of code in a schema in a Fleet Advisor collector
-- inventory.
--
-- 'codeSize', 'schemaResponse_codeSize' - The size level of the code in a schema in a Fleet Advisor collector
-- inventory.
--
-- 'complexity', 'schemaResponse_complexity' - The complexity level of the code in a schema in a Fleet Advisor
-- collector inventory.
--
-- 'databaseInstance', 'schemaResponse_databaseInstance' - The database for a schema in a Fleet Advisor collector inventory.
--
-- 'originalSchema', 'schemaResponse_originalSchema' - Undocumented member.
--
-- 'schemaId', 'schemaResponse_schemaId' - The ID of a schema in a Fleet Advisor collector inventory.
--
-- 'schemaName', 'schemaResponse_schemaName' - The name of a schema in a Fleet Advisor collector inventory.
--
-- 'server', 'schemaResponse_server' - The database server for a schema in a Fleet Advisor collector inventory.
--
-- 'similarity', 'schemaResponse_similarity' - The similarity value for a schema in a Fleet Advisor collector
-- inventory. A higher similarity value indicates that a schema is likely
-- to be a duplicate.
newSchemaResponse ::
  SchemaResponse
newSchemaResponse :: SchemaResponse
newSchemaResponse =
  SchemaResponse'
    { $sel:codeLineCount:SchemaResponse' :: Maybe Integer
codeLineCount = forall a. Maybe a
Prelude.Nothing,
      $sel:codeSize:SchemaResponse' :: Maybe Integer
codeSize = forall a. Maybe a
Prelude.Nothing,
      $sel:complexity:SchemaResponse' :: Maybe Text
complexity = forall a. Maybe a
Prelude.Nothing,
      $sel:databaseInstance:SchemaResponse' :: Maybe DatabaseShortInfoResponse
databaseInstance = forall a. Maybe a
Prelude.Nothing,
      $sel:originalSchema:SchemaResponse' :: Maybe SchemaShortInfoResponse
originalSchema = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaId:SchemaResponse' :: Maybe Text
schemaId = forall a. Maybe a
Prelude.Nothing,
      $sel:schemaName:SchemaResponse' :: Maybe Text
schemaName = forall a. Maybe a
Prelude.Nothing,
      $sel:server:SchemaResponse' :: Maybe ServerShortInfoResponse
server = forall a. Maybe a
Prelude.Nothing,
      $sel:similarity:SchemaResponse' :: Maybe Double
similarity = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of lines of code in a schema in a Fleet Advisor collector
-- inventory.
schemaResponse_codeLineCount :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Integer)
schemaResponse_codeLineCount :: Lens' SchemaResponse (Maybe Integer)
schemaResponse_codeLineCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Integer
codeLineCount :: Maybe Integer
$sel:codeLineCount:SchemaResponse' :: SchemaResponse -> Maybe Integer
codeLineCount} -> Maybe Integer
codeLineCount) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Integer
a -> SchemaResponse
s {$sel:codeLineCount:SchemaResponse' :: Maybe Integer
codeLineCount = Maybe Integer
a} :: SchemaResponse)

-- | The size level of the code in a schema in a Fleet Advisor collector
-- inventory.
schemaResponse_codeSize :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Integer)
schemaResponse_codeSize :: Lens' SchemaResponse (Maybe Integer)
schemaResponse_codeSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Integer
codeSize :: Maybe Integer
$sel:codeSize:SchemaResponse' :: SchemaResponse -> Maybe Integer
codeSize} -> Maybe Integer
codeSize) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Integer
a -> SchemaResponse
s {$sel:codeSize:SchemaResponse' :: Maybe Integer
codeSize = Maybe Integer
a} :: SchemaResponse)

-- | The complexity level of the code in a schema in a Fleet Advisor
-- collector inventory.
schemaResponse_complexity :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Text)
schemaResponse_complexity :: Lens' SchemaResponse (Maybe Text)
schemaResponse_complexity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Text
complexity :: Maybe Text
$sel:complexity:SchemaResponse' :: SchemaResponse -> Maybe Text
complexity} -> Maybe Text
complexity) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Text
a -> SchemaResponse
s {$sel:complexity:SchemaResponse' :: Maybe Text
complexity = Maybe Text
a} :: SchemaResponse)

-- | The database for a schema in a Fleet Advisor collector inventory.
schemaResponse_databaseInstance :: Lens.Lens' SchemaResponse (Prelude.Maybe DatabaseShortInfoResponse)
schemaResponse_databaseInstance :: Lens' SchemaResponse (Maybe DatabaseShortInfoResponse)
schemaResponse_databaseInstance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe DatabaseShortInfoResponse
databaseInstance :: Maybe DatabaseShortInfoResponse
$sel:databaseInstance:SchemaResponse' :: SchemaResponse -> Maybe DatabaseShortInfoResponse
databaseInstance} -> Maybe DatabaseShortInfoResponse
databaseInstance) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe DatabaseShortInfoResponse
a -> SchemaResponse
s {$sel:databaseInstance:SchemaResponse' :: Maybe DatabaseShortInfoResponse
databaseInstance = Maybe DatabaseShortInfoResponse
a} :: SchemaResponse)

-- | Undocumented member.
schemaResponse_originalSchema :: Lens.Lens' SchemaResponse (Prelude.Maybe SchemaShortInfoResponse)
schemaResponse_originalSchema :: Lens' SchemaResponse (Maybe SchemaShortInfoResponse)
schemaResponse_originalSchema = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe SchemaShortInfoResponse
originalSchema :: Maybe SchemaShortInfoResponse
$sel:originalSchema:SchemaResponse' :: SchemaResponse -> Maybe SchemaShortInfoResponse
originalSchema} -> Maybe SchemaShortInfoResponse
originalSchema) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe SchemaShortInfoResponse
a -> SchemaResponse
s {$sel:originalSchema:SchemaResponse' :: Maybe SchemaShortInfoResponse
originalSchema = Maybe SchemaShortInfoResponse
a} :: SchemaResponse)

-- | The ID of a schema in a Fleet Advisor collector inventory.
schemaResponse_schemaId :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Text)
schemaResponse_schemaId :: Lens' SchemaResponse (Maybe Text)
schemaResponse_schemaId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Text
schemaId :: Maybe Text
$sel:schemaId:SchemaResponse' :: SchemaResponse -> Maybe Text
schemaId} -> Maybe Text
schemaId) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Text
a -> SchemaResponse
s {$sel:schemaId:SchemaResponse' :: Maybe Text
schemaId = Maybe Text
a} :: SchemaResponse)

-- | The name of a schema in a Fleet Advisor collector inventory.
schemaResponse_schemaName :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Text)
schemaResponse_schemaName :: Lens' SchemaResponse (Maybe Text)
schemaResponse_schemaName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Text
schemaName :: Maybe Text
$sel:schemaName:SchemaResponse' :: SchemaResponse -> Maybe Text
schemaName} -> Maybe Text
schemaName) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Text
a -> SchemaResponse
s {$sel:schemaName:SchemaResponse' :: Maybe Text
schemaName = Maybe Text
a} :: SchemaResponse)

-- | The database server for a schema in a Fleet Advisor collector inventory.
schemaResponse_server :: Lens.Lens' SchemaResponse (Prelude.Maybe ServerShortInfoResponse)
schemaResponse_server :: Lens' SchemaResponse (Maybe ServerShortInfoResponse)
schemaResponse_server = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe ServerShortInfoResponse
server :: Maybe ServerShortInfoResponse
$sel:server:SchemaResponse' :: SchemaResponse -> Maybe ServerShortInfoResponse
server} -> Maybe ServerShortInfoResponse
server) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe ServerShortInfoResponse
a -> SchemaResponse
s {$sel:server:SchemaResponse' :: Maybe ServerShortInfoResponse
server = Maybe ServerShortInfoResponse
a} :: SchemaResponse)

-- | The similarity value for a schema in a Fleet Advisor collector
-- inventory. A higher similarity value indicates that a schema is likely
-- to be a duplicate.
schemaResponse_similarity :: Lens.Lens' SchemaResponse (Prelude.Maybe Prelude.Double)
schemaResponse_similarity :: Lens' SchemaResponse (Maybe Double)
schemaResponse_similarity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SchemaResponse' {Maybe Double
similarity :: Maybe Double
$sel:similarity:SchemaResponse' :: SchemaResponse -> Maybe Double
similarity} -> Maybe Double
similarity) (\s :: SchemaResponse
s@SchemaResponse' {} Maybe Double
a -> SchemaResponse
s {$sel:similarity:SchemaResponse' :: Maybe Double
similarity = Maybe Double
a} :: SchemaResponse)

instance Data.FromJSON SchemaResponse where
  parseJSON :: Value -> Parser SchemaResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SchemaResponse"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Text
-> Maybe DatabaseShortInfoResponse
-> Maybe SchemaShortInfoResponse
-> Maybe Text
-> Maybe Text
-> Maybe ServerShortInfoResponse
-> Maybe Double
-> SchemaResponse
SchemaResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CodeLineCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CodeSize")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Complexity")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DatabaseInstance")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OriginalSchema")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SchemaId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SchemaName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Server")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Similarity")
      )

instance Prelude.Hashable SchemaResponse where
  hashWithSalt :: Int -> SchemaResponse -> Int
hashWithSalt Int
_salt SchemaResponse' {Maybe Double
Maybe Integer
Maybe Text
Maybe DatabaseShortInfoResponse
Maybe SchemaShortInfoResponse
Maybe ServerShortInfoResponse
similarity :: Maybe Double
server :: Maybe ServerShortInfoResponse
schemaName :: Maybe Text
schemaId :: Maybe Text
originalSchema :: Maybe SchemaShortInfoResponse
databaseInstance :: Maybe DatabaseShortInfoResponse
complexity :: Maybe Text
codeSize :: Maybe Integer
codeLineCount :: Maybe Integer
$sel:similarity:SchemaResponse' :: SchemaResponse -> Maybe Double
$sel:server:SchemaResponse' :: SchemaResponse -> Maybe ServerShortInfoResponse
$sel:schemaName:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:schemaId:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:originalSchema:SchemaResponse' :: SchemaResponse -> Maybe SchemaShortInfoResponse
$sel:databaseInstance:SchemaResponse' :: SchemaResponse -> Maybe DatabaseShortInfoResponse
$sel:complexity:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:codeSize:SchemaResponse' :: SchemaResponse -> Maybe Integer
$sel:codeLineCount:SchemaResponse' :: SchemaResponse -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
codeLineCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
codeSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
complexity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DatabaseShortInfoResponse
databaseInstance
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SchemaShortInfoResponse
originalSchema
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
schemaName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServerShortInfoResponse
server
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
similarity

instance Prelude.NFData SchemaResponse where
  rnf :: SchemaResponse -> ()
rnf SchemaResponse' {Maybe Double
Maybe Integer
Maybe Text
Maybe DatabaseShortInfoResponse
Maybe SchemaShortInfoResponse
Maybe ServerShortInfoResponse
similarity :: Maybe Double
server :: Maybe ServerShortInfoResponse
schemaName :: Maybe Text
schemaId :: Maybe Text
originalSchema :: Maybe SchemaShortInfoResponse
databaseInstance :: Maybe DatabaseShortInfoResponse
complexity :: Maybe Text
codeSize :: Maybe Integer
codeLineCount :: Maybe Integer
$sel:similarity:SchemaResponse' :: SchemaResponse -> Maybe Double
$sel:server:SchemaResponse' :: SchemaResponse -> Maybe ServerShortInfoResponse
$sel:schemaName:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:schemaId:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:originalSchema:SchemaResponse' :: SchemaResponse -> Maybe SchemaShortInfoResponse
$sel:databaseInstance:SchemaResponse' :: SchemaResponse -> Maybe DatabaseShortInfoResponse
$sel:complexity:SchemaResponse' :: SchemaResponse -> Maybe Text
$sel:codeSize:SchemaResponse' :: SchemaResponse -> Maybe Integer
$sel:codeLineCount:SchemaResponse' :: SchemaResponse -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
codeLineCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
codeSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
complexity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DatabaseShortInfoResponse
databaseInstance
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SchemaShortInfoResponse
originalSchema
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
schemaName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServerShortInfoResponse
server
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
similarity