{-# 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.ComprehendMedical.Types.Characters
-- 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.ComprehendMedical.Types.Characters where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | The number of characters in the input text to be analyzed.
--
-- /See:/ 'newCharacters' smart constructor.
data Characters = Characters'
  { -- | The number of characters present in the input text document as processed
    -- by Comprehend Medical.
    Characters -> Maybe Int
originalTextCharacters :: Prelude.Maybe Prelude.Int
  }
  deriving (Characters -> Characters -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Characters -> Characters -> Bool
$c/= :: Characters -> Characters -> Bool
== :: Characters -> Characters -> Bool
$c== :: Characters -> Characters -> Bool
Prelude.Eq, ReadPrec [Characters]
ReadPrec Characters
Int -> ReadS Characters
ReadS [Characters]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Characters]
$creadListPrec :: ReadPrec [Characters]
readPrec :: ReadPrec Characters
$creadPrec :: ReadPrec Characters
readList :: ReadS [Characters]
$creadList :: ReadS [Characters]
readsPrec :: Int -> ReadS Characters
$creadsPrec :: Int -> ReadS Characters
Prelude.Read, Int -> Characters -> ShowS
[Characters] -> ShowS
Characters -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Characters] -> ShowS
$cshowList :: [Characters] -> ShowS
show :: Characters -> String
$cshow :: Characters -> String
showsPrec :: Int -> Characters -> ShowS
$cshowsPrec :: Int -> Characters -> ShowS
Prelude.Show, forall x. Rep Characters x -> Characters
forall x. Characters -> Rep Characters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Characters x -> Characters
$cfrom :: forall x. Characters -> Rep Characters x
Prelude.Generic)

-- |
-- Create a value of 'Characters' 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:
--
-- 'originalTextCharacters', 'characters_originalTextCharacters' - The number of characters present in the input text document as processed
-- by Comprehend Medical.
newCharacters ::
  Characters
newCharacters :: Characters
newCharacters =
  Characters'
    { $sel:originalTextCharacters:Characters' :: Maybe Int
originalTextCharacters =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The number of characters present in the input text document as processed
-- by Comprehend Medical.
characters_originalTextCharacters :: Lens.Lens' Characters (Prelude.Maybe Prelude.Int)
characters_originalTextCharacters :: Lens' Characters (Maybe Int)
characters_originalTextCharacters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Characters' {Maybe Int
originalTextCharacters :: Maybe Int
$sel:originalTextCharacters:Characters' :: Characters -> Maybe Int
originalTextCharacters} -> Maybe Int
originalTextCharacters) (\s :: Characters
s@Characters' {} Maybe Int
a -> Characters
s {$sel:originalTextCharacters:Characters' :: Maybe Int
originalTextCharacters = Maybe Int
a} :: Characters)

instance Data.FromJSON Characters where
  parseJSON :: Value -> Parser Characters
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Characters"
      ( \Object
x ->
          Maybe Int -> Characters
Characters'
            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
"OriginalTextCharacters")
      )

instance Prelude.Hashable Characters where
  hashWithSalt :: Int -> Characters -> Int
hashWithSalt Int
_salt Characters' {Maybe Int
originalTextCharacters :: Maybe Int
$sel:originalTextCharacters:Characters' :: Characters -> Maybe Int
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
originalTextCharacters

instance Prelude.NFData Characters where
  rnf :: Characters -> ()
rnf Characters' {Maybe Int
originalTextCharacters :: Maybe Int
$sel:originalTextCharacters:Characters' :: Characters -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
originalTextCharacters