{-# 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.LexRuntime.Types.GenericAttachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexRuntime.Types.Button
import qualified Amazonka.Prelude as Prelude
data GenericAttachment = GenericAttachment'
{
GenericAttachment -> Maybe Text
attachmentLinkUrl :: Prelude.Maybe Prelude.Text,
GenericAttachment -> Maybe [Button]
buttons :: Prelude.Maybe [Button],
GenericAttachment -> Maybe Text
imageUrl :: Prelude.Maybe Prelude.Text,
GenericAttachment -> Maybe Text
subTitle :: Prelude.Maybe Prelude.Text,
GenericAttachment -> Maybe Text
title :: Prelude.Maybe Prelude.Text
}
deriving (GenericAttachment -> GenericAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GenericAttachment -> GenericAttachment -> Bool
$c/= :: GenericAttachment -> GenericAttachment -> Bool
== :: GenericAttachment -> GenericAttachment -> Bool
$c== :: GenericAttachment -> GenericAttachment -> Bool
Prelude.Eq, ReadPrec [GenericAttachment]
ReadPrec GenericAttachment
Int -> ReadS GenericAttachment
ReadS [GenericAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GenericAttachment]
$creadListPrec :: ReadPrec [GenericAttachment]
readPrec :: ReadPrec GenericAttachment
$creadPrec :: ReadPrec GenericAttachment
readList :: ReadS [GenericAttachment]
$creadList :: ReadS [GenericAttachment]
readsPrec :: Int -> ReadS GenericAttachment
$creadsPrec :: Int -> ReadS GenericAttachment
Prelude.Read, Int -> GenericAttachment -> ShowS
[GenericAttachment] -> ShowS
GenericAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GenericAttachment] -> ShowS
$cshowList :: [GenericAttachment] -> ShowS
show :: GenericAttachment -> String
$cshow :: GenericAttachment -> String
showsPrec :: Int -> GenericAttachment -> ShowS
$cshowsPrec :: Int -> GenericAttachment -> ShowS
Prelude.Show, forall x. Rep GenericAttachment x -> GenericAttachment
forall x. GenericAttachment -> Rep GenericAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GenericAttachment x -> GenericAttachment
$cfrom :: forall x. GenericAttachment -> Rep GenericAttachment x
Prelude.Generic)
newGenericAttachment ::
GenericAttachment
newGenericAttachment :: GenericAttachment
newGenericAttachment =
GenericAttachment'
{ $sel:attachmentLinkUrl:GenericAttachment' :: Maybe Text
attachmentLinkUrl =
forall a. Maybe a
Prelude.Nothing,
$sel:buttons:GenericAttachment' :: Maybe [Button]
buttons = forall a. Maybe a
Prelude.Nothing,
$sel:imageUrl:GenericAttachment' :: Maybe Text
imageUrl = forall a. Maybe a
Prelude.Nothing,
$sel:subTitle:GenericAttachment' :: Maybe Text
subTitle = forall a. Maybe a
Prelude.Nothing,
$sel:title:GenericAttachment' :: Maybe Text
title = forall a. Maybe a
Prelude.Nothing
}
genericAttachment_attachmentLinkUrl :: Lens.Lens' GenericAttachment (Prelude.Maybe Prelude.Text)
genericAttachment_attachmentLinkUrl :: Lens' GenericAttachment (Maybe Text)
genericAttachment_attachmentLinkUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenericAttachment' {Maybe Text
attachmentLinkUrl :: Maybe Text
$sel:attachmentLinkUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
attachmentLinkUrl} -> Maybe Text
attachmentLinkUrl) (\s :: GenericAttachment
s@GenericAttachment' {} Maybe Text
a -> GenericAttachment
s {$sel:attachmentLinkUrl:GenericAttachment' :: Maybe Text
attachmentLinkUrl = Maybe Text
a} :: GenericAttachment)
genericAttachment_buttons :: Lens.Lens' GenericAttachment (Prelude.Maybe [Button])
genericAttachment_buttons :: Lens' GenericAttachment (Maybe [Button])
genericAttachment_buttons = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenericAttachment' {Maybe [Button]
buttons :: Maybe [Button]
$sel:buttons:GenericAttachment' :: GenericAttachment -> Maybe [Button]
buttons} -> Maybe [Button]
buttons) (\s :: GenericAttachment
s@GenericAttachment' {} Maybe [Button]
a -> GenericAttachment
s {$sel:buttons:GenericAttachment' :: Maybe [Button]
buttons = Maybe [Button]
a} :: GenericAttachment) 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
genericAttachment_imageUrl :: Lens.Lens' GenericAttachment (Prelude.Maybe Prelude.Text)
genericAttachment_imageUrl :: Lens' GenericAttachment (Maybe Text)
genericAttachment_imageUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenericAttachment' {Maybe Text
imageUrl :: Maybe Text
$sel:imageUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
imageUrl} -> Maybe Text
imageUrl) (\s :: GenericAttachment
s@GenericAttachment' {} Maybe Text
a -> GenericAttachment
s {$sel:imageUrl:GenericAttachment' :: Maybe Text
imageUrl = Maybe Text
a} :: GenericAttachment)
genericAttachment_subTitle :: Lens.Lens' GenericAttachment (Prelude.Maybe Prelude.Text)
genericAttachment_subTitle :: Lens' GenericAttachment (Maybe Text)
genericAttachment_subTitle = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenericAttachment' {Maybe Text
subTitle :: Maybe Text
$sel:subTitle:GenericAttachment' :: GenericAttachment -> Maybe Text
subTitle} -> Maybe Text
subTitle) (\s :: GenericAttachment
s@GenericAttachment' {} Maybe Text
a -> GenericAttachment
s {$sel:subTitle:GenericAttachment' :: Maybe Text
subTitle = Maybe Text
a} :: GenericAttachment)
genericAttachment_title :: Lens.Lens' GenericAttachment (Prelude.Maybe Prelude.Text)
genericAttachment_title :: Lens' GenericAttachment (Maybe Text)
genericAttachment_title = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GenericAttachment' {Maybe Text
title :: Maybe Text
$sel:title:GenericAttachment' :: GenericAttachment -> Maybe Text
title} -> Maybe Text
title) (\s :: GenericAttachment
s@GenericAttachment' {} Maybe Text
a -> GenericAttachment
s {$sel:title:GenericAttachment' :: Maybe Text
title = Maybe Text
a} :: GenericAttachment)
instance Data.FromJSON GenericAttachment where
parseJSON :: Value -> Parser GenericAttachment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GenericAttachment"
( \Object
x ->
Maybe Text
-> Maybe [Button]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GenericAttachment
GenericAttachment'
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
"attachmentLinkUrl")
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
"buttons" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"imageUrl")
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
"subTitle")
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
"title")
)
instance Prelude.Hashable GenericAttachment where
hashWithSalt :: Int -> GenericAttachment -> Int
hashWithSalt Int
_salt GenericAttachment' {Maybe [Button]
Maybe Text
title :: Maybe Text
subTitle :: Maybe Text
imageUrl :: Maybe Text
buttons :: Maybe [Button]
attachmentLinkUrl :: Maybe Text
$sel:title:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:subTitle:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:imageUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:buttons:GenericAttachment' :: GenericAttachment -> Maybe [Button]
$sel:attachmentLinkUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
attachmentLinkUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Button]
buttons
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
imageUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subTitle
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
title
instance Prelude.NFData GenericAttachment where
rnf :: GenericAttachment -> ()
rnf GenericAttachment' {Maybe [Button]
Maybe Text
title :: Maybe Text
subTitle :: Maybe Text
imageUrl :: Maybe Text
buttons :: Maybe [Button]
attachmentLinkUrl :: Maybe Text
$sel:title:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:subTitle:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:imageUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
$sel:buttons:GenericAttachment' :: GenericAttachment -> Maybe [Button]
$sel:attachmentLinkUrl:GenericAttachment' :: GenericAttachment -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
attachmentLinkUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Button]
buttons
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
imageUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subTitle
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
title