{-# 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.BotChannelAssociation
-- 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.BotChannelAssociation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types.ChannelStatus
import Amazonka.LexModels.Types.ChannelType
import qualified Amazonka.Prelude as Prelude

-- | Represents an association between an Amazon Lex bot and an external
-- messaging platform.
--
-- /See:/ 'newBotChannelAssociation' smart constructor.
data BotChannelAssociation = BotChannelAssociation'
  { -- | If @status@ is @FAILED@, Amazon Lex provides the reason that it failed
    -- to create the association.
    BotChannelAssociation -> Maybe Text
failureReason :: Prelude.Maybe Prelude.Text,
    -- | The status of the bot channel.
    --
    -- -   @CREATED@ - The channel has been created and is ready for use.
    --
    -- -   @IN_PROGRESS@ - Channel creation is in progress.
    --
    -- -   @FAILED@ - There was an error creating the channel. For information
    --     about the reason for the failure, see the @failureReason@ field.
    BotChannelAssociation -> Maybe ChannelStatus
status :: Prelude.Maybe ChannelStatus,
    -- | An alias pointing to the specific version of the Amazon Lex bot to which
    -- this association is being made.
    BotChannelAssociation -> Maybe Text
botAlias :: Prelude.Maybe Prelude.Text,
    -- | The name of the Amazon Lex bot to which this association is being made.
    --
    -- Currently, Amazon Lex supports associations with Facebook and Slack, and
    -- Twilio.
    BotChannelAssociation -> Maybe Text
botName :: Prelude.Maybe Prelude.Text,
    -- | Provides information necessary to communicate with the messaging
    -- platform.
    BotChannelAssociation -> Maybe (Sensitive (HashMap Text Text))
botConfiguration :: Prelude.Maybe (Core.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | The date that the association between the Amazon Lex bot and the channel
    -- was created.
    BotChannelAssociation -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the association between the bot and the channel.
    BotChannelAssociation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Specifies the type of association by indicating the type of channel
    -- being established between the Amazon Lex bot and the external messaging
    -- platform.
    BotChannelAssociation -> Maybe ChannelType
type' :: Prelude.Maybe ChannelType,
    -- | A text description of the association you are creating.
    BotChannelAssociation -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (BotChannelAssociation -> BotChannelAssociation -> Bool
(BotChannelAssociation -> BotChannelAssociation -> Bool)
-> (BotChannelAssociation -> BotChannelAssociation -> Bool)
-> Eq BotChannelAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BotChannelAssociation -> BotChannelAssociation -> Bool
$c/= :: BotChannelAssociation -> BotChannelAssociation -> Bool
== :: BotChannelAssociation -> BotChannelAssociation -> Bool
$c== :: BotChannelAssociation -> BotChannelAssociation -> Bool
Prelude.Eq, Int -> BotChannelAssociation -> ShowS
[BotChannelAssociation] -> ShowS
BotChannelAssociation -> String
(Int -> BotChannelAssociation -> ShowS)
-> (BotChannelAssociation -> String)
-> ([BotChannelAssociation] -> ShowS)
-> Show BotChannelAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BotChannelAssociation] -> ShowS
$cshowList :: [BotChannelAssociation] -> ShowS
show :: BotChannelAssociation -> String
$cshow :: BotChannelAssociation -> String
showsPrec :: Int -> BotChannelAssociation -> ShowS
$cshowsPrec :: Int -> BotChannelAssociation -> ShowS
Prelude.Show, (forall x. BotChannelAssociation -> Rep BotChannelAssociation x)
-> (forall x. Rep BotChannelAssociation x -> BotChannelAssociation)
-> Generic BotChannelAssociation
forall x. Rep BotChannelAssociation x -> BotChannelAssociation
forall x. BotChannelAssociation -> Rep BotChannelAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BotChannelAssociation x -> BotChannelAssociation
$cfrom :: forall x. BotChannelAssociation -> Rep BotChannelAssociation x
Prelude.Generic)

-- |
-- Create a value of 'BotChannelAssociation' 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:
--
-- 'failureReason', 'botChannelAssociation_failureReason' - If @status@ is @FAILED@, Amazon Lex provides the reason that it failed
-- to create the association.
--
-- 'status', 'botChannelAssociation_status' - The status of the bot channel.
--
-- -   @CREATED@ - The channel has been created and is ready for use.
--
-- -   @IN_PROGRESS@ - Channel creation is in progress.
--
-- -   @FAILED@ - There was an error creating the channel. For information
--     about the reason for the failure, see the @failureReason@ field.
--
-- 'botAlias', 'botChannelAssociation_botAlias' - An alias pointing to the specific version of the Amazon Lex bot to which
-- this association is being made.
--
-- 'botName', 'botChannelAssociation_botName' - The name of the Amazon Lex bot to which this association is being made.
--
-- Currently, Amazon Lex supports associations with Facebook and Slack, and
-- Twilio.
--
-- 'botConfiguration', 'botChannelAssociation_botConfiguration' - Provides information necessary to communicate with the messaging
-- platform.
--
-- 'createdDate', 'botChannelAssociation_createdDate' - The date that the association between the Amazon Lex bot and the channel
-- was created.
--
-- 'name', 'botChannelAssociation_name' - The name of the association between the bot and the channel.
--
-- 'type'', 'botChannelAssociation_type' - Specifies the type of association by indicating the type of channel
-- being established between the Amazon Lex bot and the external messaging
-- platform.
--
-- 'description', 'botChannelAssociation_description' - A text description of the association you are creating.
newBotChannelAssociation ::
  BotChannelAssociation
newBotChannelAssociation :: BotChannelAssociation
newBotChannelAssociation =
  BotChannelAssociation' :: Maybe Text
-> Maybe ChannelStatus
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelType
-> Maybe Text
-> BotChannelAssociation
BotChannelAssociation'
    { $sel:failureReason:BotChannelAssociation' :: Maybe Text
failureReason =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:BotChannelAssociation' :: Maybe ChannelStatus
status = Maybe ChannelStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:botAlias:BotChannelAssociation' :: Maybe Text
botAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:botName:BotChannelAssociation' :: Maybe Text
botName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:botConfiguration:BotChannelAssociation' :: Maybe (Sensitive (HashMap Text Text))
botConfiguration = Maybe (Sensitive (HashMap Text Text))
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:BotChannelAssociation' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:name:BotChannelAssociation' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':BotChannelAssociation' :: Maybe ChannelType
type' = Maybe ChannelType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:BotChannelAssociation' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | If @status@ is @FAILED@, Amazon Lex provides the reason that it failed
-- to create the association.
botChannelAssociation_failureReason :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.Text)
botChannelAssociation_failureReason :: (Maybe Text -> f (Maybe Text))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_failureReason = (BotChannelAssociation -> Maybe Text)
-> (BotChannelAssociation -> Maybe Text -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe Text
failureReason :: Maybe Text
$sel:failureReason:BotChannelAssociation' :: BotChannelAssociation -> Maybe Text
failureReason} -> Maybe Text
failureReason) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe Text
a -> BotChannelAssociation
s {$sel:failureReason:BotChannelAssociation' :: Maybe Text
failureReason = Maybe Text
a} :: BotChannelAssociation)

-- | The status of the bot channel.
--
-- -   @CREATED@ - The channel has been created and is ready for use.
--
-- -   @IN_PROGRESS@ - Channel creation is in progress.
--
-- -   @FAILED@ - There was an error creating the channel. For information
--     about the reason for the failure, see the @failureReason@ field.
botChannelAssociation_status :: Lens.Lens' BotChannelAssociation (Prelude.Maybe ChannelStatus)
botChannelAssociation_status :: (Maybe ChannelStatus -> f (Maybe ChannelStatus))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_status = (BotChannelAssociation -> Maybe ChannelStatus)
-> (BotChannelAssociation
    -> Maybe ChannelStatus -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe ChannelStatus)
     (Maybe ChannelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe ChannelStatus
status :: Maybe ChannelStatus
$sel:status:BotChannelAssociation' :: BotChannelAssociation -> Maybe ChannelStatus
status} -> Maybe ChannelStatus
status) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe ChannelStatus
a -> BotChannelAssociation
s {$sel:status:BotChannelAssociation' :: Maybe ChannelStatus
status = Maybe ChannelStatus
a} :: BotChannelAssociation)

-- | An alias pointing to the specific version of the Amazon Lex bot to which
-- this association is being made.
botChannelAssociation_botAlias :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.Text)
botChannelAssociation_botAlias :: (Maybe Text -> f (Maybe Text))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_botAlias = (BotChannelAssociation -> Maybe Text)
-> (BotChannelAssociation -> Maybe Text -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe Text
botAlias :: Maybe Text
$sel:botAlias:BotChannelAssociation' :: BotChannelAssociation -> Maybe Text
botAlias} -> Maybe Text
botAlias) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe Text
a -> BotChannelAssociation
s {$sel:botAlias:BotChannelAssociation' :: Maybe Text
botAlias = Maybe Text
a} :: BotChannelAssociation)

-- | The name of the Amazon Lex bot to which this association is being made.
--
-- Currently, Amazon Lex supports associations with Facebook and Slack, and
-- Twilio.
botChannelAssociation_botName :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.Text)
botChannelAssociation_botName :: (Maybe Text -> f (Maybe Text))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_botName = (BotChannelAssociation -> Maybe Text)
-> (BotChannelAssociation -> Maybe Text -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe Text
botName :: Maybe Text
$sel:botName:BotChannelAssociation' :: BotChannelAssociation -> Maybe Text
botName} -> Maybe Text
botName) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe Text
a -> BotChannelAssociation
s {$sel:botName:BotChannelAssociation' :: Maybe Text
botName = Maybe Text
a} :: BotChannelAssociation)

-- | Provides information necessary to communicate with the messaging
-- platform.
botChannelAssociation_botConfiguration :: Lens.Lens' BotChannelAssociation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
botChannelAssociation_botConfiguration :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_botConfiguration = (BotChannelAssociation -> Maybe (Sensitive (HashMap Text Text)))
-> (BotChannelAssociation
    -> Maybe (Sensitive (HashMap Text Text)) -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (Sensitive (HashMap Text Text)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe (Sensitive (HashMap Text Text))
botConfiguration :: Maybe (Sensitive (HashMap Text Text))
$sel:botConfiguration:BotChannelAssociation' :: BotChannelAssociation -> Maybe (Sensitive (HashMap Text Text))
botConfiguration} -> Maybe (Sensitive (HashMap Text Text))
botConfiguration) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe (Sensitive (HashMap Text Text))
a -> BotChannelAssociation
s {$sel:botConfiguration:BotChannelAssociation' :: Maybe (Sensitive (HashMap Text Text))
botConfiguration = Maybe (Sensitive (HashMap Text Text))
a} :: BotChannelAssociation) ((Maybe (Sensitive (HashMap Text Text))
  -> f (Maybe (Sensitive (HashMap Text Text))))
 -> BotChannelAssociation -> f BotChannelAssociation)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (Sensitive (HashMap Text Text))
    -> f (Maybe (Sensitive (HashMap Text Text))))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> BotChannelAssociation
-> f BotChannelAssociation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (Sensitive (HashMap Text Text)))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive AnIso
  (Sensitive (HashMap Text Text))
  (Sensitive (HashMap Text Text))
  (HashMap Text Text)
  (HashMap Text Text)
-> (Exchange
      (HashMap Text Text)
      (HashMap Text Text)
      (HashMap Text Text)
      (Identity (HashMap Text Text))
    -> Exchange
         (HashMap Text Text)
         (HashMap Text Text)
         (HashMap Text Text)
         (Identity (HashMap Text Text)))
-> AnIso
     (Sensitive (HashMap Text Text))
     (Sensitive (HashMap Text Text))
     (HashMap Text Text)
     (HashMap Text Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Exchange
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (Identity (HashMap Text Text))
-> Exchange
     (HashMap Text Text)
     (HashMap Text Text)
     (HashMap Text Text)
     (Identity (HashMap Text Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The date that the association between the Amazon Lex bot and the channel
-- was created.
botChannelAssociation_createdDate :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.UTCTime)
botChannelAssociation_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_createdDate = (BotChannelAssociation -> Maybe POSIX)
-> (BotChannelAssociation -> Maybe POSIX -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:BotChannelAssociation' :: BotChannelAssociation -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe POSIX
a -> BotChannelAssociation
s {$sel:createdDate:BotChannelAssociation' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: BotChannelAssociation) ((Maybe POSIX -> f (Maybe POSIX))
 -> BotChannelAssociation -> f BotChannelAssociation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BotChannelAssociation
-> f BotChannelAssociation
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 association between the bot and the channel.
botChannelAssociation_name :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.Text)
botChannelAssociation_name :: (Maybe Text -> f (Maybe Text))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_name = (BotChannelAssociation -> Maybe Text)
-> (BotChannelAssociation -> Maybe Text -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe Text
name :: Maybe Text
$sel:name:BotChannelAssociation' :: BotChannelAssociation -> Maybe Text
name} -> Maybe Text
name) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe Text
a -> BotChannelAssociation
s {$sel:name:BotChannelAssociation' :: Maybe Text
name = Maybe Text
a} :: BotChannelAssociation)

-- | Specifies the type of association by indicating the type of channel
-- being established between the Amazon Lex bot and the external messaging
-- platform.
botChannelAssociation_type :: Lens.Lens' BotChannelAssociation (Prelude.Maybe ChannelType)
botChannelAssociation_type :: (Maybe ChannelType -> f (Maybe ChannelType))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_type = (BotChannelAssociation -> Maybe ChannelType)
-> (BotChannelAssociation
    -> Maybe ChannelType -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe ChannelType)
     (Maybe ChannelType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe ChannelType
type' :: Maybe ChannelType
$sel:type':BotChannelAssociation' :: BotChannelAssociation -> Maybe ChannelType
type'} -> Maybe ChannelType
type') (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe ChannelType
a -> BotChannelAssociation
s {$sel:type':BotChannelAssociation' :: Maybe ChannelType
type' = Maybe ChannelType
a} :: BotChannelAssociation)

-- | A text description of the association you are creating.
botChannelAssociation_description :: Lens.Lens' BotChannelAssociation (Prelude.Maybe Prelude.Text)
botChannelAssociation_description :: (Maybe Text -> f (Maybe Text))
-> BotChannelAssociation -> f BotChannelAssociation
botChannelAssociation_description = (BotChannelAssociation -> Maybe Text)
-> (BotChannelAssociation -> Maybe Text -> BotChannelAssociation)
-> Lens
     BotChannelAssociation
     BotChannelAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BotChannelAssociation' {Maybe Text
description :: Maybe Text
$sel:description:BotChannelAssociation' :: BotChannelAssociation -> Maybe Text
description} -> Maybe Text
description) (\s :: BotChannelAssociation
s@BotChannelAssociation' {} Maybe Text
a -> BotChannelAssociation
s {$sel:description:BotChannelAssociation' :: Maybe Text
description = Maybe Text
a} :: BotChannelAssociation)

instance Core.FromJSON BotChannelAssociation where
  parseJSON :: Value -> Parser BotChannelAssociation
parseJSON =
    String
-> (Object -> Parser BotChannelAssociation)
-> Value
-> Parser BotChannelAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BotChannelAssociation"
      ( \Object
x ->
          Maybe Text
-> Maybe ChannelStatus
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe POSIX
-> Maybe Text
-> Maybe ChannelType
-> Maybe Text
-> BotChannelAssociation
BotChannelAssociation'
            (Maybe Text
 -> Maybe ChannelStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive (HashMap Text Text))
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe ChannelType
 -> Maybe Text
 -> BotChannelAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ChannelStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive (HashMap Text Text))
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ChannelType
      -> Maybe Text
      -> BotChannelAssociation)
forall (f :: * -> *) a b. Functor 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
"failureReason")
            Parser
  (Maybe ChannelStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive (HashMap Text Text))
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ChannelType
   -> Maybe Text
   -> BotChannelAssociation)
-> Parser (Maybe ChannelStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive (HashMap Text Text))
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ChannelType
      -> Maybe Text
      -> BotChannelAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive (HashMap Text Text))
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ChannelType
   -> Maybe Text
   -> BotChannelAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive (HashMap Text Text))
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ChannelType
      -> Maybe Text
      -> BotChannelAssociation)
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
"botAlias")
            Parser
  (Maybe Text
   -> Maybe (Sensitive (HashMap Text Text))
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ChannelType
   -> Maybe Text
   -> BotChannelAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive (HashMap Text Text))
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe ChannelType
      -> Maybe Text
      -> BotChannelAssociation)
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
"botName")
            Parser
  (Maybe (Sensitive (HashMap Text Text))
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe ChannelType
   -> Maybe Text
   -> BotChannelAssociation)
-> Parser (Maybe (Sensitive (HashMap Text Text)))
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe ChannelType
      -> Maybe Text
      -> BotChannelAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"botConfiguration"
                            Parser (Maybe (Maybe (Sensitive (HashMap Text Text))))
-> Maybe (Sensitive (HashMap Text Text))
-> Parser (Maybe (Sensitive (HashMap Text Text)))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (Sensitive (HashMap Text Text))
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe ChannelType
   -> Maybe Text
   -> BotChannelAssociation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe ChannelType -> Maybe Text -> BotChannelAssociation)
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
"createdDate")
            Parser
  (Maybe Text
   -> Maybe ChannelType -> Maybe Text -> BotChannelAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ChannelType -> Maybe Text -> BotChannelAssociation)
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 ChannelType -> Maybe Text -> BotChannelAssociation)
-> Parser (Maybe ChannelType)
-> Parser (Maybe Text -> BotChannelAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ChannelType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> BotChannelAssociation)
-> Parser (Maybe Text) -> Parser BotChannelAssociation
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 BotChannelAssociation

instance Prelude.NFData BotChannelAssociation