{-# 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.Comprehend.Types.EntityRecognizerEntityList
-- 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)
module Amazonka.Comprehend.Types.EntityRecognizerEntityList where

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

-- | Describes the entity recognizer submitted with an entity recognizer.
--
-- /See:/ 'newEntityRecognizerEntityList' smart constructor.
data EntityRecognizerEntityList = EntityRecognizerEntityList'
  { -- | Specifies the Amazon S3 location where the entity list is located. The
    -- URI must be in the same region as the API endpoint that you are calling.
    EntityRecognizerEntityList -> Text
s3Uri :: Prelude.Text
  }
  deriving (EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool
(EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool)
-> (EntityRecognizerEntityList
    -> EntityRecognizerEntityList -> Bool)
-> Eq EntityRecognizerEntityList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool
$c/= :: EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool
== :: EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool
$c== :: EntityRecognizerEntityList -> EntityRecognizerEntityList -> Bool
Prelude.Eq, ReadPrec [EntityRecognizerEntityList]
ReadPrec EntityRecognizerEntityList
Int -> ReadS EntityRecognizerEntityList
ReadS [EntityRecognizerEntityList]
(Int -> ReadS EntityRecognizerEntityList)
-> ReadS [EntityRecognizerEntityList]
-> ReadPrec EntityRecognizerEntityList
-> ReadPrec [EntityRecognizerEntityList]
-> Read EntityRecognizerEntityList
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntityRecognizerEntityList]
$creadListPrec :: ReadPrec [EntityRecognizerEntityList]
readPrec :: ReadPrec EntityRecognizerEntityList
$creadPrec :: ReadPrec EntityRecognizerEntityList
readList :: ReadS [EntityRecognizerEntityList]
$creadList :: ReadS [EntityRecognizerEntityList]
readsPrec :: Int -> ReadS EntityRecognizerEntityList
$creadsPrec :: Int -> ReadS EntityRecognizerEntityList
Prelude.Read, Int -> EntityRecognizerEntityList -> ShowS
[EntityRecognizerEntityList] -> ShowS
EntityRecognizerEntityList -> String
(Int -> EntityRecognizerEntityList -> ShowS)
-> (EntityRecognizerEntityList -> String)
-> ([EntityRecognizerEntityList] -> ShowS)
-> Show EntityRecognizerEntityList
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntityRecognizerEntityList] -> ShowS
$cshowList :: [EntityRecognizerEntityList] -> ShowS
show :: EntityRecognizerEntityList -> String
$cshow :: EntityRecognizerEntityList -> String
showsPrec :: Int -> EntityRecognizerEntityList -> ShowS
$cshowsPrec :: Int -> EntityRecognizerEntityList -> ShowS
Prelude.Show, (forall x.
 EntityRecognizerEntityList -> Rep EntityRecognizerEntityList x)
-> (forall x.
    Rep EntityRecognizerEntityList x -> EntityRecognizerEntityList)
-> Generic EntityRecognizerEntityList
forall x.
Rep EntityRecognizerEntityList x -> EntityRecognizerEntityList
forall x.
EntityRecognizerEntityList -> Rep EntityRecognizerEntityList x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EntityRecognizerEntityList x -> EntityRecognizerEntityList
$cfrom :: forall x.
EntityRecognizerEntityList -> Rep EntityRecognizerEntityList x
Prelude.Generic)

-- |
-- Create a value of 'EntityRecognizerEntityList' 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:
--
-- 's3Uri', 'entityRecognizerEntityList_s3Uri' - Specifies the Amazon S3 location where the entity list is located. The
-- URI must be in the same region as the API endpoint that you are calling.
newEntityRecognizerEntityList ::
  -- | 's3Uri'
  Prelude.Text ->
  EntityRecognizerEntityList
newEntityRecognizerEntityList :: Text -> EntityRecognizerEntityList
newEntityRecognizerEntityList Text
pS3Uri_ =
  EntityRecognizerEntityList' :: Text -> EntityRecognizerEntityList
EntityRecognizerEntityList' {$sel:s3Uri:EntityRecognizerEntityList' :: Text
s3Uri = Text
pS3Uri_}

-- | Specifies the Amazon S3 location where the entity list is located. The
-- URI must be in the same region as the API endpoint that you are calling.
entityRecognizerEntityList_s3Uri :: Lens.Lens' EntityRecognizerEntityList Prelude.Text
entityRecognizerEntityList_s3Uri :: (Text -> f Text)
-> EntityRecognizerEntityList -> f EntityRecognizerEntityList
entityRecognizerEntityList_s3Uri = (EntityRecognizerEntityList -> Text)
-> (EntityRecognizerEntityList
    -> Text -> EntityRecognizerEntityList)
-> Lens
     EntityRecognizerEntityList EntityRecognizerEntityList Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntityRecognizerEntityList' {Text
s3Uri :: Text
$sel:s3Uri:EntityRecognizerEntityList' :: EntityRecognizerEntityList -> Text
s3Uri} -> Text
s3Uri) (\s :: EntityRecognizerEntityList
s@EntityRecognizerEntityList' {} Text
a -> EntityRecognizerEntityList
s {$sel:s3Uri:EntityRecognizerEntityList' :: Text
s3Uri = Text
a} :: EntityRecognizerEntityList)

instance Core.FromJSON EntityRecognizerEntityList where
  parseJSON :: Value -> Parser EntityRecognizerEntityList
parseJSON =
    String
-> (Object -> Parser EntityRecognizerEntityList)
-> Value
-> Parser EntityRecognizerEntityList
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EntityRecognizerEntityList"
      ( \Object
x ->
          Text -> EntityRecognizerEntityList
EntityRecognizerEntityList'
            (Text -> EntityRecognizerEntityList)
-> Parser Text -> Parser EntityRecognizerEntityList
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Uri")
      )

instance Prelude.Hashable EntityRecognizerEntityList

instance Prelude.NFData EntityRecognizerEntityList

instance Core.ToJSON EntityRecognizerEntityList where
  toJSON :: EntityRecognizerEntityList -> Value
toJSON EntityRecognizerEntityList' {Text
s3Uri :: Text
$sel:s3Uri:EntityRecognizerEntityList' :: EntityRecognizerEntityList -> Text
..} =
    [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
"S3Uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3Uri)]
      )