{-# 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.LexV2Models.Types.SlotTypeSummary
-- 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.LexV2Models.Types.SlotTypeSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.SlotTypeCategory
import qualified Amazonka.Prelude as Prelude

-- | Provides summary information about a slot type.
--
-- /See:/ 'newSlotTypeSummary' smart constructor.
data SlotTypeSummary = SlotTypeSummary'
  { -- | The description of the slot type.
    SlotTypeSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A timestamp of the date and time that the slot type was last updated.
    SlotTypeSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | If the slot type is derived from a built-on slot type, the name of the
    -- parent slot type.
    SlotTypeSummary -> Maybe Text
parentSlotTypeSignature :: Prelude.Maybe Prelude.Text,
    -- | Indicates the type of the slot type.
    --
    -- -   @Custom@ - A slot type that you created using custom values. For
    --     more information, see
    --     <https://docs.aws.amazon.com/lexv2/latest/dg/custom-slot-types.html Creating custom slot types>.
    --
    -- -   @Extended@ - A slot type created by extending the
    --     AMAZON.AlphaNumeric built-in slot type. For more information, see
    --     <https://docs.aws.amazon.com/lexv2/latest/dg/built-in-slot-alphanumerice.html AMAZON.AlphaNumeric>.
    --
    -- -   @ExternalGrammar@ - A slot type using a custom GRXML grammar to
    --     define values. For more information, see
    --     <https://docs.aws.amazon.com/lexv2/latest/dg/building-grxml.html Using a custom grammar slot type>.
    SlotTypeSummary -> Maybe SlotTypeCategory
slotTypeCategory :: Prelude.Maybe SlotTypeCategory,
    -- | The unique identifier assigned to the slot type.
    SlotTypeSummary -> Maybe Text
slotTypeId :: Prelude.Maybe Prelude.Text,
    -- | The name of the slot type.
    SlotTypeSummary -> Maybe Text
slotTypeName :: Prelude.Maybe Prelude.Text
  }
  deriving (SlotTypeSummary -> SlotTypeSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotTypeSummary -> SlotTypeSummary -> Bool
$c/= :: SlotTypeSummary -> SlotTypeSummary -> Bool
== :: SlotTypeSummary -> SlotTypeSummary -> Bool
$c== :: SlotTypeSummary -> SlotTypeSummary -> Bool
Prelude.Eq, ReadPrec [SlotTypeSummary]
ReadPrec SlotTypeSummary
Int -> ReadS SlotTypeSummary
ReadS [SlotTypeSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotTypeSummary]
$creadListPrec :: ReadPrec [SlotTypeSummary]
readPrec :: ReadPrec SlotTypeSummary
$creadPrec :: ReadPrec SlotTypeSummary
readList :: ReadS [SlotTypeSummary]
$creadList :: ReadS [SlotTypeSummary]
readsPrec :: Int -> ReadS SlotTypeSummary
$creadsPrec :: Int -> ReadS SlotTypeSummary
Prelude.Read, Int -> SlotTypeSummary -> ShowS
[SlotTypeSummary] -> ShowS
SlotTypeSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotTypeSummary] -> ShowS
$cshowList :: [SlotTypeSummary] -> ShowS
show :: SlotTypeSummary -> String
$cshow :: SlotTypeSummary -> String
showsPrec :: Int -> SlotTypeSummary -> ShowS
$cshowsPrec :: Int -> SlotTypeSummary -> ShowS
Prelude.Show, forall x. Rep SlotTypeSummary x -> SlotTypeSummary
forall x. SlotTypeSummary -> Rep SlotTypeSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlotTypeSummary x -> SlotTypeSummary
$cfrom :: forall x. SlotTypeSummary -> Rep SlotTypeSummary x
Prelude.Generic)

-- |
-- Create a value of 'SlotTypeSummary' 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:
--
-- 'description', 'slotTypeSummary_description' - The description of the slot type.
--
-- 'lastUpdatedDateTime', 'slotTypeSummary_lastUpdatedDateTime' - A timestamp of the date and time that the slot type was last updated.
--
-- 'parentSlotTypeSignature', 'slotTypeSummary_parentSlotTypeSignature' - If the slot type is derived from a built-on slot type, the name of the
-- parent slot type.
--
-- 'slotTypeCategory', 'slotTypeSummary_slotTypeCategory' - Indicates the type of the slot type.
--
-- -   @Custom@ - A slot type that you created using custom values. For
--     more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/custom-slot-types.html Creating custom slot types>.
--
-- -   @Extended@ - A slot type created by extending the
--     AMAZON.AlphaNumeric built-in slot type. For more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/built-in-slot-alphanumerice.html AMAZON.AlphaNumeric>.
--
-- -   @ExternalGrammar@ - A slot type using a custom GRXML grammar to
--     define values. For more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/building-grxml.html Using a custom grammar slot type>.
--
-- 'slotTypeId', 'slotTypeSummary_slotTypeId' - The unique identifier assigned to the slot type.
--
-- 'slotTypeName', 'slotTypeSummary_slotTypeName' - The name of the slot type.
newSlotTypeSummary ::
  SlotTypeSummary
newSlotTypeSummary :: SlotTypeSummary
newSlotTypeSummary =
  SlotTypeSummary'
    { $sel:description:SlotTypeSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:SlotTypeSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:parentSlotTypeSignature:SlotTypeSummary' :: Maybe Text
parentSlotTypeSignature = forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypeCategory:SlotTypeSummary' :: Maybe SlotTypeCategory
slotTypeCategory = forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypeId:SlotTypeSummary' :: Maybe Text
slotTypeId = forall a. Maybe a
Prelude.Nothing,
      $sel:slotTypeName:SlotTypeSummary' :: Maybe Text
slotTypeName = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the slot type.
slotTypeSummary_description :: Lens.Lens' SlotTypeSummary (Prelude.Maybe Prelude.Text)
slotTypeSummary_description :: Lens' SlotTypeSummary (Maybe Text)
slotTypeSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe Text
description :: Maybe Text
$sel:description:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe Text
a -> SlotTypeSummary
s {$sel:description:SlotTypeSummary' :: Maybe Text
description = Maybe Text
a} :: SlotTypeSummary)

-- | A timestamp of the date and time that the slot type was last updated.
slotTypeSummary_lastUpdatedDateTime :: Lens.Lens' SlotTypeSummary (Prelude.Maybe Prelude.UTCTime)
slotTypeSummary_lastUpdatedDateTime :: Lens' SlotTypeSummary (Maybe UTCTime)
slotTypeSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:SlotTypeSummary' :: SlotTypeSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe POSIX
a -> SlotTypeSummary
s {$sel:lastUpdatedDateTime:SlotTypeSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: SlotTypeSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | If the slot type is derived from a built-on slot type, the name of the
-- parent slot type.
slotTypeSummary_parentSlotTypeSignature :: Lens.Lens' SlotTypeSummary (Prelude.Maybe Prelude.Text)
slotTypeSummary_parentSlotTypeSignature :: Lens' SlotTypeSummary (Maybe Text)
slotTypeSummary_parentSlotTypeSignature = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe Text
parentSlotTypeSignature :: Maybe Text
$sel:parentSlotTypeSignature:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
parentSlotTypeSignature} -> Maybe Text
parentSlotTypeSignature) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe Text
a -> SlotTypeSummary
s {$sel:parentSlotTypeSignature:SlotTypeSummary' :: Maybe Text
parentSlotTypeSignature = Maybe Text
a} :: SlotTypeSummary)

-- | Indicates the type of the slot type.
--
-- -   @Custom@ - A slot type that you created using custom values. For
--     more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/custom-slot-types.html Creating custom slot types>.
--
-- -   @Extended@ - A slot type created by extending the
--     AMAZON.AlphaNumeric built-in slot type. For more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/built-in-slot-alphanumerice.html AMAZON.AlphaNumeric>.
--
-- -   @ExternalGrammar@ - A slot type using a custom GRXML grammar to
--     define values. For more information, see
--     <https://docs.aws.amazon.com/lexv2/latest/dg/building-grxml.html Using a custom grammar slot type>.
slotTypeSummary_slotTypeCategory :: Lens.Lens' SlotTypeSummary (Prelude.Maybe SlotTypeCategory)
slotTypeSummary_slotTypeCategory :: Lens' SlotTypeSummary (Maybe SlotTypeCategory)
slotTypeSummary_slotTypeCategory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe SlotTypeCategory
slotTypeCategory :: Maybe SlotTypeCategory
$sel:slotTypeCategory:SlotTypeSummary' :: SlotTypeSummary -> Maybe SlotTypeCategory
slotTypeCategory} -> Maybe SlotTypeCategory
slotTypeCategory) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe SlotTypeCategory
a -> SlotTypeSummary
s {$sel:slotTypeCategory:SlotTypeSummary' :: Maybe SlotTypeCategory
slotTypeCategory = Maybe SlotTypeCategory
a} :: SlotTypeSummary)

-- | The unique identifier assigned to the slot type.
slotTypeSummary_slotTypeId :: Lens.Lens' SlotTypeSummary (Prelude.Maybe Prelude.Text)
slotTypeSummary_slotTypeId :: Lens' SlotTypeSummary (Maybe Text)
slotTypeSummary_slotTypeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe Text
slotTypeId :: Maybe Text
$sel:slotTypeId:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
slotTypeId} -> Maybe Text
slotTypeId) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe Text
a -> SlotTypeSummary
s {$sel:slotTypeId:SlotTypeSummary' :: Maybe Text
slotTypeId = Maybe Text
a} :: SlotTypeSummary)

-- | The name of the slot type.
slotTypeSummary_slotTypeName :: Lens.Lens' SlotTypeSummary (Prelude.Maybe Prelude.Text)
slotTypeSummary_slotTypeName :: Lens' SlotTypeSummary (Maybe Text)
slotTypeSummary_slotTypeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeSummary' {Maybe Text
slotTypeName :: Maybe Text
$sel:slotTypeName:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
slotTypeName} -> Maybe Text
slotTypeName) (\s :: SlotTypeSummary
s@SlotTypeSummary' {} Maybe Text
a -> SlotTypeSummary
s {$sel:slotTypeName:SlotTypeSummary' :: Maybe Text
slotTypeName = Maybe Text
a} :: SlotTypeSummary)

instance Data.FromJSON SlotTypeSummary where
  parseJSON :: Value -> Parser SlotTypeSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SlotTypeSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe SlotTypeCategory
-> Maybe Text
-> Maybe Text
-> SlotTypeSummary
SlotTypeSummary'
            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
"description")
            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
"lastUpdatedDateTime")
            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
"parentSlotTypeSignature")
            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
"slotTypeCategory")
            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
"slotTypeId")
            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
"slotTypeName")
      )

instance Prelude.Hashable SlotTypeSummary where
  hashWithSalt :: Int -> SlotTypeSummary -> Int
hashWithSalt Int
_salt SlotTypeSummary' {Maybe Text
Maybe POSIX
Maybe SlotTypeCategory
slotTypeName :: Maybe Text
slotTypeId :: Maybe Text
slotTypeCategory :: Maybe SlotTypeCategory
parentSlotTypeSignature :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
$sel:slotTypeName:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:slotTypeId:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:slotTypeCategory:SlotTypeSummary' :: SlotTypeSummary -> Maybe SlotTypeCategory
$sel:parentSlotTypeSignature:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:lastUpdatedDateTime:SlotTypeSummary' :: SlotTypeSummary -> Maybe POSIX
$sel:description:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parentSlotTypeSignature
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SlotTypeCategory
slotTypeCategory
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
slotTypeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
slotTypeName

instance Prelude.NFData SlotTypeSummary where
  rnf :: SlotTypeSummary -> ()
rnf SlotTypeSummary' {Maybe Text
Maybe POSIX
Maybe SlotTypeCategory
slotTypeName :: Maybe Text
slotTypeId :: Maybe Text
slotTypeCategory :: Maybe SlotTypeCategory
parentSlotTypeSignature :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
description :: Maybe Text
$sel:slotTypeName:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:slotTypeId:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:slotTypeCategory:SlotTypeSummary' :: SlotTypeSummary -> Maybe SlotTypeCategory
$sel:parentSlotTypeSignature:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
$sel:lastUpdatedDateTime:SlotTypeSummary' :: SlotTypeSummary -> Maybe POSIX
$sel:description:SlotTypeSummary' :: SlotTypeSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parentSlotTypeSignature
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SlotTypeCategory
slotTypeCategory
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
slotTypeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
slotTypeName