-- | Message embeds
module Calamity.Types.Model.Channel.Embed (
    Embed (..),
    embedFooter,
    embedImage,
    embedThumbnail,
    embedAuthor,
    embedAuthor',
    embedField,
    EmbedFooter (..),
    EmbedImage (..),
    EmbedThumbnail (..),
    EmbedVideo (..),
    EmbedProvider (..),
    EmbedAuthor (..),
    EmbedField (..),
) where

import Calamity.Internal.AesonThings
import Calamity.Internal.IntColour
import Calamity.Internal.OverriddenVia
import Calamity.Internal.Utils
import Control.Lens
import Data.Aeson
import Data.Colour (Colour)
import Data.Default.Class
import Data.Generics.Labels ()
import Data.Semigroup
import Data.Text (Text)
import Data.Time
import Data.Word
import GHC.Generics
import TextShow
import qualified TextShow.Generic as TSG

data Embed' = Embed'
    { Embed' -> Maybe Text
title :: Maybe Text
    , Embed' -> Maybe Text
type_ :: Maybe Text
    , Embed' -> Maybe Text
description :: Maybe Text
    , Embed' -> Maybe Text
url :: Maybe Text
    , Embed' -> Maybe (CalamityFromStringShow UTCTime)
timestamp :: Maybe (CalamityFromStringShow UTCTime)
    , Embed' -> Maybe IntColour
color :: Maybe IntColour
    , Embed' -> Maybe EmbedFooter
footer :: Maybe EmbedFooter
    , Embed' -> Maybe EmbedImage
image :: Maybe EmbedImage
    , Embed' -> Maybe EmbedThumbnail
thumbnail :: Maybe EmbedThumbnail
    , Embed' -> Maybe EmbedVideo
video :: Maybe EmbedVideo
    , Embed' -> Maybe EmbedProvider
provider :: Maybe EmbedProvider
    , Embed' -> Maybe EmbedAuthor
author :: Maybe EmbedAuthor
    , Embed' -> [EmbedField]
fields :: [EmbedField]
    }
    deriving ((forall x. Embed' -> Rep Embed' x)
-> (forall x. Rep Embed' x -> Embed') -> Generic Embed'
forall x. Rep Embed' x -> Embed'
forall x. Embed' -> Rep Embed' x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Embed' x -> Embed'
$cfrom :: forall x. Embed' -> Rep Embed' x
Generic)
    deriving (Value -> Parser [Embed']
Value -> Parser Embed'
(Value -> Parser Embed')
-> (Value -> Parser [Embed']) -> FromJSON Embed'
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Embed']
$cparseJSONList :: Value -> Parser [Embed']
parseJSON :: Value -> Parser Embed'
$cparseJSON :: Value -> Parser Embed'
FromJSON) via WithSpecialCases '[IfNoneThen "fields" DefaultToEmptyArray] Embed'
    deriving ([Embed'] -> Encoding
[Embed'] -> Value
Embed' -> Encoding
Embed' -> Value
(Embed' -> Value)
-> (Embed' -> Encoding)
-> ([Embed'] -> Value)
-> ([Embed'] -> Encoding)
-> ToJSON Embed'
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Embed'] -> Encoding
$ctoEncodingList :: [Embed'] -> Encoding
toJSONList :: [Embed'] -> Value
$ctoJSONList :: [Embed'] -> Value
toEncoding :: Embed' -> Encoding
$ctoEncoding :: Embed' -> Encoding
toJSON :: Embed' -> Value
$ctoJSON :: Embed' -> Value
ToJSON) via CalamityJSON Embed'
    deriving (Int -> Embed' -> Builder
Int -> Embed' -> Text
Int -> Embed' -> Text
[Embed'] -> Builder
[Embed'] -> Text
[Embed'] -> Text
Embed' -> Builder
Embed' -> Text
Embed' -> Text
(Int -> Embed' -> Builder)
-> (Embed' -> Builder)
-> ([Embed'] -> Builder)
-> (Int -> Embed' -> Text)
-> (Embed' -> Text)
-> ([Embed'] -> Text)
-> (Int -> Embed' -> Text)
-> (Embed' -> Text)
-> ([Embed'] -> Text)
-> TextShow Embed'
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [Embed'] -> Text
$cshowtlList :: [Embed'] -> Text
showtl :: Embed' -> Text
$cshowtl :: Embed' -> Text
showtlPrec :: Int -> Embed' -> Text
$cshowtlPrec :: Int -> Embed' -> Text
showtList :: [Embed'] -> Text
$cshowtList :: [Embed'] -> Text
showt :: Embed' -> Text
$cshowt :: Embed' -> Text
showtPrec :: Int -> Embed' -> Text
$cshowtPrec :: Int -> Embed' -> Text
showbList :: [Embed'] -> Builder
$cshowbList :: [Embed'] -> Builder
showb :: Embed' -> Builder
$cshowb :: Embed' -> Builder
showbPrec :: Int -> Embed' -> Builder
$cshowbPrec :: Int -> Embed' -> Builder
TextShow) via TSG.FromGeneric Embed'

data Embed = Embed
    { Embed -> Maybe Text
title :: Maybe Text
    , Embed -> Maybe Text
type_ :: Maybe Text
    , Embed -> Maybe Text
description :: Maybe Text
    , Embed -> Maybe Text
url :: Maybe Text
    , Embed -> Maybe UTCTime
timestamp :: Maybe UTCTime
    , Embed -> Maybe (Colour Double)
color :: Maybe (Colour Double)
    , Embed -> Maybe EmbedFooter
footer :: Maybe EmbedFooter
    , Embed -> Maybe EmbedImage
image :: Maybe EmbedImage
    , Embed -> Maybe EmbedThumbnail
thumbnail :: Maybe EmbedThumbnail
    , Embed -> Maybe EmbedVideo
video :: Maybe EmbedVideo
    , Embed -> Maybe EmbedProvider
provider :: Maybe EmbedProvider
    , Embed -> Maybe EmbedAuthor
author :: Maybe EmbedAuthor
    , Embed -> [EmbedField]
fields :: [EmbedField]
    }
    deriving (Embed -> Embed -> Bool
(Embed -> Embed -> Bool) -> (Embed -> Embed -> Bool) -> Eq Embed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Embed -> Embed -> Bool
$c/= :: Embed -> Embed -> Bool
== :: Embed -> Embed -> Bool
$c== :: Embed -> Embed -> Bool
Eq, Int -> Embed -> ShowS
[Embed] -> ShowS
Embed -> String
(Int -> Embed -> ShowS)
-> (Embed -> String) -> ([Embed] -> ShowS) -> Show Embed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Embed] -> ShowS
$cshowList :: [Embed] -> ShowS
show :: Embed -> String
$cshow :: Embed -> String
showsPrec :: Int -> Embed -> ShowS
$cshowsPrec :: Int -> Embed -> ShowS
Show, (forall x. Embed -> Rep Embed x)
-> (forall x. Rep Embed x -> Embed) -> Generic Embed
forall x. Rep Embed x -> Embed
forall x. Embed -> Rep Embed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Embed x -> Embed
$cfrom :: forall x. Embed -> Rep Embed x
Generic, Embed
Embed -> Default Embed
forall a. a -> Default a
def :: Embed
$cdef :: Embed
Default)
    deriving (Int -> Embed -> Builder
Int -> Embed -> Text
Int -> Embed -> Text
[Embed] -> Builder
[Embed] -> Text
[Embed] -> Text
Embed -> Builder
Embed -> Text
Embed -> Text
(Int -> Embed -> Builder)
-> (Embed -> Builder)
-> ([Embed] -> Builder)
-> (Int -> Embed -> Text)
-> (Embed -> Text)
-> ([Embed] -> Text)
-> (Int -> Embed -> Text)
-> (Embed -> Text)
-> ([Embed] -> Text)
-> TextShow Embed
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [Embed] -> Text
$cshowtlList :: [Embed] -> Text
showtl :: Embed -> Text
$cshowtl :: Embed -> Text
showtlPrec :: Int -> Embed -> Text
$cshowtlPrec :: Int -> Embed -> Text
showtList :: [Embed] -> Text
$cshowtList :: [Embed] -> Text
showt :: Embed -> Text
$cshowt :: Embed -> Text
showtPrec :: Int -> Embed -> Text
$cshowtPrec :: Int -> Embed -> Text
showbList :: [Embed] -> Builder
$cshowbList :: [Embed] -> Builder
showb :: Embed -> Builder
$cshowb :: Embed -> Builder
showbPrec :: Int -> Embed -> Builder
$cshowbPrec :: Int -> Embed -> Builder
TextShow, Value -> Parser [Embed]
Value -> Parser Embed
(Value -> Parser Embed)
-> (Value -> Parser [Embed]) -> FromJSON Embed
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Embed]
$cparseJSONList :: Value -> Parser [Embed]
parseJSON :: Value -> Parser Embed
$cparseJSON :: Value -> Parser Embed
FromJSON, [Embed] -> Encoding
[Embed] -> Value
Embed -> Encoding
Embed -> Value
(Embed -> Value)
-> (Embed -> Encoding)
-> ([Embed] -> Value)
-> ([Embed] -> Encoding)
-> ToJSON Embed
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Embed] -> Encoding
$ctoEncodingList :: [Embed] -> Encoding
toJSONList :: [Embed] -> Value
$ctoJSONList :: [Embed] -> Value
toEncoding :: Embed -> Encoding
$ctoEncoding :: Embed -> Encoding
toJSON :: Embed -> Value
$ctoJSON :: Embed -> Value
ToJSON) via OverriddenVia Embed Embed'

instance Semigroup Embed where
    Embed
l <> :: Embed -> Embed -> Embed
<> Embed
r =
        Embed
l
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel "title" (ASetter Embed Embed (Maybe Text) (Maybe Text))
ASetter Embed Embed (Maybe Text) (Maybe Text)
#title ASetter Embed Embed (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ (Maybe Text -> Maybe Text -> Maybe Text
forall a. Semigroup a => a -> a -> a
<> (Embed
r Embed -> Getting (Maybe Text) Embed (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel "title" (Getting (Maybe Text) Embed (Maybe Text))
Getting (Maybe Text) Embed (Maybe Text)
#title))
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel "type_" (ASetter Embed Embed (Maybe Text) (Maybe Text))
ASetter Embed Embed (Maybe Text) (Maybe Text)
#type_ ASetter Embed Embed (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe Text) -> Maybe Text
forall a. Last a -> a
getLast (Last (Maybe Text) -> Maybe Text)
-> (Maybe Text -> Last (Maybe Text)) -> Maybe Text -> Maybe Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe Text) -> Last (Maybe Text) -> Last (Maybe Text)
forall a. Semigroup a => a -> a -> a
<> Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last (Embed
r Embed -> Getting (Maybe Text) Embed (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel "type_" (Getting (Maybe Text) Embed (Maybe Text))
Getting (Maybe Text) Embed (Maybe Text)
#type_)) (Last (Maybe Text) -> Last (Maybe Text))
-> (Maybe Text -> Last (Maybe Text))
-> Maybe Text
-> Last (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "description" (ASetter Embed Embed (Maybe Text) (Maybe Text))
ASetter Embed Embed (Maybe Text) (Maybe Text)
#description ASetter Embed Embed (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ (Maybe Text -> Maybe Text -> Maybe Text
forall a. Semigroup a => a -> a -> a
<> (Embed
r Embed -> Getting (Maybe Text) Embed (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel "description" (Getting (Maybe Text) Embed (Maybe Text))
Getting (Maybe Text) Embed (Maybe Text)
#description))
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel "url" (ASetter Embed Embed (Maybe Text) (Maybe Text))
ASetter Embed Embed (Maybe Text) (Maybe Text)
#url ASetter Embed Embed (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe Text) -> Maybe Text
forall a. Last a -> a
getLast (Last (Maybe Text) -> Maybe Text)
-> (Maybe Text -> Last (Maybe Text)) -> Maybe Text -> Maybe Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe Text) -> Last (Maybe Text) -> Last (Maybe Text)
forall a. Semigroup a => a -> a -> a
<> Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last (Embed
r Embed -> Getting (Maybe Text) Embed (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel "url" (Getting (Maybe Text) Embed (Maybe Text))
Getting (Maybe Text) Embed (Maybe Text)
#url)) (Last (Maybe Text) -> Last (Maybe Text))
-> (Maybe Text -> Last (Maybe Text))
-> Maybe Text
-> Last (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "timestamp" (ASetter Embed Embed (Maybe UTCTime) (Maybe UTCTime))
ASetter Embed Embed (Maybe UTCTime) (Maybe UTCTime)
#timestamp ASetter Embed Embed (Maybe UTCTime) (Maybe UTCTime)
-> (Maybe UTCTime -> Maybe UTCTime) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe UTCTime) -> Maybe UTCTime
forall a. Last a -> a
getLast (Last (Maybe UTCTime) -> Maybe UTCTime)
-> (Maybe UTCTime -> Last (Maybe UTCTime))
-> Maybe UTCTime
-> Maybe UTCTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe UTCTime)
-> Last (Maybe UTCTime) -> Last (Maybe UTCTime)
forall a. Semigroup a => a -> a -> a
<> Maybe UTCTime -> Last (Maybe UTCTime)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe UTCTime) Embed (Maybe UTCTime) -> Maybe UTCTime
forall s a. s -> Getting a s a -> a
^. IsLabel "timestamp" (Getting (Maybe UTCTime) Embed (Maybe UTCTime))
Getting (Maybe UTCTime) Embed (Maybe UTCTime)
#timestamp)) (Last (Maybe UTCTime) -> Last (Maybe UTCTime))
-> (Maybe UTCTime -> Last (Maybe UTCTime))
-> Maybe UTCTime
-> Last (Maybe UTCTime)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe UTCTime -> Last (Maybe UTCTime)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "color"
  (ASetter
     Embed Embed (Maybe (Colour Double)) (Maybe (Colour Double)))
ASetter Embed Embed (Maybe (Colour Double)) (Maybe (Colour Double))
#color ASetter Embed Embed (Maybe (Colour Double)) (Maybe (Colour Double))
-> (Maybe (Colour Double) -> Maybe (Colour Double))
-> Embed
-> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe (Colour Double)) -> Maybe (Colour Double)
forall a. Last a -> a
getLast (Last (Maybe (Colour Double)) -> Maybe (Colour Double))
-> (Maybe (Colour Double) -> Last (Maybe (Colour Double)))
-> Maybe (Colour Double)
-> Maybe (Colour Double)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe (Colour Double))
-> Last (Maybe (Colour Double)) -> Last (Maybe (Colour Double))
forall a. Semigroup a => a -> a -> a
<> Maybe (Colour Double) -> Last (Maybe (Colour Double))
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe (Colour Double)) Embed (Maybe (Colour Double))
-> Maybe (Colour Double)
forall s a. s -> Getting a s a -> a
^. IsLabel
  "color"
  (Getting (Maybe (Colour Double)) Embed (Maybe (Colour Double)))
Getting (Maybe (Colour Double)) Embed (Maybe (Colour Double))
#color)) (Last (Maybe (Colour Double)) -> Last (Maybe (Colour Double)))
-> (Maybe (Colour Double) -> Last (Maybe (Colour Double)))
-> Maybe (Colour Double)
-> Last (Maybe (Colour Double))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe (Colour Double) -> Last (Maybe (Colour Double))
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "footer"
  (ASetter Embed Embed (Maybe EmbedFooter) (Maybe EmbedFooter))
ASetter Embed Embed (Maybe EmbedFooter) (Maybe EmbedFooter)
#footer ASetter Embed Embed (Maybe EmbedFooter) (Maybe EmbedFooter)
-> (Maybe EmbedFooter -> Maybe EmbedFooter) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ (Maybe EmbedFooter -> Maybe EmbedFooter -> Maybe EmbedFooter
forall a. Semigroup a => a -> a -> a
<> (Embed
r Embed
-> Getting (Maybe EmbedFooter) Embed (Maybe EmbedFooter)
-> Maybe EmbedFooter
forall s a. s -> Getting a s a -> a
^. IsLabel
  "footer" (Getting (Maybe EmbedFooter) Embed (Maybe EmbedFooter))
Getting (Maybe EmbedFooter) Embed (Maybe EmbedFooter)
#footer))
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "image" (ASetter Embed Embed (Maybe EmbedImage) (Maybe EmbedImage))
ASetter Embed Embed (Maybe EmbedImage) (Maybe EmbedImage)
#image ASetter Embed Embed (Maybe EmbedImage) (Maybe EmbedImage)
-> (Maybe EmbedImage -> Maybe EmbedImage) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe EmbedImage) -> Maybe EmbedImage
forall a. Last a -> a
getLast (Last (Maybe EmbedImage) -> Maybe EmbedImage)
-> (Maybe EmbedImage -> Last (Maybe EmbedImage))
-> Maybe EmbedImage
-> Maybe EmbedImage
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe EmbedImage)
-> Last (Maybe EmbedImage) -> Last (Maybe EmbedImage)
forall a. Semigroup a => a -> a -> a
<> Maybe EmbedImage -> Last (Maybe EmbedImage)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe EmbedImage) Embed (Maybe EmbedImage)
-> Maybe EmbedImage
forall s a. s -> Getting a s a -> a
^. IsLabel
  "image" (Getting (Maybe EmbedImage) Embed (Maybe EmbedImage))
Getting (Maybe EmbedImage) Embed (Maybe EmbedImage)
#image)) (Last (Maybe EmbedImage) -> Last (Maybe EmbedImage))
-> (Maybe EmbedImage -> Last (Maybe EmbedImage))
-> Maybe EmbedImage
-> Last (Maybe EmbedImage)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe EmbedImage -> Last (Maybe EmbedImage)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "thumbnail"
  (ASetter Embed Embed (Maybe EmbedThumbnail) (Maybe EmbedThumbnail))
ASetter Embed Embed (Maybe EmbedThumbnail) (Maybe EmbedThumbnail)
#thumbnail ASetter Embed Embed (Maybe EmbedThumbnail) (Maybe EmbedThumbnail)
-> (Maybe EmbedThumbnail -> Maybe EmbedThumbnail) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe EmbedThumbnail) -> Maybe EmbedThumbnail
forall a. Last a -> a
getLast (Last (Maybe EmbedThumbnail) -> Maybe EmbedThumbnail)
-> (Maybe EmbedThumbnail -> Last (Maybe EmbedThumbnail))
-> Maybe EmbedThumbnail
-> Maybe EmbedThumbnail
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe EmbedThumbnail)
-> Last (Maybe EmbedThumbnail) -> Last (Maybe EmbedThumbnail)
forall a. Semigroup a => a -> a -> a
<> Maybe EmbedThumbnail -> Last (Maybe EmbedThumbnail)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe EmbedThumbnail) Embed (Maybe EmbedThumbnail)
-> Maybe EmbedThumbnail
forall s a. s -> Getting a s a -> a
^. IsLabel
  "thumbnail"
  (Getting (Maybe EmbedThumbnail) Embed (Maybe EmbedThumbnail))
Getting (Maybe EmbedThumbnail) Embed (Maybe EmbedThumbnail)
#thumbnail)) (Last (Maybe EmbedThumbnail) -> Last (Maybe EmbedThumbnail))
-> (Maybe EmbedThumbnail -> Last (Maybe EmbedThumbnail))
-> Maybe EmbedThumbnail
-> Last (Maybe EmbedThumbnail)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe EmbedThumbnail -> Last (Maybe EmbedThumbnail)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "video" (ASetter Embed Embed (Maybe EmbedVideo) (Maybe EmbedVideo))
ASetter Embed Embed (Maybe EmbedVideo) (Maybe EmbedVideo)
#video ASetter Embed Embed (Maybe EmbedVideo) (Maybe EmbedVideo)
-> (Maybe EmbedVideo -> Maybe EmbedVideo) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe EmbedVideo) -> Maybe EmbedVideo
forall a. Last a -> a
getLast (Last (Maybe EmbedVideo) -> Maybe EmbedVideo)
-> (Maybe EmbedVideo -> Last (Maybe EmbedVideo))
-> Maybe EmbedVideo
-> Maybe EmbedVideo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe EmbedVideo)
-> Last (Maybe EmbedVideo) -> Last (Maybe EmbedVideo)
forall a. Semigroup a => a -> a -> a
<> Maybe EmbedVideo -> Last (Maybe EmbedVideo)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe EmbedVideo) Embed (Maybe EmbedVideo)
-> Maybe EmbedVideo
forall s a. s -> Getting a s a -> a
^. IsLabel
  "video" (Getting (Maybe EmbedVideo) Embed (Maybe EmbedVideo))
Getting (Maybe EmbedVideo) Embed (Maybe EmbedVideo)
#video)) (Last (Maybe EmbedVideo) -> Last (Maybe EmbedVideo))
-> (Maybe EmbedVideo -> Last (Maybe EmbedVideo))
-> Maybe EmbedVideo
-> Last (Maybe EmbedVideo)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe EmbedVideo -> Last (Maybe EmbedVideo)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "provider"
  (ASetter Embed Embed (Maybe EmbedProvider) (Maybe EmbedProvider))
ASetter Embed Embed (Maybe EmbedProvider) (Maybe EmbedProvider)
#provider ASetter Embed Embed (Maybe EmbedProvider) (Maybe EmbedProvider)
-> (Maybe EmbedProvider -> Maybe EmbedProvider) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe EmbedProvider) -> Maybe EmbedProvider
forall a. Last a -> a
getLast (Last (Maybe EmbedProvider) -> Maybe EmbedProvider)
-> (Maybe EmbedProvider -> Last (Maybe EmbedProvider))
-> Maybe EmbedProvider
-> Maybe EmbedProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe EmbedProvider)
-> Last (Maybe EmbedProvider) -> Last (Maybe EmbedProvider)
forall a. Semigroup a => a -> a -> a
<> Maybe EmbedProvider -> Last (Maybe EmbedProvider)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe EmbedProvider) Embed (Maybe EmbedProvider)
-> Maybe EmbedProvider
forall s a. s -> Getting a s a -> a
^. IsLabel
  "provider"
  (Getting (Maybe EmbedProvider) Embed (Maybe EmbedProvider))
Getting (Maybe EmbedProvider) Embed (Maybe EmbedProvider)
#provider)) (Last (Maybe EmbedProvider) -> Last (Maybe EmbedProvider))
-> (Maybe EmbedProvider -> Last (Maybe EmbedProvider))
-> Maybe EmbedProvider
-> Last (Maybe EmbedProvider)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe EmbedProvider -> Last (Maybe EmbedProvider)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel
  "author"
  (ASetter Embed Embed (Maybe EmbedAuthor) (Maybe EmbedAuthor))
ASetter Embed Embed (Maybe EmbedAuthor) (Maybe EmbedAuthor)
#author ASetter Embed Embed (Maybe EmbedAuthor) (Maybe EmbedAuthor)
-> (Maybe EmbedAuthor -> Maybe EmbedAuthor) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe EmbedAuthor) -> Maybe EmbedAuthor
forall a. Last a -> a
getLast (Last (Maybe EmbedAuthor) -> Maybe EmbedAuthor)
-> (Maybe EmbedAuthor -> Last (Maybe EmbedAuthor))
-> Maybe EmbedAuthor
-> Maybe EmbedAuthor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe EmbedAuthor)
-> Last (Maybe EmbedAuthor) -> Last (Maybe EmbedAuthor)
forall a. Semigroup a => a -> a -> a
<> Maybe EmbedAuthor -> Last (Maybe EmbedAuthor)
forall a. a -> Last a
Last (Embed
r Embed
-> Getting (Maybe EmbedAuthor) Embed (Maybe EmbedAuthor)
-> Maybe EmbedAuthor
forall s a. s -> Getting a s a -> a
^. IsLabel
  "author" (Getting (Maybe EmbedAuthor) Embed (Maybe EmbedAuthor))
Getting (Maybe EmbedAuthor) Embed (Maybe EmbedAuthor)
#author)) (Last (Maybe EmbedAuthor) -> Last (Maybe EmbedAuthor))
-> (Maybe EmbedAuthor -> Last (Maybe EmbedAuthor))
-> Maybe EmbedAuthor
-> Last (Maybe EmbedAuthor)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe EmbedAuthor -> Last (Maybe EmbedAuthor)
forall a. a -> Last a
Last
            Embed -> (Embed -> Embed) -> Embed
forall a b. a -> (a -> b) -> b
& IsLabel "fields" (ASetter Embed Embed [EmbedField] [EmbedField])
ASetter Embed Embed [EmbedField] [EmbedField]
#fields ASetter Embed Embed [EmbedField] [EmbedField]
-> ([EmbedField] -> [EmbedField]) -> Embed -> Embed
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ ([EmbedField] -> [EmbedField] -> [EmbedField]
forall a. Semigroup a => a -> a -> a
<> (Embed
r Embed -> Getting [EmbedField] Embed [EmbedField] -> [EmbedField]
forall s a. s -> Getting a s a -> a
^. IsLabel "fields" (Getting [EmbedField] Embed [EmbedField])
Getting [EmbedField] Embed [EmbedField]
#fields))

instance Monoid Embed where
    mempty :: Embed
mempty = Embed
forall a. Default a => a
def

data EmbedFooter = EmbedFooter
    { EmbedFooter -> Text
text :: Text
    , EmbedFooter -> Maybe Text
iconUrl :: Maybe Text
    , EmbedFooter -> Maybe Text
proxyIconUrl :: Maybe Text
    }
    deriving (EmbedFooter -> EmbedFooter -> Bool
(EmbedFooter -> EmbedFooter -> Bool)
-> (EmbedFooter -> EmbedFooter -> Bool) -> Eq EmbedFooter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedFooter -> EmbedFooter -> Bool
$c/= :: EmbedFooter -> EmbedFooter -> Bool
== :: EmbedFooter -> EmbedFooter -> Bool
$c== :: EmbedFooter -> EmbedFooter -> Bool
Eq, Int -> EmbedFooter -> ShowS
[EmbedFooter] -> ShowS
EmbedFooter -> String
(Int -> EmbedFooter -> ShowS)
-> (EmbedFooter -> String)
-> ([EmbedFooter] -> ShowS)
-> Show EmbedFooter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedFooter] -> ShowS
$cshowList :: [EmbedFooter] -> ShowS
show :: EmbedFooter -> String
$cshow :: EmbedFooter -> String
showsPrec :: Int -> EmbedFooter -> ShowS
$cshowsPrec :: Int -> EmbedFooter -> ShowS
Show, (forall x. EmbedFooter -> Rep EmbedFooter x)
-> (forall x. Rep EmbedFooter x -> EmbedFooter)
-> Generic EmbedFooter
forall x. Rep EmbedFooter x -> EmbedFooter
forall x. EmbedFooter -> Rep EmbedFooter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedFooter x -> EmbedFooter
$cfrom :: forall x. EmbedFooter -> Rep EmbedFooter x
Generic)
    deriving (Int -> EmbedFooter -> Builder
Int -> EmbedFooter -> Text
Int -> EmbedFooter -> Text
[EmbedFooter] -> Builder
[EmbedFooter] -> Text
[EmbedFooter] -> Text
EmbedFooter -> Builder
EmbedFooter -> Text
EmbedFooter -> Text
(Int -> EmbedFooter -> Builder)
-> (EmbedFooter -> Builder)
-> ([EmbedFooter] -> Builder)
-> (Int -> EmbedFooter -> Text)
-> (EmbedFooter -> Text)
-> ([EmbedFooter] -> Text)
-> (Int -> EmbedFooter -> Text)
-> (EmbedFooter -> Text)
-> ([EmbedFooter] -> Text)
-> TextShow EmbedFooter
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedFooter] -> Text
$cshowtlList :: [EmbedFooter] -> Text
showtl :: EmbedFooter -> Text
$cshowtl :: EmbedFooter -> Text
showtlPrec :: Int -> EmbedFooter -> Text
$cshowtlPrec :: Int -> EmbedFooter -> Text
showtList :: [EmbedFooter] -> Text
$cshowtList :: [EmbedFooter] -> Text
showt :: EmbedFooter -> Text
$cshowt :: EmbedFooter -> Text
showtPrec :: Int -> EmbedFooter -> Text
$cshowtPrec :: Int -> EmbedFooter -> Text
showbList :: [EmbedFooter] -> Builder
$cshowbList :: [EmbedFooter] -> Builder
showb :: EmbedFooter -> Builder
$cshowb :: EmbedFooter -> Builder
showbPrec :: Int -> EmbedFooter -> Builder
$cshowbPrec :: Int -> EmbedFooter -> Builder
TextShow) via TSG.FromGeneric EmbedFooter
    deriving ([EmbedFooter] -> Encoding
[EmbedFooter] -> Value
EmbedFooter -> Encoding
EmbedFooter -> Value
(EmbedFooter -> Value)
-> (EmbedFooter -> Encoding)
-> ([EmbedFooter] -> Value)
-> ([EmbedFooter] -> Encoding)
-> ToJSON EmbedFooter
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedFooter] -> Encoding
$ctoEncodingList :: [EmbedFooter] -> Encoding
toJSONList :: [EmbedFooter] -> Value
$ctoJSONList :: [EmbedFooter] -> Value
toEncoding :: EmbedFooter -> Encoding
$ctoEncoding :: EmbedFooter -> Encoding
toJSON :: EmbedFooter -> Value
$ctoJSON :: EmbedFooter -> Value
ToJSON, Value -> Parser [EmbedFooter]
Value -> Parser EmbedFooter
(Value -> Parser EmbedFooter)
-> (Value -> Parser [EmbedFooter]) -> FromJSON EmbedFooter
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedFooter]
$cparseJSONList :: Value -> Parser [EmbedFooter]
parseJSON :: Value -> Parser EmbedFooter
$cparseJSON :: Value -> Parser EmbedFooter
FromJSON) via CalamityJSON EmbedFooter

{- | Create an embed footer with a provided content

 The remaining fields are set to Nothing
-}
embedFooter :: Text -> EmbedFooter
embedFooter :: Text -> EmbedFooter
embedFooter Text
text = Text -> Maybe Text -> Maybe Text -> EmbedFooter
EmbedFooter Text
text Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing

instance Semigroup EmbedFooter where
    EmbedFooter
l <> :: EmbedFooter -> EmbedFooter -> EmbedFooter
<> EmbedFooter
r =
        EmbedFooter
l
            EmbedFooter -> (EmbedFooter -> EmbedFooter) -> EmbedFooter
forall a b. a -> (a -> b) -> b
& IsLabel "text" (ASetter EmbedFooter EmbedFooter Text Text)
ASetter EmbedFooter EmbedFooter Text Text
#text ASetter EmbedFooter EmbedFooter Text Text
-> (Text -> Text) -> EmbedFooter -> EmbedFooter
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ (Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> (EmbedFooter
r EmbedFooter -> Getting Text EmbedFooter Text -> Text
forall s a. s -> Getting a s a -> a
^. IsLabel "text" (Getting Text EmbedFooter Text)
Getting Text EmbedFooter Text
#text))
            EmbedFooter -> (EmbedFooter -> EmbedFooter) -> EmbedFooter
forall a b. a -> (a -> b) -> b
& IsLabel
  "iconUrl"
  (ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text))
ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text)
#iconUrl ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> EmbedFooter -> EmbedFooter
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe Text) -> Maybe Text
forall a. Last a -> a
getLast (Last (Maybe Text) -> Maybe Text)
-> (Maybe Text -> Last (Maybe Text)) -> Maybe Text -> Maybe Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe Text) -> Last (Maybe Text) -> Last (Maybe Text)
forall a. Semigroup a => a -> a -> a
<> Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last (EmbedFooter
r EmbedFooter
-> Getting (Maybe Text) EmbedFooter (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel "iconUrl" (Getting (Maybe Text) EmbedFooter (Maybe Text))
Getting (Maybe Text) EmbedFooter (Maybe Text)
#iconUrl)) (Last (Maybe Text) -> Last (Maybe Text))
-> (Maybe Text -> Last (Maybe Text))
-> Maybe Text
-> Last (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last
            EmbedFooter -> (EmbedFooter -> EmbedFooter) -> EmbedFooter
forall a b. a -> (a -> b) -> b
& IsLabel
  "proxyIconUrl"
  (ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text))
ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text)
#proxyIconUrl ASetter EmbedFooter EmbedFooter (Maybe Text) (Maybe Text)
-> (Maybe Text -> Maybe Text) -> EmbedFooter -> EmbedFooter
forall s t a b. ASetter s t a b -> (a -> b) -> s -> t
%~ Last (Maybe Text) -> Maybe Text
forall a. Last a -> a
getLast (Last (Maybe Text) -> Maybe Text)
-> (Maybe Text -> Last (Maybe Text)) -> Maybe Text -> Maybe Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Last (Maybe Text) -> Last (Maybe Text) -> Last (Maybe Text)
forall a. Semigroup a => a -> a -> a
<> Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last (EmbedFooter
r EmbedFooter
-> Getting (Maybe Text) EmbedFooter (Maybe Text) -> Maybe Text
forall s a. s -> Getting a s a -> a
^. IsLabel
  "proxyIconUrl" (Getting (Maybe Text) EmbedFooter (Maybe Text))
Getting (Maybe Text) EmbedFooter (Maybe Text)
#proxyIconUrl)) (Last (Maybe Text) -> Last (Maybe Text))
-> (Maybe Text -> Last (Maybe Text))
-> Maybe Text
-> Last (Maybe Text)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe Text -> Last (Maybe Text)
forall a. a -> Last a
Last

data EmbedImage = EmbedImage
    { EmbedImage -> Text
url :: Text
    , EmbedImage -> Maybe Text
proxyUrl :: Maybe Text
    , EmbedImage -> Maybe Word64
width :: Maybe Word64
    , EmbedImage -> Maybe Word64
height :: Maybe Word64
    }
    deriving (EmbedImage -> EmbedImage -> Bool
(EmbedImage -> EmbedImage -> Bool)
-> (EmbedImage -> EmbedImage -> Bool) -> Eq EmbedImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedImage -> EmbedImage -> Bool
$c/= :: EmbedImage -> EmbedImage -> Bool
== :: EmbedImage -> EmbedImage -> Bool
$c== :: EmbedImage -> EmbedImage -> Bool
Eq, Int -> EmbedImage -> ShowS
[EmbedImage] -> ShowS
EmbedImage -> String
(Int -> EmbedImage -> ShowS)
-> (EmbedImage -> String)
-> ([EmbedImage] -> ShowS)
-> Show EmbedImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedImage] -> ShowS
$cshowList :: [EmbedImage] -> ShowS
show :: EmbedImage -> String
$cshow :: EmbedImage -> String
showsPrec :: Int -> EmbedImage -> ShowS
$cshowsPrec :: Int -> EmbedImage -> ShowS
Show, (forall x. EmbedImage -> Rep EmbedImage x)
-> (forall x. Rep EmbedImage x -> EmbedImage) -> Generic EmbedImage
forall x. Rep EmbedImage x -> EmbedImage
forall x. EmbedImage -> Rep EmbedImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedImage x -> EmbedImage
$cfrom :: forall x. EmbedImage -> Rep EmbedImage x
Generic)
    deriving (Int -> EmbedImage -> Builder
Int -> EmbedImage -> Text
Int -> EmbedImage -> Text
[EmbedImage] -> Builder
[EmbedImage] -> Text
[EmbedImage] -> Text
EmbedImage -> Builder
EmbedImage -> Text
EmbedImage -> Text
(Int -> EmbedImage -> Builder)
-> (EmbedImage -> Builder)
-> ([EmbedImage] -> Builder)
-> (Int -> EmbedImage -> Text)
-> (EmbedImage -> Text)
-> ([EmbedImage] -> Text)
-> (Int -> EmbedImage -> Text)
-> (EmbedImage -> Text)
-> ([EmbedImage] -> Text)
-> TextShow EmbedImage
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedImage] -> Text
$cshowtlList :: [EmbedImage] -> Text
showtl :: EmbedImage -> Text
$cshowtl :: EmbedImage -> Text
showtlPrec :: Int -> EmbedImage -> Text
$cshowtlPrec :: Int -> EmbedImage -> Text
showtList :: [EmbedImage] -> Text
$cshowtList :: [EmbedImage] -> Text
showt :: EmbedImage -> Text
$cshowt :: EmbedImage -> Text
showtPrec :: Int -> EmbedImage -> Text
$cshowtPrec :: Int -> EmbedImage -> Text
showbList :: [EmbedImage] -> Builder
$cshowbList :: [EmbedImage] -> Builder
showb :: EmbedImage -> Builder
$cshowb :: EmbedImage -> Builder
showbPrec :: Int -> EmbedImage -> Builder
$cshowbPrec :: Int -> EmbedImage -> Builder
TextShow) via TSG.FromGeneric EmbedImage
    deriving (Value -> Parser [EmbedImage]
Value -> Parser EmbedImage
(Value -> Parser EmbedImage)
-> (Value -> Parser [EmbedImage]) -> FromJSON EmbedImage
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedImage]
$cparseJSONList :: Value -> Parser [EmbedImage]
parseJSON :: Value -> Parser EmbedImage
$cparseJSON :: Value -> Parser EmbedImage
FromJSON, [EmbedImage] -> Encoding
[EmbedImage] -> Value
EmbedImage -> Encoding
EmbedImage -> Value
(EmbedImage -> Value)
-> (EmbedImage -> Encoding)
-> ([EmbedImage] -> Value)
-> ([EmbedImage] -> Encoding)
-> ToJSON EmbedImage
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedImage] -> Encoding
$ctoEncodingList :: [EmbedImage] -> Encoding
toJSONList :: [EmbedImage] -> Value
$ctoJSONList :: [EmbedImage] -> Value
toEncoding :: EmbedImage -> Encoding
$ctoEncoding :: EmbedImage -> Encoding
toJSON :: EmbedImage -> Value
$ctoJSON :: EmbedImage -> Value
ToJSON) via CalamityJSON EmbedImage

{- | Create an embed image with a provided url

 The remaining fields are set to Nothing
-}
embedImage :: Text -> EmbedImage
embedImage :: Text -> EmbedImage
embedImage Text
url = Text -> Maybe Text -> Maybe Word64 -> Maybe Word64 -> EmbedImage
EmbedImage Text
url Maybe Text
forall a. Maybe a
Nothing Maybe Word64
forall a. Maybe a
Nothing Maybe Word64
forall a. Maybe a
Nothing

data EmbedThumbnail = EmbedThumbnail
    { EmbedThumbnail -> Text
url :: Text
    , EmbedThumbnail -> Maybe Text
proxyUrl :: Maybe Text
    , EmbedThumbnail -> Maybe Word64
width :: Maybe Word64
    , EmbedThumbnail -> Maybe Word64
height :: Maybe Word64
    }
    deriving (EmbedThumbnail -> EmbedThumbnail -> Bool
(EmbedThumbnail -> EmbedThumbnail -> Bool)
-> (EmbedThumbnail -> EmbedThumbnail -> Bool) -> Eq EmbedThumbnail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedThumbnail -> EmbedThumbnail -> Bool
$c/= :: EmbedThumbnail -> EmbedThumbnail -> Bool
== :: EmbedThumbnail -> EmbedThumbnail -> Bool
$c== :: EmbedThumbnail -> EmbedThumbnail -> Bool
Eq, Int -> EmbedThumbnail -> ShowS
[EmbedThumbnail] -> ShowS
EmbedThumbnail -> String
(Int -> EmbedThumbnail -> ShowS)
-> (EmbedThumbnail -> String)
-> ([EmbedThumbnail] -> ShowS)
-> Show EmbedThumbnail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedThumbnail] -> ShowS
$cshowList :: [EmbedThumbnail] -> ShowS
show :: EmbedThumbnail -> String
$cshow :: EmbedThumbnail -> String
showsPrec :: Int -> EmbedThumbnail -> ShowS
$cshowsPrec :: Int -> EmbedThumbnail -> ShowS
Show, (forall x. EmbedThumbnail -> Rep EmbedThumbnail x)
-> (forall x. Rep EmbedThumbnail x -> EmbedThumbnail)
-> Generic EmbedThumbnail
forall x. Rep EmbedThumbnail x -> EmbedThumbnail
forall x. EmbedThumbnail -> Rep EmbedThumbnail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedThumbnail x -> EmbedThumbnail
$cfrom :: forall x. EmbedThumbnail -> Rep EmbedThumbnail x
Generic)
    deriving (Int -> EmbedThumbnail -> Builder
Int -> EmbedThumbnail -> Text
Int -> EmbedThumbnail -> Text
[EmbedThumbnail] -> Builder
[EmbedThumbnail] -> Text
[EmbedThumbnail] -> Text
EmbedThumbnail -> Builder
EmbedThumbnail -> Text
EmbedThumbnail -> Text
(Int -> EmbedThumbnail -> Builder)
-> (EmbedThumbnail -> Builder)
-> ([EmbedThumbnail] -> Builder)
-> (Int -> EmbedThumbnail -> Text)
-> (EmbedThumbnail -> Text)
-> ([EmbedThumbnail] -> Text)
-> (Int -> EmbedThumbnail -> Text)
-> (EmbedThumbnail -> Text)
-> ([EmbedThumbnail] -> Text)
-> TextShow EmbedThumbnail
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedThumbnail] -> Text
$cshowtlList :: [EmbedThumbnail] -> Text
showtl :: EmbedThumbnail -> Text
$cshowtl :: EmbedThumbnail -> Text
showtlPrec :: Int -> EmbedThumbnail -> Text
$cshowtlPrec :: Int -> EmbedThumbnail -> Text
showtList :: [EmbedThumbnail] -> Text
$cshowtList :: [EmbedThumbnail] -> Text
showt :: EmbedThumbnail -> Text
$cshowt :: EmbedThumbnail -> Text
showtPrec :: Int -> EmbedThumbnail -> Text
$cshowtPrec :: Int -> EmbedThumbnail -> Text
showbList :: [EmbedThumbnail] -> Builder
$cshowbList :: [EmbedThumbnail] -> Builder
showb :: EmbedThumbnail -> Builder
$cshowb :: EmbedThumbnail -> Builder
showbPrec :: Int -> EmbedThumbnail -> Builder
$cshowbPrec :: Int -> EmbedThumbnail -> Builder
TextShow) via TSG.FromGeneric EmbedThumbnail
    deriving (Value -> Parser [EmbedThumbnail]
Value -> Parser EmbedThumbnail
(Value -> Parser EmbedThumbnail)
-> (Value -> Parser [EmbedThumbnail]) -> FromJSON EmbedThumbnail
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedThumbnail]
$cparseJSONList :: Value -> Parser [EmbedThumbnail]
parseJSON :: Value -> Parser EmbedThumbnail
$cparseJSON :: Value -> Parser EmbedThumbnail
FromJSON, [EmbedThumbnail] -> Encoding
[EmbedThumbnail] -> Value
EmbedThumbnail -> Encoding
EmbedThumbnail -> Value
(EmbedThumbnail -> Value)
-> (EmbedThumbnail -> Encoding)
-> ([EmbedThumbnail] -> Value)
-> ([EmbedThumbnail] -> Encoding)
-> ToJSON EmbedThumbnail
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedThumbnail] -> Encoding
$ctoEncodingList :: [EmbedThumbnail] -> Encoding
toJSONList :: [EmbedThumbnail] -> Value
$ctoJSONList :: [EmbedThumbnail] -> Value
toEncoding :: EmbedThumbnail -> Encoding
$ctoEncoding :: EmbedThumbnail -> Encoding
toJSON :: EmbedThumbnail -> Value
$ctoJSON :: EmbedThumbnail -> Value
ToJSON) via CalamityJSON EmbedThumbnail

{- | Create an embed thumbnail with a provided url

 The remaining fields are set to Nothing
-}
embedThumbnail :: Text -> EmbedThumbnail
embedThumbnail :: Text -> EmbedThumbnail
embedThumbnail Text
url = Text
-> Maybe Text -> Maybe Word64 -> Maybe Word64 -> EmbedThumbnail
EmbedThumbnail Text
url Maybe Text
forall a. Maybe a
Nothing Maybe Word64
forall a. Maybe a
Nothing Maybe Word64
forall a. Maybe a
Nothing

data EmbedVideo = EmbedVideo
    { EmbedVideo -> Maybe Text
url :: Maybe Text
    , EmbedVideo -> Maybe Text
proxyUrl :: Maybe Text
    , EmbedVideo -> Maybe Word64
width :: Maybe Word64
    , EmbedVideo -> Maybe Word64
height :: Maybe Word64
    }
    deriving (EmbedVideo -> EmbedVideo -> Bool
(EmbedVideo -> EmbedVideo -> Bool)
-> (EmbedVideo -> EmbedVideo -> Bool) -> Eq EmbedVideo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedVideo -> EmbedVideo -> Bool
$c/= :: EmbedVideo -> EmbedVideo -> Bool
== :: EmbedVideo -> EmbedVideo -> Bool
$c== :: EmbedVideo -> EmbedVideo -> Bool
Eq, Int -> EmbedVideo -> ShowS
[EmbedVideo] -> ShowS
EmbedVideo -> String
(Int -> EmbedVideo -> ShowS)
-> (EmbedVideo -> String)
-> ([EmbedVideo] -> ShowS)
-> Show EmbedVideo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedVideo] -> ShowS
$cshowList :: [EmbedVideo] -> ShowS
show :: EmbedVideo -> String
$cshow :: EmbedVideo -> String
showsPrec :: Int -> EmbedVideo -> ShowS
$cshowsPrec :: Int -> EmbedVideo -> ShowS
Show, (forall x. EmbedVideo -> Rep EmbedVideo x)
-> (forall x. Rep EmbedVideo x -> EmbedVideo) -> Generic EmbedVideo
forall x. Rep EmbedVideo x -> EmbedVideo
forall x. EmbedVideo -> Rep EmbedVideo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedVideo x -> EmbedVideo
$cfrom :: forall x. EmbedVideo -> Rep EmbedVideo x
Generic)
    deriving (Int -> EmbedVideo -> Builder
Int -> EmbedVideo -> Text
Int -> EmbedVideo -> Text
[EmbedVideo] -> Builder
[EmbedVideo] -> Text
[EmbedVideo] -> Text
EmbedVideo -> Builder
EmbedVideo -> Text
EmbedVideo -> Text
(Int -> EmbedVideo -> Builder)
-> (EmbedVideo -> Builder)
-> ([EmbedVideo] -> Builder)
-> (Int -> EmbedVideo -> Text)
-> (EmbedVideo -> Text)
-> ([EmbedVideo] -> Text)
-> (Int -> EmbedVideo -> Text)
-> (EmbedVideo -> Text)
-> ([EmbedVideo] -> Text)
-> TextShow EmbedVideo
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedVideo] -> Text
$cshowtlList :: [EmbedVideo] -> Text
showtl :: EmbedVideo -> Text
$cshowtl :: EmbedVideo -> Text
showtlPrec :: Int -> EmbedVideo -> Text
$cshowtlPrec :: Int -> EmbedVideo -> Text
showtList :: [EmbedVideo] -> Text
$cshowtList :: [EmbedVideo] -> Text
showt :: EmbedVideo -> Text
$cshowt :: EmbedVideo -> Text
showtPrec :: Int -> EmbedVideo -> Text
$cshowtPrec :: Int -> EmbedVideo -> Text
showbList :: [EmbedVideo] -> Builder
$cshowbList :: [EmbedVideo] -> Builder
showb :: EmbedVideo -> Builder
$cshowb :: EmbedVideo -> Builder
showbPrec :: Int -> EmbedVideo -> Builder
$cshowbPrec :: Int -> EmbedVideo -> Builder
TextShow) via TSG.FromGeneric EmbedVideo
    deriving (Value -> Parser [EmbedVideo]
Value -> Parser EmbedVideo
(Value -> Parser EmbedVideo)
-> (Value -> Parser [EmbedVideo]) -> FromJSON EmbedVideo
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedVideo]
$cparseJSONList :: Value -> Parser [EmbedVideo]
parseJSON :: Value -> Parser EmbedVideo
$cparseJSON :: Value -> Parser EmbedVideo
FromJSON, [EmbedVideo] -> Encoding
[EmbedVideo] -> Value
EmbedVideo -> Encoding
EmbedVideo -> Value
(EmbedVideo -> Value)
-> (EmbedVideo -> Encoding)
-> ([EmbedVideo] -> Value)
-> ([EmbedVideo] -> Encoding)
-> ToJSON EmbedVideo
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedVideo] -> Encoding
$ctoEncodingList :: [EmbedVideo] -> Encoding
toJSONList :: [EmbedVideo] -> Value
$ctoJSONList :: [EmbedVideo] -> Value
toEncoding :: EmbedVideo -> Encoding
$ctoEncoding :: EmbedVideo -> Encoding
toJSON :: EmbedVideo -> Value
$ctoJSON :: EmbedVideo -> Value
ToJSON) via CalamityJSON EmbedVideo

data EmbedProvider = EmbedProvider
    { EmbedProvider -> Maybe Text
name :: Maybe Text
    , EmbedProvider -> Maybe Text
url :: Maybe Text
    }
    deriving (EmbedProvider -> EmbedProvider -> Bool
(EmbedProvider -> EmbedProvider -> Bool)
-> (EmbedProvider -> EmbedProvider -> Bool) -> Eq EmbedProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedProvider -> EmbedProvider -> Bool
$c/= :: EmbedProvider -> EmbedProvider -> Bool
== :: EmbedProvider -> EmbedProvider -> Bool
$c== :: EmbedProvider -> EmbedProvider -> Bool
Eq, Int -> EmbedProvider -> ShowS
[EmbedProvider] -> ShowS
EmbedProvider -> String
(Int -> EmbedProvider -> ShowS)
-> (EmbedProvider -> String)
-> ([EmbedProvider] -> ShowS)
-> Show EmbedProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedProvider] -> ShowS
$cshowList :: [EmbedProvider] -> ShowS
show :: EmbedProvider -> String
$cshow :: EmbedProvider -> String
showsPrec :: Int -> EmbedProvider -> ShowS
$cshowsPrec :: Int -> EmbedProvider -> ShowS
Show, (forall x. EmbedProvider -> Rep EmbedProvider x)
-> (forall x. Rep EmbedProvider x -> EmbedProvider)
-> Generic EmbedProvider
forall x. Rep EmbedProvider x -> EmbedProvider
forall x. EmbedProvider -> Rep EmbedProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedProvider x -> EmbedProvider
$cfrom :: forall x. EmbedProvider -> Rep EmbedProvider x
Generic)
    deriving (Int -> EmbedProvider -> Builder
Int -> EmbedProvider -> Text
Int -> EmbedProvider -> Text
[EmbedProvider] -> Builder
[EmbedProvider] -> Text
[EmbedProvider] -> Text
EmbedProvider -> Builder
EmbedProvider -> Text
EmbedProvider -> Text
(Int -> EmbedProvider -> Builder)
-> (EmbedProvider -> Builder)
-> ([EmbedProvider] -> Builder)
-> (Int -> EmbedProvider -> Text)
-> (EmbedProvider -> Text)
-> ([EmbedProvider] -> Text)
-> (Int -> EmbedProvider -> Text)
-> (EmbedProvider -> Text)
-> ([EmbedProvider] -> Text)
-> TextShow EmbedProvider
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedProvider] -> Text
$cshowtlList :: [EmbedProvider] -> Text
showtl :: EmbedProvider -> Text
$cshowtl :: EmbedProvider -> Text
showtlPrec :: Int -> EmbedProvider -> Text
$cshowtlPrec :: Int -> EmbedProvider -> Text
showtList :: [EmbedProvider] -> Text
$cshowtList :: [EmbedProvider] -> Text
showt :: EmbedProvider -> Text
$cshowt :: EmbedProvider -> Text
showtPrec :: Int -> EmbedProvider -> Text
$cshowtPrec :: Int -> EmbedProvider -> Text
showbList :: [EmbedProvider] -> Builder
$cshowbList :: [EmbedProvider] -> Builder
showb :: EmbedProvider -> Builder
$cshowb :: EmbedProvider -> Builder
showbPrec :: Int -> EmbedProvider -> Builder
$cshowbPrec :: Int -> EmbedProvider -> Builder
TextShow) via TSG.FromGeneric EmbedProvider
    deriving ([EmbedProvider] -> Encoding
[EmbedProvider] -> Value
EmbedProvider -> Encoding
EmbedProvider -> Value
(EmbedProvider -> Value)
-> (EmbedProvider -> Encoding)
-> ([EmbedProvider] -> Value)
-> ([EmbedProvider] -> Encoding)
-> ToJSON EmbedProvider
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedProvider] -> Encoding
$ctoEncodingList :: [EmbedProvider] -> Encoding
toJSONList :: [EmbedProvider] -> Value
$ctoJSONList :: [EmbedProvider] -> Value
toEncoding :: EmbedProvider -> Encoding
$ctoEncoding :: EmbedProvider -> Encoding
toJSON :: EmbedProvider -> Value
$ctoJSON :: EmbedProvider -> Value
ToJSON, Value -> Parser [EmbedProvider]
Value -> Parser EmbedProvider
(Value -> Parser EmbedProvider)
-> (Value -> Parser [EmbedProvider]) -> FromJSON EmbedProvider
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedProvider]
$cparseJSONList :: Value -> Parser [EmbedProvider]
parseJSON :: Value -> Parser EmbedProvider
$cparseJSON :: Value -> Parser EmbedProvider
FromJSON) via CalamityJSON EmbedProvider

data EmbedAuthor = EmbedAuthor
    { EmbedAuthor -> Maybe Text
name :: Maybe Text
    , EmbedAuthor -> Maybe Text
url :: Maybe Text
    , EmbedAuthor -> Maybe Text
iconUrl :: Maybe Text
    , EmbedAuthor -> Maybe Text
proxyIconURL :: Maybe Text
    }
    deriving (EmbedAuthor -> EmbedAuthor -> Bool
(EmbedAuthor -> EmbedAuthor -> Bool)
-> (EmbedAuthor -> EmbedAuthor -> Bool) -> Eq EmbedAuthor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedAuthor -> EmbedAuthor -> Bool
$c/= :: EmbedAuthor -> EmbedAuthor -> Bool
== :: EmbedAuthor -> EmbedAuthor -> Bool
$c== :: EmbedAuthor -> EmbedAuthor -> Bool
Eq, Int -> EmbedAuthor -> ShowS
[EmbedAuthor] -> ShowS
EmbedAuthor -> String
(Int -> EmbedAuthor -> ShowS)
-> (EmbedAuthor -> String)
-> ([EmbedAuthor] -> ShowS)
-> Show EmbedAuthor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedAuthor] -> ShowS
$cshowList :: [EmbedAuthor] -> ShowS
show :: EmbedAuthor -> String
$cshow :: EmbedAuthor -> String
showsPrec :: Int -> EmbedAuthor -> ShowS
$cshowsPrec :: Int -> EmbedAuthor -> ShowS
Show, (forall x. EmbedAuthor -> Rep EmbedAuthor x)
-> (forall x. Rep EmbedAuthor x -> EmbedAuthor)
-> Generic EmbedAuthor
forall x. Rep EmbedAuthor x -> EmbedAuthor
forall x. EmbedAuthor -> Rep EmbedAuthor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedAuthor x -> EmbedAuthor
$cfrom :: forall x. EmbedAuthor -> Rep EmbedAuthor x
Generic, EmbedAuthor
EmbedAuthor -> Default EmbedAuthor
forall a. a -> Default a
def :: EmbedAuthor
$cdef :: EmbedAuthor
Default)
    deriving (Int -> EmbedAuthor -> Builder
Int -> EmbedAuthor -> Text
Int -> EmbedAuthor -> Text
[EmbedAuthor] -> Builder
[EmbedAuthor] -> Text
[EmbedAuthor] -> Text
EmbedAuthor -> Builder
EmbedAuthor -> Text
EmbedAuthor -> Text
(Int -> EmbedAuthor -> Builder)
-> (EmbedAuthor -> Builder)
-> ([EmbedAuthor] -> Builder)
-> (Int -> EmbedAuthor -> Text)
-> (EmbedAuthor -> Text)
-> ([EmbedAuthor] -> Text)
-> (Int -> EmbedAuthor -> Text)
-> (EmbedAuthor -> Text)
-> ([EmbedAuthor] -> Text)
-> TextShow EmbedAuthor
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedAuthor] -> Text
$cshowtlList :: [EmbedAuthor] -> Text
showtl :: EmbedAuthor -> Text
$cshowtl :: EmbedAuthor -> Text
showtlPrec :: Int -> EmbedAuthor -> Text
$cshowtlPrec :: Int -> EmbedAuthor -> Text
showtList :: [EmbedAuthor] -> Text
$cshowtList :: [EmbedAuthor] -> Text
showt :: EmbedAuthor -> Text
$cshowt :: EmbedAuthor -> Text
showtPrec :: Int -> EmbedAuthor -> Text
$cshowtPrec :: Int -> EmbedAuthor -> Text
showbList :: [EmbedAuthor] -> Builder
$cshowbList :: [EmbedAuthor] -> Builder
showb :: EmbedAuthor -> Builder
$cshowb :: EmbedAuthor -> Builder
showbPrec :: Int -> EmbedAuthor -> Builder
$cshowbPrec :: Int -> EmbedAuthor -> Builder
TextShow) via TSG.FromGeneric EmbedAuthor
    deriving ([EmbedAuthor] -> Encoding
[EmbedAuthor] -> Value
EmbedAuthor -> Encoding
EmbedAuthor -> Value
(EmbedAuthor -> Value)
-> (EmbedAuthor -> Encoding)
-> ([EmbedAuthor] -> Value)
-> ([EmbedAuthor] -> Encoding)
-> ToJSON EmbedAuthor
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedAuthor] -> Encoding
$ctoEncodingList :: [EmbedAuthor] -> Encoding
toJSONList :: [EmbedAuthor] -> Value
$ctoJSONList :: [EmbedAuthor] -> Value
toEncoding :: EmbedAuthor -> Encoding
$ctoEncoding :: EmbedAuthor -> Encoding
toJSON :: EmbedAuthor -> Value
$ctoJSON :: EmbedAuthor -> Value
ToJSON, Value -> Parser [EmbedAuthor]
Value -> Parser EmbedAuthor
(Value -> Parser EmbedAuthor)
-> (Value -> Parser [EmbedAuthor]) -> FromJSON EmbedAuthor
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedAuthor]
$cparseJSONList :: Value -> Parser [EmbedAuthor]
parseJSON :: Value -> Parser EmbedAuthor
$cparseJSON :: Value -> Parser EmbedAuthor
FromJSON) via CalamityJSON EmbedAuthor

{- | Create an embed author with the given name

 The remaining fields are set to Nothing
-}
embedAuthor :: Text -> EmbedAuthor
embedAuthor :: Text -> EmbedAuthor
embedAuthor Text
name = Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> EmbedAuthor
EmbedAuthor (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
name) Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing Maybe Text
forall a. Maybe a
Nothing

{- | Create an embed author with the given name, url, and icon url

 The remaining fields are set to Nothing
-}
embedAuthor' ::
    -- | Name
    Text ->
    -- | Url
    Text ->
    -- | Icon url
    Text ->
    EmbedAuthor
embedAuthor' :: Text -> Text -> Text -> EmbedAuthor
embedAuthor' Text
name Text
url Text
iconUrl = Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> EmbedAuthor
EmbedAuthor (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
name) (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
url) (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
iconUrl) Maybe Text
forall a. Maybe a
Nothing

data EmbedField = EmbedField
    { EmbedField -> Text
name :: Text
    , EmbedField -> Text
value :: Text
    , EmbedField -> Bool
inline :: Bool
    }
    deriving (EmbedField -> EmbedField -> Bool
(EmbedField -> EmbedField -> Bool)
-> (EmbedField -> EmbedField -> Bool) -> Eq EmbedField
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EmbedField -> EmbedField -> Bool
$c/= :: EmbedField -> EmbedField -> Bool
== :: EmbedField -> EmbedField -> Bool
$c== :: EmbedField -> EmbedField -> Bool
Eq, Int -> EmbedField -> ShowS
[EmbedField] -> ShowS
EmbedField -> String
(Int -> EmbedField -> ShowS)
-> (EmbedField -> String)
-> ([EmbedField] -> ShowS)
-> Show EmbedField
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EmbedField] -> ShowS
$cshowList :: [EmbedField] -> ShowS
show :: EmbedField -> String
$cshow :: EmbedField -> String
showsPrec :: Int -> EmbedField -> ShowS
$cshowsPrec :: Int -> EmbedField -> ShowS
Show, (forall x. EmbedField -> Rep EmbedField x)
-> (forall x. Rep EmbedField x -> EmbedField) -> Generic EmbedField
forall x. Rep EmbedField x -> EmbedField
forall x. EmbedField -> Rep EmbedField x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EmbedField x -> EmbedField
$cfrom :: forall x. EmbedField -> Rep EmbedField x
Generic)
    deriving (Int -> EmbedField -> Builder
Int -> EmbedField -> Text
Int -> EmbedField -> Text
[EmbedField] -> Builder
[EmbedField] -> Text
[EmbedField] -> Text
EmbedField -> Builder
EmbedField -> Text
EmbedField -> Text
(Int -> EmbedField -> Builder)
-> (EmbedField -> Builder)
-> ([EmbedField] -> Builder)
-> (Int -> EmbedField -> Text)
-> (EmbedField -> Text)
-> ([EmbedField] -> Text)
-> (Int -> EmbedField -> Text)
-> (EmbedField -> Text)
-> ([EmbedField] -> Text)
-> TextShow EmbedField
forall a.
(Int -> a -> Builder)
-> (a -> Builder)
-> ([a] -> Builder)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> (Int -> a -> Text)
-> (a -> Text)
-> ([a] -> Text)
-> TextShow a
showtlList :: [EmbedField] -> Text
$cshowtlList :: [EmbedField] -> Text
showtl :: EmbedField -> Text
$cshowtl :: EmbedField -> Text
showtlPrec :: Int -> EmbedField -> Text
$cshowtlPrec :: Int -> EmbedField -> Text
showtList :: [EmbedField] -> Text
$cshowtList :: [EmbedField] -> Text
showt :: EmbedField -> Text
$cshowt :: EmbedField -> Text
showtPrec :: Int -> EmbedField -> Text
$cshowtPrec :: Int -> EmbedField -> Text
showbList :: [EmbedField] -> Builder
$cshowbList :: [EmbedField] -> Builder
showb :: EmbedField -> Builder
$cshowb :: EmbedField -> Builder
showbPrec :: Int -> EmbedField -> Builder
$cshowbPrec :: Int -> EmbedField -> Builder
TextShow) via TSG.FromGeneric EmbedField
    deriving
        (Value -> Parser [EmbedField]
Value -> Parser EmbedField
(Value -> Parser EmbedField)
-> (Value -> Parser [EmbedField]) -> FromJSON EmbedField
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [EmbedField]
$cparseJSONList :: Value -> Parser [EmbedField]
parseJSON :: Value -> Parser EmbedField
$cparseJSON :: Value -> Parser EmbedField
FromJSON)
        via WithSpecialCases
                '[IfNoneThen "inline" DefaultToFalse]
                EmbedField
    deriving ([EmbedField] -> Encoding
[EmbedField] -> Value
EmbedField -> Encoding
EmbedField -> Value
(EmbedField -> Value)
-> (EmbedField -> Encoding)
-> ([EmbedField] -> Value)
-> ([EmbedField] -> Encoding)
-> ToJSON EmbedField
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [EmbedField] -> Encoding
$ctoEncodingList :: [EmbedField] -> Encoding
toJSONList :: [EmbedField] -> Value
$ctoJSONList :: [EmbedField] -> Value
toEncoding :: EmbedField -> Encoding
$ctoEncoding :: EmbedField -> Encoding
toJSON :: EmbedField -> Value
$ctoJSON :: EmbedField -> Value
ToJSON) via CalamityJSON EmbedField

-- | Create a non-inline embed field
embedField ::
    -- | Name
    Text ->
    -- | Value
    Text ->
    EmbedField
embedField :: Text -> Text -> EmbedField
embedField Text
name Text
value = Text -> Text -> Bool -> EmbedField
EmbedField Text
name Text
value Bool
False