{-# 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.BotLocaleSummary
-- 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.BotLocaleSummary 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.BotLocaleStatus
import qualified Amazonka.Prelude as Prelude

-- | Summary information about bot locales returned by the
-- <https://docs.aws.amazon.com/lexv2/latest/dg/API_ListBotLocales.html ListBotLocales>
-- operation.
--
-- /See:/ 'newBotLocaleSummary' smart constructor.
data BotLocaleSummary = BotLocaleSummary'
  { -- | The current status of the bot locale. When the status is @Built@ the
    -- locale is ready for use.
    BotLocaleSummary -> Maybe BotLocaleStatus
botLocaleStatus :: Prelude.Maybe BotLocaleStatus,
    -- | The description of the bot locale.
    BotLocaleSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A timestamp of the date and time that the bot locale was last built.
    BotLocaleSummary -> Maybe POSIX
lastBuildSubmittedDateTime :: Prelude.Maybe Data.POSIX,
    -- | A timestamp of the date and time that the bot locale was last updated.
    BotLocaleSummary -> Maybe POSIX
lastUpdatedDateTime :: Prelude.Maybe Data.POSIX,
    -- | The language and locale of the bot locale.
    BotLocaleSummary -> Maybe Text
localeId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bot locale.
    BotLocaleSummary -> Maybe Text
localeName :: Prelude.Maybe Prelude.Text
  }
  deriving (BotLocaleSummary -> BotLocaleSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotLocaleSummary -> BotLocaleSummary -> Bool
$c/= :: BotLocaleSummary -> BotLocaleSummary -> Bool
== :: BotLocaleSummary -> BotLocaleSummary -> Bool
$c== :: BotLocaleSummary -> BotLocaleSummary -> Bool
Prelude.Eq, ReadPrec [BotLocaleSummary]
ReadPrec BotLocaleSummary
Int -> ReadS BotLocaleSummary
ReadS [BotLocaleSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BotLocaleSummary]
$creadListPrec :: ReadPrec [BotLocaleSummary]
readPrec :: ReadPrec BotLocaleSummary
$creadPrec :: ReadPrec BotLocaleSummary
readList :: ReadS [BotLocaleSummary]
$creadList :: ReadS [BotLocaleSummary]
readsPrec :: Int -> ReadS BotLocaleSummary
$creadsPrec :: Int -> ReadS BotLocaleSummary
Prelude.Read, Int -> BotLocaleSummary -> ShowS
[BotLocaleSummary] -> ShowS
BotLocaleSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotLocaleSummary] -> ShowS
$cshowList :: [BotLocaleSummary] -> ShowS
show :: BotLocaleSummary -> String
$cshow :: BotLocaleSummary -> String
showsPrec :: Int -> BotLocaleSummary -> ShowS
$cshowsPrec :: Int -> BotLocaleSummary -> ShowS
Prelude.Show, forall x. Rep BotLocaleSummary x -> BotLocaleSummary
forall x. BotLocaleSummary -> Rep BotLocaleSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotLocaleSummary x -> BotLocaleSummary
$cfrom :: forall x. BotLocaleSummary -> Rep BotLocaleSummary x
Prelude.Generic)

-- |
-- Create a value of 'BotLocaleSummary' 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:
--
-- 'botLocaleStatus', 'botLocaleSummary_botLocaleStatus' - The current status of the bot locale. When the status is @Built@ the
-- locale is ready for use.
--
-- 'description', 'botLocaleSummary_description' - The description of the bot locale.
--
-- 'lastBuildSubmittedDateTime', 'botLocaleSummary_lastBuildSubmittedDateTime' - A timestamp of the date and time that the bot locale was last built.
--
-- 'lastUpdatedDateTime', 'botLocaleSummary_lastUpdatedDateTime' - A timestamp of the date and time that the bot locale was last updated.
--
-- 'localeId', 'botLocaleSummary_localeId' - The language and locale of the bot locale.
--
-- 'localeName', 'botLocaleSummary_localeName' - The name of the bot locale.
newBotLocaleSummary ::
  BotLocaleSummary
newBotLocaleSummary :: BotLocaleSummary
newBotLocaleSummary =
  BotLocaleSummary'
    { $sel:botLocaleStatus:BotLocaleSummary' :: Maybe BotLocaleStatus
botLocaleStatus =
        forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotLocaleSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lastBuildSubmittedDateTime:BotLocaleSummary' :: Maybe POSIX
lastBuildSubmittedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:BotLocaleSummary' :: Maybe POSIX
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:localeId:BotLocaleSummary' :: Maybe Text
localeId = forall a. Maybe a
Prelude.Nothing,
      $sel:localeName:BotLocaleSummary' :: Maybe Text
localeName = forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the bot locale. When the status is @Built@ the
-- locale is ready for use.
botLocaleSummary_botLocaleStatus :: Lens.Lens' BotLocaleSummary (Prelude.Maybe BotLocaleStatus)
botLocaleSummary_botLocaleStatus :: Lens' BotLocaleSummary (Maybe BotLocaleStatus)
botLocaleSummary_botLocaleStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe BotLocaleStatus
botLocaleStatus :: Maybe BotLocaleStatus
$sel:botLocaleStatus:BotLocaleSummary' :: BotLocaleSummary -> Maybe BotLocaleStatus
botLocaleStatus} -> Maybe BotLocaleStatus
botLocaleStatus) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe BotLocaleStatus
a -> BotLocaleSummary
s {$sel:botLocaleStatus:BotLocaleSummary' :: Maybe BotLocaleStatus
botLocaleStatus = Maybe BotLocaleStatus
a} :: BotLocaleSummary)

-- | The description of the bot locale.
botLocaleSummary_description :: Lens.Lens' BotLocaleSummary (Prelude.Maybe Prelude.Text)
botLocaleSummary_description :: Lens' BotLocaleSummary (Maybe Text)
botLocaleSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe Text
description :: Maybe Text
$sel:description:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe Text
a -> BotLocaleSummary
s {$sel:description:BotLocaleSummary' :: Maybe Text
description = Maybe Text
a} :: BotLocaleSummary)

-- | A timestamp of the date and time that the bot locale was last built.
botLocaleSummary_lastBuildSubmittedDateTime :: Lens.Lens' BotLocaleSummary (Prelude.Maybe Prelude.UTCTime)
botLocaleSummary_lastBuildSubmittedDateTime :: Lens' BotLocaleSummary (Maybe UTCTime)
botLocaleSummary_lastBuildSubmittedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe POSIX
lastBuildSubmittedDateTime :: Maybe POSIX
$sel:lastBuildSubmittedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
lastBuildSubmittedDateTime} -> Maybe POSIX
lastBuildSubmittedDateTime) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe POSIX
a -> BotLocaleSummary
s {$sel:lastBuildSubmittedDateTime:BotLocaleSummary' :: Maybe POSIX
lastBuildSubmittedDateTime = Maybe POSIX
a} :: BotLocaleSummary) 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

-- | A timestamp of the date and time that the bot locale was last updated.
botLocaleSummary_lastUpdatedDateTime :: Lens.Lens' BotLocaleSummary (Prelude.Maybe Prelude.UTCTime)
botLocaleSummary_lastUpdatedDateTime :: Lens' BotLocaleSummary (Maybe UTCTime)
botLocaleSummary_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe POSIX
lastUpdatedDateTime :: Maybe POSIX
$sel:lastUpdatedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
lastUpdatedDateTime} -> Maybe POSIX
lastUpdatedDateTime) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe POSIX
a -> BotLocaleSummary
s {$sel:lastUpdatedDateTime:BotLocaleSummary' :: Maybe POSIX
lastUpdatedDateTime = Maybe POSIX
a} :: BotLocaleSummary) 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

-- | The language and locale of the bot locale.
botLocaleSummary_localeId :: Lens.Lens' BotLocaleSummary (Prelude.Maybe Prelude.Text)
botLocaleSummary_localeId :: Lens' BotLocaleSummary (Maybe Text)
botLocaleSummary_localeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe Text
localeId :: Maybe Text
$sel:localeId:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
localeId} -> Maybe Text
localeId) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe Text
a -> BotLocaleSummary
s {$sel:localeId:BotLocaleSummary' :: Maybe Text
localeId = Maybe Text
a} :: BotLocaleSummary)

-- | The name of the bot locale.
botLocaleSummary_localeName :: Lens.Lens' BotLocaleSummary (Prelude.Maybe Prelude.Text)
botLocaleSummary_localeName :: Lens' BotLocaleSummary (Maybe Text)
botLocaleSummary_localeName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotLocaleSummary' {Maybe Text
localeName :: Maybe Text
$sel:localeName:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
localeName} -> Maybe Text
localeName) (\s :: BotLocaleSummary
s@BotLocaleSummary' {} Maybe Text
a -> BotLocaleSummary
s {$sel:localeName:BotLocaleSummary' :: Maybe Text
localeName = Maybe Text
a} :: BotLocaleSummary)

instance Data.FromJSON BotLocaleSummary where
  parseJSON :: Value -> Parser BotLocaleSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BotLocaleSummary"
      ( \Object
x ->
          Maybe BotLocaleStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> BotLocaleSummary
BotLocaleSummary'
            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
"botLocaleStatus")
            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
"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
"lastBuildSubmittedDateTime")
            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
"localeId")
            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
"localeName")
      )

instance Prelude.Hashable BotLocaleSummary where
  hashWithSalt :: Int -> BotLocaleSummary -> Int
hashWithSalt Int
_salt BotLocaleSummary' {Maybe Text
Maybe POSIX
Maybe BotLocaleStatus
localeName :: Maybe Text
localeId :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
lastBuildSubmittedDateTime :: Maybe POSIX
description :: Maybe Text
botLocaleStatus :: Maybe BotLocaleStatus
$sel:localeName:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:localeId:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:lastUpdatedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
$sel:lastBuildSubmittedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
$sel:description:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:botLocaleStatus:BotLocaleSummary' :: BotLocaleSummary -> Maybe BotLocaleStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BotLocaleStatus
botLocaleStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastBuildSubmittedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
localeId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
localeName

instance Prelude.NFData BotLocaleSummary where
  rnf :: BotLocaleSummary -> ()
rnf BotLocaleSummary' {Maybe Text
Maybe POSIX
Maybe BotLocaleStatus
localeName :: Maybe Text
localeId :: Maybe Text
lastUpdatedDateTime :: Maybe POSIX
lastBuildSubmittedDateTime :: Maybe POSIX
description :: Maybe Text
botLocaleStatus :: Maybe BotLocaleStatus
$sel:localeName:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:localeId:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:lastUpdatedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
$sel:lastBuildSubmittedDateTime:BotLocaleSummary' :: BotLocaleSummary -> Maybe POSIX
$sel:description:BotLocaleSummary' :: BotLocaleSummary -> Maybe Text
$sel:botLocaleStatus:BotLocaleSummary' :: BotLocaleSummary -> Maybe BotLocaleStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe BotLocaleStatus
botLocaleStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
lastBuildSubmittedDateTime
      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
localeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
localeName