module TD.Query.RemoveStoryAlbumStories
  (RemoveStoryAlbumStories(..)
  , defaultRemoveStoryAlbumStories
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Removes stories from an album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album. Returns 'TD.Data.StoryAlbum.StoryAlbum'
data RemoveStoryAlbumStories
  = RemoveStoryAlbumStories
    { RemoveStoryAlbumStories -> Maybe Int
chat_id        :: Maybe Int   -- ^ Identifier of the chat that owns the stories
    , RemoveStoryAlbumStories -> Maybe Int
story_album_id :: Maybe Int   -- ^ Identifier of the story album
    , RemoveStoryAlbumStories -> Maybe [Int]
story_ids      :: Maybe [Int] -- ^ Identifier of the stories to remove from the album
    }
  deriving (RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool
(RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool)
-> (RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool)
-> Eq RemoveStoryAlbumStories
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool
== :: RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool
$c/= :: RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool
/= :: RemoveStoryAlbumStories -> RemoveStoryAlbumStories -> Bool
Eq, Int -> RemoveStoryAlbumStories -> ShowS
[RemoveStoryAlbumStories] -> ShowS
RemoveStoryAlbumStories -> String
(Int -> RemoveStoryAlbumStories -> ShowS)
-> (RemoveStoryAlbumStories -> String)
-> ([RemoveStoryAlbumStories] -> ShowS)
-> Show RemoveStoryAlbumStories
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoveStoryAlbumStories -> ShowS
showsPrec :: Int -> RemoveStoryAlbumStories -> ShowS
$cshow :: RemoveStoryAlbumStories -> String
show :: RemoveStoryAlbumStories -> String
$cshowList :: [RemoveStoryAlbumStories] -> ShowS
showList :: [RemoveStoryAlbumStories] -> ShowS
Show)

instance I.ShortShow RemoveStoryAlbumStories where
  shortShow :: RemoveStoryAlbumStories -> String
shortShow
    RemoveStoryAlbumStories
      { chat_id :: RemoveStoryAlbumStories -> Maybe Int
chat_id        = Maybe Int
chat_id_
      , story_album_id :: RemoveStoryAlbumStories -> Maybe Int
story_album_id = Maybe Int
story_album_id_
      , story_ids :: RemoveStoryAlbumStories -> Maybe [Int]
story_ids      = Maybe [Int]
story_ids_
      }
        = String
"RemoveStoryAlbumStories"
          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
"story_album_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_album_id_
          , String
"story_ids"      String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
story_ids_
          ]

instance AT.ToJSON RemoveStoryAlbumStories where
  toJSON :: RemoveStoryAlbumStories -> Value
toJSON
    RemoveStoryAlbumStories
      { chat_id :: RemoveStoryAlbumStories -> Maybe Int
chat_id        = Maybe Int
chat_id_
      , story_album_id :: RemoveStoryAlbumStories -> Maybe Int
story_album_id = Maybe Int
story_album_id_
      , story_ids :: RemoveStoryAlbumStories -> Maybe [Int]
story_ids      = Maybe [Int]
story_ids_
      }
        = [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
"removeStoryAlbumStories"
          , 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
"story_album_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
story_album_id_
          , Key
"story_ids"      Key -> Maybe [Int] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Int]
story_ids_
          ]

defaultRemoveStoryAlbumStories :: RemoveStoryAlbumStories
defaultRemoveStoryAlbumStories :: RemoveStoryAlbumStories
defaultRemoveStoryAlbumStories =
  RemoveStoryAlbumStories
    { chat_id :: Maybe Int
chat_id        = Maybe Int
forall a. Maybe a
Nothing
    , story_album_id :: Maybe Int
story_album_id = Maybe Int
forall a. Maybe a
Nothing
    , story_ids :: Maybe [Int]
story_ids      = Maybe [Int]
forall a. Maybe a
Nothing
    }