{-# 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.LexModels.Types.SlotTypeMetadata
-- 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.LexModels.Types.SlotTypeMetadata where

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

-- | Provides information about a slot type..
--
-- /See:/ 'newSlotTypeMetadata' smart constructor.
data SlotTypeMetadata = SlotTypeMetadata'
  { -- | The date that the slot type was created.
    SlotTypeMetadata -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the slot type.
    SlotTypeMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version of the slot type.
    SlotTypeMetadata -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The date that the slot type was updated. When you create a resource, the
    -- creation date and last updated date are the same.
    SlotTypeMetadata -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX,
    -- | A description of the slot type.
    SlotTypeMetadata -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (SlotTypeMetadata -> SlotTypeMetadata -> Bool
(SlotTypeMetadata -> SlotTypeMetadata -> Bool)
-> (SlotTypeMetadata -> SlotTypeMetadata -> Bool)
-> Eq SlotTypeMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlotTypeMetadata -> SlotTypeMetadata -> Bool
$c/= :: SlotTypeMetadata -> SlotTypeMetadata -> Bool
== :: SlotTypeMetadata -> SlotTypeMetadata -> Bool
$c== :: SlotTypeMetadata -> SlotTypeMetadata -> Bool
Prelude.Eq, ReadPrec [SlotTypeMetadata]
ReadPrec SlotTypeMetadata
Int -> ReadS SlotTypeMetadata
ReadS [SlotTypeMetadata]
(Int -> ReadS SlotTypeMetadata)
-> ReadS [SlotTypeMetadata]
-> ReadPrec SlotTypeMetadata
-> ReadPrec [SlotTypeMetadata]
-> Read SlotTypeMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlotTypeMetadata]
$creadListPrec :: ReadPrec [SlotTypeMetadata]
readPrec :: ReadPrec SlotTypeMetadata
$creadPrec :: ReadPrec SlotTypeMetadata
readList :: ReadS [SlotTypeMetadata]
$creadList :: ReadS [SlotTypeMetadata]
readsPrec :: Int -> ReadS SlotTypeMetadata
$creadsPrec :: Int -> ReadS SlotTypeMetadata
Prelude.Read, Int -> SlotTypeMetadata -> ShowS
[SlotTypeMetadata] -> ShowS
SlotTypeMetadata -> String
(Int -> SlotTypeMetadata -> ShowS)
-> (SlotTypeMetadata -> String)
-> ([SlotTypeMetadata] -> ShowS)
-> Show SlotTypeMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlotTypeMetadata] -> ShowS
$cshowList :: [SlotTypeMetadata] -> ShowS
show :: SlotTypeMetadata -> String
$cshow :: SlotTypeMetadata -> String
showsPrec :: Int -> SlotTypeMetadata -> ShowS
$cshowsPrec :: Int -> SlotTypeMetadata -> ShowS
Prelude.Show, (forall x. SlotTypeMetadata -> Rep SlotTypeMetadata x)
-> (forall x. Rep SlotTypeMetadata x -> SlotTypeMetadata)
-> Generic SlotTypeMetadata
forall x. Rep SlotTypeMetadata x -> SlotTypeMetadata
forall x. SlotTypeMetadata -> Rep SlotTypeMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlotTypeMetadata x -> SlotTypeMetadata
$cfrom :: forall x. SlotTypeMetadata -> Rep SlotTypeMetadata x
Prelude.Generic)

-- |
-- Create a value of 'SlotTypeMetadata' 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:
--
-- 'createdDate', 'slotTypeMetadata_createdDate' - The date that the slot type was created.
--
-- 'name', 'slotTypeMetadata_name' - The name of the slot type.
--
-- 'version', 'slotTypeMetadata_version' - The version of the slot type.
--
-- 'lastUpdatedDate', 'slotTypeMetadata_lastUpdatedDate' - The date that the slot type was updated. When you create a resource, the
-- creation date and last updated date are the same.
--
-- 'description', 'slotTypeMetadata_description' - A description of the slot type.
newSlotTypeMetadata ::
  SlotTypeMetadata
newSlotTypeMetadata :: SlotTypeMetadata
newSlotTypeMetadata =
  SlotTypeMetadata' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> SlotTypeMetadata
SlotTypeMetadata'
    { $sel:createdDate:SlotTypeMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:SlotTypeMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:SlotTypeMetadata' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDate:SlotTypeMetadata' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:SlotTypeMetadata' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The date that the slot type was created.
slotTypeMetadata_createdDate :: Lens.Lens' SlotTypeMetadata (Prelude.Maybe Prelude.UTCTime)
slotTypeMetadata_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SlotTypeMetadata -> f SlotTypeMetadata
slotTypeMetadata_createdDate = (SlotTypeMetadata -> Maybe POSIX)
-> (SlotTypeMetadata -> Maybe POSIX -> SlotTypeMetadata)
-> Lens
     SlotTypeMetadata SlotTypeMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeMetadata' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:SlotTypeMetadata' :: SlotTypeMetadata -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: SlotTypeMetadata
s@SlotTypeMetadata' {} Maybe POSIX
a -> SlotTypeMetadata
s {$sel:createdDate:SlotTypeMetadata' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: SlotTypeMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> SlotTypeMetadata -> f SlotTypeMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SlotTypeMetadata
-> f SlotTypeMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

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

-- | The date that the slot type was updated. When you create a resource, the
-- creation date and last updated date are the same.
slotTypeMetadata_lastUpdatedDate :: Lens.Lens' SlotTypeMetadata (Prelude.Maybe Prelude.UTCTime)
slotTypeMetadata_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SlotTypeMetadata -> f SlotTypeMetadata
slotTypeMetadata_lastUpdatedDate = (SlotTypeMetadata -> Maybe POSIX)
-> (SlotTypeMetadata -> Maybe POSIX -> SlotTypeMetadata)
-> Lens
     SlotTypeMetadata SlotTypeMetadata (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlotTypeMetadata' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:SlotTypeMetadata' :: SlotTypeMetadata -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: SlotTypeMetadata
s@SlotTypeMetadata' {} Maybe POSIX
a -> SlotTypeMetadata
s {$sel:lastUpdatedDate:SlotTypeMetadata' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: SlotTypeMetadata) ((Maybe POSIX -> f (Maybe POSIX))
 -> SlotTypeMetadata -> f SlotTypeMetadata)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SlotTypeMetadata
-> f SlotTypeMetadata
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

instance Core.FromJSON SlotTypeMetadata where
  parseJSON :: Value -> Parser SlotTypeMetadata
parseJSON =
    String
-> (Object -> Parser SlotTypeMetadata)
-> Value
-> Parser SlotTypeMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SlotTypeMetadata"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> SlotTypeMetadata
SlotTypeMetadata'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> SlotTypeMetadata)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdDate")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"name")
            Parser
  (Maybe Text -> Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"version")
            Parser (Maybe POSIX -> Maybe Text -> SlotTypeMetadata)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> SlotTypeMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedDate")
            Parser (Maybe Text -> SlotTypeMetadata)
-> Parser (Maybe Text) -> Parser SlotTypeMetadata
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
      )

instance Prelude.Hashable SlotTypeMetadata

instance Prelude.NFData SlotTypeMetadata