From 98abaf3d19631f1280b83467d38f28b150a02a3a Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 27 Jul 2024 05:56:48 +0300 Subject: Add a default values to (hopefully) all nullable fields --- src/types/ChatInviteLink.zig | 8 ++++---- src/types/ChatJoinRequest.zig | 4 ++-- src/types/ChosenInlineResult.zig | 2 +- src/types/Document.zig | 4 ++-- src/types/EncryptedPassportElement.zig | 16 ++++++++-------- src/types/InlineQuery.zig | 4 ++-- src/types/PollAnswer.zig | 4 ++-- src/types/PreCheckoutQuery.zig | 4 ++-- src/types/SwitchInlineQueryChosenChat.zig | 2 +- src/types/message_origin.zig | 4 ++-- 10 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/types/ChatInviteLink.zig b/src/types/ChatInviteLink.zig index 41a1f44..232ddcc 100644 --- a/src/types/ChatInviteLink.zig +++ b/src/types/ChatInviteLink.zig @@ -5,7 +5,7 @@ creator: User, creates_join_request: bool, is_primary: bool, is_revoked: bool, -name: ?[]const u8, -expire_date: ?u64, -member_limit: ?u64, -pending_join_request_count: ?u64, +name: ?[]const u8 = null, +expire_date: ?u64 = null, +member_limit: ?u64 = null, +pending_join_request_count: ?u64 = null, diff --git a/src/types/ChatJoinRequest.zig b/src/types/ChatJoinRequest.zig index f08e070..194871d 100644 --- a/src/types/ChatJoinRequest.zig +++ b/src/types/ChatJoinRequest.zig @@ -6,5 +6,5 @@ chat: Chat, from: User, user_chat_id: i64, date: u64, -bio: ?[]const u8, -invite_link: ?ChatInviteLink, +bio: ?[]const u8 = null, +invite_link: ?ChatInviteLink = null, diff --git a/src/types/ChosenInlineResult.zig b/src/types/ChosenInlineResult.zig index e0528cd..46ba207 100644 --- a/src/types/ChosenInlineResult.zig +++ b/src/types/ChosenInlineResult.zig @@ -4,5 +4,5 @@ const User = @import("User.zig"); result_id: []const u8, from: User, location: ?Location = null, -inline_message_id: ?[]const u8, +inline_message_id: ?[]const u8 = null, query: []const u8, diff --git a/src/types/Document.zig b/src/types/Document.zig index 811273d..e4d6a32 100644 --- a/src/types/Document.zig +++ b/src/types/Document.zig @@ -3,6 +3,6 @@ const PhotoSize = @import("PhotoSize.zig"); file_id: []const u8, file_unique_id: []const u8, thumbnail: ?PhotoSize = null, -file_name: ?[]const u8, -mime_type: ?[]const u8, +file_name: ?[]const u8 = null, +mime_type: ?[]const u8 = null, file_size: ?u64 = null, diff --git a/src/types/EncryptedPassportElement.zig b/src/types/EncryptedPassportElement.zig index ca0e2ed..2f9c5fd 100644 --- a/src/types/EncryptedPassportElement.zig +++ b/src/types/EncryptedPassportElement.zig @@ -19,12 +19,12 @@ pub const Type = enum { }; type: Type, -data: ?[]const u8, -phone_number: ?[]const u8, -email: ?[]const u8, -files: ?[]PassportFile, -front_side: ?PassportFile, -reverse_side: ?PassportFile, -selfie: ?PassportFile, -translation: ?[]PassportFile, +data: ?[]const u8 = null, +phone_number: ?[]const u8 = null, +email: ?[]const u8 = null, +files: ?[]PassportFile = null, +front_side: ?PassportFile = null, +reverse_side: ?PassportFile = null, +selfie: ?PassportFile = null, +translation: ?[]PassportFile = null, hash: []const u8, diff --git a/src/types/InlineQuery.zig b/src/types/InlineQuery.zig index 7cbbe20..47da2cb 100644 --- a/src/types/InlineQuery.zig +++ b/src/types/InlineQuery.zig @@ -13,5 +13,5 @@ id: []const u8, from: User, query: []const u8, offset: []const u8, -chat_type: ?ChatType, -location: ?Location, +chat_type: ?ChatType = null, +location: ?Location = null, diff --git a/src/types/PollAnswer.zig b/src/types/PollAnswer.zig index 7d4985c..f6aca35 100644 --- a/src/types/PollAnswer.zig +++ b/src/types/PollAnswer.zig @@ -2,6 +2,6 @@ const Chat = @import("Chat.zig"); const User = @import("User.zig"); poll_id: []const u8, -voter_chat: ?Chat, -user: ?User, +voter_chat: ?Chat = null, +user: ?User = null, option_ids: []u64, diff --git a/src/types/PreCheckoutQuery.zig b/src/types/PreCheckoutQuery.zig index 48e013f..fe80ce5 100644 --- a/src/types/PreCheckoutQuery.zig +++ b/src/types/PreCheckoutQuery.zig @@ -6,5 +6,5 @@ from: User, currency: []const u8, total_amount: u64, invoice_payload: []const u8, -shipping_option_id: ?[]const u8, -order_info: ?OrderInfo, +shipping_option_id: ?[]const u8 = null, +order_info: ?OrderInfo = null, diff --git a/src/types/SwitchInlineQueryChosenChat.zig b/src/types/SwitchInlineQueryChosenChat.zig index 860f2d9..404b08e 100644 --- a/src/types/SwitchInlineQueryChosenChat.zig +++ b/src/types/SwitchInlineQueryChosenChat.zig @@ -1,4 +1,4 @@ -query: ?[]const u8, +query: ?[]const u8 = null, allow_user_chats: ?bool = null, allow_bot_chats: ?bool = null, allow_group_chats: ?bool = null, diff --git a/src/types/message_origin.zig b/src/types/message_origin.zig index 5ca1f9f..96af076 100644 --- a/src/types/message_origin.zig +++ b/src/types/message_origin.zig @@ -15,13 +15,13 @@ pub const MessageOrigin = union(enum) { chat: struct { date: u64, sender_chat: Chat, - author_signature: ?[]const u8, + author_signature: ?[]const u8 = null, }, channel: struct { date: u64, chat: Chat, message_id: u64, - author_signature: ?[]const u8, + author_signature: ?[]const u8 = null, }, pub const jsonParse = json.makeJsonParse(MessageOrigin); -- cgit v1.2.3