From f4193aed82967cd7109e5bb6111b4e45299d80dd Mon Sep 17 00:00:00 2001 From: Tokuhiro Matsuno Date: Wed, 25 Oct 2023 15:03:11 +0900 Subject: [PATCH] more omitempty --- examples/kitchensink/server.go | 8 ++-- .../generator/pebble/IsOmitEmptyFunction.java | 4 ++ .../model_error_response.go | 4 +- ...el_verify_channel_access_token_response.go | 2 +- linebot/insight/model_area_tile.go | 2 +- linebot/insight/model_error_detail.go | 4 +- .../model_get_message_event_response_click.go | 2 +- ...del_get_message_event_response_overview.go | 2 +- linebot/liff/model_add_liff_app_request.go | 4 +- linebot/liff/model_liff_app.go | 6 +-- linebot/liff/model_update_liff_app_request.go | 4 +- ..._add_audience_to_audience_group_request.go | 2 +- linebot/manage_audience/model_audience.go | 2 +- .../manage_audience/model_audience_group.go | 6 +-- .../model_audience_group_job.go | 2 +- .../model_create_audience_group_request.go | 4 +- .../model_create_audience_group_response.go | 2 +- ...eate_click_based_audience_group_request.go | 6 +-- ...ate_click_based_audience_group_response.go | 6 +-- ...create_imp_based_audience_group_request.go | 4 +- ...reate_imp_based_audience_group_response.go | 4 +- linebot/manage_audience/model_error_detail.go | 4 +- ...date_audience_group_description_request.go | 2 +- linebot/messaging_api/model_action.go | 4 +- linebot/messaging_api/model_alt_uri.go | 2 +- linebot/messaging_api/model_audio_message.go | 2 +- .../messaging_api/model_bot_info_response.go | 4 +- .../messaging_api/model_buttons_template.go | 12 +++--- linebot/messaging_api/model_camera_action.go | 2 +- .../messaging_api/model_camera_roll_action.go | 2 +- .../messaging_api/model_carousel_column.go | 8 ++-- .../messaging_api/model_carousel_template.go | 4 +- .../messaging_api/model_confirm_template.go | 2 +- .../model_datetime_picker_action.go | 10 ++--- .../messaging_api/model_demographic_filter.go | 2 +- linebot/messaging_api/model_emoji.go | 4 +- linebot/messaging_api/model_error_detail.go | 4 +- .../messaging_api/model_flex_block_style.go | 4 +- linebot/messaging_api/model_flex_box.go | 38 +++++++++---------- .../model_flex_box_linear_gradient.go | 10 ++--- linebot/messaging_api/model_flex_button.go | 12 +++--- linebot/messaging_api/model_flex_icon.go | 16 ++++---- linebot/messaging_api/model_flex_image.go | 16 ++++---- linebot/messaging_api/model_flex_message.go | 2 +- linebot/messaging_api/model_flex_separator.go | 4 +- linebot/messaging_api/model_flex_span.go | 6 +-- linebot/messaging_api/model_flex_text.go | 18 ++++----- linebot/messaging_api/model_flex_video.go | 6 +-- ...get_aggregation_unit_name_list_response.go | 2 +- .../model_get_followers_response.go | 2 +- .../model_group_summary_response.go | 2 +- .../model_group_user_profile_response.go | 2 +- .../model_image_carousel_column.go | 2 +- linebot/messaging_api/model_image_message.go | 4 +- .../model_imagemap_external_link.go | 4 +- .../messaging_api/model_imagemap_message.go | 4 +- linebot/messaging_api/model_imagemap_video.go | 4 +- .../messaging_api/model_location_action.go | 2 +- .../messaging_api/model_location_message.go | 4 +- .../model_members_ids_response.go | 2 +- linebot/messaging_api/model_message_action.go | 4 +- .../model_message_imagemap_action.go | 4 +- .../model_narrowcast_progress_response.go | 2 +- .../messaging_api/model_postback_action.go | 10 ++--- .../messaging_api/model_quick_reply_item.go | 4 +- linebot/messaging_api/model_recipient.go | 2 +- .../model_redelivery_recipient.go | 2 +- .../model_rich_menu_batch_request.go | 2 +- .../messaging_api/model_rich_menu_request.go | 4 +- .../model_rich_menu_switch_action.go | 6 +-- .../model_room_user_profile_response.go | 2 +- linebot/messaging_api/model_sender.go | 4 +- linebot/messaging_api/model_sent_message.go | 2 +- .../messaging_api/model_sticker_message.go | 6 +-- .../messaging_api/model_template_message.go | 2 +- .../model_test_webhook_endpoint_request.go | 2 +- linebot/messaging_api/model_text_message.go | 4 +- linebot/messaging_api/model_uri_action.go | 4 +- .../model_uri_imagemap_action.go | 4 +- .../model_user_profile_response.go | 6 +-- linebot/messaging_api/model_video_message.go | 6 +-- linebot/module/model_detach_module_request.go | 2 +- linebot/module/model_get_modules_response.go | 2 +- linebot/module/model_module_bot.go | 4 +- linebot/webhook/model_account_link_event.go | 2 +- linebot/webhook/model_action_result.go | 2 +- linebot/webhook/model_beacon_content.go | 2 +- linebot/webhook/model_callback_request.go | 2 +- linebot/webhook/model_content_provider.go | 4 +- linebot/webhook/model_event.go | 2 +- linebot/webhook/model_group_source.go | 2 +- linebot/webhook/model_image_set.go | 2 +- .../webhook/model_location_message_content.go | 4 +- linebot/webhook/model_mentionee.go | 2 +- linebot/webhook/model_message_content.go | 2 +- linebot/webhook/model_message_event.go | 2 +- linebot/webhook/model_module_content.go | 2 +- linebot/webhook/model_postback_event.go | 2 +- linebot/webhook/model_room_source.go | 2 +- linebot/webhook/model_scenario_result.go | 6 +-- linebot/webhook/model_source.go | 2 +- .../webhook/model_sticker_message_content.go | 4 +- linebot/webhook/model_text_message_content.go | 2 +- linebot/webhook/model_things_content.go | 2 +- linebot/webhook/model_user_mentionee.go | 2 +- linebot/webhook/model_user_source.go | 2 +- 106 files changed, 231 insertions(+), 227 deletions(-) diff --git a/examples/kitchensink/server.go b/examples/kitchensink/server.go index 686c95f1..0caf6d82 100644 --- a/examples/kitchensink/server.go +++ b/examples/kitchensink/server.go @@ -69,6 +69,9 @@ type KitchenSink struct { // NewKitchenSink function func NewKitchenSink(channelSecret, channelToken, appBaseURL string) (*KitchenSink, error) { + if appBaseURL == "" { + return nil, fmt.Errorf("missing appBaseURL") + } bot, err := messaging_api.NewMessagingApiAPI( channelToken, ) @@ -199,10 +202,7 @@ func (app *KitchenSink) handleText(message *webhook.TextMessageContent, replyTok template := &messaging_api.ButtonsTemplate{ ThumbnailImageUrl: imageURL, Title: "My button sample", - DefaultAction: &messaging_api.UriAction{ - Label: "Go to line.me", - Uri: "https://line.me", - }, + Text: "Hello", Actions: []messaging_api.ActionInterface{ &messaging_api.UriAction{ Label: "Go to line.me", diff --git a/generator/src/main/java/line/bot/generator/pebble/IsOmitEmptyFunction.java b/generator/src/main/java/line/bot/generator/pebble/IsOmitEmptyFunction.java index 12a019c6..c5668c33 100644 --- a/generator/src/main/java/line/bot/generator/pebble/IsOmitEmptyFunction.java +++ b/generator/src/main/java/line/bot/generator/pebble/IsOmitEmptyFunction.java @@ -33,6 +33,10 @@ public Object execute(Map args, PebbleTemplate self, EvaluationC // As a result, the default value is empty string. return true; } + if (var.isString) { + // such as imageBackgroundColor in ButtonsTemplate. + return true; + } if (var.isPrimitiveType) { return false; } diff --git a/linebot/channel_access_token/model_error_response.go b/linebot/channel_access_token/model_error_response.go index 325f0770..3382750c 100644 --- a/linebot/channel_access_token/model_error_response.go +++ b/linebot/channel_access_token/model_error_response.go @@ -28,12 +28,12 @@ type ErrorResponse struct { /** * Error summary */ - Error string `json:"error"` + Error string `json:"error,omitempty"` /** * Details of the error. Not returned in certain situations. */ - ErrorDescription string `json:"error_description"` + ErrorDescription string `json:"error_description,omitempty"` } func NewErrorResponse() *ErrorResponse { diff --git a/linebot/channel_access_token/model_verify_channel_access_token_response.go b/linebot/channel_access_token/model_verify_channel_access_token_response.go index dc48c7f5..25bc37d5 100644 --- a/linebot/channel_access_token/model_verify_channel_access_token_response.go +++ b/linebot/channel_access_token/model_verify_channel_access_token_response.go @@ -38,7 +38,7 @@ type VerifyChannelAccessTokenResponse struct { /** * Permissions granted to the channel access token. */ - Scope string `json:"scope"` + Scope string `json:"scope,omitempty"` } func NewVerifyChannelAccessTokenResponse( diff --git a/linebot/insight/model_area_tile.go b/linebot/insight/model_area_tile.go index 75ac56a3..5780d834 100644 --- a/linebot/insight/model_area_tile.go +++ b/linebot/insight/model_area_tile.go @@ -28,7 +28,7 @@ type AreaTile struct { /** * users' country and region */ - Area string `json:"area"` + Area string `json:"area,omitempty"` /** * Percentage diff --git a/linebot/insight/model_error_detail.go b/linebot/insight/model_error_detail.go index 89a4d37c..53d8da87 100644 --- a/linebot/insight/model_error_detail.go +++ b/linebot/insight/model_error_detail.go @@ -28,12 +28,12 @@ type ErrorDetail struct { /** * Details of the error. Not included in the response under certain situations. */ - Message string `json:"message"` + Message string `json:"message,omitempty"` /** * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. */ - Property string `json:"property"` + Property string `json:"property,omitempty"` } func NewErrorDetail() *ErrorDetail { diff --git a/linebot/insight/model_get_message_event_response_click.go b/linebot/insight/model_get_message_event_response_click.go index e0bec59d..f45bd121 100644 --- a/linebot/insight/model_get_message_event_response_click.go +++ b/linebot/insight/model_get_message_event_response_click.go @@ -33,7 +33,7 @@ type GetMessageEventResponseClick struct { /** * URL. */ - Url string `json:"url"` + Url string `json:"url,omitempty"` /** * Number of times the URL was opened. diff --git a/linebot/insight/model_get_message_event_response_overview.go b/linebot/insight/model_get_message_event_response_overview.go index d0f83efe..bc485f37 100644 --- a/linebot/insight/model_get_message_event_response_overview.go +++ b/linebot/insight/model_get_message_event_response_overview.go @@ -28,7 +28,7 @@ type GetMessageEventResponseOverview struct { /** * Request ID. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` /** * UNIX timestamp for message delivery time in seconds. diff --git a/linebot/liff/model_add_liff_app_request.go b/linebot/liff/model_add_liff_app_request.go index 0692e3e8..6fd9d40a 100644 --- a/linebot/liff/model_add_liff_app_request.go +++ b/linebot/liff/model_add_liff_app_request.go @@ -33,7 +33,7 @@ type AddLiffAppRequest struct { /** * Name of the LIFF app. The LIFF app name can't include \"LINE\" or similar strings, or inappropriate strings. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * Get Features @@ -43,7 +43,7 @@ type AddLiffAppRequest struct { /** * How additional information in LIFF URLs is handled. Specify `concat`. */ - PermanentLinkPattern string `json:"permanentLinkPattern"` + PermanentLinkPattern string `json:"permanentLinkPattern,omitempty"` /** * Get Scope diff --git a/linebot/liff/model_liff_app.go b/linebot/liff/model_liff_app.go index 30066e48..93bd04bd 100644 --- a/linebot/liff/model_liff_app.go +++ b/linebot/liff/model_liff_app.go @@ -28,7 +28,7 @@ type LiffApp struct { /** * LIFF app ID */ - LiffId string `json:"liffId"` + LiffId string `json:"liffId,omitempty"` /** * Get View @@ -38,7 +38,7 @@ type LiffApp struct { /** * Name of the LIFF app */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * Get Features @@ -48,7 +48,7 @@ type LiffApp struct { /** * How additional information in LIFF URLs is handled. concat is returned. */ - PermanentLinkPattern string `json:"permanentLinkPattern"` + PermanentLinkPattern string `json:"permanentLinkPattern,omitempty"` /** * Get Scope diff --git a/linebot/liff/model_update_liff_app_request.go b/linebot/liff/model_update_liff_app_request.go index ede01fc8..832282f2 100644 --- a/linebot/liff/model_update_liff_app_request.go +++ b/linebot/liff/model_update_liff_app_request.go @@ -33,7 +33,7 @@ type UpdateLiffAppRequest struct { /** * Name of the LIFF app. The LIFF app name can't include \"LINE\" or similar strings, or inappropriate strings. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * Get Features @@ -43,7 +43,7 @@ type UpdateLiffAppRequest struct { /** * How additional information in LIFF URLs is handled. Specify `concat`. */ - PermanentLinkPattern string `json:"permanentLinkPattern"` + PermanentLinkPattern string `json:"permanentLinkPattern,omitempty"` /** * Get Scope diff --git a/linebot/manage_audience/model_add_audience_to_audience_group_request.go b/linebot/manage_audience/model_add_audience_to_audience_group_request.go index d9e78dab..bed625ed 100644 --- a/linebot/manage_audience/model_add_audience_to_audience_group_request.go +++ b/linebot/manage_audience/model_add_audience_to_audience_group_request.go @@ -33,7 +33,7 @@ type AddAudienceToAudienceGroupRequest struct { /** * The audience's name. */ - UploadDescription string `json:"uploadDescription"` + UploadDescription string `json:"uploadDescription,omitempty"` /** * An array of up to 10,000 user IDs or IFAs. diff --git a/linebot/manage_audience/model_audience.go b/linebot/manage_audience/model_audience.go index fcadedd5..b0e16e4a 100644 --- a/linebot/manage_audience/model_audience.go +++ b/linebot/manage_audience/model_audience.go @@ -28,7 +28,7 @@ type Audience struct { /** * A user ID or IFA. You can specify an empty array. */ - Id string `json:"id"` + Id string `json:"id,omitempty"` } func NewAudience() *Audience { diff --git a/linebot/manage_audience/model_audience_group.go b/linebot/manage_audience/model_audience_group.go index e9014cdb..cf4b194b 100644 --- a/linebot/manage_audience/model_audience_group.go +++ b/linebot/manage_audience/model_audience_group.go @@ -38,7 +38,7 @@ type AudienceGroup struct { /** * The audience's name. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * Get Status @@ -63,12 +63,12 @@ type AudienceGroup struct { /** * The request ID that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK or IMP. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` /** * The URL that was specified when the audience was created. This is only included when `audienceGroup.type` is CLICK and link URL is specified. */ - ClickUrl string `json:"clickUrl"` + ClickUrl string `json:"clickUrl,omitempty"` /** * The value indicating the type of account to be sent, as specified when creating the audience for uploading user IDs. diff --git a/linebot/manage_audience/model_audience_group_job.go b/linebot/manage_audience/model_audience_group_job.go index 6f841767..35cb4de8 100644 --- a/linebot/manage_audience/model_audience_group_job.go +++ b/linebot/manage_audience/model_audience_group_job.go @@ -38,7 +38,7 @@ type AudienceGroupJob struct { /** * The job's description. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * Get Type diff --git a/linebot/manage_audience/model_create_audience_group_request.go b/linebot/manage_audience/model_create_audience_group_request.go index 3c450a2f..a29f3478 100644 --- a/linebot/manage_audience/model_create_audience_group_request.go +++ b/linebot/manage_audience/model_create_audience_group_request.go @@ -28,7 +28,7 @@ type CreateAudienceGroupRequest struct { /** * The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * To specify recipients by IFAs: set true. To specify recipients by user IDs: set false or omit isIfaAudience property. @@ -38,7 +38,7 @@ type CreateAudienceGroupRequest struct { /** * The description to register for the job (in jobs[].description). */ - UploadDescription string `json:"uploadDescription"` + UploadDescription string `json:"uploadDescription,omitempty"` /** * An array of user IDs or IFAs. Max number: 10,000 diff --git a/linebot/manage_audience/model_create_audience_group_response.go b/linebot/manage_audience/model_create_audience_group_response.go index 4313139a..0b78dadd 100644 --- a/linebot/manage_audience/model_create_audience_group_response.go +++ b/linebot/manage_audience/model_create_audience_group_response.go @@ -43,7 +43,7 @@ type CreateAudienceGroupResponse struct { /** * The audience's name. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * When the audience was created (in UNIX time). diff --git a/linebot/manage_audience/model_create_click_based_audience_group_request.go b/linebot/manage_audience/model_create_click_based_audience_group_request.go index 2009386c..729a315e 100644 --- a/linebot/manage_audience/model_create_click_based_audience_group_request.go +++ b/linebot/manage_audience/model_create_click_based_audience_group_request.go @@ -28,17 +28,17 @@ type CreateClickBasedAudienceGroupRequest struct { /** * The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` /** * The URL clicked by the user. If empty, users who clicked any URL in the message are added to the list of recipients. Max character limit: 2,000 */ - ClickUrl string `json:"clickUrl"` + ClickUrl string `json:"clickUrl,omitempty"` } func NewCreateClickBasedAudienceGroupRequest() *CreateClickBasedAudienceGroupRequest { diff --git a/linebot/manage_audience/model_create_click_based_audience_group_response.go b/linebot/manage_audience/model_create_click_based_audience_group_response.go index 789a7b17..b6f66f62 100644 --- a/linebot/manage_audience/model_create_click_based_audience_group_response.go +++ b/linebot/manage_audience/model_create_click_based_audience_group_response.go @@ -38,7 +38,7 @@ type CreateClickBasedAudienceGroupResponse struct { /** * The audience's name. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * When the audience was created (in UNIX time). @@ -48,12 +48,12 @@ type CreateClickBasedAudienceGroupResponse struct { /** * The request ID that was specified when the audience was created. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` /** * The URL that was specified when the audience was created. */ - ClickUrl string `json:"clickUrl"` + ClickUrl string `json:"clickUrl,omitempty"` /** * How the audience was created. `MESSAGING_API`: An audience created with Messaging API. diff --git a/linebot/manage_audience/model_create_imp_based_audience_group_request.go b/linebot/manage_audience/model_create_imp_based_audience_group_request.go index 27c0c522..69022954 100644 --- a/linebot/manage_audience/model_create_imp_based_audience_group_request.go +++ b/linebot/manage_audience/model_create_imp_based_audience_group_request.go @@ -28,12 +28,12 @@ type CreateImpBasedAudienceGroupRequest struct { /** * The audience's name. This is case-insensitive, meaning `AUDIENCE` and `audience` are considered identical. Max character limit: 120 */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` } func NewCreateImpBasedAudienceGroupRequest() *CreateImpBasedAudienceGroupRequest { diff --git a/linebot/manage_audience/model_create_imp_based_audience_group_response.go b/linebot/manage_audience/model_create_imp_based_audience_group_response.go index afad3542..032bb14f 100644 --- a/linebot/manage_audience/model_create_imp_based_audience_group_response.go +++ b/linebot/manage_audience/model_create_imp_based_audience_group_response.go @@ -38,7 +38,7 @@ type CreateImpBasedAudienceGroupResponse struct { /** * The audience's name. */ - Description string `json:"description"` + Description string `json:"description,omitempty"` /** * When the audience was created (in UNIX time). @@ -48,7 +48,7 @@ type CreateImpBasedAudienceGroupResponse struct { /** * The request ID that was specified when the audience was created. */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` } func NewCreateImpBasedAudienceGroupResponse() *CreateImpBasedAudienceGroupResponse { diff --git a/linebot/manage_audience/model_error_detail.go b/linebot/manage_audience/model_error_detail.go index 657e7ea4..fdae05ba 100644 --- a/linebot/manage_audience/model_error_detail.go +++ b/linebot/manage_audience/model_error_detail.go @@ -28,12 +28,12 @@ type ErrorDetail struct { /** * Details of the error. Not included in the response under certain situations. */ - Message string `json:"message"` + Message string `json:"message,omitempty"` /** * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. */ - Property string `json:"property"` + Property string `json:"property,omitempty"` } func NewErrorDetail() *ErrorDetail { diff --git a/linebot/manage_audience/model_update_audience_group_description_request.go b/linebot/manage_audience/model_update_audience_group_description_request.go index 5b6ef843..9845530e 100644 --- a/linebot/manage_audience/model_update_audience_group_description_request.go +++ b/linebot/manage_audience/model_update_audience_group_description_request.go @@ -28,7 +28,7 @@ type UpdateAudienceGroupDescriptionRequest struct { /** * The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 */ - Description string `json:"description"` + Description string `json:"description,omitempty"` } func NewUpdateAudienceGroupDescriptionRequest() *UpdateAudienceGroupDescriptionRequest { diff --git a/linebot/messaging_api/model_action.go b/linebot/messaging_api/model_action.go index 26adce4a..6ca78026 100644 --- a/linebot/messaging_api/model_action.go +++ b/linebot/messaging_api/model_action.go @@ -143,10 +143,10 @@ func setDiscriminatorPropertyAction(r ActionInterface) ActionInterface { type Action struct { // Type of action - Type string `json:"type"` + Type string `json:"type,omitempty"` // Label for the action. - Label string `json:"label"` + Label string `json:"label,omitempty"` } func UnmarshalAction(data []byte) (ActionInterface, error) { diff --git a/linebot/messaging_api/model_alt_uri.go b/linebot/messaging_api/model_alt_uri.go index 5dbc9736..4fc76e5c 100644 --- a/linebot/messaging_api/model_alt_uri.go +++ b/linebot/messaging_api/model_alt_uri.go @@ -28,7 +28,7 @@ type AltUri struct { /** * Get Desktop */ - Desktop string `json:"desktop"` + Desktop string `json:"desktop,omitempty"` } func NewAltUri() *AltUri { diff --git a/linebot/messaging_api/model_audio_message.go b/linebot/messaging_api/model_audio_message.go index 38ca6a97..c7056259 100644 --- a/linebot/messaging_api/model_audio_message.go +++ b/linebot/messaging_api/model_audio_message.go @@ -39,7 +39,7 @@ type AudioMessage struct { /** * Get OriginalContentUrl */ - OriginalContentUrl string `json:"originalContentUrl"` + OriginalContentUrl string `json:"originalContentUrl,omitempty"` /** * Get Duration diff --git a/linebot/messaging_api/model_bot_info_response.go b/linebot/messaging_api/model_bot_info_response.go index 0de3db1d..d2d1557d 100644 --- a/linebot/messaging_api/model_bot_info_response.go +++ b/linebot/messaging_api/model_bot_info_response.go @@ -38,7 +38,7 @@ type BotInfoResponse struct { /** * Bot's premium ID. Not included in the response if the premium ID isn't set. */ - PremiumId string `json:"premiumId"` + PremiumId string `json:"premiumId,omitempty"` /** * Bot's display name (Required) @@ -48,7 +48,7 @@ type BotInfoResponse struct { /** * Profile image URL. `https` image URL. Not included in the response if the bot doesn't have a profile image. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` /** * Chat settings set in the LINE Official Account Manager. One of: `chat`: Chat is set to \"On\". `bot`: Chat is set to \"Off\". (Required) diff --git a/linebot/messaging_api/model_buttons_template.go b/linebot/messaging_api/model_buttons_template.go index 96c623e3..edd0b177 100644 --- a/linebot/messaging_api/model_buttons_template.go +++ b/linebot/messaging_api/model_buttons_template.go @@ -34,32 +34,32 @@ type ButtonsTemplate struct { /** * Get ThumbnailImageUrl */ - ThumbnailImageUrl string `json:"thumbnailImageUrl"` + ThumbnailImageUrl string `json:"thumbnailImageUrl,omitempty"` /** * Get ImageAspectRatio */ - ImageAspectRatio string `json:"imageAspectRatio"` + ImageAspectRatio string `json:"imageAspectRatio,omitempty"` /** * Get ImageSize */ - ImageSize string `json:"imageSize"` + ImageSize string `json:"imageSize,omitempty"` /** * Get ImageBackgroundColor */ - ImageBackgroundColor string `json:"imageBackgroundColor"` + ImageBackgroundColor string `json:"imageBackgroundColor,omitempty"` /** * Get Title */ - Title string `json:"title"` + Title string `json:"title,omitempty"` /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get DefaultAction diff --git a/linebot/messaging_api/model_camera_action.go b/linebot/messaging_api/model_camera_action.go index db018138..aada75a1 100644 --- a/linebot/messaging_api/model_camera_action.go +++ b/linebot/messaging_api/model_camera_action.go @@ -29,7 +29,7 @@ type CameraAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewCameraAction() *CameraAction { diff --git a/linebot/messaging_api/model_camera_roll_action.go b/linebot/messaging_api/model_camera_roll_action.go index 0d07e4fa..cbf0cb20 100644 --- a/linebot/messaging_api/model_camera_roll_action.go +++ b/linebot/messaging_api/model_camera_roll_action.go @@ -29,7 +29,7 @@ type CameraRollAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewCameraRollAction() *CameraRollAction { diff --git a/linebot/messaging_api/model_carousel_column.go b/linebot/messaging_api/model_carousel_column.go index 153d4857..496249fe 100644 --- a/linebot/messaging_api/model_carousel_column.go +++ b/linebot/messaging_api/model_carousel_column.go @@ -33,22 +33,22 @@ type CarouselColumn struct { /** * Get ThumbnailImageUrl */ - ThumbnailImageUrl string `json:"thumbnailImageUrl"` + ThumbnailImageUrl string `json:"thumbnailImageUrl,omitempty"` /** * Get ImageBackgroundColor */ - ImageBackgroundColor string `json:"imageBackgroundColor"` + ImageBackgroundColor string `json:"imageBackgroundColor,omitempty"` /** * Get Title */ - Title string `json:"title"` + Title string `json:"title,omitempty"` /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get DefaultAction diff --git a/linebot/messaging_api/model_carousel_template.go b/linebot/messaging_api/model_carousel_template.go index b9a2cd75..586298d1 100644 --- a/linebot/messaging_api/model_carousel_template.go +++ b/linebot/messaging_api/model_carousel_template.go @@ -34,12 +34,12 @@ type CarouselTemplate struct { /** * Get ImageAspectRatio */ - ImageAspectRatio string `json:"imageAspectRatio"` + ImageAspectRatio string `json:"imageAspectRatio,omitempty"` /** * Get ImageSize */ - ImageSize string `json:"imageSize"` + ImageSize string `json:"imageSize,omitempty"` } func NewCarouselTemplate() *CarouselTemplate { diff --git a/linebot/messaging_api/model_confirm_template.go b/linebot/messaging_api/model_confirm_template.go index 05d6339c..485351c0 100644 --- a/linebot/messaging_api/model_confirm_template.go +++ b/linebot/messaging_api/model_confirm_template.go @@ -34,7 +34,7 @@ type ConfirmTemplate struct { /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get Actions diff --git a/linebot/messaging_api/model_datetime_picker_action.go b/linebot/messaging_api/model_datetime_picker_action.go index ca48e946..c6835f20 100644 --- a/linebot/messaging_api/model_datetime_picker_action.go +++ b/linebot/messaging_api/model_datetime_picker_action.go @@ -29,12 +29,12 @@ type DatetimePickerAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` /** * Get Data */ - Data string `json:"data"` + Data string `json:"data,omitempty"` /** * Get Mode @@ -44,17 +44,17 @@ type DatetimePickerAction struct { /** * Get Initial */ - Initial string `json:"initial"` + Initial string `json:"initial,omitempty"` /** * Get Max */ - Max string `json:"max"` + Max string `json:"max,omitempty"` /** * Get Min */ - Min string `json:"min"` + Min string `json:"min,omitempty"` } func NewDatetimePickerAction() *DatetimePickerAction { diff --git a/linebot/messaging_api/model_demographic_filter.go b/linebot/messaging_api/model_demographic_filter.go index e8fb6146..f0c77d91 100644 --- a/linebot/messaging_api/model_demographic_filter.go +++ b/linebot/messaging_api/model_demographic_filter.go @@ -121,7 +121,7 @@ func setDiscriminatorPropertyDemographicFilter(r DemographicFilterInterface) Dem type DemographicFilter struct { // Type of demographic filter - Type string `json:"type"` + Type string `json:"type,omitempty"` } func UnmarshalDemographicFilter(data []byte) (DemographicFilterInterface, error) { diff --git a/linebot/messaging_api/model_emoji.go b/linebot/messaging_api/model_emoji.go index 85a9df41..fc3ae9f9 100644 --- a/linebot/messaging_api/model_emoji.go +++ b/linebot/messaging_api/model_emoji.go @@ -33,12 +33,12 @@ type Emoji struct { /** * Get ProductId */ - ProductId string `json:"productId"` + ProductId string `json:"productId,omitempty"` /** * Get EmojiId */ - EmojiId string `json:"emojiId"` + EmojiId string `json:"emojiId,omitempty"` } func NewEmoji() *Emoji { diff --git a/linebot/messaging_api/model_error_detail.go b/linebot/messaging_api/model_error_detail.go index ee593a33..d9e3261f 100644 --- a/linebot/messaging_api/model_error_detail.go +++ b/linebot/messaging_api/model_error_detail.go @@ -28,12 +28,12 @@ type ErrorDetail struct { /** * Details of the error. Not included in the response under certain situations. */ - Message string `json:"message"` + Message string `json:"message,omitempty"` /** * Location of where the error occurred. Returns the JSON field name or query parameter name of the request. Not included in the response under certain situations. */ - Property string `json:"property"` + Property string `json:"property,omitempty"` } func NewErrorDetail() *ErrorDetail { diff --git a/linebot/messaging_api/model_flex_block_style.go b/linebot/messaging_api/model_flex_block_style.go index 5d30502e..7abea4f7 100644 --- a/linebot/messaging_api/model_flex_block_style.go +++ b/linebot/messaging_api/model_flex_block_style.go @@ -28,7 +28,7 @@ type FlexBlockStyle struct { /** * Get BackgroundColor */ - BackgroundColor string `json:"backgroundColor"` + BackgroundColor string `json:"backgroundColor,omitempty"` /** * Get Separator @@ -38,7 +38,7 @@ type FlexBlockStyle struct { /** * Get SeparatorColor */ - SeparatorColor string `json:"separatorColor"` + SeparatorColor string `json:"separatorColor,omitempty"` } func NewFlexBlockStyle() *FlexBlockStyle { diff --git a/linebot/messaging_api/model_flex_box.go b/linebot/messaging_api/model_flex_box.go index 42b44faf..841a70d6 100644 --- a/linebot/messaging_api/model_flex_box.go +++ b/linebot/messaging_api/model_flex_box.go @@ -49,12 +49,12 @@ type FlexBox struct { /** * Get Spacing */ - Spacing string `json:"spacing"` + Spacing string `json:"spacing,omitempty"` /** * Get Margin */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Get Position @@ -64,87 +64,87 @@ type FlexBox struct { /** * Get OffsetTop */ - OffsetTop string `json:"offsetTop"` + OffsetTop string `json:"offsetTop,omitempty"` /** * Get OffsetBottom */ - OffsetBottom string `json:"offsetBottom"` + OffsetBottom string `json:"offsetBottom,omitempty"` /** * Get OffsetStart */ - OffsetStart string `json:"offsetStart"` + OffsetStart string `json:"offsetStart,omitempty"` /** * Get OffsetEnd */ - OffsetEnd string `json:"offsetEnd"` + OffsetEnd string `json:"offsetEnd,omitempty"` /** * Get BackgroundColor */ - BackgroundColor string `json:"backgroundColor"` + BackgroundColor string `json:"backgroundColor,omitempty"` /** * Get BorderColor */ - BorderColor string `json:"borderColor"` + BorderColor string `json:"borderColor,omitempty"` /** * Get BorderWidth */ - BorderWidth string `json:"borderWidth"` + BorderWidth string `json:"borderWidth,omitempty"` /** * Get CornerRadius */ - CornerRadius string `json:"cornerRadius"` + CornerRadius string `json:"cornerRadius,omitempty"` /** * Get Width */ - Width string `json:"width"` + Width string `json:"width,omitempty"` /** * Get MaxWidth */ - MaxWidth string `json:"maxWidth"` + MaxWidth string `json:"maxWidth,omitempty"` /** * Get Height */ - Height string `json:"height"` + Height string `json:"height,omitempty"` /** * Get MaxHeight */ - MaxHeight string `json:"maxHeight"` + MaxHeight string `json:"maxHeight,omitempty"` /** * Get PaddingAll */ - PaddingAll string `json:"paddingAll"` + PaddingAll string `json:"paddingAll,omitempty"` /** * Get PaddingTop */ - PaddingTop string `json:"paddingTop"` + PaddingTop string `json:"paddingTop,omitempty"` /** * Get PaddingBottom */ - PaddingBottom string `json:"paddingBottom"` + PaddingBottom string `json:"paddingBottom,omitempty"` /** * Get PaddingStart */ - PaddingStart string `json:"paddingStart"` + PaddingStart string `json:"paddingStart,omitempty"` /** * Get PaddingEnd */ - PaddingEnd string `json:"paddingEnd"` + PaddingEnd string `json:"paddingEnd,omitempty"` /** * Get Action diff --git a/linebot/messaging_api/model_flex_box_linear_gradient.go b/linebot/messaging_api/model_flex_box_linear_gradient.go index 40ab0b40..3512786b 100644 --- a/linebot/messaging_api/model_flex_box_linear_gradient.go +++ b/linebot/messaging_api/model_flex_box_linear_gradient.go @@ -29,27 +29,27 @@ type FlexBoxLinearGradient struct { /** * Get Angle */ - Angle string `json:"angle"` + Angle string `json:"angle,omitempty"` /** * Get StartColor */ - StartColor string `json:"startColor"` + StartColor string `json:"startColor,omitempty"` /** * Get EndColor */ - EndColor string `json:"endColor"` + EndColor string `json:"endColor,omitempty"` /** * Get CenterColor */ - CenterColor string `json:"centerColor"` + CenterColor string `json:"centerColor,omitempty"` /** * Get CenterPosition */ - CenterPosition string `json:"centerPosition"` + CenterPosition string `json:"centerPosition,omitempty"` } func NewFlexBoxLinearGradient() *FlexBoxLinearGradient { diff --git a/linebot/messaging_api/model_flex_button.go b/linebot/messaging_api/model_flex_button.go index e5872a12..f07e29d9 100644 --- a/linebot/messaging_api/model_flex_button.go +++ b/linebot/messaging_api/model_flex_button.go @@ -38,7 +38,7 @@ type FlexButton struct { /** * Get Color */ - Color string `json:"color"` + Color string `json:"color,omitempty"` /** * Get Style @@ -58,7 +58,7 @@ type FlexButton struct { /** * Get Margin */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Get Position @@ -68,22 +68,22 @@ type FlexButton struct { /** * Get OffsetTop */ - OffsetTop string `json:"offsetTop"` + OffsetTop string `json:"offsetTop,omitempty"` /** * Get OffsetBottom */ - OffsetBottom string `json:"offsetBottom"` + OffsetBottom string `json:"offsetBottom,omitempty"` /** * Get OffsetStart */ - OffsetStart string `json:"offsetStart"` + OffsetStart string `json:"offsetStart,omitempty"` /** * Get OffsetEnd */ - OffsetEnd string `json:"offsetEnd"` + OffsetEnd string `json:"offsetEnd,omitempty"` /** * Get Height diff --git a/linebot/messaging_api/model_flex_icon.go b/linebot/messaging_api/model_flex_icon.go index 613ae9b3..fb221a92 100644 --- a/linebot/messaging_api/model_flex_icon.go +++ b/linebot/messaging_api/model_flex_icon.go @@ -29,22 +29,22 @@ type FlexIcon struct { /** * Get Url */ - Url string `json:"url"` + Url string `json:"url,omitempty"` /** * Get Size */ - Size string `json:"size"` + Size string `json:"size,omitempty"` /** * Get AspectRatio */ - AspectRatio string `json:"aspectRatio"` + AspectRatio string `json:"aspectRatio,omitempty"` /** * Get Margin */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Get Position @@ -54,22 +54,22 @@ type FlexIcon struct { /** * Get OffsetTop */ - OffsetTop string `json:"offsetTop"` + OffsetTop string `json:"offsetTop,omitempty"` /** * Get OffsetBottom */ - OffsetBottom string `json:"offsetBottom"` + OffsetBottom string `json:"offsetBottom,omitempty"` /** * Get OffsetStart */ - OffsetStart string `json:"offsetStart"` + OffsetStart string `json:"offsetStart,omitempty"` /** * Get OffsetEnd */ - OffsetEnd string `json:"offsetEnd"` + OffsetEnd string `json:"offsetEnd,omitempty"` /** * Get Scaling diff --git a/linebot/messaging_api/model_flex_image.go b/linebot/messaging_api/model_flex_image.go index 0c239fd2..9e4dd72b 100644 --- a/linebot/messaging_api/model_flex_image.go +++ b/linebot/messaging_api/model_flex_image.go @@ -43,7 +43,7 @@ type FlexImage struct { /** * The minimum amount of space to include before this component in its parent container. */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Reference for offsetTop, offsetBottom, offsetStart, and offsetEnd. Specify one of the following values: `relative`: Use the previous box as reference. `absolute`: Use the top left of parent element as reference. The default value is relative. @@ -53,22 +53,22 @@ type FlexImage struct { /** * Offset. */ - OffsetTop string `json:"offsetTop"` + OffsetTop string `json:"offsetTop,omitempty"` /** * Offset. */ - OffsetBottom string `json:"offsetBottom"` + OffsetBottom string `json:"offsetBottom,omitempty"` /** * Offset. */ - OffsetStart string `json:"offsetStart"` + OffsetStart string `json:"offsetStart,omitempty"` /** * Offset. */ - OffsetEnd string `json:"offsetEnd"` + OffsetEnd string `json:"offsetEnd,omitempty"` /** * Alignment style in horizontal direction. @@ -83,12 +83,12 @@ type FlexImage struct { /** * The maximum image width. This is md by default. */ - Size string `json:"size"` + Size string `json:"size,omitempty"` /** * Aspect ratio of the image. `{width}:{height}` format. Specify the value of `{width}` and `{height}` in the range from `1` to `100000`. However, you cannot set `{height}` to a value that is more than three times the value of `{width}`. The default value is `1:1`. */ - AspectRatio string `json:"aspectRatio"` + AspectRatio string `json:"aspectRatio,omitempty"` /** * The display style of the image if the aspect ratio of the image and that specified by the aspectRatio property do not match. @@ -98,7 +98,7 @@ type FlexImage struct { /** * Background color of the image. Use a hexadecimal color code. */ - BackgroundColor string `json:"backgroundColor"` + BackgroundColor string `json:"backgroundColor,omitempty"` /** * Get Action diff --git a/linebot/messaging_api/model_flex_message.go b/linebot/messaging_api/model_flex_message.go index 6f904e1e..c4e1b0cb 100644 --- a/linebot/messaging_api/model_flex_message.go +++ b/linebot/messaging_api/model_flex_message.go @@ -43,7 +43,7 @@ type FlexMessage struct { /** * Get AltText */ - AltText string `json:"altText"` + AltText string `json:"altText,omitempty"` /** * Get Contents diff --git a/linebot/messaging_api/model_flex_separator.go b/linebot/messaging_api/model_flex_separator.go index d30f1d99..761e1cd8 100644 --- a/linebot/messaging_api/model_flex_separator.go +++ b/linebot/messaging_api/model_flex_separator.go @@ -29,12 +29,12 @@ type FlexSeparator struct { /** * Get Margin */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Get Color */ - Color string `json:"color"` + Color string `json:"color,omitempty"` } func NewFlexSeparator() *FlexSeparator { diff --git a/linebot/messaging_api/model_flex_span.go b/linebot/messaging_api/model_flex_span.go index 5e130410..2fe82ad5 100644 --- a/linebot/messaging_api/model_flex_span.go +++ b/linebot/messaging_api/model_flex_span.go @@ -29,17 +29,17 @@ type FlexSpan struct { /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get Size */ - Size string `json:"size"` + Size string `json:"size,omitempty"` /** * Get Color */ - Color string `json:"color"` + Color string `json:"color,omitempty"` /** * Get Weight diff --git a/linebot/messaging_api/model_flex_text.go b/linebot/messaging_api/model_flex_text.go index 5afd97a0..4d9489bc 100644 --- a/linebot/messaging_api/model_flex_text.go +++ b/linebot/messaging_api/model_flex_text.go @@ -38,12 +38,12 @@ type FlexText struct { /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get Size */ - Size string `json:"size"` + Size string `json:"size,omitempty"` /** * Get Align @@ -58,7 +58,7 @@ type FlexText struct { /** * Get Color */ - Color string `json:"color"` + Color string `json:"color,omitempty"` /** * Get Weight @@ -83,12 +83,12 @@ type FlexText struct { /** * Get LineSpacing */ - LineSpacing string `json:"lineSpacing"` + LineSpacing string `json:"lineSpacing,omitempty"` /** * Get Margin */ - Margin string `json:"margin"` + Margin string `json:"margin,omitempty"` /** * Get Position @@ -98,22 +98,22 @@ type FlexText struct { /** * Get OffsetTop */ - OffsetTop string `json:"offsetTop"` + OffsetTop string `json:"offsetTop,omitempty"` /** * Get OffsetBottom */ - OffsetBottom string `json:"offsetBottom"` + OffsetBottom string `json:"offsetBottom,omitempty"` /** * Get OffsetStart */ - OffsetStart string `json:"offsetStart"` + OffsetStart string `json:"offsetStart,omitempty"` /** * Get OffsetEnd */ - OffsetEnd string `json:"offsetEnd"` + OffsetEnd string `json:"offsetEnd,omitempty"` /** * Get Action diff --git a/linebot/messaging_api/model_flex_video.go b/linebot/messaging_api/model_flex_video.go index e8d92f1f..44510f84 100644 --- a/linebot/messaging_api/model_flex_video.go +++ b/linebot/messaging_api/model_flex_video.go @@ -33,12 +33,12 @@ type FlexVideo struct { /** * Get Url */ - Url string `json:"url"` + Url string `json:"url,omitempty"` /** * Get PreviewUrl */ - PreviewUrl string `json:"previewUrl"` + PreviewUrl string `json:"previewUrl,omitempty"` /** * Get AltContent @@ -48,7 +48,7 @@ type FlexVideo struct { /** * Get AspectRatio */ - AspectRatio string `json:"aspectRatio"` + AspectRatio string `json:"aspectRatio,omitempty"` /** * Get Action diff --git a/linebot/messaging_api/model_get_aggregation_unit_name_list_response.go b/linebot/messaging_api/model_get_aggregation_unit_name_list_response.go index 59b6fdbc..9aaec495 100644 --- a/linebot/messaging_api/model_get_aggregation_unit_name_list_response.go +++ b/linebot/messaging_api/model_get_aggregation_unit_name_list_response.go @@ -33,7 +33,7 @@ type GetAggregationUnitNameListResponse struct { /** * A continuation token to get the next array of unit names. Returned only when there are remaining aggregation units that weren't returned in customAggregationUnits in the original request. */ - Next string `json:"next"` + Next string `json:"next,omitempty"` } func NewGetAggregationUnitNameListResponse( diff --git a/linebot/messaging_api/model_get_followers_response.go b/linebot/messaging_api/model_get_followers_response.go index 6cccaca1..9c9a381e 100644 --- a/linebot/messaging_api/model_get_followers_response.go +++ b/linebot/messaging_api/model_get_followers_response.go @@ -33,7 +33,7 @@ type GetFollowersResponse struct { /** * A continuation token to get the next array of user IDs. Returned only when there are remaining user IDs that weren't returned in `userIds` in the original request. The number of user IDs in the `userIds` element doesn't have to reach the maximum number specified by `limit` for the `next` property to be included in the response. */ - Next string `json:"next"` + Next string `json:"next,omitempty"` } func NewGetFollowersResponse( diff --git a/linebot/messaging_api/model_group_summary_response.go b/linebot/messaging_api/model_group_summary_response.go index 71013405..639d52be 100644 --- a/linebot/messaging_api/model_group_summary_response.go +++ b/linebot/messaging_api/model_group_summary_response.go @@ -38,7 +38,7 @@ type GroupSummaryResponse struct { /** * Group icon URL. Not included in the response if the user doesn't set a group profile icon. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` } func NewGroupSummaryResponse( diff --git a/linebot/messaging_api/model_group_user_profile_response.go b/linebot/messaging_api/model_group_user_profile_response.go index 660375c4..7130caf5 100644 --- a/linebot/messaging_api/model_group_user_profile_response.go +++ b/linebot/messaging_api/model_group_user_profile_response.go @@ -38,7 +38,7 @@ type GroupUserProfileResponse struct { /** * Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` } func NewGroupUserProfileResponse( diff --git a/linebot/messaging_api/model_image_carousel_column.go b/linebot/messaging_api/model_image_carousel_column.go index ca7c1d5e..05c5b3d9 100644 --- a/linebot/messaging_api/model_image_carousel_column.go +++ b/linebot/messaging_api/model_image_carousel_column.go @@ -32,7 +32,7 @@ type ImageCarouselColumn struct { /** * Get ImageUrl */ - ImageUrl string `json:"imageUrl"` + ImageUrl string `json:"imageUrl,omitempty"` /** * Get Action diff --git a/linebot/messaging_api/model_image_message.go b/linebot/messaging_api/model_image_message.go index c682eed7..59240038 100644 --- a/linebot/messaging_api/model_image_message.go +++ b/linebot/messaging_api/model_image_message.go @@ -39,12 +39,12 @@ type ImageMessage struct { /** * Get OriginalContentUrl */ - OriginalContentUrl string `json:"originalContentUrl"` + OriginalContentUrl string `json:"originalContentUrl,omitempty"` /** * Get PreviewImageUrl */ - PreviewImageUrl string `json:"previewImageUrl"` + PreviewImageUrl string `json:"previewImageUrl,omitempty"` } func NewImageMessage() *ImageMessage { diff --git a/linebot/messaging_api/model_imagemap_external_link.go b/linebot/messaging_api/model_imagemap_external_link.go index ea6ff4b0..43c0948b 100644 --- a/linebot/messaging_api/model_imagemap_external_link.go +++ b/linebot/messaging_api/model_imagemap_external_link.go @@ -28,12 +28,12 @@ type ImagemapExternalLink struct { /** * Get LinkUri */ - LinkUri string `json:"linkUri"` + LinkUri string `json:"linkUri,omitempty"` /** * Get Label */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewImagemapExternalLink() *ImagemapExternalLink { diff --git a/linebot/messaging_api/model_imagemap_message.go b/linebot/messaging_api/model_imagemap_message.go index 41d1446a..9813a1cc 100644 --- a/linebot/messaging_api/model_imagemap_message.go +++ b/linebot/messaging_api/model_imagemap_message.go @@ -44,12 +44,12 @@ type ImagemapMessage struct { /** * Get BaseUrl */ - BaseUrl string `json:"baseUrl"` + BaseUrl string `json:"baseUrl,omitempty"` /** * Get AltText */ - AltText string `json:"altText"` + AltText string `json:"altText,omitempty"` /** * Get BaseSize diff --git a/linebot/messaging_api/model_imagemap_video.go b/linebot/messaging_api/model_imagemap_video.go index a40570b2..096bd13f 100644 --- a/linebot/messaging_api/model_imagemap_video.go +++ b/linebot/messaging_api/model_imagemap_video.go @@ -28,12 +28,12 @@ type ImagemapVideo struct { /** * Get OriginalContentUrl */ - OriginalContentUrl string `json:"originalContentUrl"` + OriginalContentUrl string `json:"originalContentUrl,omitempty"` /** * Get PreviewImageUrl */ - PreviewImageUrl string `json:"previewImageUrl"` + PreviewImageUrl string `json:"previewImageUrl,omitempty"` /** * Get Area diff --git a/linebot/messaging_api/model_location_action.go b/linebot/messaging_api/model_location_action.go index f6426b70..5be763d2 100644 --- a/linebot/messaging_api/model_location_action.go +++ b/linebot/messaging_api/model_location_action.go @@ -29,7 +29,7 @@ type LocationAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewLocationAction() *LocationAction { diff --git a/linebot/messaging_api/model_location_message.go b/linebot/messaging_api/model_location_message.go index 971ae56d..60a8d1a5 100644 --- a/linebot/messaging_api/model_location_message.go +++ b/linebot/messaging_api/model_location_message.go @@ -39,12 +39,12 @@ type LocationMessage struct { /** * Get Title */ - Title string `json:"title"` + Title string `json:"title,omitempty"` /** * Get Address */ - Address string `json:"address"` + Address string `json:"address,omitempty"` /** * Get Latitude diff --git a/linebot/messaging_api/model_members_ids_response.go b/linebot/messaging_api/model_members_ids_response.go index 07fd0827..83b84b90 100644 --- a/linebot/messaging_api/model_members_ids_response.go +++ b/linebot/messaging_api/model_members_ids_response.go @@ -33,7 +33,7 @@ type MembersIdsResponse struct { /** * A continuation token to get the next array of user IDs of the members in the group chat. Returned only when there are remaining user IDs that were not returned in `memberIds` in the original request. */ - Next string `json:"next"` + Next string `json:"next,omitempty"` } func NewMembersIdsResponse( diff --git a/linebot/messaging_api/model_message_action.go b/linebot/messaging_api/model_message_action.go index d846a1b9..178a8b08 100644 --- a/linebot/messaging_api/model_message_action.go +++ b/linebot/messaging_api/model_message_action.go @@ -29,12 +29,12 @@ type MessageAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` } func NewMessageAction() *MessageAction { diff --git a/linebot/messaging_api/model_message_imagemap_action.go b/linebot/messaging_api/model_message_imagemap_action.go index 9bc0690b..66d0a0cc 100644 --- a/linebot/messaging_api/model_message_imagemap_action.go +++ b/linebot/messaging_api/model_message_imagemap_action.go @@ -34,12 +34,12 @@ type MessageImagemapAction struct { /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get Label */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewMessageImagemapAction() *MessageImagemapAction { diff --git a/linebot/messaging_api/model_narrowcast_progress_response.go b/linebot/messaging_api/model_narrowcast_progress_response.go index e288764d..3ae03204 100644 --- a/linebot/messaging_api/model_narrowcast_progress_response.go +++ b/linebot/messaging_api/model_narrowcast_progress_response.go @@ -52,7 +52,7 @@ type NarrowcastProgressResponse struct { /** * The reason the message failed to be sent. This is only included with a `phase` property value of `failed`. */ - FailedDescription string `json:"failedDescription"` + FailedDescription string `json:"failedDescription,omitempty"` /** * Error summary. This is only included with a phase property value of failed. One of: `1`: An internal error occurred. `2`: An error occurred because there weren't enough recipients. `3`: A conflict error of requests occurs because a request that has already been accepted is retried. diff --git a/linebot/messaging_api/model_postback_action.go b/linebot/messaging_api/model_postback_action.go index 3e53b37f..9432c5b7 100644 --- a/linebot/messaging_api/model_postback_action.go +++ b/linebot/messaging_api/model_postback_action.go @@ -29,22 +29,22 @@ type PostbackAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` /** * Get Data */ - Data string `json:"data"` + Data string `json:"data,omitempty"` /** * Get DisplayText */ - DisplayText string `json:"displayText"` + DisplayText string `json:"displayText,omitempty"` /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get InputOption @@ -54,7 +54,7 @@ type PostbackAction struct { /** * Get FillInText */ - FillInText string `json:"fillInText"` + FillInText string `json:"fillInText,omitempty"` } func NewPostbackAction() *PostbackAction { diff --git a/linebot/messaging_api/model_quick_reply_item.go b/linebot/messaging_api/model_quick_reply_item.go index aa88aa2c..89f00e9a 100644 --- a/linebot/messaging_api/model_quick_reply_item.go +++ b/linebot/messaging_api/model_quick_reply_item.go @@ -32,7 +32,7 @@ type QuickReplyItem struct { /** * URL of the icon that is displayed at the beginning of the button */ - ImageUrl string `json:"imageUrl"` + ImageUrl string `json:"imageUrl,omitempty"` /** * Get Action @@ -42,7 +42,7 @@ type QuickReplyItem struct { /** * `action` */ - Type string `json:"type"` + Type string `json:"type,omitempty"` } func NewQuickReplyItem() *QuickReplyItem { diff --git a/linebot/messaging_api/model_recipient.go b/linebot/messaging_api/model_recipient.go index c14a7863..4dad983c 100644 --- a/linebot/messaging_api/model_recipient.go +++ b/linebot/messaging_api/model_recipient.go @@ -88,7 +88,7 @@ func setDiscriminatorPropertyRecipient(r RecipientInterface) RecipientInterface type Recipient struct { // Type of recipient - Type string `json:"type"` + Type string `json:"type,omitempty"` } func UnmarshalRecipient(data []byte) (RecipientInterface, error) { diff --git a/linebot/messaging_api/model_redelivery_recipient.go b/linebot/messaging_api/model_redelivery_recipient.go index b9679380..9d6a328b 100644 --- a/linebot/messaging_api/model_redelivery_recipient.go +++ b/linebot/messaging_api/model_redelivery_recipient.go @@ -29,7 +29,7 @@ type RedeliveryRecipient struct { /** * Get RequestId */ - RequestId string `json:"requestId"` + RequestId string `json:"requestId,omitempty"` } func NewRedeliveryRecipient() *RedeliveryRecipient { diff --git a/linebot/messaging_api/model_rich_menu_batch_request.go b/linebot/messaging_api/model_rich_menu_batch_request.go index e542f60d..24c16427 100644 --- a/linebot/messaging_api/model_rich_menu_batch_request.go +++ b/linebot/messaging_api/model_rich_menu_batch_request.go @@ -38,7 +38,7 @@ type RichMenuBatchRequest struct { /** * Key for retry. Key value is a string matching the regular expression pattern */ - ResumeRequestKey string `json:"resumeRequestKey"` + ResumeRequestKey string `json:"resumeRequestKey,omitempty"` } func NewRichMenuBatchRequest( diff --git a/linebot/messaging_api/model_rich_menu_request.go b/linebot/messaging_api/model_rich_menu_request.go index 57d23b3e..34cafc18 100644 --- a/linebot/messaging_api/model_rich_menu_request.go +++ b/linebot/messaging_api/model_rich_menu_request.go @@ -38,12 +38,12 @@ type RichMenuRequest struct { /** * Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. */ - Name string `json:"name"` + Name string `json:"name,omitempty"` /** * Text displayed in the chat bar */ - ChatBarText string `json:"chatBarText"` + ChatBarText string `json:"chatBarText,omitempty"` /** * Array of area objects which define the coordinates and size of tappable areas diff --git a/linebot/messaging_api/model_rich_menu_switch_action.go b/linebot/messaging_api/model_rich_menu_switch_action.go index 71e1d101..6ee347fd 100644 --- a/linebot/messaging_api/model_rich_menu_switch_action.go +++ b/linebot/messaging_api/model_rich_menu_switch_action.go @@ -29,17 +29,17 @@ type RichMenuSwitchAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` /** * Get Data */ - Data string `json:"data"` + Data string `json:"data,omitempty"` /** * Get RichMenuAliasId */ - RichMenuAliasId string `json:"richMenuAliasId"` + RichMenuAliasId string `json:"richMenuAliasId,omitempty"` } func NewRichMenuSwitchAction() *RichMenuSwitchAction { diff --git a/linebot/messaging_api/model_room_user_profile_response.go b/linebot/messaging_api/model_room_user_profile_response.go index b91e5872..0ef803a7 100644 --- a/linebot/messaging_api/model_room_user_profile_response.go +++ b/linebot/messaging_api/model_room_user_profile_response.go @@ -38,7 +38,7 @@ type RoomUserProfileResponse struct { /** * Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` } func NewRoomUserProfileResponse( diff --git a/linebot/messaging_api/model_sender.go b/linebot/messaging_api/model_sender.go index c512e79e..918bdb2b 100644 --- a/linebot/messaging_api/model_sender.go +++ b/linebot/messaging_api/model_sender.go @@ -28,12 +28,12 @@ type Sender struct { /** * Display name. Certain words such as `LINE` may not be used. */ - Name string `json:"name"` + Name string `json:"name,omitempty"` /** * URL of the image to display as an icon when sending a message */ - IconUrl string `json:"iconUrl"` + IconUrl string `json:"iconUrl,omitempty"` } func NewSender() *Sender { diff --git a/linebot/messaging_api/model_sent_message.go b/linebot/messaging_api/model_sent_message.go index 27afb7a0..79425ddc 100644 --- a/linebot/messaging_api/model_sent_message.go +++ b/linebot/messaging_api/model_sent_message.go @@ -33,7 +33,7 @@ type SentMessage struct { /** * Quote token of the message. Only included when a message object that can be specified as a quote target was sent as a push or reply message. */ - QuoteToken string `json:"quoteToken"` + QuoteToken string `json:"quoteToken,omitempty"` } func NewSentMessage( diff --git a/linebot/messaging_api/model_sticker_message.go b/linebot/messaging_api/model_sticker_message.go index a5c064f3..8025745b 100644 --- a/linebot/messaging_api/model_sticker_message.go +++ b/linebot/messaging_api/model_sticker_message.go @@ -39,17 +39,17 @@ type StickerMessage struct { /** * Get PackageId */ - PackageId string `json:"packageId"` + PackageId string `json:"packageId,omitempty"` /** * Get StickerId */ - StickerId string `json:"stickerId"` + StickerId string `json:"stickerId,omitempty"` /** * Quote token of the message you want to quote. */ - QuoteToken string `json:"quoteToken"` + QuoteToken string `json:"quoteToken,omitempty"` } func NewStickerMessage() *StickerMessage { diff --git a/linebot/messaging_api/model_template_message.go b/linebot/messaging_api/model_template_message.go index dee2e506..ecf6a663 100644 --- a/linebot/messaging_api/model_template_message.go +++ b/linebot/messaging_api/model_template_message.go @@ -43,7 +43,7 @@ type TemplateMessage struct { /** * Get AltText */ - AltText string `json:"altText"` + AltText string `json:"altText,omitempty"` /** * Get Template diff --git a/linebot/messaging_api/model_test_webhook_endpoint_request.go b/linebot/messaging_api/model_test_webhook_endpoint_request.go index 6d03f805..4fb7ce48 100644 --- a/linebot/messaging_api/model_test_webhook_endpoint_request.go +++ b/linebot/messaging_api/model_test_webhook_endpoint_request.go @@ -28,7 +28,7 @@ type TestWebhookEndpointRequest struct { /** * A webhook URL to be validated. */ - Endpoint string `json:"endpoint"` + Endpoint string `json:"endpoint,omitempty"` } func NewTestWebhookEndpointRequest() *TestWebhookEndpointRequest { diff --git a/linebot/messaging_api/model_text_message.go b/linebot/messaging_api/model_text_message.go index d9ba5502..002e7af0 100644 --- a/linebot/messaging_api/model_text_message.go +++ b/linebot/messaging_api/model_text_message.go @@ -39,7 +39,7 @@ type TextMessage struct { /** * Get Text */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Get Emojis @@ -49,7 +49,7 @@ type TextMessage struct { /** * Quote token of the message you want to quote. */ - QuoteToken string `json:"quoteToken"` + QuoteToken string `json:"quoteToken,omitempty"` } func NewTextMessage() *TextMessage { diff --git a/linebot/messaging_api/model_uri_action.go b/linebot/messaging_api/model_uri_action.go index 3096fa09..cfddfbac 100644 --- a/linebot/messaging_api/model_uri_action.go +++ b/linebot/messaging_api/model_uri_action.go @@ -29,12 +29,12 @@ type UriAction struct { /** * Label for the action. */ - Label string `json:"label"` + Label string `json:"label,omitempty"` /** * Get Uri */ - Uri string `json:"uri"` + Uri string `json:"uri,omitempty"` /** * Get AltUri diff --git a/linebot/messaging_api/model_uri_imagemap_action.go b/linebot/messaging_api/model_uri_imagemap_action.go index a4c092b0..fa1b11e6 100644 --- a/linebot/messaging_api/model_uri_imagemap_action.go +++ b/linebot/messaging_api/model_uri_imagemap_action.go @@ -34,12 +34,12 @@ type UriImagemapAction struct { /** * Get LinkUri */ - LinkUri string `json:"linkUri"` + LinkUri string `json:"linkUri,omitempty"` /** * Get Label */ - Label string `json:"label"` + Label string `json:"label,omitempty"` } func NewUriImagemapAction() *UriImagemapAction { diff --git a/linebot/messaging_api/model_user_profile_response.go b/linebot/messaging_api/model_user_profile_response.go index f5287d5c..fc1229e2 100644 --- a/linebot/messaging_api/model_user_profile_response.go +++ b/linebot/messaging_api/model_user_profile_response.go @@ -38,17 +38,17 @@ type UserProfileResponse struct { /** * Profile image URL. `https` image URL. Not included in the response if the user doesn't have a profile image. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` /** * User's status message. Not included in the response if the user doesn't have a status message. */ - StatusMessage string `json:"statusMessage"` + StatusMessage string `json:"statusMessage,omitempty"` /** * User's language, as a BCP 47 language tag. Not included in the response if the user hasn't yet consented to the LINE Privacy Policy. */ - Language string `json:"language"` + Language string `json:"language,omitempty"` } func NewUserProfileResponse( diff --git a/linebot/messaging_api/model_video_message.go b/linebot/messaging_api/model_video_message.go index 6c49dce6..336e7646 100644 --- a/linebot/messaging_api/model_video_message.go +++ b/linebot/messaging_api/model_video_message.go @@ -39,17 +39,17 @@ type VideoMessage struct { /** * Get OriginalContentUrl */ - OriginalContentUrl string `json:"originalContentUrl"` + OriginalContentUrl string `json:"originalContentUrl,omitempty"` /** * Get PreviewImageUrl */ - PreviewImageUrl string `json:"previewImageUrl"` + PreviewImageUrl string `json:"previewImageUrl,omitempty"` /** * Get TrackingId */ - TrackingId string `json:"trackingId"` + TrackingId string `json:"trackingId,omitempty"` } func NewVideoMessage() *VideoMessage { diff --git a/linebot/module/model_detach_module_request.go b/linebot/module/model_detach_module_request.go index c68478c2..2802d81d 100644 --- a/linebot/module/model_detach_module_request.go +++ b/linebot/module/model_detach_module_request.go @@ -28,7 +28,7 @@ type DetachModuleRequest struct { /** * User ID of the LINE Official Account bot attached to the module channel. */ - BotId string `json:"botId"` + BotId string `json:"botId,omitempty"` } func NewDetachModuleRequest() *DetachModuleRequest { diff --git a/linebot/module/model_get_modules_response.go b/linebot/module/model_get_modules_response.go index f8aa3123..92f7d08f 100644 --- a/linebot/module/model_get_modules_response.go +++ b/linebot/module/model_get_modules_response.go @@ -33,7 +33,7 @@ type GetModulesResponse struct { /** * Continuation token. Used to get the next array of basic bot information. This property is only returned if there are more unreturned results. */ - Next string `json:"next"` + Next string `json:"next,omitempty"` } func NewGetModulesResponse( diff --git a/linebot/module/model_module_bot.go b/linebot/module/model_module_bot.go index 96da3389..17429248 100644 --- a/linebot/module/model_module_bot.go +++ b/linebot/module/model_module_bot.go @@ -38,7 +38,7 @@ type ModuleBot struct { /** * Bot's premium ID. Not included in the response if the premium ID isn't set. */ - PremiumId string `json:"premiumId"` + PremiumId string `json:"premiumId,omitempty"` /** * Bot's display name (Required) @@ -48,7 +48,7 @@ type ModuleBot struct { /** * Profile image URL. Image URL starting with `https://`. Not included in the response if the bot doesn't have a profile image. */ - PictureUrl string `json:"pictureUrl"` + PictureUrl string `json:"pictureUrl,omitempty"` } func NewModuleBot( diff --git a/linebot/webhook/model_account_link_event.go b/linebot/webhook/model_account_link_event.go index dc985568..4cf3be63 100644 --- a/linebot/webhook/model_account_link_event.go +++ b/linebot/webhook/model_account_link_event.go @@ -58,7 +58,7 @@ type AccountLinkEvent struct { /** * Reply token used to send reply message to this event. This property won't be included if linking the account has failed. */ - ReplyToken string `json:"replyToken"` + ReplyToken string `json:"replyToken,omitempty"` /** * Get Link diff --git a/linebot/webhook/model_action_result.go b/linebot/webhook/model_action_result.go index 80a095f4..fe7fd6c6 100644 --- a/linebot/webhook/model_action_result.go +++ b/linebot/webhook/model_action_result.go @@ -33,7 +33,7 @@ type ActionResult struct { /** * Base64-encoded binary data */ - Data string `json:"data"` + Data string `json:"data,omitempty"` } func NewActionResult( diff --git a/linebot/webhook/model_beacon_content.go b/linebot/webhook/model_beacon_content.go index 91b79d49..0e1c52a8 100644 --- a/linebot/webhook/model_beacon_content.go +++ b/linebot/webhook/model_beacon_content.go @@ -38,7 +38,7 @@ type BeaconContent struct { /** * Device message of beacon that was detected. */ - Dm string `json:"dm"` + Dm string `json:"dm,omitempty"` } func NewBeaconContent( diff --git a/linebot/webhook/model_callback_request.go b/linebot/webhook/model_callback_request.go index cd392bba..7f722ec8 100644 --- a/linebot/webhook/model_callback_request.go +++ b/linebot/webhook/model_callback_request.go @@ -33,7 +33,7 @@ type CallbackRequest struct { /** * User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, `U[0-9a-f]{32}`. */ - Destination string `json:"destination"` + Destination string `json:"destination,omitempty"` /** * Array of webhook event objects. The LINE Platform may send an empty array that doesn't include a webhook event object to confirm communication. diff --git a/linebot/webhook/model_content_provider.go b/linebot/webhook/model_content_provider.go index 8ed27eb4..f62cffdb 100644 --- a/linebot/webhook/model_content_provider.go +++ b/linebot/webhook/model_content_provider.go @@ -33,12 +33,12 @@ type ContentProvider struct { /** * URL of the image file. Only included when contentProvider.type is external. */ - OriginalContentUrl string `json:"originalContentUrl"` + OriginalContentUrl string `json:"originalContentUrl,omitempty"` /** * URL of the preview image. Only included when contentProvider.type is external. */ - PreviewImageUrl string `json:"previewImageUrl"` + PreviewImageUrl string `json:"previewImageUrl,omitempty"` } func NewContentProvider( diff --git a/linebot/webhook/model_event.go b/linebot/webhook/model_event.go index 848ad45c..952dda83 100644 --- a/linebot/webhook/model_event.go +++ b/linebot/webhook/model_event.go @@ -253,7 +253,7 @@ func setDiscriminatorPropertyEvent(r EventInterface) EventInterface { type Event struct { // Type of the event - Type string `json:"type"` + Type string `json:"type,omitempty"` Source Source `json:"source,omitempty"` // Time of the event in milliseconds. diff --git a/linebot/webhook/model_group_source.go b/linebot/webhook/model_group_source.go index 5695294c..43202da8 100644 --- a/linebot/webhook/model_group_source.go +++ b/linebot/webhook/model_group_source.go @@ -34,7 +34,7 @@ type GroupSource struct { /** * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. */ - UserId string `json:"userId"` + UserId string `json:"userId,omitempty"` } func NewGroupSource( diff --git a/linebot/webhook/model_image_set.go b/linebot/webhook/model_image_set.go index b75e96f8..dbe29537 100644 --- a/linebot/webhook/model_image_set.go +++ b/linebot/webhook/model_image_set.go @@ -28,7 +28,7 @@ type ImageSet struct { /** * Image set ID. Only included when multiple images are sent simultaneously. */ - Id string `json:"id"` + Id string `json:"id,omitempty"` /** * An index starting from 1, indicating the image number in a set of images sent simultaneously. Only included when multiple images are sent simultaneously. However, it won't be included if the sender is using LINE 11.15 or earlier for Android. diff --git a/linebot/webhook/model_location_message_content.go b/linebot/webhook/model_location_message_content.go index 0482e48c..d2bcd606 100644 --- a/linebot/webhook/model_location_message_content.go +++ b/linebot/webhook/model_location_message_content.go @@ -34,12 +34,12 @@ type LocationMessageContent struct { /** * Title */ - Title string `json:"title"` + Title string `json:"title,omitempty"` /** * Address */ - Address string `json:"address"` + Address string `json:"address,omitempty"` /** * Latitude (Required) diff --git a/linebot/webhook/model_mentionee.go b/linebot/webhook/model_mentionee.go index 899680d8..be0bd6bc 100644 --- a/linebot/webhook/model_mentionee.go +++ b/linebot/webhook/model_mentionee.go @@ -75,7 +75,7 @@ func setDiscriminatorPropertyMentionee(r MentioneeInterface) MentioneeInterface type Mentionee struct { // Mentioned target. - Type string `json:"type"` + Type string `json:"type,omitempty"` // Index position of the user mention for a character in text, with the first character being at position 0. Index int32 `json:"index"` diff --git a/linebot/webhook/model_message_content.go b/linebot/webhook/model_message_content.go index 9e510434..a895324d 100644 --- a/linebot/webhook/model_message_content.go +++ b/linebot/webhook/model_message_content.go @@ -130,7 +130,7 @@ func setDiscriminatorPropertyMessageContent(r MessageContentInterface) MessageCo type MessageContent struct { // Type - Type string `json:"type"` + Type string `json:"type,omitempty"` // Message ID Id string `json:"id"` diff --git a/linebot/webhook/model_message_event.go b/linebot/webhook/model_message_event.go index 2d9178da..ad34f852 100644 --- a/linebot/webhook/model_message_event.go +++ b/linebot/webhook/model_message_event.go @@ -58,7 +58,7 @@ type MessageEvent struct { /** * Get ReplyToken */ - ReplyToken string `json:"replyToken"` + ReplyToken string `json:"replyToken,omitempty"` /** * Get Message diff --git a/linebot/webhook/model_module_content.go b/linebot/webhook/model_module_content.go index 9b5ba7cc..18a9cedc 100644 --- a/linebot/webhook/model_module_content.go +++ b/linebot/webhook/model_module_content.go @@ -75,7 +75,7 @@ func setDiscriminatorPropertyModuleContent(r ModuleContentInterface) ModuleConte type ModuleContent struct { // Type - Type string `json:"type"` + Type string `json:"type,omitempty"` } func UnmarshalModuleContent(data []byte) (ModuleContentInterface, error) { diff --git a/linebot/webhook/model_postback_event.go b/linebot/webhook/model_postback_event.go index 64007a9e..51ce8b1f 100644 --- a/linebot/webhook/model_postback_event.go +++ b/linebot/webhook/model_postback_event.go @@ -58,7 +58,7 @@ type PostbackEvent struct { /** * Reply token used to send reply message to this event */ - ReplyToken string `json:"replyToken"` + ReplyToken string `json:"replyToken,omitempty"` /** * Get Postback diff --git a/linebot/webhook/model_room_source.go b/linebot/webhook/model_room_source.go index 781cd17d..403313bc 100644 --- a/linebot/webhook/model_room_source.go +++ b/linebot/webhook/model_room_source.go @@ -29,7 +29,7 @@ type RoomSource struct { /** * ID of the source user. Only included in message events. Only users of LINE for iOS and LINE for Android are included in userId. */ - UserId string `json:"userId"` + UserId string `json:"userId,omitempty"` /** * Room ID of the source multi-person chat (Required) diff --git a/linebot/webhook/model_scenario_result.go b/linebot/webhook/model_scenario_result.go index 524e2208..4f8b4918 100644 --- a/linebot/webhook/model_scenario_result.go +++ b/linebot/webhook/model_scenario_result.go @@ -28,7 +28,7 @@ type ScenarioResult struct { /** * Scenario ID executed */ - ScenarioId string `json:"scenarioId"` + ScenarioId string `json:"scenarioId,omitempty"` /** * Revision number of the scenario set containing the executed scenario @@ -58,12 +58,12 @@ type ScenarioResult struct { /** * Data contained in notification. */ - BleNotificationPayload string `json:"bleNotificationPayload"` + BleNotificationPayload string `json:"bleNotificationPayload,omitempty"` /** * Error reason. */ - ErrorReason string `json:"errorReason"` + ErrorReason string `json:"errorReason,omitempty"` } func NewScenarioResult( diff --git a/linebot/webhook/model_source.go b/linebot/webhook/model_source.go index 12d8b4aa..dfd7fa4b 100644 --- a/linebot/webhook/model_source.go +++ b/linebot/webhook/model_source.go @@ -88,7 +88,7 @@ func setDiscriminatorPropertySource(r SourceInterface) SourceInterface { type Source struct { // source type - Type string `json:"type"` + Type string `json:"type,omitempty"` } func UnmarshalSource(data []byte) (SourceInterface, error) { diff --git a/linebot/webhook/model_sticker_message_content.go b/linebot/webhook/model_sticker_message_content.go index aa062f4b..c3275e8d 100644 --- a/linebot/webhook/model_sticker_message_content.go +++ b/linebot/webhook/model_sticker_message_content.go @@ -54,7 +54,7 @@ type StickerMessageContent struct { /** * Any text entered by the user. This property is only included for message stickers. Max character limit: 100 */ - Text string `json:"text"` + Text string `json:"text,omitempty"` /** * Quote token to quote this message. (Required) @@ -64,7 +64,7 @@ type StickerMessageContent struct { /** * Message ID of a quoted message. Only included when the received message quotes a past message. */ - QuotedMessageId string `json:"quotedMessageId"` + QuotedMessageId string `json:"quotedMessageId,omitempty"` } func NewStickerMessageContent( diff --git a/linebot/webhook/model_text_message_content.go b/linebot/webhook/model_text_message_content.go index 671be841..7c506a18 100644 --- a/linebot/webhook/model_text_message_content.go +++ b/linebot/webhook/model_text_message_content.go @@ -54,7 +54,7 @@ type TextMessageContent struct { /** * Message ID of a quoted message. Only included when the received message quotes a past message. */ - QuotedMessageId string `json:"quotedMessageId"` + QuotedMessageId string `json:"quotedMessageId,omitempty"` } func NewTextMessageContent( diff --git a/linebot/webhook/model_things_content.go b/linebot/webhook/model_things_content.go index f4b85077..a0f8e98d 100644 --- a/linebot/webhook/model_things_content.go +++ b/linebot/webhook/model_things_content.go @@ -86,7 +86,7 @@ func setDiscriminatorPropertyThingsContent(r ThingsContentInterface) ThingsConte type ThingsContent struct { // Type - Type string `json:"type"` + Type string `json:"type,omitempty"` } func UnmarshalThingsContent(data []byte) (ThingsContentInterface, error) { diff --git a/linebot/webhook/model_user_mentionee.go b/linebot/webhook/model_user_mentionee.go index cd40a664..18ce89ce 100644 --- a/linebot/webhook/model_user_mentionee.go +++ b/linebot/webhook/model_user_mentionee.go @@ -39,7 +39,7 @@ type UserMentionee struct { /** * User ID of the mentioned user. Only included if mention.mentions[].type is user and the user consents to the LINE Official Account obtaining their user profile information. */ - UserId string `json:"userId"` + UserId string `json:"userId,omitempty"` } func NewUserMentionee( diff --git a/linebot/webhook/model_user_source.go b/linebot/webhook/model_user_source.go index 72d9e38b..4090bf54 100644 --- a/linebot/webhook/model_user_source.go +++ b/linebot/webhook/model_user_source.go @@ -29,7 +29,7 @@ type UserSource struct { /** * ID of the source user */ - UserId string `json:"userId"` + UserId string `json:"userId,omitempty"` } func NewUserSource() *UserSource {