{-# 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 #-}
module Amazonka.SSMIncidents.Types.ChatChannel where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSMIncidents.Types.EmptyChatChannel
data ChatChannel = ChatChannel'
{
ChatChannel -> Maybe (NonEmpty Text)
chatbotSns :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
ChatChannel -> Maybe EmptyChatChannel
empty :: Prelude.Maybe EmptyChatChannel
}
deriving (ChatChannel -> ChatChannel -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChatChannel -> ChatChannel -> Bool
$c/= :: ChatChannel -> ChatChannel -> Bool
== :: ChatChannel -> ChatChannel -> Bool
$c== :: ChatChannel -> ChatChannel -> Bool
Prelude.Eq, ReadPrec [ChatChannel]
ReadPrec ChatChannel
Int -> ReadS ChatChannel
ReadS [ChatChannel]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChatChannel]
$creadListPrec :: ReadPrec [ChatChannel]
readPrec :: ReadPrec ChatChannel
$creadPrec :: ReadPrec ChatChannel
readList :: ReadS [ChatChannel]
$creadList :: ReadS [ChatChannel]
readsPrec :: Int -> ReadS ChatChannel
$creadsPrec :: Int -> ReadS ChatChannel
Prelude.Read, Int -> ChatChannel -> ShowS
[ChatChannel] -> ShowS
ChatChannel -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatChannel] -> ShowS
$cshowList :: [ChatChannel] -> ShowS
show :: ChatChannel -> String
$cshow :: ChatChannel -> String
showsPrec :: Int -> ChatChannel -> ShowS
$cshowsPrec :: Int -> ChatChannel -> ShowS
Prelude.Show, forall x. Rep ChatChannel x -> ChatChannel
forall x. ChatChannel -> Rep ChatChannel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChatChannel x -> ChatChannel
$cfrom :: forall x. ChatChannel -> Rep ChatChannel x
Prelude.Generic)
newChatChannel ::
ChatChannel
newChatChannel :: ChatChannel
newChatChannel =
ChatChannel'
{ $sel:chatbotSns:ChatChannel' :: Maybe (NonEmpty Text)
chatbotSns = forall a. Maybe a
Prelude.Nothing,
$sel:empty:ChatChannel' :: Maybe EmptyChatChannel
empty = forall a. Maybe a
Prelude.Nothing
}
chatChannel_chatbotSns :: Lens.Lens' ChatChannel (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
chatChannel_chatbotSns :: Lens' ChatChannel (Maybe (NonEmpty Text))
chatChannel_chatbotSns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatChannel' {Maybe (NonEmpty Text)
chatbotSns :: Maybe (NonEmpty Text)
$sel:chatbotSns:ChatChannel' :: ChatChannel -> Maybe (NonEmpty Text)
chatbotSns} -> Maybe (NonEmpty Text)
chatbotSns) (\s :: ChatChannel
s@ChatChannel' {} Maybe (NonEmpty Text)
a -> ChatChannel
s {$sel:chatbotSns:ChatChannel' :: Maybe (NonEmpty Text)
chatbotSns = Maybe (NonEmpty Text)
a} :: ChatChannel) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
chatChannel_empty :: Lens.Lens' ChatChannel (Prelude.Maybe EmptyChatChannel)
chatChannel_empty :: Lens' ChatChannel (Maybe EmptyChatChannel)
chatChannel_empty = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatChannel' {Maybe EmptyChatChannel
empty :: Maybe EmptyChatChannel
$sel:empty:ChatChannel' :: ChatChannel -> Maybe EmptyChatChannel
empty} -> Maybe EmptyChatChannel
empty) (\s :: ChatChannel
s@ChatChannel' {} Maybe EmptyChatChannel
a -> ChatChannel
s {$sel:empty:ChatChannel' :: Maybe EmptyChatChannel
empty = Maybe EmptyChatChannel
a} :: ChatChannel)
instance Data.FromJSON ChatChannel where
parseJSON :: Value -> Parser ChatChannel
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChatChannel"
( \Object
x ->
Maybe (NonEmpty Text) -> Maybe EmptyChatChannel -> ChatChannel
ChatChannel'
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
"chatbotSns")
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
"empty")
)
instance Prelude.Hashable ChatChannel where
hashWithSalt :: Int -> ChatChannel -> Int
hashWithSalt Int
_salt ChatChannel' {Maybe (NonEmpty Text)
Maybe EmptyChatChannel
empty :: Maybe EmptyChatChannel
chatbotSns :: Maybe (NonEmpty Text)
$sel:empty:ChatChannel' :: ChatChannel -> Maybe EmptyChatChannel
$sel:chatbotSns:ChatChannel' :: ChatChannel -> Maybe (NonEmpty Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
chatbotSns
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EmptyChatChannel
empty
instance Prelude.NFData ChatChannel where
rnf :: ChatChannel -> ()
rnf ChatChannel' {Maybe (NonEmpty Text)
Maybe EmptyChatChannel
empty :: Maybe EmptyChatChannel
chatbotSns :: Maybe (NonEmpty Text)
$sel:empty:ChatChannel' :: ChatChannel -> Maybe EmptyChatChannel
$sel:chatbotSns:ChatChannel' :: ChatChannel -> Maybe (NonEmpty Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
chatbotSns
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EmptyChatChannel
empty
instance Data.ToJSON ChatChannel where
toJSON :: ChatChannel -> Value
toJSON ChatChannel' {Maybe (NonEmpty Text)
Maybe EmptyChatChannel
empty :: Maybe EmptyChatChannel
chatbotSns :: Maybe (NonEmpty Text)
$sel:empty:ChatChannel' :: ChatChannel -> Maybe EmptyChatChannel
$sel:chatbotSns:ChatChannel' :: ChatChannel -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"chatbotSns" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
chatbotSns,
(Key
"empty" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EmptyChatChannel
empty
]
)