module TD.Query.SetBusinessAccountBio
  (SetBusinessAccountBio(..)
  , defaultSetBusinessAccountBio
  ) 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

-- | Changes the bio of a business account; for bots only. Returns 'TD.Data.Ok.Ok'
data SetBusinessAccountBio
  = SetBusinessAccountBio
    { SetBusinessAccountBio -> Maybe Text
business_connection_id :: Maybe T.Text -- ^ Unique identifier of business connection
    , SetBusinessAccountBio -> Maybe Text
bio                    :: Maybe T.Text -- ^ The new value of the bio; 0-getOption("bio_length_max") characters without line feeds
    }
  deriving (SetBusinessAccountBio -> SetBusinessAccountBio -> Bool
(SetBusinessAccountBio -> SetBusinessAccountBio -> Bool)
-> (SetBusinessAccountBio -> SetBusinessAccountBio -> Bool)
-> Eq SetBusinessAccountBio
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetBusinessAccountBio -> SetBusinessAccountBio -> Bool
== :: SetBusinessAccountBio -> SetBusinessAccountBio -> Bool
$c/= :: SetBusinessAccountBio -> SetBusinessAccountBio -> Bool
/= :: SetBusinessAccountBio -> SetBusinessAccountBio -> Bool
Eq, Int -> SetBusinessAccountBio -> ShowS
[SetBusinessAccountBio] -> ShowS
SetBusinessAccountBio -> String
(Int -> SetBusinessAccountBio -> ShowS)
-> (SetBusinessAccountBio -> String)
-> ([SetBusinessAccountBio] -> ShowS)
-> Show SetBusinessAccountBio
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetBusinessAccountBio -> ShowS
showsPrec :: Int -> SetBusinessAccountBio -> ShowS
$cshow :: SetBusinessAccountBio -> String
show :: SetBusinessAccountBio -> String
$cshowList :: [SetBusinessAccountBio] -> ShowS
showList :: [SetBusinessAccountBio] -> ShowS
Show)

instance I.ShortShow SetBusinessAccountBio where
  shortShow :: SetBusinessAccountBio -> String
shortShow
    SetBusinessAccountBio
      { business_connection_id :: SetBusinessAccountBio -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
      , bio :: SetBusinessAccountBio -> Maybe Text
bio                    = Maybe Text
bio_
      }
        = String
"SetBusinessAccountBio"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
          , String
"bio"                    String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
bio_
          ]

instance AT.ToJSON SetBusinessAccountBio where
  toJSON :: SetBusinessAccountBio -> Value
toJSON
    SetBusinessAccountBio
      { business_connection_id :: SetBusinessAccountBio -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
      , bio :: SetBusinessAccountBio -> Maybe Text
bio                    = Maybe Text
bio_
      }
        = [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
"setBusinessAccountBio"
          , Key
"business_connection_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
business_connection_id_
          , Key
"bio"                    Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
bio_
          ]

defaultSetBusinessAccountBio :: SetBusinessAccountBio
defaultSetBusinessAccountBio :: SetBusinessAccountBio
defaultSetBusinessAccountBio =
  SetBusinessAccountBio
    { business_connection_id :: Maybe Text
business_connection_id = Maybe Text
forall a. Maybe a
Nothing
    , bio :: Maybe Text
bio                    = Maybe Text
forall a. Maybe a
Nothing
    }