module TD.Query.CreateChatSubscriptionInviteLink
(CreateChatSubscriptionInviteLink(..)
, defaultCreateChatSubscriptionInviteLink
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
import qualified TD.Data.StarSubscriptionPricing as StarSubscriptionPricing
data CreateChatSubscriptionInviteLink
= CreateChatSubscriptionInviteLink
{ CreateChatSubscriptionInviteLink -> Maybe Int
chat_id :: Maybe Int
, CreateChatSubscriptionInviteLink -> Maybe Text
name :: Maybe T.Text
, CreateChatSubscriptionInviteLink -> Maybe StarSubscriptionPricing
subscription_pricing :: Maybe StarSubscriptionPricing.StarSubscriptionPricing
}
deriving (CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool
(CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool)
-> (CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool)
-> Eq CreateChatSubscriptionInviteLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool
== :: CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool
$c/= :: CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool
/= :: CreateChatSubscriptionInviteLink
-> CreateChatSubscriptionInviteLink -> Bool
Eq, Int -> CreateChatSubscriptionInviteLink -> ShowS
[CreateChatSubscriptionInviteLink] -> ShowS
CreateChatSubscriptionInviteLink -> String
(Int -> CreateChatSubscriptionInviteLink -> ShowS)
-> (CreateChatSubscriptionInviteLink -> String)
-> ([CreateChatSubscriptionInviteLink] -> ShowS)
-> Show CreateChatSubscriptionInviteLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateChatSubscriptionInviteLink -> ShowS
showsPrec :: Int -> CreateChatSubscriptionInviteLink -> ShowS
$cshow :: CreateChatSubscriptionInviteLink -> String
show :: CreateChatSubscriptionInviteLink -> String
$cshowList :: [CreateChatSubscriptionInviteLink] -> ShowS
showList :: [CreateChatSubscriptionInviteLink] -> ShowS
Show)
instance I.ShortShow CreateChatSubscriptionInviteLink where
shortShow :: CreateChatSubscriptionInviteLink -> String
shortShow
CreateChatSubscriptionInviteLink
{ chat_id :: CreateChatSubscriptionInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, name :: CreateChatSubscriptionInviteLink -> Maybe Text
name = Maybe Text
name_
, subscription_pricing :: CreateChatSubscriptionInviteLink -> Maybe StarSubscriptionPricing
subscription_pricing = Maybe StarSubscriptionPricing
subscription_pricing_
}
= String
"CreateChatSubscriptionInviteLink"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"subscription_pricing" String -> Maybe StarSubscriptionPricing -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StarSubscriptionPricing
subscription_pricing_
]
instance AT.ToJSON CreateChatSubscriptionInviteLink where
toJSON :: CreateChatSubscriptionInviteLink -> Value
toJSON
CreateChatSubscriptionInviteLink
{ chat_id :: CreateChatSubscriptionInviteLink -> Maybe Int
chat_id = Maybe Int
chat_id_
, name :: CreateChatSubscriptionInviteLink -> Maybe Text
name = Maybe Text
name_
, subscription_pricing :: CreateChatSubscriptionInviteLink -> Maybe StarSubscriptionPricing
subscription_pricing = Maybe StarSubscriptionPricing
subscription_pricing_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"createChatSubscriptionInviteLink"
, Key
"chat_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
, Key
"name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
name_
, Key
"subscription_pricing" Key -> Maybe StarSubscriptionPricing -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StarSubscriptionPricing
subscription_pricing_
]
defaultCreateChatSubscriptionInviteLink :: CreateChatSubscriptionInviteLink
defaultCreateChatSubscriptionInviteLink :: CreateChatSubscriptionInviteLink
defaultCreateChatSubscriptionInviteLink =
CreateChatSubscriptionInviteLink
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, subscription_pricing :: Maybe StarSubscriptionPricing
subscription_pricing = Maybe StarSubscriptionPricing
forall a. Maybe a
Nothing
}