Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
2 similar comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Author
|
That's way more diff than I was expecting 🤔 |
d7ceed2 to
f194057
Compare
4cb08ea to
3efc4cc
Compare
Collaborator
Author
|
Depends on #295 |
This comment was marked as outdated.
This comment was marked as outdated.
6 tasks
3efc4cc to
818f042
Compare
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/MultipartFormData/Api.elm branch/cli/generated/MultipartFormData/Api.elm
0a1,259
> module MultipartFormData.Api exposing (api, apiTask, noMaybes, noMaybesTask)
>
> {-|
>
>
> ## Operations
>
> @docs api, apiTask, noMaybes, noMaybesTask
>
> -}
>
> import Bytes
> import Dict
> import Http
> import Json.Decode
> import Json.Encode
> import OpenApi.Common
> import Task
> import Url.Builder
>
>
> api :
> { toMsg : Result (OpenApi.Common.Error e String) () -> msg
> , body :
> { address : Maybe { city : Maybe String, street : Maybe String }
> , id : String
> , profileImage : Maybe Bytes.Bytes
> }
> }
> -> Cmd msg
> api config =
> Http.request
> { url = Url.Builder.absolute [ "api" ] []
> , method = "POST"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> (Json.Decode.succeed ())
> config.toMsg
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "address"
> (Json.Encode.encode
> 0
> (Json.Encode.object
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack0 ->
> ( "city"
> , Json.Encode.string
> mapUnpack0
> )
> )
> mapUnpack.city
> , Maybe.map
> (\mapUnpack0 ->
> ( "street"
> , Json.Encode.string
> mapUnpack0
> )
> )
> mapUnpack.street
> ]
> )
> )
> )
> )
> config.body.address
> , Just (Http.stringPart "id" config.body.id)
> , Maybe.map
> (Http.bytesPart
> "profileImage"
> "application/octet-stream"
> )
> config.body.profileImage
> ]
> )
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> apiTask :
> { body :
> { address : Maybe { city : Maybe String, street : Maybe String }
> , id : String
> , profileImage : Maybe Bytes.Bytes
> }
> }
> -> Task.Task (OpenApi.Common.Error e String) ()
> apiTask config =
> Http.task
> { url = Url.Builder.absolute [ "api" ] []
> , method = "POST"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> (Json.Decode.succeed ())
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "address"
> (Json.Encode.encode
> 0
> (Json.Encode.object
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack0 ->
> ( "city"
> , Json.Encode.string
> mapUnpack0
> )
> )
> mapUnpack.city
> , Maybe.map
> (\mapUnpack0 ->
> ( "street"
> , Json.Encode.string
> mapUnpack0
> )
> )
> mapUnpack.street
> ]
> )
> )
> )
> )
> config.body.address
> , Just (Http.stringPart "id" config.body.id)
> , Maybe.map
> (Http.bytesPart
> "profileImage"
> "application/octet-stream"
> )
> config.body.profileImage
> ]
> )
> , timeout = Nothing
> }
>
>
> noMaybes :
> { toMsg : Result (OpenApi.Common.Error e String) () -> msg
> , body :
> { address : { city : Maybe String, street : Maybe String }
> , id : String
> , profileImage : Bytes.Bytes
> }
> }
> -> Cmd msg
> noMaybes config =
> Http.request
> { url = Url.Builder.absolute [ "noMaybes" ] []
> , method = "POST"
> , headers = []
> , expect =
> OpenApi.Common.expectJsonCustom
> (Dict.fromList [])
> (Json.Decode.succeed ())
> config.toMsg
> , body =
> Http.multipartBody
> [ Http.stringPart
> "address"
> (Json.Encode.encode
> 0
> (Json.Encode.object
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack ->
> ( "city", Json.Encode.string mapUnpack )
> )
> config.body.address.city
> , Maybe.map
> (\mapUnpack ->
> ( "street"
> , Json.Encode.string mapUnpack
> )
> )
> config.body.address.street
> ]
> )
> )
> )
> , Http.stringPart "id" config.body.id
> , Http.bytesPart
> "profileImage"
> "application/octet-stream"
> config.body.profileImage
> ]
> , timeout = Nothing
> , tracker = Nothing
> }
>
>
> noMaybesTask :
> { body :
> { address : { city : Maybe String, street : Maybe String }
> , id : String
> , profileImage : Bytes.Bytes
> }
> }
> -> Task.Task (OpenApi.Common.Error e String) ()
> noMaybesTask config =
> Http.task
> { url = Url.Builder.absolute [ "noMaybes" ] []
> , method = "POST"
> , headers = []
> , resolver =
> OpenApi.Common.jsonResolverCustom
> (Dict.fromList [])
> (Json.Decode.succeed ())
> , body =
> Http.multipartBody
> [ Http.stringPart
> "address"
> (Json.Encode.encode
> 0
> (Json.Encode.object
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (\mapUnpack ->
> ( "city", Json.Encode.string mapUnpack )
> )
> config.body.address.city
> , Maybe.map
> (\mapUnpack ->
> ( "street"
> , Json.Encode.string mapUnpack
> )
> )
> config.body.address.street
> ]
> )
> )
> )
> , Http.stringPart "id" config.body.id
> , Http.bytesPart
> "profileImage"
> "application/octet-stream"
> config.body.profileImage
> ]
> , timeout = Nothing
> }
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/MultipartFormData/Types/RequestBodies.elm branch/cli/generated/MultipartFormData/Types/RequestBodies.elm
0a1,26
> module MultipartFormData.Types.RequestBodies exposing (Multipart, MultipartNoMaybes)
>
> {-|
>
>
> ## Aliases
>
> @docs Multipart, MultipartNoMaybes
>
> -}
>
> import Uuid
>
>
> type alias Multipart =
> { address : Maybe { city : Maybe String, street : Maybe String }
> , id : Uuid.Uuid
> , profileImage : Maybe String
> }
>
>
> type alias MultipartNoMaybes =
> { address : { city : Maybe String, street : Maybe String }
> , id : Uuid.Uuid
> , profileImage : String
> }
diff --ignore-all-space --minimal --new-file --recursive main/cli/generated/TelegramBotApi/Api.elm branch/cli/generated/TelegramBotApi/Api.elm
120d119
< import Bytes
133a133,148
> addStickerToSet :
> { toMsg :
> Result
> (OpenApi.Common.Error TelegramBotApi.Types.Error String)
> { ok :
> Bool
> , result : Bool
> }
> -> msg
> , body :
> { name : String
> , sticker : TelegramBotApi.Types.InputSticker
> , user_id : Int
> }
> }
> -> Cmd msg
159c174,188
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> [ Http.stringPart "name" config.body.name
> , Http.stringPart
> "sticker"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputSticker
> config.body.sticker
> )
> )
> , Http.stringPart
> "user_id"
> (Json.Encode.encode 0 (Json.Encode.int config.body.user_id))
> ]
168c197,202
< { body : Bytes.Bytes }
---
> { body :
> { name : String
> , sticker : TelegramBotApi.Types.InputSticker
> , user_id : Int
> }
> }
200c234,248
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> [ Http.stringPart "name" config.body.name
> , Http.stringPart
> "sticker"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputSticker
> config.body.sticker
> )
> )
> , Http.stringPart
> "user_id"
> (Json.Encode.encode 0 (Json.Encode.int config.body.user_id))
> ]
3393a3442,3460
> createNewStickerSet :
> { toMsg :
> Result
> (OpenApi.Common.Error TelegramBotApi.Types.Error String)
> { ok :
> Bool
> , result : Bool
> }
> -> msg
> , body :
> { name : String
> , needs_repainting : Maybe Bool
> , sticker_type : Maybe String
> , stickers : List TelegramBotApi.Types.InputSticker
> , title : String
> , user_id : Int
> }
> }
> -> Cmd msg
3419c3486,3532
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Just (Http.stringPart "name" config.body.name)
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "needs_repainting"
> (Json.Encode.encode
> 0
> (Json.Encode.bool mapUnpack)
> )
> )
> config.body.needs_repainting
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "sticker_type"
> (Json.Encode.encode
> 0
> (Json.Encode.string mapUnpack)
> )
> )
> config.body.sticker_type
> , Just
> (Http.stringPart
> "stickers"
> (Json.Encode.encode
> 0
> (Json.Encode.list
> TelegramBotApi.Json.encodeInputSticker
> config.body.stickers
> )
> )
> )
> , Just (Http.stringPart "title" config.body.title)
> , Just
> (Http.stringPart
> "user_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.user_id)
> )
> )
> ]
> )
3428c3541,3549
< { body : Bytes.Bytes }
---
> { body :
> { name : String
> , needs_repainting : Maybe Bool
> , sticker_type : Maybe String
> , stickers : List TelegramBotApi.Types.InputSticker
> , title : String
> , user_id : Int
> }
> }
3460c3581,3627
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Just (Http.stringPart "name" config.body.name)
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "needs_repainting"
> (Json.Encode.encode
> 0
> (Json.Encode.bool mapUnpack)
> )
> )
> config.body.needs_repainting
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "sticker_type"
> (Json.Encode.encode
> 0
> (Json.Encode.string mapUnpack)
> )
> )
> config.body.sticker_type
> , Just
> (Http.stringPart
> "stickers"
> (Json.Encode.encode
> 0
> (Json.Encode.list
> TelegramBotApi.Json.encodeInputSticker
> config.body.stickers
> )
> )
> )
> , Just (Http.stringPart "title" config.body.title)
> , Just
> (Http.stringPart
> "user_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.user_id)
> )
> )
> ]
> )
5802a5970,5987
> editMessageChecklist :
> { toMsg :
> Result
> (OpenApi.Common.Error TelegramBotApi.Types.Error String)
> { ok :
> Bool
> , result : TelegramBotApi.Types.Message
> }
> -> msg
> , body :
> { business_connection_id : String
> , chat_id : Int
> , checklist : TelegramBotApi.Types.InputChecklist
> , message_id : Int
> , reply_markup : Maybe TelegramBotApi.Types.InlineKeyboardMarkup
> }
> }
> -> Cmd msg
5828c6013,6061
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Just
> (Http.stringPart
> "business_connection_id"
> config.body.business_connection_id
> )
> , Just
> (Http.stringPart
> "chat_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.chat_id)
> )
> )
> , Just
> (Http.stringPart
> "checklist"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputChecklist
> config.body.checklist
> )
> )
> )
> , Just
> (Http.stringPart
> "message_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.message_id)
> )
> )
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "reply_markup"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInlineKeyboardMarkup
> mapUnpack
> )
> )
> )
> config.body.reply_markup
> ]
> )
5837c6070,6077
< { body : Bytes.Bytes }
---
> { body :
> { business_connection_id : String
> , chat_id : Int
> , checklist : TelegramBotApi.Types.InputChecklist
> , message_id : Int
> , reply_markup : Maybe TelegramBotApi.Types.InlineKeyboardMarkup
> }
> }
5869c6109,6157
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Just
> (Http.stringPart
> "business_connection_id"
> config.body.business_connection_id
> )
> , Just
> (Http.stringPart
> "chat_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.chat_id)
> )
> )
> , Just
> (Http.stringPart
> "checklist"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputChecklist
> config.body.checklist
> )
> )
> )
> , Just
> (Http.stringPart
> "message_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int config.body.message_id)
> )
> )
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "reply_markup"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInlineKeyboardMarkup
> mapUnpack
> )
> )
> )
> config.body.reply_markup
> ]
> )
6167c6455,6462
< , body : Bytes.Bytes
---
> , body :
> { business_connection_id : Maybe String
> , chat_id : Maybe TelegramBotApi.Types.Int_Or_String
> , inline_message_id : Maybe String
> , media : TelegramBotApi.Types.InputMedia
> , message_id : Maybe Int
> , reply_markup : Maybe TelegramBotApi.Types.InlineKeyboardMarkup
> }
6203c6498,6557
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (Http.stringPart "business_connection_id")
> config.body.business_connection_id
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "chat_id"
> (Json.Encode.encode
> 0
> (case mapUnpack of
> TelegramBotApi.Types.Int_Or_String__Int content ->
> Json.Encode.int content
>
> TelegramBotApi.Types.Int_Or_String__String content ->
> Json.Encode.string content
> )
> )
> )
> config.body.chat_id
> , Maybe.map
> (Http.stringPart "inline_message_id")
> config.body.inline_message_id
> , Just
> (Http.stringPart
> "media"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputMedia
> config.body.media
> )
> )
> )
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "message_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int mapUnpack)
> )
> )
> config.body.message_id
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "reply_markup"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInlineKeyboardMarkup
> mapUnpack
> )
> )
> )
> config.body.reply_markup
> ]
> )
6212c6566,6574
< { body : Bytes.Bytes }
---
> { body :
> { business_connection_id : Maybe String
> , chat_id : Maybe TelegramBotApi.Types.Int_Or_String
> , inline_message_id : Maybe String
> , media : TelegramBotApi.Types.InputMedia
> , message_id : Maybe Int
> , reply_markup : Maybe TelegramBotApi.Types.InlineKeyboardMarkup
> }
> }
6252c6614,6673
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> Http.multipartBody
> (List.filterMap
> Basics.identity
> [ Maybe.map
> (Http.stringPart "business_connection_id")
> config.body.business_connection_id
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "chat_id"
> (Json.Encode.encode
> 0
> (case mapUnpack of
> TelegramBotApi.Types.Int_Or_String__Int content ->
> Json.Encode.int content
>
> TelegramBotApi.Types.Int_Or_String__String content ->
> Json.Encode.string content
> )
> )
> )
> config.body.chat_id
> , Maybe.map
> (Http.stringPart "inline_message_id")
> config.body.inline_message_id
> , Just
> (Http.stringPart
> "media"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInputMedia
> config.body.media
> )
> )
> )
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "message_id"
> (Json.Encode.encode
> 0
> (Json.Encode.int mapUnpack)
> )
> )
> config.body.message_id
> , Maybe.map
> (\mapUnpack ->
> Http.stringPart
> "reply_markup"
> (Json.Encode.encode
> 0
> (TelegramBotApi.Json.encodeInlineKeyboardMarkup
> mapUnpack
> )
> )
> )
> config.body.reply_markup
> ]
> )
6724a7146,7165
> editStory :
> { toMsg :
> Result
> (OpenApi.Common.Error TelegramBotApi.Types.Error String)
> { ok :
> Bool
> , result : TelegramBotApi.Types.Story
> }
> -> msg
> , body :
> { areas : Maybe (List TelegramBotApi.Types.StoryArea)
> , business_connection_id : String
> , caption : Maybe String
> , caption_entities : Maybe (List TelegramBotApi.Types.MessageEntity)
> , content : TelegramBotApi.Types.InputStoryContent
> , parse_mode : Maybe String
> , story_id : Int
> }
> }
> -> Cmd msg
6750c7191,7249
< , body = Http.bytesBody "multipart/form-data" config.body
---
> , body =
> |
wolfadex
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenAPITools/openapi-generator#22530 (comment)