From 3b4309ba9c93342763f9564893f02d1b02b01ce5 Mon Sep 17 00:00:00 2001 From: Muhamad Ibnu Lukman Date: Fri, 4 Oct 2024 17:10:08 +0700 Subject: [PATCH] Initial release --- .gitignore | 26 + CHANGELOG.md | 12 + CONTRIBUTING.md | 33 + LICENSE | 7 + README.md | 224 + api/openapi.yaml | 7599 +++++++++++++++++ api_accept_reject_order.go | 146 + api_cancel_order.go | 210 + api_check_order_cancelable.go | 155 + api_create_campaign.go | 166 + api_delete_campaign.go | 128 + api_edit_order.go | 160 + api_get_dinein_voucher.go | 185 + api_get_oauth_grab.go | 146 + api_get_store_hour.go | 149 + api_get_store_status.go | 149 + api_list_campaign.go | 145 + api_list_orders.go | 166 + api_mark_order_ready.go | 155 + api_notify_membership_webview.go | 145 + api_pause_store.go | 145 + api_redeem_dinein_voucher.go | 188 + api_trace_menu_sync.go | 155 + api_update_campaign.go | 150 + api_update_delivery_state.go | 145 + api_update_menu_notification.go | 146 + api_update_menu_record.go | 277 + api_update_order_ready_time.go | 155 + api_update_store_delivery_hour.go | 161 + api_update_store_dine_in_hour.go | 161 + api_update_store_special_hour.go | 161 + client.go | 727 ++ configuration.go | 247 + docs/AcceptOrderRequest.md | 72 + docs/AcceptRejectOrderAPI.md | 75 + docs/Address.md | 212 + docs/AdvancedPricing.md | 212 + docs/BatchUpdateMenuItem.md | 98 + docs/BatchUpdateMenuResponse.md | 118 + docs/BindMembershipNativeRequest.md | 77 + docs/BindMembershipNativeResponse.md | 51 + docs/Campaign.md | 218 + docs/CampaignConditions.md | 171 + docs/CampaignDiscount.md | 124 + docs/CampaignQuotas.md | 82 + docs/CampaignScope.md | 77 + docs/CancelCode.md | 17 + docs/CancelOrderAPI.md | 77 + docs/CancelOrderLimitType.md | 19 + docs/CancelOrderRequest.md | 93 + docs/CancelOrderResponse.md | 82 + docs/CancelReason.md | 82 + docs/CheckOrderCancelableAPI.md | 77 + docs/CheckOrderCancelableResponse.md | 160 + docs/Coordinates.md | 82 + docs/CreateCampaignAPI.md | 78 + docs/CreateCampaignRequest.md | 166 + docs/CreateCampaignResponse.md | 56 + docs/Currency.md | 93 + docs/DeleteCampaignAPI.md | 77 + docs/DineIn.md | 82 + docs/EditOrderAPI.md | 81 + docs/EditOrderItem.md | 124 + docs/EditOrderRequest.md | 98 + docs/Error.md | 108 + docs/GetDineInVoucherResponse.md | 186 + docs/GetDineinVoucherAPI.md | 79 + docs/GetMembershipNativeResponse.md | 108 + docs/GetMembershipNativeResponsePointInfo.md | 108 + docs/GetMembershipRequest.md | 51 + docs/GetMembershipWebviewResponse.md | 56 + docs/GetMenuNewResponse.md | 145 + docs/GetMenuOldResponse.md | 124 + docs/GetOauthGrabAPI.md | 75 + docs/GetRewardNativeRequest.md | 134 + docs/GetRewardNativeResponse.md | 51 + docs/GetStoreHourAPI.md | 79 + docs/GetStoreStatusAPI.md | 79 + docs/GrabOauthRequest.md | 114 + docs/GrabOauthResponse.md | 108 + docs/ListCampaignAPI.md | 75 + docs/ListCampaignResponse.md | 82 + docs/ListOrdersAPI.md | 79 + docs/ListOrdersResponse.md | 82 + docs/MarkOrderReadyAPI.md | 75 + docs/MarkOrderRequest.md | 72 + docs/MenuCategory.md | 161 + docs/MenuEntity.md | 186 + docs/MenuEntityError.md | 82 + docs/MenuItem.md | 426 + docs/MenuModifier.md | 197 + docs/MenuSection.md | 114 + docs/MenuSectionCategory.md | 140 + docs/MenuSectionCategoryItem.md | 400 + docs/MenuSyncFail.md | 134 + docs/MenuSyncFailCategory.md | 108 + docs/MenuSyncFailItem.md | 108 + docs/MenuSyncFailModifier.md | 82 + docs/MenuSyncFailModifierGroup.md | 108 + docs/MenuSyncFailServiceHours.md | 56 + docs/MenuSyncResponse.md | 165 + docs/MenuSyncWebhookRequest.md | 212 + docs/ModifierGroup.md | 192 + docs/NewOrderTimeRequest.md | 72 + docs/NotifyMembershipWebviewAPI.md | 75 + docs/NotifyMembershipWebviewRequest.md | 134 + docs/OpenPeriod.md | 72 + docs/Order.md | 536 ++ docs/OrderCampaign.md | 326 + docs/OrderDeliveryRequest.md | 93 + docs/OrderFeatureFlags.md | 98 + docs/OrderFreeItem.md | 134 + docs/OrderItem.md | 228 + docs/OrderItemModifier.md | 134 + docs/OrderPrice.md | 228 + docs/OrderPromo.md | 238 + docs/OrderReadyEstimation.md | 129 + docs/OrderStateRequest.md | 181 + docs/OutOfStockInstruction.md | 134 + docs/PartnerOauthRequest.md | 119 + docs/PartnerOauthResponse.md | 108 + docs/PauseStoreAPI.md | 75 + docs/PauseStoreRequest.md | 98 + docs/Purchasability.md | 212 + docs/Receiver.md | 108 + docs/RedeemDineInVoucherRequest.md | 72 + docs/RedeemDineInVoucherResponse.md | 186 + docs/RedeemDineinVoucherAPI.md | 77 + docs/RedeemResult.md | 82 + docs/RegisterMembershipNativeRequest.md | 129 + docs/RegisterMembershipNativeResponse.md | 51 + docs/RewardItem.md | 82 + docs/SellingTime.md | 160 + docs/ServiceHour.md | 77 + docs/ServiceHours.md | 177 + docs/SpecialOpeningHour.md | 134 + docs/SpecialOpeningHourMetadata.md | 56 + docs/SpecialOpeningHourOpeningHours.md | 82 + docs/StoreHour.md | 177 + docs/StoreHourResponse.md | 108 + docs/StoreStatusResponse.md | 93 + docs/SubmitOrderRequest.md | 536 ++ docs/TraceMenuSyncAPI.md | 75 + docs/UnbindMembershipNativeRequest.md | 51 + docs/UnlinkMembershipWebviewRequest.md | 51 + docs/UpdateAdvancedPricing.md | 82 + docs/UpdateCampaignAPI.md | 81 + docs/UpdateCampaignRequest.md | 186 + docs/UpdateDeliveryHourRequest.md | 72 + docs/UpdateDeliveryHourResponse.md | 129 + docs/UpdateDeliveryStateAPI.md | 75 + docs/UpdateDineInHourRequest.md | 51 + docs/UpdateDineInHourResponse.md | 66 + docs/UpdateMenuItem.md | 223 + docs/UpdateMenuModifier.md | 218 + docs/UpdateMenuNotifRequest.md | 51 + docs/UpdateMenuNotificationAPI.md | 75 + docs/UpdateMenuRecordAPI.md | 144 + docs/UpdateMenuRequest.md | 270 + docs/UpdateOrderReadyTimeAPI.md | 76 + docs/UpdatePurchasability.md | 82 + docs/UpdateSpecialHourRequest.md | 51 + docs/UpdateSpecialHourResponse.md | 129 + docs/UpdateStoreDeliveryHourAPI.md | 83 + docs/UpdateStoreDineInHourAPI.md | 83 + docs/UpdateStoreSpecialHourAPI.md | 83 + docs/Voucher.md | 160 + docs/VoucherDescriptionInfo.md | 56 + docs/WorkingHour.md | 212 + docs/WorkingHourDay.md | 66 + go.mod | 6 + go.sum | 11 + model_accept_order_request.go | 202 + model_address.go | 386 + model_advanced_pricing.go | 387 + model_batch_update_menu_item.go | 240 + model_batch_update_menu_response.go | 236 + model_bind_membership_native_request.go | 210 + model_bind_membership_native_response.go | 172 + model_campaign.go | 411 + model_campaign_conditions.go | 346 + model_campaign_discount.go | 277 + model_campaign_quotas.go | 197 + model_campaign_scope.go | 210 + model_cancel_code.go | 118 + model_cancel_order_limit_type.go | 120 + model_cancel_order_request.go | 231 + model_cancel_order_response.go | 196 + model_cancel_reason.go | 196 + model_check_order_cancelable_response.go | 310 + model_coordinates.go | 197 + model_create_campaign_request.go | 335 + model_create_campaign_response.go | 159 + model_currency.go | 232 + model_dine_in.go | 197 + model_edit_order_item.go | 278 + model_edit_order_request.go | 240 + model_error.go | 235 + model_get_dine_in_voucher_response.go | 348 + model_get_membership_native_response.go | 234 + ...t_membership_native_response_point_info.go | 235 + model_get_membership_request.go | 172 + model_get_membership_webview_response.go | 159 + model_get_menu_new_response.go | 307 + model_get_menu_old_response.go | 277 + model_get_reward_native_request.go | 272 + model_get_reward_native_response.go | 172 + model_grab_oauth_request.go | 262 + model_grab_oauth_response.go | 235 + model_list_campaign_response.go | 195 + model_list_orders_response.go | 196 + model_mark_order_request.go | 202 + model_menu_category.go | 330 + model_menu_entity.go | 349 + model_menu_entity_error.go | 197 + model_menu_item.go | 716 ++ model_menu_modifier.go | 383 + model_menu_section.go | 261 + model_menu_section_category.go | 300 + model_menu_section_category_item.go | 678 ++ model_menu_sync_fail.go | 270 + model_menu_sync_fail_category.go | 235 + model_menu_sync_fail_item.go | 234 + model_menu_sync_fail_modifier.go | 196 + model_menu_sync_fail_modifier_group.go | 233 + model_menu_sync_fail_service_hours.go | 159 + model_menu_sync_response.go | 310 + model_menu_sync_webhook_request.go | 387 + model_modifier_group.go | 376 + model_new_order_time_request.go | 203 + model_notify_membership_webview_request.go | 273 + model_open_period.go | 202 + model_order.go | 856 ++ model_order_campaign.go | 539 ++ model_order_delivery_request.go | 232 + model_order_feature_flags.go | 240 + model_order_free_item.go | 273 + model_order_item.go | 423 + model_order_item_modifier.go | 273 + model_order_price.go | 430 + model_order_promo.go | 425 + model_order_ready_estimation.go | 281 + model_order_state_request.go | 356 + model_out_of_stock_instruction.go | 273 + model_partner_oauth_request.go | 270 + model_partner_oauth_response.go | 235 + model_pause_store_request.go | 240 + model_purchasability.go | 380 + model_receiver.go | 234 + model_redeem_dine_in_voucher_request.go | 202 + model_redeem_dine_in_voucher_response.go | 347 + model_redeem_result.go | 197 + model_register_membership_native_request.go | 286 + model_register_membership_native_response.go | 172 + model_reward_item.go | 197 + model_selling_time.go | 310 + model_service_hour.go | 210 + model_service_hours.go | 345 + model_special_opening_hour.go | 271 + model_special_opening_hour_metadata.go | 159 + model_special_opening_hour_opening_hours.go | 197 + model_store_hour.go | 352 + model_store_hour_response.go | 233 + model_store_status_response.go | 232 + model_submit_order_request.go | 856 ++ model_unbind_membership_native_request.go | 172 + model_unlink_membership_webview_request.go | 172 + model_update_advanced_pricing.go | 197 + model_update_campaign_request.go | 346 + model_update_delivery_hour_request.go | 201 + model_update_delivery_hour_response.go | 271 + model_update_dine_in_hour_request.go | 171 + model_update_dine_in_hour_response.go | 160 + model_update_menu_item.go | 422 + model_update_menu_modifier.go | 414 + model_update_menu_notif_request.go | 172 + model_update_menu_request.go | 160 + model_update_purchasability.go | 196 + model_update_special_hour_request.go | 172 + model_update_special_hour_response.go | 271 + model_voucher.go | 310 + model_voucher_description_info.go | 159 + model_working_hour.go | 380 + model_working_hour_day.go | 160 + response.go | 50 + utils.go | 364 + 286 files changed, 61127 insertions(+) create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 api/openapi.yaml create mode 100644 api_accept_reject_order.go create mode 100644 api_cancel_order.go create mode 100644 api_check_order_cancelable.go create mode 100644 api_create_campaign.go create mode 100644 api_delete_campaign.go create mode 100644 api_edit_order.go create mode 100644 api_get_dinein_voucher.go create mode 100644 api_get_oauth_grab.go create mode 100644 api_get_store_hour.go create mode 100644 api_get_store_status.go create mode 100644 api_list_campaign.go create mode 100644 api_list_orders.go create mode 100644 api_mark_order_ready.go create mode 100644 api_notify_membership_webview.go create mode 100644 api_pause_store.go create mode 100644 api_redeem_dinein_voucher.go create mode 100644 api_trace_menu_sync.go create mode 100644 api_update_campaign.go create mode 100644 api_update_delivery_state.go create mode 100644 api_update_menu_notification.go create mode 100644 api_update_menu_record.go create mode 100644 api_update_order_ready_time.go create mode 100644 api_update_store_delivery_hour.go create mode 100644 api_update_store_dine_in_hour.go create mode 100644 api_update_store_special_hour.go create mode 100644 client.go create mode 100644 configuration.go create mode 100644 docs/AcceptOrderRequest.md create mode 100644 docs/AcceptRejectOrderAPI.md create mode 100644 docs/Address.md create mode 100644 docs/AdvancedPricing.md create mode 100644 docs/BatchUpdateMenuItem.md create mode 100644 docs/BatchUpdateMenuResponse.md create mode 100644 docs/BindMembershipNativeRequest.md create mode 100644 docs/BindMembershipNativeResponse.md create mode 100644 docs/Campaign.md create mode 100644 docs/CampaignConditions.md create mode 100644 docs/CampaignDiscount.md create mode 100644 docs/CampaignQuotas.md create mode 100644 docs/CampaignScope.md create mode 100644 docs/CancelCode.md create mode 100644 docs/CancelOrderAPI.md create mode 100644 docs/CancelOrderLimitType.md create mode 100644 docs/CancelOrderRequest.md create mode 100644 docs/CancelOrderResponse.md create mode 100644 docs/CancelReason.md create mode 100644 docs/CheckOrderCancelableAPI.md create mode 100644 docs/CheckOrderCancelableResponse.md create mode 100644 docs/Coordinates.md create mode 100644 docs/CreateCampaignAPI.md create mode 100644 docs/CreateCampaignRequest.md create mode 100644 docs/CreateCampaignResponse.md create mode 100644 docs/Currency.md create mode 100644 docs/DeleteCampaignAPI.md create mode 100644 docs/DineIn.md create mode 100644 docs/EditOrderAPI.md create mode 100644 docs/EditOrderItem.md create mode 100644 docs/EditOrderRequest.md create mode 100644 docs/Error.md create mode 100644 docs/GetDineInVoucherResponse.md create mode 100644 docs/GetDineinVoucherAPI.md create mode 100644 docs/GetMembershipNativeResponse.md create mode 100644 docs/GetMembershipNativeResponsePointInfo.md create mode 100644 docs/GetMembershipRequest.md create mode 100644 docs/GetMembershipWebviewResponse.md create mode 100644 docs/GetMenuNewResponse.md create mode 100644 docs/GetMenuOldResponse.md create mode 100644 docs/GetOauthGrabAPI.md create mode 100644 docs/GetRewardNativeRequest.md create mode 100644 docs/GetRewardNativeResponse.md create mode 100644 docs/GetStoreHourAPI.md create mode 100644 docs/GetStoreStatusAPI.md create mode 100644 docs/GrabOauthRequest.md create mode 100644 docs/GrabOauthResponse.md create mode 100644 docs/ListCampaignAPI.md create mode 100644 docs/ListCampaignResponse.md create mode 100644 docs/ListOrdersAPI.md create mode 100644 docs/ListOrdersResponse.md create mode 100644 docs/MarkOrderReadyAPI.md create mode 100644 docs/MarkOrderRequest.md create mode 100644 docs/MenuCategory.md create mode 100644 docs/MenuEntity.md create mode 100644 docs/MenuEntityError.md create mode 100644 docs/MenuItem.md create mode 100644 docs/MenuModifier.md create mode 100644 docs/MenuSection.md create mode 100644 docs/MenuSectionCategory.md create mode 100644 docs/MenuSectionCategoryItem.md create mode 100644 docs/MenuSyncFail.md create mode 100644 docs/MenuSyncFailCategory.md create mode 100644 docs/MenuSyncFailItem.md create mode 100644 docs/MenuSyncFailModifier.md create mode 100644 docs/MenuSyncFailModifierGroup.md create mode 100644 docs/MenuSyncFailServiceHours.md create mode 100644 docs/MenuSyncResponse.md create mode 100644 docs/MenuSyncWebhookRequest.md create mode 100644 docs/ModifierGroup.md create mode 100644 docs/NewOrderTimeRequest.md create mode 100644 docs/NotifyMembershipWebviewAPI.md create mode 100644 docs/NotifyMembershipWebviewRequest.md create mode 100644 docs/OpenPeriod.md create mode 100644 docs/Order.md create mode 100644 docs/OrderCampaign.md create mode 100644 docs/OrderDeliveryRequest.md create mode 100644 docs/OrderFeatureFlags.md create mode 100644 docs/OrderFreeItem.md create mode 100644 docs/OrderItem.md create mode 100644 docs/OrderItemModifier.md create mode 100644 docs/OrderPrice.md create mode 100644 docs/OrderPromo.md create mode 100644 docs/OrderReadyEstimation.md create mode 100644 docs/OrderStateRequest.md create mode 100644 docs/OutOfStockInstruction.md create mode 100644 docs/PartnerOauthRequest.md create mode 100644 docs/PartnerOauthResponse.md create mode 100644 docs/PauseStoreAPI.md create mode 100644 docs/PauseStoreRequest.md create mode 100644 docs/Purchasability.md create mode 100644 docs/Receiver.md create mode 100644 docs/RedeemDineInVoucherRequest.md create mode 100644 docs/RedeemDineInVoucherResponse.md create mode 100644 docs/RedeemDineinVoucherAPI.md create mode 100644 docs/RedeemResult.md create mode 100644 docs/RegisterMembershipNativeRequest.md create mode 100644 docs/RegisterMembershipNativeResponse.md create mode 100644 docs/RewardItem.md create mode 100644 docs/SellingTime.md create mode 100644 docs/ServiceHour.md create mode 100644 docs/ServiceHours.md create mode 100644 docs/SpecialOpeningHour.md create mode 100644 docs/SpecialOpeningHourMetadata.md create mode 100644 docs/SpecialOpeningHourOpeningHours.md create mode 100644 docs/StoreHour.md create mode 100644 docs/StoreHourResponse.md create mode 100644 docs/StoreStatusResponse.md create mode 100644 docs/SubmitOrderRequest.md create mode 100644 docs/TraceMenuSyncAPI.md create mode 100644 docs/UnbindMembershipNativeRequest.md create mode 100644 docs/UnlinkMembershipWebviewRequest.md create mode 100644 docs/UpdateAdvancedPricing.md create mode 100644 docs/UpdateCampaignAPI.md create mode 100644 docs/UpdateCampaignRequest.md create mode 100644 docs/UpdateDeliveryHourRequest.md create mode 100644 docs/UpdateDeliveryHourResponse.md create mode 100644 docs/UpdateDeliveryStateAPI.md create mode 100644 docs/UpdateDineInHourRequest.md create mode 100644 docs/UpdateDineInHourResponse.md create mode 100644 docs/UpdateMenuItem.md create mode 100644 docs/UpdateMenuModifier.md create mode 100644 docs/UpdateMenuNotifRequest.md create mode 100644 docs/UpdateMenuNotificationAPI.md create mode 100644 docs/UpdateMenuRecordAPI.md create mode 100644 docs/UpdateMenuRequest.md create mode 100644 docs/UpdateOrderReadyTimeAPI.md create mode 100644 docs/UpdatePurchasability.md create mode 100644 docs/UpdateSpecialHourRequest.md create mode 100644 docs/UpdateSpecialHourResponse.md create mode 100644 docs/UpdateStoreDeliveryHourAPI.md create mode 100644 docs/UpdateStoreDineInHourAPI.md create mode 100644 docs/UpdateStoreSpecialHourAPI.md create mode 100644 docs/Voucher.md create mode 100644 docs/VoucherDescriptionInfo.md create mode 100644 docs/WorkingHour.md create mode 100644 docs/WorkingHourDay.md create mode 100644 go.mod create mode 100644 go.sum create mode 100644 model_accept_order_request.go create mode 100644 model_address.go create mode 100644 model_advanced_pricing.go create mode 100644 model_batch_update_menu_item.go create mode 100644 model_batch_update_menu_response.go create mode 100644 model_bind_membership_native_request.go create mode 100644 model_bind_membership_native_response.go create mode 100644 model_campaign.go create mode 100644 model_campaign_conditions.go create mode 100644 model_campaign_discount.go create mode 100644 model_campaign_quotas.go create mode 100644 model_campaign_scope.go create mode 100644 model_cancel_code.go create mode 100644 model_cancel_order_limit_type.go create mode 100644 model_cancel_order_request.go create mode 100644 model_cancel_order_response.go create mode 100644 model_cancel_reason.go create mode 100644 model_check_order_cancelable_response.go create mode 100644 model_coordinates.go create mode 100644 model_create_campaign_request.go create mode 100644 model_create_campaign_response.go create mode 100644 model_currency.go create mode 100644 model_dine_in.go create mode 100644 model_edit_order_item.go create mode 100644 model_edit_order_request.go create mode 100644 model_error.go create mode 100644 model_get_dine_in_voucher_response.go create mode 100644 model_get_membership_native_response.go create mode 100644 model_get_membership_native_response_point_info.go create mode 100644 model_get_membership_request.go create mode 100644 model_get_membership_webview_response.go create mode 100644 model_get_menu_new_response.go create mode 100644 model_get_menu_old_response.go create mode 100644 model_get_reward_native_request.go create mode 100644 model_get_reward_native_response.go create mode 100644 model_grab_oauth_request.go create mode 100644 model_grab_oauth_response.go create mode 100644 model_list_campaign_response.go create mode 100644 model_list_orders_response.go create mode 100644 model_mark_order_request.go create mode 100644 model_menu_category.go create mode 100644 model_menu_entity.go create mode 100644 model_menu_entity_error.go create mode 100644 model_menu_item.go create mode 100644 model_menu_modifier.go create mode 100644 model_menu_section.go create mode 100644 model_menu_section_category.go create mode 100644 model_menu_section_category_item.go create mode 100644 model_menu_sync_fail.go create mode 100644 model_menu_sync_fail_category.go create mode 100644 model_menu_sync_fail_item.go create mode 100644 model_menu_sync_fail_modifier.go create mode 100644 model_menu_sync_fail_modifier_group.go create mode 100644 model_menu_sync_fail_service_hours.go create mode 100644 model_menu_sync_response.go create mode 100644 model_menu_sync_webhook_request.go create mode 100644 model_modifier_group.go create mode 100644 model_new_order_time_request.go create mode 100644 model_notify_membership_webview_request.go create mode 100644 model_open_period.go create mode 100644 model_order.go create mode 100644 model_order_campaign.go create mode 100644 model_order_delivery_request.go create mode 100644 model_order_feature_flags.go create mode 100644 model_order_free_item.go create mode 100644 model_order_item.go create mode 100644 model_order_item_modifier.go create mode 100644 model_order_price.go create mode 100644 model_order_promo.go create mode 100644 model_order_ready_estimation.go create mode 100644 model_order_state_request.go create mode 100644 model_out_of_stock_instruction.go create mode 100644 model_partner_oauth_request.go create mode 100644 model_partner_oauth_response.go create mode 100644 model_pause_store_request.go create mode 100644 model_purchasability.go create mode 100644 model_receiver.go create mode 100644 model_redeem_dine_in_voucher_request.go create mode 100644 model_redeem_dine_in_voucher_response.go create mode 100644 model_redeem_result.go create mode 100644 model_register_membership_native_request.go create mode 100644 model_register_membership_native_response.go create mode 100644 model_reward_item.go create mode 100644 model_selling_time.go create mode 100644 model_service_hour.go create mode 100644 model_service_hours.go create mode 100644 model_special_opening_hour.go create mode 100644 model_special_opening_hour_metadata.go create mode 100644 model_special_opening_hour_opening_hours.go create mode 100644 model_store_hour.go create mode 100644 model_store_hour_response.go create mode 100644 model_store_status_response.go create mode 100644 model_submit_order_request.go create mode 100644 model_unbind_membership_native_request.go create mode 100644 model_unlink_membership_webview_request.go create mode 100644 model_update_advanced_pricing.go create mode 100644 model_update_campaign_request.go create mode 100644 model_update_delivery_hour_request.go create mode 100644 model_update_delivery_hour_response.go create mode 100644 model_update_dine_in_hour_request.go create mode 100644 model_update_dine_in_hour_response.go create mode 100644 model_update_menu_item.go create mode 100644 model_update_menu_modifier.go create mode 100644 model_update_menu_notif_request.go create mode 100644 model_update_menu_request.go create mode 100644 model_update_purchasability.go create mode 100644 model_update_special_hour_request.go create mode 100644 model_update_special_hour_response.go create mode 100644 model_voucher.go create mode 100644 model_voucher_description_info.go create mode 100644 model_working_hour.go create mode 100644 model_working_hour_day.go create mode 100644 response.go create mode 100644 utils.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf2bb1d --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..63c9d19 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog + +## [1.0.0] - 2024-09-25 + +### Added +- Initial release of the project. + +### Changed + +### Deprecated + +[1.0.0]: https://github.com/grab/grabfood-api-sdk-go/releases/tag/v1.0.0 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b291156 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing to Our Project's SDK + +We value your input and contributions! We use the [OpenAPI Generator tool](https://openapi-generator.tech) to generate our SDK based on an OpenAPI YAML specification. + +If you find an issue with our SDK and want to contribute a fix, follow the guidelines mentioned below: + +## Reporting an Issue + +1. Notice an issue while using the SDK? Try to determine what's causing it. Was it a particular endpoint, operation, or datatype? + +2. Check the YAML specification: Once you've identified the issue, refer to the corresponding definition in the OpenAPI YAML specification file that is included in the SDK. This could be a specific path, operation, parameter, or schema. + +3. Describe the current behavior and desired correct behavior. + +4. Describe the steps to reproduce this issue. + +Please note that due to our open-source process, we don't have a direct way to accept code contributions for the SDK. The SDK is directly generated from our OpenAPI YAML specification file. Hence, you don't need to manually update the SDK. Instead, identify the modifications needed in the OpenAPI YAML specification. + +## Submitting a Suggestion + +If there's something in the SDK that isn't broken but could be better, you're welcome to share suggestions. Constructive feedback is always appreciated! + +When submitting a suggestion: + +1. Be clear and concise in your description of the suggestion. + +2. Explain why it would be beneficial. Real-life examples, if applicable, can help to illustrate your point. + +3. Be patient. Not all suggestions can be incorporated immediately, and it may be necessary for us to research your idea before we can implement it. + +Remember, contributions come in many forms, not just in code! Identifying areas for improvement or bringing up issues helps us make the SDK better for everyone. + +Thank you for your contributions! \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8096d9f --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2024 Grabtaxi Holdings PTE LTE (GRAB) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..f4eadbd --- /dev/null +++ b/README.md @@ -0,0 +1,224 @@ +# Go API client for GrabFood + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.1.3 +- Package version: 1.0.0 +- Generator version: 7.8.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +For more information, please visit [https://developer.grab.com](https://developer.grab.com) + +## Installation + +```shell +go get github.com/grab/grabfood-api-sdk-go +``` + +Put the package under your project folder and add the following in import: + +```go +import grabfood "github.com/grab/grabfood-api-sdk-go" +``` + +## Usage Example + +In the example below, we start by acquiring an OAuth2 access token. In your applications, it's important to handle OAuth2 tokens efficiently. This means: +- Store the received access token once it's obtained. +- Use this stored access token for as long as it's valid. +- Only request a new access token when the current one has expired. + +By following these practices, you minimize the number of requests to the server, making your application more efficient and responsive. + +You can usually determine the validity of a token by the `expires_in` attribute in the OAuth2 token response. + +```go +config := grabfood.NewConfiguration() +apiClient := grabfood.NewAPIClient(config) +ctx := context.WithValue(context.Background(), grabfood.ContextServerIndex, grabfood.StgEnv) + +grabOauthRequest := *grabfood.NewGrabOauthRequest("client_id", "client_secret", "client_credentials", "food.partner_api") + +authResp, _, _ := apiClient.GetOauthGrabAPI.GetOauthGrab(ctx).GrabOauthRequest(grabOauthRequest).Execute() + +// Request a new token only when the previous one has expired. +// Can utilize the `expires_in` from *authResp.ExpiresIn to determine the validity of the token. +ACCESS_TOKEN := *authResp.AccessToken + +authorization := "Bearer " + ACCESS_TOKEN +merchantID := "1-CYNGRUNGSBCCC" +resp, _, _ := apiClient.GetStoreHourAPI.GetStoreHour(ctx, merchantID).Authorization(authorization).Execute() + +fmt.Printf("Response from `GetStoreHourAPI.GetStoreHour`: %+v\n", resp) +``` + +For handling webhook requests, we provide dedicated models for both requests and responses. Please refer to the list of available models provided below for more details. + +## Documentation for API Endpoints + +The base URL for OAuth2 URIs is https://api.grab.com + +For other GrabFood partner API endpoints, URIs are relative to https://partner-api.grab.com/grabfood + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AcceptRejectOrderAPI* | [**AcceptRejectOrder**](docs/AcceptRejectOrderAPI.md#acceptrejectorder) | **Post** /partner/v1/order/prepare | Manually accept/reject orders +*CancelOrderAPI* | [**CancelOrder**](docs/CancelOrderAPI.md#cancelorder) | **Put** /partner/v1/order/cancel | Cancel an order +*CheckOrderCancelableAPI* | [**CheckOrderCancelable**](docs/CheckOrderCancelableAPI.md#checkordercancelable) | **Get** /partner/v1/order/cancelable | Check order cancelable +*CreateCampaignAPI* | [**CreateCampaign**](docs/CreateCampaignAPI.md#createcampaign) | **Post** /partner/v1/campaigns | Create campaign +*DeleteCampaignAPI* | [**DeleteCampaign**](docs/DeleteCampaignAPI.md#deletecampaign) | **Delete** /partner/v1/campaigns/{campaign_id} | Delete campaigns +*EditOrderAPI* | [**EditOrder**](docs/EditOrderAPI.md#editorder) | **Put** /partner/v1/orders/{orderID} | Edit Order +*GetDineinVoucherAPI* | [**GetDineinVoucher**](docs/GetDineinVoucherAPI.md#getdineinvoucher) | **Get** /partner/v1/dinein/voucher | Get Dine In Voucher +*GetOauthGrabAPI* | [**GetOauthGrab**](docs/GetOauthGrabAPI.md#getoauthgrab) | **Post** /grabid/v1/oauth2/token | Get Oauth access token +*GetStoreHourAPI* | [**GetStoreHour**](docs/GetStoreHourAPI.md#getstorehour) | **Get** /partner/v2/merchants/{merchantID}/store/hours | Get Store Hours +*GetStoreStatusAPI* | [**GetStoreStatus**](docs/GetStoreStatusAPI.md#getstorestatus) | **Get** /partner/v1/merchants/{merchantID}/store/status | Get Store Status +*ListCampaignAPI* | [**ListCampaign**](docs/ListCampaignAPI.md#listcampaign) | **Get** /partner/v1/campaigns | List campaigns +*ListOrdersAPI* | [**ListOrders**](docs/ListOrdersAPI.md#listorders) | **Get** /partner/v1/orders | List orders +*MarkOrderReadyAPI* | [**MarkOrderReady**](docs/MarkOrderReadyAPI.md#markorderready) | **Post** /partner/v1/orders/mark | Mark order as ready +*NotifyMembershipWebviewAPI* | [**NotifyMembershipWebview**](docs/NotifyMembershipWebviewAPI.md#notifymembershipwebview) | **Post** /partner/v1/membership/notify | Notify Membership +*PauseStoreAPI* | [**PauseStore**](docs/PauseStoreAPI.md#pausestore) | **Put** /partner/v1/merchant/pause | Pause store +*RedeemDineinVoucherAPI* | [**RedeemDineinVoucher**](docs/RedeemDineinVoucherAPI.md#redeemdineinvoucher) | **Post** /partner/v1/dinein/voucher/redeem | Redeem Dine In Voucher +*TraceMenuSyncAPI* | [**TraceMenuSync**](docs/TraceMenuSyncAPI.md#tracemenusync) | **Get** /partner/v1/merchant/menu/trace | Trace menu sync +*UpdateCampaignAPI* | [**UpdateCampaign**](docs/UpdateCampaignAPI.md#updatecampaign) | **Put** /partner/v1/campaigns/{campaign_id} | Update campaign +*UpdateDeliveryStateAPI* | [**UpdateDeliveryState**](docs/UpdateDeliveryStateAPI.md#updatedeliverystate) | **Post** /partner/v1/order/delivery | Update delivery state +*UpdateMenuNotificationAPI* | [**UpdateMenuNotification**](docs/UpdateMenuNotificationAPI.md#updatemenunotification) | **Post** /partner/v1/merchant/menu/notification | Notify Grab of updated menu +*UpdateMenuRecordAPI* | [**BatchUpdateMenu**](docs/UpdateMenuRecordAPI.md#batchupdatemenu) | **Put** /partner/v1/batch/menu | Batch Update Menu +*UpdateMenuRecordAPI* | [**UpdateMenu**](docs/UpdateMenuRecordAPI.md#updatemenu) | **Put** /partner/v1/menu | Update menu record +*UpdateOrderReadyTimeAPI* | [**UpdateOrderReadyTime**](docs/UpdateOrderReadyTimeAPI.md#updateorderreadytime) | **Put** /partner/v1/order/readytime | Update new order ready time +*UpdateStoreDeliveryHourAPI* | [**UpdateStoreDeliveryHour**](docs/UpdateStoreDeliveryHourAPI.md#updatestoredeliveryhour) | **Put** /partner/v1/merchants/{merchantID}/store/opening-hours | Update Store Delivery Hours +*UpdateStoreDineInHourAPI* | [**UpdateStoreDineInHour**](docs/UpdateStoreDineInHourAPI.md#updatestoredineinhour) | **Put** /partner/v1/merchants/{merchantID}/store/dine-in-hours | Update Store Dine-in Hours +*UpdateStoreSpecialHourAPI* | [**UpdateStoreSpecialHour**](docs/UpdateStoreSpecialHourAPI.md#updatestorespecialhour) | **Put** /partner/v2/merchants/{merchantID}/store/special-opening-hour | Update Store Special Hours + + +## Documentation For Models + + - [AcceptOrderRequest](docs/AcceptOrderRequest.md) + - [Address](docs/Address.md) + - [AdvancedPricing](docs/AdvancedPricing.md) + - [BatchUpdateMenuItem](docs/BatchUpdateMenuItem.md) + - [BatchUpdateMenuResponse](docs/BatchUpdateMenuResponse.md) + - [BindMembershipNativeRequest](docs/BindMembershipNativeRequest.md) + - [BindMembershipNativeResponse](docs/BindMembershipNativeResponse.md) + - [Campaign](docs/Campaign.md) + - [CampaignConditions](docs/CampaignConditions.md) + - [CampaignDiscount](docs/CampaignDiscount.md) + - [CampaignQuotas](docs/CampaignQuotas.md) + - [CampaignScope](docs/CampaignScope.md) + - [CancelCode](docs/CancelCode.md) + - [CancelOrderLimitType](docs/CancelOrderLimitType.md) + - [CancelOrderRequest](docs/CancelOrderRequest.md) + - [CancelOrderResponse](docs/CancelOrderResponse.md) + - [CancelReason](docs/CancelReason.md) + - [CheckOrderCancelableResponse](docs/CheckOrderCancelableResponse.md) + - [Coordinates](docs/Coordinates.md) + - [CreateCampaignRequest](docs/CreateCampaignRequest.md) + - [CreateCampaignResponse](docs/CreateCampaignResponse.md) + - [Currency](docs/Currency.md) + - [DineIn](docs/DineIn.md) + - [EditOrderItem](docs/EditOrderItem.md) + - [EditOrderRequest](docs/EditOrderRequest.md) + - [Error](docs/Error.md) + - [GetDineInVoucherResponse](docs/GetDineInVoucherResponse.md) + - [GetMembershipNativeResponse](docs/GetMembershipNativeResponse.md) + - [GetMembershipNativeResponsePointInfo](docs/GetMembershipNativeResponsePointInfo.md) + - [GetMembershipRequest](docs/GetMembershipRequest.md) + - [GetMembershipWebviewResponse](docs/GetMembershipWebviewResponse.md) + - [GetMenuNewResponse](docs/GetMenuNewResponse.md) + - [GetMenuOldResponse](docs/GetMenuOldResponse.md) + - [GetRewardNativeRequest](docs/GetRewardNativeRequest.md) + - [GetRewardNativeResponse](docs/GetRewardNativeResponse.md) + - [GrabOauthRequest](docs/GrabOauthRequest.md) + - [GrabOauthResponse](docs/GrabOauthResponse.md) + - [ListCampaignResponse](docs/ListCampaignResponse.md) + - [ListOrdersResponse](docs/ListOrdersResponse.md) + - [MarkOrderRequest](docs/MarkOrderRequest.md) + - [MenuCategory](docs/MenuCategory.md) + - [MenuEntity](docs/MenuEntity.md) + - [MenuEntityError](docs/MenuEntityError.md) + - [MenuItem](docs/MenuItem.md) + - [MenuModifier](docs/MenuModifier.md) + - [MenuSection](docs/MenuSection.md) + - [MenuSectionCategory](docs/MenuSectionCategory.md) + - [MenuSectionCategoryItem](docs/MenuSectionCategoryItem.md) + - [MenuSyncFail](docs/MenuSyncFail.md) + - [MenuSyncFailCategory](docs/MenuSyncFailCategory.md) + - [MenuSyncFailItem](docs/MenuSyncFailItem.md) + - [MenuSyncFailModifier](docs/MenuSyncFailModifier.md) + - [MenuSyncFailModifierGroup](docs/MenuSyncFailModifierGroup.md) + - [MenuSyncFailServiceHours](docs/MenuSyncFailServiceHours.md) + - [MenuSyncResponse](docs/MenuSyncResponse.md) + - [MenuSyncWebhookRequest](docs/MenuSyncWebhookRequest.md) + - [ModifierGroup](docs/ModifierGroup.md) + - [NewOrderTimeRequest](docs/NewOrderTimeRequest.md) + - [NotifyMembershipWebviewRequest](docs/NotifyMembershipWebviewRequest.md) + - [OpenPeriod](docs/OpenPeriod.md) + - [Order](docs/Order.md) + - [OrderCampaign](docs/OrderCampaign.md) + - [OrderDeliveryRequest](docs/OrderDeliveryRequest.md) + - [OrderFeatureFlags](docs/OrderFeatureFlags.md) + - [OrderFreeItem](docs/OrderFreeItem.md) + - [OrderItem](docs/OrderItem.md) + - [OrderItemModifier](docs/OrderItemModifier.md) + - [OrderPrice](docs/OrderPrice.md) + - [OrderPromo](docs/OrderPromo.md) + - [OrderReadyEstimation](docs/OrderReadyEstimation.md) + - [OrderStateRequest](docs/OrderStateRequest.md) + - [OutOfStockInstruction](docs/OutOfStockInstruction.md) + - [PartnerOauthRequest](docs/PartnerOauthRequest.md) + - [PartnerOauthResponse](docs/PartnerOauthResponse.md) + - [PauseStoreRequest](docs/PauseStoreRequest.md) + - [Purchasability](docs/Purchasability.md) + - [Receiver](docs/Receiver.md) + - [RedeemDineInVoucherRequest](docs/RedeemDineInVoucherRequest.md) + - [RedeemDineInVoucherResponse](docs/RedeemDineInVoucherResponse.md) + - [RedeemResult](docs/RedeemResult.md) + - [RegisterMembershipNativeRequest](docs/RegisterMembershipNativeRequest.md) + - [RegisterMembershipNativeResponse](docs/RegisterMembershipNativeResponse.md) + - [RewardItem](docs/RewardItem.md) + - [SellingTime](docs/SellingTime.md) + - [ServiceHour](docs/ServiceHour.md) + - [ServiceHours](docs/ServiceHours.md) + - [SpecialOpeningHour](docs/SpecialOpeningHour.md) + - [SpecialOpeningHourMetadata](docs/SpecialOpeningHourMetadata.md) + - [SpecialOpeningHourOpeningHours](docs/SpecialOpeningHourOpeningHours.md) + - [StoreHour](docs/StoreHour.md) + - [StoreHourResponse](docs/StoreHourResponse.md) + - [StoreStatusResponse](docs/StoreStatusResponse.md) + - [SubmitOrderRequest](docs/SubmitOrderRequest.md) + - [UnbindMembershipNativeRequest](docs/UnbindMembershipNativeRequest.md) + - [UnlinkMembershipWebviewRequest](docs/UnlinkMembershipWebviewRequest.md) + - [UpdateAdvancedPricing](docs/UpdateAdvancedPricing.md) + - [UpdateCampaignRequest](docs/UpdateCampaignRequest.md) + - [UpdateDeliveryHourRequest](docs/UpdateDeliveryHourRequest.md) + - [UpdateDeliveryHourResponse](docs/UpdateDeliveryHourResponse.md) + - [UpdateDineInHourRequest](docs/UpdateDineInHourRequest.md) + - [UpdateDineInHourResponse](docs/UpdateDineInHourResponse.md) + - [UpdateMenuItem](docs/UpdateMenuItem.md) + - [UpdateMenuModifier](docs/UpdateMenuModifier.md) + - [UpdateMenuNotifRequest](docs/UpdateMenuNotifRequest.md) + - [UpdateMenuRequest](docs/UpdateMenuRequest.md) + - [UpdatePurchasability](docs/UpdatePurchasability.md) + - [UpdateSpecialHourRequest](docs/UpdateSpecialHourRequest.md) + - [UpdateSpecialHourResponse](docs/UpdateSpecialHourResponse.md) + - [Voucher](docs/Voucher.md) + - [VoucherDescriptionInfo](docs/VoucherDescriptionInfo.md) + - [WorkingHour](docs/WorkingHour.md) + - [WorkingHourDay](docs/WorkingHourDay.md) + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` diff --git a/api/openapi.yaml b/api/openapi.yaml new file mode 100644 index 0000000..c5ef10c --- /dev/null +++ b/api/openapi.yaml @@ -0,0 +1,7599 @@ +openapi: 3.0.3 +info: + termsOfService: https://developer.grab.com/pages/terms-of-use + title: GrabFood + version: 1.1.3 +servers: +- description: Staging Environment - Manual Partner Onboarding + url: https://partner-api.stg-myteksi.com/grabfood-sandbox +- description: Staging Environment - Self Serve Partner Onboarding + url: https://partner-api.grab.com/grabfood-sandbox +- description: Production Environment + url: https://partner-api.grab.com/grabfood +tags: +- name: sdk-intro + x-displayName: GrabFood SDK +- name: go + x-displayName: Go +- name: java + x-displayName: Java +- name: get-oauth-grab + x-displayName: Get GrabFood access token +- name: get-oauth-partner-webhook + x-displayName: Get partner access token webhook +- name: get-menu-webhook + x-displayName: Get food menu webhook +- name: update-menu-record + x-displayName: Update menu record +- name: update-menu-notification + x-displayName: Update menu notification +- name: menu-sync-webhook + x-displayName: Menu sync webhook +- name: trace-menu-sync + x-displayName: Trace menu sync +- name: sync-flow + x-displayName: Menu sync flow +- name: submit-order-webhook + x-displayName: Submit order webhook +- name: accept-reject-order + x-displayName: Accept/reject orders +- name: list-orders + x-displayName: List orders +- name: edit-order + x-displayName: Edit orders +- name: order-state-webhook + x-displayName: Push order state webhook +- name: mark-order-ready + x-displayName: Mark orders ready +- name: update-delivery-state + x-displayName: Update delivery state +- name: update-order-ready-time + x-displayName: Update order ready time +- name: check-order-cancelable + x-displayName: Check if order is cancelable +- name: cancel-order + x-displayName: Cancel order +- name: pause-store + x-displayName: Temporarily pause store +- name: campaign-type + x-displayName: Campaign type +- name: create-campaign + x-displayName: Create campaigns +- name: update-campaign + x-displayName: Update campaigns +- name: list-campaign + x-displayName: List campaigns +- name: delete-campaign + x-displayName: Delete campaigns +- name: troubleshooting + x-displayName: Troubleshooting +- name: faqs + x-displayName: Frequently asked questions (FAQs) +- name: changelog + x-displayName: Changelog +- name: scan-to-order + x-displayName: Scan to order +- name: get-store-hour + x-displayName: Get Store Hours +- name: get-store-status + x-displayName: Get Store Status +- name: update-store-delivery-hour + x-displayName: Update Store Delivery Hours +- name: update-store-dine-in-hour + x-displayName: Update Store Dine-in Hours +- name: update-store-special-hour + x-displayName: Update Store Special Hours +- name: get-dinein-voucher + x-displayName: Get Dine In Voucher +- name: redeem-dinein-voucher + x-displayName: Redeem Dine In Voucher +- name: partner-loyalty-native + x-displayName: Partner Loyalty Program (Native) +- name: partner-loyalty-webview + x-displayName: Partner Loyalty Program (Webview) +- name: bind-membership-native + x-displayName: Bind membership +- name: register-membership-native + x-displayName: Register membership +- name: notify-membership-webview + x-displayName: Notify membership +- name: unbind-membership-native + x-displayName: Unbind membership +- name: unlink-membership-webview + x-displayName: Unlink membership +- name: get-membership-native + x-displayName: Get membership detail +- name: get-membership-webview + x-displayName: Get membership detail +- name: get-reward-native + x-displayName: Calculate reward points +paths: + /partner/v2/merchants/{merchantID}/store/special-opening-hour: + put: + operationId: update-store-special-hour + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSpecialHourRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSpecialHourResponse' + description: Success + "401": + description: Unauthorized. The access token is invalid. + "5XX": + description: All other unexpected errors. + summary: Update Store Special Hours + tags: + - update-store-special-hour + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X PUT 'https://partner-api.grab.com/grabfood/partner/v2/merchants/1-C3VEJY6CMEEGUE/store/special-opening-hour' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "specialOpeningHours": [ + { + "startDate": "2024-05-01", + "endDate": "2024-09-04", + "metadata": { + "description": "Holiday Season Special Hours" + }, + "openingHours": { + "openPeriodType": "Period", + "periods": [ + { + "startTime": "09:00", + "endTime": "12:00" + }, + { + "startTime": "13:00", + "endTime": "18:00" + } + ] + } + }, + { + "startDate": "2024-09-05", + "endDate": "2024-09-10", + "metadata": { + "description": "New Year Special Hours" + }, + "openingHours": { + "openPeriodType": "OpenAllDay" + } + } + ] + }' + /partner/v1/merchants/{merchantID}/store/dine-in-hours: + put: + operationId: update-store-dine-in-hour + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDineInHourRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDineInHourResponse' + description: Success + "401": + description: Unauthorized. The access token is invalid. + "5XX": + description: All other unexpected errors. + summary: Update Store Dine-in Hours + tags: + - update-store-dine-in-hour + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X PUT 'https://partner-api.grab.com/grabfood/partner/v1/merchants/1-C3VEJY6CMEEGUE/store/dine-in-hours' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "dineInHour": { + "mon": [ + { + "startTime": "00:00", + "endTime": "00:05" + }, + { + "startTime": "01:00", + "endTime": "01:05" + } + ], + "tue": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "wed": [], + "thu": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "fri": [], + "sat": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "sun": [] + } + }' + /partner/v1/merchants/{merchantID}/store/opening-hours: + put: + operationId: update-store-delivery-hour + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDeliveryHourRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateDeliveryHourResponse' + description: Success + "401": + description: Unauthorized. The access token is invalid. + "5XX": + description: All other unexpected errors. + summary: Update Store Delivery Hours + tags: + - update-store-delivery-hour + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X PUT 'https://partner-api.grab.com/grabfood/partner/v1/merchants/1-C3VEJY6CMEEGUE/store/opening-hours' \ + -H 'Authorization: Bearer ' \ + -H 'Content-Type: application/json' \ + -d '{ + "openingHour": { + "mon": [ + { + "startTime": "00:00", + "endTime": "00:05" + }, + { + "startTime": "01:00", + "endTime": "01:05" + } + ], + "tue": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "wed": [], + "thu": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "fri": [], + "sat": [ + { + "startTime": "00:00", + "endTime": "00:05" + } + ], + "sun": [], + "force": true + } + }' + /partner/v1/merchants/{merchantID}/store/status: + get: + operationId: get-store-status + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StoreStatusResponse' + description: Success + "401": + description: Unauthorized. The access token is invalid. + "5XX": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: All other unexpected errors. + summary: Get Store Status + tags: + - get-store-status + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X GET 'https://partner-api.grab.com/grabfood/partner/v1/merchants/1-C3VEJY6CMEEGUE/store/status' \ + -H 'Authorization: Bearer ' + /partner/v2/merchants/{merchantID}/store/hours: + get: + operationId: get-store-hour + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/StoreHourResponse' + description: Success + "401": + description: Unauthorized. The access token is invalid. + "5XX": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: All other unexpected errors. + summary: Get Store Hours + tags: + - get-store-hour + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X GET 'https://partner-api.grab.com/grabfood/partner/v2/merchants/1-C3VEJY6CMEEGUE/store/hours' \ + -H 'Authorization: Bearer ' + /grabid/v1/oauth2/token: + post: + operationId: get-oauth-grab + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GrabOauthRequest' + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GrabOauthResponse' + description: The API request is successfully processed. + servers: + - description: Staging Environment - Manual Partner Onboarding + url: https://api.stg-myteksi.com + - description: Staging Environment - Self Serve Partner Onboarding + url: https://api.grab.com + - description: Production Environment + url: https://api.grab.com + summary: Get Oauth access token + tags: + - get-oauth-grab + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X POST https://api.stg-myteksi.com/grabid/v1/oauth2/token \ + -H 'Content-Type: application/json' \ + -d '{ + "client_id": "", + "client_secret": "", + "grant_type": "client_credentials", + "scope": "food.partner_api" + }' + /partner/v1/menu: + put: + operationId: update-menu + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/update_menu_request' + description: "" + required: true + responses: + "204": + description: Successful. No Content returned. + summary: Update menu record + tags: + - update-menu-record + x-codeSamples: + - lang: cURL + label: Update menu item + source: | + curl -X PUT \ + https://partner-api.grab.com/grabfood/partner/v1/menu \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "merchantID": "1-C3VEJY6CMEEGUE", + "field": "ITEM", + "id": "111", + "price": 123, // 1.23 Dollar + "availableStatus": "", + "maxStock": 10, + "advancedPricings": [ + { + "key": "Delivery_Scheduled_GrabApp", + "price": 110 + } + ], + "purchasabilities": [ + { + "key": "Delivery_Scheduled_GrabApp", + "purchasable": true + } + ] + }' + - lang: cURL + label: Update menu modifier + source: | + curl -X PUT \ + https://partner-api.grab.com/grabfood/partner/v1/menu \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "merchantID": "1-C3VEJY6CMEEGUE", + "field": "MODIFIER", + "id": "111", + "price": 123, // 1.23 Dollar + "availableStatus": "", + "name": "caramel sauce", + "isFree": false, + "advancedPricings": [ + { + "key": "Delivery_Scheduled_GrabApp", + "price": 110 + } + ] + }' + /partner/v1/batch/menu: + put: + operationId: batch-update-menu + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpdateMenuItem' + description: "" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpdateMenuResponse' + description: The API request is successfully processed. Refer to status + and errors for more info. + "400": + description: | + invalid_argument + | Description | + | ----------- | + | Invalid parameter | + | Batch update menu support at most 200 items | + "409": + description: | + conflict. BatchUpdate ITEM xxx too frequently, retry after 10 seconds + "429": + description: | + Too Many Requests + summary: Batch Update Menu + tags: + - update-menu-record + x-codeSamples: + - lang: cURL + label: Batch update menu item + source: | + curl -X PUT \ + https://partner-api.grab.com/grabfood/partner/v1/batch/menu \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "merchantID": "1-C3VEJY6CMEEGUE", + "field": "ITEM", + "menuEntities": [ + { + "id": "111", + "price": 123, // 1.23 Dollar + "availableStatus": "AVAILABLE|UNAVAILABLE|UNAVAILABLETODAY", + "maxStock": 10, + "advancedPricings": [ + { + "key": "Delivery_Scheduled_GrabApp", + "price": 110 + } + ], + "purchasabilities": [ + { + "key": "Delivery_Scheduled_GrabApp", + "purchasable": true + } + ] + }, + { + "id": "222", + "price": 456, // 1.23 Dollar + "availableStatus": "UNAVAILABLE" + } + ] + }' + /partner/v1/merchant/menu/notification: + post: + operationId: update-menu-notification + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMenuNotifRequest' + description: "" + required: true + responses: + "204": + description: Successful. No Content returned. + headers: + x-job-id: + description: "Uniquely identifies a menu sync job. Please mention this\ + \ value while raising any issues on [Menu sync webhook](#tag/menu-sync-webhook)." + example: 36bb8bb8-4aef-4eca-bed9-fd5ae1e4dc11 + explode: false + schema: + type: string + style: simple + summary: Notify Grab of updated menu + tags: + - update-menu-notification + x-codeSamples: + - lang: cURL + label: Update Menu Notification + source: | + curl -X POST \ + https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/merchant/menu/notification \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "merchantID": "1-C3VEJY6CMEEGUE" + }' + /partner/v1/merchant/menu/trace: + get: + operationId: trace-menu-sync + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: true + in: query + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/MenuSyncResponse' + description: Sync success or fail + "4xx": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Common error + summary: Trace menu sync + tags: + - trace-menu-sync + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X GET 'https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/merchant/menu/trace?merchantID=1-C3VEJY6CMEEGUE' \ + -H 'Authorization: Bearer ' + /partner/v1/order/prepare: + post: + operationId: accept-reject-order + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AcceptOrderRequest' + description: "" + required: true + responses: + "204": + description: Successful. No content returned. + summary: Manually accept/reject orders + tags: + - accept-reject-order + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X POST \ + https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/order/prepare \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "orderID": "123-CYNKLPCVRN5", + "toState": "Accepted" + }' + /partner/v1/orders: + get: + operationId: list-orders + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: true + in: query + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: form + - explode: true + in: query + name: date + required: true + schema: + $ref: '#/components/schemas/date' + style: form + - description: Specify the page number for the report. + example: 1 + explode: true + in: query + name: page + required: true + schema: + type: integer + style: form + responses: + "2xx": + content: + application/json: + schema: + $ref: '#/components/schemas/ListOrdersResponse' + description: Sync success + summary: List orders + tags: + - list-orders + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X GET \ + https://partner-api.grab.com/grabfood/partner/v1/orders?merchantID=1-C3VEJY6CMEEGUE&date=2020-01-20&page=0 \ + -H 'Authorization: Bearer ' + /partner/v1/orders/{orderID}: + put: + operationId: edit-order + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - explode: false + in: path + name: orderID + required: true + schema: + $ref: '#/components/schemas/orderID' + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/EditOrderRequest' + required: true + responses: + "204": + description: Successful. No content returned. + "4XX": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "invalid_argument Fail example with code and reason.\n| Code\ + \ | Reason | Message |\n| ------| ------| ------ |\n| 400 | invalid_argument\ + \ | nothing changed |\n| 400 | invalid_argument | can't remove all items\ + \ |\n| 404 | not_found | order detail abnormal |\n| 403 | forbidden |\ + \ not editable |\n| 400 | invalid_argument | recalculate failed |\n| 400\t\ + | invalid_argument|\tsubmit edit failed |\n| 404\t| not_found\t| get merchant\ + \ failed |\n| 400\t| invalid_argument | exceed basket limit |\n| 400\t\ + | invalid_argument | exceed price increase limit |\n| 400\t| invalid_argument\ + \ | negative weight |\n| 400\t| invalid_argument | parameters must include\ + \ all items |\n| 400\t| invalid_argument | fraud check error |\n| 400\ + \ | invalid_argument | externalItemID not supported for this status |\n\ + | 400 | invalid_argument | externalItemID inactive or out of selling time\ + \ |\n| 400 | invalid_argument | added item invalid |\n" + summary: Edit Order + tags: + - edit-order + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl --location --request PUT 'https://partner-api.grab.com/grabfood/partner/v1/orders/91725890-C25KME4ZVP2FLX' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer ' + --data-raw '{ + "orderID":"91725890-C25KME4ZVP2FLX", + "items":[ + { + "itemID":"IDGFSTI000004qy1490868132306763533", + "status":"DELETED", + "quantity": 3, + "isExternalItemID": false + }, + { + "itemID":"IDGFSTI000004qy1490868121450639138", + "status":"UPDATED", + "quantity": 2, + "isExternalItemID": false + }, + { + "itemID":"Burger_2", + "status":"ADDED", + "quantity": 3, + "isExternalItemID": true + } + ], + "onlyRecalculate": false + }' + /partner/v1/orders/mark: + post: + operationId: mark-order-ready + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MarkOrderRequest' + required: true + responses: + "204": + description: Successful. No content returned. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "invalid_argument\n| Code | Reason | Message |\n| ----- | ------\ + \ | ------- |\n| 400 | invalid_argument | invalid order state |\n| 400\ + \ | invalid_argument\t| order already marked ready|\n| 400 | invalid_argument\ + \ | invalid markStatus: 0|\n" + summary: Mark order as ready + tags: + - mark-order-ready + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl --location --request POST 'https://partner-api.grab.com/grabfood/partner/v1/orders/mark' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer ' \ + --data-raw '{ + "orderID": "102445314-C3LWN3CDLCN2JJ", + "markStatus": 1 + }' + /partner/v1/order/delivery: + post: + operationId: update-delivery-state + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrderDeliveryRequest' + required: true + responses: + "204": + description: Successful. No content returned. + summary: Update delivery state + tags: + - update-delivery-state + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X POST \ + https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/order/delivery \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "orderID": "123-CYNKLPCVRN5", + "fromState": "Collected", + "toState": "Delivered" + }' + /partner/v1/order/readytime: + put: + operationId: update-order-ready-time + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NewOrderTimeRequest' + required: true + responses: + "204": + description: Successful. No content returned. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + invalid_argument + | Code | Reason | Message | + | ----- | ----- | ------- | + | 400 | invalid_argument | invalid new order ready time | + | 400 | invalid_argument | order ready time not allowed to change | + summary: Update new order ready time + tags: + - update-order-ready-time + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl --location --request PUT 'https://partner-api.grab.com/grabfood/partner/v1/order/readytime' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer ' \ + --data-raw '{ + "orderID": "102445314-C3LWN3CDLCN2JJ", + "newOrderReadyTime": "2019-05-24T05:16:00Z" + }' + /partner/v1/order/cancelable: + get: + operationId: check-order-cancelable + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - explode: true + in: query + name: orderID + required: true + schema: + $ref: '#/components/schemas/orderID' + style: form + - description: The merchant's ID that is in GrabFood's database. + explode: true + in: query + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CheckOrderCancelableResponse' + description: The API request is successfully processed. + summary: Check order cancelable + tags: + - check-order-cancelable + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl --location --request GET 'https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/order/cancelable?orderID=102445314-C3LWN3CDLCN2JJ&merchantID=1-CYNGRUNGSBCCC' \ + --header 'Authorization: Bearer ' \ + /partner/v1/order/cancel: + put: + operationId: cancel-order + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CancelOrderRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CancelOrderResponse' + description: The API request is successfully processed. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: invalid_argument + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + This request is forbidden. + + For each 403 HTTP response, a detailed reason will be returned. + | Type | Message | + | -------| ------------| + | Invalid order | Order cannot be cancelled via this endpoint as this order does not belong to you. Please contact Grab Support for further assistance. | + | Daily limit reached | Order cannot be cancelled via this endpoint as the daily limit for order cancellations has been reached. Please contact Grab Support for further assistance. | + | Weekly limit reached | Order cannot be cancelled via this endpoint as the weekly limit for order cancellations has been reached. Please contact Grab Support for further assistance. | + | Monthly limit reached | Order cannot be cancelled via this endpoint as the monthly limit for order cancellations has been reached. Please contact Grab Support for further assistance. | + | Mix and match order | Order cannot be cancelled via this endpoint as it is part of a GKMM (Grab Kitchen Mix And Match) order. Please contact Grab Support for further assistance. | + | Self-pick up order | Order cannot be cancelled via this endpoint as it is a self-pick up order. Please contact Grab Support for further assistance. | + | Scheduled order | Order cannot be cancelled via this endpoint as it is a scheduled order. Please contact Grab Support for further assistance. | + | Time limit | Order cannot be cancelled via this endpoint as the cancellation time limit has been reached since a driver has been allocated for too long. Please contact Grab Support for further assistance. | + | Manual-accept stores | Order cannot be cancelled via this endpoint as only stores on auto-accept can use this endpoint. Please contact Grab Support for further assistance. | + | Outdated driver app | Order cannot be cancelled via this endpoint as the driver's Grab app is outdated. Please contact Grab Support for further assistance. | + | Unallocated order | Order cannot be cancelled via this endpoint as the order has not been allocated yet. Please contact Grab Support for further assistance. | + | Default error (edge case) | Order cannot be cancelled via this endpoint as a default error has occured. Please contact Grab Support for further assistance. | + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: not_found + "409": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: conflict + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + 5XX error codes are rare and indicate that GrabFood is facing an internal server error. This type of error is applicable to all HTTP response codes in the 500 range, e.g. 500, 504. Retry the operation at a later time with a unique ID. Use an exponential backoff retry mechanism to resend the requests at an increasingly slower interval. It is also a good practice to use a randomized delay (jitter) in your retry schedule. + + | Type | Message | + | -------| ------------| + | Get order error | Get order failed. | + | Cancel order error | Cancel order failed. | + summary: Cancel an order + tags: + - cancel-order + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl --location --request PUT 'https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/order/cancel' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer ' \ + --data-raw '{ + "orderID": "102445314-C3LWN3CDLCN2JJ", + "merchantID": "1-CYNGRUNGSBCCC", + "cancelCode": 1001 + }' + /partner/v1/merchant/pause: + put: + operationId: pause-store + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PauseStoreRequest' + required: true + responses: + "204": + description: Successful. No content returned. + summary: Pause store + tags: + - pause-store + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X PUT 'https://partner-api.stg-myteksi.com/grabfood-sandbox/partner/v1/merchant/pause' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + --data-raw '{ + "merchantID": "6-CYXYRCMXNEKCVA", + "isPause": true, + "duration": "30m" + }' + /partner/v1/campaigns: + get: + operationId: list-campaign + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The merchant's ID that is in GrabFood's database. + explode: true + in: query + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ListCampaignResponse' + description: The API request is successfully processed. + summary: List campaigns + tags: + - list-campaign + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X GET 'https://partner-api.grab.com/grabfood/partner/v1/campaigns?merchantID=4-CY4VMFMANYBYJ6' \ + -H 'Authorization: Bearer ' + post: + operationId: create-campaign + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCampaignRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateCampaignResponse' + description: The API request is successfully processed. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: | + invalid_argument + | Code | Reason | Message | + | ---- | ---------------- | ----------------------------------- | + | 400 | invalid_argument | items not found | + | 400 | invalid_argument | startTime has to be after now | + | 400 | invalid_argument | CAMPAIGN_START_TIME_TOO_CLOSE_TO_NOW:failed to create MFC: | + | 400 | invalid_argument | CAMPAIGN_DURATION_TOO_LONG:failed to create MFC: | + | 400 | invalid_argument | EFFECTIVE_DATE_OVERLAP:failed to create MFC: Item(s) are on multiple promotions in the same promotion period: SGITE2021052909250501859400 (4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295)" | + | 400 | invalid_argument | EATER_TYPE_CONDITION_IS_NOT_SUPPORTED:failed to create MFC: This level campaign can't be applied for such eater type | + | 400 | invalid_argument | INVALID_QUOTAS:failed to create MFC: | + | 400 | invalid_argument | INVALID_DISCOUNT_VALUE:failed to create MFC: | + | 400 | invalid_argument | INVALID_PARAMS:failed to create MFC: Order level campaign should have min basket condition | + | 400 | invalid_argument | INVALID_BUNDLE_OFFER:failed to create MFC: bundle price invalid | + | 400 | invalid_argument | INVALID_BUNDLE_OFFER:failed to create MFC: itemIDs should be between 2 and 20 | + | 400 | invalid_argument | NOT_SUPPORT_BUNDLE_SAME_MULTIPLE_ITEMS:failed to create MFC: bundle multiple items is not supported for same item bundle | + | 400 | invalid_argument | EXCEED_ACTIVE_CAMPAIGN_MAX_LIMIT:failed to create MFC: number of same campaign level's promotions exceeds maximum limit(100) | + summary: Create campaign + tags: + - create-campaign + /partner/v1/campaigns/{campaign_id}: + delete: + operationId: delete-campaign + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - explode: false + in: path + name: campaign_id + required: true + schema: + $ref: '#/components/schemas/campaignId' + style: simple + responses: + "204": + description: The API request is successfully processed. + summary: Delete campaigns + tags: + - delete-campaign + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X DELETE 'https://partner-api.grab.com/grabfood/partner/v1/campaigns/4-CY4VMFMANYBYJ6-C2AGRGBHRCADFA-25547977' \ + -H 'Authorization: Bearer ' + put: + operationId: update-campaign + parameters: + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - explode: false + in: path + name: campaign_id + required: true + schema: + $ref: '#/components/schemas/campaignId' + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateCampaignRequest' + required: true + responses: + "204": + description: The API request is successfully processed. + summary: Update campaign + tags: + - update-campaign + /partner/v1/dinein/voucher: + get: + operationId: get-dinein-voucher + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: A short code for the dine-in voucher purchased by the user. Required + if `certificateID` is not specified. + explode: true + in: query + name: voucherCode + required: false + schema: + $ref: '#/components/schemas/voucherCode' + style: form + - description: "This certificateID is decoded from scanning the QR code, and\ + \ 1:1 mapping with voucherCode. Required if `voucherCode` is not specified." + explode: true + in: query + name: certificateID + required: false + schema: + $ref: '#/components/schemas/certificateID' + style: form + - explode: true + in: query + name: merchantID + required: true + schema: + $ref: '#/components/schemas/merchantID' + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/GetDineInVoucherResponse' + description: The API request is successfully processed. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "invalid_argument\n| Code | Reason | Message \ + \ | Description \ + \ | \n| ----\ + \ | ---------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------\ + \ | \n| 400 | invalid_argument | invalid certificateID \ + \ | The certificateID is not valid. \ + \ |\n| 400 | invalid_argument | voucherCode\ + \ or certificateID not specified | The voucherCode and certificateID are\ + \ both empty in params, one of the both must be provided. |\n" + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "not_found\n| Code | Reason | Message \ + \ | Description \ + \ | \n| -----| ----------- | ----------------------------\ + \ | -----------------------------------------------------------------------------------------------\ + \ | \n| 404 | not_found | voucher not found | The voucher\ + \ is not found for the specified voucherCode or certificateID. \ + \ |\n| 404 | not_found | failed to get store info \ + \ | The store is not found for the specified merchantID. \ + \ |\n" + summary: Get Dine In Voucher + tags: + - get-dinein-voucher + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -L -X GET 'https://partner-api.grab.com/grabfood/partner/v1/dinein/voucher?voucherCode=GV-OQBJDKZH&certificateID=PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg==&merchantID=4-C2YEK6CGZMTEX' \ + -H 'Authorization: Bearer ' \ + /partner/v1/dinein/voucher/redeem: + post: + operationId: redeem-dinein-voucher + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RedeemDineInVoucherRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RedeemDineInVoucherResponse' + description: The API request is successfully processed. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "invalid_argument\n| Code | Reason | Message \ + \ | Description \ + \ \ + \ | \n| ---- | ---------------- | ------------------------------------------\ + \ | ---------------------------------------------------------------------------------------------------------\ + \ | \n| 400 | invalid_argument | invalid certificateID \ + \ | The certificateID is not valid. \ + \ |\n| 400 | invalid_argument\ + \ | not enabled | The QR redemption feature\ + \ is not enabled for the merchant, please reach out to the integration\ + \ manager |\n" + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "not_found\n| Code | Reason | Message \ + \ | Description \ + \ | \n| -----| ----------- | ----------------------------\ + \ | -----------------------------------------------------------------------------------------------\ + \ | \n| 404 | not_found | voucher not found | The voucher\ + \ is not found for the specified voucherCode or certificateID. \ + \ |\n| 404 | not_found | failed to get store info \ + \ | The store is not found for the specified merchantID. \ + \ |\n" + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: "internal\n| Code | Reason | Message \ + \ | Description \ + \ | \n| -----| ----------- | ----------------------------\ + \ | -----------------------------------------------------------------------------------------------\ + \ | \n| 500 | internal | redeem failed | Redemption\ + \ failed, please try again later. \ + \ |\n" + summary: Redeem Dine In Voucher + tags: + - redeem-dinein-voucher + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X POST 'https://partner-api.grab.com/grabfood/partner/v1/dinein/voucher/redeem' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "certificateID": "PPD%23-lQi823X7Te-MCXUW1ynhA7PEpXjeml2xqB2KTIvNdXzu3M_R8mLtA==", + "merchantID": "1-C3VEJY6CMEEGUE" + }' + /partner/v1/membership/notify: + post: + operationId: notify-membership-webview + parameters: + - description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + - description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/NotifyMembershipWebviewRequest' + required: true + responses: + "204": + description: Success. No content returned. + "4xx": + description: Failed. + summary: Notify Membership + tags: + - notify-membership-webview + x-codeSamples: + - lang: cURL + label: CLI + source: | + curl -X POST \ + 'https://partner-api.grab.com/grabfood/partner/v1/membership/notify' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer ' \ + -d '{ + "memberID": "A12345689", + "grabID": "b2abcd0b-69b0-3369-9603-68345a5f4f0a", + "merchantID": "1-CYNGRUNGSBCCC", + "action": "LINK" + }' +components: + parameters: + Authorization: + description: Specify the generated authorization token of the bearer type. + explode: false + in: header + name: Authorization + required: true + schema: + example: Bearer + type: string + style: simple + Content-Type: + description: The content type of the request body. You must use `application/json` + for this header as GrabFood API currently does not support other formats. + explode: false + in: header + name: Content-Type + required: true + schema: + example: application/json + type: string + style: simple + MerchantID: + description: The merchant's ID that is in GrabFood's database. + explode: false + in: path + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: simple + MerchantIDinQuery: + description: The merchant's ID that is in GrabFood's database. + explode: true + in: query + name: merchantID + required: true + schema: + example: 1-CYNGRUNGSBCCC + type: string + style: form + schemas: + PartnerOauthRequest: + description: | + Information about GrabFood getting an OAuth access token from partners. + properties: + client_id: + description: The client identifier issued to obtain the OAuth access token. + example: + maxLength: 32 + type: string + client_secret: + description: The client secret issued to obtain the OAuth access token. + example: + maxLength: 32 + type: string + grant_type: + description: Refers to the way an application gets OAuth access token. + example: client_credentials + type: string + scope: + description: A space delimited list of partner scopes. + example: food.partner_api + type: string + required: + - client_id + - client_secret + - grant_type + title: OauthRequestPartner + type: object + PartnerOauthResponse: + properties: + access_token: + description: The OAuth 2.0 access token issued by the partner. + example: eyJhbGciOiJSUzI1NiIsImtpZCI6Il9kZWZhdWx0IiwidHlwIjoiSldUIn0.eyJhdWQiOiI1NWRkNzEyZTViNWY0MDQyYTEzZjVkZTM0ZjM4NmVjMSIsImV4cCI6MTU2MDMwMDgzMSwiaWF0IjoxNTU5Njk2MDMxLCJpc3MiOiJodHRwczovL2lkcC5ncmFiLmNvbSIsImp0aSI6InFJZDB6Wmh1UkhxX0F4STZPdncwekEiLCJuYmYiOjE1NTk2OTU4NTEsInBpZCI6IjIwM2E5MmFmLTJmN2ItNDNjZS1hNTVmLTc5NGE4ZWQzZWE2NyIsInBzdCI6MSwic2NwIjoiW1wiYzE2MWM0NTdlZGVlNGExYmI4YTQwMzZmMDM5ZTYzZDZcIl0iLCJzdWIiOiJUV09fTEVHR0VEX09BVVRIIiwic3ZjIjoiIiwidGtfdHlwZSI6ImFjY2VzcyJ9.DEpeDobxey2YIEiAYWJ4zB5chCwGwc7Fojb8GEjnn4bORqb8-vDD5zQ-X7BRPRxAUv0MVam4q2annB4z4tEBNYYv1PW-w9UiJ-224kR8QJ1lWOsN9ZKibSWRMS6Mt9LN3r0_VSTDQB_X0QzMOOV00EeloMTbf6TKJ-3YQwDuD8GJeK1aNaLFmfcQC6avvyGcfO2VFnDDnLbDLmJ-oYQXn9Xb7SX_GDsnWUukxaOriQFW7PW0JVSvrAmq3lV5C1aioDI_qJD0MV065MJJT9xOVPIf_Myq5R6AHTF5Gon6ga3eA8fAYNpQ9Qbmq2jH-aFYBMcx27fL2-4vIhBCHKnhww + type: string + token_type: + description: The type of token issued which is case insensitive. + enum: + - Bearer + type: string + expires_in: + description: The access token lifespan in seconds. + example: 604799 + type: integer + title: OauthResponse + type: object + GetMenuNewResponse: + description: "" + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + currency: + $ref: '#/components/schemas/currency' + sellingTimes: + description: "An array of sellingTimes JSON objects. Max 20 allowed. Refer\ + \ to [Selling Times](#selling-times) for more information." + items: + $ref: '#/components/schemas/SellingTime' + required: + - endTime + - id + - name + - serviceHours + - startTime + title: sellingTimes + type: array + categories: + description: "An array of category JSON objects. Max 100 allowed per section.\ + \ Refer to [Categories](#categories) for more information." + items: + $ref: '#/components/schemas/MenuCategory' + title: categories + type: array + required: + - categories + - currency + - sellingTimes + title: Selling Time Based + type: object + GetMenuOldResponse: + description: "" + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + currency: + $ref: '#/components/schemas/currency' + sections: + description: "An array of section JSON objects. Max 7 allowed. Refer to\ + \ [Sections](#sections) for more information." + items: + $ref: '#/components/schemas/MenuSection' + title: sections + type: array + required: + - currency + - sections + title: Section Based + type: object + MenuSyncWebhookRequest: + description: | + This request pushes the state of a menu sync operation. + properties: + requestID: + description: | + An universally unique identifier (UUID) string. Used to uniquely identify a webhook request. + Partners should use this value to distinguish between different webhook requests. If two requests contain the same requestID, only the first request should be considered and later requests **must** be ignored or discarded. + example: 6b5e362a-caa1-4858-908b-dae145d317bc + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + jobID: + description: | + An UUID string. Uniquely identifies a menu sync job. + This can be found from the [Menu Update Notification](#tag/update-menu-noti) API response header. + example: 36bb8bb8-4aef-4eca-bed9-fd5ae1e4dc11 + type: string + updatedAt: + description: | + Indicates the time of menu sync status change. + This is based on ISO_8601/RFC3339. For example: `2022-07-29T15:55:59Z`. + example: 2022-07-29T15:55:59Z + type: string + status: + description: Indicates the state of the menu sync job. + enum: + - QUEUEING + - PROCESSING + - SUCCESS + - FAILED + type: string + errors: + description: A string array of errors that occurred during processing. This + array is empty if the status is not `FAILED`. + items: + type: string + example: null + type: array + title: MenuSyncWebhookRequest + type: object + SubmitOrderRequest: + description: | + A JSON object containing the order information. + example: + scheduledTime: 2019-05-24T08:26:00Z + receiver: + address: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + name: Prashanth + phones: "60122234704" + orderID: 123-CYNKLPCVRN5 + partnerMerchantID: Partner-ABECU + cutlery: true + completeTime: 2019-05-24T05:26:00Z + membershipID: 12345678Z + paymentType: CASH + orderState: DELIVERED + shortOrderNumber: GF-123 + orderTime: 2019-05-24T05:06:00Z + submitTime: 2019-05-24T05:16:00Z + campaigns: + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + merchantID: 1-CYNGRUNGSBCCC + price: + deliveryFee: 400 + subtotal: 2550 + merchantChargeFee: 0 + grabFundPromo: 300 + basketPromo: 775 + tax: 117 + merchantFundPromo: 475 + eaterPayment: 2175 + orderReadyEstimation: + maxOrderReadyTime: 2019-05-24T05:16:00Z + newOrderReadyTime: 2019-05-24T05:26:00Z + estimatedOrderReadyTime: 2019-05-24T05:16:00Z + allowChange: true + currency: + symbol: S$ + code: SGD + exponent: 2 + items: + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + promos: + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + dineIn: + eaterCount: 2 + tableID: "1" + featureFlags: + orderType: DeliveredByGrab + orderAcceptedType: AUTO + isMexEditOrder: false + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + shortOrderNumber: + description: "The GrabFood short order number. This is unique for each merchant\ + \ per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: GF-123 + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + paymentType: + description: "The payment method used. Refer to FAQs for more details about\ + \ [paymentType](#section/Order/Does-the-paymentType-affect-partners)." + enum: + - CASH + - CASHLESS + type: string + cutlery: + description: "The boolean value to indicate whether cutlery are needed or\ + \ not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery)." + type: boolean + orderTime: + description: "The UTC time that a consumer places the order, based on ISO_8601/RFC3339." + example: 2019-05-24T05:06:00Z + type: string + submitTime: + description: "The order submit time, based on ISO_8601/RFC3339. Only present\ + \ in the [List Orders](#tag/list-order) response." + example: 2019-05-24T05:16:00Z + format: date-time + type: string + completeTime: + description: "The order complete time, based on ISO_8601/RFC3339. Only present\ + \ in the [List Orders](#tag/list-order) response." + example: 2019-05-24T05:26:00Z + format: date-time + type: string + scheduledTime: + description: "The order scheduled time, based on ISO_8601/RFC3339. Empty\ + \ for non-scheduled orders." + example: 2019-05-24T08:26:00Z + type: string + orderState: + description: "The state of the order. Only present in the [List Orders](#tag/list-order)\ + \ response. Refer to [Order States](#section/Order-states)." + example: DELIVERED + type: string + currency: + $ref: '#/components/schemas/currency' + featureFlags: + $ref: '#/components/schemas/orderFeatureFlags' + items: + description: "The items in an array of JSON Object. Refer to [Items](#items)\ + \ for more information." + items: + $ref: '#/components/schemas/OrderItem' + title: orderItems + type: array + campaigns: + description: | + The campaigns that are applicable for the order.`null` when there is no campaign applied. + items: + $ref: '#/components/schemas/OrderCampaign' + nullable: true + title: campaigns + type: array + promos: + description: An array of promotion objects. Only promotions that are funded + by merchants will be sent. + items: + $ref: '#/components/schemas/OrderPromo' + title: promos + type: array + price: + $ref: '#/components/schemas/orderPrice' + dineIn: + $ref: '#/components/schemas/dineIn' + receiver: + $ref: '#/components/schemas/receiver' + orderReadyEstimation: + $ref: '#/components/schemas/orderReadyEstimation' + membershipID: + description: Membership ID for loyalty project. Only present for loyalty + program partners. + example: 12345678Z + type: string + required: + - currency + - cutlery + - featureFlags + - items + - merchantID + - orderID + - orderTime + - paymentType + - price + - shortOrderNumber + title: Order + type: object + OrderStateRequest: + description: | + This request pushes the state of an order on GrabFood. + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + state: + description: "The current order state. For takeaway orders, only `DELIVERED`\ + \ and `CANCELLED` states are pushed." + enum: + - ACCEPTED + - DRIVER_ALLOCATED + - DRIVER_ARRIVED + - COLLECTED + - DELIVERED + - FAILED + - CANCELLED + example: CANCELLED + type: string + driverETA: + description: The driver's estimated of arrival (ETA) in seconds when the + state is `DRIVER_ALLOCATED`. + nullable: true + type: integer + example: null + code: + description: "The current order's sub-state. This is in free text so you\ + \ should only use for reference. Grab may use this for troubleshooting.\ + \ If you want some analysis, kindly use `state` instead." + example: CANCELLED + type: string + message: + description: Additional information to explain the current order state. + May be system status or human entered message. + example: We're too busy right now. + type: string + required: + - merchantID + - orderID + - state + title: OrderStateRequest + type: object + BindMembershipNativeRequest: + description: | + This request submits membership binding request to partner. + properties: + grabID: + description: The id used to identify an unique grab user. + example: b2abcd0b-69b0-3369-9603-68345a5f4f0a + type: string + phoneNumber: + description: Grab user phone number used to login. + example: "60188888888" + type: string + required: + - grabID + title: Bind Membership Request + type: object + BindMembershipNativeResponse: + description: | + This response returns membershipID after membership binding is successful. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + required: + - memberID + title: Bind Membership Response + type: object + RegisterMembershipNativeRequest: + description: | + This request submits membership registration request to partner. + properties: + grabID: + description: The id used to identify an unique grab user. + example: b2abcd0b-69b0-3369-9603-68345a5f4f0a + type: string + phoneNumber: + description: Grab user's phone number for registration. + example: "60188888888" + type: string + name: + description: Grab user's name for registration. + example: John Doe + type: string + email: + description: Grab user's email address for registration. + example: john.doe8888@gmail.com + type: string + required: + - grabID + title: Register Membership Request + type: object + RegisterMembershipNativeResponse: + description: | + This response returns membershipID after membership binding is successful. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + required: + - memberID + title: Bind Membership Response + type: object + UnbindMembershipNativeRequest: + description: | + This request submits membership unbind request to partner. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + required: + - memberID + title: Unbind Membership Request + type: object + UnlinkMembershipWebviewRequest: + description: | + This request submits membership unbind request to partner. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + required: + - memberID + title: Unlink Membership Request + type: object + GetMembershipRequest: + description: | + This request submits membership unbind request to partner. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + required: + - memberID + title: Unbind Membership Request + type: object + GetMembershipNativeResponse: + description: | + This response returns membership detail. + properties: + membershipStatus: + description: Status of the memberID. + enum: + - VALID + - INVALID + example: VALID + type: string + pointInfo: + $ref: '#/components/schemas/GetMembershipNativeResponse_pointInfo' + pointsExpireDate: + description: Earliest points expiry date. In `yyyy-mm-dd` format + example: 2024-06-24 + type: string + title: Get Membership (Native) + type: object + GetMembershipWebviewResponse: + description: | + This response returns membership detail. + properties: + membershipStatus: + description: Status of the memberID. + enum: + - VALID + - INVALID + example: VALID + type: string + title: Get Membership (Webview) + type: object + GetRewardNativeRequest: + description: | + This request submits membership detail and order value to get reward calculation. + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + merchantID: + description: Grab merchant's ID. + example: 1-CYNGRUNGSBCCC + type: string + items: + items: + $ref: '#/components/schemas/RewardItem' + type: array + orderValue: + description: The post-discount order value. + example: 25 + format: int64 + type: integer + title: Get Reward Request + type: object + GetRewardNativeResponse: + description: | + This response returns reward points earn for this order. + properties: + points: + description: The reward points earned in this purchase. + example: 10 + format: int64 + type: integer + required: + - points + title: Get Reward Response + type: object + UpdateSpecialHourRequest: + description: Object contains store special hours. + example: + specialOpeningHours: + - metadata: + description: New Year Opening Hours + endDate: 2024-02-04 + openingHours: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + startDate: 2024-02-01 + - metadata: + description: New Year Opening Hours + endDate: 2024-02-04 + openingHours: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + startDate: 2024-02-01 + properties: + specialOpeningHours: + description: An array of objects contain store special hours. Max. 3 array + elements. + items: + $ref: '#/components/schemas/specialOpeningHour' + type: array + required: + - specialOpeningHours + title: UpdateSpecialHourRequest + type: object + UpdateSpecialHourResponse: + description: Object contain update store special hour response + example: + closeImmediately: false + orderCount: 2 + scheduledOrderCount: 0 + errorReasons: + - PendingOrders + - PendingOrders + properties: + errorReasons: + description: Error message when updating store delivery hour. `null` indicates + no error. + items: + enum: + - PendingOrders + type: string + nullable: true + type: array + orderCount: + description: Total active order for the day. + example: 2 + format: int64 + type: integer + scheduledOrderCount: + description: Total scheduled order during store close period. + format: int64 + type: integer + closeImmediately: + description: Indicate the store status after updating special hours. + example: false + type: boolean + required: + - closeImmediately + - orderCount + - scheduledOrderCount + title: UpdateStoreSpecialHourResponse + type: object + UpdateDineInHourRequest: + description: Object contains store dine-in hours. + example: + dineInHour: + thu: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + dineInHour: + $ref: '#/components/schemas/storeHour' + required: + - dineInHour + title: UpdateDineInHourRequest + type: object + UpdateDineInHourResponse: + description: Object contain update store dine-in hour response + example: + errorReasons: + - errorReasons + - errorReasons + properties: + errorReasons: + description: Error message when updating store dine-in hour. `null` indicates + no error. + items: + type: string + nullable: true + type: array + title: UpdateStoreDineInHourResponse + type: object + UpdateDeliveryHourRequest: + description: Object contains store delivery hours. + example: + openingHour: + thu: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + force: true + properties: + openingHour: + $ref: '#/components/schemas/storeHour' + force: + description: To enable force update store delivery hours. Error will be + returned if set to false while there is ongoing order. + type: boolean + required: + - force + - openingHour + title: UpdateDeliveryHourRequest + type: object + UpdateDeliveryHourResponse: + description: Object contain update store delivery hour response + example: + closeImmediately: false + orderCount: 2 + scheduledOrderCount: 0 + errorReasons: + - ClosingHoursIneffective + - ClosingHoursIneffective + properties: + errorReasons: + description: Error message when updating store delivery hour. `null` indicates + no error. + items: + enum: + - ClosingHoursIneffective + - ForceUpdated + - PendingScheduledOrders + - PendingOrders + type: string + nullable: true + type: array + orderCount: + description: Total active order for the day. + example: 2 + format: int64 + type: integer + scheduledOrderCount: + description: Total scheduled order during store close period. + format: int64 + type: integer + closeImmediately: + description: Indicate the store status after updating delivery hours. + example: false + type: boolean + required: + - closeImmediately + - orderCount + - scheduledOrderCount + title: UpdateStoreDeliveryHourResponse + type: object + StoreStatusResponse: + description: Object contains store status info + example: + isInSpecialOpeningHourRange: false + isOpen: false + closeReason: mex_paused + properties: + closeReason: + description: The code of store close reason. Blank indicates store is currently + open. + enum: + - mex_paused + - ops_paused + - out_of_special_opening_hours + - out_of_opening_hours + - inactive + - ops_paused_without_comm + - restricted + - suspended + - parse_data_fail + - "" + type: string + isInSpecialOpeningHourRange: + description: Indicate whether the store is in special opening hour range. + example: false + type: boolean + isOpen: + description: Indicate whether the store is open. + example: false + type: boolean + required: + - closeReason + - isInSpecialOpeningHourRange + - isOpen + title: StoreStatusResponse + type: object + Error: + example: + reason: error_reason + message: error detail + target: "" + properties: + target: + description: Target of error + example: "" + type: string + reason: + description: The type of error. + example: error_reason + type: string + message: + description: The details of the error. + example: error detail + type: string + title: Error + type: object + StoreHourResponse: + description: Object contain store hour info + example: + openingHour: + thu: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + specialOpeningHours: + - metadata: + description: New Year Opening Hours + endDate: 2024-02-04 + openingHours: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + startDate: 2024-02-01 + - metadata: + description: New Year Opening Hours + endDate: 2024-02-04 + openingHours: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + startDate: 2024-02-01 + dineInHour: + thu: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + dineInHour: + $ref: '#/components/schemas/storeHour' + openingHour: + $ref: '#/components/schemas/storeHour' + specialOpeningHours: + description: The store's special opening hours. + items: + $ref: '#/components/schemas/specialOpeningHour' + type: array + title: StoreHourResponse + type: object + GrabOauthRequest: + description: | + Information about the GrabFood client getting an OAuth 2.0 access token from partners. + example: + grant_type: client_credentials + scope: food.partner_api + client_secret: + client_id: + properties: + client_id: + description: The client identifier issued to the client to obtain the OAuth + 2.0 access_token. + example: + maxLength: 32 + type: string + client_secret: + description: The client secret issued to the client to obtain the OAuth + 2.0 access_token. + example: + maxLength: 32 + type: string + grant_type: + description: The grant type for the client to obtain the OAuth 2.0 access_token. + example: client_credentials + type: string + scope: + description: The scope for the client to obtain the OAuth 2.0 access_token. + example: food.partner_api + type: string + required: + - client_id + - client_secret + - grant_type + - scope + title: OauthRequestPartner + type: object + GrabOauthResponse: + example: + access_token: eyJhbGciOiJSUzI1NiIsImtpZCI6Il9kZWZhdWx0IiwidHlwIjoiSldUIn0.eyJhdWQiOiI1NWRkNzEyZTViNWY0MDQyYTEzZjVkZTM0ZjM4NmVjMSIsImV4cCI6MTU2MDMwMDgzMSwiaWF0IjoxNTU5Njk2MDMxLCJpc3MiOiJodHRwczovL2lkcC5ncmFiLmNvbSIsImp0aSI6InFJZDB6Wmh1UkhxX0F4STZPdncwekEiLCJuYmYiOjE1NTk2OTU4NTEsInBpZCI6IjIwM2E5MmFmLTJmN2ItNDNjZS1hNTVmLTc5NGE4ZWQzZWE2NyIsInBzdCI6MSwic2NwIjoiW1wiYzE2MWM0NTdlZGVlNGExYmI4YTQwMzZmMDM5ZTYzZDZcIl0iLCJzdWIiOiJUV09fTEVHR0VEX09BVVRIIiwic3ZjIjoiIiwidGtfdHlwZSI6ImFjY2VzcyJ9.DEpeDobxey2YIEiAYWJ4zB5chCwGwc7Fojb8GEjnn4bORqb8-vDD5zQ-X7BRPRxAUv0MVam4q2annB4z4tEBNYYv1PW-w9UiJ-224kR8QJ1lWOsN9ZKibSWRMS6Mt9LN3r0_VSTDQB_X0QzMOOV00EeloMTbf6TKJ-3YQwDuD8GJeK1aNaLFmfcQC6avvyGcfO2VFnDDnLbDLmJ-oYQXn9Xb7SX_GDsnWUukxaOriQFW7PW0JVSvrAmq3lV5C1aioDI_qJD0MV065MJJT9xOVPIf_Myq5R6AHTF5Gon6ga3eA8fAYNpQ9Qbmq2jH-aFYBMcx27fL2-4vIhBCHKnhww + token_type: Bearer + expires_in: 604799 + properties: + access_token: + description: The OAuth 2.0 access token issued by the partner. + example: eyJhbGciOiJSUzI1NiIsImtpZCI6Il9kZWZhdWx0IiwidHlwIjoiSldUIn0.eyJhdWQiOiI1NWRkNzEyZTViNWY0MDQyYTEzZjVkZTM0ZjM4NmVjMSIsImV4cCI6MTU2MDMwMDgzMSwiaWF0IjoxNTU5Njk2MDMxLCJpc3MiOiJodHRwczovL2lkcC5ncmFiLmNvbSIsImp0aSI6InFJZDB6Wmh1UkhxX0F4STZPdncwekEiLCJuYmYiOjE1NTk2OTU4NTEsInBpZCI6IjIwM2E5MmFmLTJmN2ItNDNjZS1hNTVmLTc5NGE4ZWQzZWE2NyIsInBzdCI6MSwic2NwIjoiW1wiYzE2MWM0NTdlZGVlNGExYmI4YTQwMzZmMDM5ZTYzZDZcIl0iLCJzdWIiOiJUV09fTEVHR0VEX09BVVRIIiwic3ZjIjoiIiwidGtfdHlwZSI6ImFjY2VzcyJ9.DEpeDobxey2YIEiAYWJ4zB5chCwGwc7Fojb8GEjnn4bORqb8-vDD5zQ-X7BRPRxAUv0MVam4q2annB4z4tEBNYYv1PW-w9UiJ-224kR8QJ1lWOsN9ZKibSWRMS6Mt9LN3r0_VSTDQB_X0QzMOOV00EeloMTbf6TKJ-3YQwDuD8GJeK1aNaLFmfcQC6avvyGcfO2VFnDDnLbDLmJ-oYQXn9Xb7SX_GDsnWUukxaOriQFW7PW0JVSvrAmq3lV5C1aioDI_qJD0MV065MJJT9xOVPIf_Myq5R6AHTF5Gon6ga3eA8fAYNpQ9Qbmq2jH-aFYBMcx27fL2-4vIhBCHKnhww + type: string + token_type: + description: The type of token issued which is case insensitive. + example: Bearer + type: string + expires_in: + description: The access token lifespan in seconds. The token is reused till + it expires - default is 604799 (7 days). + example: 604799 + type: integer + title: OauthResponse + type: object + UpdateMenuItem: + description: | + Information about the GrabFood client updating their food menu. + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + field: + description: The record type that you want to update. + enum: + - ITEM + example: ITEM + type: string + id: + description: "The record's ID on the partner system. For example, the item\ + \ id in case type is ITEM." + example: ITEM-1 + type: string + price: + description: The record's price in minor unit format. + example: 200 + format: int64 + type: integer + availableStatus: + description: "The record's availableStatus. \n\nNote: In order to set an\ + \ item as \"UNAVAILABLE\", it is required to update both the `availableStatus`\ + \ and `maxStock` fields, whereby the `maxStock` value should be set to\ + \ 0.\n" + enum: + - AVAILABLE + - UNAVAILABLE + - UNAVAILABLETODAY + type: string + maxStock: + description: | + Available stocks under inventory for this item. Auto reduce when there is order placed for this item. + + Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is "UNAVAILABLE". Item will be set to "AVAILABLE" if `maxStock` > 0. + example: 10 + format: int64 + type: integer + advancedPricings: + description: | + Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + items: + $ref: '#/components/schemas/UpdateAdvancedPricing' + type: array + purchasabilities: + description: | + Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. + items: + $ref: '#/components/schemas/UpdatePurchasability' + type: array + required: + - field + - id + - merchantID + title: Update Item + type: object + UpdateMenuModifier: + description: | + Information about the GrabFood client updating their food menu. + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + field: + description: The record type that you want to update. + enum: + - MODIFIER + example: MODIFIER + type: string + id: + description: "The record's ID on the partner system. For example, the modifier\ + \ id in case type is MODIFIER." + example: MODIFIER-1 + type: string + price: + description: The record's price in minor unit format. + example: 100 + format: int64 + type: integer + name: + description: '**Only required when updating modifiers.** The record''s name. + Used as identifier to locate the correct record.' + example: modifier-1 + type: string + availableStatus: + description: The record's availableStatus. + enum: + - AVAILABLE + - UNAVAILABLE + - UNAVAILABLETODAY + type: string + isFree: + description: | + Allows the modifier's price to be explicitly set as zero. Possible values are as follows: + * `isFree` && `price == 0` sets the modifier's price to zero. + * `isFree` && `price > 0` returns an error message that "price cannot be set to > 0, if modifier is free”. + * `!isFree` && `price > 0` sets the modifier's price to the defined price. + * `!isFree` && `price == 0` does not update the modifier's price and reuses the existing price. + example: false + type: boolean + advancedPricings: + description: | + Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + items: + $ref: '#/components/schemas/UpdateAdvancedPricing' + type: array + required: + - field + - id + - merchantID + - name + title: Update Modifier + type: object + BatchUpdateMenuItem: + description: | + Information about the GrabFood client updating their food menu. + example: + menuEntities: + - availableStatus: AVAILABLE + advancedPricings: + - price: 100 + key: Delivery_OnDemand_GrabApp + - price: 100 + key: Delivery_OnDemand_GrabApp + purchasabilities: + - purchasable: true + key: Delivery_OnDemand_GrabApp + - purchasable: true + key: Delivery_OnDemand_GrabApp + price: 200 + maxStock: 10 + id: ITEM-1 + - availableStatus: AVAILABLE + advancedPricings: + - price: 100 + key: Delivery_OnDemand_GrabApp + - price: 100 + key: Delivery_OnDemand_GrabApp + purchasabilities: + - purchasable: true + key: Delivery_OnDemand_GrabApp + - purchasable: true + key: Delivery_OnDemand_GrabApp + price: 200 + maxStock: 10 + id: ITEM-1 + field: ITEM + merchantID: 1-CYNGRUNGSBCCC + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + field: + description: The record type that you want to update. + enum: + - ITEM + example: ITEM + type: string + menuEntities: + description: | + The items in an array of JSON Object. + items: + $ref: '#/components/schemas/MenuEntity' + type: array + required: + - field + - merchantID + title: Batch Update Item + type: object + BatchUpdateMenuResponse: + example: + merchantID: 1-CYNGRUNGSBCCC + errors: + - errMsg: get food item fail + entityID: ITEM-1 + - errMsg: get food item fail + entityID: ITEM-1 + status: + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + status: + description: The status of this request. + enum: + - success + - partial success + - fail + example: + type: string + errors: + description: The error messages when batch update menu record was partial + success/fail. `null` when the request was success. + items: + $ref: '#/components/schemas/MenuEntityError' + nullable: true + type: array + title: Batch Update Menu Record Response + type: object + UpdateMenuNotifRequest: + description: | + This request notifies GrabFood about the partner's updated food menu. + example: + merchantID: 1-CYNGRUNGSBCCC + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + required: + - merchantID + title: UpdateMenuNotifRequest + type: object + MenuSyncResponse: + description: "" + example: + updatedTime: 2020-07-09T09:54:01.423512013Z + code: Success + createdTime: 2020-07-09T09:53:59.783632615Z + errors: + - error message 1 + - error message 1 + sections: + - serviceHours: + errors: + - error 1 + - error 1 + id: section_externalID1 + categories: + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + errors: + - error 1 + - error 1 + - serviceHours: + errors: + - error 1 + - error 1 + id: section_externalID1 + categories: + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + errors: + - error 1 + - error 1 + properties: + createdTime: + description: The Unix time the specified menu was created in GrabFood's + database. + example: 2020-07-09T09:53:59.783632615Z + format: date-time + type: string + updatedTime: + description: The Unix time the specified menu was created in GrabFood's + database. + example: 2020-07-09T09:54:01.423512013Z + format: date-time + type: string + code: + description: "The status code for this request. See [Menu sync response\ + \ statuses](#section/Menu-sync-response-statuses) for more information." + enum: + - Success + - PartialSuccess + - InQueuing + type: string + errors: + description: An array of strings of error message. + items: + example: error message 1 + type: string + nullable: true + type: array + example: null + sections: + items: + $ref: '#/components/schemas/menuSyncFail' + nullable: true + type: array + example: null + required: + - code + - createdTime + - updatedTime + title: MenuSyncSuccess + type: object + AcceptOrderRequest: + description: | + The manual acceptance or rejection of an order on GrabFood. + example: + toState: Accepted + orderID: 123-CYNKLPCVRN5 + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + toState: + description: The order's updated state. + enum: + - Accepted + - Rejected + type: string + required: + - orderID + - toState + title: AcceptOrderRequest + type: object + date: + description: The date of your report. + example: 2020-01-20 + title: date + type: string + ListOrdersResponse: + description: "" + example: + more: true + orders: + - scheduledTime: 2019-05-24T08:26:00Z + receiver: + address: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + name: Prashanth + phones: "60122234704" + orderID: 123-CYNKLPCVRN5 + partnerMerchantID: Partner-ABECU + cutlery: true + completeTime: 2019-05-24T05:26:00Z + membershipID: 12345678Z + paymentType: CASH + orderState: DELIVERED + shortOrderNumber: GF-123 + orderTime: 2019-05-24T05:06:00Z + submitTime: 2019-05-24T05:16:00Z + campaigns: + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + merchantID: 1-CYNGRUNGSBCCC + price: + deliveryFee: 400 + subtotal: 2550 + merchantChargeFee: 0 + grabFundPromo: 300 + basketPromo: 775 + tax: 117 + merchantFundPromo: 475 + eaterPayment: 2175 + orderReadyEstimation: + maxOrderReadyTime: 2019-05-24T05:16:00Z + newOrderReadyTime: 2019-05-24T05:26:00Z + estimatedOrderReadyTime: 2019-05-24T05:16:00Z + allowChange: true + currency: + symbol: S$ + code: SGD + exponent: 2 + items: + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + promos: + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + dineIn: + eaterCount: 2 + tableID: "1" + featureFlags: + orderType: DeliveredByGrab + orderAcceptedType: AUTO + isMexEditOrder: false + - scheduledTime: 2019-05-24T08:26:00Z + receiver: + address: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + name: Prashanth + phones: "60122234704" + orderID: 123-CYNKLPCVRN5 + partnerMerchantID: Partner-ABECU + cutlery: true + completeTime: 2019-05-24T05:26:00Z + membershipID: 12345678Z + paymentType: CASH + orderState: DELIVERED + shortOrderNumber: GF-123 + orderTime: 2019-05-24T05:06:00Z + submitTime: 2019-05-24T05:16:00Z + campaigns: + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + merchantID: 1-CYNGRUNGSBCCC + price: + deliveryFee: 400 + subtotal: 2550 + merchantChargeFee: 0 + grabFundPromo: 300 + basketPromo: 775 + tax: 117 + merchantFundPromo: 475 + eaterPayment: 2175 + orderReadyEstimation: + maxOrderReadyTime: 2019-05-24T05:16:00Z + newOrderReadyTime: 2019-05-24T05:26:00Z + estimatedOrderReadyTime: 2019-05-24T05:16:00Z + allowChange: true + currency: + symbol: S$ + code: SGD + exponent: 2 + items: + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + promos: + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + dineIn: + eaterCount: 2 + tableID: "1" + featureFlags: + orderType: DeliveredByGrab + orderAcceptedType: AUTO + isMexEditOrder: false + properties: + more: + description: "The boolean value to indicate if there is more order data.\ + \ If `true`, you can continue requesting with page+1." + type: boolean + orders: + items: + $ref: '#/components/schemas/order' + type: array + title: ListOrdersResponse + type: object + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs for\ + \ more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + EditOrderRequest: + description: | + Information about editing an existing order on GrabFood. + example: + onlyRecalculate: false + orderID: 123-CYNKLPCVRN5 + items: + - isExternalItemID: false + itemID: IDGFSTI000004qy1490868132306763533 + quantity: 1 + status: UPDATED + - isExternalItemID: false + itemID: IDGFSTI000004qy1490868132306763533 + quantity: 1 + status: UPDATED + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + items: + description: "Specify the array of all items in the order, including deleted,\ + \ added, updated and unchanged items." + items: + $ref: '#/components/schemas/EditOrderItem' + type: array + onlyRecalculate: + description: | + This parameter specifies whether to recalculate the edited order without submitting it. It is intended for testing purposes only. This parameter is set to false by default, which means the edited order will be recalculated and re-submitted to partners. + example: false + type: boolean + required: + - items + - orderID + title: EditOrderRequest + type: object + MarkOrderRequest: + description: | + This request marks an order as ready for delivery or completed on GrabFood. + example: + orderID: 123-CYNKLPCVRN5 + markStatus: 0 + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + markStatus: + description: "The status to be marked accordingly. \n* `1` - mark order\ + \ as ready \n* `2` - mark order as completed and only applicable to **dine-in**\ + \ orders\n" + enum: + - 1 + - 2 + type: integer + required: + - markStatus + - orderID + title: MarkOrderRequest + type: object + OrderDeliveryRequest: + description: | + This request marks an order as delivered on GrabFood. + example: + fromState: Collect + toState: Delivered + orderID: 123-CYNKLPCVRN5 + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + fromState: + description: Specify the order's initial state. + enum: + - Accepted + - FindDriver + - Collected + example: Collect + type: string + toState: + description: Specify the order's new state. + enum: + - FindDriver + - Collected + - Delivered + example: Delivered + type: string + required: + - fromState + - orderID + - toState + title: OrderDeliveryRequest + type: object + NewOrderTimeRequest: + description: | + This request updates an order with a new ready time on GrabFood. + example: + orderID: 123-CYNKLPCVRN5 + newOrderReadyTime: 2019-05-24T05:16:00Z + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + newOrderReadyTime: + description: "The new order ready time for this order, based on ISO_8601/RFC3339." + example: 2019-05-24T05:16:00Z + format: date-time + type: string + required: + - newOrderReadyTime + - orderID + title: NewOrderTimeRequest + type: object + CheckOrderCancelableResponse: + description: "" + example: + limitTimes: 0 + nonCancellationReason: GKMM (Grab Kitchen Mix & Match) orders cannot be cancelled + cancelAble: true + limitType: not approaching limit + cancelReasons: + - reason: Items are unavailable + code: 6 + - reason: Items are unavailable + code: 6 + properties: + cancelAble: + description: The boolean value to indicate whether an order can be cancelled. + example: true + type: boolean + nonCancellationReason: + description: The reason for the order to be non-cancelable. + enum: + - GKMM (Grab Kitchen Mix & Match) orders cannot be cancelled + - Self pick-up orders cannot be cancelled + - Scheduled orders cannot be cancelled + - Daily cancellation limit reached + - Weekly cancellation limit reached + - Monthly cancellation limit reached + - Driver has been allocated for too long + - Driver App version is outdated preventing cancellation + - Order has not yet been allocated preventing cancellation + - The current status of the order does not allow cancellation + - Default Error + - "" + type: string + example: null + limitType: + $ref: '#/components/schemas/cancelOrderLimitType' + limitTimes: + description: "The remaining cancellation quota for the merchant. A value\ + \ is only returned when the nearest remaining cancellation limit is approaching,\ + \ else it returns 0." + format: int64 + title: cancelOrderLimitTimes + type: integer + cancelReasons: + description: An array of cancel order reasons JSON objects. + items: + $ref: '#/components/schemas/CancelReason' + title: cancelReasons + type: array + title: CheckOrderCancelableResponse + type: object + CancelOrderRequest: + description: | + This request cancels an order on GrabFood. + example: + orderID: 123-CYNKLPCVRN5 + merchantID: 1-CYNGRUNGSBCCC + cancelCode: 0 + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + cancelCode: + $ref: '#/components/schemas/cancelCode' + required: + - cancelCode + - merchantID + - orderID + title: CancelOrderRequest + type: object + CancelOrderResponse: + description: "" + example: + limitTimes: 0 + limitType: not approaching limit + properties: + limitType: + $ref: '#/components/schemas/cancelOrderLimitType' + limitTimes: + description: "The remaining cancellation quota for the merchant. A value\ + \ is only returned when the nearest remaining cancellation limit is approaching,\ + \ else it returns 0." + format: int64 + title: cancelOrderLimitTimes + type: integer + title: CancelOrderResponse + type: object + PauseStoreRequest: + description: | + This request pauses a store temporarily for (30 minutes/1 hour/24 hours) or unpauses a store on GrabFood. + example: + duration: 30m + merchantID: 1-CYNGRUNGSBCCC + isPause: true + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + isPause: + description: Boolean value to pause or unpause store. + type: boolean + duration: + description: The duration to pause the store. Only required when `isPause=true`. + enum: + - 30m + - 1h + - 24h + type: string + required: + - isPause + - merchantID + title: PauseStoreRequest + type: object + ListCampaignResponse: + description: "" + example: + ongoing: + - quotas: + totalCountPerUser: 2 + totalCount: 10 + createdBy: Merchant + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + - quotas: + totalCountPerUser: 2 + totalCount: 10 + createdBy: Merchant + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + upcoming: + - quotas: + totalCountPerUser: 2 + totalCount: 10 + createdBy: Merchant + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + - quotas: + totalCountPerUser: 2 + totalCount: 10 + createdBy: Merchant + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + properties: + ongoing: + items: + $ref: '#/components/schemas/campaign' + type: array + upcoming: + items: + $ref: '#/components/schemas/campaign' + type: array + title: ListCampaignResponse + type: object + CreateCampaignRequest: + description: | + This request creates a campaign for your GrabFood store. + example: + quotas: + totalCountPerUser: 2 + totalCount: 10 + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + name: + description: The campaign's name. + example: $4 off with min $10 order for all users within weekday + title: name + type: string + quotas: + $ref: '#/components/schemas/campaignQuotas' + conditions: + $ref: '#/components/schemas/campaignConditions' + discount: + $ref: '#/components/schemas/campaignDiscount' + customTag: + description: Specify the tag for custom bundle offer campaign. Only whitelisted + partner is supported as of now. + example: "" + maxLength: 22 + title: customTag + type: string + required: + - conditions + - discount + - merchantID + - name + title: CreateCampaignRequest + type: object + CreateCampaignResponse: + description: "" + example: + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + properties: + id: + description: The campaign's ID. + example: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + title: id + type: string + title: CreateCampaignResponse + type: object + campaignId: + description: The campaign's ID. + example: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + title: id + type: string + UpdateCampaignRequest: + description: | + This request updates a campaign for your GrabFood store. + example: + quotas: + totalCountPerUser: 2 + totalCount: 10 + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + properties: + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + name: + description: The campaign's name. + example: $4 off with min $10 order for all users within weekday + title: name + type: string + quotas: + $ref: '#/components/schemas/campaignQuotas' + conditions: + $ref: '#/components/schemas/campaignConditions' + discount: + $ref: '#/components/schemas/campaignDiscount' + customTag: + description: Specify the tag for custom bundle offer campaign. Only whitelisted + partner is supported as of now. + example: "" + maxLength: 22 + title: customTag + type: string + title: CreateCampaignRequest + type: object + voucherCode: + description: A short code for the dine-in voucher purchased by the user. + example: GV-OQBJDKZH + maxLength: 11 + title: voucherCode + type: string + certificateID: + description: "This certificateID is decoded from scanning the QR code, and 1:1\ + \ mapping with `voucherCode`." + example: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + title: certificateID + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + GetDineInVoucherResponse: + description: "" + example: + voucherStatus: ACTIVE + merchantID: 1-CYNGRUNGSBCCC + voucher: + discountedPrice: S$1.00 + originalPrice: S$10.00 + voucherType: CASH + descriptionInfo: + text: Dine-in cash voucher for use in a transaction. + title: S$10.00 Dine-in Voucher + campaignID: 1-CYNGRUNGSBCCC-CZNZFFL1G8KKLX-94794295 + certificateID: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + voucherCode: GV-OQBJDKZH + properties: + certificateID: + description: "This certificateID is decoded from scanning the QR code, and\ + \ 1:1 mapping with `voucherCode`." + example: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + title: certificateID + type: string + voucherCode: + description: A short code for the dine-in voucher purchased by the user. + example: GV-OQBJDKZH + maxLength: 11 + title: voucherCode + type: string + voucher: + $ref: '#/components/schemas/voucher' + voucherStatus: + description: The status of the dine-in voucher purchased. Only active voucher + is eligible for redemption. + enum: + - ACTIVE + - REDEEMED + - EXPIRED + - REFUNDED + example: ACTIVE + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + campaignID: + description: The dine-in voucher campaign's ID in GrabFood's database. + example: 1-CYNGRUNGSBCCC-CZNZFFL1G8KKLX-94794295 + title: campaignID + type: string + title: GetDineInVoucherResponse + type: object + RedeemDineInVoucherRequest: + description: | + Dine in voucher redemption + example: + merchantID: 1-CYNGRUNGSBCCC + certificateID: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + properties: + certificateID: + description: "This certificateID is decoded from scanning the QR code, and\ + \ 1:1 mapping with `voucherCode`." + example: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + title: certificateID + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + required: + - certificateID + - merchantID + title: RedeemDineInVoucherRequest + type: object + RedeemDineInVoucherResponse: + description: "" + example: + merchantID: 1-CYNGRUNGSBCCC + voucher: + discountedPrice: S$1.00 + originalPrice: S$10.00 + voucherType: CASH + descriptionInfo: + text: Dine-in cash voucher for use in a transaction. + title: S$10.00 Dine-in Voucher + campaignID: 1-CYNGRUNGSBCCC-CZNZFFL1G8KKLX-94794295 + certificateID: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + voucherCode: GV-OQBJDKZH + redeemResult: + code: "" + success: true + properties: + certificateID: + description: "This certificateID is decoded from scanning the QR code, and\ + \ 1:1 mapping with `voucherCode`." + example: PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg== + title: certificateID + type: string + voucherCode: + description: A short code for the dine-in voucher purchased by the user. + example: GV-OQBJDKZH + maxLength: 11 + title: voucherCode + type: string + voucher: + $ref: '#/components/schemas/voucher' + redeemResult: + $ref: '#/components/schemas/redeemResult' + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + campaignID: + description: The dine-in voucher campaign's ID in GrabFood's database. + example: 1-CYNGRUNGSBCCC-CZNZFFL1G8KKLX-94794295 + title: campaignID + type: string + title: RedeemDineInVoucherResponse + type: object + NotifyMembershipWebviewRequest: + description: | + This request submits membership registration request to partner. + example: + grabID: b2abcd0b-69b0-3369-9603-68345a5f4f0a + merchantID: 1-CYNGRUNGSBCCC + action: LINK + memberID: A12345689 + properties: + memberID: + description: The unique member ID on the partner's database. + example: A12345689 + type: string + grabID: + description: The id used to identify an unique grab user. + example: b2abcd0b-69b0-3369-9603-68345a5f4f0a + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + type: string + action: + description: Action completed in partner's webview. + enum: + - LINK + - REGISTER + - UNLINK + example: LINK + type: string + title: Register Membership Request + type: object + order: + description: | + A JSON object containing the order information. + example: + scheduledTime: 2019-05-24T08:26:00Z + receiver: + address: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + name: Prashanth + phones: "60122234704" + orderID: 123-CYNKLPCVRN5 + partnerMerchantID: Partner-ABECU + cutlery: true + completeTime: 2019-05-24T05:26:00Z + membershipID: 12345678Z + paymentType: CASH + orderState: DELIVERED + shortOrderNumber: GF-123 + orderTime: 2019-05-24T05:06:00Z + submitTime: 2019-05-24T05:16:00Z + campaigns: + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + - level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + merchantID: 1-CYNGRUNGSBCCC + price: + deliveryFee: 400 + subtotal: 2550 + merchantChargeFee: 0 + grabFundPromo: 300 + basketPromo: 775 + tax: 117 + merchantFundPromo: 475 + eaterPayment: 2175 + orderReadyEstimation: + maxOrderReadyTime: 2019-05-24T05:16:00Z + newOrderReadyTime: 2019-05-24T05:26:00Z + estimatedOrderReadyTime: 2019-05-24T05:16:00Z + allowChange: true + currency: + symbol: S$ + code: SGD + exponent: 2 + items: + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + - quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + promos: + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + - promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + dineIn: + eaterCount: 2 + tableID: "1" + featureFlags: + orderType: DeliveredByGrab + orderAcceptedType: AUTO + isMexEditOrder: false + properties: + orderID: + description: "The order's ID that is returned from GrabFood. Refer to FAQs\ + \ for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: 123-CYNKLPCVRN5 + title: orderID + type: string + shortOrderNumber: + description: "The GrabFood short order number. This is unique for each merchant\ + \ per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber)." + example: GF-123 + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + paymentType: + description: "The payment method used. Refer to FAQs for more details about\ + \ [paymentType](#section/Order/Does-the-paymentType-affect-partners)." + enum: + - CASH + - CASHLESS + type: string + cutlery: + description: "The boolean value to indicate whether cutlery are needed or\ + \ not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery)." + type: boolean + orderTime: + description: "The UTC time that a consumer places the order, based on ISO_8601/RFC3339." + example: 2019-05-24T05:06:00Z + type: string + submitTime: + description: "The order submit time, based on ISO_8601/RFC3339. Only present\ + \ in the [List Orders](#tag/list-order) response." + example: 2019-05-24T05:16:00Z + format: date-time + type: string + completeTime: + description: "The order complete time, based on ISO_8601/RFC3339. Only present\ + \ in the [List Orders](#tag/list-order) response." + example: 2019-05-24T05:26:00Z + format: date-time + type: string + scheduledTime: + description: "The order scheduled time, based on ISO_8601/RFC3339. Empty\ + \ for non-scheduled orders." + example: 2019-05-24T08:26:00Z + type: string + orderState: + description: "The state of the order. Only present in the [List Orders](#tag/list-order)\ + \ response. Refer to [Order States](#section/Order-states)." + example: DELIVERED + type: string + currency: + $ref: '#/components/schemas/currency' + featureFlags: + $ref: '#/components/schemas/orderFeatureFlags' + items: + description: "The items in an array of JSON Object. Refer to [Items](#items)\ + \ for more information." + items: + $ref: '#/components/schemas/OrderItem' + title: orderItems + type: array + campaigns: + description: | + The campaigns that are applicable for the order.`null` when there is no campaign applied. + items: + $ref: '#/components/schemas/OrderCampaign' + nullable: true + title: campaigns + type: array + promos: + description: An array of promotion objects. Only promotions that are funded + by merchants will be sent. + items: + $ref: '#/components/schemas/OrderPromo' + title: promos + type: array + price: + $ref: '#/components/schemas/orderPrice' + dineIn: + $ref: '#/components/schemas/dineIn' + receiver: + $ref: '#/components/schemas/receiver' + orderReadyEstimation: + $ref: '#/components/schemas/orderReadyEstimation' + membershipID: + description: Membership ID for loyalty project. Only present for loyalty + program partners. + example: 12345678Z + type: string + required: + - currency + - cutlery + - featureFlags + - items + - merchantID + - orderID + - orderTime + - paymentType + - price + - shortOrderNumber + title: Order + type: object + specialOpeningHour: + example: + metadata: + description: New Year Opening Hours + endDate: 2024-02-04 + openingHours: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + startDate: 2024-02-01 + properties: + startDate: + description: The start date of store special opening hours. + example: 2024-02-01 + type: string + endDate: + description: The end date of store special opening hours. + example: 2024-02-04 + type: string + metadata: + $ref: '#/components/schemas/specialOpeningHour_metadata' + openingHours: + $ref: '#/components/schemas/specialOpeningHour_openingHours' + type: object + storeHour: + description: A JSON object that describes the store hour for each day. + example: + thu: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + mon: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + tue: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + wed: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + thu: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + fri: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + sat: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + sun: + description: An array of open periods. Maximum of 3 periods. Blank indicates + store close. + items: + $ref: '#/components/schemas/openPeriod' + type: array + required: + - fri + - mon + - sat + - sun + - thu + - tue + - wed + title: storeHour + type: object + menuSyncFail: + example: + serviceHours: + errors: + - error 1 + - error 1 + id: section_externalID1 + categories: + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + - id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + errors: + - error 1 + - error 1 + properties: + id: + example: section_externalID1 + type: string + errors: + description: An array of strings of error message. + items: + example: error 1 + type: string + type: array + serviceHours: + $ref: '#/components/schemas/menuSyncFail_serviceHours' + categories: + items: + $ref: '#/components/schemas/MenuSyncFailCategory' + type: array + type: object + cancelOrderLimitType: + description: The type of the order cancellation limit. + enum: + - not approaching limit + - approaching the daily limit + - approaching the weekly limit + - approaching the monthly limit + - "" + title: cancelOrderLimitType + type: string + cancelOrderLimitTimes: + description: "The remaining cancellation quota for the merchant. A value is\ + \ only returned when the nearest remaining cancellation limit is approaching,\ + \ else it returns 0." + format: int64 + title: cancelOrderLimitTimes + type: integer + cancelReasons: + description: An array of cancel order reasons JSON objects. + items: + $ref: '#/components/schemas/CancelReason' + title: cancelReasons + type: array + cancelCode: + description: The cancel code for a specific cancel reason. + enum: + - 1001 + - 1002 + - 1003 + - 1004 + title: cancelCode + type: integer + campaign: + description: A JSON object containing the campaign details for a merchant. Only + campaigns that are funded by merchants will be sent. + example: + quotas: + totalCountPerUser: 2 + totalCount: 10 + createdBy: Merchant + merchantID: 1-CYNGRUNGSBCCC + customTag: "" + name: $4 off with min $10 order for all users within weekday + discount: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + id: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + conditions: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + properties: + id: + description: The campaign's ID. + example: 4-CY4VMFMANYBYJ6-CZNZFFL1G8KKLX-94794295 + title: id + type: string + createdBy: + description: "The party who created the campaign. Can be created by partners\ + \ via API, merchants via the merchant app or Grab." + enum: + - Grab + - Merchant + - Partner + example: Merchant + type: string + merchantID: + description: The merchant's ID that is in GrabFood's database. + example: 1-CYNGRUNGSBCCC + title: merchantID + type: string + name: + description: The campaign's name. + example: $4 off with min $10 order for all users within weekday + title: name + type: string + quotas: + $ref: '#/components/schemas/campaignQuotas' + conditions: + $ref: '#/components/schemas/campaignConditions' + discount: + $ref: '#/components/schemas/campaignDiscount' + customTag: + description: Specify the tag for custom bundle offer campaign. Only whitelisted + partner is supported as of now. + example: "" + maxLength: 22 + title: customTag + type: string + required: + - createdBy + - id + - merchantID + - name + title: campaign + type: object + campaignName: + description: The campaign's name. + example: $4 off with min $10 order for all users within weekday + title: name + type: string + campaignQuotas: + description: The quotas/limits for a particular campaign. + example: + totalCountPerUser: 2 + totalCount: 10 + properties: + totalCount: + description: | + The maximum number of redemptions. Default is unlimited if unspecified. + example: 10 + format: int64 + type: integer + totalCountPerUser: + description: The maximum number of redemptions per user. Default is unlimited + if unspecified. + example: 2 + format: int64 + type: integer + title: campaignQuotas + type: object + campaignConditions: + description: The conditions to apply to a campaign. + example: + eaterType: all + minBasketAmount: 10 + startTime: 2021-09-23T03:30:00Z + workingHour: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + endTime: 2021-09-23T06:00:00Z + bundleQuantity: 0 + properties: + startTime: + description: "The campaign's start time in UTC format. For example, 2021-09-23T03:30:00Z\ + \ means 2021-09-23 11:30:00 (UTC +08:00)." + example: 2021-09-23T03:30:00Z + format: date-time + type: string + endTime: + description: The campaign's end time in UTC format. + example: 2021-09-23T06:00:00Z + format: date-time + type: string + eaterType: + description: "The type of eater eligible for the campaign. \n* `all` - campaign\ + \ will be applied to everyone. No limitation on campaign type.\n* `new`\ + \ - campaign will be applied to consumers who have not ordered from this\ + \ store in the last three months. Only applicable to **order-level** campaign.\n" + enum: + - all + - new + type: string + minBasketAmount: + description: "The minimum basket amount to be eligible for the campaign.\ + \ Only applicable for **order-level** campaign. For example, 10.5 means\ + \ the basket amount has to be at least $10.50." + example: 10 + format: double + type: number + bundleQuantity: + description: Specify the bundle quantity for bundle offer campaign. + example: 0 + type: integer + workingHour: + $ref: '#/components/schemas/workingHour' + required: + - eaterType + - endTime + - startTime + title: campaignConditions + type: object + campaignDiscount: + description: The discount detail for a particular campaign when conditions are + satisfied. + example: + cap: 5 + scope: + type: items + objectIDs: + - + - + type: percentage + value: 10 + properties: + type: + description: | + The type of discount + enum: + - net + - percentage + - delivery + - freeItem + - bundleSameNet + - bundleSamePercentage + - bundleSameFixPrice + - bundleDiffNet + - bundleDiffPercentage + - bundleDiffFixPrice + example: percentage + type: string + cap: + description: | + The maximum discount dollar amount. It is **not required** and will be ignored when the `discount.type` is: + - `net` + - `delivery` + - `freeItem` + - `bundleSameNet` + - `bundleSamePercentage` + - `bundleSameFixPrice` + - `bundleDiffNet` + - `bundleDiffPercentage` + - `bundleDiffFixPrice` + example: 5 + format: double + type: number + value: + description: | + Specify the discount amount. Decimal number is not supported For VN, ID and TH. For example, `10.5` is not allowed and it should be `10.0`. + * Dollar amount value when `discount.type` is `net`, `delivery`, `bundleSameNet`, `bundleSameFixPrice`, `bundleDiffNet`, `bundleDiffFixPrice`. + * Percentage value (0-100) when `discount.type` is `percentage`, `bundleSamePercentage`, `bundleDiffPercentage`. + * **Not required** when `discount.type` is `freeItem`. + example: 10 + format: double + type: number + scope: + $ref: '#/components/schemas/campaignScope' + required: + - scope + - type + title: campaignDiscount + type: object + customTag: + description: Specify the tag for custom bundle offer campaign. Only whitelisted + partner is supported as of now. + example: "" + maxLength: 22 + title: customTag + type: string + voucher: + description: A JSON object containing dine-in voucher details. + example: + discountedPrice: S$1.00 + originalPrice: S$10.00 + voucherType: CASH + descriptionInfo: + text: Dine-in cash voucher for use in a transaction. + title: S$10.00 Dine-in Voucher + properties: + title: + description: The title of the voucher. + example: S$10.00 Dine-in Voucher + type: string + discountedPrice: + description: The amount paid after discount is applied in local currency. + example: S$1.00 + type: string + originalPrice: + description: The original amount before discount is applied in local currency. + example: S$10.00 + type: string + descriptionInfo: + $ref: '#/components/schemas/voucher_descriptionInfo' + voucherType: + description: The type of the dine-in voucher. + enum: + - CASH + - ITEM + type: string + title: voucher + type: object + dineInVoucher_campaignID: + description: The dine-in voucher campaign's ID in GrabFood's database. + example: 1-CYNGRUNGSBCCC-CZNZFFL1G8KKLX-94794295 + title: campaignID + type: string + redeemResult: + description: A JSON object containing dine-in voucher details. + example: + code: "" + success: true + properties: + success: + description: To indicate whether the dine-in voucher redemption succeeded. + example: true + type: boolean + code: + description: | + The code for the reason of failed redemption. Empty if the `success` is true. + + * `VOUCHER_REDEEMED` - The voucher has already been redeemed. + * `INVALID_STATE` - The current status of voucher is EXPIRED or REFUNDED. + * `REDEEM_FAILED` - Internal service error. + * `INVALID_MERCHANT` - Voucher not applicable for this merchant. + * `INVALID_ID` - Invalid certificateID. + enum: + - VOUCHER_REDEEMED + - INVALID_STATE + - REDEEM_FAILED + - INVALID_MERCHANT + - INVALID_ID + - "" + example: "" + type: string + title: voucher + type: object + partnerMerchantID: + description: The merchant's ID that is on the partner's database. + example: Partner-ABECU + title: partnerMerchantID + type: string + currency: + description: "A JSON object containing code, symbol, and exponent for a given\ + \ currency. Refer to [Country and Currency](#section/Getting-started/Country-and-currency)." + example: + symbol: S$ + code: SGD + exponent: 2 + properties: + code: + description: | + The three-letter ISO currency code. This is the currency that is associated with the payment amount. + enum: + - IDR + - MYR + - PHP + - SGD + - THB + - VND + example: SGD + maxLength: 3 + type: string + symbol: + description: | + The currency symbol. + enum: + - Rp + - RM + - ₱ + - S$ + - ฿ + - ₫ + example: S$ + maxLength: 3 + type: string + exponent: + description: | + The log base 10 of the number of times we have to multiply the major unit to get the minor unit. Should be 0 for VN and 2 for other countries (SG/MY/ID/TH/PH/KH). + example: 2 + type: integer + required: + - code + - exponent + - symbol + title: currency + type: object + sellingTimes: + description: "An array of sellingTimes JSON objects. Max 20 allowed. Refer to\ + \ [Selling Times](#selling-times) for more information." + items: + $ref: '#/components/schemas/SellingTime' + required: + - endTime + - id + - name + - serviceHours + - startTime + title: sellingTimes + type: array + categories: + description: "An array of category JSON objects. Max 100 allowed per section.\ + \ Refer to [Categories](#categories) for more information." + items: + $ref: '#/components/schemas/MenuCategory' + title: categories + type: array + sections: + description: "An array of section JSON objects. Max 7 allowed. Refer to [Sections](#sections)\ + \ for more information." + items: + $ref: '#/components/schemas/MenuSection' + title: sections + type: array + orderFeatureFlags: + description: The featureFlag JSON object containing an order's feature related + information. + example: + orderType: DeliveredByGrab + orderAcceptedType: AUTO + isMexEditOrder: false + properties: + orderAcceptedType: + description: | + The acceptance type for the order. Refer to FAQs for more details about [orderAcceptedType](#section/Order/How-do-I-identify-if-a-particular-order-is-auto-or-manual-acceptance). + enum: + - AUTO + - MANUAL + type: string + orderType: + description: | + The type of order. + enum: + - TakeAway + - DeliveredByGrab + - DeliveredByRestaurant + - DineIn + example: DeliveredByGrab + type: string + isMexEditOrder: + description: | + A boolean value that indicates if the order is edited. + example: false + type: boolean + required: + - orderAcceptedType + - orderType + title: orderFeatureFlags + type: object + orderItems: + description: "The items in an array of JSON Object. Refer to [Items](#items)\ + \ for more information." + items: + $ref: '#/components/schemas/OrderItem' + title: orderItems + type: array + orderCampaigns: + description: | + The campaigns that are applicable for the order.`null` when there is no campaign applied. + items: + $ref: '#/components/schemas/OrderCampaign' + nullable: true + title: campaigns + type: array + promos: + description: An array of promotion objects. Only promotions that are funded + by merchants will be sent. + items: + $ref: '#/components/schemas/OrderPromo' + title: promos + type: array + orderPrice: + description: A JSON object containing order's price in the minor unit format. + example: + deliveryFee: 400 + subtotal: 2550 + merchantChargeFee: 0 + grabFundPromo: 300 + basketPromo: 775 + tax: 117 + merchantFundPromo: 475 + eaterPayment: 2175 + properties: + subtotal: + description: Total item and modifier price (tax-inclusive) in the minor + unit. `Sum of all (Item price * quantity) | 2550*1=2550`. + example: 2550 + format: int64 + type: integer + tax: + description: "GrabFood's tax in the minor unit. `(subtotal-merchantFundPromo)*\ + \ Tax /(1+Tax) | (2550-475)*0.06/1.06=117`. Refer to FAQs for more details\ + \ about [tax](#section/Order/How-is-tax-calculated)." + example: 117 + format: int64 + type: integer + merchantChargeFee: + description: "Any additional fee charged by merchant, which is 100% paid\ + \ out to the merchant. Eg. Takeaway, packaging costs, dine-in charge." + example: 0 + format: int64 + type: integer + grabFundPromo: + description: GrabFood's promo fund in the minor unit. Calculated based on + funded ratio. + example: 300 + format: int64 + type: integer + merchantFundPromo: + description: The merchant's promo fund in the minor unit. Calculated based + on funded ratio. + example: 475 + format: int64 + type: integer + basketPromo: + description: | + The total amount promo applied to the basket items only (item level/order level) in the minor unit. Delivery fee is excluded. `(grabFundPromo + merchantFundPromo) | 300 + 475 = 775` + example: 775 + format: int64 + type: integer + deliveryFee: + description: The delivery fee in the minor unit. + example: 400 + format: int64 + type: integer + eaterPayment: + description: The total amount consumer paid in the minor unit. `(subtotal + + deliveryFee) - (sum of all promo) | (2550+400)-775=2175` + example: 2175 + format: int64 + type: integer + required: + - eaterPayment + - subtotal + title: price + type: object + dineIn: + description: "A JSON object containing order at table information. Present only\ + \ for dineIn order. **Not available** in [ListOrder](#tag/list-order/operation/list-orders)\ + \ response." + example: + eaterCount: 2 + tableID: "1" + properties: + tableID: + description: Table number. + example: "1" + type: string + eaterCount: + description: The number of eaters. + example: 2 + format: int64 + type: integer + title: dineIn + type: object + receiver: + description: A JSON object containing the receiver information. Currently only + for orders that are delivered by the restaurant. + example: + address: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + name: Prashanth + phones: "60122234704" + properties: + name: + description: The name of the receiver. + example: Prashanth + maxLength: 64 + type: string + phones: + description: The receiver's phone number. + example: "60122234704" + type: string + address: + $ref: '#/components/schemas/address' + title: receiver + type: object + orderReadyEstimation: + description: Information related to the order ready time estimation. + example: + maxOrderReadyTime: 2019-05-24T05:16:00Z + newOrderReadyTime: 2019-05-24T05:26:00Z + estimatedOrderReadyTime: 2019-05-24T05:16:00Z + allowChange: true + properties: + allowChange: + description: A boolean value indicating if the order ready time can be changed. + example: true + type: boolean + estimatedOrderReadyTime: + description: "The order ready time for this order estimated by GrabFood,\ + \ based on ISO_8601/RFC3339." + example: 2019-05-24T05:16:00Z + format: date-time + type: string + maxOrderReadyTime: + description: "The max allowed order ready time for this order, based on\ + \ ISO_8601/RFC3339." + example: 2019-05-24T05:16:00Z + format: date-time + type: string + newOrderReadyTime: + description: "The new order ready time for this order. Only present after\ + \ a new order ready time is set (default will be null), based on ISO_8601/RFC3339." + example: 2019-05-24T05:26:00Z + format: date-time + nullable: true + type: string + required: + - allowChange + - estimatedOrderReadyTime + - maxOrderReadyTime + title: orderReadyEstimation + type: object + openPeriod: + example: + startTime: 11:30 + endTime: 21:30 + properties: + startTime: + description: The open start time in 24h format. + example: 11:30 + type: string + endTime: + description: The open start time in 24h format. + example: 21:30 + type: string + required: + - endTime + - startTime + type: object + workingHour: + description: A JSON object that describes the workingHour for each day. + example: + thu: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + tue: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + wed: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sat: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + fri: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + sun: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + mon: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + sun: + $ref: '#/components/schemas/workingHourDay' + mon: + $ref: '#/components/schemas/workingHourDay' + tue: + $ref: '#/components/schemas/workingHourDay' + wed: + $ref: '#/components/schemas/workingHourDay' + thu: + $ref: '#/components/schemas/workingHourDay' + fri: + $ref: '#/components/schemas/workingHourDay' + sat: + $ref: '#/components/schemas/workingHourDay' + title: workingHour + type: object + campaignScope: + description: The scope level for a particular campaign. + example: + type: items + objectIDs: + - + - + properties: + type: + description: "The scope type for this campaign. \n* `order` - order level\ + \ campaign.\n* `items` - item level campaign or bundle offer. \n* `category`\ + \ - category level campaign where all items within applies the same discount.\n" + enum: + - order + - items + - category + example: items + type: string + objectIDs: + description: | + The list of item IDs in the partner's database applicable for discount when `discount.scope.type` is `items` (or category IDs for `category`). + + One and only 1 item supported when `discount.type` is: + - `freeItem` + - `bundleSameNet` + - `bundleSamePercentage` + - `bundleSameFixPrice` + + Minimum 2 - Maximum 20 items supported when `discount.type` is: + - `bundleDiffNet` + - `bundleDiffPercentage` + - `bundleDiffFixPrice` + items: + example: + type: string + type: array + required: + - type + title: campaignScope + type: object + serviceHours: + description: A JSON object with serviceHours for each day of the week. + properties: + mon: + $ref: '#/components/schemas/serviceHour' + tue: + $ref: '#/components/schemas/serviceHour' + wed: + $ref: '#/components/schemas/serviceHour' + thu: + $ref: '#/components/schemas/serviceHour' + fri: + $ref: '#/components/schemas/serviceHour' + sat: + $ref: '#/components/schemas/serviceHour' + sun: + $ref: '#/components/schemas/serviceHour' + required: + - fri + - mon + - sat + - sun + - thu + - tue + - wed + title: serviceHours + type: object + menuTranslation: + description: | + The translated name or description. The property key represents the language code (e.g., `en`, `th`, `ms`, `zh`, `vi`, `id`, `km`, `my`), and the value is the translated text. \ + Example: { "en": "english translation" } + example: translation + type: string + menuItems: + description: "An array of item JSON objects. Max 300 allowed per category. Refer\ + \ to [Items](#items) for more information." + items: + $ref: '#/components/schemas/MenuItem' + title: menuItems + type: array + advancedPricing: + description: | + Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. Refer [Service Based Menu](#section/Service-Based-Menu). + properties: + Delivery_OnDemand_GrabApp: + description: | + Service type: `Delivery`, Order type: `Instant`, Channel: `Grab App` + example: 30 + format: int64 + type: integer + Delivery_Scheduled_GrabApp: + description: | + Service type: `Delivery`, Order type: `Scheduled`, Channel: `Grab App` + example: 25 + format: int64 + type: integer + SelfPickUp_OnDemand_GrabApp: + description: | + Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Grab App` + example: 25 + format: int64 + type: integer + DineIn_OnDemand_GrabApp: + description: | + Service type: `Dine In`, Order type: `Instant`, Channel: `Grab App` + example: 25 + format: int64 + type: integer + Delivery_OnDemand_StoreFront: + description: | + Service type: `Delivery`, Order type: `Instant`, Channel: `Store Front` + example: 25 + format: int64 + type: integer + Delivery_Scheduled_StoreFront: + description: | + Service type: `Delivery`, Order type: `Scheduled`, Channel: `Store Front` + example: 25 + format: int64 + type: integer + SelfPickUp_OnDemand_StoreFront: + description: | + Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Store Front` + example: 25 + format: int64 + type: integer + title: advancedPricing + type: object + purchasability: + description: | + Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. Refer [Service Based Menu](#section/Service-Based-Menu). + properties: + Delivery_OnDemand_GrabApp: + type: boolean + Delivery_Scheduled_GrabApp: + type: boolean + SelfPickUp_OnDemand_GrabApp: + type: boolean + DineIn_OnDemand_GrabApp: + type: boolean + Delivery_OnDemand_StoreFront: + type: boolean + Delivery_Scheduled_StoreFront: + type: boolean + SelfPickUp_OnDemand_StoreFront: + type: boolean + type: object + modifierGroups: + description: "An array of the modifierGroup JSON objects. Max 30 allowed per\ + \ item. Refer to [Modifier groups](#modifier-groups) for more information." + items: + $ref: '#/components/schemas/ModifierGroup' + title: modifierGroups + type: array + outOfStockInstruction: + description: An JSON object that indicates the instructions to be taken by the + merchant when the item is out of stock. + example: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + nullable: true + properties: + title: + description: The short instruction message. + example: Replace item + type: string + instructionType: + description: "Type of out-of-stock instruction chosen by customer. `CONTACT`\ + \ is disabled by default, kindly reach out to your integration manager\ + \ if you wish to receive this instruction." + enum: + - REMOVE + - CANCEL + - SPECIFIC_ITEM + - CONTACT + example: SPECIFIC_ITEM + type: string + replacementItemID: + description: The preferred item's ID in the partner system. Only applicable + when the instructionType is `SPECIFIC_ITEM`. + example: ITEM-2 + type: string + replacementGrabItemID: + description: The preferred item's ID in the Grab system. Only applicable + when the instructionType is `SPECIFIC_ITEM`. + example: IDGFSTI000004qy1490868132303452210 + type: string + title: outOfStockInstruction + type: object + orderModifiers: + description: "An array of JSON objects modifiers. Read [this](#categories) for\ + \ more information." + items: + $ref: '#/components/schemas/OrderItemModifier' + required: + - id + - price + - quantity + - tax + title: modifiers + type: array + orderFreeItem: + description: Free item information for `freeItem` campaign. + example: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + properties: + id: + description: The item's ID + example: item-2 + type: string + name: + description: | + The name of the item. + example: Free tote bag + type: string + quantity: + description: The item's quantity. Maximum is **1**. + example: 1 + type: integer + price: + description: The item's price in minor unit format. + example: 10 + format: int64 + type: integer + title: orderFreeItem + type: object + address: + description: A JSON object containing the receiver’s location information. + example: + poiSource: GRAB + address: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + postcode: "123456" + coordinates: + latitude: 1.234567 + longitude: 3.456789 + unitNumber: 3-45 + deliveryInstruction: turn left in 2 floor. + poiID: poiID + properties: + unitNumber: + description: The delivery address' unit number. + example: 3-45 + type: string + deliveryInstruction: + description: Instructions for the delivery. + example: turn left in 2 floor. + type: string + poiSource: + description: POI source + enum: + - GRAB + - GOOGLE + type: string + poiID: + description: "POI ID, empty when poiSource is GRAB." + type: string + address: + description: "The delivery address containing street name, city, postal\ + \ code, and country. Has value only when poiSource is `GRAB`." + example: "123, Jalan Eater street, Batu Caves, 12345, Selangor" + type: string + postcode: + description: The postcode of the delivery address. Has value only when poiSource + is `GRAB`. + example: "123456" + type: string + coordinates: + $ref: '#/components/schemas/coordinates' + title: address + type: object + workingHourDay: + description: A JSON object for workingHour for a day. + example: + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + periods: + description: "An array of open periods. `null` in [ListCampaign](#tag/list-campaign)\ + \ response if the campaign is available all day." + items: + $ref: '#/components/schemas/openPeriod' + nullable: true + title: periods + type: array + type: object + serviceHour: + description: A JSON object serviceHour for each day. + properties: + openPeriodType: + description: | + The period type for when the outlet is open. + - OpenPeriod = open only in given periods + - OpenAllDay = open 24 hours + - CloseAllDay = closed 24 hours + enum: + - OpenPeriod + - OpenAllDay + - CloseAllDay + example: OpenPeriod + type: string + periods: + description: An array of open periods. Only required when `openPeriodType` + is **OpenPeriod** + items: + $ref: '#/components/schemas/openPeriod' + required: + - endTime + - startTime + title: periods + type: array + required: + - openPeriodType + title: serviceHour + type: object + menuModifiers: + description: "An array of modifier JSON objects. Max 100 per modifierGroup.\ + \ Refer to [Modifiers](#modifiers) for more information." + items: + $ref: '#/components/schemas/MenuModifier' + title: modifiers + type: array + coordinates: + description: A JSON object containing the coordinates of the delivery address. + Only has value when poiSource is `GRAB`. + example: + latitude: 1.234567 + longitude: 3.456789 + properties: + latitude: + description: The latitude coordinates of the delivery address. + example: 1.234567 + format: double + type: number + longitude: + description: The longitude coordinates of the delivery address. + example: 3.456789 + format: double + type: number + title: coordinates + type: object + campaignPeriods: + description: "An array of open periods. `null` in [ListCampaign](#tag/list-campaign)\ + \ response if the campaign is available all day." + items: + $ref: '#/components/schemas/openPeriod' + nullable: true + title: periods + type: array + periods: + description: An array of open periods. Only required when `openPeriodType` is + **OpenPeriod** + items: + $ref: '#/components/schemas/openPeriod' + required: + - endTime + - startTime + title: periods + type: array + update_menu_request: + oneOf: + - $ref: '#/components/schemas/UpdateMenuItem' + - $ref: '#/components/schemas/UpdateMenuModifier' + GetMembershipNativeResponse_pointInfo: + description: Obtain contains user's point details. + properties: + currentPoints: + description: Point that user currently obtained. + example: 200 + format: int64 + type: integer + maxPoints: + description: Maximum point that user can obtain. + example: 5000 + format: int64 + type: integer + expirePoints: + description: Points that would get expired in future. + example: 20 + format: int64 + type: integer + type: object + RewardItem: + properties: + itemID: + description: The item's ID in partner system. + example: item-1 + type: string + quantity: + description: The item's quantity. + example: 1 + type: integer + title: RewardItem + type: object + UpdateAdvancedPricing: + example: + price: 100 + key: Delivery_OnDemand_GrabApp + properties: + key: + description: Available service type. + enum: + - Delivery_OnDemand_GrabApp + - Delivery_Scheduled_GrabApp + - SelfPickUp_OnDemand_GrabApp + - DineIn_OnDemand_GrabApp + - Delivery_OnDemand_StoreFront + - Delivery_Scheduled_StoreFront + - SelfPickUp_OnDemand_StoreFront + example: Delivery_OnDemand_GrabApp + type: string + price: + description: Price in minor unit. + example: 100 + format: int64 + type: integer + title: UpdateAdvancedPricing + type: object + UpdatePurchasability: + example: + purchasable: true + key: Delivery_OnDemand_GrabApp + properties: + key: + description: Available service type. + enum: + - Delivery_OnDemand_GrabApp + - Delivery_Scheduled_GrabApp + - SelfPickUp_OnDemand_GrabApp + - DineIn_OnDemand_GrabApp + - Delivery_OnDemand_StoreFront + - Delivery_Scheduled_StoreFront + - SelfPickUp_OnDemand_StoreFront + example: Delivery_OnDemand_GrabApp + type: string + purchasable: + type: boolean + title: UpdatePurchasability + type: object + MenuEntity: + example: + availableStatus: AVAILABLE + advancedPricings: + - price: 100 + key: Delivery_OnDemand_GrabApp + - price: 100 + key: Delivery_OnDemand_GrabApp + purchasabilities: + - purchasable: true + key: Delivery_OnDemand_GrabApp + - purchasable: true + key: Delivery_OnDemand_GrabApp + price: 200 + maxStock: 10 + id: ITEM-1 + properties: + id: + description: "The record's ID on the partner system. For example, the item\ + \ id in case type is ITEM, modifier id is MODIFIER." + example: ITEM-1 + type: string + price: + description: The record's price in minor unit format. + example: 200 + format: int64 + type: integer + availableStatus: + description: | + The record's availableStatus. + + Note: In order to set an item as "UNAVAILABLE", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + enum: + - AVAILABLE + - UNAVAILABLE + - UNAVAILABLETODAY + type: string + maxStock: + description: | + Available stocks under inventory for this item. Auto reduce when there is order placed for this item. + + Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is "UNAVAILABLE". Item will be set to "AVAILABLE" if `maxStock` > 0. + example: 10 + format: int64 + type: integer + advancedPricings: + description: | + Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + items: + $ref: '#/components/schemas/UpdateAdvancedPricing' + type: array + purchasabilities: + description: | + Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. + items: + $ref: '#/components/schemas/UpdatePurchasability' + type: array + title: MenuEntity + type: object + MenuEntityError: + example: + errMsg: get food item fail + entityID: ITEM-1 + properties: + entityID: + description: The itemID. + example: ITEM-1 + type: string + errMsg: + description: The error message. + example: get food item fail + type: string + title: MenuEntityError + type: object + EditOrderItem: + example: + isExternalItemID: false + itemID: IDGFSTI000004qy1490868132306763533 + quantity: 1 + status: UPDATED + properties: + itemID: + description: "The item's ID in Grab system that can be obtained from the\ + \ [Submit Order Webhook](#tag/submit-order-webhook/operation/submit-order-webhook)\ + \ request payload parameters under `items[].grabItemID`, or `items[].outOfStockInstruction.replacementGrabItemID`\ + \ for item replacement. External item ID from Partner system is only supported\ + \ when `ADDED` status and `isExternalItemID: true`." + example: IDGFSTI000004qy1490868132306763533 + type: string + status: + description: The item's edited status. Leave empty string if there is no + change to the item. + enum: + - DELETED + - UPDATED + - ADDED + - "" + example: UPDATED + type: string + quantity: + description: "The item's quantity. If the item is not being updated or deleted,\ + \ use the original quantity." + example: 1 + format: int64 + type: integer + isExternalItemID: + description: "Only applicable for `ADDED`status. Indicate if the `itemID`\ + \ is an external item ID. Grab checks for the items that are mapped to\ + \ the provided item ID, considering their availability. If multiple Grab\ + \ items are found to be mapped to the provided external item ID, the last\ + \ updated item will be chosen. If no suitable record is found, an 400\ + \ error will be returned to the partner, indicating that the submitted\ + \ external item ID cannot be edited." + example: false + type: boolean + required: + - itemID + - status + title: EditOrderItem + type: object + specialOpeningHour_metadata: + description: Contains special opening hour info. + example: + description: New Year Opening Hours + properties: + description: + description: Description of the special opening hour. + example: New Year Opening Hours + type: string + type: object + specialOpeningHour_openingHours: + description: Store special opening hour period. + example: + openPeriodType: Period + periods: + - startTime: 11:30 + endTime: 21:30 + - startTime: 11:30 + endTime: 21:30 + properties: + openPeriodType: + description: The period type for when the outlet is open. + enum: + - Period + - OpenAllDay + - ClosedAllDay + example: Period + type: string + periods: + description: An array of open periods. Maximum of 3 periods. + items: + $ref: '#/components/schemas/openPeriod' + type: array + type: object + menuSyncFail_serviceHours: + example: + errors: + - error 1 + - error 1 + properties: + errors: + description: An array of strings of error message. + items: + example: error 1 + type: string + type: array + type: object + MenuSyncFailModifier: + example: + id: modifier_externalID1 + errors: + - error 1 + - error 1 + properties: + id: + example: modifier_externalID1 + type: string + errors: + description: An array of strings of error message. + items: + example: error 1 + type: string + type: array + title: MenuSyncFailModifier + type: object + MenuSyncFailModifierGroup: + example: + id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + properties: + id: + example: modifierGroup_externalID1 + type: string + errors: + description: An array of strings of error message. + items: + example: error 2 + type: string + type: array + modifiers: + items: + $ref: '#/components/schemas/MenuSyncFailModifier' + type: array + title: MenuSyncFailModifierGroup + type: object + MenuSyncFailItem: + example: + id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + properties: + id: + description: | + The item's ID in the partner system. + example: item_externalID1 + maxLength: 64 + type: string + errors: + description: An array of strings of error message. + items: + example: error 1 + type: string + type: array + modifierGroups: + items: + $ref: '#/components/schemas/MenuSyncFailModifierGroup' + type: array + title: MenuSyncFailItem + type: object + MenuSyncFailCategory: + example: + id: category_externalID1 + items: + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: item_externalID1 + errors: + - error 1 + - error 1 + modifierGroups: + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + - id: modifierGroup_externalID1 + modifiers: + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + - id: modifier_externalID1 + errors: + - error 1 + - error 1 + errors: + - error 2 + - error 2 + errors: + - error 2 + - error 2 + properties: + id: + description: The category's ID that is on the partner system. This ID should + be unique with a min length of 1 and max of 64. + example: category_externalID1 + maxLength: 64 + type: string + errors: + description: An array of strings of error message. + items: + example: error 2 + type: string + type: array + items: + description: "An array of item JSON objects. Max 300 allowed per category.\ + \ Refer to [Items](#items) for more information." + items: + $ref: '#/components/schemas/MenuSyncFailItem' + title: syncFailCategoryItems + type: array + title: MenuSyncFailCategory + type: object + CancelReason: + example: + reason: Items are unavailable + code: 6 + properties: + code: + $ref: '#/components/schemas/cancelCode' + reason: + description: | + The detailed cancel reason for the specific cancel code. + - Items are unavailable + - I have too many orders now + - My shop is closed + - My shop is closing soon + example: Items are unavailable + type: string + title: CancelReason + type: object + voucher_descriptionInfo: + description: A JSON object containing dine-in voucher's description information. + example: + text: Dine-in cash voucher for use in a transaction. + properties: + text: + description: The description of the dine-in voucher. + example: Dine-in cash voucher for use in a transaction. + type: string + type: object + SellingTime: + properties: + startTime: + description: | + The selling time group start time in date & time format. + example: 2022-03-01 10:00:00 + type: string + endTime: + description: | + The selling time group end time in date & time format. + example: 2025-01-21 22:00:00 + type: string + id: + description: | + The selling time's ID on the partner system. This ID should be unique with length min 1 and max 64. + example: partner-sellingTimeID-1 + maxLength: 64 + type: string + name: + description: | + The name of the selling time. + example: Lunch deal + type: string + serviceHours: + $ref: '#/components/schemas/serviceHours' + title: SellingTime + type: object + MenuCategory: + properties: + id: + description: The category's ID that is on the partner system. This ID should + be unique with a min length of 1 and max of 64. + example: category_id + maxLength: 64 + type: string + name: + description: The name of the category. + example: Value set + maxLength: 60 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the category name. Only support up to 1 translated\ + \ language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: "The status for the category. Refer to FAQs for more details\ + \ about [availableStatus](#section/Menu/What-is-availableStatus)." + enum: + - AVAILABLE + - UNAVAILABLE + - HIDE + type: string + sellingTimeID: + description: The selling time's ID for the category. All items within the + category will apply the same selling time unless there is another selling + time specified for the item. + example: partner-sellingTimeID-1 + type: string + items: + description: "An array of item JSON objects. Max 300 allowed per category.\ + \ Refer to [Items](#items) for more information." + items: + $ref: '#/components/schemas/MenuItem' + title: menuItems + type: array + required: + - availableStatus + - id + - items + - name + - sellingTimeID + title: MenuCategory + type: object + MenuSectionCategoryItem: + properties: + id: + description: | + The item's ID in the partner system. + example: item_id + maxLength: 64 + type: string + name: + description: The name of the item. + example: Crispy burger with smoked salmon + maxLength: 80 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the item name. Only support up to 1 translated\ + \ language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: | + The status for the item that is in the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). + + Note: In order to set an item as "UNAVAILABLE", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + enum: + - AVAILABLE + - UNAVAILABLE + - HIDE + - UNAVAILABLETODAY + type: string + description: + description: | + The description of the item. There is a custom length limit of 2000 for `VN`. + example: "Crispy burger with smoked salmon is a delicious twist on a classic\ + \ burger. Made with a perfectly cooked beef patty and topped with smoked\ + \ salmon, fresh greens, and a creamy sauce." + maxLength: 300 + type: string + descriptionTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the item description. Only support up to 1\ + \ translated language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + price: + description: | + The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. + example: 1900 + type: integer + photos: + description: | + An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). + items: + example: http://example.com/image_url.jpg + type: string + type: array + specialType: + description: | + The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). + enum: + - alcohol + - "" + type: string + example: null + taxable: + description: | + **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. + example: false + type: boolean + barcode: + description: | + The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. + example: GTIN + maxLength: 64 + type: string + maxStock: + description: | + Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. + + Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is "UNAVAILABLE". Item will be set to "AVAILABLE" if `maxStock` > 0. + example: 15 + type: integer + advancedPricing: + $ref: '#/components/schemas/advancedPricing' + purchasability: + $ref: '#/components/schemas/purchasability' + modifierGroups: + description: "An array of the modifierGroup JSON objects. Max 30 allowed\ + \ per item. Refer to [Modifier groups](#modifier-groups) for more information." + items: + $ref: '#/components/schemas/ModifierGroup' + title: modifierGroups + type: array + required: + - availableStatus + - id + - name + - price + title: MenuSectionCategoryItem + type: object + MenuSectionCategory: + properties: + id: + description: The category's ID that is on the partner system. This ID should + be unique with a min length of 1 and max of 64. + example: category_id + maxLength: 64 + type: string + name: + description: The name of the category. + example: Value set + maxLength: 60 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the category name. Only support up to 1 translated\ + \ language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: "The status for the category. Refer to FAQs for more details\ + \ about [availableStatus](#section/Menu/What-is-availableStatus)." + enum: + - AVAILABLE + - UNAVAILABLE + - HIDE + example: AVAILABLE + type: string + items: + description: "An array of item JSON objects. Max 300 allowed per category.\ + \ Refer to [Items](#items) for more information." + items: + $ref: '#/components/schemas/MenuSectionCategoryItem' + title: oldMenuSectionCategoryItems + type: array + required: + - availableStatus + - id + - items + - name + title: MenuSectionCategory + type: object + MenuSection: + properties: + id: + description: | + The section's ID in the partner system. + example: section_id + maxLength: 64 + type: string + name: + description: The name of the section. + example: Lunch deal + maxLength: 30 + type: string + serviceHours: + $ref: '#/components/schemas/serviceHours' + categories: + description: "An array of category JSON objects. Max 100 allowed per section.\ + \ Refer to [Categories](#categories) for more information." + items: + $ref: '#/components/schemas/MenuSectionCategory' + type: array + required: + - categories + - id + - name + - serviceHours + title: MenuSection + type: object + OrderItem: + example: + quantity: 1 + grabItemID: IDGFSTI000004qy1490868132306763533 + price: 2550 + tax: 144 + id: item-1 + modifiers: + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + - quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + specifications: less sugar and chili + outOfStockInstruction: + replacementItemID: ITEM-2 + instructionType: SPECIFIC_ITEM + replacementGrabItemID: IDGFSTI000004qy1490868132303452210 + title: Replace item + properties: + id: + description: | + The item's ExternalID in the partner system. + example: item-1 + type: string + grabItemID: + description: The item's ID in Grab system. Partner can use this field in + the `EditOrder` endpoint. + example: IDGFSTI000004qy1490868132306763533 + type: string + quantity: + description: The number of the item ordered. + example: 1 + type: integer + price: + description: | + The price (tax-inclusive) in minor format for 1 item and modifiers under it. `Item price(tax inclusive) + Modifier price(tax inclusive) | (2241*1.06)+(165*1.06)=2550`. + example: 2550 + format: int64 + type: integer + tax: + description: "Tax in minor format for 1 item and all modifiers under it.\ + \ `0` if tax configuration is absent. `Item tax + Modifier tax | (2241*0.06)+(165*0.06)=144`.\ + \ Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated)." + example: 144 + format: int64 + type: integer + specifications: + description: | + An extra note for the merchant. `Blank` if no note from consumer. + example: less sugar and chili + maxLength: 300 + type: string + outOfStockInstruction: + $ref: '#/components/schemas/outOfStockInstruction' + modifiers: + description: "An array of JSON objects modifiers. Read [this](#categories)\ + \ for more information." + items: + $ref: '#/components/schemas/OrderItemModifier' + required: + - id + - price + - quantity + - tax + title: modifiers + type: array + required: + - grabItemID + - id + - price + - quantity + title: OrderItem + type: object + OrderCampaign: + example: + level: item + deductedAmount: 475 + freeItem: + quantity: 1 + price: 10 + name: Free tote bag + id: item-2 + appliedItemIDs: + - item-1 + - item-1 + name: 20% off Deal Of the day + deductedPart: basket_amount + id: id + type: percentage + campaignNameForMex: DEAL_20%_BURGER_OCT + usageCount: 1 + mexFundedRatio: 100 + properties: + id: + description: The campaign's ID returned by GrabFood upon campaign creation. + maxLength: 64 + type: string + name: + description: The name of the campaign. This campaign name has been automatically + generated by Grab for display in the customer app. + example: 20% off Deal Of the day + maxLength: 60 + type: string + campaignNameForMex: + description: "The campaign name provided by the merchant in [Create Campaign](#tag/create-campaign).\ + \ Whitelist required, reach out to your integration manager." + example: DEAL_20%_BURGER_OCT + type: string + level: + description: The campaign level. + enum: + - item + - category + - order + - delivery_fee + - bundle + example: item + type: string + type: + description: The type of campaign. + enum: + - percentage + - net + - delivery + - freeItem + - bundleSameNet + - bundleSamePercentage + - bundleSameFixPrice + example: percentage + type: string + usageCount: + description: The campaign redemption count in this order. + example: 1 + format: int64 + type: integer + mexFundedRatio: + description: The ratio funded by the merchant in percentage. + example: 100 + type: integer + deductedAmount: + description: The deducted amount in minor unit format. `Item price(tax inclusive) + * 20% discount | 2375*0.2` + example: 475 + format: int64 + type: integer + deductedPart: + description: The part that the campaign is applied. + enum: + - basket_amount + - delivery_fee + example: basket_amount + type: string + appliedItemIDs: + description: An array of item IDs that get discount under this campaign. + `null` if no item applied in this campaign. + items: + example: item-1 + type: string + nullable: true + type: array + freeItem: + $ref: '#/components/schemas/orderFreeItem' + title: OrderCampaign + type: object + OrderPromo: + example: + promoAmountInMin: 300 + code: promo_code + mexFundedAmount: 0 + promoAmount: 3 + name: Order now! + targetedPrice: 2550 + description: $3 off for entire order! + mexFundedRatio: 0 + properties: + code: + description: Promo code applied in the order. + example: promo_code + type: string + description: + description: Promo description. + example: $3 off for entire order! + type: string + name: + description: Name of the promotion. + example: Order now! + type: string + promoAmount: + description: "Promo amount applied in the order, in local currency. This\ + \ amount is rounded into whole number." + example: 3 + format: int64 + type: integer + mexFundedRatio: + description: The merchant's funded ratio of the promo in percentage. + example: 0 + type: integer + mexFundedAmount: + description: The merchant's promo fund in the minor unit. Calculated based + on merchant funded ratio. + example: 0 + format: int64 + type: integer + targetedPrice: + description: The subtotal of the order basket in minor unit. + example: 2550 + format: int64 + type: integer + promoAmountInMin: + description: Promo amount applied in the order in minor unit. + example: 300 + format: int64 + type: integer + title: OrderPromo + type: object + MenuItem: + properties: + id: + description: | + The item's ID in the partner system. + example: item_id + maxLength: 64 + type: string + name: + description: The name of the item. + example: Crispy burger with smoked salmon + maxLength: 80 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the item name. Only support up to 1 translated\ + \ language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: | + The status for the item that is in the category. + + Note: In order to set an item as "UNAVAILABLE", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + enum: + - AVAILABLE + - UNAVAILABLE + - HIDE + - UNAVAILABLETODAY + type: string + description: + description: | + The description of the item. There is a custom length limit of 2000 for `VN`. + example: "Crispy burger with smoked salmon is a delicious twist on a classic\ + \ burger. Made with a perfectly cooked beef patty and topped with smoked\ + \ salmon, fresh greens, and a creamy sauce." + maxLength: 300 + type: string + descriptionTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the item description. Only support up to 1\ + \ translated language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + price: + description: | + The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. + example: 1900 + format: int64 + type: integer + photos: + description: | + An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). + items: + example: http://example.com/image_url.jpg + type: string + type: array + specialType: + description: | + The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). + enum: + - alcohol + - "" + type: string + example: null + taxable: + description: | + **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. + example: false + type: boolean + barcode: + description: | + The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. + example: GTIN + maxLength: 64 + type: string + sellingTimeID: + description: | + The selling time's ID for the item. This value overwrites the category's selling time if it is different. Empty value implies the category's selling time will be applied. + example: partner-sellingTimeID-1 + type: string + maxStock: + description: | + Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. + + Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is "UNAVAILABLE". Item will be set to "AVAILABLE" if `maxStock` > 0. + example: 15 + format: int64 + type: integer + advancedPricing: + $ref: '#/components/schemas/advancedPricing' + purchasability: + $ref: '#/components/schemas/purchasability' + modifierGroups: + description: "An array of the modifierGroup JSON objects. Max 30 allowed\ + \ per item. Refer to [Modifier groups](#modifier-groups) for more information." + items: + $ref: '#/components/schemas/ModifierGroup' + title: modifierGroups + type: array + required: + - availableStatus + - id + - name + - price + title: MenuItem + type: object + ModifierGroup: + properties: + id: + description: The ModifierGroup's ID that is on the partner system. This + ID should be unique with a min length of 1 and max of 64. + example: modifier_group_id + maxLength: 64 + type: string + name: + description: The name of the ModifierGroup for the item that is in the parent + category and section. + example: Add on + maxLength: 50 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the modifier group name. Only support up to\ + \ 1 translated language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: The status for the ModifierGroup that is in the item. + enum: + - AVAILABLE + - UNAVAILABLE + - UNAVAILABLETODAY + - HIDE + type: string + selectionRangeMin: + description: "The minimum quantity of the attribute. Refer to FAQs for more\ + \ details about [selection range](#section/Menu/What-does-the-selection-range-do)." + example: 0 + type: integer + selectionRangeMax: + description: "The maximum quantity of the attribute. Refer to FAQs for more\ + \ details about [selection range](#section/Menu/What-does-the-selection-range-do)." + example: 1 + type: integer + modifiers: + description: "An array of modifier JSON objects. Max 100 per modifierGroup.\ + \ Refer to [Modifiers](#modifiers) for more information." + items: + $ref: '#/components/schemas/MenuModifier' + title: modifiers + type: array + required: + - availableStatus + - id + - name + - selectionRangeMax + title: ModifierGroup + type: object + OrderItemModifier: + example: + quantity: 0 + price: 175 + tax: 10 + id: modifier-1 + properties: + id: + description: The modifier's ID that is on the partner's system. + example: modifier-1 + maxLength: 64 + type: string + price: + description: The modifier's price (tax-inclusive) in minor format. `round(165 + * (1 + 0.06)) = 175`. + example: 175 + format: int64 + type: integer + tax: + description: "Tax in minor format for 1 modifier. `165*0.06=10`. Refer to\ + \ FAQs for more details about [tax](#section/Order/How-is-tax-calculated)." + example: 10 + format: int64 + type: integer + quantity: + description: The number of modifiers present. The value is always 1. + enum: + - 1 + type: integer + title: OrderItemModifier + type: object + MenuModifier: + properties: + id: + description: The modifier's ID that is on the partner's system. This ID + should be unique with a min length of 1 and max of 64. + example: modifier_id + maxLength: 64 + type: string + name: + description: The name of the modifier. + example: Smoked tuna + maxLength: 40 + type: string + nameTranslation: + additionalProperties: + $ref: '#/components/schemas/menuTranslation' + description: "Translation of the modifier name. Only support up to 1 translated\ + \ language. Refer [Menu Translation](#section/Menu-Translation)." + type: object + availableStatus: + description: The status for the modifier that is in the ModifierGroup. + enum: + - AVAILABLE + - UNAVAILABLE + - UNAVAILABLETODAY + - HIDE + type: string + price: + description: "The modifier's price (excluding tax) in minor format. Refer\ + \ to FAQs for more details about [tax](#section/Order/How-is-tax-calculated)." + example: 200 + format: int64 + type: integer + barcode: + description: "The barcode Number (GTIN). GTIN must be 8, 12, 13, 14 numeric\ + \ digits." + example: GTIN + maxLength: 64 + type: string + advancedPricing: + $ref: '#/components/schemas/advancedPricing' + required: + - availableStatus + - id + - name + title: MenuModifier + type: object +x-tagGroups: +- name: SDK library + tags: + - sdk-intro + - go + - java +- name: Authorisation + tags: + - get-oauth-grab + - get-oauth-partner-webhook +- name: Menu sync + tags: + - sync-flow + - get-menu-webhook + - update-menu-notification + - update-menu-record + - menu-sync-webhook + - trace-menu-sync +- name: Order sync + tags: + - scan-to-order + - submit-order-webhook + - accept-reject-order + - list-orders + - edit-order + - order-state-webhook + - mark-order-ready + - update-delivery-state + - update-order-ready-time + - check-order-cancelable + - cancel-order +- name: Store + tags: + - pause-store + - get-store-hour + - get-store-status + - update-store-delivery-hour + - update-store-dine-in-hour + - update-store-special-hour +- name: Campaigns + tags: + - campaign-type + - create-campaign + - update-campaign + - list-campaign + - delete-campaign +- name: Vouchers + tags: + - get-dinein-voucher + - redeem-dinein-voucher +- name: Partner Loyalty (Native) + tags: + - partner-loyalty-native + - bind-membership-native + - register-membership-native + - unbind-membership-native + - get-membership-native + - get-reward-native +- name: Partner Loyalty (Webview) + tags: + - partner-loyalty-webview + - notify-membership-webview + - unlink-membership-webview + - get-membership-webview +- name: Troubleshooting and FAQs + tags: + - troubleshooting + - faqs + - changelog diff --git a/api_accept_reject_order.go b/api_accept_reject_order.go new file mode 100644 index 0000000..a9e0cea --- /dev/null +++ b/api_accept_reject_order.go @@ -0,0 +1,146 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// AcceptRejectOrderAPIService AcceptRejectOrderAPI service +type AcceptRejectOrderAPIService service + +type ApiAcceptRejectOrderRequest struct { + ctx context.Context + ApiService *AcceptRejectOrderAPIService + authorization *string + contentType *string + acceptOrderRequest *AcceptOrderRequest +} + +// Specify the generated authorization token of the bearer type. +func (r ApiAcceptRejectOrderRequest) Authorization(authorization string) ApiAcceptRejectOrderRequest { + r.authorization = &authorization + return r +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiAcceptRejectOrderRequest) ContentType(contentType string) ApiAcceptRejectOrderRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiAcceptRejectOrderRequest) AcceptOrderRequest(acceptOrderRequest AcceptOrderRequest) ApiAcceptRejectOrderRequest { + r.acceptOrderRequest = &acceptOrderRequest + return r +} + +func (r ApiAcceptRejectOrderRequest) Execute() (*http.Response, error) { + return r.ApiService.AcceptRejectOrderExecute(r) +} + +/* +AcceptRejectOrder Manually accept/reject orders + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAcceptRejectOrderRequest +*/ +func (a *AcceptRejectOrderAPIService) AcceptRejectOrder(ctx context.Context) ApiAcceptRejectOrderRequest { + return ApiAcceptRejectOrderRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *AcceptRejectOrderAPIService) AcceptRejectOrderExecute(r ApiAcceptRejectOrderRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AcceptRejectOrderAPIService.AcceptRejectOrder") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/order/prepare" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.acceptOrderRequest == nil { + return nil, reportError("acceptOrderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.acceptOrderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_cancel_order.go b/api_cancel_order.go new file mode 100644 index 0000000..30ed3e8 --- /dev/null +++ b/api_cancel_order.go @@ -0,0 +1,210 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// CancelOrderAPIService CancelOrderAPI service +type CancelOrderAPIService service + +type ApiCancelOrderRequest struct { + ctx context.Context + ApiService *CancelOrderAPIService + contentType *string + authorization *string + cancelOrderRequest *CancelOrderRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiCancelOrderRequest) ContentType(contentType string) ApiCancelOrderRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiCancelOrderRequest) Authorization(authorization string) ApiCancelOrderRequest { + r.authorization = &authorization + return r +} + +func (r ApiCancelOrderRequest) CancelOrderRequest(cancelOrderRequest CancelOrderRequest) ApiCancelOrderRequest { + r.cancelOrderRequest = &cancelOrderRequest + return r +} + +func (r ApiCancelOrderRequest) Execute() (*CancelOrderResponse, *http.Response, error) { + return r.ApiService.CancelOrderExecute(r) +} + +/* +CancelOrder Cancel an order + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCancelOrderRequest +*/ +func (a *CancelOrderAPIService) CancelOrder(ctx context.Context) ApiCancelOrderRequest { + return ApiCancelOrderRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CancelOrderResponse +func (a *CancelOrderAPIService) CancelOrderExecute(r ApiCancelOrderRequest) (*CancelOrderResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CancelOrderResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CancelOrderAPIService.CancelOrder") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/order/cancel" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.cancelOrderRequest == nil { + return localVarReturnValue, nil, reportError("cancelOrderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.cancelOrderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_check_order_cancelable.go b/api_check_order_cancelable.go new file mode 100644 index 0000000..f3bb4b5 --- /dev/null +++ b/api_check_order_cancelable.go @@ -0,0 +1,155 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// CheckOrderCancelableAPIService CheckOrderCancelableAPI service +type CheckOrderCancelableAPIService service + +type ApiCheckOrderCancelableRequest struct { + ctx context.Context + ApiService *CheckOrderCancelableAPIService + authorization *string + orderID *string + merchantID *string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiCheckOrderCancelableRequest) Authorization(authorization string) ApiCheckOrderCancelableRequest { + r.authorization = &authorization + return r +} + +func (r ApiCheckOrderCancelableRequest) OrderID(orderID string) ApiCheckOrderCancelableRequest { + r.orderID = &orderID + return r +} + +// The merchant's ID that is in GrabFood's database. +func (r ApiCheckOrderCancelableRequest) MerchantID(merchantID string) ApiCheckOrderCancelableRequest { + r.merchantID = &merchantID + return r +} + +func (r ApiCheckOrderCancelableRequest) Execute() (*CheckOrderCancelableResponse, *http.Response, error) { + return r.ApiService.CheckOrderCancelableExecute(r) +} + +/* +CheckOrderCancelable Check order cancelable + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCheckOrderCancelableRequest +*/ +func (a *CheckOrderCancelableAPIService) CheckOrderCancelable(ctx context.Context) ApiCheckOrderCancelableRequest { + return ApiCheckOrderCancelableRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CheckOrderCancelableResponse +func (a *CheckOrderCancelableAPIService) CheckOrderCancelableExecute(r ApiCheckOrderCancelableRequest) (*CheckOrderCancelableResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CheckOrderCancelableResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CheckOrderCancelableAPIService.CheckOrderCancelable") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/order/cancelable" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.orderID == nil { + return localVarReturnValue, nil, reportError("orderID is required and must be specified") + } + if r.merchantID == nil { + return localVarReturnValue, nil, reportError("merchantID is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "orderID", r.orderID, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "merchantID", r.merchantID, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_create_campaign.go b/api_create_campaign.go new file mode 100644 index 0000000..fc7fe50 --- /dev/null +++ b/api_create_campaign.go @@ -0,0 +1,166 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// CreateCampaignAPIService CreateCampaignAPI service +type CreateCampaignAPIService service + +type ApiCreateCampaignRequest struct { + ctx context.Context + ApiService *CreateCampaignAPIService + contentType *string + authorization *string + createCampaignRequest *CreateCampaignRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiCreateCampaignRequest) ContentType(contentType string) ApiCreateCampaignRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiCreateCampaignRequest) Authorization(authorization string) ApiCreateCampaignRequest { + r.authorization = &authorization + return r +} + +func (r ApiCreateCampaignRequest) CreateCampaignRequest(createCampaignRequest CreateCampaignRequest) ApiCreateCampaignRequest { + r.createCampaignRequest = &createCampaignRequest + return r +} + +func (r ApiCreateCampaignRequest) Execute() (*CreateCampaignResponse, *http.Response, error) { + return r.ApiService.CreateCampaignExecute(r) +} + +/* +CreateCampaign Create campaign + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateCampaignRequest +*/ +func (a *CreateCampaignAPIService) CreateCampaign(ctx context.Context) ApiCreateCampaignRequest { + return ApiCreateCampaignRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CreateCampaignResponse +func (a *CreateCampaignAPIService) CreateCampaignExecute(r ApiCreateCampaignRequest) (*CreateCampaignResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateCampaignResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CreateCampaignAPIService.CreateCampaign") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/campaigns" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.createCampaignRequest == nil { + return localVarReturnValue, nil, reportError("createCampaignRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.createCampaignRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_delete_campaign.go b/api_delete_campaign.go new file mode 100644 index 0000000..6ac5196 --- /dev/null +++ b/api_delete_campaign.go @@ -0,0 +1,128 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// DeleteCampaignAPIService DeleteCampaignAPI service +type DeleteCampaignAPIService service + +type ApiDeleteCampaignRequest struct { + ctx context.Context + ApiService *DeleteCampaignAPIService + authorization *string + campaignId string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiDeleteCampaignRequest) Authorization(authorization string) ApiDeleteCampaignRequest { + r.authorization = &authorization + return r +} + +func (r ApiDeleteCampaignRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteCampaignExecute(r) +} + +/* +DeleteCampaign Delete campaigns + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param campaignId + @return ApiDeleteCampaignRequest +*/ +func (a *DeleteCampaignAPIService) DeleteCampaign(ctx context.Context, campaignId string) ApiDeleteCampaignRequest { + return ApiDeleteCampaignRequest{ + ApiService: a, + ctx: ctx, + campaignId: campaignId, + } +} + +// Execute executes the request +func (a *DeleteCampaignAPIService) DeleteCampaignExecute(r ApiDeleteCampaignRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DeleteCampaignAPIService.DeleteCampaign") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/campaigns/{campaign_id}" + localVarPath = strings.Replace(localVarPath, "{"+"campaign_id"+"}", url.PathEscape(parameterValueToString(r.campaignId, "campaignId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_edit_order.go b/api_edit_order.go new file mode 100644 index 0000000..6b9a261 --- /dev/null +++ b/api_edit_order.go @@ -0,0 +1,160 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// EditOrderAPIService EditOrderAPI service +type EditOrderAPIService service + +type ApiEditOrderRequest struct { + ctx context.Context + ApiService *EditOrderAPIService + contentType *string + authorization *string + orderID string + editOrderRequest *EditOrderRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiEditOrderRequest) ContentType(contentType string) ApiEditOrderRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiEditOrderRequest) Authorization(authorization string) ApiEditOrderRequest { + r.authorization = &authorization + return r +} + +func (r ApiEditOrderRequest) EditOrderRequest(editOrderRequest EditOrderRequest) ApiEditOrderRequest { + r.editOrderRequest = &editOrderRequest + return r +} + +func (r ApiEditOrderRequest) Execute() (*http.Response, error) { + return r.ApiService.EditOrderExecute(r) +} + +/* +EditOrder Edit Order + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param orderID + @return ApiEditOrderRequest +*/ +func (a *EditOrderAPIService) EditOrder(ctx context.Context, orderID string) ApiEditOrderRequest { + return ApiEditOrderRequest{ + ApiService: a, + ctx: ctx, + orderID: orderID, + } +} + +// Execute executes the request +func (a *EditOrderAPIService) EditOrderExecute(r ApiEditOrderRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EditOrderAPIService.EditOrder") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/orders/{orderID}" + localVarPath = strings.Replace(localVarPath, "{"+"orderID"+"}", url.PathEscape(parameterValueToString(r.orderID, "orderID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.editOrderRequest == nil { + return nil, reportError("editOrderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.editOrderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_get_dinein_voucher.go b/api_get_dinein_voucher.go new file mode 100644 index 0000000..33c41d0 --- /dev/null +++ b/api_get_dinein_voucher.go @@ -0,0 +1,185 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// GetDineinVoucherAPIService GetDineinVoucherAPI service +type GetDineinVoucherAPIService service + +type ApiGetDineinVoucherRequest struct { + ctx context.Context + ApiService *GetDineinVoucherAPIService + authorization *string + merchantID *string + voucherCode *string + certificateID *string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiGetDineinVoucherRequest) Authorization(authorization string) ApiGetDineinVoucherRequest { + r.authorization = &authorization + return r +} + +func (r ApiGetDineinVoucherRequest) MerchantID(merchantID string) ApiGetDineinVoucherRequest { + r.merchantID = &merchantID + return r +} + +// A short code for the dine-in voucher purchased by the user. Required if `certificateID` is not specified. +func (r ApiGetDineinVoucherRequest) VoucherCode(voucherCode string) ApiGetDineinVoucherRequest { + r.voucherCode = &voucherCode + return r +} + +// This certificateID is decoded from scanning the QR code, and 1:1 mapping with voucherCode. Required if `voucherCode` is not specified. +func (r ApiGetDineinVoucherRequest) CertificateID(certificateID string) ApiGetDineinVoucherRequest { + r.certificateID = &certificateID + return r +} + +func (r ApiGetDineinVoucherRequest) Execute() (*GetDineInVoucherResponse, *http.Response, error) { + return r.ApiService.GetDineinVoucherExecute(r) +} + +/* +GetDineinVoucher Get Dine In Voucher + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetDineinVoucherRequest +*/ +func (a *GetDineinVoucherAPIService) GetDineinVoucher(ctx context.Context) ApiGetDineinVoucherRequest { + return ApiGetDineinVoucherRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetDineInVoucherResponse +func (a *GetDineinVoucherAPIService) GetDineinVoucherExecute(r ApiGetDineinVoucherRequest) (*GetDineInVoucherResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDineInVoucherResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GetDineinVoucherAPIService.GetDineinVoucher") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/dinein/voucher" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.merchantID == nil { + return localVarReturnValue, nil, reportError("merchantID is required and must be specified") + } + + if r.voucherCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "voucherCode", r.voucherCode, "form", "") + } + if r.certificateID != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificateID", r.certificateID, "form", "") + } + parameterAddToHeaderOrQuery(localVarQueryParams, "merchantID", r.merchantID, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_get_oauth_grab.go b/api_get_oauth_grab.go new file mode 100644 index 0000000..243f434 --- /dev/null +++ b/api_get_oauth_grab.go @@ -0,0 +1,146 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// GetOauthGrabAPIService GetOauthGrabAPI service +type GetOauthGrabAPIService service + +type ApiGetOauthGrabRequest struct { + ctx context.Context + ApiService *GetOauthGrabAPIService + contentType *string + grabOauthRequest *GrabOauthRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiGetOauthGrabRequest) ContentType(contentType string) ApiGetOauthGrabRequest { + r.contentType = &contentType + return r +} + +// +func (r ApiGetOauthGrabRequest) GrabOauthRequest(grabOauthRequest GrabOauthRequest) ApiGetOauthGrabRequest { + r.grabOauthRequest = &grabOauthRequest + return r +} + +func (r ApiGetOauthGrabRequest) Execute() (*GrabOauthResponse, *http.Response, error) { + return r.ApiService.GetOauthGrabExecute(r) +} + +/* +GetOauthGrab Get Oauth access token + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetOauthGrabRequest +*/ +func (a *GetOauthGrabAPIService) GetOauthGrab(ctx context.Context) ApiGetOauthGrabRequest { + return ApiGetOauthGrabRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GrabOauthResponse +func (a *GetOauthGrabAPIService) GetOauthGrabExecute(r ApiGetOauthGrabRequest) (*GrabOauthResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GrabOauthResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GetOauthGrabAPIService.GetOauthGrab") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/grabid/v1/oauth2/token" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.grabOauthRequest == nil { + return localVarReturnValue, nil, reportError("grabOauthRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.grabOauthRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_get_store_hour.go b/api_get_store_hour.go new file mode 100644 index 0000000..d251b0e --- /dev/null +++ b/api_get_store_hour.go @@ -0,0 +1,149 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// GetStoreHourAPIService GetStoreHourAPI service +type GetStoreHourAPIService service + +type ApiGetStoreHourRequest struct { + ctx context.Context + ApiService *GetStoreHourAPIService + authorization *string + merchantID string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiGetStoreHourRequest) Authorization(authorization string) ApiGetStoreHourRequest { + r.authorization = &authorization + return r +} + +func (r ApiGetStoreHourRequest) Execute() (*StoreHourResponse, *http.Response, error) { + return r.ApiService.GetStoreHourExecute(r) +} + +/* +GetStoreHour Get Store Hours + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantID The merchant's ID that is in GrabFood's database. + @return ApiGetStoreHourRequest +*/ +func (a *GetStoreHourAPIService) GetStoreHour(ctx context.Context, merchantID string) ApiGetStoreHourRequest { + return ApiGetStoreHourRequest{ + ApiService: a, + ctx: ctx, + merchantID: merchantID, + } +} + +// Execute executes the request +// @return StoreHourResponse +func (a *GetStoreHourAPIService) GetStoreHourExecute(r ApiGetStoreHourRequest) (*StoreHourResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StoreHourResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GetStoreHourAPIService.GetStoreHour") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v2/merchants/{merchantID}/store/hours" + localVarPath = strings.Replace(localVarPath, "{"+"merchantID"+"}", url.PathEscape(parameterValueToString(r.merchantID, "merchantID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_get_store_status.go b/api_get_store_status.go new file mode 100644 index 0000000..688d748 --- /dev/null +++ b/api_get_store_status.go @@ -0,0 +1,149 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// GetStoreStatusAPIService GetStoreStatusAPI service +type GetStoreStatusAPIService service + +type ApiGetStoreStatusRequest struct { + ctx context.Context + ApiService *GetStoreStatusAPIService + authorization *string + merchantID string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiGetStoreStatusRequest) Authorization(authorization string) ApiGetStoreStatusRequest { + r.authorization = &authorization + return r +} + +func (r ApiGetStoreStatusRequest) Execute() (*StoreStatusResponse, *http.Response, error) { + return r.ApiService.GetStoreStatusExecute(r) +} + +/* +GetStoreStatus Get Store Status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantID The merchant's ID that is in GrabFood's database. + @return ApiGetStoreStatusRequest +*/ +func (a *GetStoreStatusAPIService) GetStoreStatus(ctx context.Context, merchantID string) ApiGetStoreStatusRequest { + return ApiGetStoreStatusRequest{ + ApiService: a, + ctx: ctx, + merchantID: merchantID, + } +} + +// Execute executes the request +// @return StoreStatusResponse +func (a *GetStoreStatusAPIService) GetStoreStatusExecute(r ApiGetStoreStatusRequest) (*StoreStatusResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StoreStatusResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GetStoreStatusAPIService.GetStoreStatus") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchants/{merchantID}/store/status" + localVarPath = strings.Replace(localVarPath, "{"+"merchantID"+"}", url.PathEscape(parameterValueToString(r.merchantID, "merchantID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_list_campaign.go b/api_list_campaign.go new file mode 100644 index 0000000..a1dea4a --- /dev/null +++ b/api_list_campaign.go @@ -0,0 +1,145 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// ListCampaignAPIService ListCampaignAPI service +type ListCampaignAPIService service + +type ApiListCampaignRequest struct { + ctx context.Context + ApiService *ListCampaignAPIService + authorization *string + merchantID *string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiListCampaignRequest) Authorization(authorization string) ApiListCampaignRequest { + r.authorization = &authorization + return r +} + +// The merchant's ID that is in GrabFood's database. +func (r ApiListCampaignRequest) MerchantID(merchantID string) ApiListCampaignRequest { + r.merchantID = &merchantID + return r +} + +func (r ApiListCampaignRequest) Execute() (*ListCampaignResponse, *http.Response, error) { + return r.ApiService.ListCampaignExecute(r) +} + +/* +ListCampaign List campaigns + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListCampaignRequest +*/ +func (a *ListCampaignAPIService) ListCampaign(ctx context.Context) ApiListCampaignRequest { + return ApiListCampaignRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListCampaignResponse +func (a *ListCampaignAPIService) ListCampaignExecute(r ApiListCampaignRequest) (*ListCampaignResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListCampaignResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ListCampaignAPIService.ListCampaign") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/campaigns" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.merchantID == nil { + return localVarReturnValue, nil, reportError("merchantID is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "merchantID", r.merchantID, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_list_orders.go b/api_list_orders.go new file mode 100644 index 0000000..9f942e3 --- /dev/null +++ b/api_list_orders.go @@ -0,0 +1,166 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// ListOrdersAPIService ListOrdersAPI service +type ListOrdersAPIService service + +type ApiListOrdersRequest struct { + ctx context.Context + ApiService *ListOrdersAPIService + authorization *string + merchantID *string + date *string + page *int32 +} + +// Specify the generated authorization token of the bearer type. +func (r ApiListOrdersRequest) Authorization(authorization string) ApiListOrdersRequest { + r.authorization = &authorization + return r +} + +// The merchant's ID that is in GrabFood's database. +func (r ApiListOrdersRequest) MerchantID(merchantID string) ApiListOrdersRequest { + r.merchantID = &merchantID + return r +} + +func (r ApiListOrdersRequest) Date(date string) ApiListOrdersRequest { + r.date = &date + return r +} + +// Specify the page number for the report. +func (r ApiListOrdersRequest) Page(page int32) ApiListOrdersRequest { + r.page = &page + return r +} + +func (r ApiListOrdersRequest) Execute() (*ListOrdersResponse, *http.Response, error) { + return r.ApiService.ListOrdersExecute(r) +} + +/* +ListOrders List orders + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListOrdersRequest +*/ +func (a *ListOrdersAPIService) ListOrders(ctx context.Context) ApiListOrdersRequest { + return ApiListOrdersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListOrdersResponse +func (a *ListOrdersAPIService) ListOrdersExecute(r ApiListOrdersRequest) (*ListOrdersResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListOrdersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ListOrdersAPIService.ListOrders") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/orders" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.merchantID == nil { + return localVarReturnValue, nil, reportError("merchantID is required and must be specified") + } + if r.date == nil { + return localVarReturnValue, nil, reportError("date is required and must be specified") + } + if r.page == nil { + return localVarReturnValue, nil, reportError("page is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "merchantID", r.merchantID, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "date", r.date, "form", "") + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_mark_order_ready.go b/api_mark_order_ready.go new file mode 100644 index 0000000..eb0bbc4 --- /dev/null +++ b/api_mark_order_ready.go @@ -0,0 +1,155 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// MarkOrderReadyAPIService MarkOrderReadyAPI service +type MarkOrderReadyAPIService service + +type ApiMarkOrderReadyRequest struct { + ctx context.Context + ApiService *MarkOrderReadyAPIService + contentType *string + authorization *string + markOrderRequest *MarkOrderRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiMarkOrderReadyRequest) ContentType(contentType string) ApiMarkOrderReadyRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiMarkOrderReadyRequest) Authorization(authorization string) ApiMarkOrderReadyRequest { + r.authorization = &authorization + return r +} + +func (r ApiMarkOrderReadyRequest) MarkOrderRequest(markOrderRequest MarkOrderRequest) ApiMarkOrderReadyRequest { + r.markOrderRequest = &markOrderRequest + return r +} + +func (r ApiMarkOrderReadyRequest) Execute() (*http.Response, error) { + return r.ApiService.MarkOrderReadyExecute(r) +} + +/* +MarkOrderReady Mark order as ready + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiMarkOrderReadyRequest +*/ +func (a *MarkOrderReadyAPIService) MarkOrderReady(ctx context.Context) ApiMarkOrderReadyRequest { + return ApiMarkOrderReadyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *MarkOrderReadyAPIService) MarkOrderReadyExecute(r ApiMarkOrderReadyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MarkOrderReadyAPIService.MarkOrderReady") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/orders/mark" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.markOrderRequest == nil { + return nil, reportError("markOrderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.markOrderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_notify_membership_webview.go b/api_notify_membership_webview.go new file mode 100644 index 0000000..8d9902c --- /dev/null +++ b/api_notify_membership_webview.go @@ -0,0 +1,145 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// NotifyMembershipWebviewAPIService NotifyMembershipWebviewAPI service +type NotifyMembershipWebviewAPIService service + +type ApiNotifyMembershipWebviewRequest struct { + ctx context.Context + ApiService *NotifyMembershipWebviewAPIService + authorization *string + contentType *string + notifyMembershipWebviewRequest *NotifyMembershipWebviewRequest +} + +// Specify the generated authorization token of the bearer type. +func (r ApiNotifyMembershipWebviewRequest) Authorization(authorization string) ApiNotifyMembershipWebviewRequest { + r.authorization = &authorization + return r +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiNotifyMembershipWebviewRequest) ContentType(contentType string) ApiNotifyMembershipWebviewRequest { + r.contentType = &contentType + return r +} + +func (r ApiNotifyMembershipWebviewRequest) NotifyMembershipWebviewRequest(notifyMembershipWebviewRequest NotifyMembershipWebviewRequest) ApiNotifyMembershipWebviewRequest { + r.notifyMembershipWebviewRequest = ¬ifyMembershipWebviewRequest + return r +} + +func (r ApiNotifyMembershipWebviewRequest) Execute() (*http.Response, error) { + return r.ApiService.NotifyMembershipWebviewExecute(r) +} + +/* +NotifyMembershipWebview Notify Membership + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiNotifyMembershipWebviewRequest +*/ +func (a *NotifyMembershipWebviewAPIService) NotifyMembershipWebview(ctx context.Context) ApiNotifyMembershipWebviewRequest { + return ApiNotifyMembershipWebviewRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *NotifyMembershipWebviewAPIService) NotifyMembershipWebviewExecute(r ApiNotifyMembershipWebviewRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NotifyMembershipWebviewAPIService.NotifyMembershipWebview") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/membership/notify" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.notifyMembershipWebviewRequest == nil { + return nil, reportError("notifyMembershipWebviewRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.notifyMembershipWebviewRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_pause_store.go b/api_pause_store.go new file mode 100644 index 0000000..c81da7f --- /dev/null +++ b/api_pause_store.go @@ -0,0 +1,145 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// PauseStoreAPIService PauseStoreAPI service +type PauseStoreAPIService service + +type ApiPauseStoreRequest struct { + ctx context.Context + ApiService *PauseStoreAPIService + contentType *string + authorization *string + pauseStoreRequest *PauseStoreRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiPauseStoreRequest) ContentType(contentType string) ApiPauseStoreRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiPauseStoreRequest) Authorization(authorization string) ApiPauseStoreRequest { + r.authorization = &authorization + return r +} + +func (r ApiPauseStoreRequest) PauseStoreRequest(pauseStoreRequest PauseStoreRequest) ApiPauseStoreRequest { + r.pauseStoreRequest = &pauseStoreRequest + return r +} + +func (r ApiPauseStoreRequest) Execute() (*http.Response, error) { + return r.ApiService.PauseStoreExecute(r) +} + +/* +PauseStore Pause store + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPauseStoreRequest +*/ +func (a *PauseStoreAPIService) PauseStore(ctx context.Context) ApiPauseStoreRequest { + return ApiPauseStoreRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *PauseStoreAPIService) PauseStoreExecute(r ApiPauseStoreRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PauseStoreAPIService.PauseStore") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchant/pause" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.pauseStoreRequest == nil { + return nil, reportError("pauseStoreRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.pauseStoreRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_redeem_dinein_voucher.go b/api_redeem_dinein_voucher.go new file mode 100644 index 0000000..3467ca9 --- /dev/null +++ b/api_redeem_dinein_voucher.go @@ -0,0 +1,188 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// RedeemDineinVoucherAPIService RedeemDineinVoucherAPI service +type RedeemDineinVoucherAPIService service + +type ApiRedeemDineinVoucherRequest struct { + ctx context.Context + ApiService *RedeemDineinVoucherAPIService + authorization *string + contentType *string + redeemDineInVoucherRequest *RedeemDineInVoucherRequest +} + +// Specify the generated authorization token of the bearer type. +func (r ApiRedeemDineinVoucherRequest) Authorization(authorization string) ApiRedeemDineinVoucherRequest { + r.authorization = &authorization + return r +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiRedeemDineinVoucherRequest) ContentType(contentType string) ApiRedeemDineinVoucherRequest { + r.contentType = &contentType + return r +} + +func (r ApiRedeemDineinVoucherRequest) RedeemDineInVoucherRequest(redeemDineInVoucherRequest RedeemDineInVoucherRequest) ApiRedeemDineinVoucherRequest { + r.redeemDineInVoucherRequest = &redeemDineInVoucherRequest + return r +} + +func (r ApiRedeemDineinVoucherRequest) Execute() (*RedeemDineInVoucherResponse, *http.Response, error) { + return r.ApiService.RedeemDineinVoucherExecute(r) +} + +/* +RedeemDineinVoucher Redeem Dine In Voucher + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRedeemDineinVoucherRequest +*/ +func (a *RedeemDineinVoucherAPIService) RedeemDineinVoucher(ctx context.Context) ApiRedeemDineinVoucherRequest { + return ApiRedeemDineinVoucherRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return RedeemDineInVoucherResponse +func (a *RedeemDineinVoucherAPIService) RedeemDineinVoucherExecute(r ApiRedeemDineinVoucherRequest) (*RedeemDineInVoucherResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedeemDineInVoucherResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RedeemDineinVoucherAPIService.RedeemDineinVoucher") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/dinein/voucher/redeem" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.redeemDineInVoucherRequest == nil { + return localVarReturnValue, nil, reportError("redeemDineInVoucherRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + // body params + localVarPostBody = r.redeemDineInVoucherRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_trace_menu_sync.go b/api_trace_menu_sync.go new file mode 100644 index 0000000..c160e8f --- /dev/null +++ b/api_trace_menu_sync.go @@ -0,0 +1,155 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// TraceMenuSyncAPIService TraceMenuSyncAPI service +type TraceMenuSyncAPIService service + +type ApiTraceMenuSyncRequest struct { + ctx context.Context + ApiService *TraceMenuSyncAPIService + authorization *string + merchantID *string +} + +// Specify the generated authorization token of the bearer type. +func (r ApiTraceMenuSyncRequest) Authorization(authorization string) ApiTraceMenuSyncRequest { + r.authorization = &authorization + return r +} + +// The merchant's ID that is in GrabFood's database. +func (r ApiTraceMenuSyncRequest) MerchantID(merchantID string) ApiTraceMenuSyncRequest { + r.merchantID = &merchantID + return r +} + +func (r ApiTraceMenuSyncRequest) Execute() (*MenuSyncResponse, *http.Response, error) { + return r.ApiService.TraceMenuSyncExecute(r) +} + +/* +TraceMenuSync Trace menu sync + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTraceMenuSyncRequest +*/ +func (a *TraceMenuSyncAPIService) TraceMenuSync(ctx context.Context) ApiTraceMenuSyncRequest { + return ApiTraceMenuSyncRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return MenuSyncResponse +func (a *TraceMenuSyncAPIService) TraceMenuSyncExecute(r ApiTraceMenuSyncRequest) (*MenuSyncResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MenuSyncResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TraceMenuSyncAPIService.TraceMenuSync") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchant/menu/trace" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.merchantID == nil { + return localVarReturnValue, nil, reportError("merchantID is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "merchantID", r.merchantID, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode >= 400 && localVarHTTPResponse.StatusCode < 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_update_campaign.go b/api_update_campaign.go new file mode 100644 index 0000000..5c98efc --- /dev/null +++ b/api_update_campaign.go @@ -0,0 +1,150 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UpdateCampaignAPIService UpdateCampaignAPI service +type UpdateCampaignAPIService service + +type ApiUpdateCampaignRequest struct { + ctx context.Context + ApiService *UpdateCampaignAPIService + contentType *string + authorization *string + campaignId string + updateCampaignRequest *UpdateCampaignRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateCampaignRequest) ContentType(contentType string) ApiUpdateCampaignRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateCampaignRequest) Authorization(authorization string) ApiUpdateCampaignRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateCampaignRequest) UpdateCampaignRequest(updateCampaignRequest UpdateCampaignRequest) ApiUpdateCampaignRequest { + r.updateCampaignRequest = &updateCampaignRequest + return r +} + +func (r ApiUpdateCampaignRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateCampaignExecute(r) +} + +/* +UpdateCampaign Update campaign + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param campaignId + @return ApiUpdateCampaignRequest +*/ +func (a *UpdateCampaignAPIService) UpdateCampaign(ctx context.Context, campaignId string) ApiUpdateCampaignRequest { + return ApiUpdateCampaignRequest{ + ApiService: a, + ctx: ctx, + campaignId: campaignId, + } +} + +// Execute executes the request +func (a *UpdateCampaignAPIService) UpdateCampaignExecute(r ApiUpdateCampaignRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateCampaignAPIService.UpdateCampaign") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/campaigns/{campaign_id}" + localVarPath = strings.Replace(localVarPath, "{"+"campaign_id"+"}", url.PathEscape(parameterValueToString(r.campaignId, "campaignId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.updateCampaignRequest == nil { + return nil, reportError("updateCampaignRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateCampaignRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_update_delivery_state.go b/api_update_delivery_state.go new file mode 100644 index 0000000..e452a13 --- /dev/null +++ b/api_update_delivery_state.go @@ -0,0 +1,145 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// UpdateDeliveryStateAPIService UpdateDeliveryStateAPI service +type UpdateDeliveryStateAPIService service + +type ApiUpdateDeliveryStateRequest struct { + ctx context.Context + ApiService *UpdateDeliveryStateAPIService + contentType *string + authorization *string + orderDeliveryRequest *OrderDeliveryRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateDeliveryStateRequest) ContentType(contentType string) ApiUpdateDeliveryStateRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateDeliveryStateRequest) Authorization(authorization string) ApiUpdateDeliveryStateRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateDeliveryStateRequest) OrderDeliveryRequest(orderDeliveryRequest OrderDeliveryRequest) ApiUpdateDeliveryStateRequest { + r.orderDeliveryRequest = &orderDeliveryRequest + return r +} + +func (r ApiUpdateDeliveryStateRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateDeliveryStateExecute(r) +} + +/* +UpdateDeliveryState Update delivery state + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdateDeliveryStateRequest +*/ +func (a *UpdateDeliveryStateAPIService) UpdateDeliveryState(ctx context.Context) ApiUpdateDeliveryStateRequest { + return ApiUpdateDeliveryStateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UpdateDeliveryStateAPIService) UpdateDeliveryStateExecute(r ApiUpdateDeliveryStateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateDeliveryStateAPIService.UpdateDeliveryState") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/order/delivery" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.orderDeliveryRequest == nil { + return nil, reportError("orderDeliveryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.orderDeliveryRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_update_menu_notification.go b/api_update_menu_notification.go new file mode 100644 index 0000000..9d7269b --- /dev/null +++ b/api_update_menu_notification.go @@ -0,0 +1,146 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// UpdateMenuNotificationAPIService UpdateMenuNotificationAPI service +type UpdateMenuNotificationAPIService service + +type ApiUpdateMenuNotificationRequest struct { + ctx context.Context + ApiService *UpdateMenuNotificationAPIService + contentType *string + authorization *string + updateMenuNotifRequest *UpdateMenuNotifRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateMenuNotificationRequest) ContentType(contentType string) ApiUpdateMenuNotificationRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateMenuNotificationRequest) Authorization(authorization string) ApiUpdateMenuNotificationRequest { + r.authorization = &authorization + return r +} + +// +func (r ApiUpdateMenuNotificationRequest) UpdateMenuNotifRequest(updateMenuNotifRequest UpdateMenuNotifRequest) ApiUpdateMenuNotificationRequest { + r.updateMenuNotifRequest = &updateMenuNotifRequest + return r +} + +func (r ApiUpdateMenuNotificationRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateMenuNotificationExecute(r) +} + +/* +UpdateMenuNotification Notify Grab of updated menu + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdateMenuNotificationRequest +*/ +func (a *UpdateMenuNotificationAPIService) UpdateMenuNotification(ctx context.Context) ApiUpdateMenuNotificationRequest { + return ApiUpdateMenuNotificationRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UpdateMenuNotificationAPIService) UpdateMenuNotificationExecute(r ApiUpdateMenuNotificationRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateMenuNotificationAPIService.UpdateMenuNotification") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchant/menu/notification" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.updateMenuNotifRequest == nil { + return nil, reportError("updateMenuNotifRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateMenuNotifRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_update_menu_record.go b/api_update_menu_record.go new file mode 100644 index 0000000..bb7c582 --- /dev/null +++ b/api_update_menu_record.go @@ -0,0 +1,277 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// UpdateMenuRecordAPIService UpdateMenuRecordAPI service +type UpdateMenuRecordAPIService service + +type ApiBatchUpdateMenuRequest struct { + ctx context.Context + ApiService *UpdateMenuRecordAPIService + contentType *string + authorization *string + batchUpdateMenuItem *BatchUpdateMenuItem +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiBatchUpdateMenuRequest) ContentType(contentType string) ApiBatchUpdateMenuRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiBatchUpdateMenuRequest) Authorization(authorization string) ApiBatchUpdateMenuRequest { + r.authorization = &authorization + return r +} + +// +func (r ApiBatchUpdateMenuRequest) BatchUpdateMenuItem(batchUpdateMenuItem BatchUpdateMenuItem) ApiBatchUpdateMenuRequest { + r.batchUpdateMenuItem = &batchUpdateMenuItem + return r +} + +func (r ApiBatchUpdateMenuRequest) Execute() (*BatchUpdateMenuResponse, *http.Response, error) { + return r.ApiService.BatchUpdateMenuExecute(r) +} + +/* +BatchUpdateMenu Batch Update Menu + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiBatchUpdateMenuRequest +*/ +func (a *UpdateMenuRecordAPIService) BatchUpdateMenu(ctx context.Context) ApiBatchUpdateMenuRequest { + return ApiBatchUpdateMenuRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return BatchUpdateMenuResponse +func (a *UpdateMenuRecordAPIService) BatchUpdateMenuExecute(r ApiBatchUpdateMenuRequest) (*BatchUpdateMenuResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BatchUpdateMenuResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateMenuRecordAPIService.BatchUpdateMenu") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/batch/menu" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.batchUpdateMenuItem == nil { + return localVarReturnValue, nil, reportError("batchUpdateMenuItem is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.batchUpdateMenuItem + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateMenuRequest struct { + ctx context.Context + ApiService *UpdateMenuRecordAPIService + contentType *string + authorization *string + updateMenuRequest *UpdateMenuRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateMenuRequest) ContentType(contentType string) ApiUpdateMenuRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateMenuRequest) Authorization(authorization string) ApiUpdateMenuRequest { + r.authorization = &authorization + return r +} + +// +func (r ApiUpdateMenuRequest) UpdateMenuRequest(updateMenuRequest UpdateMenuRequest) ApiUpdateMenuRequest { + r.updateMenuRequest = &updateMenuRequest + return r +} + +func (r ApiUpdateMenuRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateMenuExecute(r) +} + +/* +UpdateMenu Update menu record + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdateMenuRequest +*/ +func (a *UpdateMenuRecordAPIService) UpdateMenu(ctx context.Context) ApiUpdateMenuRequest { + return ApiUpdateMenuRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UpdateMenuRecordAPIService) UpdateMenuExecute(r ApiUpdateMenuRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateMenuRecordAPIService.UpdateMenu") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/menu" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.updateMenuRequest == nil { + return nil, reportError("updateMenuRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateMenuRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_update_order_ready_time.go b/api_update_order_ready_time.go new file mode 100644 index 0000000..c03d35e --- /dev/null +++ b/api_update_order_ready_time.go @@ -0,0 +1,155 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// UpdateOrderReadyTimeAPIService UpdateOrderReadyTimeAPI service +type UpdateOrderReadyTimeAPIService service + +type ApiUpdateOrderReadyTimeRequest struct { + ctx context.Context + ApiService *UpdateOrderReadyTimeAPIService + contentType *string + authorization *string + newOrderTimeRequest *NewOrderTimeRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateOrderReadyTimeRequest) ContentType(contentType string) ApiUpdateOrderReadyTimeRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateOrderReadyTimeRequest) Authorization(authorization string) ApiUpdateOrderReadyTimeRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateOrderReadyTimeRequest) NewOrderTimeRequest(newOrderTimeRequest NewOrderTimeRequest) ApiUpdateOrderReadyTimeRequest { + r.newOrderTimeRequest = &newOrderTimeRequest + return r +} + +func (r ApiUpdateOrderReadyTimeRequest) Execute() (*http.Response, error) { + return r.ApiService.UpdateOrderReadyTimeExecute(r) +} + +/* +UpdateOrderReadyTime Update new order ready time + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiUpdateOrderReadyTimeRequest +*/ +func (a *UpdateOrderReadyTimeAPIService) UpdateOrderReadyTime(ctx context.Context) ApiUpdateOrderReadyTimeRequest { + return ApiUpdateOrderReadyTimeRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *UpdateOrderReadyTimeAPIService) UpdateOrderReadyTimeExecute(r ApiUpdateOrderReadyTimeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateOrderReadyTimeAPIService.UpdateOrderReadyTime") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/order/readytime" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return nil, reportError("authorization is required and must be specified") + } + if r.newOrderTimeRequest == nil { + return nil, reportError("newOrderTimeRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.newOrderTimeRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/api_update_store_delivery_hour.go b/api_update_store_delivery_hour.go new file mode 100644 index 0000000..80dee99 --- /dev/null +++ b/api_update_store_delivery_hour.go @@ -0,0 +1,161 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UpdateStoreDeliveryHourAPIService UpdateStoreDeliveryHourAPI service +type UpdateStoreDeliveryHourAPIService service + +type ApiUpdateStoreDeliveryHourRequest struct { + ctx context.Context + ApiService *UpdateStoreDeliveryHourAPIService + contentType *string + authorization *string + merchantID string + updateDeliveryHourRequest *UpdateDeliveryHourRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateStoreDeliveryHourRequest) ContentType(contentType string) ApiUpdateStoreDeliveryHourRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateStoreDeliveryHourRequest) Authorization(authorization string) ApiUpdateStoreDeliveryHourRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateStoreDeliveryHourRequest) UpdateDeliveryHourRequest(updateDeliveryHourRequest UpdateDeliveryHourRequest) ApiUpdateStoreDeliveryHourRequest { + r.updateDeliveryHourRequest = &updateDeliveryHourRequest + return r +} + +func (r ApiUpdateStoreDeliveryHourRequest) Execute() (*UpdateDeliveryHourResponse, *http.Response, error) { + return r.ApiService.UpdateStoreDeliveryHourExecute(r) +} + +/* +UpdateStoreDeliveryHour Update Store Delivery Hours + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantID The merchant's ID that is in GrabFood's database. + @return ApiUpdateStoreDeliveryHourRequest +*/ +func (a *UpdateStoreDeliveryHourAPIService) UpdateStoreDeliveryHour(ctx context.Context, merchantID string) ApiUpdateStoreDeliveryHourRequest { + return ApiUpdateStoreDeliveryHourRequest{ + ApiService: a, + ctx: ctx, + merchantID: merchantID, + } +} + +// Execute executes the request +// @return UpdateDeliveryHourResponse +func (a *UpdateStoreDeliveryHourAPIService) UpdateStoreDeliveryHourExecute(r ApiUpdateStoreDeliveryHourRequest) (*UpdateDeliveryHourResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateDeliveryHourResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateStoreDeliveryHourAPIService.UpdateStoreDeliveryHour") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchants/{merchantID}/store/opening-hours" + localVarPath = strings.Replace(localVarPath, "{"+"merchantID"+"}", url.PathEscape(parameterValueToString(r.merchantID, "merchantID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.updateDeliveryHourRequest == nil { + return localVarReturnValue, nil, reportError("updateDeliveryHourRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateDeliveryHourRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_update_store_dine_in_hour.go b/api_update_store_dine_in_hour.go new file mode 100644 index 0000000..7facfe4 --- /dev/null +++ b/api_update_store_dine_in_hour.go @@ -0,0 +1,161 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UpdateStoreDineInHourAPIService UpdateStoreDineInHourAPI service +type UpdateStoreDineInHourAPIService service + +type ApiUpdateStoreDineInHourRequest struct { + ctx context.Context + ApiService *UpdateStoreDineInHourAPIService + contentType *string + authorization *string + merchantID string + updateDineInHourRequest *UpdateDineInHourRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateStoreDineInHourRequest) ContentType(contentType string) ApiUpdateStoreDineInHourRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateStoreDineInHourRequest) Authorization(authorization string) ApiUpdateStoreDineInHourRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateStoreDineInHourRequest) UpdateDineInHourRequest(updateDineInHourRequest UpdateDineInHourRequest) ApiUpdateStoreDineInHourRequest { + r.updateDineInHourRequest = &updateDineInHourRequest + return r +} + +func (r ApiUpdateStoreDineInHourRequest) Execute() (*UpdateDineInHourResponse, *http.Response, error) { + return r.ApiService.UpdateStoreDineInHourExecute(r) +} + +/* +UpdateStoreDineInHour Update Store Dine-in Hours + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantID The merchant's ID that is in GrabFood's database. + @return ApiUpdateStoreDineInHourRequest +*/ +func (a *UpdateStoreDineInHourAPIService) UpdateStoreDineInHour(ctx context.Context, merchantID string) ApiUpdateStoreDineInHourRequest { + return ApiUpdateStoreDineInHourRequest{ + ApiService: a, + ctx: ctx, + merchantID: merchantID, + } +} + +// Execute executes the request +// @return UpdateDineInHourResponse +func (a *UpdateStoreDineInHourAPIService) UpdateStoreDineInHourExecute(r ApiUpdateStoreDineInHourRequest) (*UpdateDineInHourResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateDineInHourResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateStoreDineInHourAPIService.UpdateStoreDineInHour") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v1/merchants/{merchantID}/store/dine-in-hours" + localVarPath = strings.Replace(localVarPath, "{"+"merchantID"+"}", url.PathEscape(parameterValueToString(r.merchantID, "merchantID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.updateDineInHourRequest == nil { + return localVarReturnValue, nil, reportError("updateDineInHourRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateDineInHourRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/api_update_store_special_hour.go b/api_update_store_special_hour.go new file mode 100644 index 0000000..b4bdc91 --- /dev/null +++ b/api_update_store_special_hour.go @@ -0,0 +1,161 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + + +// UpdateStoreSpecialHourAPIService UpdateStoreSpecialHourAPI service +type UpdateStoreSpecialHourAPIService service + +type ApiUpdateStoreSpecialHourRequest struct { + ctx context.Context + ApiService *UpdateStoreSpecialHourAPIService + contentType *string + authorization *string + merchantID string + updateSpecialHourRequest *UpdateSpecialHourRequest +} + +// The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. +func (r ApiUpdateStoreSpecialHourRequest) ContentType(contentType string) ApiUpdateStoreSpecialHourRequest { + r.contentType = &contentType + return r +} + +// Specify the generated authorization token of the bearer type. +func (r ApiUpdateStoreSpecialHourRequest) Authorization(authorization string) ApiUpdateStoreSpecialHourRequest { + r.authorization = &authorization + return r +} + +func (r ApiUpdateStoreSpecialHourRequest) UpdateSpecialHourRequest(updateSpecialHourRequest UpdateSpecialHourRequest) ApiUpdateStoreSpecialHourRequest { + r.updateSpecialHourRequest = &updateSpecialHourRequest + return r +} + +func (r ApiUpdateStoreSpecialHourRequest) Execute() (*UpdateSpecialHourResponse, *http.Response, error) { + return r.ApiService.UpdateStoreSpecialHourExecute(r) +} + +/* +UpdateStoreSpecialHour Update Store Special Hours + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param merchantID The merchant's ID that is in GrabFood's database. + @return ApiUpdateStoreSpecialHourRequest +*/ +func (a *UpdateStoreSpecialHourAPIService) UpdateStoreSpecialHour(ctx context.Context, merchantID string) ApiUpdateStoreSpecialHourRequest { + return ApiUpdateStoreSpecialHourRequest{ + ApiService: a, + ctx: ctx, + merchantID: merchantID, + } +} + +// Execute executes the request +// @return UpdateSpecialHourResponse +func (a *UpdateStoreSpecialHourAPIService) UpdateStoreSpecialHourExecute(r ApiUpdateStoreSpecialHourRequest) (*UpdateSpecialHourResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UpdateSpecialHourResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UpdateStoreSpecialHourAPIService.UpdateStoreSpecialHour") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/partner/v2/merchants/{merchantID}/store/special-opening-hour" + localVarPath = strings.Replace(localVarPath, "{"+"merchantID"+"}", url.PathEscape(parameterValueToString(r.merchantID, "merchantID")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.contentType == nil { + return localVarReturnValue, nil, reportError("contentType is required and must be specified") + } + if r.authorization == nil { + return localVarReturnValue, nil, reportError("authorization is required and must be specified") + } + if r.updateSpecialHourRequest == nil { + return localVarReturnValue, nil, reportError("updateSpecialHourRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarHeaderParams, "Content-Type", r.contentType, "simple", "") + parameterAddToHeaderOrQuery(localVarHeaderParams, "Authorization", r.authorization, "simple", "") + // body params + localVarPostBody = r.updateSpecialHourRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/client.go b/client.go new file mode 100644 index 0000000..610740e --- /dev/null +++ b/client.go @@ -0,0 +1,727 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) +) + +// APIClient manages communication with the GrabFood API v1.1.3 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AcceptRejectOrderAPI *AcceptRejectOrderAPIService + + CancelOrderAPI *CancelOrderAPIService + + CheckOrderCancelableAPI *CheckOrderCancelableAPIService + + CreateCampaignAPI *CreateCampaignAPIService + + DeleteCampaignAPI *DeleteCampaignAPIService + + EditOrderAPI *EditOrderAPIService + + GetDineinVoucherAPI *GetDineinVoucherAPIService + + GetOauthGrabAPI *GetOauthGrabAPIService + + GetStoreHourAPI *GetStoreHourAPIService + + GetStoreStatusAPI *GetStoreStatusAPIService + + ListCampaignAPI *ListCampaignAPIService + + ListOrdersAPI *ListOrdersAPIService + + MarkOrderReadyAPI *MarkOrderReadyAPIService + + NotifyMembershipWebviewAPI *NotifyMembershipWebviewAPIService + + PauseStoreAPI *PauseStoreAPIService + + RedeemDineinVoucherAPI *RedeemDineinVoucherAPIService + + TraceMenuSyncAPI *TraceMenuSyncAPIService + + UpdateCampaignAPI *UpdateCampaignAPIService + + UpdateDeliveryStateAPI *UpdateDeliveryStateAPIService + + UpdateMenuNotificationAPI *UpdateMenuNotificationAPIService + + UpdateMenuRecordAPI *UpdateMenuRecordAPIService + + UpdateOrderReadyTimeAPI *UpdateOrderReadyTimeAPIService + + UpdateStoreDeliveryHourAPI *UpdateStoreDeliveryHourAPIService + + UpdateStoreDineInHourAPI *UpdateStoreDineInHourAPIService + + UpdateStoreSpecialHourAPI *UpdateStoreSpecialHourAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AcceptRejectOrderAPI = (*AcceptRejectOrderAPIService)(&c.common) + c.CancelOrderAPI = (*CancelOrderAPIService)(&c.common) + c.CheckOrderCancelableAPI = (*CheckOrderCancelableAPIService)(&c.common) + c.CreateCampaignAPI = (*CreateCampaignAPIService)(&c.common) + c.DeleteCampaignAPI = (*DeleteCampaignAPIService)(&c.common) + c.EditOrderAPI = (*EditOrderAPIService)(&c.common) + c.GetDineinVoucherAPI = (*GetDineinVoucherAPIService)(&c.common) + c.GetOauthGrabAPI = (*GetOauthGrabAPIService)(&c.common) + c.GetStoreHourAPI = (*GetStoreHourAPIService)(&c.common) + c.GetStoreStatusAPI = (*GetStoreStatusAPIService)(&c.common) + c.ListCampaignAPI = (*ListCampaignAPIService)(&c.common) + c.ListOrdersAPI = (*ListOrdersAPIService)(&c.common) + c.MarkOrderReadyAPI = (*MarkOrderReadyAPIService)(&c.common) + c.NotifyMembershipWebviewAPI = (*NotifyMembershipWebviewAPIService)(&c.common) + c.PauseStoreAPI = (*PauseStoreAPIService)(&c.common) + c.RedeemDineinVoucherAPI = (*RedeemDineinVoucherAPIService)(&c.common) + c.TraceMenuSyncAPI = (*TraceMenuSyncAPIService)(&c.common) + c.UpdateCampaignAPI = (*UpdateCampaignAPIService)(&c.common) + c.UpdateDeliveryStateAPI = (*UpdateDeliveryStateAPIService)(&c.common) + c.UpdateMenuNotificationAPI = (*UpdateMenuNotificationAPIService)(&c.common) + c.UpdateMenuRecordAPI = (*UpdateMenuRecordAPIService)(&c.common) + c.UpdateOrderReadyTimeAPI = (*UpdateOrderReadyTimeAPIService)(&c.common) + c.UpdateStoreDeliveryHourAPI = (*UpdateStoreDeliveryHourAPIService)(&c.common) + c.UpdateStoreDineInHourAPI = (*UpdateStoreDineInHourAPIService)(&c.common) + c.UpdateStoreSpecialHourAPI = (*UpdateStoreSpecialHourAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/configuration.go b/configuration.go new file mode 100644 index 0000000..afcc664 --- /dev/null +++ b/configuration.go @@ -0,0 +1,247 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// custom const +const ( + StgManualEnv int = 0 // staging environment for manual onboarding partner + StgEnv int = 1 // staging environment for self serve onboarding partner + PrdEnv int = 2 // production environment +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "GrabFood-API-SDK/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "https://partner-api.stg-myteksi.com/grabfood-sandbox", + Description: "Staging Environment - Manual Partner Onboarding", + }, + { + URL: "https://partner-api.grab.com/grabfood-sandbox", + Description: "Staging Environment - Self Serve Partner Onboarding", + }, + { + URL: "https://partner-api.grab.com/grabfood", + Description: "Production Environment", + }, + }, + OperationServers: map[string]ServerConfigurations{ + "GetOauthGrabAPIService.GetOauthGrab": { + { + URL: "https://api.stg-myteksi.com", + Description: "Staging Environment - Manual Partner Onboarding", + }, + { + URL: "https://api.grab.com", + Description: "Staging Environment - Self Serve Partner Onboarding", + }, + { + URL: "https://api.grab.com", + Description: "Production Environment", + }, + }, + }, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/docs/AcceptOrderRequest.md b/docs/AcceptOrderRequest.md new file mode 100644 index 0000000..65ae115 --- /dev/null +++ b/docs/AcceptOrderRequest.md @@ -0,0 +1,72 @@ +# AcceptOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**ToState** | **string** | The order's updated state. | + +## Methods + +### NewAcceptOrderRequest + +`func NewAcceptOrderRequest(orderID string, toState string, ) *AcceptOrderRequest` + +NewAcceptOrderRequest instantiates a new AcceptOrderRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAcceptOrderRequestWithDefaults + +`func NewAcceptOrderRequestWithDefaults() *AcceptOrderRequest` + +NewAcceptOrderRequestWithDefaults instantiates a new AcceptOrderRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *AcceptOrderRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *AcceptOrderRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *AcceptOrderRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetToState + +`func (o *AcceptOrderRequest) GetToState() string` + +GetToState returns the ToState field if non-nil, zero value otherwise. + +### GetToStateOk + +`func (o *AcceptOrderRequest) GetToStateOk() (*string, bool)` + +GetToStateOk returns a tuple with the ToState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToState + +`func (o *AcceptOrderRequest) SetToState(v string)` + +SetToState sets ToState field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AcceptRejectOrderAPI.md b/docs/AcceptRejectOrderAPI.md new file mode 100644 index 0000000..18e91b1 --- /dev/null +++ b/docs/AcceptRejectOrderAPI.md @@ -0,0 +1,75 @@ +# \AcceptRejectOrderAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AcceptRejectOrder**](AcceptRejectOrderAPI.md#AcceptRejectOrder) | **Post** /partner/v1/order/prepare | Manually accept/reject orders + + + +## AcceptRejectOrder + +> AcceptRejectOrder(ctx).Authorization(authorization).ContentType(contentType).AcceptOrderRequest(acceptOrderRequest).Execute() + +Manually accept/reject orders + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + acceptOrderRequest := *grabfood.NewAcceptOrderRequest("123-CYNKLPCVRN5", "ToState_example") // AcceptOrderRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.AcceptRejectOrderAPI.AcceptRejectOrder(context.Background()).Authorization(authorization).ContentType(contentType).AcceptOrderRequest(acceptOrderRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AcceptRejectOrderAPI.AcceptRejectOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiAcceptRejectOrderRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **acceptOrderRequest** | [**AcceptOrderRequest**](AcceptOrderRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/Address.md b/docs/Address.md new file mode 100644 index 0000000..d610ecc --- /dev/null +++ b/docs/Address.md @@ -0,0 +1,212 @@ +# Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UnitNumber** | Pointer to **string** | The delivery address' unit number. | [optional] +**DeliveryInstruction** | Pointer to **string** | Instructions for the delivery. | [optional] +**PoiSource** | Pointer to **string** | POI source | [optional] +**PoiID** | Pointer to **string** | POI ID, empty when poiSource is GRAB. | [optional] +**Address** | Pointer to **string** | The delivery address containing street name, city, postal code, and country. Has value only when poiSource is `GRAB`. | [optional] +**Postcode** | Pointer to **string** | The postcode of the delivery address. Has value only when poiSource is `GRAB`. | [optional] +**Coordinates** | Pointer to [**Coordinates**](Coordinates.md) | | [optional] + +## Methods + +### NewAddress + +`func NewAddress() *Address` + +NewAddress instantiates a new Address object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAddressWithDefaults + +`func NewAddressWithDefaults() *Address` + +NewAddressWithDefaults instantiates a new Address object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUnitNumber + +`func (o *Address) GetUnitNumber() string` + +GetUnitNumber returns the UnitNumber field if non-nil, zero value otherwise. + +### GetUnitNumberOk + +`func (o *Address) GetUnitNumberOk() (*string, bool)` + +GetUnitNumberOk returns a tuple with the UnitNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnitNumber + +`func (o *Address) SetUnitNumber(v string)` + +SetUnitNumber sets UnitNumber field to given value. + +### HasUnitNumber + +`func (o *Address) HasUnitNumber() bool` + +HasUnitNumber returns a boolean if a field has been set. + +### GetDeliveryInstruction + +`func (o *Address) GetDeliveryInstruction() string` + +GetDeliveryInstruction returns the DeliveryInstruction field if non-nil, zero value otherwise. + +### GetDeliveryInstructionOk + +`func (o *Address) GetDeliveryInstructionOk() (*string, bool)` + +GetDeliveryInstructionOk returns a tuple with the DeliveryInstruction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryInstruction + +`func (o *Address) SetDeliveryInstruction(v string)` + +SetDeliveryInstruction sets DeliveryInstruction field to given value. + +### HasDeliveryInstruction + +`func (o *Address) HasDeliveryInstruction() bool` + +HasDeliveryInstruction returns a boolean if a field has been set. + +### GetPoiSource + +`func (o *Address) GetPoiSource() string` + +GetPoiSource returns the PoiSource field if non-nil, zero value otherwise. + +### GetPoiSourceOk + +`func (o *Address) GetPoiSourceOk() (*string, bool)` + +GetPoiSourceOk returns a tuple with the PoiSource field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPoiSource + +`func (o *Address) SetPoiSource(v string)` + +SetPoiSource sets PoiSource field to given value. + +### HasPoiSource + +`func (o *Address) HasPoiSource() bool` + +HasPoiSource returns a boolean if a field has been set. + +### GetPoiID + +`func (o *Address) GetPoiID() string` + +GetPoiID returns the PoiID field if non-nil, zero value otherwise. + +### GetPoiIDOk + +`func (o *Address) GetPoiIDOk() (*string, bool)` + +GetPoiIDOk returns a tuple with the PoiID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPoiID + +`func (o *Address) SetPoiID(v string)` + +SetPoiID sets PoiID field to given value. + +### HasPoiID + +`func (o *Address) HasPoiID() bool` + +HasPoiID returns a boolean if a field has been set. + +### GetAddress + +`func (o *Address) GetAddress() string` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Address) GetAddressOk() (*string, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Address) SetAddress(v string)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *Address) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + +### GetPostcode + +`func (o *Address) GetPostcode() string` + +GetPostcode returns the Postcode field if non-nil, zero value otherwise. + +### GetPostcodeOk + +`func (o *Address) GetPostcodeOk() (*string, bool)` + +GetPostcodeOk returns a tuple with the Postcode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPostcode + +`func (o *Address) SetPostcode(v string)` + +SetPostcode sets Postcode field to given value. + +### HasPostcode + +`func (o *Address) HasPostcode() bool` + +HasPostcode returns a boolean if a field has been set. + +### GetCoordinates + +`func (o *Address) GetCoordinates() Coordinates` + +GetCoordinates returns the Coordinates field if non-nil, zero value otherwise. + +### GetCoordinatesOk + +`func (o *Address) GetCoordinatesOk() (*Coordinates, bool)` + +GetCoordinatesOk returns a tuple with the Coordinates field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCoordinates + +`func (o *Address) SetCoordinates(v Coordinates)` + +SetCoordinates sets Coordinates field to given value. + +### HasCoordinates + +`func (o *Address) HasCoordinates() bool` + +HasCoordinates returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/AdvancedPricing.md b/docs/AdvancedPricing.md new file mode 100644 index 0000000..e46f0be --- /dev/null +++ b/docs/AdvancedPricing.md @@ -0,0 +1,212 @@ +# AdvancedPricing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeliveryOnDemandGrabApp** | Pointer to **int64** | Service type: `Delivery`, Order type: `Instant`, Channel: `Grab App` | [optional] +**DeliveryScheduledGrabApp** | Pointer to **int64** | Service type: `Delivery`, Order type: `Scheduled`, Channel: `Grab App` | [optional] +**SelfPickUpOnDemandGrabApp** | Pointer to **int64** | Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Grab App` | [optional] +**DineInOnDemandGrabApp** | Pointer to **int64** | Service type: `Dine In`, Order type: `Instant`, Channel: `Grab App` | [optional] +**DeliveryOnDemandStoreFront** | Pointer to **int64** | Service type: `Delivery`, Order type: `Instant`, Channel: `Store Front` | [optional] +**DeliveryScheduledStoreFront** | Pointer to **int64** | Service type: `Delivery`, Order type: `Scheduled`, Channel: `Store Front` | [optional] +**SelfPickUpOnDemandStoreFront** | Pointer to **int64** | Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Store Front` | [optional] + +## Methods + +### NewAdvancedPricing + +`func NewAdvancedPricing() *AdvancedPricing` + +NewAdvancedPricing instantiates a new AdvancedPricing object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewAdvancedPricingWithDefaults + +`func NewAdvancedPricingWithDefaults() *AdvancedPricing` + +NewAdvancedPricingWithDefaults instantiates a new AdvancedPricing object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeliveryOnDemandGrabApp + +`func (o *AdvancedPricing) GetDeliveryOnDemandGrabApp() int64` + +GetDeliveryOnDemandGrabApp returns the DeliveryOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetDeliveryOnDemandGrabAppOk + +`func (o *AdvancedPricing) GetDeliveryOnDemandGrabAppOk() (*int64, bool)` + +GetDeliveryOnDemandGrabAppOk returns a tuple with the DeliveryOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryOnDemandGrabApp + +`func (o *AdvancedPricing) SetDeliveryOnDemandGrabApp(v int64)` + +SetDeliveryOnDemandGrabApp sets DeliveryOnDemandGrabApp field to given value. + +### HasDeliveryOnDemandGrabApp + +`func (o *AdvancedPricing) HasDeliveryOnDemandGrabApp() bool` + +HasDeliveryOnDemandGrabApp returns a boolean if a field has been set. + +### GetDeliveryScheduledGrabApp + +`func (o *AdvancedPricing) GetDeliveryScheduledGrabApp() int64` + +GetDeliveryScheduledGrabApp returns the DeliveryScheduledGrabApp field if non-nil, zero value otherwise. + +### GetDeliveryScheduledGrabAppOk + +`func (o *AdvancedPricing) GetDeliveryScheduledGrabAppOk() (*int64, bool)` + +GetDeliveryScheduledGrabAppOk returns a tuple with the DeliveryScheduledGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryScheduledGrabApp + +`func (o *AdvancedPricing) SetDeliveryScheduledGrabApp(v int64)` + +SetDeliveryScheduledGrabApp sets DeliveryScheduledGrabApp field to given value. + +### HasDeliveryScheduledGrabApp + +`func (o *AdvancedPricing) HasDeliveryScheduledGrabApp() bool` + +HasDeliveryScheduledGrabApp returns a boolean if a field has been set. + +### GetSelfPickUpOnDemandGrabApp + +`func (o *AdvancedPricing) GetSelfPickUpOnDemandGrabApp() int64` + +GetSelfPickUpOnDemandGrabApp returns the SelfPickUpOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetSelfPickUpOnDemandGrabAppOk + +`func (o *AdvancedPricing) GetSelfPickUpOnDemandGrabAppOk() (*int64, bool)` + +GetSelfPickUpOnDemandGrabAppOk returns a tuple with the SelfPickUpOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelfPickUpOnDemandGrabApp + +`func (o *AdvancedPricing) SetSelfPickUpOnDemandGrabApp(v int64)` + +SetSelfPickUpOnDemandGrabApp sets SelfPickUpOnDemandGrabApp field to given value. + +### HasSelfPickUpOnDemandGrabApp + +`func (o *AdvancedPricing) HasSelfPickUpOnDemandGrabApp() bool` + +HasSelfPickUpOnDemandGrabApp returns a boolean if a field has been set. + +### GetDineInOnDemandGrabApp + +`func (o *AdvancedPricing) GetDineInOnDemandGrabApp() int64` + +GetDineInOnDemandGrabApp returns the DineInOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetDineInOnDemandGrabAppOk + +`func (o *AdvancedPricing) GetDineInOnDemandGrabAppOk() (*int64, bool)` + +GetDineInOnDemandGrabAppOk returns a tuple with the DineInOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineInOnDemandGrabApp + +`func (o *AdvancedPricing) SetDineInOnDemandGrabApp(v int64)` + +SetDineInOnDemandGrabApp sets DineInOnDemandGrabApp field to given value. + +### HasDineInOnDemandGrabApp + +`func (o *AdvancedPricing) HasDineInOnDemandGrabApp() bool` + +HasDineInOnDemandGrabApp returns a boolean if a field has been set. + +### GetDeliveryOnDemandStoreFront + +`func (o *AdvancedPricing) GetDeliveryOnDemandStoreFront() int64` + +GetDeliveryOnDemandStoreFront returns the DeliveryOnDemandStoreFront field if non-nil, zero value otherwise. + +### GetDeliveryOnDemandStoreFrontOk + +`func (o *AdvancedPricing) GetDeliveryOnDemandStoreFrontOk() (*int64, bool)` + +GetDeliveryOnDemandStoreFrontOk returns a tuple with the DeliveryOnDemandStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryOnDemandStoreFront + +`func (o *AdvancedPricing) SetDeliveryOnDemandStoreFront(v int64)` + +SetDeliveryOnDemandStoreFront sets DeliveryOnDemandStoreFront field to given value. + +### HasDeliveryOnDemandStoreFront + +`func (o *AdvancedPricing) HasDeliveryOnDemandStoreFront() bool` + +HasDeliveryOnDemandStoreFront returns a boolean if a field has been set. + +### GetDeliveryScheduledStoreFront + +`func (o *AdvancedPricing) GetDeliveryScheduledStoreFront() int64` + +GetDeliveryScheduledStoreFront returns the DeliveryScheduledStoreFront field if non-nil, zero value otherwise. + +### GetDeliveryScheduledStoreFrontOk + +`func (o *AdvancedPricing) GetDeliveryScheduledStoreFrontOk() (*int64, bool)` + +GetDeliveryScheduledStoreFrontOk returns a tuple with the DeliveryScheduledStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryScheduledStoreFront + +`func (o *AdvancedPricing) SetDeliveryScheduledStoreFront(v int64)` + +SetDeliveryScheduledStoreFront sets DeliveryScheduledStoreFront field to given value. + +### HasDeliveryScheduledStoreFront + +`func (o *AdvancedPricing) HasDeliveryScheduledStoreFront() bool` + +HasDeliveryScheduledStoreFront returns a boolean if a field has been set. + +### GetSelfPickUpOnDemandStoreFront + +`func (o *AdvancedPricing) GetSelfPickUpOnDemandStoreFront() int64` + +GetSelfPickUpOnDemandStoreFront returns the SelfPickUpOnDemandStoreFront field if non-nil, zero value otherwise. + +### GetSelfPickUpOnDemandStoreFrontOk + +`func (o *AdvancedPricing) GetSelfPickUpOnDemandStoreFrontOk() (*int64, bool)` + +GetSelfPickUpOnDemandStoreFrontOk returns a tuple with the SelfPickUpOnDemandStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelfPickUpOnDemandStoreFront + +`func (o *AdvancedPricing) SetSelfPickUpOnDemandStoreFront(v int64)` + +SetSelfPickUpOnDemandStoreFront sets SelfPickUpOnDemandStoreFront field to given value. + +### HasSelfPickUpOnDemandStoreFront + +`func (o *AdvancedPricing) HasSelfPickUpOnDemandStoreFront() bool` + +HasSelfPickUpOnDemandStoreFront returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateMenuItem.md b/docs/BatchUpdateMenuItem.md new file mode 100644 index 0000000..bedaa4a --- /dev/null +++ b/docs/BatchUpdateMenuItem.md @@ -0,0 +1,98 @@ +# BatchUpdateMenuItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Field** | **string** | The record type that you want to update. | +**MenuEntities** | Pointer to [**[]MenuEntity**](MenuEntity.md) | The items in an array of JSON Object. | [optional] + +## Methods + +### NewBatchUpdateMenuItem + +`func NewBatchUpdateMenuItem(merchantID string, field string, ) *BatchUpdateMenuItem` + +NewBatchUpdateMenuItem instantiates a new BatchUpdateMenuItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchUpdateMenuItemWithDefaults + +`func NewBatchUpdateMenuItemWithDefaults() *BatchUpdateMenuItem` + +NewBatchUpdateMenuItemWithDefaults instantiates a new BatchUpdateMenuItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *BatchUpdateMenuItem) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *BatchUpdateMenuItem) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *BatchUpdateMenuItem) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetField + +`func (o *BatchUpdateMenuItem) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *BatchUpdateMenuItem) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *BatchUpdateMenuItem) SetField(v string)` + +SetField sets Field field to given value. + + +### GetMenuEntities + +`func (o *BatchUpdateMenuItem) GetMenuEntities() []MenuEntity` + +GetMenuEntities returns the MenuEntities field if non-nil, zero value otherwise. + +### GetMenuEntitiesOk + +`func (o *BatchUpdateMenuItem) GetMenuEntitiesOk() (*[]MenuEntity, bool)` + +GetMenuEntitiesOk returns a tuple with the MenuEntities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMenuEntities + +`func (o *BatchUpdateMenuItem) SetMenuEntities(v []MenuEntity)` + +SetMenuEntities sets MenuEntities field to given value. + +### HasMenuEntities + +`func (o *BatchUpdateMenuItem) HasMenuEntities() bool` + +HasMenuEntities returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BatchUpdateMenuResponse.md b/docs/BatchUpdateMenuResponse.md new file mode 100644 index 0000000..16c642b --- /dev/null +++ b/docs/BatchUpdateMenuResponse.md @@ -0,0 +1,118 @@ +# BatchUpdateMenuResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**Status** | Pointer to **string** | The status of this request. | [optional] +**Errors** | Pointer to [**[]MenuEntityError**](MenuEntityError.md) | The error messages when batch update menu record was partial success/fail. `null` when the request was success. | [optional] + +## Methods + +### NewBatchUpdateMenuResponse + +`func NewBatchUpdateMenuResponse() *BatchUpdateMenuResponse` + +NewBatchUpdateMenuResponse instantiates a new BatchUpdateMenuResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBatchUpdateMenuResponseWithDefaults + +`func NewBatchUpdateMenuResponseWithDefaults() *BatchUpdateMenuResponse` + +NewBatchUpdateMenuResponseWithDefaults instantiates a new BatchUpdateMenuResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *BatchUpdateMenuResponse) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *BatchUpdateMenuResponse) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *BatchUpdateMenuResponse) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *BatchUpdateMenuResponse) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetStatus + +`func (o *BatchUpdateMenuResponse) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *BatchUpdateMenuResponse) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *BatchUpdateMenuResponse) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *BatchUpdateMenuResponse) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetErrors + +`func (o *BatchUpdateMenuResponse) GetErrors() []MenuEntityError` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *BatchUpdateMenuResponse) GetErrorsOk() (*[]MenuEntityError, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *BatchUpdateMenuResponse) SetErrors(v []MenuEntityError)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *BatchUpdateMenuResponse) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### SetErrorsNil + +`func (o *BatchUpdateMenuResponse) SetErrorsNil(b bool)` + + SetErrorsNil sets the value for Errors to be an explicit nil + +### UnsetErrors +`func (o *BatchUpdateMenuResponse) UnsetErrors()` + +UnsetErrors ensures that no value is present for Errors, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BindMembershipNativeRequest.md b/docs/BindMembershipNativeRequest.md new file mode 100644 index 0000000..f752a5c --- /dev/null +++ b/docs/BindMembershipNativeRequest.md @@ -0,0 +1,77 @@ +# BindMembershipNativeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GrabID** | **string** | The id used to identify an unique grab user. | +**PhoneNumber** | Pointer to **string** | Grab user phone number used to login. | [optional] + +## Methods + +### NewBindMembershipNativeRequest + +`func NewBindMembershipNativeRequest(grabID string, ) *BindMembershipNativeRequest` + +NewBindMembershipNativeRequest instantiates a new BindMembershipNativeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBindMembershipNativeRequestWithDefaults + +`func NewBindMembershipNativeRequestWithDefaults() *BindMembershipNativeRequest` + +NewBindMembershipNativeRequestWithDefaults instantiates a new BindMembershipNativeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGrabID + +`func (o *BindMembershipNativeRequest) GetGrabID() string` + +GetGrabID returns the GrabID field if non-nil, zero value otherwise. + +### GetGrabIDOk + +`func (o *BindMembershipNativeRequest) GetGrabIDOk() (*string, bool)` + +GetGrabIDOk returns a tuple with the GrabID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrabID + +`func (o *BindMembershipNativeRequest) SetGrabID(v string)` + +SetGrabID sets GrabID field to given value. + + +### GetPhoneNumber + +`func (o *BindMembershipNativeRequest) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *BindMembershipNativeRequest) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *BindMembershipNativeRequest) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *BindMembershipNativeRequest) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/BindMembershipNativeResponse.md b/docs/BindMembershipNativeResponse.md new file mode 100644 index 0000000..073e39c --- /dev/null +++ b/docs/BindMembershipNativeResponse.md @@ -0,0 +1,51 @@ +# BindMembershipNativeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | **string** | The unique member ID on the partner's database. | + +## Methods + +### NewBindMembershipNativeResponse + +`func NewBindMembershipNativeResponse(memberID string, ) *BindMembershipNativeResponse` + +NewBindMembershipNativeResponse instantiates a new BindMembershipNativeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewBindMembershipNativeResponseWithDefaults + +`func NewBindMembershipNativeResponseWithDefaults() *BindMembershipNativeResponse` + +NewBindMembershipNativeResponseWithDefaults instantiates a new BindMembershipNativeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *BindMembershipNativeResponse) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *BindMembershipNativeResponse) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *BindMembershipNativeResponse) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Campaign.md b/docs/Campaign.md new file mode 100644 index 0000000..4df9990 --- /dev/null +++ b/docs/Campaign.md @@ -0,0 +1,218 @@ +# Campaign + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The campaign's ID. | +**CreatedBy** | **string** | The party who created the campaign. Can be created by partners via API, merchants via the merchant app or Grab. | +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Name** | **string** | The campaign's name. | +**Quotas** | Pointer to [**CampaignQuotas**](CampaignQuotas.md) | | [optional] +**Conditions** | Pointer to [**CampaignConditions**](CampaignConditions.md) | | [optional] +**Discount** | Pointer to [**CampaignDiscount**](CampaignDiscount.md) | | [optional] +**CustomTag** | Pointer to **string** | Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. | [optional] + +## Methods + +### NewCampaign + +`func NewCampaign(id string, createdBy string, merchantID string, name string, ) *Campaign` + +NewCampaign instantiates a new Campaign object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCampaignWithDefaults + +`func NewCampaignWithDefaults() *Campaign` + +NewCampaignWithDefaults instantiates a new Campaign object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *Campaign) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Campaign) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *Campaign) SetId(v string)` + +SetId sets Id field to given value. + + +### GetCreatedBy + +`func (o *Campaign) GetCreatedBy() string` + +GetCreatedBy returns the CreatedBy field if non-nil, zero value otherwise. + +### GetCreatedByOk + +`func (o *Campaign) GetCreatedByOk() (*string, bool)` + +GetCreatedByOk returns a tuple with the CreatedBy field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedBy + +`func (o *Campaign) SetCreatedBy(v string)` + +SetCreatedBy sets CreatedBy field to given value. + + +### GetMerchantID + +`func (o *Campaign) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *Campaign) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *Campaign) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetName + +`func (o *Campaign) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Campaign) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Campaign) SetName(v string)` + +SetName sets Name field to given value. + + +### GetQuotas + +`func (o *Campaign) GetQuotas() CampaignQuotas` + +GetQuotas returns the Quotas field if non-nil, zero value otherwise. + +### GetQuotasOk + +`func (o *Campaign) GetQuotasOk() (*CampaignQuotas, bool)` + +GetQuotasOk returns a tuple with the Quotas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuotas + +`func (o *Campaign) SetQuotas(v CampaignQuotas)` + +SetQuotas sets Quotas field to given value. + +### HasQuotas + +`func (o *Campaign) HasQuotas() bool` + +HasQuotas returns a boolean if a field has been set. + +### GetConditions + +`func (o *Campaign) GetConditions() CampaignConditions` + +GetConditions returns the Conditions field if non-nil, zero value otherwise. + +### GetConditionsOk + +`func (o *Campaign) GetConditionsOk() (*CampaignConditions, bool)` + +GetConditionsOk returns a tuple with the Conditions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConditions + +`func (o *Campaign) SetConditions(v CampaignConditions)` + +SetConditions sets Conditions field to given value. + +### HasConditions + +`func (o *Campaign) HasConditions() bool` + +HasConditions returns a boolean if a field has been set. + +### GetDiscount + +`func (o *Campaign) GetDiscount() CampaignDiscount` + +GetDiscount returns the Discount field if non-nil, zero value otherwise. + +### GetDiscountOk + +`func (o *Campaign) GetDiscountOk() (*CampaignDiscount, bool)` + +GetDiscountOk returns a tuple with the Discount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscount + +`func (o *Campaign) SetDiscount(v CampaignDiscount)` + +SetDiscount sets Discount field to given value. + +### HasDiscount + +`func (o *Campaign) HasDiscount() bool` + +HasDiscount returns a boolean if a field has been set. + +### GetCustomTag + +`func (o *Campaign) GetCustomTag() string` + +GetCustomTag returns the CustomTag field if non-nil, zero value otherwise. + +### GetCustomTagOk + +`func (o *Campaign) GetCustomTagOk() (*string, bool)` + +GetCustomTagOk returns a tuple with the CustomTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomTag + +`func (o *Campaign) SetCustomTag(v string)` + +SetCustomTag sets CustomTag field to given value. + +### HasCustomTag + +`func (o *Campaign) HasCustomTag() bool` + +HasCustomTag returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CampaignConditions.md b/docs/CampaignConditions.md new file mode 100644 index 0000000..b832cef --- /dev/null +++ b/docs/CampaignConditions.md @@ -0,0 +1,171 @@ +# CampaignConditions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartTime** | **time.Time** | The campaign's start time in UTC format. For example, 2021-09-23T03:30:00Z means 2021-09-23 11:30:00 (UTC +08:00). | +**EndTime** | **time.Time** | The campaign's end time in UTC format. | +**EaterType** | **string** | The type of eater eligible for the campaign. * `all` - campaign will be applied to everyone. No limitation on campaign type. * `new` - campaign will be applied to consumers who have not ordered from this store in the last three months. Only applicable to **order-level** campaign. | +**MinBasketAmount** | Pointer to **float64** | The minimum basket amount to be eligible for the campaign. Only applicable for **order-level** campaign. For example, 10.5 means the basket amount has to be at least $10.50. | [optional] +**BundleQuantity** | Pointer to **int32** | Specify the bundle quantity for bundle offer campaign. | [optional] +**WorkingHour** | Pointer to [**WorkingHour**](WorkingHour.md) | | [optional] + +## Methods + +### NewCampaignConditions + +`func NewCampaignConditions(startTime time.Time, endTime time.Time, eaterType string, ) *CampaignConditions` + +NewCampaignConditions instantiates a new CampaignConditions object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCampaignConditionsWithDefaults + +`func NewCampaignConditionsWithDefaults() *CampaignConditions` + +NewCampaignConditionsWithDefaults instantiates a new CampaignConditions object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartTime + +`func (o *CampaignConditions) GetStartTime() time.Time` + +GetStartTime returns the StartTime field if non-nil, zero value otherwise. + +### GetStartTimeOk + +`func (o *CampaignConditions) GetStartTimeOk() (*time.Time, bool)` + +GetStartTimeOk returns a tuple with the StartTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartTime + +`func (o *CampaignConditions) SetStartTime(v time.Time)` + +SetStartTime sets StartTime field to given value. + + +### GetEndTime + +`func (o *CampaignConditions) GetEndTime() time.Time` + +GetEndTime returns the EndTime field if non-nil, zero value otherwise. + +### GetEndTimeOk + +`func (o *CampaignConditions) GetEndTimeOk() (*time.Time, bool)` + +GetEndTimeOk returns a tuple with the EndTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndTime + +`func (o *CampaignConditions) SetEndTime(v time.Time)` + +SetEndTime sets EndTime field to given value. + + +### GetEaterType + +`func (o *CampaignConditions) GetEaterType() string` + +GetEaterType returns the EaterType field if non-nil, zero value otherwise. + +### GetEaterTypeOk + +`func (o *CampaignConditions) GetEaterTypeOk() (*string, bool)` + +GetEaterTypeOk returns a tuple with the EaterType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEaterType + +`func (o *CampaignConditions) SetEaterType(v string)` + +SetEaterType sets EaterType field to given value. + + +### GetMinBasketAmount + +`func (o *CampaignConditions) GetMinBasketAmount() float64` + +GetMinBasketAmount returns the MinBasketAmount field if non-nil, zero value otherwise. + +### GetMinBasketAmountOk + +`func (o *CampaignConditions) GetMinBasketAmountOk() (*float64, bool)` + +GetMinBasketAmountOk returns a tuple with the MinBasketAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMinBasketAmount + +`func (o *CampaignConditions) SetMinBasketAmount(v float64)` + +SetMinBasketAmount sets MinBasketAmount field to given value. + +### HasMinBasketAmount + +`func (o *CampaignConditions) HasMinBasketAmount() bool` + +HasMinBasketAmount returns a boolean if a field has been set. + +### GetBundleQuantity + +`func (o *CampaignConditions) GetBundleQuantity() int32` + +GetBundleQuantity returns the BundleQuantity field if non-nil, zero value otherwise. + +### GetBundleQuantityOk + +`func (o *CampaignConditions) GetBundleQuantityOk() (*int32, bool)` + +GetBundleQuantityOk returns a tuple with the BundleQuantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBundleQuantity + +`func (o *CampaignConditions) SetBundleQuantity(v int32)` + +SetBundleQuantity sets BundleQuantity field to given value. + +### HasBundleQuantity + +`func (o *CampaignConditions) HasBundleQuantity() bool` + +HasBundleQuantity returns a boolean if a field has been set. + +### GetWorkingHour + +`func (o *CampaignConditions) GetWorkingHour() WorkingHour` + +GetWorkingHour returns the WorkingHour field if non-nil, zero value otherwise. + +### GetWorkingHourOk + +`func (o *CampaignConditions) GetWorkingHourOk() (*WorkingHour, bool)` + +GetWorkingHourOk returns a tuple with the WorkingHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkingHour + +`func (o *CampaignConditions) SetWorkingHour(v WorkingHour)` + +SetWorkingHour sets WorkingHour field to given value. + +### HasWorkingHour + +`func (o *CampaignConditions) HasWorkingHour() bool` + +HasWorkingHour returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CampaignDiscount.md b/docs/CampaignDiscount.md new file mode 100644 index 0000000..396f422 --- /dev/null +++ b/docs/CampaignDiscount.md @@ -0,0 +1,124 @@ +# CampaignDiscount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The type of discount | +**Cap** | Pointer to **float64** | The maximum discount dollar amount. It is **not required** and will be ignored when the `discount.type` is: - `net` - `delivery` - `freeItem` - `bundleSameNet` - `bundleSamePercentage` - `bundleSameFixPrice` - `bundleDiffNet` - `bundleDiffPercentage` - `bundleDiffFixPrice` | [optional] +**Value** | Pointer to **float64** | Specify the discount amount. Decimal number is not supported For VN, ID and TH. For example, `10.5` is not allowed and it should be `10.0`. * Dollar amount value when `discount.type` is `net`, `delivery`, `bundleSameNet`, `bundleSameFixPrice`, `bundleDiffNet`, `bundleDiffFixPrice`. * Percentage value (0-100) when `discount.type` is `percentage`, `bundleSamePercentage`, `bundleDiffPercentage`. * **Not required** when `discount.type` is `freeItem`. | [optional] +**Scope** | [**CampaignScope**](CampaignScope.md) | | + +## Methods + +### NewCampaignDiscount + +`func NewCampaignDiscount(type_ string, scope CampaignScope, ) *CampaignDiscount` + +NewCampaignDiscount instantiates a new CampaignDiscount object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCampaignDiscountWithDefaults + +`func NewCampaignDiscountWithDefaults() *CampaignDiscount` + +NewCampaignDiscountWithDefaults instantiates a new CampaignDiscount object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *CampaignDiscount) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CampaignDiscount) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CampaignDiscount) SetType(v string)` + +SetType sets Type field to given value. + + +### GetCap + +`func (o *CampaignDiscount) GetCap() float64` + +GetCap returns the Cap field if non-nil, zero value otherwise. + +### GetCapOk + +`func (o *CampaignDiscount) GetCapOk() (*float64, bool)` + +GetCapOk returns a tuple with the Cap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCap + +`func (o *CampaignDiscount) SetCap(v float64)` + +SetCap sets Cap field to given value. + +### HasCap + +`func (o *CampaignDiscount) HasCap() bool` + +HasCap returns a boolean if a field has been set. + +### GetValue + +`func (o *CampaignDiscount) GetValue() float64` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *CampaignDiscount) GetValueOk() (*float64, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *CampaignDiscount) SetValue(v float64)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *CampaignDiscount) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetScope + +`func (o *CampaignDiscount) GetScope() CampaignScope` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *CampaignDiscount) GetScopeOk() (*CampaignScope, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *CampaignDiscount) SetScope(v CampaignScope)` + +SetScope sets Scope field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CampaignQuotas.md b/docs/CampaignQuotas.md new file mode 100644 index 0000000..f8c3b68 --- /dev/null +++ b/docs/CampaignQuotas.md @@ -0,0 +1,82 @@ +# CampaignQuotas + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalCount** | Pointer to **int64** | The maximum number of redemptions. Default is unlimited if unspecified. | [optional] +**TotalCountPerUser** | Pointer to **int64** | The maximum number of redemptions per user. Default is unlimited if unspecified. | [optional] + +## Methods + +### NewCampaignQuotas + +`func NewCampaignQuotas() *CampaignQuotas` + +NewCampaignQuotas instantiates a new CampaignQuotas object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCampaignQuotasWithDefaults + +`func NewCampaignQuotasWithDefaults() *CampaignQuotas` + +NewCampaignQuotasWithDefaults instantiates a new CampaignQuotas object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTotalCount + +`func (o *CampaignQuotas) GetTotalCount() int64` + +GetTotalCount returns the TotalCount field if non-nil, zero value otherwise. + +### GetTotalCountOk + +`func (o *CampaignQuotas) GetTotalCountOk() (*int64, bool)` + +GetTotalCountOk returns a tuple with the TotalCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCount + +`func (o *CampaignQuotas) SetTotalCount(v int64)` + +SetTotalCount sets TotalCount field to given value. + +### HasTotalCount + +`func (o *CampaignQuotas) HasTotalCount() bool` + +HasTotalCount returns a boolean if a field has been set. + +### GetTotalCountPerUser + +`func (o *CampaignQuotas) GetTotalCountPerUser() int64` + +GetTotalCountPerUser returns the TotalCountPerUser field if non-nil, zero value otherwise. + +### GetTotalCountPerUserOk + +`func (o *CampaignQuotas) GetTotalCountPerUserOk() (*int64, bool)` + +GetTotalCountPerUserOk returns a tuple with the TotalCountPerUser field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTotalCountPerUser + +`func (o *CampaignQuotas) SetTotalCountPerUser(v int64)` + +SetTotalCountPerUser sets TotalCountPerUser field to given value. + +### HasTotalCountPerUser + +`func (o *CampaignQuotas) HasTotalCountPerUser() bool` + +HasTotalCountPerUser returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CampaignScope.md b/docs/CampaignScope.md new file mode 100644 index 0000000..939176d --- /dev/null +++ b/docs/CampaignScope.md @@ -0,0 +1,77 @@ +# CampaignScope + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type** | **string** | The scope type for this campaign. * `order` - order level campaign. * `items` - item level campaign or bundle offer. * `category` - category level campaign where all items within applies the same discount. | +**ObjectIDs** | Pointer to **[]string** | The list of item IDs in the partner's database applicable for discount when `discount.scope.type` is `items` (or category IDs for `category`). One and only 1 item supported when `discount.type` is: - `freeItem` - `bundleSameNet` - `bundleSamePercentage` - `bundleSameFixPrice` Minimum 2 - Maximum 20 items supported when `discount.type` is: - `bundleDiffNet` - `bundleDiffPercentage` - `bundleDiffFixPrice` | [optional] + +## Methods + +### NewCampaignScope + +`func NewCampaignScope(type_ string, ) *CampaignScope` + +NewCampaignScope instantiates a new CampaignScope object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCampaignScopeWithDefaults + +`func NewCampaignScopeWithDefaults() *CampaignScope` + +NewCampaignScopeWithDefaults instantiates a new CampaignScope object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetType + +`func (o *CampaignScope) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *CampaignScope) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *CampaignScope) SetType(v string)` + +SetType sets Type field to given value. + + +### GetObjectIDs + +`func (o *CampaignScope) GetObjectIDs() []string` + +GetObjectIDs returns the ObjectIDs field if non-nil, zero value otherwise. + +### GetObjectIDsOk + +`func (o *CampaignScope) GetObjectIDsOk() (*[]string, bool)` + +GetObjectIDsOk returns a tuple with the ObjectIDs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObjectIDs + +`func (o *CampaignScope) SetObjectIDs(v []string)` + +SetObjectIDs sets ObjectIDs field to given value. + +### HasObjectIDs + +`func (o *CampaignScope) HasObjectIDs() bool` + +HasObjectIDs returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelCode.md b/docs/CancelCode.md new file mode 100644 index 0000000..9ded578 --- /dev/null +++ b/docs/CancelCode.md @@ -0,0 +1,17 @@ +# CancelCode + +## Enum + + +* `_1001` (value: `1001`) + +* `_1002` (value: `1002`) + +* `_1003` (value: `1003`) + +* `_1004` (value: `1004`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelOrderAPI.md b/docs/CancelOrderAPI.md new file mode 100644 index 0000000..3c9e412 --- /dev/null +++ b/docs/CancelOrderAPI.md @@ -0,0 +1,77 @@ +# \CancelOrderAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CancelOrder**](CancelOrderAPI.md#CancelOrder) | **Put** /partner/v1/order/cancel | Cancel an order + + + +## CancelOrder + +> CancelOrderResponse CancelOrder(ctx).ContentType(contentType).Authorization(authorization).CancelOrderRequest(cancelOrderRequest).Execute() + +Cancel an order + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + cancelOrderRequest := *grabfood.NewCancelOrderRequest("123-CYNKLPCVRN5", "1-CYNGRUNGSBCCC", grabfood.cancelCode(1001)) // CancelOrderRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.CancelOrderAPI.CancelOrder(context.Background()).ContentType(contentType).Authorization(authorization).CancelOrderRequest(cancelOrderRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CancelOrderAPI.CancelOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CancelOrder`: CancelOrderResponse + fmt.Fprintf(os.Stdout, "Response from `CancelOrderAPI.CancelOrder`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCancelOrderRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **cancelOrderRequest** | [**CancelOrderRequest**](CancelOrderRequest.md) | | + +### Return type + +[**CancelOrderResponse**](CancelOrderResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/CancelOrderLimitType.md b/docs/CancelOrderLimitType.md new file mode 100644 index 0000000..e19e358 --- /dev/null +++ b/docs/CancelOrderLimitType.md @@ -0,0 +1,19 @@ +# CancelOrderLimitType + +## Enum + + +* `NOT_APPROACHING_LIMIT` (value: `"not approaching limit"`) + +* `APPROACHING_THE_DAILY_LIMIT` (value: `"approaching the daily limit"`) + +* `APPROACHING_THE_WEEKLY_LIMIT` (value: `"approaching the weekly limit"`) + +* `APPROACHING_THE_MONTHLY_LIMIT` (value: `"approaching the monthly limit"`) + +* `EMPTY` (value: `""`) + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelOrderRequest.md b/docs/CancelOrderRequest.md new file mode 100644 index 0000000..7096037 --- /dev/null +++ b/docs/CancelOrderRequest.md @@ -0,0 +1,93 @@ +# CancelOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**CancelCode** | [**CancelCode**](CancelCode.md) | | + +## Methods + +### NewCancelOrderRequest + +`func NewCancelOrderRequest(orderID string, merchantID string, cancelCode CancelCode, ) *CancelOrderRequest` + +NewCancelOrderRequest instantiates a new CancelOrderRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCancelOrderRequestWithDefaults + +`func NewCancelOrderRequestWithDefaults() *CancelOrderRequest` + +NewCancelOrderRequestWithDefaults instantiates a new CancelOrderRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *CancelOrderRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *CancelOrderRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *CancelOrderRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetMerchantID + +`func (o *CancelOrderRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *CancelOrderRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *CancelOrderRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetCancelCode + +`func (o *CancelOrderRequest) GetCancelCode() CancelCode` + +GetCancelCode returns the CancelCode field if non-nil, zero value otherwise. + +### GetCancelCodeOk + +`func (o *CancelOrderRequest) GetCancelCodeOk() (*CancelCode, bool)` + +GetCancelCodeOk returns a tuple with the CancelCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelCode + +`func (o *CancelOrderRequest) SetCancelCode(v CancelCode)` + +SetCancelCode sets CancelCode field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelOrderResponse.md b/docs/CancelOrderResponse.md new file mode 100644 index 0000000..e6dd808 --- /dev/null +++ b/docs/CancelOrderResponse.md @@ -0,0 +1,82 @@ +# CancelOrderResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LimitType** | Pointer to [**CancelOrderLimitType**](CancelOrderLimitType.md) | | [optional] +**LimitTimes** | Pointer to **int64** | The remaining cancellation quota for the merchant. A value is only returned when the nearest remaining cancellation limit is approaching, else it returns 0. | [optional] + +## Methods + +### NewCancelOrderResponse + +`func NewCancelOrderResponse() *CancelOrderResponse` + +NewCancelOrderResponse instantiates a new CancelOrderResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCancelOrderResponseWithDefaults + +`func NewCancelOrderResponseWithDefaults() *CancelOrderResponse` + +NewCancelOrderResponseWithDefaults instantiates a new CancelOrderResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLimitType + +`func (o *CancelOrderResponse) GetLimitType() CancelOrderLimitType` + +GetLimitType returns the LimitType field if non-nil, zero value otherwise. + +### GetLimitTypeOk + +`func (o *CancelOrderResponse) GetLimitTypeOk() (*CancelOrderLimitType, bool)` + +GetLimitTypeOk returns a tuple with the LimitType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimitType + +`func (o *CancelOrderResponse) SetLimitType(v CancelOrderLimitType)` + +SetLimitType sets LimitType field to given value. + +### HasLimitType + +`func (o *CancelOrderResponse) HasLimitType() bool` + +HasLimitType returns a boolean if a field has been set. + +### GetLimitTimes + +`func (o *CancelOrderResponse) GetLimitTimes() int64` + +GetLimitTimes returns the LimitTimes field if non-nil, zero value otherwise. + +### GetLimitTimesOk + +`func (o *CancelOrderResponse) GetLimitTimesOk() (*int64, bool)` + +GetLimitTimesOk returns a tuple with the LimitTimes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimitTimes + +`func (o *CancelOrderResponse) SetLimitTimes(v int64)` + +SetLimitTimes sets LimitTimes field to given value. + +### HasLimitTimes + +`func (o *CancelOrderResponse) HasLimitTimes() bool` + +HasLimitTimes returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CancelReason.md b/docs/CancelReason.md new file mode 100644 index 0000000..14b9fb1 --- /dev/null +++ b/docs/CancelReason.md @@ -0,0 +1,82 @@ +# CancelReason + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to [**CancelCode**](CancelCode.md) | | [optional] +**Reason** | Pointer to **string** | The detailed cancel reason for the specific cancel code. - Items are unavailable <code 1001> - I have too many orders now <code 1002> - My shop is closed <code 1003> - My shop is closing soon <code 1004> | [optional] + +## Methods + +### NewCancelReason + +`func NewCancelReason() *CancelReason` + +NewCancelReason instantiates a new CancelReason object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCancelReasonWithDefaults + +`func NewCancelReasonWithDefaults() *CancelReason` + +NewCancelReasonWithDefaults instantiates a new CancelReason object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *CancelReason) GetCode() CancelCode` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *CancelReason) GetCodeOk() (*CancelCode, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *CancelReason) SetCode(v CancelCode)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *CancelReason) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetReason + +`func (o *CancelReason) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *CancelReason) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *CancelReason) SetReason(v string)` + +SetReason sets Reason field to given value. + +### HasReason + +`func (o *CancelReason) HasReason() bool` + +HasReason returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CheckOrderCancelableAPI.md b/docs/CheckOrderCancelableAPI.md new file mode 100644 index 0000000..81e541d --- /dev/null +++ b/docs/CheckOrderCancelableAPI.md @@ -0,0 +1,77 @@ +# \CheckOrderCancelableAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CheckOrderCancelable**](CheckOrderCancelableAPI.md#CheckOrderCancelable) | **Get** /partner/v1/order/cancelable | Check order cancelable + + + +## CheckOrderCancelable + +> CheckOrderCancelableResponse CheckOrderCancelable(ctx).Authorization(authorization).OrderID(orderID).MerchantID(merchantID).Execute() + +Check order cancelable + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + orderID := "orderID_example" // string | + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.CheckOrderCancelableAPI.CheckOrderCancelable(context.Background()).Authorization(authorization).OrderID(orderID).MerchantID(merchantID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CheckOrderCancelableAPI.CheckOrderCancelable``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CheckOrderCancelable`: CheckOrderCancelableResponse + fmt.Fprintf(os.Stdout, "Response from `CheckOrderCancelableAPI.CheckOrderCancelable`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCheckOrderCancelableRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **orderID** | **string** | | + **merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Return type + +[**CheckOrderCancelableResponse**](CheckOrderCancelableResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/CheckOrderCancelableResponse.md b/docs/CheckOrderCancelableResponse.md new file mode 100644 index 0000000..0aa9dd2 --- /dev/null +++ b/docs/CheckOrderCancelableResponse.md @@ -0,0 +1,160 @@ +# CheckOrderCancelableResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CancelAble** | Pointer to **bool** | The boolean value to indicate whether an order can be cancelled. | [optional] +**NonCancellationReason** | Pointer to **string** | The reason for the order to be non-cancelable. | [optional] +**LimitType** | Pointer to [**CancelOrderLimitType**](CancelOrderLimitType.md) | | [optional] +**LimitTimes** | Pointer to **int64** | The remaining cancellation quota for the merchant. A value is only returned when the nearest remaining cancellation limit is approaching, else it returns 0. | [optional] +**CancelReasons** | Pointer to [**[]CancelReason**](CancelReason.md) | An array of cancel order reasons JSON objects. | [optional] + +## Methods + +### NewCheckOrderCancelableResponse + +`func NewCheckOrderCancelableResponse() *CheckOrderCancelableResponse` + +NewCheckOrderCancelableResponse instantiates a new CheckOrderCancelableResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCheckOrderCancelableResponseWithDefaults + +`func NewCheckOrderCancelableResponseWithDefaults() *CheckOrderCancelableResponse` + +NewCheckOrderCancelableResponseWithDefaults instantiates a new CheckOrderCancelableResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCancelAble + +`func (o *CheckOrderCancelableResponse) GetCancelAble() bool` + +GetCancelAble returns the CancelAble field if non-nil, zero value otherwise. + +### GetCancelAbleOk + +`func (o *CheckOrderCancelableResponse) GetCancelAbleOk() (*bool, bool)` + +GetCancelAbleOk returns a tuple with the CancelAble field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelAble + +`func (o *CheckOrderCancelableResponse) SetCancelAble(v bool)` + +SetCancelAble sets CancelAble field to given value. + +### HasCancelAble + +`func (o *CheckOrderCancelableResponse) HasCancelAble() bool` + +HasCancelAble returns a boolean if a field has been set. + +### GetNonCancellationReason + +`func (o *CheckOrderCancelableResponse) GetNonCancellationReason() string` + +GetNonCancellationReason returns the NonCancellationReason field if non-nil, zero value otherwise. + +### GetNonCancellationReasonOk + +`func (o *CheckOrderCancelableResponse) GetNonCancellationReasonOk() (*string, bool)` + +GetNonCancellationReasonOk returns a tuple with the NonCancellationReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNonCancellationReason + +`func (o *CheckOrderCancelableResponse) SetNonCancellationReason(v string)` + +SetNonCancellationReason sets NonCancellationReason field to given value. + +### HasNonCancellationReason + +`func (o *CheckOrderCancelableResponse) HasNonCancellationReason() bool` + +HasNonCancellationReason returns a boolean if a field has been set. + +### GetLimitType + +`func (o *CheckOrderCancelableResponse) GetLimitType() CancelOrderLimitType` + +GetLimitType returns the LimitType field if non-nil, zero value otherwise. + +### GetLimitTypeOk + +`func (o *CheckOrderCancelableResponse) GetLimitTypeOk() (*CancelOrderLimitType, bool)` + +GetLimitTypeOk returns a tuple with the LimitType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimitType + +`func (o *CheckOrderCancelableResponse) SetLimitType(v CancelOrderLimitType)` + +SetLimitType sets LimitType field to given value. + +### HasLimitType + +`func (o *CheckOrderCancelableResponse) HasLimitType() bool` + +HasLimitType returns a boolean if a field has been set. + +### GetLimitTimes + +`func (o *CheckOrderCancelableResponse) GetLimitTimes() int64` + +GetLimitTimes returns the LimitTimes field if non-nil, zero value otherwise. + +### GetLimitTimesOk + +`func (o *CheckOrderCancelableResponse) GetLimitTimesOk() (*int64, bool)` + +GetLimitTimesOk returns a tuple with the LimitTimes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLimitTimes + +`func (o *CheckOrderCancelableResponse) SetLimitTimes(v int64)` + +SetLimitTimes sets LimitTimes field to given value. + +### HasLimitTimes + +`func (o *CheckOrderCancelableResponse) HasLimitTimes() bool` + +HasLimitTimes returns a boolean if a field has been set. + +### GetCancelReasons + +`func (o *CheckOrderCancelableResponse) GetCancelReasons() []CancelReason` + +GetCancelReasons returns the CancelReasons field if non-nil, zero value otherwise. + +### GetCancelReasonsOk + +`func (o *CheckOrderCancelableResponse) GetCancelReasonsOk() (*[]CancelReason, bool)` + +GetCancelReasonsOk returns a tuple with the CancelReasons field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCancelReasons + +`func (o *CheckOrderCancelableResponse) SetCancelReasons(v []CancelReason)` + +SetCancelReasons sets CancelReasons field to given value. + +### HasCancelReasons + +`func (o *CheckOrderCancelableResponse) HasCancelReasons() bool` + +HasCancelReasons returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Coordinates.md b/docs/Coordinates.md new file mode 100644 index 0000000..eded55f --- /dev/null +++ b/docs/Coordinates.md @@ -0,0 +1,82 @@ +# Coordinates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Latitude** | Pointer to **float64** | The latitude coordinates of the delivery address. | [optional] +**Longitude** | Pointer to **float64** | The longitude coordinates of the delivery address. | [optional] + +## Methods + +### NewCoordinates + +`func NewCoordinates() *Coordinates` + +NewCoordinates instantiates a new Coordinates object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCoordinatesWithDefaults + +`func NewCoordinatesWithDefaults() *Coordinates` + +NewCoordinatesWithDefaults instantiates a new Coordinates object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLatitude + +`func (o *Coordinates) GetLatitude() float64` + +GetLatitude returns the Latitude field if non-nil, zero value otherwise. + +### GetLatitudeOk + +`func (o *Coordinates) GetLatitudeOk() (*float64, bool)` + +GetLatitudeOk returns a tuple with the Latitude field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLatitude + +`func (o *Coordinates) SetLatitude(v float64)` + +SetLatitude sets Latitude field to given value. + +### HasLatitude + +`func (o *Coordinates) HasLatitude() bool` + +HasLatitude returns a boolean if a field has been set. + +### GetLongitude + +`func (o *Coordinates) GetLongitude() float64` + +GetLongitude returns the Longitude field if non-nil, zero value otherwise. + +### GetLongitudeOk + +`func (o *Coordinates) GetLongitudeOk() (*float64, bool)` + +GetLongitudeOk returns a tuple with the Longitude field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLongitude + +`func (o *Coordinates) SetLongitude(v float64)` + +SetLongitude sets Longitude field to given value. + +### HasLongitude + +`func (o *Coordinates) HasLongitude() bool` + +HasLongitude returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateCampaignAPI.md b/docs/CreateCampaignAPI.md new file mode 100644 index 0000000..a7f7e2b --- /dev/null +++ b/docs/CreateCampaignAPI.md @@ -0,0 +1,78 @@ +# \CreateCampaignAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateCampaign**](CreateCampaignAPI.md#CreateCampaign) | **Post** /partner/v1/campaigns | Create campaign + + + +## CreateCampaign + +> CreateCampaignResponse CreateCampaign(ctx).ContentType(contentType).Authorization(authorization).CreateCampaignRequest(createCampaignRequest).Execute() + +Create campaign + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + createCampaignRequest := *grabfood.NewCreateCampaignRequest("1-CYNGRUNGSBCCC", "$4 off with min $10 order for all users within weekday", *grabfood.NewCampaignConditions(time.Now(), time.Now(), "EaterType_example"), *grabfood.NewCampaignDiscount("percentage", *grabfood.NewCampaignScope("items"))) // CreateCampaignRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.CreateCampaignAPI.CreateCampaign(context.Background()).ContentType(contentType).Authorization(authorization).CreateCampaignRequest(createCampaignRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `CreateCampaignAPI.CreateCampaign``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateCampaign`: CreateCampaignResponse + fmt.Fprintf(os.Stdout, "Response from `CreateCampaignAPI.CreateCampaign`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateCampaignRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **createCampaignRequest** | [**CreateCampaignRequest**](CreateCampaignRequest.md) | | + +### Return type + +[**CreateCampaignResponse**](CreateCampaignResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/CreateCampaignRequest.md b/docs/CreateCampaignRequest.md new file mode 100644 index 0000000..77e813e --- /dev/null +++ b/docs/CreateCampaignRequest.md @@ -0,0 +1,166 @@ +# CreateCampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Name** | **string** | The campaign's name. | +**Quotas** | Pointer to [**CampaignQuotas**](CampaignQuotas.md) | | [optional] +**Conditions** | [**CampaignConditions**](CampaignConditions.md) | | +**Discount** | [**CampaignDiscount**](CampaignDiscount.md) | | +**CustomTag** | Pointer to **string** | Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. | [optional] + +## Methods + +### NewCreateCampaignRequest + +`func NewCreateCampaignRequest(merchantID string, name string, conditions CampaignConditions, discount CampaignDiscount, ) *CreateCampaignRequest` + +NewCreateCampaignRequest instantiates a new CreateCampaignRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateCampaignRequestWithDefaults + +`func NewCreateCampaignRequestWithDefaults() *CreateCampaignRequest` + +NewCreateCampaignRequestWithDefaults instantiates a new CreateCampaignRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *CreateCampaignRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *CreateCampaignRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *CreateCampaignRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetName + +`func (o *CreateCampaignRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *CreateCampaignRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *CreateCampaignRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetQuotas + +`func (o *CreateCampaignRequest) GetQuotas() CampaignQuotas` + +GetQuotas returns the Quotas field if non-nil, zero value otherwise. + +### GetQuotasOk + +`func (o *CreateCampaignRequest) GetQuotasOk() (*CampaignQuotas, bool)` + +GetQuotasOk returns a tuple with the Quotas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuotas + +`func (o *CreateCampaignRequest) SetQuotas(v CampaignQuotas)` + +SetQuotas sets Quotas field to given value. + +### HasQuotas + +`func (o *CreateCampaignRequest) HasQuotas() bool` + +HasQuotas returns a boolean if a field has been set. + +### GetConditions + +`func (o *CreateCampaignRequest) GetConditions() CampaignConditions` + +GetConditions returns the Conditions field if non-nil, zero value otherwise. + +### GetConditionsOk + +`func (o *CreateCampaignRequest) GetConditionsOk() (*CampaignConditions, bool)` + +GetConditionsOk returns a tuple with the Conditions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConditions + +`func (o *CreateCampaignRequest) SetConditions(v CampaignConditions)` + +SetConditions sets Conditions field to given value. + + +### GetDiscount + +`func (o *CreateCampaignRequest) GetDiscount() CampaignDiscount` + +GetDiscount returns the Discount field if non-nil, zero value otherwise. + +### GetDiscountOk + +`func (o *CreateCampaignRequest) GetDiscountOk() (*CampaignDiscount, bool)` + +GetDiscountOk returns a tuple with the Discount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscount + +`func (o *CreateCampaignRequest) SetDiscount(v CampaignDiscount)` + +SetDiscount sets Discount field to given value. + + +### GetCustomTag + +`func (o *CreateCampaignRequest) GetCustomTag() string` + +GetCustomTag returns the CustomTag field if non-nil, zero value otherwise. + +### GetCustomTagOk + +`func (o *CreateCampaignRequest) GetCustomTagOk() (*string, bool)` + +GetCustomTagOk returns a tuple with the CustomTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomTag + +`func (o *CreateCampaignRequest) SetCustomTag(v string)` + +SetCustomTag sets CustomTag field to given value. + +### HasCustomTag + +`func (o *CreateCampaignRequest) HasCustomTag() bool` + +HasCustomTag returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CreateCampaignResponse.md b/docs/CreateCampaignResponse.md new file mode 100644 index 0000000..87d1f22 --- /dev/null +++ b/docs/CreateCampaignResponse.md @@ -0,0 +1,56 @@ +# CreateCampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The campaign's ID. | [optional] + +## Methods + +### NewCreateCampaignResponse + +`func NewCreateCampaignResponse() *CreateCampaignResponse` + +NewCreateCampaignResponse instantiates a new CreateCampaignResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCreateCampaignResponseWithDefaults + +`func NewCreateCampaignResponseWithDefaults() *CreateCampaignResponse` + +NewCreateCampaignResponseWithDefaults instantiates a new CreateCampaignResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *CreateCampaignResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *CreateCampaignResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *CreateCampaignResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *CreateCampaignResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Currency.md b/docs/Currency.md new file mode 100644 index 0000000..d851e9e --- /dev/null +++ b/docs/Currency.md @@ -0,0 +1,93 @@ +# Currency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **string** | The three-letter ISO currency code. This is the currency that is associated with the payment amount. | +**Symbol** | **string** | The currency symbol. | +**Exponent** | **int32** | The log base 10 of the number of times we have to multiply the major unit to get the minor unit. Should be 0 for VN and 2 for other countries (SG/MY/ID/TH/PH/KH). | + +## Methods + +### NewCurrency + +`func NewCurrency(code string, symbol string, exponent int32, ) *Currency` + +NewCurrency instantiates a new Currency object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewCurrencyWithDefaults + +`func NewCurrencyWithDefaults() *Currency` + +NewCurrencyWithDefaults instantiates a new Currency object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *Currency) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *Currency) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *Currency) SetCode(v string)` + +SetCode sets Code field to given value. + + +### GetSymbol + +`func (o *Currency) GetSymbol() string` + +GetSymbol returns the Symbol field if non-nil, zero value otherwise. + +### GetSymbolOk + +`func (o *Currency) GetSymbolOk() (*string, bool)` + +GetSymbolOk returns a tuple with the Symbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSymbol + +`func (o *Currency) SetSymbol(v string)` + +SetSymbol sets Symbol field to given value. + + +### GetExponent + +`func (o *Currency) GetExponent() int32` + +GetExponent returns the Exponent field if non-nil, zero value otherwise. + +### GetExponentOk + +`func (o *Currency) GetExponentOk() (*int32, bool)` + +GetExponentOk returns a tuple with the Exponent field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExponent + +`func (o *Currency) SetExponent(v int32)` + +SetExponent sets Exponent field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeleteCampaignAPI.md b/docs/DeleteCampaignAPI.md new file mode 100644 index 0000000..4f13a47 --- /dev/null +++ b/docs/DeleteCampaignAPI.md @@ -0,0 +1,77 @@ +# \DeleteCampaignAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteCampaign**](DeleteCampaignAPI.md#DeleteCampaign) | **Delete** /partner/v1/campaigns/{campaign_id} | Delete campaigns + + + +## DeleteCampaign + +> DeleteCampaign(ctx, campaignId).Authorization(authorization).Execute() + +Delete campaigns + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + campaignId := "campaignId_example" // string | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.DeleteCampaignAPI.DeleteCampaign(context.Background(), campaignId).Authorization(authorization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DeleteCampaignAPI.DeleteCampaign``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**campaignId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteCampaignRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/DineIn.md b/docs/DineIn.md new file mode 100644 index 0000000..5cbcde4 --- /dev/null +++ b/docs/DineIn.md @@ -0,0 +1,82 @@ +# DineIn + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TableID** | Pointer to **string** | Table number. | [optional] +**EaterCount** | Pointer to **int64** | The number of eaters. | [optional] + +## Methods + +### NewDineIn + +`func NewDineIn() *DineIn` + +NewDineIn instantiates a new DineIn object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDineInWithDefaults + +`func NewDineInWithDefaults() *DineIn` + +NewDineInWithDefaults instantiates a new DineIn object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTableID + +`func (o *DineIn) GetTableID() string` + +GetTableID returns the TableID field if non-nil, zero value otherwise. + +### GetTableIDOk + +`func (o *DineIn) GetTableIDOk() (*string, bool)` + +GetTableIDOk returns a tuple with the TableID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTableID + +`func (o *DineIn) SetTableID(v string)` + +SetTableID sets TableID field to given value. + +### HasTableID + +`func (o *DineIn) HasTableID() bool` + +HasTableID returns a boolean if a field has been set. + +### GetEaterCount + +`func (o *DineIn) GetEaterCount() int64` + +GetEaterCount returns the EaterCount field if non-nil, zero value otherwise. + +### GetEaterCountOk + +`func (o *DineIn) GetEaterCountOk() (*int64, bool)` + +GetEaterCountOk returns a tuple with the EaterCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEaterCount + +`func (o *DineIn) SetEaterCount(v int64)` + +SetEaterCount sets EaterCount field to given value. + +### HasEaterCount + +`func (o *DineIn) HasEaterCount() bool` + +HasEaterCount returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditOrderAPI.md b/docs/EditOrderAPI.md new file mode 100644 index 0000000..fa95e09 --- /dev/null +++ b/docs/EditOrderAPI.md @@ -0,0 +1,81 @@ +# \EditOrderAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**EditOrder**](EditOrderAPI.md#EditOrder) | **Put** /partner/v1/orders/{orderID} | Edit Order + + + +## EditOrder + +> EditOrder(ctx, orderID).ContentType(contentType).Authorization(authorization).EditOrderRequest(editOrderRequest).Execute() + +Edit Order + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + orderID := "orderID_example" // string | + editOrderRequest := *grabfood.NewEditOrderRequest("123-CYNKLPCVRN5", []grabfood.EditOrderItem{*grabfood.NewEditOrderItem("IDGFSTI000004qy1490868132306763533", "UPDATED")}) // EditOrderRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.EditOrderAPI.EditOrder(context.Background(), orderID).ContentType(contentType).Authorization(authorization).EditOrderRequest(editOrderRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `EditOrderAPI.EditOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orderID** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiEditOrderRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + **editOrderRequest** | [**EditOrderRequest**](EditOrderRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/EditOrderItem.md b/docs/EditOrderItem.md new file mode 100644 index 0000000..3ed86e7 --- /dev/null +++ b/docs/EditOrderItem.md @@ -0,0 +1,124 @@ +# EditOrderItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ItemID** | **string** | The item's ID in Grab system that can be obtained from the [Submit Order Webhook](#tag/submit-order-webhook/operation/submit-order-webhook) request payload parameters under `items[].grabItemID`, or `items[].outOfStockInstruction.replacementGrabItemID` for item replacement. External item ID from Partner system is only supported when `ADDED` status and `isExternalItemID: true`. | +**Status** | **string** | The item's edited status. Leave empty string if there is no change to the item. | +**Quantity** | Pointer to **int64** | The item's quantity. If the item is not being updated or deleted, use the original quantity. | [optional] +**IsExternalItemID** | Pointer to **bool** | Only applicable for `ADDED`status. Indicate if the `itemID` is an external item ID. Grab checks for the items that are mapped to the provided item ID, considering their availability. If multiple Grab items are found to be mapped to the provided external item ID, the last updated item will be chosen. If no suitable record is found, an 400 error will be returned to the partner, indicating that the submitted external item ID cannot be edited. | [optional] + +## Methods + +### NewEditOrderItem + +`func NewEditOrderItem(itemID string, status string, ) *EditOrderItem` + +NewEditOrderItem instantiates a new EditOrderItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEditOrderItemWithDefaults + +`func NewEditOrderItemWithDefaults() *EditOrderItem` + +NewEditOrderItemWithDefaults instantiates a new EditOrderItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItemID + +`func (o *EditOrderItem) GetItemID() string` + +GetItemID returns the ItemID field if non-nil, zero value otherwise. + +### GetItemIDOk + +`func (o *EditOrderItem) GetItemIDOk() (*string, bool)` + +GetItemIDOk returns a tuple with the ItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemID + +`func (o *EditOrderItem) SetItemID(v string)` + +SetItemID sets ItemID field to given value. + + +### GetStatus + +`func (o *EditOrderItem) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *EditOrderItem) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *EditOrderItem) SetStatus(v string)` + +SetStatus sets Status field to given value. + + +### GetQuantity + +`func (o *EditOrderItem) GetQuantity() int64` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *EditOrderItem) GetQuantityOk() (*int64, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *EditOrderItem) SetQuantity(v int64)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *EditOrderItem) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetIsExternalItemID + +`func (o *EditOrderItem) GetIsExternalItemID() bool` + +GetIsExternalItemID returns the IsExternalItemID field if non-nil, zero value otherwise. + +### GetIsExternalItemIDOk + +`func (o *EditOrderItem) GetIsExternalItemIDOk() (*bool, bool)` + +GetIsExternalItemIDOk returns a tuple with the IsExternalItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsExternalItemID + +`func (o *EditOrderItem) SetIsExternalItemID(v bool)` + +SetIsExternalItemID sets IsExternalItemID field to given value. + +### HasIsExternalItemID + +`func (o *EditOrderItem) HasIsExternalItemID() bool` + +HasIsExternalItemID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EditOrderRequest.md b/docs/EditOrderRequest.md new file mode 100644 index 0000000..19140fd --- /dev/null +++ b/docs/EditOrderRequest.md @@ -0,0 +1,98 @@ +# EditOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**Items** | [**[]EditOrderItem**](EditOrderItem.md) | Specify the array of all items in the order, including deleted, added, updated and unchanged items. | +**OnlyRecalculate** | Pointer to **bool** | This parameter specifies whether to recalculate the edited order without submitting it. It is intended for testing purposes only. This parameter is set to false by default, which means the edited order will be recalculated and re-submitted to partners. | [optional] + +## Methods + +### NewEditOrderRequest + +`func NewEditOrderRequest(orderID string, items []EditOrderItem, ) *EditOrderRequest` + +NewEditOrderRequest instantiates a new EditOrderRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewEditOrderRequestWithDefaults + +`func NewEditOrderRequestWithDefaults() *EditOrderRequest` + +NewEditOrderRequestWithDefaults instantiates a new EditOrderRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *EditOrderRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *EditOrderRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *EditOrderRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetItems + +`func (o *EditOrderRequest) GetItems() []EditOrderItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *EditOrderRequest) GetItemsOk() (*[]EditOrderItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *EditOrderRequest) SetItems(v []EditOrderItem)` + +SetItems sets Items field to given value. + + +### GetOnlyRecalculate + +`func (o *EditOrderRequest) GetOnlyRecalculate() bool` + +GetOnlyRecalculate returns the OnlyRecalculate field if non-nil, zero value otherwise. + +### GetOnlyRecalculateOk + +`func (o *EditOrderRequest) GetOnlyRecalculateOk() (*bool, bool)` + +GetOnlyRecalculateOk returns a tuple with the OnlyRecalculate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOnlyRecalculate + +`func (o *EditOrderRequest) SetOnlyRecalculate(v bool)` + +SetOnlyRecalculate sets OnlyRecalculate field to given value. + +### HasOnlyRecalculate + +`func (o *EditOrderRequest) HasOnlyRecalculate() bool` + +HasOnlyRecalculate returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Error.md b/docs/Error.md new file mode 100644 index 0000000..00d452d --- /dev/null +++ b/docs/Error.md @@ -0,0 +1,108 @@ +# Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Target** | Pointer to **string** | Target of error | [optional] +**Reason** | Pointer to **string** | The type of error. | [optional] +**Message** | Pointer to **string** | The details of the error. | [optional] + +## Methods + +### NewError + +`func NewError() *Error` + +NewError instantiates a new Error object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewErrorWithDefaults + +`func NewErrorWithDefaults() *Error` + +NewErrorWithDefaults instantiates a new Error object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTarget + +`func (o *Error) GetTarget() string` + +GetTarget returns the Target field if non-nil, zero value otherwise. + +### GetTargetOk + +`func (o *Error) GetTargetOk() (*string, bool)` + +GetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTarget + +`func (o *Error) SetTarget(v string)` + +SetTarget sets Target field to given value. + +### HasTarget + +`func (o *Error) HasTarget() bool` + +HasTarget returns a boolean if a field has been set. + +### GetReason + +`func (o *Error) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *Error) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *Error) SetReason(v string)` + +SetReason sets Reason field to given value. + +### HasReason + +`func (o *Error) HasReason() bool` + +HasReason returns a boolean if a field has been set. + +### GetMessage + +`func (o *Error) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *Error) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *Error) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *Error) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetDineInVoucherResponse.md b/docs/GetDineInVoucherResponse.md new file mode 100644 index 0000000..65a428f --- /dev/null +++ b/docs/GetDineInVoucherResponse.md @@ -0,0 +1,186 @@ +# GetDineInVoucherResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CertificateID** | Pointer to **string** | This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. | [optional] +**VoucherCode** | Pointer to **string** | A short code for the dine-in voucher purchased by the user. | [optional] +**Voucher** | Pointer to [**Voucher**](Voucher.md) | | [optional] +**VoucherStatus** | Pointer to **string** | The status of the dine-in voucher purchased. Only active voucher is eligible for redemption. | [optional] +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**CampaignID** | Pointer to **string** | The dine-in voucher campaign's ID in GrabFood's database. | [optional] + +## Methods + +### NewGetDineInVoucherResponse + +`func NewGetDineInVoucherResponse() *GetDineInVoucherResponse` + +NewGetDineInVoucherResponse instantiates a new GetDineInVoucherResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetDineInVoucherResponseWithDefaults + +`func NewGetDineInVoucherResponseWithDefaults() *GetDineInVoucherResponse` + +NewGetDineInVoucherResponseWithDefaults instantiates a new GetDineInVoucherResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCertificateID + +`func (o *GetDineInVoucherResponse) GetCertificateID() string` + +GetCertificateID returns the CertificateID field if non-nil, zero value otherwise. + +### GetCertificateIDOk + +`func (o *GetDineInVoucherResponse) GetCertificateIDOk() (*string, bool)` + +GetCertificateIDOk returns a tuple with the CertificateID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCertificateID + +`func (o *GetDineInVoucherResponse) SetCertificateID(v string)` + +SetCertificateID sets CertificateID field to given value. + +### HasCertificateID + +`func (o *GetDineInVoucherResponse) HasCertificateID() bool` + +HasCertificateID returns a boolean if a field has been set. + +### GetVoucherCode + +`func (o *GetDineInVoucherResponse) GetVoucherCode() string` + +GetVoucherCode returns the VoucherCode field if non-nil, zero value otherwise. + +### GetVoucherCodeOk + +`func (o *GetDineInVoucherResponse) GetVoucherCodeOk() (*string, bool)` + +GetVoucherCodeOk returns a tuple with the VoucherCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucherCode + +`func (o *GetDineInVoucherResponse) SetVoucherCode(v string)` + +SetVoucherCode sets VoucherCode field to given value. + +### HasVoucherCode + +`func (o *GetDineInVoucherResponse) HasVoucherCode() bool` + +HasVoucherCode returns a boolean if a field has been set. + +### GetVoucher + +`func (o *GetDineInVoucherResponse) GetVoucher() Voucher` + +GetVoucher returns the Voucher field if non-nil, zero value otherwise. + +### GetVoucherOk + +`func (o *GetDineInVoucherResponse) GetVoucherOk() (*Voucher, bool)` + +GetVoucherOk returns a tuple with the Voucher field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucher + +`func (o *GetDineInVoucherResponse) SetVoucher(v Voucher)` + +SetVoucher sets Voucher field to given value. + +### HasVoucher + +`func (o *GetDineInVoucherResponse) HasVoucher() bool` + +HasVoucher returns a boolean if a field has been set. + +### GetVoucherStatus + +`func (o *GetDineInVoucherResponse) GetVoucherStatus() string` + +GetVoucherStatus returns the VoucherStatus field if non-nil, zero value otherwise. + +### GetVoucherStatusOk + +`func (o *GetDineInVoucherResponse) GetVoucherStatusOk() (*string, bool)` + +GetVoucherStatusOk returns a tuple with the VoucherStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucherStatus + +`func (o *GetDineInVoucherResponse) SetVoucherStatus(v string)` + +SetVoucherStatus sets VoucherStatus field to given value. + +### HasVoucherStatus + +`func (o *GetDineInVoucherResponse) HasVoucherStatus() bool` + +HasVoucherStatus returns a boolean if a field has been set. + +### GetMerchantID + +`func (o *GetDineInVoucherResponse) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *GetDineInVoucherResponse) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *GetDineInVoucherResponse) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *GetDineInVoucherResponse) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetCampaignID + +`func (o *GetDineInVoucherResponse) GetCampaignID() string` + +GetCampaignID returns the CampaignID field if non-nil, zero value otherwise. + +### GetCampaignIDOk + +`func (o *GetDineInVoucherResponse) GetCampaignIDOk() (*string, bool)` + +GetCampaignIDOk returns a tuple with the CampaignID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCampaignID + +`func (o *GetDineInVoucherResponse) SetCampaignID(v string)` + +SetCampaignID sets CampaignID field to given value. + +### HasCampaignID + +`func (o *GetDineInVoucherResponse) HasCampaignID() bool` + +HasCampaignID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetDineinVoucherAPI.md b/docs/GetDineinVoucherAPI.md new file mode 100644 index 0000000..41879c9 --- /dev/null +++ b/docs/GetDineinVoucherAPI.md @@ -0,0 +1,79 @@ +# \GetDineinVoucherAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetDineinVoucher**](GetDineinVoucherAPI.md#GetDineinVoucher) | **Get** /partner/v1/dinein/voucher | Get Dine In Voucher + + + +## GetDineinVoucher + +> GetDineInVoucherResponse GetDineinVoucher(ctx).Authorization(authorization).MerchantID(merchantID).VoucherCode(voucherCode).CertificateID(certificateID).Execute() + +Get Dine In Voucher + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "merchantID_example" // string | + voucherCode := "voucherCode_example" // string | A short code for the dine-in voucher purchased by the user. Required if `certificateID` is not specified. (optional) + certificateID := "certificateID_example" // string | This certificateID is decoded from scanning the QR code, and 1:1 mapping with voucherCode. Required if `voucherCode` is not specified. (optional) + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.GetDineinVoucherAPI.GetDineinVoucher(context.Background()).Authorization(authorization).MerchantID(merchantID).VoucherCode(voucherCode).CertificateID(certificateID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GetDineinVoucherAPI.GetDineinVoucher``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetDineinVoucher`: GetDineInVoucherResponse + fmt.Fprintf(os.Stdout, "Response from `GetDineinVoucherAPI.GetDineinVoucher`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetDineinVoucherRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **merchantID** | **string** | | + **voucherCode** | **string** | A short code for the dine-in voucher purchased by the user. Required if `certificateID` is not specified. | + **certificateID** | **string** | This certificateID is decoded from scanning the QR code, and 1:1 mapping with voucherCode. Required if `voucherCode` is not specified. | + +### Return type + +[**GetDineInVoucherResponse**](GetDineInVoucherResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/GetMembershipNativeResponse.md b/docs/GetMembershipNativeResponse.md new file mode 100644 index 0000000..bb77335 --- /dev/null +++ b/docs/GetMembershipNativeResponse.md @@ -0,0 +1,108 @@ +# GetMembershipNativeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MembershipStatus** | Pointer to **string** | Status of the memberID. | [optional] +**PointInfo** | Pointer to [**GetMembershipNativeResponsePointInfo**](GetMembershipNativeResponsePointInfo.md) | | [optional] +**PointsExpireDate** | Pointer to **string** | Earliest points expiry date. In `yyyy-mm-dd` format | [optional] + +## Methods + +### NewGetMembershipNativeResponse + +`func NewGetMembershipNativeResponse() *GetMembershipNativeResponse` + +NewGetMembershipNativeResponse instantiates a new GetMembershipNativeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMembershipNativeResponseWithDefaults + +`func NewGetMembershipNativeResponseWithDefaults() *GetMembershipNativeResponse` + +NewGetMembershipNativeResponseWithDefaults instantiates a new GetMembershipNativeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMembershipStatus + +`func (o *GetMembershipNativeResponse) GetMembershipStatus() string` + +GetMembershipStatus returns the MembershipStatus field if non-nil, zero value otherwise. + +### GetMembershipStatusOk + +`func (o *GetMembershipNativeResponse) GetMembershipStatusOk() (*string, bool)` + +GetMembershipStatusOk returns a tuple with the MembershipStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembershipStatus + +`func (o *GetMembershipNativeResponse) SetMembershipStatus(v string)` + +SetMembershipStatus sets MembershipStatus field to given value. + +### HasMembershipStatus + +`func (o *GetMembershipNativeResponse) HasMembershipStatus() bool` + +HasMembershipStatus returns a boolean if a field has been set. + +### GetPointInfo + +`func (o *GetMembershipNativeResponse) GetPointInfo() GetMembershipNativeResponsePointInfo` + +GetPointInfo returns the PointInfo field if non-nil, zero value otherwise. + +### GetPointInfoOk + +`func (o *GetMembershipNativeResponse) GetPointInfoOk() (*GetMembershipNativeResponsePointInfo, bool)` + +GetPointInfoOk returns a tuple with the PointInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPointInfo + +`func (o *GetMembershipNativeResponse) SetPointInfo(v GetMembershipNativeResponsePointInfo)` + +SetPointInfo sets PointInfo field to given value. + +### HasPointInfo + +`func (o *GetMembershipNativeResponse) HasPointInfo() bool` + +HasPointInfo returns a boolean if a field has been set. + +### GetPointsExpireDate + +`func (o *GetMembershipNativeResponse) GetPointsExpireDate() string` + +GetPointsExpireDate returns the PointsExpireDate field if non-nil, zero value otherwise. + +### GetPointsExpireDateOk + +`func (o *GetMembershipNativeResponse) GetPointsExpireDateOk() (*string, bool)` + +GetPointsExpireDateOk returns a tuple with the PointsExpireDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPointsExpireDate + +`func (o *GetMembershipNativeResponse) SetPointsExpireDate(v string)` + +SetPointsExpireDate sets PointsExpireDate field to given value. + +### HasPointsExpireDate + +`func (o *GetMembershipNativeResponse) HasPointsExpireDate() bool` + +HasPointsExpireDate returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMembershipNativeResponsePointInfo.md b/docs/GetMembershipNativeResponsePointInfo.md new file mode 100644 index 0000000..efe5f2f --- /dev/null +++ b/docs/GetMembershipNativeResponsePointInfo.md @@ -0,0 +1,108 @@ +# GetMembershipNativeResponsePointInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CurrentPoints** | Pointer to **int64** | Point that user currently obtained. | [optional] +**MaxPoints** | Pointer to **int64** | Maximum point that user can obtain. | [optional] +**ExpirePoints** | Pointer to **int64** | Points that would get expired in future. | [optional] + +## Methods + +### NewGetMembershipNativeResponsePointInfo + +`func NewGetMembershipNativeResponsePointInfo() *GetMembershipNativeResponsePointInfo` + +NewGetMembershipNativeResponsePointInfo instantiates a new GetMembershipNativeResponsePointInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMembershipNativeResponsePointInfoWithDefaults + +`func NewGetMembershipNativeResponsePointInfoWithDefaults() *GetMembershipNativeResponsePointInfo` + +NewGetMembershipNativeResponsePointInfoWithDefaults instantiates a new GetMembershipNativeResponsePointInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCurrentPoints + +`func (o *GetMembershipNativeResponsePointInfo) GetCurrentPoints() int64` + +GetCurrentPoints returns the CurrentPoints field if non-nil, zero value otherwise. + +### GetCurrentPointsOk + +`func (o *GetMembershipNativeResponsePointInfo) GetCurrentPointsOk() (*int64, bool)` + +GetCurrentPointsOk returns a tuple with the CurrentPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrentPoints + +`func (o *GetMembershipNativeResponsePointInfo) SetCurrentPoints(v int64)` + +SetCurrentPoints sets CurrentPoints field to given value. + +### HasCurrentPoints + +`func (o *GetMembershipNativeResponsePointInfo) HasCurrentPoints() bool` + +HasCurrentPoints returns a boolean if a field has been set. + +### GetMaxPoints + +`func (o *GetMembershipNativeResponsePointInfo) GetMaxPoints() int64` + +GetMaxPoints returns the MaxPoints field if non-nil, zero value otherwise. + +### GetMaxPointsOk + +`func (o *GetMembershipNativeResponsePointInfo) GetMaxPointsOk() (*int64, bool)` + +GetMaxPointsOk returns a tuple with the MaxPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxPoints + +`func (o *GetMembershipNativeResponsePointInfo) SetMaxPoints(v int64)` + +SetMaxPoints sets MaxPoints field to given value. + +### HasMaxPoints + +`func (o *GetMembershipNativeResponsePointInfo) HasMaxPoints() bool` + +HasMaxPoints returns a boolean if a field has been set. + +### GetExpirePoints + +`func (o *GetMembershipNativeResponsePointInfo) GetExpirePoints() int64` + +GetExpirePoints returns the ExpirePoints field if non-nil, zero value otherwise. + +### GetExpirePointsOk + +`func (o *GetMembershipNativeResponsePointInfo) GetExpirePointsOk() (*int64, bool)` + +GetExpirePointsOk returns a tuple with the ExpirePoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpirePoints + +`func (o *GetMembershipNativeResponsePointInfo) SetExpirePoints(v int64)` + +SetExpirePoints sets ExpirePoints field to given value. + +### HasExpirePoints + +`func (o *GetMembershipNativeResponsePointInfo) HasExpirePoints() bool` + +HasExpirePoints returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMembershipRequest.md b/docs/GetMembershipRequest.md new file mode 100644 index 0000000..7ace1e3 --- /dev/null +++ b/docs/GetMembershipRequest.md @@ -0,0 +1,51 @@ +# GetMembershipRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | **string** | The unique member ID on the partner's database. | + +## Methods + +### NewGetMembershipRequest + +`func NewGetMembershipRequest(memberID string, ) *GetMembershipRequest` + +NewGetMembershipRequest instantiates a new GetMembershipRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMembershipRequestWithDefaults + +`func NewGetMembershipRequestWithDefaults() *GetMembershipRequest` + +NewGetMembershipRequestWithDefaults instantiates a new GetMembershipRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *GetMembershipRequest) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *GetMembershipRequest) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *GetMembershipRequest) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMembershipWebviewResponse.md b/docs/GetMembershipWebviewResponse.md new file mode 100644 index 0000000..1e6b6fb --- /dev/null +++ b/docs/GetMembershipWebviewResponse.md @@ -0,0 +1,56 @@ +# GetMembershipWebviewResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MembershipStatus** | Pointer to **string** | Status of the memberID. | [optional] + +## Methods + +### NewGetMembershipWebviewResponse + +`func NewGetMembershipWebviewResponse() *GetMembershipWebviewResponse` + +NewGetMembershipWebviewResponse instantiates a new GetMembershipWebviewResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMembershipWebviewResponseWithDefaults + +`func NewGetMembershipWebviewResponseWithDefaults() *GetMembershipWebviewResponse` + +NewGetMembershipWebviewResponseWithDefaults instantiates a new GetMembershipWebviewResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMembershipStatus + +`func (o *GetMembershipWebviewResponse) GetMembershipStatus() string` + +GetMembershipStatus returns the MembershipStatus field if non-nil, zero value otherwise. + +### GetMembershipStatusOk + +`func (o *GetMembershipWebviewResponse) GetMembershipStatusOk() (*string, bool)` + +GetMembershipStatusOk returns a tuple with the MembershipStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembershipStatus + +`func (o *GetMembershipWebviewResponse) SetMembershipStatus(v string)` + +SetMembershipStatus sets MembershipStatus field to given value. + +### HasMembershipStatus + +`func (o *GetMembershipWebviewResponse) HasMembershipStatus() bool` + +HasMembershipStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMenuNewResponse.md b/docs/GetMenuNewResponse.md new file mode 100644 index 0000000..fb3b3e1 --- /dev/null +++ b/docs/GetMenuNewResponse.md @@ -0,0 +1,145 @@ +# GetMenuNewResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**PartnerMerchantID** | Pointer to **string** | The merchant's ID that is on the partner's database. | [optional] +**Currency** | [**Currency**](Currency.md) | | +**SellingTimes** | [**[]SellingTime**](SellingTime.md) | An array of sellingTimes JSON objects. Max 20 allowed. Refer to [Selling Times](#selling-times) for more information. | +**Categories** | [**[]MenuCategory**](MenuCategory.md) | An array of category JSON objects. Max 100 allowed per section. Refer to [Categories](#categories) for more information. | + +## Methods + +### NewGetMenuNewResponse + +`func NewGetMenuNewResponse(currency Currency, sellingTimes []SellingTime, categories []MenuCategory, ) *GetMenuNewResponse` + +NewGetMenuNewResponse instantiates a new GetMenuNewResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMenuNewResponseWithDefaults + +`func NewGetMenuNewResponseWithDefaults() *GetMenuNewResponse` + +NewGetMenuNewResponseWithDefaults instantiates a new GetMenuNewResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *GetMenuNewResponse) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *GetMenuNewResponse) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *GetMenuNewResponse) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *GetMenuNewResponse) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetPartnerMerchantID + +`func (o *GetMenuNewResponse) GetPartnerMerchantID() string` + +GetPartnerMerchantID returns the PartnerMerchantID field if non-nil, zero value otherwise. + +### GetPartnerMerchantIDOk + +`func (o *GetMenuNewResponse) GetPartnerMerchantIDOk() (*string, bool)` + +GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartnerMerchantID + +`func (o *GetMenuNewResponse) SetPartnerMerchantID(v string)` + +SetPartnerMerchantID sets PartnerMerchantID field to given value. + +### HasPartnerMerchantID + +`func (o *GetMenuNewResponse) HasPartnerMerchantID() bool` + +HasPartnerMerchantID returns a boolean if a field has been set. + +### GetCurrency + +`func (o *GetMenuNewResponse) GetCurrency() Currency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *GetMenuNewResponse) GetCurrencyOk() (*Currency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *GetMenuNewResponse) SetCurrency(v Currency)` + +SetCurrency sets Currency field to given value. + + +### GetSellingTimes + +`func (o *GetMenuNewResponse) GetSellingTimes() []SellingTime` + +GetSellingTimes returns the SellingTimes field if non-nil, zero value otherwise. + +### GetSellingTimesOk + +`func (o *GetMenuNewResponse) GetSellingTimesOk() (*[]SellingTime, bool)` + +GetSellingTimesOk returns a tuple with the SellingTimes field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSellingTimes + +`func (o *GetMenuNewResponse) SetSellingTimes(v []SellingTime)` + +SetSellingTimes sets SellingTimes field to given value. + + +### GetCategories + +`func (o *GetMenuNewResponse) GetCategories() []MenuCategory` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *GetMenuNewResponse) GetCategoriesOk() (*[]MenuCategory, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *GetMenuNewResponse) SetCategories(v []MenuCategory)` + +SetCategories sets Categories field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetMenuOldResponse.md b/docs/GetMenuOldResponse.md new file mode 100644 index 0000000..d5f2252 --- /dev/null +++ b/docs/GetMenuOldResponse.md @@ -0,0 +1,124 @@ +# GetMenuOldResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**PartnerMerchantID** | Pointer to **string** | The merchant's ID that is on the partner's database. | [optional] +**Currency** | [**Currency**](Currency.md) | | +**Sections** | [**[]MenuSection**](MenuSection.md) | An array of section JSON objects. Max 7 allowed. Refer to [Sections](#sections) for more information. | + +## Methods + +### NewGetMenuOldResponse + +`func NewGetMenuOldResponse(currency Currency, sections []MenuSection, ) *GetMenuOldResponse` + +NewGetMenuOldResponse instantiates a new GetMenuOldResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetMenuOldResponseWithDefaults + +`func NewGetMenuOldResponseWithDefaults() *GetMenuOldResponse` + +NewGetMenuOldResponseWithDefaults instantiates a new GetMenuOldResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *GetMenuOldResponse) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *GetMenuOldResponse) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *GetMenuOldResponse) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *GetMenuOldResponse) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetPartnerMerchantID + +`func (o *GetMenuOldResponse) GetPartnerMerchantID() string` + +GetPartnerMerchantID returns the PartnerMerchantID field if non-nil, zero value otherwise. + +### GetPartnerMerchantIDOk + +`func (o *GetMenuOldResponse) GetPartnerMerchantIDOk() (*string, bool)` + +GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartnerMerchantID + +`func (o *GetMenuOldResponse) SetPartnerMerchantID(v string)` + +SetPartnerMerchantID sets PartnerMerchantID field to given value. + +### HasPartnerMerchantID + +`func (o *GetMenuOldResponse) HasPartnerMerchantID() bool` + +HasPartnerMerchantID returns a boolean if a field has been set. + +### GetCurrency + +`func (o *GetMenuOldResponse) GetCurrency() Currency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *GetMenuOldResponse) GetCurrencyOk() (*Currency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *GetMenuOldResponse) SetCurrency(v Currency)` + +SetCurrency sets Currency field to given value. + + +### GetSections + +`func (o *GetMenuOldResponse) GetSections() []MenuSection` + +GetSections returns the Sections field if non-nil, zero value otherwise. + +### GetSectionsOk + +`func (o *GetMenuOldResponse) GetSectionsOk() (*[]MenuSection, bool)` + +GetSectionsOk returns a tuple with the Sections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSections + +`func (o *GetMenuOldResponse) SetSections(v []MenuSection)` + +SetSections sets Sections field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetOauthGrabAPI.md b/docs/GetOauthGrabAPI.md new file mode 100644 index 0000000..dcb7900 --- /dev/null +++ b/docs/GetOauthGrabAPI.md @@ -0,0 +1,75 @@ +# \GetOauthGrabAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetOauthGrab**](GetOauthGrabAPI.md#GetOauthGrab) | **Post** /grabid/v1/oauth2/token | Get Oauth access token + + + +## GetOauthGrab + +> GrabOauthResponse GetOauthGrab(ctx).ContentType(contentType).GrabOauthRequest(grabOauthRequest).Execute() + +Get Oauth access token + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + grabOauthRequest := *grabfood.NewGrabOauthRequest("", "", "client_credentials", "food.partner_api") // GrabOauthRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.GetOauthGrabAPI.GetOauthGrab(context.Background()).ContentType(contentType).GrabOauthRequest(grabOauthRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GetOauthGrabAPI.GetOauthGrab``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOauthGrab`: GrabOauthResponse + fmt.Fprintf(os.Stdout, "Response from `GetOauthGrabAPI.GetOauthGrab`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetOauthGrabRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **grabOauthRequest** | [**GrabOauthRequest**](GrabOauthRequest.md) | | + +### Return type + +[**GrabOauthResponse**](GrabOauthResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/GetRewardNativeRequest.md b/docs/GetRewardNativeRequest.md new file mode 100644 index 0000000..0a951ae --- /dev/null +++ b/docs/GetRewardNativeRequest.md @@ -0,0 +1,134 @@ +# GetRewardNativeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | Pointer to **string** | The unique member ID on the partner's database. | [optional] +**MerchantID** | Pointer to **string** | Grab merchant's ID. | [optional] +**Items** | Pointer to [**[]RewardItem**](RewardItem.md) | | [optional] +**OrderValue** | Pointer to **int64** | The post-discount order value. | [optional] + +## Methods + +### NewGetRewardNativeRequest + +`func NewGetRewardNativeRequest() *GetRewardNativeRequest` + +NewGetRewardNativeRequest instantiates a new GetRewardNativeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRewardNativeRequestWithDefaults + +`func NewGetRewardNativeRequestWithDefaults() *GetRewardNativeRequest` + +NewGetRewardNativeRequestWithDefaults instantiates a new GetRewardNativeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *GetRewardNativeRequest) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *GetRewardNativeRequest) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *GetRewardNativeRequest) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + +### HasMemberID + +`func (o *GetRewardNativeRequest) HasMemberID() bool` + +HasMemberID returns a boolean if a field has been set. + +### GetMerchantID + +`func (o *GetRewardNativeRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *GetRewardNativeRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *GetRewardNativeRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *GetRewardNativeRequest) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetItems + +`func (o *GetRewardNativeRequest) GetItems() []RewardItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *GetRewardNativeRequest) GetItemsOk() (*[]RewardItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *GetRewardNativeRequest) SetItems(v []RewardItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *GetRewardNativeRequest) HasItems() bool` + +HasItems returns a boolean if a field has been set. + +### GetOrderValue + +`func (o *GetRewardNativeRequest) GetOrderValue() int64` + +GetOrderValue returns the OrderValue field if non-nil, zero value otherwise. + +### GetOrderValueOk + +`func (o *GetRewardNativeRequest) GetOrderValueOk() (*int64, bool)` + +GetOrderValueOk returns a tuple with the OrderValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderValue + +`func (o *GetRewardNativeRequest) SetOrderValue(v int64)` + +SetOrderValue sets OrderValue field to given value. + +### HasOrderValue + +`func (o *GetRewardNativeRequest) HasOrderValue() bool` + +HasOrderValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetRewardNativeResponse.md b/docs/GetRewardNativeResponse.md new file mode 100644 index 0000000..4bb23d6 --- /dev/null +++ b/docs/GetRewardNativeResponse.md @@ -0,0 +1,51 @@ +# GetRewardNativeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Points** | **int64** | The reward points earned in this purchase. | + +## Methods + +### NewGetRewardNativeResponse + +`func NewGetRewardNativeResponse(points int64, ) *GetRewardNativeResponse` + +NewGetRewardNativeResponse instantiates a new GetRewardNativeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRewardNativeResponseWithDefaults + +`func NewGetRewardNativeResponseWithDefaults() *GetRewardNativeResponse` + +NewGetRewardNativeResponseWithDefaults instantiates a new GetRewardNativeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPoints + +`func (o *GetRewardNativeResponse) GetPoints() int64` + +GetPoints returns the Points field if non-nil, zero value otherwise. + +### GetPointsOk + +`func (o *GetRewardNativeResponse) GetPointsOk() (*int64, bool)` + +GetPointsOk returns a tuple with the Points field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPoints + +`func (o *GetRewardNativeResponse) SetPoints(v int64)` + +SetPoints sets Points field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetStoreHourAPI.md b/docs/GetStoreHourAPI.md new file mode 100644 index 0000000..6c8a721 --- /dev/null +++ b/docs/GetStoreHourAPI.md @@ -0,0 +1,79 @@ +# \GetStoreHourAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetStoreHour**](GetStoreHourAPI.md#GetStoreHour) | **Get** /partner/v2/merchants/{merchantID}/store/hours | Get Store Hours + + + +## GetStoreHour + +> StoreHourResponse GetStoreHour(ctx, merchantID).Authorization(authorization).Execute() + +Get Store Hours + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.GetStoreHourAPI.GetStoreHour(context.Background(), merchantID).Authorization(authorization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GetStoreHourAPI.GetStoreHour``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetStoreHour`: StoreHourResponse + fmt.Fprintf(os.Stdout, "Response from `GetStoreHourAPI.GetStoreHour`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetStoreHourRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + +### Return type + +[**StoreHourResponse**](StoreHourResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/GetStoreStatusAPI.md b/docs/GetStoreStatusAPI.md new file mode 100644 index 0000000..ab25a6b --- /dev/null +++ b/docs/GetStoreStatusAPI.md @@ -0,0 +1,79 @@ +# \GetStoreStatusAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetStoreStatus**](GetStoreStatusAPI.md#GetStoreStatus) | **Get** /partner/v1/merchants/{merchantID}/store/status | Get Store Status + + + +## GetStoreStatus + +> StoreStatusResponse GetStoreStatus(ctx, merchantID).Authorization(authorization).Execute() + +Get Store Status + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.GetStoreStatusAPI.GetStoreStatus(context.Background(), merchantID).Authorization(authorization).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `GetStoreStatusAPI.GetStoreStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetStoreStatus`: StoreStatusResponse + fmt.Fprintf(os.Stdout, "Response from `GetStoreStatusAPI.GetStoreStatus`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetStoreStatusRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + +### Return type + +[**StoreStatusResponse**](StoreStatusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/GrabOauthRequest.md b/docs/GrabOauthRequest.md new file mode 100644 index 0000000..bea09fe --- /dev/null +++ b/docs/GrabOauthRequest.md @@ -0,0 +1,114 @@ +# GrabOauthRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | The client identifier issued to the client to obtain the OAuth 2.0 access_token. | +**ClientSecret** | **string** | The client secret issued to the client to obtain the OAuth 2.0 access_token. | +**GrantType** | **string** | The grant type for the client to obtain the OAuth 2.0 access_token. | +**Scope** | **string** | The scope for the client to obtain the OAuth 2.0 access_token. | + +## Methods + +### NewGrabOauthRequest + +`func NewGrabOauthRequest(clientId string, clientSecret string, grantType string, scope string, ) *GrabOauthRequest` + +NewGrabOauthRequest instantiates a new GrabOauthRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGrabOauthRequestWithDefaults + +`func NewGrabOauthRequestWithDefaults() *GrabOauthRequest` + +NewGrabOauthRequestWithDefaults instantiates a new GrabOauthRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *GrabOauthRequest) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *GrabOauthRequest) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *GrabOauthRequest) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetClientSecret + +`func (o *GrabOauthRequest) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *GrabOauthRequest) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *GrabOauthRequest) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + + +### GetGrantType + +`func (o *GrabOauthRequest) GetGrantType() string` + +GetGrantType returns the GrantType field if non-nil, zero value otherwise. + +### GetGrantTypeOk + +`func (o *GrabOauthRequest) GetGrantTypeOk() (*string, bool)` + +GetGrantTypeOk returns a tuple with the GrantType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantType + +`func (o *GrabOauthRequest) SetGrantType(v string)` + +SetGrantType sets GrantType field to given value. + + +### GetScope + +`func (o *GrabOauthRequest) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *GrabOauthRequest) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *GrabOauthRequest) SetScope(v string)` + +SetScope sets Scope field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GrabOauthResponse.md b/docs/GrabOauthResponse.md new file mode 100644 index 0000000..3b08bbb --- /dev/null +++ b/docs/GrabOauthResponse.md @@ -0,0 +1,108 @@ +# GrabOauthResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | Pointer to **string** | The OAuth 2.0 access token issued by the partner. | [optional] +**TokenType** | Pointer to **string** | The type of token issued which is case insensitive. | [optional] +**ExpiresIn** | Pointer to **int32** | The access token lifespan in seconds. The token is reused till it expires - default is 604799 (7 days). | [optional] + +## Methods + +### NewGrabOauthResponse + +`func NewGrabOauthResponse() *GrabOauthResponse` + +NewGrabOauthResponse instantiates a new GrabOauthResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGrabOauthResponseWithDefaults + +`func NewGrabOauthResponseWithDefaults() *GrabOauthResponse` + +NewGrabOauthResponseWithDefaults instantiates a new GrabOauthResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessToken + +`func (o *GrabOauthResponse) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *GrabOauthResponse) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *GrabOauthResponse) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + +### HasAccessToken + +`func (o *GrabOauthResponse) HasAccessToken() bool` + +HasAccessToken returns a boolean if a field has been set. + +### GetTokenType + +`func (o *GrabOauthResponse) GetTokenType() string` + +GetTokenType returns the TokenType field if non-nil, zero value otherwise. + +### GetTokenTypeOk + +`func (o *GrabOauthResponse) GetTokenTypeOk() (*string, bool)` + +GetTokenTypeOk returns a tuple with the TokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenType + +`func (o *GrabOauthResponse) SetTokenType(v string)` + +SetTokenType sets TokenType field to given value. + +### HasTokenType + +`func (o *GrabOauthResponse) HasTokenType() bool` + +HasTokenType returns a boolean if a field has been set. + +### GetExpiresIn + +`func (o *GrabOauthResponse) GetExpiresIn() int32` + +GetExpiresIn returns the ExpiresIn field if non-nil, zero value otherwise. + +### GetExpiresInOk + +`func (o *GrabOauthResponse) GetExpiresInOk() (*int32, bool)` + +GetExpiresInOk returns a tuple with the ExpiresIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresIn + +`func (o *GrabOauthResponse) SetExpiresIn(v int32)` + +SetExpiresIn sets ExpiresIn field to given value. + +### HasExpiresIn + +`func (o *GrabOauthResponse) HasExpiresIn() bool` + +HasExpiresIn returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListCampaignAPI.md b/docs/ListCampaignAPI.md new file mode 100644 index 0000000..da69b8f --- /dev/null +++ b/docs/ListCampaignAPI.md @@ -0,0 +1,75 @@ +# \ListCampaignAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListCampaign**](ListCampaignAPI.md#ListCampaign) | **Get** /partner/v1/campaigns | List campaigns + + + +## ListCampaign + +> ListCampaignResponse ListCampaign(ctx).Authorization(authorization).MerchantID(merchantID).Execute() + +List campaigns + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.ListCampaignAPI.ListCampaign(context.Background()).Authorization(authorization).MerchantID(merchantID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ListCampaignAPI.ListCampaign``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListCampaign`: ListCampaignResponse + fmt.Fprintf(os.Stdout, "Response from `ListCampaignAPI.ListCampaign`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListCampaignRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Return type + +[**ListCampaignResponse**](ListCampaignResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ListCampaignResponse.md b/docs/ListCampaignResponse.md new file mode 100644 index 0000000..ca98482 --- /dev/null +++ b/docs/ListCampaignResponse.md @@ -0,0 +1,82 @@ +# ListCampaignResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ongoing** | Pointer to [**[]Campaign**](Campaign.md) | | [optional] +**Upcoming** | Pointer to [**[]Campaign**](Campaign.md) | | [optional] + +## Methods + +### NewListCampaignResponse + +`func NewListCampaignResponse() *ListCampaignResponse` + +NewListCampaignResponse instantiates a new ListCampaignResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListCampaignResponseWithDefaults + +`func NewListCampaignResponseWithDefaults() *ListCampaignResponse` + +NewListCampaignResponseWithDefaults instantiates a new ListCampaignResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOngoing + +`func (o *ListCampaignResponse) GetOngoing() []Campaign` + +GetOngoing returns the Ongoing field if non-nil, zero value otherwise. + +### GetOngoingOk + +`func (o *ListCampaignResponse) GetOngoingOk() (*[]Campaign, bool)` + +GetOngoingOk returns a tuple with the Ongoing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOngoing + +`func (o *ListCampaignResponse) SetOngoing(v []Campaign)` + +SetOngoing sets Ongoing field to given value. + +### HasOngoing + +`func (o *ListCampaignResponse) HasOngoing() bool` + +HasOngoing returns a boolean if a field has been set. + +### GetUpcoming + +`func (o *ListCampaignResponse) GetUpcoming() []Campaign` + +GetUpcoming returns the Upcoming field if non-nil, zero value otherwise. + +### GetUpcomingOk + +`func (o *ListCampaignResponse) GetUpcomingOk() (*[]Campaign, bool)` + +GetUpcomingOk returns a tuple with the Upcoming field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpcoming + +`func (o *ListCampaignResponse) SetUpcoming(v []Campaign)` + +SetUpcoming sets Upcoming field to given value. + +### HasUpcoming + +`func (o *ListCampaignResponse) HasUpcoming() bool` + +HasUpcoming returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ListOrdersAPI.md b/docs/ListOrdersAPI.md new file mode 100644 index 0000000..0aba4a5 --- /dev/null +++ b/docs/ListOrdersAPI.md @@ -0,0 +1,79 @@ +# \ListOrdersAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListOrders**](ListOrdersAPI.md#ListOrders) | **Get** /partner/v1/orders | List orders + + + +## ListOrders + +> ListOrdersResponse ListOrders(ctx).Authorization(authorization).MerchantID(merchantID).Date(date).Page(page).Execute() + +List orders + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + date := "date_example" // string | + page := int32(1) // int32 | Specify the page number for the report. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.ListOrdersAPI.ListOrders(context.Background()).Authorization(authorization).MerchantID(merchantID).Date(date).Page(page).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ListOrdersAPI.ListOrders``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListOrders`: ListOrdersResponse + fmt.Fprintf(os.Stdout, "Response from `ListOrdersAPI.ListOrders`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListOrdersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + **date** | **string** | | + **page** | **int32** | Specify the page number for the report. | + +### Return type + +[**ListOrdersResponse**](ListOrdersResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/ListOrdersResponse.md b/docs/ListOrdersResponse.md new file mode 100644 index 0000000..51a6656 --- /dev/null +++ b/docs/ListOrdersResponse.md @@ -0,0 +1,82 @@ +# ListOrdersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**More** | Pointer to **bool** | The boolean value to indicate if there is more order data. If `true`, you can continue requesting with page+1. | [optional] +**Orders** | Pointer to [**[]Order**](Order.md) | | [optional] + +## Methods + +### NewListOrdersResponse + +`func NewListOrdersResponse() *ListOrdersResponse` + +NewListOrdersResponse instantiates a new ListOrdersResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewListOrdersResponseWithDefaults + +`func NewListOrdersResponseWithDefaults() *ListOrdersResponse` + +NewListOrdersResponseWithDefaults instantiates a new ListOrdersResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMore + +`func (o *ListOrdersResponse) GetMore() bool` + +GetMore returns the More field if non-nil, zero value otherwise. + +### GetMoreOk + +`func (o *ListOrdersResponse) GetMoreOk() (*bool, bool)` + +GetMoreOk returns a tuple with the More field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMore + +`func (o *ListOrdersResponse) SetMore(v bool)` + +SetMore sets More field to given value. + +### HasMore + +`func (o *ListOrdersResponse) HasMore() bool` + +HasMore returns a boolean if a field has been set. + +### GetOrders + +`func (o *ListOrdersResponse) GetOrders() []Order` + +GetOrders returns the Orders field if non-nil, zero value otherwise. + +### GetOrdersOk + +`func (o *ListOrdersResponse) GetOrdersOk() (*[]Order, bool)` + +GetOrdersOk returns a tuple with the Orders field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrders + +`func (o *ListOrdersResponse) SetOrders(v []Order)` + +SetOrders sets Orders field to given value. + +### HasOrders + +`func (o *ListOrdersResponse) HasOrders() bool` + +HasOrders returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MarkOrderReadyAPI.md b/docs/MarkOrderReadyAPI.md new file mode 100644 index 0000000..0a24587 --- /dev/null +++ b/docs/MarkOrderReadyAPI.md @@ -0,0 +1,75 @@ +# \MarkOrderReadyAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**MarkOrderReady**](MarkOrderReadyAPI.md#MarkOrderReady) | **Post** /partner/v1/orders/mark | Mark order as ready + + + +## MarkOrderReady + +> MarkOrderReady(ctx).ContentType(contentType).Authorization(authorization).MarkOrderRequest(markOrderRequest).Execute() + +Mark order as ready + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + markOrderRequest := *grabfood.NewMarkOrderRequest("123-CYNKLPCVRN5", int32(123)) // MarkOrderRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.MarkOrderReadyAPI.MarkOrderReady(context.Background()).ContentType(contentType).Authorization(authorization).MarkOrderRequest(markOrderRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MarkOrderReadyAPI.MarkOrderReady``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiMarkOrderReadyRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **markOrderRequest** | [**MarkOrderRequest**](MarkOrderRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/MarkOrderRequest.md b/docs/MarkOrderRequest.md new file mode 100644 index 0000000..8d5f075 --- /dev/null +++ b/docs/MarkOrderRequest.md @@ -0,0 +1,72 @@ +# MarkOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**MarkStatus** | **int32** | The status to be marked accordingly. * `1` - mark order as ready * `2` - mark order as completed and only applicable to **dine-in** orders | + +## Methods + +### NewMarkOrderRequest + +`func NewMarkOrderRequest(orderID string, markStatus int32, ) *MarkOrderRequest` + +NewMarkOrderRequest instantiates a new MarkOrderRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMarkOrderRequestWithDefaults + +`func NewMarkOrderRequestWithDefaults() *MarkOrderRequest` + +NewMarkOrderRequestWithDefaults instantiates a new MarkOrderRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *MarkOrderRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *MarkOrderRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *MarkOrderRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetMarkStatus + +`func (o *MarkOrderRequest) GetMarkStatus() int32` + +GetMarkStatus returns the MarkStatus field if non-nil, zero value otherwise. + +### GetMarkStatusOk + +`func (o *MarkOrderRequest) GetMarkStatusOk() (*int32, bool)` + +GetMarkStatusOk returns a tuple with the MarkStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMarkStatus + +`func (o *MarkOrderRequest) SetMarkStatus(v int32)` + +SetMarkStatus sets MarkStatus field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuCategory.md b/docs/MenuCategory.md new file mode 100644 index 0000000..9c3c2d4 --- /dev/null +++ b/docs/MenuCategory.md @@ -0,0 +1,161 @@ +# MenuCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. | +**Name** | **string** | The name of the category. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the category name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). | +**SellingTimeID** | **string** | The selling time's ID for the category. All items within the category will apply the same selling time unless there is another selling time specified for the item. | +**Items** | [**[]MenuItem**](MenuItem.md) | An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. | + +## Methods + +### NewMenuCategory + +`func NewMenuCategory(id string, name string, availableStatus string, sellingTimeID string, items []MenuItem, ) *MenuCategory` + +NewMenuCategory instantiates a new MenuCategory object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuCategoryWithDefaults + +`func NewMenuCategoryWithDefaults() *MenuCategory` + +NewMenuCategoryWithDefaults instantiates a new MenuCategory object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuCategory) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuCategory) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuCategory) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuCategory) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuCategory) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuCategory) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *MenuCategory) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *MenuCategory) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *MenuCategory) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *MenuCategory) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuCategory) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuCategory) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuCategory) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetSellingTimeID + +`func (o *MenuCategory) GetSellingTimeID() string` + +GetSellingTimeID returns the SellingTimeID field if non-nil, zero value otherwise. + +### GetSellingTimeIDOk + +`func (o *MenuCategory) GetSellingTimeIDOk() (*string, bool)` + +GetSellingTimeIDOk returns a tuple with the SellingTimeID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSellingTimeID + +`func (o *MenuCategory) SetSellingTimeID(v string)` + +SetSellingTimeID sets SellingTimeID field to given value. + + +### GetItems + +`func (o *MenuCategory) GetItems() []MenuItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *MenuCategory) GetItemsOk() (*[]MenuItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *MenuCategory) SetItems(v []MenuItem)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuEntity.md b/docs/MenuEntity.md new file mode 100644 index 0000000..28dfa9d --- /dev/null +++ b/docs/MenuEntity.md @@ -0,0 +1,186 @@ +# MenuEntity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The record's ID on the partner system. For example, the item id in case type is ITEM, modifier id is MODIFIER. | [optional] +**Price** | Pointer to **int64** | The record's price in minor unit format. | [optional] +**AvailableStatus** | Pointer to **string** | The record's availableStatus. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. | [optional] +**MaxStock** | Pointer to **int64** | Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. | [optional] +**AdvancedPricings** | Pointer to [**[]UpdateAdvancedPricing**](UpdateAdvancedPricing.md) | Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. | [optional] +**Purchasabilities** | Pointer to [**[]UpdatePurchasability**](UpdatePurchasability.md) | Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. | [optional] + +## Methods + +### NewMenuEntity + +`func NewMenuEntity() *MenuEntity` + +NewMenuEntity instantiates a new MenuEntity object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuEntityWithDefaults + +`func NewMenuEntityWithDefaults() *MenuEntity` + +NewMenuEntityWithDefaults instantiates a new MenuEntity object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuEntity) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuEntity) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuEntity) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuEntity) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPrice + +`func (o *MenuEntity) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *MenuEntity) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *MenuEntity) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *MenuEntity) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuEntity) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuEntity) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuEntity) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + +### HasAvailableStatus + +`func (o *MenuEntity) HasAvailableStatus() bool` + +HasAvailableStatus returns a boolean if a field has been set. + +### GetMaxStock + +`func (o *MenuEntity) GetMaxStock() int64` + +GetMaxStock returns the MaxStock field if non-nil, zero value otherwise. + +### GetMaxStockOk + +`func (o *MenuEntity) GetMaxStockOk() (*int64, bool)` + +GetMaxStockOk returns a tuple with the MaxStock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxStock + +`func (o *MenuEntity) SetMaxStock(v int64)` + +SetMaxStock sets MaxStock field to given value. + +### HasMaxStock + +`func (o *MenuEntity) HasMaxStock() bool` + +HasMaxStock returns a boolean if a field has been set. + +### GetAdvancedPricings + +`func (o *MenuEntity) GetAdvancedPricings() []UpdateAdvancedPricing` + +GetAdvancedPricings returns the AdvancedPricings field if non-nil, zero value otherwise. + +### GetAdvancedPricingsOk + +`func (o *MenuEntity) GetAdvancedPricingsOk() (*[]UpdateAdvancedPricing, bool)` + +GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricings + +`func (o *MenuEntity) SetAdvancedPricings(v []UpdateAdvancedPricing)` + +SetAdvancedPricings sets AdvancedPricings field to given value. + +### HasAdvancedPricings + +`func (o *MenuEntity) HasAdvancedPricings() bool` + +HasAdvancedPricings returns a boolean if a field has been set. + +### GetPurchasabilities + +`func (o *MenuEntity) GetPurchasabilities() []UpdatePurchasability` + +GetPurchasabilities returns the Purchasabilities field if non-nil, zero value otherwise. + +### GetPurchasabilitiesOk + +`func (o *MenuEntity) GetPurchasabilitiesOk() (*[]UpdatePurchasability, bool)` + +GetPurchasabilitiesOk returns a tuple with the Purchasabilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasabilities + +`func (o *MenuEntity) SetPurchasabilities(v []UpdatePurchasability)` + +SetPurchasabilities sets Purchasabilities field to given value. + +### HasPurchasabilities + +`func (o *MenuEntity) HasPurchasabilities() bool` + +HasPurchasabilities returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuEntityError.md b/docs/MenuEntityError.md new file mode 100644 index 0000000..c732bf2 --- /dev/null +++ b/docs/MenuEntityError.md @@ -0,0 +1,82 @@ +# MenuEntityError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EntityID** | Pointer to **string** | The itemID. | [optional] +**ErrMsg** | Pointer to **string** | The error message. | [optional] + +## Methods + +### NewMenuEntityError + +`func NewMenuEntityError() *MenuEntityError` + +NewMenuEntityError instantiates a new MenuEntityError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuEntityErrorWithDefaults + +`func NewMenuEntityErrorWithDefaults() *MenuEntityError` + +NewMenuEntityErrorWithDefaults instantiates a new MenuEntityError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetEntityID + +`func (o *MenuEntityError) GetEntityID() string` + +GetEntityID returns the EntityID field if non-nil, zero value otherwise. + +### GetEntityIDOk + +`func (o *MenuEntityError) GetEntityIDOk() (*string, bool)` + +GetEntityIDOk returns a tuple with the EntityID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEntityID + +`func (o *MenuEntityError) SetEntityID(v string)` + +SetEntityID sets EntityID field to given value. + +### HasEntityID + +`func (o *MenuEntityError) HasEntityID() bool` + +HasEntityID returns a boolean if a field has been set. + +### GetErrMsg + +`func (o *MenuEntityError) GetErrMsg() string` + +GetErrMsg returns the ErrMsg field if non-nil, zero value otherwise. + +### GetErrMsgOk + +`func (o *MenuEntityError) GetErrMsgOk() (*string, bool)` + +GetErrMsgOk returns a tuple with the ErrMsg field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrMsg + +`func (o *MenuEntityError) SetErrMsg(v string)` + +SetErrMsg sets ErrMsg field to given value. + +### HasErrMsg + +`func (o *MenuEntityError) HasErrMsg() bool` + +HasErrMsg returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuItem.md b/docs/MenuItem.md new file mode 100644 index 0000000..5ea6e97 --- /dev/null +++ b/docs/MenuItem.md @@ -0,0 +1,426 @@ +# MenuItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The item's ID in the partner system. | +**Name** | **string** | The name of the item. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the item name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the item that is in the category. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. | +**Description** | Pointer to **string** | The description of the item. There is a custom length limit of 2000 for `VN`. | [optional] +**DescriptionTranslation** | Pointer to **map[string]string** | Translation of the item description. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**Price** | **int64** | The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. | +**Photos** | Pointer to **[]string** | An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). | [optional] +**SpecialType** | Pointer to **string** | The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). | [optional] +**Taxable** | Pointer to **bool** | **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. | [optional] +**Barcode** | Pointer to **string** | The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. | [optional] +**SellingTimeID** | Pointer to **string** | The selling time's ID for the item. This value overwrites the category's selling time if it is different. Empty value implies the category's selling time will be applied. | [optional] +**MaxStock** | Pointer to **int64** | Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. | [optional] +**AdvancedPricing** | Pointer to [**AdvancedPricing**](AdvancedPricing.md) | | [optional] +**Purchasability** | Pointer to [**Purchasability**](Purchasability.md) | | [optional] +**ModifierGroups** | Pointer to [**[]ModifierGroup**](ModifierGroup.md) | An array of the modifierGroup JSON objects. Max 30 allowed per item. Refer to [Modifier groups](#modifier-groups) for more information. | [optional] + +## Methods + +### NewMenuItem + +`func NewMenuItem(id string, name string, availableStatus string, price int64, ) *MenuItem` + +NewMenuItem instantiates a new MenuItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuItemWithDefaults + +`func NewMenuItemWithDefaults() *MenuItem` + +NewMenuItemWithDefaults instantiates a new MenuItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *MenuItem) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *MenuItem) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *MenuItem) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *MenuItem) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuItem) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuItem) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuItem) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetDescription + +`func (o *MenuItem) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *MenuItem) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *MenuItem) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *MenuItem) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetDescriptionTranslation + +`func (o *MenuItem) GetDescriptionTranslation() map[string]string` + +GetDescriptionTranslation returns the DescriptionTranslation field if non-nil, zero value otherwise. + +### GetDescriptionTranslationOk + +`func (o *MenuItem) GetDescriptionTranslationOk() (*map[string]string, bool)` + +GetDescriptionTranslationOk returns a tuple with the DescriptionTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescriptionTranslation + +`func (o *MenuItem) SetDescriptionTranslation(v map[string]string)` + +SetDescriptionTranslation sets DescriptionTranslation field to given value. + +### HasDescriptionTranslation + +`func (o *MenuItem) HasDescriptionTranslation() bool` + +HasDescriptionTranslation returns a boolean if a field has been set. + +### GetPrice + +`func (o *MenuItem) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *MenuItem) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *MenuItem) SetPrice(v int64)` + +SetPrice sets Price field to given value. + + +### GetPhotos + +`func (o *MenuItem) GetPhotos() []string` + +GetPhotos returns the Photos field if non-nil, zero value otherwise. + +### GetPhotosOk + +`func (o *MenuItem) GetPhotosOk() (*[]string, bool)` + +GetPhotosOk returns a tuple with the Photos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhotos + +`func (o *MenuItem) SetPhotos(v []string)` + +SetPhotos sets Photos field to given value. + +### HasPhotos + +`func (o *MenuItem) HasPhotos() bool` + +HasPhotos returns a boolean if a field has been set. + +### GetSpecialType + +`func (o *MenuItem) GetSpecialType() string` + +GetSpecialType returns the SpecialType field if non-nil, zero value otherwise. + +### GetSpecialTypeOk + +`func (o *MenuItem) GetSpecialTypeOk() (*string, bool)` + +GetSpecialTypeOk returns a tuple with the SpecialType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialType + +`func (o *MenuItem) SetSpecialType(v string)` + +SetSpecialType sets SpecialType field to given value. + +### HasSpecialType + +`func (o *MenuItem) HasSpecialType() bool` + +HasSpecialType returns a boolean if a field has been set. + +### GetTaxable + +`func (o *MenuItem) GetTaxable() bool` + +GetTaxable returns the Taxable field if non-nil, zero value otherwise. + +### GetTaxableOk + +`func (o *MenuItem) GetTaxableOk() (*bool, bool)` + +GetTaxableOk returns a tuple with the Taxable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaxable + +`func (o *MenuItem) SetTaxable(v bool)` + +SetTaxable sets Taxable field to given value. + +### HasTaxable + +`func (o *MenuItem) HasTaxable() bool` + +HasTaxable returns a boolean if a field has been set. + +### GetBarcode + +`func (o *MenuItem) GetBarcode() string` + +GetBarcode returns the Barcode field if non-nil, zero value otherwise. + +### GetBarcodeOk + +`func (o *MenuItem) GetBarcodeOk() (*string, bool)` + +GetBarcodeOk returns a tuple with the Barcode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBarcode + +`func (o *MenuItem) SetBarcode(v string)` + +SetBarcode sets Barcode field to given value. + +### HasBarcode + +`func (o *MenuItem) HasBarcode() bool` + +HasBarcode returns a boolean if a field has been set. + +### GetSellingTimeID + +`func (o *MenuItem) GetSellingTimeID() string` + +GetSellingTimeID returns the SellingTimeID field if non-nil, zero value otherwise. + +### GetSellingTimeIDOk + +`func (o *MenuItem) GetSellingTimeIDOk() (*string, bool)` + +GetSellingTimeIDOk returns a tuple with the SellingTimeID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSellingTimeID + +`func (o *MenuItem) SetSellingTimeID(v string)` + +SetSellingTimeID sets SellingTimeID field to given value. + +### HasSellingTimeID + +`func (o *MenuItem) HasSellingTimeID() bool` + +HasSellingTimeID returns a boolean if a field has been set. + +### GetMaxStock + +`func (o *MenuItem) GetMaxStock() int64` + +GetMaxStock returns the MaxStock field if non-nil, zero value otherwise. + +### GetMaxStockOk + +`func (o *MenuItem) GetMaxStockOk() (*int64, bool)` + +GetMaxStockOk returns a tuple with the MaxStock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxStock + +`func (o *MenuItem) SetMaxStock(v int64)` + +SetMaxStock sets MaxStock field to given value. + +### HasMaxStock + +`func (o *MenuItem) HasMaxStock() bool` + +HasMaxStock returns a boolean if a field has been set. + +### GetAdvancedPricing + +`func (o *MenuItem) GetAdvancedPricing() AdvancedPricing` + +GetAdvancedPricing returns the AdvancedPricing field if non-nil, zero value otherwise. + +### GetAdvancedPricingOk + +`func (o *MenuItem) GetAdvancedPricingOk() (*AdvancedPricing, bool)` + +GetAdvancedPricingOk returns a tuple with the AdvancedPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricing + +`func (o *MenuItem) SetAdvancedPricing(v AdvancedPricing)` + +SetAdvancedPricing sets AdvancedPricing field to given value. + +### HasAdvancedPricing + +`func (o *MenuItem) HasAdvancedPricing() bool` + +HasAdvancedPricing returns a boolean if a field has been set. + +### GetPurchasability + +`func (o *MenuItem) GetPurchasability() Purchasability` + +GetPurchasability returns the Purchasability field if non-nil, zero value otherwise. + +### GetPurchasabilityOk + +`func (o *MenuItem) GetPurchasabilityOk() (*Purchasability, bool)` + +GetPurchasabilityOk returns a tuple with the Purchasability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasability + +`func (o *MenuItem) SetPurchasability(v Purchasability)` + +SetPurchasability sets Purchasability field to given value. + +### HasPurchasability + +`func (o *MenuItem) HasPurchasability() bool` + +HasPurchasability returns a boolean if a field has been set. + +### GetModifierGroups + +`func (o *MenuItem) GetModifierGroups() []ModifierGroup` + +GetModifierGroups returns the ModifierGroups field if non-nil, zero value otherwise. + +### GetModifierGroupsOk + +`func (o *MenuItem) GetModifierGroupsOk() (*[]ModifierGroup, bool)` + +GetModifierGroupsOk returns a tuple with the ModifierGroups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifierGroups + +`func (o *MenuItem) SetModifierGroups(v []ModifierGroup)` + +SetModifierGroups sets ModifierGroups field to given value. + +### HasModifierGroups + +`func (o *MenuItem) HasModifierGroups() bool` + +HasModifierGroups returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuModifier.md b/docs/MenuModifier.md new file mode 100644 index 0000000..66ef847 --- /dev/null +++ b/docs/MenuModifier.md @@ -0,0 +1,197 @@ +# MenuModifier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The modifier's ID that is on the partner's system. This ID should be unique with a min length of 1 and max of 64. | +**Name** | **string** | The name of the modifier. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the modifier name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the modifier that is in the ModifierGroup. | +**Price** | Pointer to **int64** | The modifier's price (excluding tax) in minor format. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). | [optional] +**Barcode** | Pointer to **string** | The barcode Number (GTIN). GTIN must be 8, 12, 13, 14 numeric digits. | [optional] +**AdvancedPricing** | Pointer to [**AdvancedPricing**](AdvancedPricing.md) | | [optional] + +## Methods + +### NewMenuModifier + +`func NewMenuModifier(id string, name string, availableStatus string, ) *MenuModifier` + +NewMenuModifier instantiates a new MenuModifier object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuModifierWithDefaults + +`func NewMenuModifierWithDefaults() *MenuModifier` + +NewMenuModifierWithDefaults instantiates a new MenuModifier object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuModifier) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuModifier) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuModifier) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuModifier) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuModifier) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuModifier) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *MenuModifier) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *MenuModifier) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *MenuModifier) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *MenuModifier) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuModifier) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuModifier) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuModifier) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetPrice + +`func (o *MenuModifier) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *MenuModifier) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *MenuModifier) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *MenuModifier) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetBarcode + +`func (o *MenuModifier) GetBarcode() string` + +GetBarcode returns the Barcode field if non-nil, zero value otherwise. + +### GetBarcodeOk + +`func (o *MenuModifier) GetBarcodeOk() (*string, bool)` + +GetBarcodeOk returns a tuple with the Barcode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBarcode + +`func (o *MenuModifier) SetBarcode(v string)` + +SetBarcode sets Barcode field to given value. + +### HasBarcode + +`func (o *MenuModifier) HasBarcode() bool` + +HasBarcode returns a boolean if a field has been set. + +### GetAdvancedPricing + +`func (o *MenuModifier) GetAdvancedPricing() AdvancedPricing` + +GetAdvancedPricing returns the AdvancedPricing field if non-nil, zero value otherwise. + +### GetAdvancedPricingOk + +`func (o *MenuModifier) GetAdvancedPricingOk() (*AdvancedPricing, bool)` + +GetAdvancedPricingOk returns a tuple with the AdvancedPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricing + +`func (o *MenuModifier) SetAdvancedPricing(v AdvancedPricing)` + +SetAdvancedPricing sets AdvancedPricing field to given value. + +### HasAdvancedPricing + +`func (o *MenuModifier) HasAdvancedPricing() bool` + +HasAdvancedPricing returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSection.md b/docs/MenuSection.md new file mode 100644 index 0000000..ca55292 --- /dev/null +++ b/docs/MenuSection.md @@ -0,0 +1,114 @@ +# MenuSection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The section's ID in the partner system. | +**Name** | **string** | The name of the section. | +**ServiceHours** | [**ServiceHours**](ServiceHours.md) | | +**Categories** | [**[]MenuSectionCategory**](MenuSectionCategory.md) | An array of category JSON objects. Max 100 allowed per section. Refer to [Categories](#categories) for more information. | + +## Methods + +### NewMenuSection + +`func NewMenuSection(id string, name string, serviceHours ServiceHours, categories []MenuSectionCategory, ) *MenuSection` + +NewMenuSection instantiates a new MenuSection object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSectionWithDefaults + +`func NewMenuSectionWithDefaults() *MenuSection` + +NewMenuSectionWithDefaults instantiates a new MenuSection object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSection) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSection) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSection) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuSection) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuSection) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuSection) SetName(v string)` + +SetName sets Name field to given value. + + +### GetServiceHours + +`func (o *MenuSection) GetServiceHours() ServiceHours` + +GetServiceHours returns the ServiceHours field if non-nil, zero value otherwise. + +### GetServiceHoursOk + +`func (o *MenuSection) GetServiceHoursOk() (*ServiceHours, bool)` + +GetServiceHoursOk returns a tuple with the ServiceHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceHours + +`func (o *MenuSection) SetServiceHours(v ServiceHours)` + +SetServiceHours sets ServiceHours field to given value. + + +### GetCategories + +`func (o *MenuSection) GetCategories() []MenuSectionCategory` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *MenuSection) GetCategoriesOk() (*[]MenuSectionCategory, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *MenuSection) SetCategories(v []MenuSectionCategory)` + +SetCategories sets Categories field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSectionCategory.md b/docs/MenuSectionCategory.md new file mode 100644 index 0000000..88997aa --- /dev/null +++ b/docs/MenuSectionCategory.md @@ -0,0 +1,140 @@ +# MenuSectionCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. | +**Name** | **string** | The name of the category. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the category name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). | +**Items** | [**[]MenuSectionCategoryItem**](MenuSectionCategoryItem.md) | An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. | + +## Methods + +### NewMenuSectionCategory + +`func NewMenuSectionCategory(id string, name string, availableStatus string, items []MenuSectionCategoryItem, ) *MenuSectionCategory` + +NewMenuSectionCategory instantiates a new MenuSectionCategory object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSectionCategoryWithDefaults + +`func NewMenuSectionCategoryWithDefaults() *MenuSectionCategory` + +NewMenuSectionCategoryWithDefaults instantiates a new MenuSectionCategory object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSectionCategory) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSectionCategory) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSectionCategory) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuSectionCategory) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuSectionCategory) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuSectionCategory) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *MenuSectionCategory) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *MenuSectionCategory) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *MenuSectionCategory) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *MenuSectionCategory) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuSectionCategory) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuSectionCategory) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuSectionCategory) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetItems + +`func (o *MenuSectionCategory) GetItems() []MenuSectionCategoryItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *MenuSectionCategory) GetItemsOk() (*[]MenuSectionCategoryItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *MenuSectionCategory) SetItems(v []MenuSectionCategoryItem)` + +SetItems sets Items field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSectionCategoryItem.md b/docs/MenuSectionCategoryItem.md new file mode 100644 index 0000000..2b0188a --- /dev/null +++ b/docs/MenuSectionCategoryItem.md @@ -0,0 +1,400 @@ +# MenuSectionCategoryItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The item's ID in the partner system. | +**Name** | **string** | The name of the item. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the item name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the item that is in the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. | +**Description** | Pointer to **string** | The description of the item. There is a custom length limit of 2000 for `VN`. | [optional] +**DescriptionTranslation** | Pointer to **map[string]string** | Translation of the item description. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**Price** | **int32** | The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. | +**Photos** | Pointer to **[]string** | An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). | [optional] +**SpecialType** | Pointer to **string** | The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). | [optional] +**Taxable** | Pointer to **bool** | **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. | [optional] +**Barcode** | Pointer to **string** | The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. | [optional] +**MaxStock** | Pointer to **int32** | Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. | [optional] +**AdvancedPricing** | Pointer to [**AdvancedPricing**](AdvancedPricing.md) | | [optional] +**Purchasability** | Pointer to [**Purchasability**](Purchasability.md) | | [optional] +**ModifierGroups** | Pointer to [**[]ModifierGroup**](ModifierGroup.md) | An array of the modifierGroup JSON objects. Max 30 allowed per item. Refer to [Modifier groups](#modifier-groups) for more information. | [optional] + +## Methods + +### NewMenuSectionCategoryItem + +`func NewMenuSectionCategoryItem(id string, name string, availableStatus string, price int32, ) *MenuSectionCategoryItem` + +NewMenuSectionCategoryItem instantiates a new MenuSectionCategoryItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSectionCategoryItemWithDefaults + +`func NewMenuSectionCategoryItemWithDefaults() *MenuSectionCategoryItem` + +NewMenuSectionCategoryItemWithDefaults instantiates a new MenuSectionCategoryItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSectionCategoryItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSectionCategoryItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSectionCategoryItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *MenuSectionCategoryItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *MenuSectionCategoryItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *MenuSectionCategoryItem) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *MenuSectionCategoryItem) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *MenuSectionCategoryItem) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *MenuSectionCategoryItem) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *MenuSectionCategoryItem) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *MenuSectionCategoryItem) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *MenuSectionCategoryItem) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *MenuSectionCategoryItem) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetDescription + +`func (o *MenuSectionCategoryItem) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *MenuSectionCategoryItem) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *MenuSectionCategoryItem) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *MenuSectionCategoryItem) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetDescriptionTranslation + +`func (o *MenuSectionCategoryItem) GetDescriptionTranslation() map[string]string` + +GetDescriptionTranslation returns the DescriptionTranslation field if non-nil, zero value otherwise. + +### GetDescriptionTranslationOk + +`func (o *MenuSectionCategoryItem) GetDescriptionTranslationOk() (*map[string]string, bool)` + +GetDescriptionTranslationOk returns a tuple with the DescriptionTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescriptionTranslation + +`func (o *MenuSectionCategoryItem) SetDescriptionTranslation(v map[string]string)` + +SetDescriptionTranslation sets DescriptionTranslation field to given value. + +### HasDescriptionTranslation + +`func (o *MenuSectionCategoryItem) HasDescriptionTranslation() bool` + +HasDescriptionTranslation returns a boolean if a field has been set. + +### GetPrice + +`func (o *MenuSectionCategoryItem) GetPrice() int32` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *MenuSectionCategoryItem) GetPriceOk() (*int32, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *MenuSectionCategoryItem) SetPrice(v int32)` + +SetPrice sets Price field to given value. + + +### GetPhotos + +`func (o *MenuSectionCategoryItem) GetPhotos() []string` + +GetPhotos returns the Photos field if non-nil, zero value otherwise. + +### GetPhotosOk + +`func (o *MenuSectionCategoryItem) GetPhotosOk() (*[]string, bool)` + +GetPhotosOk returns a tuple with the Photos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhotos + +`func (o *MenuSectionCategoryItem) SetPhotos(v []string)` + +SetPhotos sets Photos field to given value. + +### HasPhotos + +`func (o *MenuSectionCategoryItem) HasPhotos() bool` + +HasPhotos returns a boolean if a field has been set. + +### GetSpecialType + +`func (o *MenuSectionCategoryItem) GetSpecialType() string` + +GetSpecialType returns the SpecialType field if non-nil, zero value otherwise. + +### GetSpecialTypeOk + +`func (o *MenuSectionCategoryItem) GetSpecialTypeOk() (*string, bool)` + +GetSpecialTypeOk returns a tuple with the SpecialType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialType + +`func (o *MenuSectionCategoryItem) SetSpecialType(v string)` + +SetSpecialType sets SpecialType field to given value. + +### HasSpecialType + +`func (o *MenuSectionCategoryItem) HasSpecialType() bool` + +HasSpecialType returns a boolean if a field has been set. + +### GetTaxable + +`func (o *MenuSectionCategoryItem) GetTaxable() bool` + +GetTaxable returns the Taxable field if non-nil, zero value otherwise. + +### GetTaxableOk + +`func (o *MenuSectionCategoryItem) GetTaxableOk() (*bool, bool)` + +GetTaxableOk returns a tuple with the Taxable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaxable + +`func (o *MenuSectionCategoryItem) SetTaxable(v bool)` + +SetTaxable sets Taxable field to given value. + +### HasTaxable + +`func (o *MenuSectionCategoryItem) HasTaxable() bool` + +HasTaxable returns a boolean if a field has been set. + +### GetBarcode + +`func (o *MenuSectionCategoryItem) GetBarcode() string` + +GetBarcode returns the Barcode field if non-nil, zero value otherwise. + +### GetBarcodeOk + +`func (o *MenuSectionCategoryItem) GetBarcodeOk() (*string, bool)` + +GetBarcodeOk returns a tuple with the Barcode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBarcode + +`func (o *MenuSectionCategoryItem) SetBarcode(v string)` + +SetBarcode sets Barcode field to given value. + +### HasBarcode + +`func (o *MenuSectionCategoryItem) HasBarcode() bool` + +HasBarcode returns a boolean if a field has been set. + +### GetMaxStock + +`func (o *MenuSectionCategoryItem) GetMaxStock() int32` + +GetMaxStock returns the MaxStock field if non-nil, zero value otherwise. + +### GetMaxStockOk + +`func (o *MenuSectionCategoryItem) GetMaxStockOk() (*int32, bool)` + +GetMaxStockOk returns a tuple with the MaxStock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxStock + +`func (o *MenuSectionCategoryItem) SetMaxStock(v int32)` + +SetMaxStock sets MaxStock field to given value. + +### HasMaxStock + +`func (o *MenuSectionCategoryItem) HasMaxStock() bool` + +HasMaxStock returns a boolean if a field has been set. + +### GetAdvancedPricing + +`func (o *MenuSectionCategoryItem) GetAdvancedPricing() AdvancedPricing` + +GetAdvancedPricing returns the AdvancedPricing field if non-nil, zero value otherwise. + +### GetAdvancedPricingOk + +`func (o *MenuSectionCategoryItem) GetAdvancedPricingOk() (*AdvancedPricing, bool)` + +GetAdvancedPricingOk returns a tuple with the AdvancedPricing field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricing + +`func (o *MenuSectionCategoryItem) SetAdvancedPricing(v AdvancedPricing)` + +SetAdvancedPricing sets AdvancedPricing field to given value. + +### HasAdvancedPricing + +`func (o *MenuSectionCategoryItem) HasAdvancedPricing() bool` + +HasAdvancedPricing returns a boolean if a field has been set. + +### GetPurchasability + +`func (o *MenuSectionCategoryItem) GetPurchasability() Purchasability` + +GetPurchasability returns the Purchasability field if non-nil, zero value otherwise. + +### GetPurchasabilityOk + +`func (o *MenuSectionCategoryItem) GetPurchasabilityOk() (*Purchasability, bool)` + +GetPurchasabilityOk returns a tuple with the Purchasability field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasability + +`func (o *MenuSectionCategoryItem) SetPurchasability(v Purchasability)` + +SetPurchasability sets Purchasability field to given value. + +### HasPurchasability + +`func (o *MenuSectionCategoryItem) HasPurchasability() bool` + +HasPurchasability returns a boolean if a field has been set. + +### GetModifierGroups + +`func (o *MenuSectionCategoryItem) GetModifierGroups() []ModifierGroup` + +GetModifierGroups returns the ModifierGroups field if non-nil, zero value otherwise. + +### GetModifierGroupsOk + +`func (o *MenuSectionCategoryItem) GetModifierGroupsOk() (*[]ModifierGroup, bool)` + +GetModifierGroupsOk returns a tuple with the ModifierGroups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifierGroups + +`func (o *MenuSectionCategoryItem) SetModifierGroups(v []ModifierGroup)` + +SetModifierGroups sets ModifierGroups field to given value. + +### HasModifierGroups + +`func (o *MenuSectionCategoryItem) HasModifierGroups() bool` + +HasModifierGroups returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFail.md b/docs/MenuSyncFail.md new file mode 100644 index 0000000..e814e94 --- /dev/null +++ b/docs/MenuSyncFail.md @@ -0,0 +1,134 @@ +# MenuSyncFail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] +**ServiceHours** | Pointer to [**MenuSyncFailServiceHours**](MenuSyncFailServiceHours.md) | | [optional] +**Categories** | Pointer to [**[]MenuSyncFailCategory**](MenuSyncFailCategory.md) | | [optional] + +## Methods + +### NewMenuSyncFail + +`func NewMenuSyncFail() *MenuSyncFail` + +NewMenuSyncFail instantiates a new MenuSyncFail object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailWithDefaults + +`func NewMenuSyncFailWithDefaults() *MenuSyncFail` + +NewMenuSyncFailWithDefaults instantiates a new MenuSyncFail object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSyncFail) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSyncFail) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSyncFail) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuSyncFail) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncFail) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFail) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFail) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFail) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetServiceHours + +`func (o *MenuSyncFail) GetServiceHours() MenuSyncFailServiceHours` + +GetServiceHours returns the ServiceHours field if non-nil, zero value otherwise. + +### GetServiceHoursOk + +`func (o *MenuSyncFail) GetServiceHoursOk() (*MenuSyncFailServiceHours, bool)` + +GetServiceHoursOk returns a tuple with the ServiceHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceHours + +`func (o *MenuSyncFail) SetServiceHours(v MenuSyncFailServiceHours)` + +SetServiceHours sets ServiceHours field to given value. + +### HasServiceHours + +`func (o *MenuSyncFail) HasServiceHours() bool` + +HasServiceHours returns a boolean if a field has been set. + +### GetCategories + +`func (o *MenuSyncFail) GetCategories() []MenuSyncFailCategory` + +GetCategories returns the Categories field if non-nil, zero value otherwise. + +### GetCategoriesOk + +`func (o *MenuSyncFail) GetCategoriesOk() (*[]MenuSyncFailCategory, bool)` + +GetCategoriesOk returns a tuple with the Categories field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCategories + +`func (o *MenuSyncFail) SetCategories(v []MenuSyncFailCategory)` + +SetCategories sets Categories field to given value. + +### HasCategories + +`func (o *MenuSyncFail) HasCategories() bool` + +HasCategories returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFailCategory.md b/docs/MenuSyncFailCategory.md new file mode 100644 index 0000000..093f06c --- /dev/null +++ b/docs/MenuSyncFailCategory.md @@ -0,0 +1,108 @@ +# MenuSyncFailCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. | [optional] +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] +**Items** | Pointer to [**[]MenuSyncFailItem**](MenuSyncFailItem.md) | An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. | [optional] + +## Methods + +### NewMenuSyncFailCategory + +`func NewMenuSyncFailCategory() *MenuSyncFailCategory` + +NewMenuSyncFailCategory instantiates a new MenuSyncFailCategory object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailCategoryWithDefaults + +`func NewMenuSyncFailCategoryWithDefaults() *MenuSyncFailCategory` + +NewMenuSyncFailCategoryWithDefaults instantiates a new MenuSyncFailCategory object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSyncFailCategory) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSyncFailCategory) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSyncFailCategory) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuSyncFailCategory) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncFailCategory) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFailCategory) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFailCategory) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFailCategory) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetItems + +`func (o *MenuSyncFailCategory) GetItems() []MenuSyncFailItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *MenuSyncFailCategory) GetItemsOk() (*[]MenuSyncFailItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *MenuSyncFailCategory) SetItems(v []MenuSyncFailItem)` + +SetItems sets Items field to given value. + +### HasItems + +`func (o *MenuSyncFailCategory) HasItems() bool` + +HasItems returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFailItem.md b/docs/MenuSyncFailItem.md new file mode 100644 index 0000000..5ee3f2d --- /dev/null +++ b/docs/MenuSyncFailItem.md @@ -0,0 +1,108 @@ +# MenuSyncFailItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The item's ID in the partner system. | [optional] +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] +**ModifierGroups** | Pointer to [**[]MenuSyncFailModifierGroup**](MenuSyncFailModifierGroup.md) | | [optional] + +## Methods + +### NewMenuSyncFailItem + +`func NewMenuSyncFailItem() *MenuSyncFailItem` + +NewMenuSyncFailItem instantiates a new MenuSyncFailItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailItemWithDefaults + +`func NewMenuSyncFailItemWithDefaults() *MenuSyncFailItem` + +NewMenuSyncFailItemWithDefaults instantiates a new MenuSyncFailItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSyncFailItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSyncFailItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSyncFailItem) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuSyncFailItem) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncFailItem) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFailItem) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFailItem) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFailItem) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetModifierGroups + +`func (o *MenuSyncFailItem) GetModifierGroups() []MenuSyncFailModifierGroup` + +GetModifierGroups returns the ModifierGroups field if non-nil, zero value otherwise. + +### GetModifierGroupsOk + +`func (o *MenuSyncFailItem) GetModifierGroupsOk() (*[]MenuSyncFailModifierGroup, bool)` + +GetModifierGroupsOk returns a tuple with the ModifierGroups field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifierGroups + +`func (o *MenuSyncFailItem) SetModifierGroups(v []MenuSyncFailModifierGroup)` + +SetModifierGroups sets ModifierGroups field to given value. + +### HasModifierGroups + +`func (o *MenuSyncFailItem) HasModifierGroups() bool` + +HasModifierGroups returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFailModifier.md b/docs/MenuSyncFailModifier.md new file mode 100644 index 0000000..4cf3208 --- /dev/null +++ b/docs/MenuSyncFailModifier.md @@ -0,0 +1,82 @@ +# MenuSyncFailModifier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] + +## Methods + +### NewMenuSyncFailModifier + +`func NewMenuSyncFailModifier() *MenuSyncFailModifier` + +NewMenuSyncFailModifier instantiates a new MenuSyncFailModifier object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailModifierWithDefaults + +`func NewMenuSyncFailModifierWithDefaults() *MenuSyncFailModifier` + +NewMenuSyncFailModifierWithDefaults instantiates a new MenuSyncFailModifier object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSyncFailModifier) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSyncFailModifier) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSyncFailModifier) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuSyncFailModifier) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncFailModifier) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFailModifier) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFailModifier) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFailModifier) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFailModifierGroup.md b/docs/MenuSyncFailModifierGroup.md new file mode 100644 index 0000000..0bc8226 --- /dev/null +++ b/docs/MenuSyncFailModifierGroup.md @@ -0,0 +1,108 @@ +# MenuSyncFailModifierGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | | [optional] +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] +**Modifiers** | Pointer to [**[]MenuSyncFailModifier**](MenuSyncFailModifier.md) | | [optional] + +## Methods + +### NewMenuSyncFailModifierGroup + +`func NewMenuSyncFailModifierGroup() *MenuSyncFailModifierGroup` + +NewMenuSyncFailModifierGroup instantiates a new MenuSyncFailModifierGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailModifierGroupWithDefaults + +`func NewMenuSyncFailModifierGroupWithDefaults() *MenuSyncFailModifierGroup` + +NewMenuSyncFailModifierGroupWithDefaults instantiates a new MenuSyncFailModifierGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *MenuSyncFailModifierGroup) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *MenuSyncFailModifierGroup) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *MenuSyncFailModifierGroup) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *MenuSyncFailModifierGroup) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncFailModifierGroup) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFailModifierGroup) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFailModifierGroup) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFailModifierGroup) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### GetModifiers + +`func (o *MenuSyncFailModifierGroup) GetModifiers() []MenuSyncFailModifier` + +GetModifiers returns the Modifiers field if non-nil, zero value otherwise. + +### GetModifiersOk + +`func (o *MenuSyncFailModifierGroup) GetModifiersOk() (*[]MenuSyncFailModifier, bool)` + +GetModifiersOk returns a tuple with the Modifiers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiers + +`func (o *MenuSyncFailModifierGroup) SetModifiers(v []MenuSyncFailModifier)` + +SetModifiers sets Modifiers field to given value. + +### HasModifiers + +`func (o *MenuSyncFailModifierGroup) HasModifiers() bool` + +HasModifiers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncFailServiceHours.md b/docs/MenuSyncFailServiceHours.md new file mode 100644 index 0000000..9eabd1b --- /dev/null +++ b/docs/MenuSyncFailServiceHours.md @@ -0,0 +1,56 @@ +# MenuSyncFailServiceHours + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] + +## Methods + +### NewMenuSyncFailServiceHours + +`func NewMenuSyncFailServiceHours() *MenuSyncFailServiceHours` + +NewMenuSyncFailServiceHours instantiates a new MenuSyncFailServiceHours object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncFailServiceHoursWithDefaults + +`func NewMenuSyncFailServiceHoursWithDefaults() *MenuSyncFailServiceHours` + +NewMenuSyncFailServiceHoursWithDefaults instantiates a new MenuSyncFailServiceHours object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrors + +`func (o *MenuSyncFailServiceHours) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncFailServiceHours) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncFailServiceHours) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncFailServiceHours) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncResponse.md b/docs/MenuSyncResponse.md new file mode 100644 index 0000000..2e33f1d --- /dev/null +++ b/docs/MenuSyncResponse.md @@ -0,0 +1,165 @@ +# MenuSyncResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedTime** | **time.Time** | The Unix time the specified menu was created in GrabFood's database. | +**UpdatedTime** | **time.Time** | The Unix time the specified menu was created in GrabFood's database. | +**Code** | **string** | The status code for this request. See [Menu sync response statuses](#section/Menu-sync-response-statuses) for more information. | +**Errors** | Pointer to **[]string** | An array of strings of error message. | [optional] +**Sections** | Pointer to [**[]MenuSyncFail**](MenuSyncFail.md) | | [optional] + +## Methods + +### NewMenuSyncResponse + +`func NewMenuSyncResponse(createdTime time.Time, updatedTime time.Time, code string, ) *MenuSyncResponse` + +NewMenuSyncResponse instantiates a new MenuSyncResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncResponseWithDefaults + +`func NewMenuSyncResponseWithDefaults() *MenuSyncResponse` + +NewMenuSyncResponseWithDefaults instantiates a new MenuSyncResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCreatedTime + +`func (o *MenuSyncResponse) GetCreatedTime() time.Time` + +GetCreatedTime returns the CreatedTime field if non-nil, zero value otherwise. + +### GetCreatedTimeOk + +`func (o *MenuSyncResponse) GetCreatedTimeOk() (*time.Time, bool)` + +GetCreatedTimeOk returns a tuple with the CreatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedTime + +`func (o *MenuSyncResponse) SetCreatedTime(v time.Time)` + +SetCreatedTime sets CreatedTime field to given value. + + +### GetUpdatedTime + +`func (o *MenuSyncResponse) GetUpdatedTime() time.Time` + +GetUpdatedTime returns the UpdatedTime field if non-nil, zero value otherwise. + +### GetUpdatedTimeOk + +`func (o *MenuSyncResponse) GetUpdatedTimeOk() (*time.Time, bool)` + +GetUpdatedTimeOk returns a tuple with the UpdatedTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedTime + +`func (o *MenuSyncResponse) SetUpdatedTime(v time.Time)` + +SetUpdatedTime sets UpdatedTime field to given value. + + +### GetCode + +`func (o *MenuSyncResponse) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *MenuSyncResponse) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *MenuSyncResponse) SetCode(v string)` + +SetCode sets Code field to given value. + + +### GetErrors + +`func (o *MenuSyncResponse) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncResponse) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncResponse) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncResponse) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + +### SetErrorsNil + +`func (o *MenuSyncResponse) SetErrorsNil(b bool)` + + SetErrorsNil sets the value for Errors to be an explicit nil + +### UnsetErrors +`func (o *MenuSyncResponse) UnsetErrors()` + +UnsetErrors ensures that no value is present for Errors, not even an explicit nil +### GetSections + +`func (o *MenuSyncResponse) GetSections() []MenuSyncFail` + +GetSections returns the Sections field if non-nil, zero value otherwise. + +### GetSectionsOk + +`func (o *MenuSyncResponse) GetSectionsOk() (*[]MenuSyncFail, bool)` + +GetSectionsOk returns a tuple with the Sections field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSections + +`func (o *MenuSyncResponse) SetSections(v []MenuSyncFail)` + +SetSections sets Sections field to given value. + +### HasSections + +`func (o *MenuSyncResponse) HasSections() bool` + +HasSections returns a boolean if a field has been set. + +### SetSectionsNil + +`func (o *MenuSyncResponse) SetSectionsNil(b bool)` + + SetSectionsNil sets the value for Sections to be an explicit nil + +### UnsetSections +`func (o *MenuSyncResponse) UnsetSections()` + +UnsetSections ensures that no value is present for Sections, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/MenuSyncWebhookRequest.md b/docs/MenuSyncWebhookRequest.md new file mode 100644 index 0000000..1c4aa9f --- /dev/null +++ b/docs/MenuSyncWebhookRequest.md @@ -0,0 +1,212 @@ +# MenuSyncWebhookRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequestID** | Pointer to **string** | An universally unique identifier (UUID) string. Used to uniquely identify a webhook request. Partners should use this value to distinguish between different webhook requests. If two requests contain the same requestID, only the first request should be considered and later requests **must** be ignored or discarded. | [optional] +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**PartnerMerchantID** | Pointer to **string** | The merchant's ID that is on the partner's database. | [optional] +**JobID** | Pointer to **string** | An UUID string. Uniquely identifies a menu sync job. This can be found from the [Menu Update Notification](#tag/update-menu-noti) API response header. | [optional] +**UpdatedAt** | Pointer to **string** | Indicates the time of menu sync status change. This is based on ISO_8601/RFC3339. For example: `2022-07-29T15:55:59Z`. | [optional] +**Status** | Pointer to **string** | Indicates the state of the menu sync job. | [optional] +**Errors** | Pointer to **[]string** | A string array of errors that occurred during processing. This array is empty if the status is not `FAILED`. | [optional] + +## Methods + +### NewMenuSyncWebhookRequest + +`func NewMenuSyncWebhookRequest() *MenuSyncWebhookRequest` + +NewMenuSyncWebhookRequest instantiates a new MenuSyncWebhookRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewMenuSyncWebhookRequestWithDefaults + +`func NewMenuSyncWebhookRequestWithDefaults() *MenuSyncWebhookRequest` + +NewMenuSyncWebhookRequestWithDefaults instantiates a new MenuSyncWebhookRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetRequestID + +`func (o *MenuSyncWebhookRequest) GetRequestID() string` + +GetRequestID returns the RequestID field if non-nil, zero value otherwise. + +### GetRequestIDOk + +`func (o *MenuSyncWebhookRequest) GetRequestIDOk() (*string, bool)` + +GetRequestIDOk returns a tuple with the RequestID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequestID + +`func (o *MenuSyncWebhookRequest) SetRequestID(v string)` + +SetRequestID sets RequestID field to given value. + +### HasRequestID + +`func (o *MenuSyncWebhookRequest) HasRequestID() bool` + +HasRequestID returns a boolean if a field has been set. + +### GetMerchantID + +`func (o *MenuSyncWebhookRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *MenuSyncWebhookRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *MenuSyncWebhookRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *MenuSyncWebhookRequest) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetPartnerMerchantID + +`func (o *MenuSyncWebhookRequest) GetPartnerMerchantID() string` + +GetPartnerMerchantID returns the PartnerMerchantID field if non-nil, zero value otherwise. + +### GetPartnerMerchantIDOk + +`func (o *MenuSyncWebhookRequest) GetPartnerMerchantIDOk() (*string, bool)` + +GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartnerMerchantID + +`func (o *MenuSyncWebhookRequest) SetPartnerMerchantID(v string)` + +SetPartnerMerchantID sets PartnerMerchantID field to given value. + +### HasPartnerMerchantID + +`func (o *MenuSyncWebhookRequest) HasPartnerMerchantID() bool` + +HasPartnerMerchantID returns a boolean if a field has been set. + +### GetJobID + +`func (o *MenuSyncWebhookRequest) GetJobID() string` + +GetJobID returns the JobID field if non-nil, zero value otherwise. + +### GetJobIDOk + +`func (o *MenuSyncWebhookRequest) GetJobIDOk() (*string, bool)` + +GetJobIDOk returns a tuple with the JobID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJobID + +`func (o *MenuSyncWebhookRequest) SetJobID(v string)` + +SetJobID sets JobID field to given value. + +### HasJobID + +`func (o *MenuSyncWebhookRequest) HasJobID() bool` + +HasJobID returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *MenuSyncWebhookRequest) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *MenuSyncWebhookRequest) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *MenuSyncWebhookRequest) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *MenuSyncWebhookRequest) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + +### GetStatus + +`func (o *MenuSyncWebhookRequest) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *MenuSyncWebhookRequest) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *MenuSyncWebhookRequest) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *MenuSyncWebhookRequest) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### GetErrors + +`func (o *MenuSyncWebhookRequest) GetErrors() []string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *MenuSyncWebhookRequest) GetErrorsOk() (*[]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *MenuSyncWebhookRequest) SetErrors(v []string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *MenuSyncWebhookRequest) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ModifierGroup.md b/docs/ModifierGroup.md new file mode 100644 index 0000000..345df8f --- /dev/null +++ b/docs/ModifierGroup.md @@ -0,0 +1,192 @@ +# ModifierGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ModifierGroup's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. | +**Name** | **string** | The name of the ModifierGroup for the item that is in the parent category and section. | +**NameTranslation** | Pointer to **map[string]string** | Translation of the modifier group name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). | [optional] +**AvailableStatus** | **string** | The status for the ModifierGroup that is in the item. | +**SelectionRangeMin** | Pointer to **int32** | The minimum quantity of the attribute. Refer to FAQs for more details about [selection range](#section/Menu/What-does-the-selection-range-do). | [optional] +**SelectionRangeMax** | **int32** | The maximum quantity of the attribute. Refer to FAQs for more details about [selection range](#section/Menu/What-does-the-selection-range-do). | +**Modifiers** | Pointer to [**[]MenuModifier**](MenuModifier.md) | An array of modifier JSON objects. Max 100 per modifierGroup. Refer to [Modifiers](#modifiers) for more information. | [optional] + +## Methods + +### NewModifierGroup + +`func NewModifierGroup(id string, name string, availableStatus string, selectionRangeMax int32, ) *ModifierGroup` + +NewModifierGroup instantiates a new ModifierGroup object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewModifierGroupWithDefaults + +`func NewModifierGroupWithDefaults() *ModifierGroup` + +NewModifierGroupWithDefaults instantiates a new ModifierGroup object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *ModifierGroup) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *ModifierGroup) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *ModifierGroup) SetId(v string)` + +SetId sets Id field to given value. + + +### GetName + +`func (o *ModifierGroup) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *ModifierGroup) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *ModifierGroup) SetName(v string)` + +SetName sets Name field to given value. + + +### GetNameTranslation + +`func (o *ModifierGroup) GetNameTranslation() map[string]string` + +GetNameTranslation returns the NameTranslation field if non-nil, zero value otherwise. + +### GetNameTranslationOk + +`func (o *ModifierGroup) GetNameTranslationOk() (*map[string]string, bool)` + +GetNameTranslationOk returns a tuple with the NameTranslation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNameTranslation + +`func (o *ModifierGroup) SetNameTranslation(v map[string]string)` + +SetNameTranslation sets NameTranslation field to given value. + +### HasNameTranslation + +`func (o *ModifierGroup) HasNameTranslation() bool` + +HasNameTranslation returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *ModifierGroup) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *ModifierGroup) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *ModifierGroup) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + + +### GetSelectionRangeMin + +`func (o *ModifierGroup) GetSelectionRangeMin() int32` + +GetSelectionRangeMin returns the SelectionRangeMin field if non-nil, zero value otherwise. + +### GetSelectionRangeMinOk + +`func (o *ModifierGroup) GetSelectionRangeMinOk() (*int32, bool)` + +GetSelectionRangeMinOk returns a tuple with the SelectionRangeMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelectionRangeMin + +`func (o *ModifierGroup) SetSelectionRangeMin(v int32)` + +SetSelectionRangeMin sets SelectionRangeMin field to given value. + +### HasSelectionRangeMin + +`func (o *ModifierGroup) HasSelectionRangeMin() bool` + +HasSelectionRangeMin returns a boolean if a field has been set. + +### GetSelectionRangeMax + +`func (o *ModifierGroup) GetSelectionRangeMax() int32` + +GetSelectionRangeMax returns the SelectionRangeMax field if non-nil, zero value otherwise. + +### GetSelectionRangeMaxOk + +`func (o *ModifierGroup) GetSelectionRangeMaxOk() (*int32, bool)` + +GetSelectionRangeMaxOk returns a tuple with the SelectionRangeMax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelectionRangeMax + +`func (o *ModifierGroup) SetSelectionRangeMax(v int32)` + +SetSelectionRangeMax sets SelectionRangeMax field to given value. + + +### GetModifiers + +`func (o *ModifierGroup) GetModifiers() []MenuModifier` + +GetModifiers returns the Modifiers field if non-nil, zero value otherwise. + +### GetModifiersOk + +`func (o *ModifierGroup) GetModifiersOk() (*[]MenuModifier, bool)` + +GetModifiersOk returns a tuple with the Modifiers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiers + +`func (o *ModifierGroup) SetModifiers(v []MenuModifier)` + +SetModifiers sets Modifiers field to given value. + +### HasModifiers + +`func (o *ModifierGroup) HasModifiers() bool` + +HasModifiers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NewOrderTimeRequest.md b/docs/NewOrderTimeRequest.md new file mode 100644 index 0000000..ae465de --- /dev/null +++ b/docs/NewOrderTimeRequest.md @@ -0,0 +1,72 @@ +# NewOrderTimeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**NewOrderReadyTime** | **time.Time** | The new order ready time for this order, based on ISO_8601/RFC3339. | + +## Methods + +### NewNewOrderTimeRequest + +`func NewNewOrderTimeRequest(orderID string, newOrderReadyTime time.Time, ) *NewOrderTimeRequest` + +NewNewOrderTimeRequest instantiates a new NewOrderTimeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNewOrderTimeRequestWithDefaults + +`func NewNewOrderTimeRequestWithDefaults() *NewOrderTimeRequest` + +NewNewOrderTimeRequestWithDefaults instantiates a new NewOrderTimeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *NewOrderTimeRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *NewOrderTimeRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *NewOrderTimeRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetNewOrderReadyTime + +`func (o *NewOrderTimeRequest) GetNewOrderReadyTime() time.Time` + +GetNewOrderReadyTime returns the NewOrderReadyTime field if non-nil, zero value otherwise. + +### GetNewOrderReadyTimeOk + +`func (o *NewOrderTimeRequest) GetNewOrderReadyTimeOk() (*time.Time, bool)` + +GetNewOrderReadyTimeOk returns a tuple with the NewOrderReadyTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNewOrderReadyTime + +`func (o *NewOrderTimeRequest) SetNewOrderReadyTime(v time.Time)` + +SetNewOrderReadyTime sets NewOrderReadyTime field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/NotifyMembershipWebviewAPI.md b/docs/NotifyMembershipWebviewAPI.md new file mode 100644 index 0000000..1d3ddf9 --- /dev/null +++ b/docs/NotifyMembershipWebviewAPI.md @@ -0,0 +1,75 @@ +# \NotifyMembershipWebviewAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**NotifyMembershipWebview**](NotifyMembershipWebviewAPI.md#NotifyMembershipWebview) | **Post** /partner/v1/membership/notify | Notify Membership + + + +## NotifyMembershipWebview + +> NotifyMembershipWebview(ctx).Authorization(authorization).ContentType(contentType).NotifyMembershipWebviewRequest(notifyMembershipWebviewRequest).Execute() + +Notify Membership + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + notifyMembershipWebviewRequest := *grabfood.NewNotifyMembershipWebviewRequest() // NotifyMembershipWebviewRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.NotifyMembershipWebviewAPI.NotifyMembershipWebview(context.Background()).Authorization(authorization).ContentType(contentType).NotifyMembershipWebviewRequest(notifyMembershipWebviewRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NotifyMembershipWebviewAPI.NotifyMembershipWebview``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiNotifyMembershipWebviewRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **notifyMembershipWebviewRequest** | [**NotifyMembershipWebviewRequest**](NotifyMembershipWebviewRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/NotifyMembershipWebviewRequest.md b/docs/NotifyMembershipWebviewRequest.md new file mode 100644 index 0000000..f75f7bd --- /dev/null +++ b/docs/NotifyMembershipWebviewRequest.md @@ -0,0 +1,134 @@ +# NotifyMembershipWebviewRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | Pointer to **string** | The unique member ID on the partner's database. | [optional] +**GrabID** | Pointer to **string** | The id used to identify an unique grab user. | [optional] +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**Action** | Pointer to **string** | Action completed in partner's webview. | [optional] + +## Methods + +### NewNotifyMembershipWebviewRequest + +`func NewNotifyMembershipWebviewRequest() *NotifyMembershipWebviewRequest` + +NewNotifyMembershipWebviewRequest instantiates a new NotifyMembershipWebviewRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewNotifyMembershipWebviewRequestWithDefaults + +`func NewNotifyMembershipWebviewRequestWithDefaults() *NotifyMembershipWebviewRequest` + +NewNotifyMembershipWebviewRequestWithDefaults instantiates a new NotifyMembershipWebviewRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *NotifyMembershipWebviewRequest) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *NotifyMembershipWebviewRequest) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *NotifyMembershipWebviewRequest) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + +### HasMemberID + +`func (o *NotifyMembershipWebviewRequest) HasMemberID() bool` + +HasMemberID returns a boolean if a field has been set. + +### GetGrabID + +`func (o *NotifyMembershipWebviewRequest) GetGrabID() string` + +GetGrabID returns the GrabID field if non-nil, zero value otherwise. + +### GetGrabIDOk + +`func (o *NotifyMembershipWebviewRequest) GetGrabIDOk() (*string, bool)` + +GetGrabIDOk returns a tuple with the GrabID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrabID + +`func (o *NotifyMembershipWebviewRequest) SetGrabID(v string)` + +SetGrabID sets GrabID field to given value. + +### HasGrabID + +`func (o *NotifyMembershipWebviewRequest) HasGrabID() bool` + +HasGrabID returns a boolean if a field has been set. + +### GetMerchantID + +`func (o *NotifyMembershipWebviewRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *NotifyMembershipWebviewRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *NotifyMembershipWebviewRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *NotifyMembershipWebviewRequest) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetAction + +`func (o *NotifyMembershipWebviewRequest) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *NotifyMembershipWebviewRequest) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *NotifyMembershipWebviewRequest) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *NotifyMembershipWebviewRequest) HasAction() bool` + +HasAction returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OpenPeriod.md b/docs/OpenPeriod.md new file mode 100644 index 0000000..ccb13ce --- /dev/null +++ b/docs/OpenPeriod.md @@ -0,0 +1,72 @@ +# OpenPeriod + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartTime** | **string** | The open start time in 24h format. | +**EndTime** | **string** | The open start time in 24h format. | + +## Methods + +### NewOpenPeriod + +`func NewOpenPeriod(startTime string, endTime string, ) *OpenPeriod` + +NewOpenPeriod instantiates a new OpenPeriod object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOpenPeriodWithDefaults + +`func NewOpenPeriodWithDefaults() *OpenPeriod` + +NewOpenPeriodWithDefaults instantiates a new OpenPeriod object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartTime + +`func (o *OpenPeriod) GetStartTime() string` + +GetStartTime returns the StartTime field if non-nil, zero value otherwise. + +### GetStartTimeOk + +`func (o *OpenPeriod) GetStartTimeOk() (*string, bool)` + +GetStartTimeOk returns a tuple with the StartTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartTime + +`func (o *OpenPeriod) SetStartTime(v string)` + +SetStartTime sets StartTime field to given value. + + +### GetEndTime + +`func (o *OpenPeriod) GetEndTime() string` + +GetEndTime returns the EndTime field if non-nil, zero value otherwise. + +### GetEndTimeOk + +`func (o *OpenPeriod) GetEndTimeOk() (*string, bool)` + +GetEndTimeOk returns a tuple with the EndTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndTime + +`func (o *OpenPeriod) SetEndTime(v string)` + +SetEndTime sets EndTime field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Order.md b/docs/Order.md new file mode 100644 index 0000000..15496ff --- /dev/null +++ b/docs/Order.md @@ -0,0 +1,536 @@ +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**ShortOrderNumber** | **string** | The GrabFood short order number. This is unique for each merchant per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**PartnerMerchantID** | Pointer to **string** | The merchant's ID that is on the partner's database. | [optional] +**PaymentType** | **string** | The payment method used. Refer to FAQs for more details about [paymentType](#section/Order/Does-the-paymentType-affect-partners). | +**Cutlery** | **bool** | The boolean value to indicate whether cutlery are needed or not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery). | +**OrderTime** | **string** | The UTC time that a consumer places the order, based on ISO_8601/RFC3339. | +**SubmitTime** | Pointer to **time.Time** | The order submit time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. | [optional] +**CompleteTime** | Pointer to **time.Time** | The order complete time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. | [optional] +**ScheduledTime** | Pointer to **string** | The order scheduled time, based on ISO_8601/RFC3339. Empty for non-scheduled orders. | [optional] +**OrderState** | Pointer to **string** | The state of the order. Only present in the [List Orders](#tag/list-order) response. Refer to [Order States](#section/Order-states). | [optional] +**Currency** | [**Currency**](Currency.md) | | +**FeatureFlags** | [**OrderFeatureFlags**](OrderFeatureFlags.md) | | +**Items** | [**[]OrderItem**](OrderItem.md) | The items in an array of JSON Object. Refer to [Items](#items) for more information. | +**Campaigns** | Pointer to [**[]OrderCampaign**](OrderCampaign.md) | The campaigns that are applicable for the order.`null` when there is no campaign applied. | [optional] +**Promos** | Pointer to [**[]OrderPromo**](OrderPromo.md) | An array of promotion objects. Only promotions that are funded by merchants will be sent. | [optional] +**Price** | [**OrderPrice**](OrderPrice.md) | | +**DineIn** | Pointer to [**DineIn**](DineIn.md) | | [optional] +**Receiver** | Pointer to [**Receiver**](Receiver.md) | | [optional] +**OrderReadyEstimation** | Pointer to [**OrderReadyEstimation**](OrderReadyEstimation.md) | | [optional] +**MembershipID** | Pointer to **string** | Membership ID for loyalty project. Only present for loyalty program partners. | [optional] + +## Methods + +### NewOrder + +`func NewOrder(orderID string, shortOrderNumber string, merchantID string, paymentType string, cutlery bool, orderTime string, currency Currency, featureFlags OrderFeatureFlags, items []OrderItem, price OrderPrice, ) *Order` + +NewOrder instantiates a new Order object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderWithDefaults + +`func NewOrderWithDefaults() *Order` + +NewOrderWithDefaults instantiates a new Order object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *Order) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *Order) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *Order) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetShortOrderNumber + +`func (o *Order) GetShortOrderNumber() string` + +GetShortOrderNumber returns the ShortOrderNumber field if non-nil, zero value otherwise. + +### GetShortOrderNumberOk + +`func (o *Order) GetShortOrderNumberOk() (*string, bool)` + +GetShortOrderNumberOk returns a tuple with the ShortOrderNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortOrderNumber + +`func (o *Order) SetShortOrderNumber(v string)` + +SetShortOrderNumber sets ShortOrderNumber field to given value. + + +### GetMerchantID + +`func (o *Order) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *Order) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *Order) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetPartnerMerchantID + +`func (o *Order) GetPartnerMerchantID() string` + +GetPartnerMerchantID returns the PartnerMerchantID field if non-nil, zero value otherwise. + +### GetPartnerMerchantIDOk + +`func (o *Order) GetPartnerMerchantIDOk() (*string, bool)` + +GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartnerMerchantID + +`func (o *Order) SetPartnerMerchantID(v string)` + +SetPartnerMerchantID sets PartnerMerchantID field to given value. + +### HasPartnerMerchantID + +`func (o *Order) HasPartnerMerchantID() bool` + +HasPartnerMerchantID returns a boolean if a field has been set. + +### GetPaymentType + +`func (o *Order) GetPaymentType() string` + +GetPaymentType returns the PaymentType field if non-nil, zero value otherwise. + +### GetPaymentTypeOk + +`func (o *Order) GetPaymentTypeOk() (*string, bool)` + +GetPaymentTypeOk returns a tuple with the PaymentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentType + +`func (o *Order) SetPaymentType(v string)` + +SetPaymentType sets PaymentType field to given value. + + +### GetCutlery + +`func (o *Order) GetCutlery() bool` + +GetCutlery returns the Cutlery field if non-nil, zero value otherwise. + +### GetCutleryOk + +`func (o *Order) GetCutleryOk() (*bool, bool)` + +GetCutleryOk returns a tuple with the Cutlery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCutlery + +`func (o *Order) SetCutlery(v bool)` + +SetCutlery sets Cutlery field to given value. + + +### GetOrderTime + +`func (o *Order) GetOrderTime() string` + +GetOrderTime returns the OrderTime field if non-nil, zero value otherwise. + +### GetOrderTimeOk + +`func (o *Order) GetOrderTimeOk() (*string, bool)` + +GetOrderTimeOk returns a tuple with the OrderTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderTime + +`func (o *Order) SetOrderTime(v string)` + +SetOrderTime sets OrderTime field to given value. + + +### GetSubmitTime + +`func (o *Order) GetSubmitTime() time.Time` + +GetSubmitTime returns the SubmitTime field if non-nil, zero value otherwise. + +### GetSubmitTimeOk + +`func (o *Order) GetSubmitTimeOk() (*time.Time, bool)` + +GetSubmitTimeOk returns a tuple with the SubmitTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubmitTime + +`func (o *Order) SetSubmitTime(v time.Time)` + +SetSubmitTime sets SubmitTime field to given value. + +### HasSubmitTime + +`func (o *Order) HasSubmitTime() bool` + +HasSubmitTime returns a boolean if a field has been set. + +### GetCompleteTime + +`func (o *Order) GetCompleteTime() time.Time` + +GetCompleteTime returns the CompleteTime field if non-nil, zero value otherwise. + +### GetCompleteTimeOk + +`func (o *Order) GetCompleteTimeOk() (*time.Time, bool)` + +GetCompleteTimeOk returns a tuple with the CompleteTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompleteTime + +`func (o *Order) SetCompleteTime(v time.Time)` + +SetCompleteTime sets CompleteTime field to given value. + +### HasCompleteTime + +`func (o *Order) HasCompleteTime() bool` + +HasCompleteTime returns a boolean if a field has been set. + +### GetScheduledTime + +`func (o *Order) GetScheduledTime() string` + +GetScheduledTime returns the ScheduledTime field if non-nil, zero value otherwise. + +### GetScheduledTimeOk + +`func (o *Order) GetScheduledTimeOk() (*string, bool)` + +GetScheduledTimeOk returns a tuple with the ScheduledTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduledTime + +`func (o *Order) SetScheduledTime(v string)` + +SetScheduledTime sets ScheduledTime field to given value. + +### HasScheduledTime + +`func (o *Order) HasScheduledTime() bool` + +HasScheduledTime returns a boolean if a field has been set. + +### GetOrderState + +`func (o *Order) GetOrderState() string` + +GetOrderState returns the OrderState field if non-nil, zero value otherwise. + +### GetOrderStateOk + +`func (o *Order) GetOrderStateOk() (*string, bool)` + +GetOrderStateOk returns a tuple with the OrderState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderState + +`func (o *Order) SetOrderState(v string)` + +SetOrderState sets OrderState field to given value. + +### HasOrderState + +`func (o *Order) HasOrderState() bool` + +HasOrderState returns a boolean if a field has been set. + +### GetCurrency + +`func (o *Order) GetCurrency() Currency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *Order) GetCurrencyOk() (*Currency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *Order) SetCurrency(v Currency)` + +SetCurrency sets Currency field to given value. + + +### GetFeatureFlags + +`func (o *Order) GetFeatureFlags() OrderFeatureFlags` + +GetFeatureFlags returns the FeatureFlags field if non-nil, zero value otherwise. + +### GetFeatureFlagsOk + +`func (o *Order) GetFeatureFlagsOk() (*OrderFeatureFlags, bool)` + +GetFeatureFlagsOk returns a tuple with the FeatureFlags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureFlags + +`func (o *Order) SetFeatureFlags(v OrderFeatureFlags)` + +SetFeatureFlags sets FeatureFlags field to given value. + + +### GetItems + +`func (o *Order) GetItems() []OrderItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *Order) GetItemsOk() (*[]OrderItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *Order) SetItems(v []OrderItem)` + +SetItems sets Items field to given value. + + +### GetCampaigns + +`func (o *Order) GetCampaigns() []OrderCampaign` + +GetCampaigns returns the Campaigns field if non-nil, zero value otherwise. + +### GetCampaignsOk + +`func (o *Order) GetCampaignsOk() (*[]OrderCampaign, bool)` + +GetCampaignsOk returns a tuple with the Campaigns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCampaigns + +`func (o *Order) SetCampaigns(v []OrderCampaign)` + +SetCampaigns sets Campaigns field to given value. + +### HasCampaigns + +`func (o *Order) HasCampaigns() bool` + +HasCampaigns returns a boolean if a field has been set. + +### SetCampaignsNil + +`func (o *Order) SetCampaignsNil(b bool)` + + SetCampaignsNil sets the value for Campaigns to be an explicit nil + +### UnsetCampaigns +`func (o *Order) UnsetCampaigns()` + +UnsetCampaigns ensures that no value is present for Campaigns, not even an explicit nil +### GetPromos + +`func (o *Order) GetPromos() []OrderPromo` + +GetPromos returns the Promos field if non-nil, zero value otherwise. + +### GetPromosOk + +`func (o *Order) GetPromosOk() (*[]OrderPromo, bool)` + +GetPromosOk returns a tuple with the Promos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromos + +`func (o *Order) SetPromos(v []OrderPromo)` + +SetPromos sets Promos field to given value. + +### HasPromos + +`func (o *Order) HasPromos() bool` + +HasPromos returns a boolean if a field has been set. + +### GetPrice + +`func (o *Order) GetPrice() OrderPrice` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *Order) GetPriceOk() (*OrderPrice, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *Order) SetPrice(v OrderPrice)` + +SetPrice sets Price field to given value. + + +### GetDineIn + +`func (o *Order) GetDineIn() DineIn` + +GetDineIn returns the DineIn field if non-nil, zero value otherwise. + +### GetDineInOk + +`func (o *Order) GetDineInOk() (*DineIn, bool)` + +GetDineInOk returns a tuple with the DineIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineIn + +`func (o *Order) SetDineIn(v DineIn)` + +SetDineIn sets DineIn field to given value. + +### HasDineIn + +`func (o *Order) HasDineIn() bool` + +HasDineIn returns a boolean if a field has been set. + +### GetReceiver + +`func (o *Order) GetReceiver() Receiver` + +GetReceiver returns the Receiver field if non-nil, zero value otherwise. + +### GetReceiverOk + +`func (o *Order) GetReceiverOk() (*Receiver, bool)` + +GetReceiverOk returns a tuple with the Receiver field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiver + +`func (o *Order) SetReceiver(v Receiver)` + +SetReceiver sets Receiver field to given value. + +### HasReceiver + +`func (o *Order) HasReceiver() bool` + +HasReceiver returns a boolean if a field has been set. + +### GetOrderReadyEstimation + +`func (o *Order) GetOrderReadyEstimation() OrderReadyEstimation` + +GetOrderReadyEstimation returns the OrderReadyEstimation field if non-nil, zero value otherwise. + +### GetOrderReadyEstimationOk + +`func (o *Order) GetOrderReadyEstimationOk() (*OrderReadyEstimation, bool)` + +GetOrderReadyEstimationOk returns a tuple with the OrderReadyEstimation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderReadyEstimation + +`func (o *Order) SetOrderReadyEstimation(v OrderReadyEstimation)` + +SetOrderReadyEstimation sets OrderReadyEstimation field to given value. + +### HasOrderReadyEstimation + +`func (o *Order) HasOrderReadyEstimation() bool` + +HasOrderReadyEstimation returns a boolean if a field has been set. + +### GetMembershipID + +`func (o *Order) GetMembershipID() string` + +GetMembershipID returns the MembershipID field if non-nil, zero value otherwise. + +### GetMembershipIDOk + +`func (o *Order) GetMembershipIDOk() (*string, bool)` + +GetMembershipIDOk returns a tuple with the MembershipID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembershipID + +`func (o *Order) SetMembershipID(v string)` + +SetMembershipID sets MembershipID field to given value. + +### HasMembershipID + +`func (o *Order) HasMembershipID() bool` + +HasMembershipID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderCampaign.md b/docs/OrderCampaign.md new file mode 100644 index 0000000..67c66dc --- /dev/null +++ b/docs/OrderCampaign.md @@ -0,0 +1,326 @@ +# OrderCampaign + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The campaign's ID returned by GrabFood upon campaign creation. | [optional] +**Name** | Pointer to **string** | The name of the campaign. This campaign name has been automatically generated by Grab for display in the customer app. | [optional] +**CampaignNameForMex** | Pointer to **string** | The campaign name provided by the merchant in [Create Campaign](#tag/create-campaign). Whitelist required, reach out to your integration manager. | [optional] +**Level** | Pointer to **string** | The campaign level. | [optional] +**Type** | Pointer to **string** | The type of campaign. | [optional] +**UsageCount** | Pointer to **int64** | The campaign redemption count in this order. | [optional] +**MexFundedRatio** | Pointer to **int32** | The ratio funded by the merchant in percentage. | [optional] +**DeductedAmount** | Pointer to **int64** | The deducted amount in minor unit format. `Item price(tax inclusive) * 20% discount | 2375*0.2` | [optional] +**DeductedPart** | Pointer to **string** | The part that the campaign is applied. | [optional] +**AppliedItemIDs** | Pointer to **[]string** | An array of item IDs that get discount under this campaign. `null` if no item applied in this campaign. | [optional] +**FreeItem** | Pointer to [**OrderFreeItem**](OrderFreeItem.md) | | [optional] + +## Methods + +### NewOrderCampaign + +`func NewOrderCampaign() *OrderCampaign` + +NewOrderCampaign instantiates a new OrderCampaign object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderCampaignWithDefaults + +`func NewOrderCampaignWithDefaults() *OrderCampaign` + +NewOrderCampaignWithDefaults instantiates a new OrderCampaign object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *OrderCampaign) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OrderCampaign) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OrderCampaign) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OrderCampaign) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *OrderCampaign) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrderCampaign) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrderCampaign) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrderCampaign) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetCampaignNameForMex + +`func (o *OrderCampaign) GetCampaignNameForMex() string` + +GetCampaignNameForMex returns the CampaignNameForMex field if non-nil, zero value otherwise. + +### GetCampaignNameForMexOk + +`func (o *OrderCampaign) GetCampaignNameForMexOk() (*string, bool)` + +GetCampaignNameForMexOk returns a tuple with the CampaignNameForMex field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCampaignNameForMex + +`func (o *OrderCampaign) SetCampaignNameForMex(v string)` + +SetCampaignNameForMex sets CampaignNameForMex field to given value. + +### HasCampaignNameForMex + +`func (o *OrderCampaign) HasCampaignNameForMex() bool` + +HasCampaignNameForMex returns a boolean if a field has been set. + +### GetLevel + +`func (o *OrderCampaign) GetLevel() string` + +GetLevel returns the Level field if non-nil, zero value otherwise. + +### GetLevelOk + +`func (o *OrderCampaign) GetLevelOk() (*string, bool)` + +GetLevelOk returns a tuple with the Level field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLevel + +`func (o *OrderCampaign) SetLevel(v string)` + +SetLevel sets Level field to given value. + +### HasLevel + +`func (o *OrderCampaign) HasLevel() bool` + +HasLevel returns a boolean if a field has been set. + +### GetType + +`func (o *OrderCampaign) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *OrderCampaign) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *OrderCampaign) SetType(v string)` + +SetType sets Type field to given value. + +### HasType + +`func (o *OrderCampaign) HasType() bool` + +HasType returns a boolean if a field has been set. + +### GetUsageCount + +`func (o *OrderCampaign) GetUsageCount() int64` + +GetUsageCount returns the UsageCount field if non-nil, zero value otherwise. + +### GetUsageCountOk + +`func (o *OrderCampaign) GetUsageCountOk() (*int64, bool)` + +GetUsageCountOk returns a tuple with the UsageCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageCount + +`func (o *OrderCampaign) SetUsageCount(v int64)` + +SetUsageCount sets UsageCount field to given value. + +### HasUsageCount + +`func (o *OrderCampaign) HasUsageCount() bool` + +HasUsageCount returns a boolean if a field has been set. + +### GetMexFundedRatio + +`func (o *OrderCampaign) GetMexFundedRatio() int32` + +GetMexFundedRatio returns the MexFundedRatio field if non-nil, zero value otherwise. + +### GetMexFundedRatioOk + +`func (o *OrderCampaign) GetMexFundedRatioOk() (*int32, bool)` + +GetMexFundedRatioOk returns a tuple with the MexFundedRatio field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMexFundedRatio + +`func (o *OrderCampaign) SetMexFundedRatio(v int32)` + +SetMexFundedRatio sets MexFundedRatio field to given value. + +### HasMexFundedRatio + +`func (o *OrderCampaign) HasMexFundedRatio() bool` + +HasMexFundedRatio returns a boolean if a field has been set. + +### GetDeductedAmount + +`func (o *OrderCampaign) GetDeductedAmount() int64` + +GetDeductedAmount returns the DeductedAmount field if non-nil, zero value otherwise. + +### GetDeductedAmountOk + +`func (o *OrderCampaign) GetDeductedAmountOk() (*int64, bool)` + +GetDeductedAmountOk returns a tuple with the DeductedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeductedAmount + +`func (o *OrderCampaign) SetDeductedAmount(v int64)` + +SetDeductedAmount sets DeductedAmount field to given value. + +### HasDeductedAmount + +`func (o *OrderCampaign) HasDeductedAmount() bool` + +HasDeductedAmount returns a boolean if a field has been set. + +### GetDeductedPart + +`func (o *OrderCampaign) GetDeductedPart() string` + +GetDeductedPart returns the DeductedPart field if non-nil, zero value otherwise. + +### GetDeductedPartOk + +`func (o *OrderCampaign) GetDeductedPartOk() (*string, bool)` + +GetDeductedPartOk returns a tuple with the DeductedPart field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeductedPart + +`func (o *OrderCampaign) SetDeductedPart(v string)` + +SetDeductedPart sets DeductedPart field to given value. + +### HasDeductedPart + +`func (o *OrderCampaign) HasDeductedPart() bool` + +HasDeductedPart returns a boolean if a field has been set. + +### GetAppliedItemIDs + +`func (o *OrderCampaign) GetAppliedItemIDs() []string` + +GetAppliedItemIDs returns the AppliedItemIDs field if non-nil, zero value otherwise. + +### GetAppliedItemIDsOk + +`func (o *OrderCampaign) GetAppliedItemIDsOk() (*[]string, bool)` + +GetAppliedItemIDsOk returns a tuple with the AppliedItemIDs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAppliedItemIDs + +`func (o *OrderCampaign) SetAppliedItemIDs(v []string)` + +SetAppliedItemIDs sets AppliedItemIDs field to given value. + +### HasAppliedItemIDs + +`func (o *OrderCampaign) HasAppliedItemIDs() bool` + +HasAppliedItemIDs returns a boolean if a field has been set. + +### SetAppliedItemIDsNil + +`func (o *OrderCampaign) SetAppliedItemIDsNil(b bool)` + + SetAppliedItemIDsNil sets the value for AppliedItemIDs to be an explicit nil + +### UnsetAppliedItemIDs +`func (o *OrderCampaign) UnsetAppliedItemIDs()` + +UnsetAppliedItemIDs ensures that no value is present for AppliedItemIDs, not even an explicit nil +### GetFreeItem + +`func (o *OrderCampaign) GetFreeItem() OrderFreeItem` + +GetFreeItem returns the FreeItem field if non-nil, zero value otherwise. + +### GetFreeItemOk + +`func (o *OrderCampaign) GetFreeItemOk() (*OrderFreeItem, bool)` + +GetFreeItemOk returns a tuple with the FreeItem field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFreeItem + +`func (o *OrderCampaign) SetFreeItem(v OrderFreeItem)` + +SetFreeItem sets FreeItem field to given value. + +### HasFreeItem + +`func (o *OrderCampaign) HasFreeItem() bool` + +HasFreeItem returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderDeliveryRequest.md b/docs/OrderDeliveryRequest.md new file mode 100644 index 0000000..13cce98 --- /dev/null +++ b/docs/OrderDeliveryRequest.md @@ -0,0 +1,93 @@ +# OrderDeliveryRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**FromState** | **string** | Specify the order's initial state. | +**ToState** | **string** | Specify the order's new state. | + +## Methods + +### NewOrderDeliveryRequest + +`func NewOrderDeliveryRequest(orderID string, fromState string, toState string, ) *OrderDeliveryRequest` + +NewOrderDeliveryRequest instantiates a new OrderDeliveryRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderDeliveryRequestWithDefaults + +`func NewOrderDeliveryRequestWithDefaults() *OrderDeliveryRequest` + +NewOrderDeliveryRequestWithDefaults instantiates a new OrderDeliveryRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *OrderDeliveryRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *OrderDeliveryRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *OrderDeliveryRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetFromState + +`func (o *OrderDeliveryRequest) GetFromState() string` + +GetFromState returns the FromState field if non-nil, zero value otherwise. + +### GetFromStateOk + +`func (o *OrderDeliveryRequest) GetFromStateOk() (*string, bool)` + +GetFromStateOk returns a tuple with the FromState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFromState + +`func (o *OrderDeliveryRequest) SetFromState(v string)` + +SetFromState sets FromState field to given value. + + +### GetToState + +`func (o *OrderDeliveryRequest) GetToState() string` + +GetToState returns the ToState field if non-nil, zero value otherwise. + +### GetToStateOk + +`func (o *OrderDeliveryRequest) GetToStateOk() (*string, bool)` + +GetToStateOk returns a tuple with the ToState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetToState + +`func (o *OrderDeliveryRequest) SetToState(v string)` + +SetToState sets ToState field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderFeatureFlags.md b/docs/OrderFeatureFlags.md new file mode 100644 index 0000000..a832147 --- /dev/null +++ b/docs/OrderFeatureFlags.md @@ -0,0 +1,98 @@ +# OrderFeatureFlags + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderAcceptedType** | **string** | The acceptance type for the order. Refer to FAQs for more details about [orderAcceptedType](#section/Order/How-do-I-identify-if-a-particular-order-is-auto-or-manual-acceptance). | +**OrderType** | **string** | The type of order. | +**IsMexEditOrder** | Pointer to **bool** | A boolean value that indicates if the order is edited. | [optional] + +## Methods + +### NewOrderFeatureFlags + +`func NewOrderFeatureFlags(orderAcceptedType string, orderType string, ) *OrderFeatureFlags` + +NewOrderFeatureFlags instantiates a new OrderFeatureFlags object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderFeatureFlagsWithDefaults + +`func NewOrderFeatureFlagsWithDefaults() *OrderFeatureFlags` + +NewOrderFeatureFlagsWithDefaults instantiates a new OrderFeatureFlags object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderAcceptedType + +`func (o *OrderFeatureFlags) GetOrderAcceptedType() string` + +GetOrderAcceptedType returns the OrderAcceptedType field if non-nil, zero value otherwise. + +### GetOrderAcceptedTypeOk + +`func (o *OrderFeatureFlags) GetOrderAcceptedTypeOk() (*string, bool)` + +GetOrderAcceptedTypeOk returns a tuple with the OrderAcceptedType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderAcceptedType + +`func (o *OrderFeatureFlags) SetOrderAcceptedType(v string)` + +SetOrderAcceptedType sets OrderAcceptedType field to given value. + + +### GetOrderType + +`func (o *OrderFeatureFlags) GetOrderType() string` + +GetOrderType returns the OrderType field if non-nil, zero value otherwise. + +### GetOrderTypeOk + +`func (o *OrderFeatureFlags) GetOrderTypeOk() (*string, bool)` + +GetOrderTypeOk returns a tuple with the OrderType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderType + +`func (o *OrderFeatureFlags) SetOrderType(v string)` + +SetOrderType sets OrderType field to given value. + + +### GetIsMexEditOrder + +`func (o *OrderFeatureFlags) GetIsMexEditOrder() bool` + +GetIsMexEditOrder returns the IsMexEditOrder field if non-nil, zero value otherwise. + +### GetIsMexEditOrderOk + +`func (o *OrderFeatureFlags) GetIsMexEditOrderOk() (*bool, bool)` + +GetIsMexEditOrderOk returns a tuple with the IsMexEditOrder field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsMexEditOrder + +`func (o *OrderFeatureFlags) SetIsMexEditOrder(v bool)` + +SetIsMexEditOrder sets IsMexEditOrder field to given value. + +### HasIsMexEditOrder + +`func (o *OrderFeatureFlags) HasIsMexEditOrder() bool` + +HasIsMexEditOrder returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderFreeItem.md b/docs/OrderFreeItem.md new file mode 100644 index 0000000..55fedce --- /dev/null +++ b/docs/OrderFreeItem.md @@ -0,0 +1,134 @@ +# OrderFreeItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The item's ID | [optional] +**Name** | Pointer to **string** | The name of the item. | [optional] +**Quantity** | Pointer to **int32** | The item's quantity. Maximum is **1**. | [optional] +**Price** | Pointer to **int64** | The item's price in minor unit format. | [optional] + +## Methods + +### NewOrderFreeItem + +`func NewOrderFreeItem() *OrderFreeItem` + +NewOrderFreeItem instantiates a new OrderFreeItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderFreeItemWithDefaults + +`func NewOrderFreeItemWithDefaults() *OrderFreeItem` + +NewOrderFreeItemWithDefaults instantiates a new OrderFreeItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *OrderFreeItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OrderFreeItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OrderFreeItem) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OrderFreeItem) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *OrderFreeItem) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrderFreeItem) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrderFreeItem) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrderFreeItem) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetQuantity + +`func (o *OrderFreeItem) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *OrderFreeItem) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *OrderFreeItem) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *OrderFreeItem) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### GetPrice + +`func (o *OrderFreeItem) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *OrderFreeItem) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *OrderFreeItem) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *OrderFreeItem) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderItem.md b/docs/OrderItem.md new file mode 100644 index 0000000..86c78a6 --- /dev/null +++ b/docs/OrderItem.md @@ -0,0 +1,228 @@ +# OrderItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The item's ExternalID in the partner system. | +**GrabItemID** | **string** | The item's ID in Grab system. Partner can use this field in the `EditOrder` endpoint. | +**Quantity** | **int32** | The number of the item ordered. | +**Price** | **int64** | The price (tax-inclusive) in minor format for 1 item and modifiers under it. `Item price(tax inclusive) + Modifier price(tax inclusive) | (2241*1.06)+(165*1.06)=2550`. | +**Tax** | Pointer to **int64** | Tax in minor format for 1 item and all modifiers under it. `0` if tax configuration is absent. `Item tax + Modifier tax | (2241*0.06)+(165*0.06)=144`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). | [optional] +**Specifications** | Pointer to **string** | An extra note for the merchant. `Blank` if no note from consumer. | [optional] +**OutOfStockInstruction** | Pointer to [**NullableOutOfStockInstruction**](OutOfStockInstruction.md) | | [optional] +**Modifiers** | Pointer to [**[]OrderItemModifier**](OrderItemModifier.md) | An array of JSON objects modifiers. Read [this](#categories) for more information. | [optional] + +## Methods + +### NewOrderItem + +`func NewOrderItem(id string, grabItemID string, quantity int32, price int64, ) *OrderItem` + +NewOrderItem instantiates a new OrderItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderItemWithDefaults + +`func NewOrderItemWithDefaults() *OrderItem` + +NewOrderItemWithDefaults instantiates a new OrderItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *OrderItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OrderItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OrderItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetGrabItemID + +`func (o *OrderItem) GetGrabItemID() string` + +GetGrabItemID returns the GrabItemID field if non-nil, zero value otherwise. + +### GetGrabItemIDOk + +`func (o *OrderItem) GetGrabItemIDOk() (*string, bool)` + +GetGrabItemIDOk returns a tuple with the GrabItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrabItemID + +`func (o *OrderItem) SetGrabItemID(v string)` + +SetGrabItemID sets GrabItemID field to given value. + + +### GetQuantity + +`func (o *OrderItem) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *OrderItem) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *OrderItem) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + + +### GetPrice + +`func (o *OrderItem) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *OrderItem) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *OrderItem) SetPrice(v int64)` + +SetPrice sets Price field to given value. + + +### GetTax + +`func (o *OrderItem) GetTax() int64` + +GetTax returns the Tax field if non-nil, zero value otherwise. + +### GetTaxOk + +`func (o *OrderItem) GetTaxOk() (*int64, bool)` + +GetTaxOk returns a tuple with the Tax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTax + +`func (o *OrderItem) SetTax(v int64)` + +SetTax sets Tax field to given value. + +### HasTax + +`func (o *OrderItem) HasTax() bool` + +HasTax returns a boolean if a field has been set. + +### GetSpecifications + +`func (o *OrderItem) GetSpecifications() string` + +GetSpecifications returns the Specifications field if non-nil, zero value otherwise. + +### GetSpecificationsOk + +`func (o *OrderItem) GetSpecificationsOk() (*string, bool)` + +GetSpecificationsOk returns a tuple with the Specifications field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecifications + +`func (o *OrderItem) SetSpecifications(v string)` + +SetSpecifications sets Specifications field to given value. + +### HasSpecifications + +`func (o *OrderItem) HasSpecifications() bool` + +HasSpecifications returns a boolean if a field has been set. + +### GetOutOfStockInstruction + +`func (o *OrderItem) GetOutOfStockInstruction() OutOfStockInstruction` + +GetOutOfStockInstruction returns the OutOfStockInstruction field if non-nil, zero value otherwise. + +### GetOutOfStockInstructionOk + +`func (o *OrderItem) GetOutOfStockInstructionOk() (*OutOfStockInstruction, bool)` + +GetOutOfStockInstructionOk returns a tuple with the OutOfStockInstruction field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOutOfStockInstruction + +`func (o *OrderItem) SetOutOfStockInstruction(v OutOfStockInstruction)` + +SetOutOfStockInstruction sets OutOfStockInstruction field to given value. + +### HasOutOfStockInstruction + +`func (o *OrderItem) HasOutOfStockInstruction() bool` + +HasOutOfStockInstruction returns a boolean if a field has been set. + +### SetOutOfStockInstructionNil + +`func (o *OrderItem) SetOutOfStockInstructionNil(b bool)` + + SetOutOfStockInstructionNil sets the value for OutOfStockInstruction to be an explicit nil + +### UnsetOutOfStockInstruction +`func (o *OrderItem) UnsetOutOfStockInstruction()` + +UnsetOutOfStockInstruction ensures that no value is present for OutOfStockInstruction, not even an explicit nil +### GetModifiers + +`func (o *OrderItem) GetModifiers() []OrderItemModifier` + +GetModifiers returns the Modifiers field if non-nil, zero value otherwise. + +### GetModifiersOk + +`func (o *OrderItem) GetModifiersOk() (*[]OrderItemModifier, bool)` + +GetModifiersOk returns a tuple with the Modifiers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetModifiers + +`func (o *OrderItem) SetModifiers(v []OrderItemModifier)` + +SetModifiers sets Modifiers field to given value. + +### HasModifiers + +`func (o *OrderItem) HasModifiers() bool` + +HasModifiers returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderItemModifier.md b/docs/OrderItemModifier.md new file mode 100644 index 0000000..1f1c3d8 --- /dev/null +++ b/docs/OrderItemModifier.md @@ -0,0 +1,134 @@ +# OrderItemModifier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **string** | The modifier's ID that is on the partner's system. | [optional] +**Price** | Pointer to **int64** | The modifier's price (tax-inclusive) in minor format. `round(165 * (1 + 0.06)) = 175`. | [optional] +**Tax** | Pointer to **int64** | Tax in minor format for 1 modifier. `165*0.06=10`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). | [optional] +**Quantity** | Pointer to **int32** | The number of modifiers present. The value is always 1. | [optional] + +## Methods + +### NewOrderItemModifier + +`func NewOrderItemModifier() *OrderItemModifier` + +NewOrderItemModifier instantiates a new OrderItemModifier object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderItemModifierWithDefaults + +`func NewOrderItemModifierWithDefaults() *OrderItemModifier` + +NewOrderItemModifierWithDefaults instantiates a new OrderItemModifier object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetId + +`func (o *OrderItemModifier) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *OrderItemModifier) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *OrderItemModifier) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *OrderItemModifier) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetPrice + +`func (o *OrderItemModifier) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *OrderItemModifier) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *OrderItemModifier) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *OrderItemModifier) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetTax + +`func (o *OrderItemModifier) GetTax() int64` + +GetTax returns the Tax field if non-nil, zero value otherwise. + +### GetTaxOk + +`func (o *OrderItemModifier) GetTaxOk() (*int64, bool)` + +GetTaxOk returns a tuple with the Tax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTax + +`func (o *OrderItemModifier) SetTax(v int64)` + +SetTax sets Tax field to given value. + +### HasTax + +`func (o *OrderItemModifier) HasTax() bool` + +HasTax returns a boolean if a field has been set. + +### GetQuantity + +`func (o *OrderItemModifier) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *OrderItemModifier) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *OrderItemModifier) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *OrderItemModifier) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderPrice.md b/docs/OrderPrice.md new file mode 100644 index 0000000..221b8ac --- /dev/null +++ b/docs/OrderPrice.md @@ -0,0 +1,228 @@ +# OrderPrice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Subtotal** | **int64** | Total item and modifier price (tax-inclusive) in the minor unit. `Sum of all (Item price * quantity) | 2550*1=2550`. | +**Tax** | Pointer to **int64** | GrabFood's tax in the minor unit. `(subtotal-merchantFundPromo)* Tax /(1+Tax) | (2550-475)*0.06/1.06=117`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). | [optional] +**MerchantChargeFee** | Pointer to **int64** | Any additional fee charged by merchant, which is 100% paid out to the merchant. Eg. Takeaway, packaging costs, dine-in charge. | [optional] +**GrabFundPromo** | Pointer to **int64** | GrabFood's promo fund in the minor unit. Calculated based on funded ratio. | [optional] +**MerchantFundPromo** | Pointer to **int64** | The merchant's promo fund in the minor unit. Calculated based on funded ratio. | [optional] +**BasketPromo** | Pointer to **int64** | The total amount promo applied to the basket items only (item level/order level) in the minor unit. Delivery fee is excluded. `(grabFundPromo + merchantFundPromo) | 300 + 475 = 775` | [optional] +**DeliveryFee** | Pointer to **int64** | The delivery fee in the minor unit. | [optional] +**EaterPayment** | **int64** | The total amount consumer paid in the minor unit. `(subtotal + deliveryFee) - (sum of all promo) | (2550+400)-775=2175` | + +## Methods + +### NewOrderPrice + +`func NewOrderPrice(subtotal int64, eaterPayment int64, ) *OrderPrice` + +NewOrderPrice instantiates a new OrderPrice object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderPriceWithDefaults + +`func NewOrderPriceWithDefaults() *OrderPrice` + +NewOrderPriceWithDefaults instantiates a new OrderPrice object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSubtotal + +`func (o *OrderPrice) GetSubtotal() int64` + +GetSubtotal returns the Subtotal field if non-nil, zero value otherwise. + +### GetSubtotalOk + +`func (o *OrderPrice) GetSubtotalOk() (*int64, bool)` + +GetSubtotalOk returns a tuple with the Subtotal field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubtotal + +`func (o *OrderPrice) SetSubtotal(v int64)` + +SetSubtotal sets Subtotal field to given value. + + +### GetTax + +`func (o *OrderPrice) GetTax() int64` + +GetTax returns the Tax field if non-nil, zero value otherwise. + +### GetTaxOk + +`func (o *OrderPrice) GetTaxOk() (*int64, bool)` + +GetTaxOk returns a tuple with the Tax field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTax + +`func (o *OrderPrice) SetTax(v int64)` + +SetTax sets Tax field to given value. + +### HasTax + +`func (o *OrderPrice) HasTax() bool` + +HasTax returns a boolean if a field has been set. + +### GetMerchantChargeFee + +`func (o *OrderPrice) GetMerchantChargeFee() int64` + +GetMerchantChargeFee returns the MerchantChargeFee field if non-nil, zero value otherwise. + +### GetMerchantChargeFeeOk + +`func (o *OrderPrice) GetMerchantChargeFeeOk() (*int64, bool)` + +GetMerchantChargeFeeOk returns a tuple with the MerchantChargeFee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantChargeFee + +`func (o *OrderPrice) SetMerchantChargeFee(v int64)` + +SetMerchantChargeFee sets MerchantChargeFee field to given value. + +### HasMerchantChargeFee + +`func (o *OrderPrice) HasMerchantChargeFee() bool` + +HasMerchantChargeFee returns a boolean if a field has been set. + +### GetGrabFundPromo + +`func (o *OrderPrice) GetGrabFundPromo() int64` + +GetGrabFundPromo returns the GrabFundPromo field if non-nil, zero value otherwise. + +### GetGrabFundPromoOk + +`func (o *OrderPrice) GetGrabFundPromoOk() (*int64, bool)` + +GetGrabFundPromoOk returns a tuple with the GrabFundPromo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrabFundPromo + +`func (o *OrderPrice) SetGrabFundPromo(v int64)` + +SetGrabFundPromo sets GrabFundPromo field to given value. + +### HasGrabFundPromo + +`func (o *OrderPrice) HasGrabFundPromo() bool` + +HasGrabFundPromo returns a boolean if a field has been set. + +### GetMerchantFundPromo + +`func (o *OrderPrice) GetMerchantFundPromo() int64` + +GetMerchantFundPromo returns the MerchantFundPromo field if non-nil, zero value otherwise. + +### GetMerchantFundPromoOk + +`func (o *OrderPrice) GetMerchantFundPromoOk() (*int64, bool)` + +GetMerchantFundPromoOk returns a tuple with the MerchantFundPromo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantFundPromo + +`func (o *OrderPrice) SetMerchantFundPromo(v int64)` + +SetMerchantFundPromo sets MerchantFundPromo field to given value. + +### HasMerchantFundPromo + +`func (o *OrderPrice) HasMerchantFundPromo() bool` + +HasMerchantFundPromo returns a boolean if a field has been set. + +### GetBasketPromo + +`func (o *OrderPrice) GetBasketPromo() int64` + +GetBasketPromo returns the BasketPromo field if non-nil, zero value otherwise. + +### GetBasketPromoOk + +`func (o *OrderPrice) GetBasketPromoOk() (*int64, bool)` + +GetBasketPromoOk returns a tuple with the BasketPromo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBasketPromo + +`func (o *OrderPrice) SetBasketPromo(v int64)` + +SetBasketPromo sets BasketPromo field to given value. + +### HasBasketPromo + +`func (o *OrderPrice) HasBasketPromo() bool` + +HasBasketPromo returns a boolean if a field has been set. + +### GetDeliveryFee + +`func (o *OrderPrice) GetDeliveryFee() int64` + +GetDeliveryFee returns the DeliveryFee field if non-nil, zero value otherwise. + +### GetDeliveryFeeOk + +`func (o *OrderPrice) GetDeliveryFeeOk() (*int64, bool)` + +GetDeliveryFeeOk returns a tuple with the DeliveryFee field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryFee + +`func (o *OrderPrice) SetDeliveryFee(v int64)` + +SetDeliveryFee sets DeliveryFee field to given value. + +### HasDeliveryFee + +`func (o *OrderPrice) HasDeliveryFee() bool` + +HasDeliveryFee returns a boolean if a field has been set. + +### GetEaterPayment + +`func (o *OrderPrice) GetEaterPayment() int64` + +GetEaterPayment returns the EaterPayment field if non-nil, zero value otherwise. + +### GetEaterPaymentOk + +`func (o *OrderPrice) GetEaterPaymentOk() (*int64, bool)` + +GetEaterPaymentOk returns a tuple with the EaterPayment field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEaterPayment + +`func (o *OrderPrice) SetEaterPayment(v int64)` + +SetEaterPayment sets EaterPayment field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderPromo.md b/docs/OrderPromo.md new file mode 100644 index 0000000..7f75fec --- /dev/null +++ b/docs/OrderPromo.md @@ -0,0 +1,238 @@ +# OrderPromo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **string** | Promo code applied in the order. | [optional] +**Description** | Pointer to **string** | Promo description. | [optional] +**Name** | Pointer to **string** | Name of the promotion. | [optional] +**PromoAmount** | Pointer to **int64** | Promo amount applied in the order, in local currency. This amount is rounded into whole number. | [optional] +**MexFundedRatio** | Pointer to **int32** | The merchant's funded ratio of the promo in percentage. | [optional] +**MexFundedAmount** | Pointer to **int64** | The merchant's promo fund in the minor unit. Calculated based on merchant funded ratio. | [optional] +**TargetedPrice** | Pointer to **int64** | The subtotal of the order basket in minor unit. | [optional] +**PromoAmountInMin** | Pointer to **int64** | Promo amount applied in the order in minor unit. | [optional] + +## Methods + +### NewOrderPromo + +`func NewOrderPromo() *OrderPromo` + +NewOrderPromo instantiates a new OrderPromo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderPromoWithDefaults + +`func NewOrderPromoWithDefaults() *OrderPromo` + +NewOrderPromoWithDefaults instantiates a new OrderPromo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *OrderPromo) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *OrderPromo) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *OrderPromo) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *OrderPromo) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetDescription + +`func (o *OrderPromo) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *OrderPromo) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *OrderPromo) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *OrderPromo) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + +### GetName + +`func (o *OrderPromo) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *OrderPromo) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *OrderPromo) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *OrderPromo) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPromoAmount + +`func (o *OrderPromo) GetPromoAmount() int64` + +GetPromoAmount returns the PromoAmount field if non-nil, zero value otherwise. + +### GetPromoAmountOk + +`func (o *OrderPromo) GetPromoAmountOk() (*int64, bool)` + +GetPromoAmountOk returns a tuple with the PromoAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromoAmount + +`func (o *OrderPromo) SetPromoAmount(v int64)` + +SetPromoAmount sets PromoAmount field to given value. + +### HasPromoAmount + +`func (o *OrderPromo) HasPromoAmount() bool` + +HasPromoAmount returns a boolean if a field has been set. + +### GetMexFundedRatio + +`func (o *OrderPromo) GetMexFundedRatio() int32` + +GetMexFundedRatio returns the MexFundedRatio field if non-nil, zero value otherwise. + +### GetMexFundedRatioOk + +`func (o *OrderPromo) GetMexFundedRatioOk() (*int32, bool)` + +GetMexFundedRatioOk returns a tuple with the MexFundedRatio field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMexFundedRatio + +`func (o *OrderPromo) SetMexFundedRatio(v int32)` + +SetMexFundedRatio sets MexFundedRatio field to given value. + +### HasMexFundedRatio + +`func (o *OrderPromo) HasMexFundedRatio() bool` + +HasMexFundedRatio returns a boolean if a field has been set. + +### GetMexFundedAmount + +`func (o *OrderPromo) GetMexFundedAmount() int64` + +GetMexFundedAmount returns the MexFundedAmount field if non-nil, zero value otherwise. + +### GetMexFundedAmountOk + +`func (o *OrderPromo) GetMexFundedAmountOk() (*int64, bool)` + +GetMexFundedAmountOk returns a tuple with the MexFundedAmount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMexFundedAmount + +`func (o *OrderPromo) SetMexFundedAmount(v int64)` + +SetMexFundedAmount sets MexFundedAmount field to given value. + +### HasMexFundedAmount + +`func (o *OrderPromo) HasMexFundedAmount() bool` + +HasMexFundedAmount returns a boolean if a field has been set. + +### GetTargetedPrice + +`func (o *OrderPromo) GetTargetedPrice() int64` + +GetTargetedPrice returns the TargetedPrice field if non-nil, zero value otherwise. + +### GetTargetedPriceOk + +`func (o *OrderPromo) GetTargetedPriceOk() (*int64, bool)` + +GetTargetedPriceOk returns a tuple with the TargetedPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetedPrice + +`func (o *OrderPromo) SetTargetedPrice(v int64)` + +SetTargetedPrice sets TargetedPrice field to given value. + +### HasTargetedPrice + +`func (o *OrderPromo) HasTargetedPrice() bool` + +HasTargetedPrice returns a boolean if a field has been set. + +### GetPromoAmountInMin + +`func (o *OrderPromo) GetPromoAmountInMin() int64` + +GetPromoAmountInMin returns the PromoAmountInMin field if non-nil, zero value otherwise. + +### GetPromoAmountInMinOk + +`func (o *OrderPromo) GetPromoAmountInMinOk() (*int64, bool)` + +GetPromoAmountInMinOk returns a tuple with the PromoAmountInMin field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromoAmountInMin + +`func (o *OrderPromo) SetPromoAmountInMin(v int64)` + +SetPromoAmountInMin sets PromoAmountInMin field to given value. + +### HasPromoAmountInMin + +`func (o *OrderPromo) HasPromoAmountInMin() bool` + +HasPromoAmountInMin returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderReadyEstimation.md b/docs/OrderReadyEstimation.md new file mode 100644 index 0000000..2ed630b --- /dev/null +++ b/docs/OrderReadyEstimation.md @@ -0,0 +1,129 @@ +# OrderReadyEstimation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowChange** | **bool** | A boolean value indicating if the order ready time can be changed. | +**EstimatedOrderReadyTime** | **time.Time** | The order ready time for this order estimated by GrabFood, based on ISO_8601/RFC3339. | +**MaxOrderReadyTime** | **time.Time** | The max allowed order ready time for this order, based on ISO_8601/RFC3339. | +**NewOrderReadyTime** | Pointer to **NullableTime** | The new order ready time for this order. Only present after a new order ready time is set (default will be null), based on ISO_8601/RFC3339. | [optional] + +## Methods + +### NewOrderReadyEstimation + +`func NewOrderReadyEstimation(allowChange bool, estimatedOrderReadyTime time.Time, maxOrderReadyTime time.Time, ) *OrderReadyEstimation` + +NewOrderReadyEstimation instantiates a new OrderReadyEstimation object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderReadyEstimationWithDefaults + +`func NewOrderReadyEstimationWithDefaults() *OrderReadyEstimation` + +NewOrderReadyEstimationWithDefaults instantiates a new OrderReadyEstimation object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAllowChange + +`func (o *OrderReadyEstimation) GetAllowChange() bool` + +GetAllowChange returns the AllowChange field if non-nil, zero value otherwise. + +### GetAllowChangeOk + +`func (o *OrderReadyEstimation) GetAllowChangeOk() (*bool, bool)` + +GetAllowChangeOk returns a tuple with the AllowChange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowChange + +`func (o *OrderReadyEstimation) SetAllowChange(v bool)` + +SetAllowChange sets AllowChange field to given value. + + +### GetEstimatedOrderReadyTime + +`func (o *OrderReadyEstimation) GetEstimatedOrderReadyTime() time.Time` + +GetEstimatedOrderReadyTime returns the EstimatedOrderReadyTime field if non-nil, zero value otherwise. + +### GetEstimatedOrderReadyTimeOk + +`func (o *OrderReadyEstimation) GetEstimatedOrderReadyTimeOk() (*time.Time, bool)` + +GetEstimatedOrderReadyTimeOk returns a tuple with the EstimatedOrderReadyTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEstimatedOrderReadyTime + +`func (o *OrderReadyEstimation) SetEstimatedOrderReadyTime(v time.Time)` + +SetEstimatedOrderReadyTime sets EstimatedOrderReadyTime field to given value. + + +### GetMaxOrderReadyTime + +`func (o *OrderReadyEstimation) GetMaxOrderReadyTime() time.Time` + +GetMaxOrderReadyTime returns the MaxOrderReadyTime field if non-nil, zero value otherwise. + +### GetMaxOrderReadyTimeOk + +`func (o *OrderReadyEstimation) GetMaxOrderReadyTimeOk() (*time.Time, bool)` + +GetMaxOrderReadyTimeOk returns a tuple with the MaxOrderReadyTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxOrderReadyTime + +`func (o *OrderReadyEstimation) SetMaxOrderReadyTime(v time.Time)` + +SetMaxOrderReadyTime sets MaxOrderReadyTime field to given value. + + +### GetNewOrderReadyTime + +`func (o *OrderReadyEstimation) GetNewOrderReadyTime() time.Time` + +GetNewOrderReadyTime returns the NewOrderReadyTime field if non-nil, zero value otherwise. + +### GetNewOrderReadyTimeOk + +`func (o *OrderReadyEstimation) GetNewOrderReadyTimeOk() (*time.Time, bool)` + +GetNewOrderReadyTimeOk returns a tuple with the NewOrderReadyTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNewOrderReadyTime + +`func (o *OrderReadyEstimation) SetNewOrderReadyTime(v time.Time)` + +SetNewOrderReadyTime sets NewOrderReadyTime field to given value. + +### HasNewOrderReadyTime + +`func (o *OrderReadyEstimation) HasNewOrderReadyTime() bool` + +HasNewOrderReadyTime returns a boolean if a field has been set. + +### SetNewOrderReadyTimeNil + +`func (o *OrderReadyEstimation) SetNewOrderReadyTimeNil(b bool)` + + SetNewOrderReadyTimeNil sets the value for NewOrderReadyTime to be an explicit nil + +### UnsetNewOrderReadyTime +`func (o *OrderReadyEstimation) UnsetNewOrderReadyTime()` + +UnsetNewOrderReadyTime ensures that no value is present for NewOrderReadyTime, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OrderStateRequest.md b/docs/OrderStateRequest.md new file mode 100644 index 0000000..c860716 --- /dev/null +++ b/docs/OrderStateRequest.md @@ -0,0 +1,181 @@ +# OrderStateRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**State** | **string** | The current order state. For takeaway orders, only `DELIVERED` and `CANCELLED` states are pushed. | +**DriverETA** | Pointer to **NullableInt32** | The driver's estimated of arrival (ETA) in seconds when the state is `DRIVER_ALLOCATED`. | [optional] +**Code** | Pointer to **string** | The current order's sub-state. This is in free text so you should only use for reference. Grab may use this for troubleshooting. If you want some analysis, kindly use `state` instead. | [optional] +**Message** | Pointer to **string** | Additional information to explain the current order state. May be system status or human entered message. | [optional] + +## Methods + +### NewOrderStateRequest + +`func NewOrderStateRequest(merchantID string, orderID string, state string, ) *OrderStateRequest` + +NewOrderStateRequest instantiates a new OrderStateRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOrderStateRequestWithDefaults + +`func NewOrderStateRequestWithDefaults() *OrderStateRequest` + +NewOrderStateRequestWithDefaults instantiates a new OrderStateRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *OrderStateRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *OrderStateRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *OrderStateRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetOrderID + +`func (o *OrderStateRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *OrderStateRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *OrderStateRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetState + +`func (o *OrderStateRequest) GetState() string` + +GetState returns the State field if non-nil, zero value otherwise. + +### GetStateOk + +`func (o *OrderStateRequest) GetStateOk() (*string, bool)` + +GetStateOk returns a tuple with the State field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetState + +`func (o *OrderStateRequest) SetState(v string)` + +SetState sets State field to given value. + + +### GetDriverETA + +`func (o *OrderStateRequest) GetDriverETA() int32` + +GetDriverETA returns the DriverETA field if non-nil, zero value otherwise. + +### GetDriverETAOk + +`func (o *OrderStateRequest) GetDriverETAOk() (*int32, bool)` + +GetDriverETAOk returns a tuple with the DriverETA field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDriverETA + +`func (o *OrderStateRequest) SetDriverETA(v int32)` + +SetDriverETA sets DriverETA field to given value. + +### HasDriverETA + +`func (o *OrderStateRequest) HasDriverETA() bool` + +HasDriverETA returns a boolean if a field has been set. + +### SetDriverETANil + +`func (o *OrderStateRequest) SetDriverETANil(b bool)` + + SetDriverETANil sets the value for DriverETA to be an explicit nil + +### UnsetDriverETA +`func (o *OrderStateRequest) UnsetDriverETA()` + +UnsetDriverETA ensures that no value is present for DriverETA, not even an explicit nil +### GetCode + +`func (o *OrderStateRequest) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *OrderStateRequest) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *OrderStateRequest) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *OrderStateRequest) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetMessage + +`func (o *OrderStateRequest) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *OrderStateRequest) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *OrderStateRequest) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *OrderStateRequest) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/OutOfStockInstruction.md b/docs/OutOfStockInstruction.md new file mode 100644 index 0000000..367d40d --- /dev/null +++ b/docs/OutOfStockInstruction.md @@ -0,0 +1,134 @@ +# OutOfStockInstruction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | Pointer to **string** | The short instruction message. | [optional] +**InstructionType** | Pointer to **string** | Type of out-of-stock instruction chosen by customer. `CONTACT` is disabled by default, kindly reach out to your integration manager if you wish to receive this instruction. | [optional] +**ReplacementItemID** | Pointer to **string** | The preferred item's ID in the partner system. Only applicable when the instructionType is `SPECIFIC_ITEM`. | [optional] +**ReplacementGrabItemID** | Pointer to **string** | The preferred item's ID in the Grab system. Only applicable when the instructionType is `SPECIFIC_ITEM`. | [optional] + +## Methods + +### NewOutOfStockInstruction + +`func NewOutOfStockInstruction() *OutOfStockInstruction` + +NewOutOfStockInstruction instantiates a new OutOfStockInstruction object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewOutOfStockInstructionWithDefaults + +`func NewOutOfStockInstructionWithDefaults() *OutOfStockInstruction` + +NewOutOfStockInstructionWithDefaults instantiates a new OutOfStockInstruction object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTitle + +`func (o *OutOfStockInstruction) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *OutOfStockInstruction) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *OutOfStockInstruction) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *OutOfStockInstruction) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### GetInstructionType + +`func (o *OutOfStockInstruction) GetInstructionType() string` + +GetInstructionType returns the InstructionType field if non-nil, zero value otherwise. + +### GetInstructionTypeOk + +`func (o *OutOfStockInstruction) GetInstructionTypeOk() (*string, bool)` + +GetInstructionTypeOk returns a tuple with the InstructionType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInstructionType + +`func (o *OutOfStockInstruction) SetInstructionType(v string)` + +SetInstructionType sets InstructionType field to given value. + +### HasInstructionType + +`func (o *OutOfStockInstruction) HasInstructionType() bool` + +HasInstructionType returns a boolean if a field has been set. + +### GetReplacementItemID + +`func (o *OutOfStockInstruction) GetReplacementItemID() string` + +GetReplacementItemID returns the ReplacementItemID field if non-nil, zero value otherwise. + +### GetReplacementItemIDOk + +`func (o *OutOfStockInstruction) GetReplacementItemIDOk() (*string, bool)` + +GetReplacementItemIDOk returns a tuple with the ReplacementItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReplacementItemID + +`func (o *OutOfStockInstruction) SetReplacementItemID(v string)` + +SetReplacementItemID sets ReplacementItemID field to given value. + +### HasReplacementItemID + +`func (o *OutOfStockInstruction) HasReplacementItemID() bool` + +HasReplacementItemID returns a boolean if a field has been set. + +### GetReplacementGrabItemID + +`func (o *OutOfStockInstruction) GetReplacementGrabItemID() string` + +GetReplacementGrabItemID returns the ReplacementGrabItemID field if non-nil, zero value otherwise. + +### GetReplacementGrabItemIDOk + +`func (o *OutOfStockInstruction) GetReplacementGrabItemIDOk() (*string, bool)` + +GetReplacementGrabItemIDOk returns a tuple with the ReplacementGrabItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReplacementGrabItemID + +`func (o *OutOfStockInstruction) SetReplacementGrabItemID(v string)` + +SetReplacementGrabItemID sets ReplacementGrabItemID field to given value. + +### HasReplacementGrabItemID + +`func (o *OutOfStockInstruction) HasReplacementGrabItemID() bool` + +HasReplacementGrabItemID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerOauthRequest.md b/docs/PartnerOauthRequest.md new file mode 100644 index 0000000..92752aa --- /dev/null +++ b/docs/PartnerOauthRequest.md @@ -0,0 +1,119 @@ +# PartnerOauthRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClientId** | **string** | The client identifier issued to obtain the OAuth access token. | +**ClientSecret** | **string** | The client secret issued to obtain the OAuth access token. | +**GrantType** | **string** | Refers to the way an application gets OAuth access token. | +**Scope** | Pointer to **string** | A space delimited list of partner scopes. | [optional] + +## Methods + +### NewPartnerOauthRequest + +`func NewPartnerOauthRequest(clientId string, clientSecret string, grantType string, ) *PartnerOauthRequest` + +NewPartnerOauthRequest instantiates a new PartnerOauthRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPartnerOauthRequestWithDefaults + +`func NewPartnerOauthRequestWithDefaults() *PartnerOauthRequest` + +NewPartnerOauthRequestWithDefaults instantiates a new PartnerOauthRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetClientId + +`func (o *PartnerOauthRequest) GetClientId() string` + +GetClientId returns the ClientId field if non-nil, zero value otherwise. + +### GetClientIdOk + +`func (o *PartnerOauthRequest) GetClientIdOk() (*string, bool)` + +GetClientIdOk returns a tuple with the ClientId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientId + +`func (o *PartnerOauthRequest) SetClientId(v string)` + +SetClientId sets ClientId field to given value. + + +### GetClientSecret + +`func (o *PartnerOauthRequest) GetClientSecret() string` + +GetClientSecret returns the ClientSecret field if non-nil, zero value otherwise. + +### GetClientSecretOk + +`func (o *PartnerOauthRequest) GetClientSecretOk() (*string, bool)` + +GetClientSecretOk returns a tuple with the ClientSecret field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetClientSecret + +`func (o *PartnerOauthRequest) SetClientSecret(v string)` + +SetClientSecret sets ClientSecret field to given value. + + +### GetGrantType + +`func (o *PartnerOauthRequest) GetGrantType() string` + +GetGrantType returns the GrantType field if non-nil, zero value otherwise. + +### GetGrantTypeOk + +`func (o *PartnerOauthRequest) GetGrantTypeOk() (*string, bool)` + +GetGrantTypeOk returns a tuple with the GrantType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrantType + +`func (o *PartnerOauthRequest) SetGrantType(v string)` + +SetGrantType sets GrantType field to given value. + + +### GetScope + +`func (o *PartnerOauthRequest) GetScope() string` + +GetScope returns the Scope field if non-nil, zero value otherwise. + +### GetScopeOk + +`func (o *PartnerOauthRequest) GetScopeOk() (*string, bool)` + +GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScope + +`func (o *PartnerOauthRequest) SetScope(v string)` + +SetScope sets Scope field to given value. + +### HasScope + +`func (o *PartnerOauthRequest) HasScope() bool` + +HasScope returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PartnerOauthResponse.md b/docs/PartnerOauthResponse.md new file mode 100644 index 0000000..cca377a --- /dev/null +++ b/docs/PartnerOauthResponse.md @@ -0,0 +1,108 @@ +# PartnerOauthResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessToken** | Pointer to **string** | The OAuth 2.0 access token issued by the partner. | [optional] +**TokenType** | Pointer to **string** | The type of token issued which is case insensitive. | [optional] +**ExpiresIn** | Pointer to **int32** | The access token lifespan in seconds. | [optional] + +## Methods + +### NewPartnerOauthResponse + +`func NewPartnerOauthResponse() *PartnerOauthResponse` + +NewPartnerOauthResponse instantiates a new PartnerOauthResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPartnerOauthResponseWithDefaults + +`func NewPartnerOauthResponseWithDefaults() *PartnerOauthResponse` + +NewPartnerOauthResponseWithDefaults instantiates a new PartnerOauthResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccessToken + +`func (o *PartnerOauthResponse) GetAccessToken() string` + +GetAccessToken returns the AccessToken field if non-nil, zero value otherwise. + +### GetAccessTokenOk + +`func (o *PartnerOauthResponse) GetAccessTokenOk() (*string, bool)` + +GetAccessTokenOk returns a tuple with the AccessToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccessToken + +`func (o *PartnerOauthResponse) SetAccessToken(v string)` + +SetAccessToken sets AccessToken field to given value. + +### HasAccessToken + +`func (o *PartnerOauthResponse) HasAccessToken() bool` + +HasAccessToken returns a boolean if a field has been set. + +### GetTokenType + +`func (o *PartnerOauthResponse) GetTokenType() string` + +GetTokenType returns the TokenType field if non-nil, zero value otherwise. + +### GetTokenTypeOk + +`func (o *PartnerOauthResponse) GetTokenTypeOk() (*string, bool)` + +GetTokenTypeOk returns a tuple with the TokenType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTokenType + +`func (o *PartnerOauthResponse) SetTokenType(v string)` + +SetTokenType sets TokenType field to given value. + +### HasTokenType + +`func (o *PartnerOauthResponse) HasTokenType() bool` + +HasTokenType returns a boolean if a field has been set. + +### GetExpiresIn + +`func (o *PartnerOauthResponse) GetExpiresIn() int32` + +GetExpiresIn returns the ExpiresIn field if non-nil, zero value otherwise. + +### GetExpiresInOk + +`func (o *PartnerOauthResponse) GetExpiresInOk() (*int32, bool)` + +GetExpiresInOk returns a tuple with the ExpiresIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetExpiresIn + +`func (o *PartnerOauthResponse) SetExpiresIn(v int32)` + +SetExpiresIn sets ExpiresIn field to given value. + +### HasExpiresIn + +`func (o *PartnerOauthResponse) HasExpiresIn() bool` + +HasExpiresIn returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PauseStoreAPI.md b/docs/PauseStoreAPI.md new file mode 100644 index 0000000..4f6b245 --- /dev/null +++ b/docs/PauseStoreAPI.md @@ -0,0 +1,75 @@ +# \PauseStoreAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**PauseStore**](PauseStoreAPI.md#PauseStore) | **Put** /partner/v1/merchant/pause | Pause store + + + +## PauseStore + +> PauseStore(ctx).ContentType(contentType).Authorization(authorization).PauseStoreRequest(pauseStoreRequest).Execute() + +Pause store + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + pauseStoreRequest := *grabfood.NewPauseStoreRequest("1-CYNGRUNGSBCCC", false) // PauseStoreRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.PauseStoreAPI.PauseStore(context.Background()).ContentType(contentType).Authorization(authorization).PauseStoreRequest(pauseStoreRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PauseStoreAPI.PauseStore``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPauseStoreRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **pauseStoreRequest** | [**PauseStoreRequest**](PauseStoreRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/PauseStoreRequest.md b/docs/PauseStoreRequest.md new file mode 100644 index 0000000..7c2d3e6 --- /dev/null +++ b/docs/PauseStoreRequest.md @@ -0,0 +1,98 @@ +# PauseStoreRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**IsPause** | **bool** | Boolean value to pause or unpause store. | +**Duration** | Pointer to **string** | The duration to pause the store. Only required when `isPause=true`. | [optional] + +## Methods + +### NewPauseStoreRequest + +`func NewPauseStoreRequest(merchantID string, isPause bool, ) *PauseStoreRequest` + +NewPauseStoreRequest instantiates a new PauseStoreRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPauseStoreRequestWithDefaults + +`func NewPauseStoreRequestWithDefaults() *PauseStoreRequest` + +NewPauseStoreRequestWithDefaults instantiates a new PauseStoreRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *PauseStoreRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *PauseStoreRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *PauseStoreRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetIsPause + +`func (o *PauseStoreRequest) GetIsPause() bool` + +GetIsPause returns the IsPause field if non-nil, zero value otherwise. + +### GetIsPauseOk + +`func (o *PauseStoreRequest) GetIsPauseOk() (*bool, bool)` + +GetIsPauseOk returns a tuple with the IsPause field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsPause + +`func (o *PauseStoreRequest) SetIsPause(v bool)` + +SetIsPause sets IsPause field to given value. + + +### GetDuration + +`func (o *PauseStoreRequest) GetDuration() string` + +GetDuration returns the Duration field if non-nil, zero value otherwise. + +### GetDurationOk + +`func (o *PauseStoreRequest) GetDurationOk() (*string, bool)` + +GetDurationOk returns a tuple with the Duration field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDuration + +`func (o *PauseStoreRequest) SetDuration(v string)` + +SetDuration sets Duration field to given value. + +### HasDuration + +`func (o *PauseStoreRequest) HasDuration() bool` + +HasDuration returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Purchasability.md b/docs/Purchasability.md new file mode 100644 index 0000000..e43e562 --- /dev/null +++ b/docs/Purchasability.md @@ -0,0 +1,212 @@ +# Purchasability + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeliveryOnDemandGrabApp** | Pointer to **bool** | | [optional] +**DeliveryScheduledGrabApp** | Pointer to **bool** | | [optional] +**SelfPickUpOnDemandGrabApp** | Pointer to **bool** | | [optional] +**DineInOnDemandGrabApp** | Pointer to **bool** | | [optional] +**DeliveryOnDemandStoreFront** | Pointer to **bool** | | [optional] +**DeliveryScheduledStoreFront** | Pointer to **bool** | | [optional] +**SelfPickUpOnDemandStoreFront** | Pointer to **bool** | | [optional] + +## Methods + +### NewPurchasability + +`func NewPurchasability() *Purchasability` + +NewPurchasability instantiates a new Purchasability object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPurchasabilityWithDefaults + +`func NewPurchasabilityWithDefaults() *Purchasability` + +NewPurchasabilityWithDefaults instantiates a new Purchasability object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDeliveryOnDemandGrabApp + +`func (o *Purchasability) GetDeliveryOnDemandGrabApp() bool` + +GetDeliveryOnDemandGrabApp returns the DeliveryOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetDeliveryOnDemandGrabAppOk + +`func (o *Purchasability) GetDeliveryOnDemandGrabAppOk() (*bool, bool)` + +GetDeliveryOnDemandGrabAppOk returns a tuple with the DeliveryOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryOnDemandGrabApp + +`func (o *Purchasability) SetDeliveryOnDemandGrabApp(v bool)` + +SetDeliveryOnDemandGrabApp sets DeliveryOnDemandGrabApp field to given value. + +### HasDeliveryOnDemandGrabApp + +`func (o *Purchasability) HasDeliveryOnDemandGrabApp() bool` + +HasDeliveryOnDemandGrabApp returns a boolean if a field has been set. + +### GetDeliveryScheduledGrabApp + +`func (o *Purchasability) GetDeliveryScheduledGrabApp() bool` + +GetDeliveryScheduledGrabApp returns the DeliveryScheduledGrabApp field if non-nil, zero value otherwise. + +### GetDeliveryScheduledGrabAppOk + +`func (o *Purchasability) GetDeliveryScheduledGrabAppOk() (*bool, bool)` + +GetDeliveryScheduledGrabAppOk returns a tuple with the DeliveryScheduledGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryScheduledGrabApp + +`func (o *Purchasability) SetDeliveryScheduledGrabApp(v bool)` + +SetDeliveryScheduledGrabApp sets DeliveryScheduledGrabApp field to given value. + +### HasDeliveryScheduledGrabApp + +`func (o *Purchasability) HasDeliveryScheduledGrabApp() bool` + +HasDeliveryScheduledGrabApp returns a boolean if a field has been set. + +### GetSelfPickUpOnDemandGrabApp + +`func (o *Purchasability) GetSelfPickUpOnDemandGrabApp() bool` + +GetSelfPickUpOnDemandGrabApp returns the SelfPickUpOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetSelfPickUpOnDemandGrabAppOk + +`func (o *Purchasability) GetSelfPickUpOnDemandGrabAppOk() (*bool, bool)` + +GetSelfPickUpOnDemandGrabAppOk returns a tuple with the SelfPickUpOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelfPickUpOnDemandGrabApp + +`func (o *Purchasability) SetSelfPickUpOnDemandGrabApp(v bool)` + +SetSelfPickUpOnDemandGrabApp sets SelfPickUpOnDemandGrabApp field to given value. + +### HasSelfPickUpOnDemandGrabApp + +`func (o *Purchasability) HasSelfPickUpOnDemandGrabApp() bool` + +HasSelfPickUpOnDemandGrabApp returns a boolean if a field has been set. + +### GetDineInOnDemandGrabApp + +`func (o *Purchasability) GetDineInOnDemandGrabApp() bool` + +GetDineInOnDemandGrabApp returns the DineInOnDemandGrabApp field if non-nil, zero value otherwise. + +### GetDineInOnDemandGrabAppOk + +`func (o *Purchasability) GetDineInOnDemandGrabAppOk() (*bool, bool)` + +GetDineInOnDemandGrabAppOk returns a tuple with the DineInOnDemandGrabApp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineInOnDemandGrabApp + +`func (o *Purchasability) SetDineInOnDemandGrabApp(v bool)` + +SetDineInOnDemandGrabApp sets DineInOnDemandGrabApp field to given value. + +### HasDineInOnDemandGrabApp + +`func (o *Purchasability) HasDineInOnDemandGrabApp() bool` + +HasDineInOnDemandGrabApp returns a boolean if a field has been set. + +### GetDeliveryOnDemandStoreFront + +`func (o *Purchasability) GetDeliveryOnDemandStoreFront() bool` + +GetDeliveryOnDemandStoreFront returns the DeliveryOnDemandStoreFront field if non-nil, zero value otherwise. + +### GetDeliveryOnDemandStoreFrontOk + +`func (o *Purchasability) GetDeliveryOnDemandStoreFrontOk() (*bool, bool)` + +GetDeliveryOnDemandStoreFrontOk returns a tuple with the DeliveryOnDemandStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryOnDemandStoreFront + +`func (o *Purchasability) SetDeliveryOnDemandStoreFront(v bool)` + +SetDeliveryOnDemandStoreFront sets DeliveryOnDemandStoreFront field to given value. + +### HasDeliveryOnDemandStoreFront + +`func (o *Purchasability) HasDeliveryOnDemandStoreFront() bool` + +HasDeliveryOnDemandStoreFront returns a boolean if a field has been set. + +### GetDeliveryScheduledStoreFront + +`func (o *Purchasability) GetDeliveryScheduledStoreFront() bool` + +GetDeliveryScheduledStoreFront returns the DeliveryScheduledStoreFront field if non-nil, zero value otherwise. + +### GetDeliveryScheduledStoreFrontOk + +`func (o *Purchasability) GetDeliveryScheduledStoreFrontOk() (*bool, bool)` + +GetDeliveryScheduledStoreFrontOk returns a tuple with the DeliveryScheduledStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDeliveryScheduledStoreFront + +`func (o *Purchasability) SetDeliveryScheduledStoreFront(v bool)` + +SetDeliveryScheduledStoreFront sets DeliveryScheduledStoreFront field to given value. + +### HasDeliveryScheduledStoreFront + +`func (o *Purchasability) HasDeliveryScheduledStoreFront() bool` + +HasDeliveryScheduledStoreFront returns a boolean if a field has been set. + +### GetSelfPickUpOnDemandStoreFront + +`func (o *Purchasability) GetSelfPickUpOnDemandStoreFront() bool` + +GetSelfPickUpOnDemandStoreFront returns the SelfPickUpOnDemandStoreFront field if non-nil, zero value otherwise. + +### GetSelfPickUpOnDemandStoreFrontOk + +`func (o *Purchasability) GetSelfPickUpOnDemandStoreFrontOk() (*bool, bool)` + +GetSelfPickUpOnDemandStoreFrontOk returns a tuple with the SelfPickUpOnDemandStoreFront field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSelfPickUpOnDemandStoreFront + +`func (o *Purchasability) SetSelfPickUpOnDemandStoreFront(v bool)` + +SetSelfPickUpOnDemandStoreFront sets SelfPickUpOnDemandStoreFront field to given value. + +### HasSelfPickUpOnDemandStoreFront + +`func (o *Purchasability) HasSelfPickUpOnDemandStoreFront() bool` + +HasSelfPickUpOnDemandStoreFront returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Receiver.md b/docs/Receiver.md new file mode 100644 index 0000000..0d6679d --- /dev/null +++ b/docs/Receiver.md @@ -0,0 +1,108 @@ +# Receiver + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | The name of the receiver. | [optional] +**Phones** | Pointer to **string** | The receiver's phone number. | [optional] +**Address** | Pointer to [**Address**](Address.md) | | [optional] + +## Methods + +### NewReceiver + +`func NewReceiver() *Receiver` + +NewReceiver instantiates a new Receiver object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewReceiverWithDefaults + +`func NewReceiverWithDefaults() *Receiver` + +NewReceiverWithDefaults instantiates a new Receiver object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *Receiver) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Receiver) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *Receiver) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *Receiver) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetPhones + +`func (o *Receiver) GetPhones() string` + +GetPhones returns the Phones field if non-nil, zero value otherwise. + +### GetPhonesOk + +`func (o *Receiver) GetPhonesOk() (*string, bool)` + +GetPhonesOk returns a tuple with the Phones field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhones + +`func (o *Receiver) SetPhones(v string)` + +SetPhones sets Phones field to given value. + +### HasPhones + +`func (o *Receiver) HasPhones() bool` + +HasPhones returns a boolean if a field has been set. + +### GetAddress + +`func (o *Receiver) GetAddress() Address` + +GetAddress returns the Address field if non-nil, zero value otherwise. + +### GetAddressOk + +`func (o *Receiver) GetAddressOk() (*Address, bool)` + +GetAddressOk returns a tuple with the Address field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAddress + +`func (o *Receiver) SetAddress(v Address)` + +SetAddress sets Address field to given value. + +### HasAddress + +`func (o *Receiver) HasAddress() bool` + +HasAddress returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RedeemDineInVoucherRequest.md b/docs/RedeemDineInVoucherRequest.md new file mode 100644 index 0000000..97e275f --- /dev/null +++ b/docs/RedeemDineInVoucherRequest.md @@ -0,0 +1,72 @@ +# RedeemDineInVoucherRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CertificateID** | **string** | This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. | +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +## Methods + +### NewRedeemDineInVoucherRequest + +`func NewRedeemDineInVoucherRequest(certificateID string, merchantID string, ) *RedeemDineInVoucherRequest` + +NewRedeemDineInVoucherRequest instantiates a new RedeemDineInVoucherRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRedeemDineInVoucherRequestWithDefaults + +`func NewRedeemDineInVoucherRequestWithDefaults() *RedeemDineInVoucherRequest` + +NewRedeemDineInVoucherRequestWithDefaults instantiates a new RedeemDineInVoucherRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCertificateID + +`func (o *RedeemDineInVoucherRequest) GetCertificateID() string` + +GetCertificateID returns the CertificateID field if non-nil, zero value otherwise. + +### GetCertificateIDOk + +`func (o *RedeemDineInVoucherRequest) GetCertificateIDOk() (*string, bool)` + +GetCertificateIDOk returns a tuple with the CertificateID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCertificateID + +`func (o *RedeemDineInVoucherRequest) SetCertificateID(v string)` + +SetCertificateID sets CertificateID field to given value. + + +### GetMerchantID + +`func (o *RedeemDineInVoucherRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *RedeemDineInVoucherRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *RedeemDineInVoucherRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RedeemDineInVoucherResponse.md b/docs/RedeemDineInVoucherResponse.md new file mode 100644 index 0000000..a838bd1 --- /dev/null +++ b/docs/RedeemDineInVoucherResponse.md @@ -0,0 +1,186 @@ +# RedeemDineInVoucherResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CertificateID** | Pointer to **string** | This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. | [optional] +**VoucherCode** | Pointer to **string** | A short code for the dine-in voucher purchased by the user. | [optional] +**Voucher** | Pointer to [**Voucher**](Voucher.md) | | [optional] +**RedeemResult** | Pointer to [**RedeemResult**](RedeemResult.md) | | [optional] +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**CampaignID** | Pointer to **string** | The dine-in voucher campaign's ID in GrabFood's database. | [optional] + +## Methods + +### NewRedeemDineInVoucherResponse + +`func NewRedeemDineInVoucherResponse() *RedeemDineInVoucherResponse` + +NewRedeemDineInVoucherResponse instantiates a new RedeemDineInVoucherResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRedeemDineInVoucherResponseWithDefaults + +`func NewRedeemDineInVoucherResponseWithDefaults() *RedeemDineInVoucherResponse` + +NewRedeemDineInVoucherResponseWithDefaults instantiates a new RedeemDineInVoucherResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCertificateID + +`func (o *RedeemDineInVoucherResponse) GetCertificateID() string` + +GetCertificateID returns the CertificateID field if non-nil, zero value otherwise. + +### GetCertificateIDOk + +`func (o *RedeemDineInVoucherResponse) GetCertificateIDOk() (*string, bool)` + +GetCertificateIDOk returns a tuple with the CertificateID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCertificateID + +`func (o *RedeemDineInVoucherResponse) SetCertificateID(v string)` + +SetCertificateID sets CertificateID field to given value. + +### HasCertificateID + +`func (o *RedeemDineInVoucherResponse) HasCertificateID() bool` + +HasCertificateID returns a boolean if a field has been set. + +### GetVoucherCode + +`func (o *RedeemDineInVoucherResponse) GetVoucherCode() string` + +GetVoucherCode returns the VoucherCode field if non-nil, zero value otherwise. + +### GetVoucherCodeOk + +`func (o *RedeemDineInVoucherResponse) GetVoucherCodeOk() (*string, bool)` + +GetVoucherCodeOk returns a tuple with the VoucherCode field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucherCode + +`func (o *RedeemDineInVoucherResponse) SetVoucherCode(v string)` + +SetVoucherCode sets VoucherCode field to given value. + +### HasVoucherCode + +`func (o *RedeemDineInVoucherResponse) HasVoucherCode() bool` + +HasVoucherCode returns a boolean if a field has been set. + +### GetVoucher + +`func (o *RedeemDineInVoucherResponse) GetVoucher() Voucher` + +GetVoucher returns the Voucher field if non-nil, zero value otherwise. + +### GetVoucherOk + +`func (o *RedeemDineInVoucherResponse) GetVoucherOk() (*Voucher, bool)` + +GetVoucherOk returns a tuple with the Voucher field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucher + +`func (o *RedeemDineInVoucherResponse) SetVoucher(v Voucher)` + +SetVoucher sets Voucher field to given value. + +### HasVoucher + +`func (o *RedeemDineInVoucherResponse) HasVoucher() bool` + +HasVoucher returns a boolean if a field has been set. + +### GetRedeemResult + +`func (o *RedeemDineInVoucherResponse) GetRedeemResult() RedeemResult` + +GetRedeemResult returns the RedeemResult field if non-nil, zero value otherwise. + +### GetRedeemResultOk + +`func (o *RedeemDineInVoucherResponse) GetRedeemResultOk() (*RedeemResult, bool)` + +GetRedeemResultOk returns a tuple with the RedeemResult field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRedeemResult + +`func (o *RedeemDineInVoucherResponse) SetRedeemResult(v RedeemResult)` + +SetRedeemResult sets RedeemResult field to given value. + +### HasRedeemResult + +`func (o *RedeemDineInVoucherResponse) HasRedeemResult() bool` + +HasRedeemResult returns a boolean if a field has been set. + +### GetMerchantID + +`func (o *RedeemDineInVoucherResponse) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *RedeemDineInVoucherResponse) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *RedeemDineInVoucherResponse) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *RedeemDineInVoucherResponse) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetCampaignID + +`func (o *RedeemDineInVoucherResponse) GetCampaignID() string` + +GetCampaignID returns the CampaignID field if non-nil, zero value otherwise. + +### GetCampaignIDOk + +`func (o *RedeemDineInVoucherResponse) GetCampaignIDOk() (*string, bool)` + +GetCampaignIDOk returns a tuple with the CampaignID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCampaignID + +`func (o *RedeemDineInVoucherResponse) SetCampaignID(v string)` + +SetCampaignID sets CampaignID field to given value. + +### HasCampaignID + +`func (o *RedeemDineInVoucherResponse) HasCampaignID() bool` + +HasCampaignID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RedeemDineinVoucherAPI.md b/docs/RedeemDineinVoucherAPI.md new file mode 100644 index 0000000..57bd048 --- /dev/null +++ b/docs/RedeemDineinVoucherAPI.md @@ -0,0 +1,77 @@ +# \RedeemDineinVoucherAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RedeemDineinVoucher**](RedeemDineinVoucherAPI.md#RedeemDineinVoucher) | **Post** /partner/v1/dinein/voucher/redeem | Redeem Dine In Voucher + + + +## RedeemDineinVoucher + +> RedeemDineInVoucherResponse RedeemDineinVoucher(ctx).Authorization(authorization).ContentType(contentType).RedeemDineInVoucherRequest(redeemDineInVoucherRequest).Execute() + +Redeem Dine In Voucher + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + redeemDineInVoucherRequest := *grabfood.NewRedeemDineInVoucherRequest("PPD#h9YygDAZhWkZVD50bT_xnM0bEFqTayuOdmHEhqJ4YAeDFPD3OKsEVg==", "1-CYNGRUNGSBCCC") // RedeemDineInVoucherRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.RedeemDineinVoucherAPI.RedeemDineinVoucher(context.Background()).Authorization(authorization).ContentType(contentType).RedeemDineInVoucherRequest(redeemDineInVoucherRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `RedeemDineinVoucherAPI.RedeemDineinVoucher``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `RedeemDineinVoucher`: RedeemDineInVoucherResponse + fmt.Fprintf(os.Stdout, "Response from `RedeemDineinVoucherAPI.RedeemDineinVoucher`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiRedeemDineinVoucherRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **redeemDineInVoucherRequest** | [**RedeemDineInVoucherRequest**](RedeemDineInVoucherRequest.md) | | + +### Return type + +[**RedeemDineInVoucherResponse**](RedeemDineInVoucherResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/RedeemResult.md b/docs/RedeemResult.md new file mode 100644 index 0000000..d38b370 --- /dev/null +++ b/docs/RedeemResult.md @@ -0,0 +1,82 @@ +# RedeemResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Success** | Pointer to **bool** | To indicate whether the dine-in voucher redemption succeeded. | [optional] +**Code** | Pointer to **string** | The code for the reason of failed redemption. Empty if the `success` is true. * `VOUCHER_REDEEMED` - The voucher has already been redeemed. * `INVALID_STATE` - The current status of voucher is EXPIRED or REFUNDED. * `REDEEM_FAILED` - Internal service error. * `INVALID_MERCHANT` - Voucher not applicable for this merchant. * `INVALID_ID` - Invalid certificateID. | [optional] + +## Methods + +### NewRedeemResult + +`func NewRedeemResult() *RedeemResult` + +NewRedeemResult instantiates a new RedeemResult object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRedeemResultWithDefaults + +`func NewRedeemResultWithDefaults() *RedeemResult` + +NewRedeemResultWithDefaults instantiates a new RedeemResult object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSuccess + +`func (o *RedeemResult) GetSuccess() bool` + +GetSuccess returns the Success field if non-nil, zero value otherwise. + +### GetSuccessOk + +`func (o *RedeemResult) GetSuccessOk() (*bool, bool)` + +GetSuccessOk returns a tuple with the Success field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSuccess + +`func (o *RedeemResult) SetSuccess(v bool)` + +SetSuccess sets Success field to given value. + +### HasSuccess + +`func (o *RedeemResult) HasSuccess() bool` + +HasSuccess returns a boolean if a field has been set. + +### GetCode + +`func (o *RedeemResult) GetCode() string` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *RedeemResult) GetCodeOk() (*string, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *RedeemResult) SetCode(v string)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *RedeemResult) HasCode() bool` + +HasCode returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RegisterMembershipNativeRequest.md b/docs/RegisterMembershipNativeRequest.md new file mode 100644 index 0000000..51bb298 --- /dev/null +++ b/docs/RegisterMembershipNativeRequest.md @@ -0,0 +1,129 @@ +# RegisterMembershipNativeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GrabID** | **string** | The id used to identify an unique grab user. | +**PhoneNumber** | Pointer to **string** | Grab user's phone number for registration. | [optional] +**Name** | Pointer to **string** | Grab user's name for registration. | [optional] +**Email** | Pointer to **string** | Grab user's email address for registration. | [optional] + +## Methods + +### NewRegisterMembershipNativeRequest + +`func NewRegisterMembershipNativeRequest(grabID string, ) *RegisterMembershipNativeRequest` + +NewRegisterMembershipNativeRequest instantiates a new RegisterMembershipNativeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRegisterMembershipNativeRequestWithDefaults + +`func NewRegisterMembershipNativeRequestWithDefaults() *RegisterMembershipNativeRequest` + +NewRegisterMembershipNativeRequestWithDefaults instantiates a new RegisterMembershipNativeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetGrabID + +`func (o *RegisterMembershipNativeRequest) GetGrabID() string` + +GetGrabID returns the GrabID field if non-nil, zero value otherwise. + +### GetGrabIDOk + +`func (o *RegisterMembershipNativeRequest) GetGrabIDOk() (*string, bool)` + +GetGrabIDOk returns a tuple with the GrabID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetGrabID + +`func (o *RegisterMembershipNativeRequest) SetGrabID(v string)` + +SetGrabID sets GrabID field to given value. + + +### GetPhoneNumber + +`func (o *RegisterMembershipNativeRequest) GetPhoneNumber() string` + +GetPhoneNumber returns the PhoneNumber field if non-nil, zero value otherwise. + +### GetPhoneNumberOk + +`func (o *RegisterMembershipNativeRequest) GetPhoneNumberOk() (*string, bool)` + +GetPhoneNumberOk returns a tuple with the PhoneNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPhoneNumber + +`func (o *RegisterMembershipNativeRequest) SetPhoneNumber(v string)` + +SetPhoneNumber sets PhoneNumber field to given value. + +### HasPhoneNumber + +`func (o *RegisterMembershipNativeRequest) HasPhoneNumber() bool` + +HasPhoneNumber returns a boolean if a field has been set. + +### GetName + +`func (o *RegisterMembershipNativeRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *RegisterMembershipNativeRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *RegisterMembershipNativeRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *RegisterMembershipNativeRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetEmail + +`func (o *RegisterMembershipNativeRequest) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *RegisterMembershipNativeRequest) GetEmailOk() (*string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEmail + +`func (o *RegisterMembershipNativeRequest) SetEmail(v string)` + +SetEmail sets Email field to given value. + +### HasEmail + +`func (o *RegisterMembershipNativeRequest) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RegisterMembershipNativeResponse.md b/docs/RegisterMembershipNativeResponse.md new file mode 100644 index 0000000..9ec0753 --- /dev/null +++ b/docs/RegisterMembershipNativeResponse.md @@ -0,0 +1,51 @@ +# RegisterMembershipNativeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | **string** | The unique member ID on the partner's database. | + +## Methods + +### NewRegisterMembershipNativeResponse + +`func NewRegisterMembershipNativeResponse(memberID string, ) *RegisterMembershipNativeResponse` + +NewRegisterMembershipNativeResponse instantiates a new RegisterMembershipNativeResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRegisterMembershipNativeResponseWithDefaults + +`func NewRegisterMembershipNativeResponseWithDefaults() *RegisterMembershipNativeResponse` + +NewRegisterMembershipNativeResponseWithDefaults instantiates a new RegisterMembershipNativeResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *RegisterMembershipNativeResponse) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *RegisterMembershipNativeResponse) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *RegisterMembershipNativeResponse) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/RewardItem.md b/docs/RewardItem.md new file mode 100644 index 0000000..3db458c --- /dev/null +++ b/docs/RewardItem.md @@ -0,0 +1,82 @@ +# RewardItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ItemID** | Pointer to **string** | The item's ID in partner system. | [optional] +**Quantity** | Pointer to **int32** | The item's quantity. | [optional] + +## Methods + +### NewRewardItem + +`func NewRewardItem() *RewardItem` + +NewRewardItem instantiates a new RewardItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRewardItemWithDefaults + +`func NewRewardItemWithDefaults() *RewardItem` + +NewRewardItemWithDefaults instantiates a new RewardItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetItemID + +`func (o *RewardItem) GetItemID() string` + +GetItemID returns the ItemID field if non-nil, zero value otherwise. + +### GetItemIDOk + +`func (o *RewardItem) GetItemIDOk() (*string, bool)` + +GetItemIDOk returns a tuple with the ItemID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItemID + +`func (o *RewardItem) SetItemID(v string)` + +SetItemID sets ItemID field to given value. + +### HasItemID + +`func (o *RewardItem) HasItemID() bool` + +HasItemID returns a boolean if a field has been set. + +### GetQuantity + +`func (o *RewardItem) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *RewardItem) GetQuantityOk() (*int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuantity + +`func (o *RewardItem) SetQuantity(v int32)` + +SetQuantity sets Quantity field to given value. + +### HasQuantity + +`func (o *RewardItem) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SellingTime.md b/docs/SellingTime.md new file mode 100644 index 0000000..0deb397 --- /dev/null +++ b/docs/SellingTime.md @@ -0,0 +1,160 @@ +# SellingTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartTime** | Pointer to **string** | The selling time group start time in date & time format. | [optional] +**EndTime** | Pointer to **string** | The selling time group end time in date & time format. | [optional] +**Id** | Pointer to **string** | The selling time's ID on the partner system. This ID should be unique with length min 1 and max 64. | [optional] +**Name** | Pointer to **string** | The name of the selling time. | [optional] +**ServiceHours** | Pointer to [**ServiceHours**](ServiceHours.md) | | [optional] + +## Methods + +### NewSellingTime + +`func NewSellingTime() *SellingTime` + +NewSellingTime instantiates a new SellingTime object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSellingTimeWithDefaults + +`func NewSellingTimeWithDefaults() *SellingTime` + +NewSellingTimeWithDefaults instantiates a new SellingTime object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartTime + +`func (o *SellingTime) GetStartTime() string` + +GetStartTime returns the StartTime field if non-nil, zero value otherwise. + +### GetStartTimeOk + +`func (o *SellingTime) GetStartTimeOk() (*string, bool)` + +GetStartTimeOk returns a tuple with the StartTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartTime + +`func (o *SellingTime) SetStartTime(v string)` + +SetStartTime sets StartTime field to given value. + +### HasStartTime + +`func (o *SellingTime) HasStartTime() bool` + +HasStartTime returns a boolean if a field has been set. + +### GetEndTime + +`func (o *SellingTime) GetEndTime() string` + +GetEndTime returns the EndTime field if non-nil, zero value otherwise. + +### GetEndTimeOk + +`func (o *SellingTime) GetEndTimeOk() (*string, bool)` + +GetEndTimeOk returns a tuple with the EndTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndTime + +`func (o *SellingTime) SetEndTime(v string)` + +SetEndTime sets EndTime field to given value. + +### HasEndTime + +`func (o *SellingTime) HasEndTime() bool` + +HasEndTime returns a boolean if a field has been set. + +### GetId + +`func (o *SellingTime) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *SellingTime) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *SellingTime) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *SellingTime) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetName + +`func (o *SellingTime) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *SellingTime) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *SellingTime) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *SellingTime) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetServiceHours + +`func (o *SellingTime) GetServiceHours() ServiceHours` + +GetServiceHours returns the ServiceHours field if non-nil, zero value otherwise. + +### GetServiceHoursOk + +`func (o *SellingTime) GetServiceHoursOk() (*ServiceHours, bool)` + +GetServiceHoursOk returns a tuple with the ServiceHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServiceHours + +`func (o *SellingTime) SetServiceHours(v ServiceHours)` + +SetServiceHours sets ServiceHours field to given value. + +### HasServiceHours + +`func (o *SellingTime) HasServiceHours() bool` + +HasServiceHours returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ServiceHour.md b/docs/ServiceHour.md new file mode 100644 index 0000000..2140689 --- /dev/null +++ b/docs/ServiceHour.md @@ -0,0 +1,77 @@ +# ServiceHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OpenPeriodType** | **string** | The period type for when the outlet is open. - OpenPeriod = open only in given periods - OpenAllDay = open 24 hours - CloseAllDay = closed 24 hours | +**Periods** | Pointer to [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Only required when `openPeriodType` is **OpenPeriod** | [optional] + +## Methods + +### NewServiceHour + +`func NewServiceHour(openPeriodType string, ) *ServiceHour` + +NewServiceHour instantiates a new ServiceHour object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceHourWithDefaults + +`func NewServiceHourWithDefaults() *ServiceHour` + +NewServiceHourWithDefaults instantiates a new ServiceHour object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOpenPeriodType + +`func (o *ServiceHour) GetOpenPeriodType() string` + +GetOpenPeriodType returns the OpenPeriodType field if non-nil, zero value otherwise. + +### GetOpenPeriodTypeOk + +`func (o *ServiceHour) GetOpenPeriodTypeOk() (*string, bool)` + +GetOpenPeriodTypeOk returns a tuple with the OpenPeriodType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpenPeriodType + +`func (o *ServiceHour) SetOpenPeriodType(v string)` + +SetOpenPeriodType sets OpenPeriodType field to given value. + + +### GetPeriods + +`func (o *ServiceHour) GetPeriods() []OpenPeriod` + +GetPeriods returns the Periods field if non-nil, zero value otherwise. + +### GetPeriodsOk + +`func (o *ServiceHour) GetPeriodsOk() (*[]OpenPeriod, bool)` + +GetPeriodsOk returns a tuple with the Periods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriods + +`func (o *ServiceHour) SetPeriods(v []OpenPeriod)` + +SetPeriods sets Periods field to given value. + +### HasPeriods + +`func (o *ServiceHour) HasPeriods() bool` + +HasPeriods returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ServiceHours.md b/docs/ServiceHours.md new file mode 100644 index 0000000..de1033a --- /dev/null +++ b/docs/ServiceHours.md @@ -0,0 +1,177 @@ +# ServiceHours + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mon** | [**ServiceHour**](ServiceHour.md) | | +**Tue** | [**ServiceHour**](ServiceHour.md) | | +**Wed** | [**ServiceHour**](ServiceHour.md) | | +**Thu** | [**ServiceHour**](ServiceHour.md) | | +**Fri** | [**ServiceHour**](ServiceHour.md) | | +**Sat** | [**ServiceHour**](ServiceHour.md) | | +**Sun** | [**ServiceHour**](ServiceHour.md) | | + +## Methods + +### NewServiceHours + +`func NewServiceHours(mon ServiceHour, tue ServiceHour, wed ServiceHour, thu ServiceHour, fri ServiceHour, sat ServiceHour, sun ServiceHour, ) *ServiceHours` + +NewServiceHours instantiates a new ServiceHours object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewServiceHoursWithDefaults + +`func NewServiceHoursWithDefaults() *ServiceHours` + +NewServiceHoursWithDefaults instantiates a new ServiceHours object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMon + +`func (o *ServiceHours) GetMon() ServiceHour` + +GetMon returns the Mon field if non-nil, zero value otherwise. + +### GetMonOk + +`func (o *ServiceHours) GetMonOk() (*ServiceHour, bool)` + +GetMonOk returns a tuple with the Mon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMon + +`func (o *ServiceHours) SetMon(v ServiceHour)` + +SetMon sets Mon field to given value. + + +### GetTue + +`func (o *ServiceHours) GetTue() ServiceHour` + +GetTue returns the Tue field if non-nil, zero value otherwise. + +### GetTueOk + +`func (o *ServiceHours) GetTueOk() (*ServiceHour, bool)` + +GetTueOk returns a tuple with the Tue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTue + +`func (o *ServiceHours) SetTue(v ServiceHour)` + +SetTue sets Tue field to given value. + + +### GetWed + +`func (o *ServiceHours) GetWed() ServiceHour` + +GetWed returns the Wed field if non-nil, zero value otherwise. + +### GetWedOk + +`func (o *ServiceHours) GetWedOk() (*ServiceHour, bool)` + +GetWedOk returns a tuple with the Wed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWed + +`func (o *ServiceHours) SetWed(v ServiceHour)` + +SetWed sets Wed field to given value. + + +### GetThu + +`func (o *ServiceHours) GetThu() ServiceHour` + +GetThu returns the Thu field if non-nil, zero value otherwise. + +### GetThuOk + +`func (o *ServiceHours) GetThuOk() (*ServiceHour, bool)` + +GetThuOk returns a tuple with the Thu field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThu + +`func (o *ServiceHours) SetThu(v ServiceHour)` + +SetThu sets Thu field to given value. + + +### GetFri + +`func (o *ServiceHours) GetFri() ServiceHour` + +GetFri returns the Fri field if non-nil, zero value otherwise. + +### GetFriOk + +`func (o *ServiceHours) GetFriOk() (*ServiceHour, bool)` + +GetFriOk returns a tuple with the Fri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFri + +`func (o *ServiceHours) SetFri(v ServiceHour)` + +SetFri sets Fri field to given value. + + +### GetSat + +`func (o *ServiceHours) GetSat() ServiceHour` + +GetSat returns the Sat field if non-nil, zero value otherwise. + +### GetSatOk + +`func (o *ServiceHours) GetSatOk() (*ServiceHour, bool)` + +GetSatOk returns a tuple with the Sat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSat + +`func (o *ServiceHours) SetSat(v ServiceHour)` + +SetSat sets Sat field to given value. + + +### GetSun + +`func (o *ServiceHours) GetSun() ServiceHour` + +GetSun returns the Sun field if non-nil, zero value otherwise. + +### GetSunOk + +`func (o *ServiceHours) GetSunOk() (*ServiceHour, bool)` + +GetSunOk returns a tuple with the Sun field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSun + +`func (o *ServiceHours) SetSun(v ServiceHour)` + +SetSun sets Sun field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpecialOpeningHour.md b/docs/SpecialOpeningHour.md new file mode 100644 index 0000000..bd9912a --- /dev/null +++ b/docs/SpecialOpeningHour.md @@ -0,0 +1,134 @@ +# SpecialOpeningHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**StartDate** | Pointer to **string** | The start date of store special opening hours. | [optional] +**EndDate** | Pointer to **string** | The end date of store special opening hours. | [optional] +**Metadata** | Pointer to [**SpecialOpeningHourMetadata**](SpecialOpeningHourMetadata.md) | | [optional] +**OpeningHours** | Pointer to [**SpecialOpeningHourOpeningHours**](SpecialOpeningHourOpeningHours.md) | | [optional] + +## Methods + +### NewSpecialOpeningHour + +`func NewSpecialOpeningHour() *SpecialOpeningHour` + +NewSpecialOpeningHour instantiates a new SpecialOpeningHour object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpecialOpeningHourWithDefaults + +`func NewSpecialOpeningHourWithDefaults() *SpecialOpeningHour` + +NewSpecialOpeningHourWithDefaults instantiates a new SpecialOpeningHour object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStartDate + +`func (o *SpecialOpeningHour) GetStartDate() string` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *SpecialOpeningHour) GetStartDateOk() (*string, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *SpecialOpeningHour) SetStartDate(v string)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *SpecialOpeningHour) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### GetEndDate + +`func (o *SpecialOpeningHour) GetEndDate() string` + +GetEndDate returns the EndDate field if non-nil, zero value otherwise. + +### GetEndDateOk + +`func (o *SpecialOpeningHour) GetEndDateOk() (*string, bool)` + +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndDate + +`func (o *SpecialOpeningHour) SetEndDate(v string)` + +SetEndDate sets EndDate field to given value. + +### HasEndDate + +`func (o *SpecialOpeningHour) HasEndDate() bool` + +HasEndDate returns a boolean if a field has been set. + +### GetMetadata + +`func (o *SpecialOpeningHour) GetMetadata() SpecialOpeningHourMetadata` + +GetMetadata returns the Metadata field if non-nil, zero value otherwise. + +### GetMetadataOk + +`func (o *SpecialOpeningHour) GetMetadataOk() (*SpecialOpeningHourMetadata, bool)` + +GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMetadata + +`func (o *SpecialOpeningHour) SetMetadata(v SpecialOpeningHourMetadata)` + +SetMetadata sets Metadata field to given value. + +### HasMetadata + +`func (o *SpecialOpeningHour) HasMetadata() bool` + +HasMetadata returns a boolean if a field has been set. + +### GetOpeningHours + +`func (o *SpecialOpeningHour) GetOpeningHours() SpecialOpeningHourOpeningHours` + +GetOpeningHours returns the OpeningHours field if non-nil, zero value otherwise. + +### GetOpeningHoursOk + +`func (o *SpecialOpeningHour) GetOpeningHoursOk() (*SpecialOpeningHourOpeningHours, bool)` + +GetOpeningHoursOk returns a tuple with the OpeningHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpeningHours + +`func (o *SpecialOpeningHour) SetOpeningHours(v SpecialOpeningHourOpeningHours)` + +SetOpeningHours sets OpeningHours field to given value. + +### HasOpeningHours + +`func (o *SpecialOpeningHour) HasOpeningHours() bool` + +HasOpeningHours returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpecialOpeningHourMetadata.md b/docs/SpecialOpeningHourMetadata.md new file mode 100644 index 0000000..ba39320 --- /dev/null +++ b/docs/SpecialOpeningHourMetadata.md @@ -0,0 +1,56 @@ +# SpecialOpeningHourMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | Pointer to **string** | Description of the special opening hour. | [optional] + +## Methods + +### NewSpecialOpeningHourMetadata + +`func NewSpecialOpeningHourMetadata() *SpecialOpeningHourMetadata` + +NewSpecialOpeningHourMetadata instantiates a new SpecialOpeningHourMetadata object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpecialOpeningHourMetadataWithDefaults + +`func NewSpecialOpeningHourMetadataWithDefaults() *SpecialOpeningHourMetadata` + +NewSpecialOpeningHourMetadataWithDefaults instantiates a new SpecialOpeningHourMetadata object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDescription + +`func (o *SpecialOpeningHourMetadata) GetDescription() string` + +GetDescription returns the Description field if non-nil, zero value otherwise. + +### GetDescriptionOk + +`func (o *SpecialOpeningHourMetadata) GetDescriptionOk() (*string, bool)` + +GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescription + +`func (o *SpecialOpeningHourMetadata) SetDescription(v string)` + +SetDescription sets Description field to given value. + +### HasDescription + +`func (o *SpecialOpeningHourMetadata) HasDescription() bool` + +HasDescription returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SpecialOpeningHourOpeningHours.md b/docs/SpecialOpeningHourOpeningHours.md new file mode 100644 index 0000000..4be8609 --- /dev/null +++ b/docs/SpecialOpeningHourOpeningHours.md @@ -0,0 +1,82 @@ +# SpecialOpeningHourOpeningHours + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OpenPeriodType** | Pointer to **string** | The period type for when the outlet is open. | [optional] +**Periods** | Pointer to [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. | [optional] + +## Methods + +### NewSpecialOpeningHourOpeningHours + +`func NewSpecialOpeningHourOpeningHours() *SpecialOpeningHourOpeningHours` + +NewSpecialOpeningHourOpeningHours instantiates a new SpecialOpeningHourOpeningHours object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSpecialOpeningHourOpeningHoursWithDefaults + +`func NewSpecialOpeningHourOpeningHoursWithDefaults() *SpecialOpeningHourOpeningHours` + +NewSpecialOpeningHourOpeningHoursWithDefaults instantiates a new SpecialOpeningHourOpeningHours object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOpenPeriodType + +`func (o *SpecialOpeningHourOpeningHours) GetOpenPeriodType() string` + +GetOpenPeriodType returns the OpenPeriodType field if non-nil, zero value otherwise. + +### GetOpenPeriodTypeOk + +`func (o *SpecialOpeningHourOpeningHours) GetOpenPeriodTypeOk() (*string, bool)` + +GetOpenPeriodTypeOk returns a tuple with the OpenPeriodType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpenPeriodType + +`func (o *SpecialOpeningHourOpeningHours) SetOpenPeriodType(v string)` + +SetOpenPeriodType sets OpenPeriodType field to given value. + +### HasOpenPeriodType + +`func (o *SpecialOpeningHourOpeningHours) HasOpenPeriodType() bool` + +HasOpenPeriodType returns a boolean if a field has been set. + +### GetPeriods + +`func (o *SpecialOpeningHourOpeningHours) GetPeriods() []OpenPeriod` + +GetPeriods returns the Periods field if non-nil, zero value otherwise. + +### GetPeriodsOk + +`func (o *SpecialOpeningHourOpeningHours) GetPeriodsOk() (*[]OpenPeriod, bool)` + +GetPeriodsOk returns a tuple with the Periods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriods + +`func (o *SpecialOpeningHourOpeningHours) SetPeriods(v []OpenPeriod)` + +SetPeriods sets Periods field to given value. + +### HasPeriods + +`func (o *SpecialOpeningHourOpeningHours) HasPeriods() bool` + +HasPeriods returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StoreHour.md b/docs/StoreHour.md new file mode 100644 index 0000000..928fc2c --- /dev/null +++ b/docs/StoreHour.md @@ -0,0 +1,177 @@ +# StoreHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mon** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Tue** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Wed** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Thu** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Fri** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Sat** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | +**Sun** | [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. Maximum of 3 periods. Blank indicates store close. | + +## Methods + +### NewStoreHour + +`func NewStoreHour(mon []OpenPeriod, tue []OpenPeriod, wed []OpenPeriod, thu []OpenPeriod, fri []OpenPeriod, sat []OpenPeriod, sun []OpenPeriod, ) *StoreHour` + +NewStoreHour instantiates a new StoreHour object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStoreHourWithDefaults + +`func NewStoreHourWithDefaults() *StoreHour` + +NewStoreHourWithDefaults instantiates a new StoreHour object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMon + +`func (o *StoreHour) GetMon() []OpenPeriod` + +GetMon returns the Mon field if non-nil, zero value otherwise. + +### GetMonOk + +`func (o *StoreHour) GetMonOk() (*[]OpenPeriod, bool)` + +GetMonOk returns a tuple with the Mon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMon + +`func (o *StoreHour) SetMon(v []OpenPeriod)` + +SetMon sets Mon field to given value. + + +### GetTue + +`func (o *StoreHour) GetTue() []OpenPeriod` + +GetTue returns the Tue field if non-nil, zero value otherwise. + +### GetTueOk + +`func (o *StoreHour) GetTueOk() (*[]OpenPeriod, bool)` + +GetTueOk returns a tuple with the Tue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTue + +`func (o *StoreHour) SetTue(v []OpenPeriod)` + +SetTue sets Tue field to given value. + + +### GetWed + +`func (o *StoreHour) GetWed() []OpenPeriod` + +GetWed returns the Wed field if non-nil, zero value otherwise. + +### GetWedOk + +`func (o *StoreHour) GetWedOk() (*[]OpenPeriod, bool)` + +GetWedOk returns a tuple with the Wed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWed + +`func (o *StoreHour) SetWed(v []OpenPeriod)` + +SetWed sets Wed field to given value. + + +### GetThu + +`func (o *StoreHour) GetThu() []OpenPeriod` + +GetThu returns the Thu field if non-nil, zero value otherwise. + +### GetThuOk + +`func (o *StoreHour) GetThuOk() (*[]OpenPeriod, bool)` + +GetThuOk returns a tuple with the Thu field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThu + +`func (o *StoreHour) SetThu(v []OpenPeriod)` + +SetThu sets Thu field to given value. + + +### GetFri + +`func (o *StoreHour) GetFri() []OpenPeriod` + +GetFri returns the Fri field if non-nil, zero value otherwise. + +### GetFriOk + +`func (o *StoreHour) GetFriOk() (*[]OpenPeriod, bool)` + +GetFriOk returns a tuple with the Fri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFri + +`func (o *StoreHour) SetFri(v []OpenPeriod)` + +SetFri sets Fri field to given value. + + +### GetSat + +`func (o *StoreHour) GetSat() []OpenPeriod` + +GetSat returns the Sat field if non-nil, zero value otherwise. + +### GetSatOk + +`func (o *StoreHour) GetSatOk() (*[]OpenPeriod, bool)` + +GetSatOk returns a tuple with the Sat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSat + +`func (o *StoreHour) SetSat(v []OpenPeriod)` + +SetSat sets Sat field to given value. + + +### GetSun + +`func (o *StoreHour) GetSun() []OpenPeriod` + +GetSun returns the Sun field if non-nil, zero value otherwise. + +### GetSunOk + +`func (o *StoreHour) GetSunOk() (*[]OpenPeriod, bool)` + +GetSunOk returns a tuple with the Sun field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSun + +`func (o *StoreHour) SetSun(v []OpenPeriod)` + +SetSun sets Sun field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StoreHourResponse.md b/docs/StoreHourResponse.md new file mode 100644 index 0000000..9c80236 --- /dev/null +++ b/docs/StoreHourResponse.md @@ -0,0 +1,108 @@ +# StoreHourResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DineInHour** | Pointer to [**StoreHour**](StoreHour.md) | | [optional] +**OpeningHour** | Pointer to [**StoreHour**](StoreHour.md) | | [optional] +**SpecialOpeningHours** | Pointer to [**[]SpecialOpeningHour**](SpecialOpeningHour.md) | The store's special opening hours. | [optional] + +## Methods + +### NewStoreHourResponse + +`func NewStoreHourResponse() *StoreHourResponse` + +NewStoreHourResponse instantiates a new StoreHourResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStoreHourResponseWithDefaults + +`func NewStoreHourResponseWithDefaults() *StoreHourResponse` + +NewStoreHourResponseWithDefaults instantiates a new StoreHourResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDineInHour + +`func (o *StoreHourResponse) GetDineInHour() StoreHour` + +GetDineInHour returns the DineInHour field if non-nil, zero value otherwise. + +### GetDineInHourOk + +`func (o *StoreHourResponse) GetDineInHourOk() (*StoreHour, bool)` + +GetDineInHourOk returns a tuple with the DineInHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineInHour + +`func (o *StoreHourResponse) SetDineInHour(v StoreHour)` + +SetDineInHour sets DineInHour field to given value. + +### HasDineInHour + +`func (o *StoreHourResponse) HasDineInHour() bool` + +HasDineInHour returns a boolean if a field has been set. + +### GetOpeningHour + +`func (o *StoreHourResponse) GetOpeningHour() StoreHour` + +GetOpeningHour returns the OpeningHour field if non-nil, zero value otherwise. + +### GetOpeningHourOk + +`func (o *StoreHourResponse) GetOpeningHourOk() (*StoreHour, bool)` + +GetOpeningHourOk returns a tuple with the OpeningHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpeningHour + +`func (o *StoreHourResponse) SetOpeningHour(v StoreHour)` + +SetOpeningHour sets OpeningHour field to given value. + +### HasOpeningHour + +`func (o *StoreHourResponse) HasOpeningHour() bool` + +HasOpeningHour returns a boolean if a field has been set. + +### GetSpecialOpeningHours + +`func (o *StoreHourResponse) GetSpecialOpeningHours() []SpecialOpeningHour` + +GetSpecialOpeningHours returns the SpecialOpeningHours field if non-nil, zero value otherwise. + +### GetSpecialOpeningHoursOk + +`func (o *StoreHourResponse) GetSpecialOpeningHoursOk() (*[]SpecialOpeningHour, bool)` + +GetSpecialOpeningHoursOk returns a tuple with the SpecialOpeningHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialOpeningHours + +`func (o *StoreHourResponse) SetSpecialOpeningHours(v []SpecialOpeningHour)` + +SetSpecialOpeningHours sets SpecialOpeningHours field to given value. + +### HasSpecialOpeningHours + +`func (o *StoreHourResponse) HasSpecialOpeningHours() bool` + +HasSpecialOpeningHours returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StoreStatusResponse.md b/docs/StoreStatusResponse.md new file mode 100644 index 0000000..70e3bbd --- /dev/null +++ b/docs/StoreStatusResponse.md @@ -0,0 +1,93 @@ +# StoreStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CloseReason** | **string** | The code of store close reason. Blank indicates store is currently open. | +**IsInSpecialOpeningHourRange** | **bool** | Indicate whether the store is in special opening hour range. | +**IsOpen** | **bool** | Indicate whether the store is open. | + +## Methods + +### NewStoreStatusResponse + +`func NewStoreStatusResponse(closeReason string, isInSpecialOpeningHourRange bool, isOpen bool, ) *StoreStatusResponse` + +NewStoreStatusResponse instantiates a new StoreStatusResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewStoreStatusResponseWithDefaults + +`func NewStoreStatusResponseWithDefaults() *StoreStatusResponse` + +NewStoreStatusResponseWithDefaults instantiates a new StoreStatusResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCloseReason + +`func (o *StoreStatusResponse) GetCloseReason() string` + +GetCloseReason returns the CloseReason field if non-nil, zero value otherwise. + +### GetCloseReasonOk + +`func (o *StoreStatusResponse) GetCloseReasonOk() (*string, bool)` + +GetCloseReasonOk returns a tuple with the CloseReason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloseReason + +`func (o *StoreStatusResponse) SetCloseReason(v string)` + +SetCloseReason sets CloseReason field to given value. + + +### GetIsInSpecialOpeningHourRange + +`func (o *StoreStatusResponse) GetIsInSpecialOpeningHourRange() bool` + +GetIsInSpecialOpeningHourRange returns the IsInSpecialOpeningHourRange field if non-nil, zero value otherwise. + +### GetIsInSpecialOpeningHourRangeOk + +`func (o *StoreStatusResponse) GetIsInSpecialOpeningHourRangeOk() (*bool, bool)` + +GetIsInSpecialOpeningHourRangeOk returns a tuple with the IsInSpecialOpeningHourRange field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsInSpecialOpeningHourRange + +`func (o *StoreStatusResponse) SetIsInSpecialOpeningHourRange(v bool)` + +SetIsInSpecialOpeningHourRange sets IsInSpecialOpeningHourRange field to given value. + + +### GetIsOpen + +`func (o *StoreStatusResponse) GetIsOpen() bool` + +GetIsOpen returns the IsOpen field if non-nil, zero value otherwise. + +### GetIsOpenOk + +`func (o *StoreStatusResponse) GetIsOpenOk() (*bool, bool)` + +GetIsOpenOk returns a tuple with the IsOpen field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsOpen + +`func (o *StoreStatusResponse) SetIsOpen(v bool)` + +SetIsOpen sets IsOpen field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SubmitOrderRequest.md b/docs/SubmitOrderRequest.md new file mode 100644 index 0000000..97b148c --- /dev/null +++ b/docs/SubmitOrderRequest.md @@ -0,0 +1,536 @@ +# SubmitOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrderID** | **string** | The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**ShortOrderNumber** | **string** | The GrabFood short order number. This is unique for each merchant per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). | +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**PartnerMerchantID** | Pointer to **string** | The merchant's ID that is on the partner's database. | [optional] +**PaymentType** | **string** | The payment method used. Refer to FAQs for more details about [paymentType](#section/Order/Does-the-paymentType-affect-partners). | +**Cutlery** | **bool** | The boolean value to indicate whether cutlery are needed or not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery). | +**OrderTime** | **string** | The UTC time that a consumer places the order, based on ISO_8601/RFC3339. | +**SubmitTime** | Pointer to **time.Time** | The order submit time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. | [optional] +**CompleteTime** | Pointer to **time.Time** | The order complete time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. | [optional] +**ScheduledTime** | Pointer to **string** | The order scheduled time, based on ISO_8601/RFC3339. Empty for non-scheduled orders. | [optional] +**OrderState** | Pointer to **string** | The state of the order. Only present in the [List Orders](#tag/list-order) response. Refer to [Order States](#section/Order-states). | [optional] +**Currency** | [**Currency**](Currency.md) | | +**FeatureFlags** | [**OrderFeatureFlags**](OrderFeatureFlags.md) | | +**Items** | [**[]OrderItem**](OrderItem.md) | The items in an array of JSON Object. Refer to [Items](#items) for more information. | +**Campaigns** | Pointer to [**[]OrderCampaign**](OrderCampaign.md) | The campaigns that are applicable for the order.`null` when there is no campaign applied. | [optional] +**Promos** | Pointer to [**[]OrderPromo**](OrderPromo.md) | An array of promotion objects. Only promotions that are funded by merchants will be sent. | [optional] +**Price** | [**OrderPrice**](OrderPrice.md) | | +**DineIn** | Pointer to [**DineIn**](DineIn.md) | | [optional] +**Receiver** | Pointer to [**Receiver**](Receiver.md) | | [optional] +**OrderReadyEstimation** | Pointer to [**OrderReadyEstimation**](OrderReadyEstimation.md) | | [optional] +**MembershipID** | Pointer to **string** | Membership ID for loyalty project. Only present for loyalty program partners. | [optional] + +## Methods + +### NewSubmitOrderRequest + +`func NewSubmitOrderRequest(orderID string, shortOrderNumber string, merchantID string, paymentType string, cutlery bool, orderTime string, currency Currency, featureFlags OrderFeatureFlags, items []OrderItem, price OrderPrice, ) *SubmitOrderRequest` + +NewSubmitOrderRequest instantiates a new SubmitOrderRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSubmitOrderRequestWithDefaults + +`func NewSubmitOrderRequestWithDefaults() *SubmitOrderRequest` + +NewSubmitOrderRequestWithDefaults instantiates a new SubmitOrderRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOrderID + +`func (o *SubmitOrderRequest) GetOrderID() string` + +GetOrderID returns the OrderID field if non-nil, zero value otherwise. + +### GetOrderIDOk + +`func (o *SubmitOrderRequest) GetOrderIDOk() (*string, bool)` + +GetOrderIDOk returns a tuple with the OrderID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderID + +`func (o *SubmitOrderRequest) SetOrderID(v string)` + +SetOrderID sets OrderID field to given value. + + +### GetShortOrderNumber + +`func (o *SubmitOrderRequest) GetShortOrderNumber() string` + +GetShortOrderNumber returns the ShortOrderNumber field if non-nil, zero value otherwise. + +### GetShortOrderNumberOk + +`func (o *SubmitOrderRequest) GetShortOrderNumberOk() (*string, bool)` + +GetShortOrderNumberOk returns a tuple with the ShortOrderNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetShortOrderNumber + +`func (o *SubmitOrderRequest) SetShortOrderNumber(v string)` + +SetShortOrderNumber sets ShortOrderNumber field to given value. + + +### GetMerchantID + +`func (o *SubmitOrderRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *SubmitOrderRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *SubmitOrderRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetPartnerMerchantID + +`func (o *SubmitOrderRequest) GetPartnerMerchantID() string` + +GetPartnerMerchantID returns the PartnerMerchantID field if non-nil, zero value otherwise. + +### GetPartnerMerchantIDOk + +`func (o *SubmitOrderRequest) GetPartnerMerchantIDOk() (*string, bool)` + +GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPartnerMerchantID + +`func (o *SubmitOrderRequest) SetPartnerMerchantID(v string)` + +SetPartnerMerchantID sets PartnerMerchantID field to given value. + +### HasPartnerMerchantID + +`func (o *SubmitOrderRequest) HasPartnerMerchantID() bool` + +HasPartnerMerchantID returns a boolean if a field has been set. + +### GetPaymentType + +`func (o *SubmitOrderRequest) GetPaymentType() string` + +GetPaymentType returns the PaymentType field if non-nil, zero value otherwise. + +### GetPaymentTypeOk + +`func (o *SubmitOrderRequest) GetPaymentTypeOk() (*string, bool)` + +GetPaymentTypeOk returns a tuple with the PaymentType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPaymentType + +`func (o *SubmitOrderRequest) SetPaymentType(v string)` + +SetPaymentType sets PaymentType field to given value. + + +### GetCutlery + +`func (o *SubmitOrderRequest) GetCutlery() bool` + +GetCutlery returns the Cutlery field if non-nil, zero value otherwise. + +### GetCutleryOk + +`func (o *SubmitOrderRequest) GetCutleryOk() (*bool, bool)` + +GetCutleryOk returns a tuple with the Cutlery field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCutlery + +`func (o *SubmitOrderRequest) SetCutlery(v bool)` + +SetCutlery sets Cutlery field to given value. + + +### GetOrderTime + +`func (o *SubmitOrderRequest) GetOrderTime() string` + +GetOrderTime returns the OrderTime field if non-nil, zero value otherwise. + +### GetOrderTimeOk + +`func (o *SubmitOrderRequest) GetOrderTimeOk() (*string, bool)` + +GetOrderTimeOk returns a tuple with the OrderTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderTime + +`func (o *SubmitOrderRequest) SetOrderTime(v string)` + +SetOrderTime sets OrderTime field to given value. + + +### GetSubmitTime + +`func (o *SubmitOrderRequest) GetSubmitTime() time.Time` + +GetSubmitTime returns the SubmitTime field if non-nil, zero value otherwise. + +### GetSubmitTimeOk + +`func (o *SubmitOrderRequest) GetSubmitTimeOk() (*time.Time, bool)` + +GetSubmitTimeOk returns a tuple with the SubmitTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubmitTime + +`func (o *SubmitOrderRequest) SetSubmitTime(v time.Time)` + +SetSubmitTime sets SubmitTime field to given value. + +### HasSubmitTime + +`func (o *SubmitOrderRequest) HasSubmitTime() bool` + +HasSubmitTime returns a boolean if a field has been set. + +### GetCompleteTime + +`func (o *SubmitOrderRequest) GetCompleteTime() time.Time` + +GetCompleteTime returns the CompleteTime field if non-nil, zero value otherwise. + +### GetCompleteTimeOk + +`func (o *SubmitOrderRequest) GetCompleteTimeOk() (*time.Time, bool)` + +GetCompleteTimeOk returns a tuple with the CompleteTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCompleteTime + +`func (o *SubmitOrderRequest) SetCompleteTime(v time.Time)` + +SetCompleteTime sets CompleteTime field to given value. + +### HasCompleteTime + +`func (o *SubmitOrderRequest) HasCompleteTime() bool` + +HasCompleteTime returns a boolean if a field has been set. + +### GetScheduledTime + +`func (o *SubmitOrderRequest) GetScheduledTime() string` + +GetScheduledTime returns the ScheduledTime field if non-nil, zero value otherwise. + +### GetScheduledTimeOk + +`func (o *SubmitOrderRequest) GetScheduledTimeOk() (*string, bool)` + +GetScheduledTimeOk returns a tuple with the ScheduledTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduledTime + +`func (o *SubmitOrderRequest) SetScheduledTime(v string)` + +SetScheduledTime sets ScheduledTime field to given value. + +### HasScheduledTime + +`func (o *SubmitOrderRequest) HasScheduledTime() bool` + +HasScheduledTime returns a boolean if a field has been set. + +### GetOrderState + +`func (o *SubmitOrderRequest) GetOrderState() string` + +GetOrderState returns the OrderState field if non-nil, zero value otherwise. + +### GetOrderStateOk + +`func (o *SubmitOrderRequest) GetOrderStateOk() (*string, bool)` + +GetOrderStateOk returns a tuple with the OrderState field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderState + +`func (o *SubmitOrderRequest) SetOrderState(v string)` + +SetOrderState sets OrderState field to given value. + +### HasOrderState + +`func (o *SubmitOrderRequest) HasOrderState() bool` + +HasOrderState returns a boolean if a field has been set. + +### GetCurrency + +`func (o *SubmitOrderRequest) GetCurrency() Currency` + +GetCurrency returns the Currency field if non-nil, zero value otherwise. + +### GetCurrencyOk + +`func (o *SubmitOrderRequest) GetCurrencyOk() (*Currency, bool)` + +GetCurrencyOk returns a tuple with the Currency field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCurrency + +`func (o *SubmitOrderRequest) SetCurrency(v Currency)` + +SetCurrency sets Currency field to given value. + + +### GetFeatureFlags + +`func (o *SubmitOrderRequest) GetFeatureFlags() OrderFeatureFlags` + +GetFeatureFlags returns the FeatureFlags field if non-nil, zero value otherwise. + +### GetFeatureFlagsOk + +`func (o *SubmitOrderRequest) GetFeatureFlagsOk() (*OrderFeatureFlags, bool)` + +GetFeatureFlagsOk returns a tuple with the FeatureFlags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFeatureFlags + +`func (o *SubmitOrderRequest) SetFeatureFlags(v OrderFeatureFlags)` + +SetFeatureFlags sets FeatureFlags field to given value. + + +### GetItems + +`func (o *SubmitOrderRequest) GetItems() []OrderItem` + +GetItems returns the Items field if non-nil, zero value otherwise. + +### GetItemsOk + +`func (o *SubmitOrderRequest) GetItemsOk() (*[]OrderItem, bool)` + +GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetItems + +`func (o *SubmitOrderRequest) SetItems(v []OrderItem)` + +SetItems sets Items field to given value. + + +### GetCampaigns + +`func (o *SubmitOrderRequest) GetCampaigns() []OrderCampaign` + +GetCampaigns returns the Campaigns field if non-nil, zero value otherwise. + +### GetCampaignsOk + +`func (o *SubmitOrderRequest) GetCampaignsOk() (*[]OrderCampaign, bool)` + +GetCampaignsOk returns a tuple with the Campaigns field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCampaigns + +`func (o *SubmitOrderRequest) SetCampaigns(v []OrderCampaign)` + +SetCampaigns sets Campaigns field to given value. + +### HasCampaigns + +`func (o *SubmitOrderRequest) HasCampaigns() bool` + +HasCampaigns returns a boolean if a field has been set. + +### SetCampaignsNil + +`func (o *SubmitOrderRequest) SetCampaignsNil(b bool)` + + SetCampaignsNil sets the value for Campaigns to be an explicit nil + +### UnsetCampaigns +`func (o *SubmitOrderRequest) UnsetCampaigns()` + +UnsetCampaigns ensures that no value is present for Campaigns, not even an explicit nil +### GetPromos + +`func (o *SubmitOrderRequest) GetPromos() []OrderPromo` + +GetPromos returns the Promos field if non-nil, zero value otherwise. + +### GetPromosOk + +`func (o *SubmitOrderRequest) GetPromosOk() (*[]OrderPromo, bool)` + +GetPromosOk returns a tuple with the Promos field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPromos + +`func (o *SubmitOrderRequest) SetPromos(v []OrderPromo)` + +SetPromos sets Promos field to given value. + +### HasPromos + +`func (o *SubmitOrderRequest) HasPromos() bool` + +HasPromos returns a boolean if a field has been set. + +### GetPrice + +`func (o *SubmitOrderRequest) GetPrice() OrderPrice` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *SubmitOrderRequest) GetPriceOk() (*OrderPrice, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *SubmitOrderRequest) SetPrice(v OrderPrice)` + +SetPrice sets Price field to given value. + + +### GetDineIn + +`func (o *SubmitOrderRequest) GetDineIn() DineIn` + +GetDineIn returns the DineIn field if non-nil, zero value otherwise. + +### GetDineInOk + +`func (o *SubmitOrderRequest) GetDineInOk() (*DineIn, bool)` + +GetDineInOk returns a tuple with the DineIn field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineIn + +`func (o *SubmitOrderRequest) SetDineIn(v DineIn)` + +SetDineIn sets DineIn field to given value. + +### HasDineIn + +`func (o *SubmitOrderRequest) HasDineIn() bool` + +HasDineIn returns a boolean if a field has been set. + +### GetReceiver + +`func (o *SubmitOrderRequest) GetReceiver() Receiver` + +GetReceiver returns the Receiver field if non-nil, zero value otherwise. + +### GetReceiverOk + +`func (o *SubmitOrderRequest) GetReceiverOk() (*Receiver, bool)` + +GetReceiverOk returns a tuple with the Receiver field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReceiver + +`func (o *SubmitOrderRequest) SetReceiver(v Receiver)` + +SetReceiver sets Receiver field to given value. + +### HasReceiver + +`func (o *SubmitOrderRequest) HasReceiver() bool` + +HasReceiver returns a boolean if a field has been set. + +### GetOrderReadyEstimation + +`func (o *SubmitOrderRequest) GetOrderReadyEstimation() OrderReadyEstimation` + +GetOrderReadyEstimation returns the OrderReadyEstimation field if non-nil, zero value otherwise. + +### GetOrderReadyEstimationOk + +`func (o *SubmitOrderRequest) GetOrderReadyEstimationOk() (*OrderReadyEstimation, bool)` + +GetOrderReadyEstimationOk returns a tuple with the OrderReadyEstimation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderReadyEstimation + +`func (o *SubmitOrderRequest) SetOrderReadyEstimation(v OrderReadyEstimation)` + +SetOrderReadyEstimation sets OrderReadyEstimation field to given value. + +### HasOrderReadyEstimation + +`func (o *SubmitOrderRequest) HasOrderReadyEstimation() bool` + +HasOrderReadyEstimation returns a boolean if a field has been set. + +### GetMembershipID + +`func (o *SubmitOrderRequest) GetMembershipID() string` + +GetMembershipID returns the MembershipID field if non-nil, zero value otherwise. + +### GetMembershipIDOk + +`func (o *SubmitOrderRequest) GetMembershipIDOk() (*string, bool)` + +GetMembershipIDOk returns a tuple with the MembershipID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMembershipID + +`func (o *SubmitOrderRequest) SetMembershipID(v string)` + +SetMembershipID sets MembershipID field to given value. + +### HasMembershipID + +`func (o *SubmitOrderRequest) HasMembershipID() bool` + +HasMembershipID returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/TraceMenuSyncAPI.md b/docs/TraceMenuSyncAPI.md new file mode 100644 index 0000000..a4d5973 --- /dev/null +++ b/docs/TraceMenuSyncAPI.md @@ -0,0 +1,75 @@ +# \TraceMenuSyncAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TraceMenuSync**](TraceMenuSyncAPI.md#TraceMenuSync) | **Get** /partner/v1/merchant/menu/trace | Trace menu sync + + + +## TraceMenuSync + +> MenuSyncResponse TraceMenuSync(ctx).Authorization(authorization).MerchantID(merchantID).Execute() + +Trace menu sync + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.TraceMenuSyncAPI.TraceMenuSync(context.Background()).Authorization(authorization).MerchantID(merchantID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `TraceMenuSyncAPI.TraceMenuSync``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TraceMenuSync`: MenuSyncResponse + fmt.Fprintf(os.Stdout, "Response from `TraceMenuSyncAPI.TraceMenuSync`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiTraceMenuSyncRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Return type + +[**MenuSyncResponse**](MenuSyncResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UnbindMembershipNativeRequest.md b/docs/UnbindMembershipNativeRequest.md new file mode 100644 index 0000000..3d95f6b --- /dev/null +++ b/docs/UnbindMembershipNativeRequest.md @@ -0,0 +1,51 @@ +# UnbindMembershipNativeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | **string** | The unique member ID on the partner's database. | + +## Methods + +### NewUnbindMembershipNativeRequest + +`func NewUnbindMembershipNativeRequest(memberID string, ) *UnbindMembershipNativeRequest` + +NewUnbindMembershipNativeRequest instantiates a new UnbindMembershipNativeRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUnbindMembershipNativeRequestWithDefaults + +`func NewUnbindMembershipNativeRequestWithDefaults() *UnbindMembershipNativeRequest` + +NewUnbindMembershipNativeRequestWithDefaults instantiates a new UnbindMembershipNativeRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *UnbindMembershipNativeRequest) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *UnbindMembershipNativeRequest) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *UnbindMembershipNativeRequest) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnlinkMembershipWebviewRequest.md b/docs/UnlinkMembershipWebviewRequest.md new file mode 100644 index 0000000..f33092f --- /dev/null +++ b/docs/UnlinkMembershipWebviewRequest.md @@ -0,0 +1,51 @@ +# UnlinkMembershipWebviewRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MemberID** | **string** | The unique member ID on the partner's database. | + +## Methods + +### NewUnlinkMembershipWebviewRequest + +`func NewUnlinkMembershipWebviewRequest(memberID string, ) *UnlinkMembershipWebviewRequest` + +NewUnlinkMembershipWebviewRequest instantiates a new UnlinkMembershipWebviewRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUnlinkMembershipWebviewRequestWithDefaults + +`func NewUnlinkMembershipWebviewRequestWithDefaults() *UnlinkMembershipWebviewRequest` + +NewUnlinkMembershipWebviewRequestWithDefaults instantiates a new UnlinkMembershipWebviewRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMemberID + +`func (o *UnlinkMembershipWebviewRequest) GetMemberID() string` + +GetMemberID returns the MemberID field if non-nil, zero value otherwise. + +### GetMemberIDOk + +`func (o *UnlinkMembershipWebviewRequest) GetMemberIDOk() (*string, bool)` + +GetMemberIDOk returns a tuple with the MemberID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMemberID + +`func (o *UnlinkMembershipWebviewRequest) SetMemberID(v string)` + +SetMemberID sets MemberID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateAdvancedPricing.md b/docs/UpdateAdvancedPricing.md new file mode 100644 index 0000000..8c566ed --- /dev/null +++ b/docs/UpdateAdvancedPricing.md @@ -0,0 +1,82 @@ +# UpdateAdvancedPricing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | Pointer to **string** | Available service type. | [optional] +**Price** | Pointer to **int64** | Price in minor unit. | [optional] + +## Methods + +### NewUpdateAdvancedPricing + +`func NewUpdateAdvancedPricing() *UpdateAdvancedPricing` + +NewUpdateAdvancedPricing instantiates a new UpdateAdvancedPricing object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateAdvancedPricingWithDefaults + +`func NewUpdateAdvancedPricingWithDefaults() *UpdateAdvancedPricing` + +NewUpdateAdvancedPricingWithDefaults instantiates a new UpdateAdvancedPricing object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKey + +`func (o *UpdateAdvancedPricing) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *UpdateAdvancedPricing) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *UpdateAdvancedPricing) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *UpdateAdvancedPricing) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetPrice + +`func (o *UpdateAdvancedPricing) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *UpdateAdvancedPricing) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *UpdateAdvancedPricing) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *UpdateAdvancedPricing) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateCampaignAPI.md b/docs/UpdateCampaignAPI.md new file mode 100644 index 0000000..0884c70 --- /dev/null +++ b/docs/UpdateCampaignAPI.md @@ -0,0 +1,81 @@ +# \UpdateCampaignAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateCampaign**](UpdateCampaignAPI.md#UpdateCampaign) | **Put** /partner/v1/campaigns/{campaign_id} | Update campaign + + + +## UpdateCampaign + +> UpdateCampaign(ctx, campaignId).ContentType(contentType).Authorization(authorization).UpdateCampaignRequest(updateCampaignRequest).Execute() + +Update campaign + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + campaignId := "campaignId_example" // string | + updateCampaignRequest := *grabfood.NewUpdateCampaignRequest() // UpdateCampaignRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.UpdateCampaignAPI.UpdateCampaign(context.Background(), campaignId).ContentType(contentType).Authorization(authorization).UpdateCampaignRequest(updateCampaignRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateCampaignAPI.UpdateCampaign``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**campaignId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateCampaignRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + **updateCampaignRequest** | [**UpdateCampaignRequest**](UpdateCampaignRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateCampaignRequest.md b/docs/UpdateCampaignRequest.md new file mode 100644 index 0000000..82e9af6 --- /dev/null +++ b/docs/UpdateCampaignRequest.md @@ -0,0 +1,186 @@ +# UpdateCampaignRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | Pointer to **string** | The merchant's ID that is in GrabFood's database. | [optional] +**Name** | Pointer to **string** | The campaign's name. | [optional] +**Quotas** | Pointer to [**CampaignQuotas**](CampaignQuotas.md) | | [optional] +**Conditions** | Pointer to [**CampaignConditions**](CampaignConditions.md) | | [optional] +**Discount** | Pointer to [**CampaignDiscount**](CampaignDiscount.md) | | [optional] +**CustomTag** | Pointer to **string** | Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. | [optional] + +## Methods + +### NewUpdateCampaignRequest + +`func NewUpdateCampaignRequest() *UpdateCampaignRequest` + +NewUpdateCampaignRequest instantiates a new UpdateCampaignRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateCampaignRequestWithDefaults + +`func NewUpdateCampaignRequestWithDefaults() *UpdateCampaignRequest` + +NewUpdateCampaignRequestWithDefaults instantiates a new UpdateCampaignRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *UpdateCampaignRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *UpdateCampaignRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *UpdateCampaignRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + +### HasMerchantID + +`func (o *UpdateCampaignRequest) HasMerchantID() bool` + +HasMerchantID returns a boolean if a field has been set. + +### GetName + +`func (o *UpdateCampaignRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateCampaignRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateCampaignRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *UpdateCampaignRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetQuotas + +`func (o *UpdateCampaignRequest) GetQuotas() CampaignQuotas` + +GetQuotas returns the Quotas field if non-nil, zero value otherwise. + +### GetQuotasOk + +`func (o *UpdateCampaignRequest) GetQuotasOk() (*CampaignQuotas, bool)` + +GetQuotasOk returns a tuple with the Quotas field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetQuotas + +`func (o *UpdateCampaignRequest) SetQuotas(v CampaignQuotas)` + +SetQuotas sets Quotas field to given value. + +### HasQuotas + +`func (o *UpdateCampaignRequest) HasQuotas() bool` + +HasQuotas returns a boolean if a field has been set. + +### GetConditions + +`func (o *UpdateCampaignRequest) GetConditions() CampaignConditions` + +GetConditions returns the Conditions field if non-nil, zero value otherwise. + +### GetConditionsOk + +`func (o *UpdateCampaignRequest) GetConditionsOk() (*CampaignConditions, bool)` + +GetConditionsOk returns a tuple with the Conditions field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetConditions + +`func (o *UpdateCampaignRequest) SetConditions(v CampaignConditions)` + +SetConditions sets Conditions field to given value. + +### HasConditions + +`func (o *UpdateCampaignRequest) HasConditions() bool` + +HasConditions returns a boolean if a field has been set. + +### GetDiscount + +`func (o *UpdateCampaignRequest) GetDiscount() CampaignDiscount` + +GetDiscount returns the Discount field if non-nil, zero value otherwise. + +### GetDiscountOk + +`func (o *UpdateCampaignRequest) GetDiscountOk() (*CampaignDiscount, bool)` + +GetDiscountOk returns a tuple with the Discount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscount + +`func (o *UpdateCampaignRequest) SetDiscount(v CampaignDiscount)` + +SetDiscount sets Discount field to given value. + +### HasDiscount + +`func (o *UpdateCampaignRequest) HasDiscount() bool` + +HasDiscount returns a boolean if a field has been set. + +### GetCustomTag + +`func (o *UpdateCampaignRequest) GetCustomTag() string` + +GetCustomTag returns the CustomTag field if non-nil, zero value otherwise. + +### GetCustomTagOk + +`func (o *UpdateCampaignRequest) GetCustomTagOk() (*string, bool)` + +GetCustomTagOk returns a tuple with the CustomTag field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCustomTag + +`func (o *UpdateCampaignRequest) SetCustomTag(v string)` + +SetCustomTag sets CustomTag field to given value. + +### HasCustomTag + +`func (o *UpdateCampaignRequest) HasCustomTag() bool` + +HasCustomTag returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDeliveryHourRequest.md b/docs/UpdateDeliveryHourRequest.md new file mode 100644 index 0000000..ae4e92e --- /dev/null +++ b/docs/UpdateDeliveryHourRequest.md @@ -0,0 +1,72 @@ +# UpdateDeliveryHourRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OpeningHour** | [**StoreHour**](StoreHour.md) | | +**Force** | **bool** | To enable force update store delivery hours. Error will be returned if set to false while there is ongoing order. | + +## Methods + +### NewUpdateDeliveryHourRequest + +`func NewUpdateDeliveryHourRequest(openingHour StoreHour, force bool, ) *UpdateDeliveryHourRequest` + +NewUpdateDeliveryHourRequest instantiates a new UpdateDeliveryHourRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateDeliveryHourRequestWithDefaults + +`func NewUpdateDeliveryHourRequestWithDefaults() *UpdateDeliveryHourRequest` + +NewUpdateDeliveryHourRequestWithDefaults instantiates a new UpdateDeliveryHourRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetOpeningHour + +`func (o *UpdateDeliveryHourRequest) GetOpeningHour() StoreHour` + +GetOpeningHour returns the OpeningHour field if non-nil, zero value otherwise. + +### GetOpeningHourOk + +`func (o *UpdateDeliveryHourRequest) GetOpeningHourOk() (*StoreHour, bool)` + +GetOpeningHourOk returns a tuple with the OpeningHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOpeningHour + +`func (o *UpdateDeliveryHourRequest) SetOpeningHour(v StoreHour)` + +SetOpeningHour sets OpeningHour field to given value. + + +### GetForce + +`func (o *UpdateDeliveryHourRequest) GetForce() bool` + +GetForce returns the Force field if non-nil, zero value otherwise. + +### GetForceOk + +`func (o *UpdateDeliveryHourRequest) GetForceOk() (*bool, bool)` + +GetForceOk returns a tuple with the Force field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetForce + +`func (o *UpdateDeliveryHourRequest) SetForce(v bool)` + +SetForce sets Force field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDeliveryHourResponse.md b/docs/UpdateDeliveryHourResponse.md new file mode 100644 index 0000000..0976375 --- /dev/null +++ b/docs/UpdateDeliveryHourResponse.md @@ -0,0 +1,129 @@ +# UpdateDeliveryHourResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorReasons** | Pointer to **[]string** | Error message when updating store delivery hour. `null` indicates no error. | [optional] +**OrderCount** | **int64** | Total active order for the day. | +**ScheduledOrderCount** | **int64** | Total scheduled order during store close period. | +**CloseImmediately** | **bool** | Indicate the store status after updating delivery hours. | + +## Methods + +### NewUpdateDeliveryHourResponse + +`func NewUpdateDeliveryHourResponse(orderCount int64, scheduledOrderCount int64, closeImmediately bool, ) *UpdateDeliveryHourResponse` + +NewUpdateDeliveryHourResponse instantiates a new UpdateDeliveryHourResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateDeliveryHourResponseWithDefaults + +`func NewUpdateDeliveryHourResponseWithDefaults() *UpdateDeliveryHourResponse` + +NewUpdateDeliveryHourResponseWithDefaults instantiates a new UpdateDeliveryHourResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorReasons + +`func (o *UpdateDeliveryHourResponse) GetErrorReasons() []string` + +GetErrorReasons returns the ErrorReasons field if non-nil, zero value otherwise. + +### GetErrorReasonsOk + +`func (o *UpdateDeliveryHourResponse) GetErrorReasonsOk() (*[]string, bool)` + +GetErrorReasonsOk returns a tuple with the ErrorReasons field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorReasons + +`func (o *UpdateDeliveryHourResponse) SetErrorReasons(v []string)` + +SetErrorReasons sets ErrorReasons field to given value. + +### HasErrorReasons + +`func (o *UpdateDeliveryHourResponse) HasErrorReasons() bool` + +HasErrorReasons returns a boolean if a field has been set. + +### SetErrorReasonsNil + +`func (o *UpdateDeliveryHourResponse) SetErrorReasonsNil(b bool)` + + SetErrorReasonsNil sets the value for ErrorReasons to be an explicit nil + +### UnsetErrorReasons +`func (o *UpdateDeliveryHourResponse) UnsetErrorReasons()` + +UnsetErrorReasons ensures that no value is present for ErrorReasons, not even an explicit nil +### GetOrderCount + +`func (o *UpdateDeliveryHourResponse) GetOrderCount() int64` + +GetOrderCount returns the OrderCount field if non-nil, zero value otherwise. + +### GetOrderCountOk + +`func (o *UpdateDeliveryHourResponse) GetOrderCountOk() (*int64, bool)` + +GetOrderCountOk returns a tuple with the OrderCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderCount + +`func (o *UpdateDeliveryHourResponse) SetOrderCount(v int64)` + +SetOrderCount sets OrderCount field to given value. + + +### GetScheduledOrderCount + +`func (o *UpdateDeliveryHourResponse) GetScheduledOrderCount() int64` + +GetScheduledOrderCount returns the ScheduledOrderCount field if non-nil, zero value otherwise. + +### GetScheduledOrderCountOk + +`func (o *UpdateDeliveryHourResponse) GetScheduledOrderCountOk() (*int64, bool)` + +GetScheduledOrderCountOk returns a tuple with the ScheduledOrderCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduledOrderCount + +`func (o *UpdateDeliveryHourResponse) SetScheduledOrderCount(v int64)` + +SetScheduledOrderCount sets ScheduledOrderCount field to given value. + + +### GetCloseImmediately + +`func (o *UpdateDeliveryHourResponse) GetCloseImmediately() bool` + +GetCloseImmediately returns the CloseImmediately field if non-nil, zero value otherwise. + +### GetCloseImmediatelyOk + +`func (o *UpdateDeliveryHourResponse) GetCloseImmediatelyOk() (*bool, bool)` + +GetCloseImmediatelyOk returns a tuple with the CloseImmediately field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloseImmediately + +`func (o *UpdateDeliveryHourResponse) SetCloseImmediately(v bool)` + +SetCloseImmediately sets CloseImmediately field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDeliveryStateAPI.md b/docs/UpdateDeliveryStateAPI.md new file mode 100644 index 0000000..31e388f --- /dev/null +++ b/docs/UpdateDeliveryStateAPI.md @@ -0,0 +1,75 @@ +# \UpdateDeliveryStateAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateDeliveryState**](UpdateDeliveryStateAPI.md#UpdateDeliveryState) | **Post** /partner/v1/order/delivery | Update delivery state + + + +## UpdateDeliveryState + +> UpdateDeliveryState(ctx).ContentType(contentType).Authorization(authorization).OrderDeliveryRequest(orderDeliveryRequest).Execute() + +Update delivery state + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + orderDeliveryRequest := *grabfood.NewOrderDeliveryRequest("123-CYNKLPCVRN5", "Collect", "Delivered") // OrderDeliveryRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.UpdateDeliveryStateAPI.UpdateDeliveryState(context.Background()).ContentType(contentType).Authorization(authorization).OrderDeliveryRequest(orderDeliveryRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateDeliveryStateAPI.UpdateDeliveryState``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateDeliveryStateRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **orderDeliveryRequest** | [**OrderDeliveryRequest**](OrderDeliveryRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateDineInHourRequest.md b/docs/UpdateDineInHourRequest.md new file mode 100644 index 0000000..266cee4 --- /dev/null +++ b/docs/UpdateDineInHourRequest.md @@ -0,0 +1,51 @@ +# UpdateDineInHourRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DineInHour** | [**StoreHour**](StoreHour.md) | | + +## Methods + +### NewUpdateDineInHourRequest + +`func NewUpdateDineInHourRequest(dineInHour StoreHour, ) *UpdateDineInHourRequest` + +NewUpdateDineInHourRequest instantiates a new UpdateDineInHourRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateDineInHourRequestWithDefaults + +`func NewUpdateDineInHourRequestWithDefaults() *UpdateDineInHourRequest` + +NewUpdateDineInHourRequestWithDefaults instantiates a new UpdateDineInHourRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetDineInHour + +`func (o *UpdateDineInHourRequest) GetDineInHour() StoreHour` + +GetDineInHour returns the DineInHour field if non-nil, zero value otherwise. + +### GetDineInHourOk + +`func (o *UpdateDineInHourRequest) GetDineInHourOk() (*StoreHour, bool)` + +GetDineInHourOk returns a tuple with the DineInHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDineInHour + +`func (o *UpdateDineInHourRequest) SetDineInHour(v StoreHour)` + +SetDineInHour sets DineInHour field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateDineInHourResponse.md b/docs/UpdateDineInHourResponse.md new file mode 100644 index 0000000..11e4476 --- /dev/null +++ b/docs/UpdateDineInHourResponse.md @@ -0,0 +1,66 @@ +# UpdateDineInHourResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorReasons** | Pointer to **[]string** | Error message when updating store dine-in hour. `null` indicates no error. | [optional] + +## Methods + +### NewUpdateDineInHourResponse + +`func NewUpdateDineInHourResponse() *UpdateDineInHourResponse` + +NewUpdateDineInHourResponse instantiates a new UpdateDineInHourResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateDineInHourResponseWithDefaults + +`func NewUpdateDineInHourResponseWithDefaults() *UpdateDineInHourResponse` + +NewUpdateDineInHourResponseWithDefaults instantiates a new UpdateDineInHourResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorReasons + +`func (o *UpdateDineInHourResponse) GetErrorReasons() []string` + +GetErrorReasons returns the ErrorReasons field if non-nil, zero value otherwise. + +### GetErrorReasonsOk + +`func (o *UpdateDineInHourResponse) GetErrorReasonsOk() (*[]string, bool)` + +GetErrorReasonsOk returns a tuple with the ErrorReasons field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorReasons + +`func (o *UpdateDineInHourResponse) SetErrorReasons(v []string)` + +SetErrorReasons sets ErrorReasons field to given value. + +### HasErrorReasons + +`func (o *UpdateDineInHourResponse) HasErrorReasons() bool` + +HasErrorReasons returns a boolean if a field has been set. + +### SetErrorReasonsNil + +`func (o *UpdateDineInHourResponse) SetErrorReasonsNil(b bool)` + + SetErrorReasonsNil sets the value for ErrorReasons to be an explicit nil + +### UnsetErrorReasons +`func (o *UpdateDineInHourResponse) UnsetErrorReasons()` + +UnsetErrorReasons ensures that no value is present for ErrorReasons, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateMenuItem.md b/docs/UpdateMenuItem.md new file mode 100644 index 0000000..02cb606 --- /dev/null +++ b/docs/UpdateMenuItem.md @@ -0,0 +1,223 @@ +# UpdateMenuItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Field** | **string** | The record type that you want to update. | +**Id** | **string** | The record's ID on the partner system. For example, the item id in case type is ITEM. | +**Price** | Pointer to **int64** | The record's price in minor unit format. | [optional] +**AvailableStatus** | Pointer to **string** | The record's availableStatus. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. | [optional] +**MaxStock** | Pointer to **int64** | Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. | [optional] +**AdvancedPricings** | Pointer to [**[]UpdateAdvancedPricing**](UpdateAdvancedPricing.md) | Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. | [optional] +**Purchasabilities** | Pointer to [**[]UpdatePurchasability**](UpdatePurchasability.md) | Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. | [optional] + +## Methods + +### NewUpdateMenuItem + +`func NewUpdateMenuItem(merchantID string, field string, id string, ) *UpdateMenuItem` + +NewUpdateMenuItem instantiates a new UpdateMenuItem object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateMenuItemWithDefaults + +`func NewUpdateMenuItemWithDefaults() *UpdateMenuItem` + +NewUpdateMenuItemWithDefaults instantiates a new UpdateMenuItem object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *UpdateMenuItem) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *UpdateMenuItem) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *UpdateMenuItem) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetField + +`func (o *UpdateMenuItem) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *UpdateMenuItem) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *UpdateMenuItem) SetField(v string)` + +SetField sets Field field to given value. + + +### GetId + +`func (o *UpdateMenuItem) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UpdateMenuItem) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UpdateMenuItem) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPrice + +`func (o *UpdateMenuItem) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *UpdateMenuItem) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *UpdateMenuItem) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *UpdateMenuItem) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *UpdateMenuItem) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *UpdateMenuItem) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *UpdateMenuItem) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + +### HasAvailableStatus + +`func (o *UpdateMenuItem) HasAvailableStatus() bool` + +HasAvailableStatus returns a boolean if a field has been set. + +### GetMaxStock + +`func (o *UpdateMenuItem) GetMaxStock() int64` + +GetMaxStock returns the MaxStock field if non-nil, zero value otherwise. + +### GetMaxStockOk + +`func (o *UpdateMenuItem) GetMaxStockOk() (*int64, bool)` + +GetMaxStockOk returns a tuple with the MaxStock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxStock + +`func (o *UpdateMenuItem) SetMaxStock(v int64)` + +SetMaxStock sets MaxStock field to given value. + +### HasMaxStock + +`func (o *UpdateMenuItem) HasMaxStock() bool` + +HasMaxStock returns a boolean if a field has been set. + +### GetAdvancedPricings + +`func (o *UpdateMenuItem) GetAdvancedPricings() []UpdateAdvancedPricing` + +GetAdvancedPricings returns the AdvancedPricings field if non-nil, zero value otherwise. + +### GetAdvancedPricingsOk + +`func (o *UpdateMenuItem) GetAdvancedPricingsOk() (*[]UpdateAdvancedPricing, bool)` + +GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricings + +`func (o *UpdateMenuItem) SetAdvancedPricings(v []UpdateAdvancedPricing)` + +SetAdvancedPricings sets AdvancedPricings field to given value. + +### HasAdvancedPricings + +`func (o *UpdateMenuItem) HasAdvancedPricings() bool` + +HasAdvancedPricings returns a boolean if a field has been set. + +### GetPurchasabilities + +`func (o *UpdateMenuItem) GetPurchasabilities() []UpdatePurchasability` + +GetPurchasabilities returns the Purchasabilities field if non-nil, zero value otherwise. + +### GetPurchasabilitiesOk + +`func (o *UpdateMenuItem) GetPurchasabilitiesOk() (*[]UpdatePurchasability, bool)` + +GetPurchasabilitiesOk returns a tuple with the Purchasabilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasabilities + +`func (o *UpdateMenuItem) SetPurchasabilities(v []UpdatePurchasability)` + +SetPurchasabilities sets Purchasabilities field to given value. + +### HasPurchasabilities + +`func (o *UpdateMenuItem) HasPurchasabilities() bool` + +HasPurchasabilities returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateMenuModifier.md b/docs/UpdateMenuModifier.md new file mode 100644 index 0000000..d820f36 --- /dev/null +++ b/docs/UpdateMenuModifier.md @@ -0,0 +1,218 @@ +# UpdateMenuModifier + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Field** | **string** | The record type that you want to update. | +**Id** | **string** | The record's ID on the partner system. For example, the modifier id in case type is MODIFIER. | +**Price** | Pointer to **int64** | The record's price in minor unit format. | [optional] +**Name** | **string** | **Only required when updating modifiers.** The record's name. Used as identifier to locate the correct record. | +**AvailableStatus** | Pointer to **string** | The record's availableStatus. | [optional] +**IsFree** | Pointer to **bool** | Allows the modifier's price to be explicitly set as zero. Possible values are as follows: * `isFree` && `price == 0` sets the modifier's price to zero. * `isFree` && `price > 0` returns an error message that \"price cannot be set to > 0, if modifier is free”. * `!isFree` && `price > 0` sets the modifier's price to the defined price. * `!isFree` && `price == 0` does not update the modifier's price and reuses the existing price. | [optional] +**AdvancedPricings** | Pointer to [**[]UpdateAdvancedPricing**](UpdateAdvancedPricing.md) | Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. | [optional] + +## Methods + +### NewUpdateMenuModifier + +`func NewUpdateMenuModifier(merchantID string, field string, id string, name string, ) *UpdateMenuModifier` + +NewUpdateMenuModifier instantiates a new UpdateMenuModifier object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateMenuModifierWithDefaults + +`func NewUpdateMenuModifierWithDefaults() *UpdateMenuModifier` + +NewUpdateMenuModifierWithDefaults instantiates a new UpdateMenuModifier object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *UpdateMenuModifier) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *UpdateMenuModifier) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *UpdateMenuModifier) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetField + +`func (o *UpdateMenuModifier) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *UpdateMenuModifier) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *UpdateMenuModifier) SetField(v string)` + +SetField sets Field field to given value. + + +### GetId + +`func (o *UpdateMenuModifier) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UpdateMenuModifier) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UpdateMenuModifier) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPrice + +`func (o *UpdateMenuModifier) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *UpdateMenuModifier) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *UpdateMenuModifier) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *UpdateMenuModifier) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetName + +`func (o *UpdateMenuModifier) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateMenuModifier) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateMenuModifier) SetName(v string)` + +SetName sets Name field to given value. + + +### GetAvailableStatus + +`func (o *UpdateMenuModifier) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *UpdateMenuModifier) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *UpdateMenuModifier) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + +### HasAvailableStatus + +`func (o *UpdateMenuModifier) HasAvailableStatus() bool` + +HasAvailableStatus returns a boolean if a field has been set. + +### GetIsFree + +`func (o *UpdateMenuModifier) GetIsFree() bool` + +GetIsFree returns the IsFree field if non-nil, zero value otherwise. + +### GetIsFreeOk + +`func (o *UpdateMenuModifier) GetIsFreeOk() (*bool, bool)` + +GetIsFreeOk returns a tuple with the IsFree field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsFree + +`func (o *UpdateMenuModifier) SetIsFree(v bool)` + +SetIsFree sets IsFree field to given value. + +### HasIsFree + +`func (o *UpdateMenuModifier) HasIsFree() bool` + +HasIsFree returns a boolean if a field has been set. + +### GetAdvancedPricings + +`func (o *UpdateMenuModifier) GetAdvancedPricings() []UpdateAdvancedPricing` + +GetAdvancedPricings returns the AdvancedPricings field if non-nil, zero value otherwise. + +### GetAdvancedPricingsOk + +`func (o *UpdateMenuModifier) GetAdvancedPricingsOk() (*[]UpdateAdvancedPricing, bool)` + +GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricings + +`func (o *UpdateMenuModifier) SetAdvancedPricings(v []UpdateAdvancedPricing)` + +SetAdvancedPricings sets AdvancedPricings field to given value. + +### HasAdvancedPricings + +`func (o *UpdateMenuModifier) HasAdvancedPricings() bool` + +HasAdvancedPricings returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateMenuNotifRequest.md b/docs/UpdateMenuNotifRequest.md new file mode 100644 index 0000000..41accb6 --- /dev/null +++ b/docs/UpdateMenuNotifRequest.md @@ -0,0 +1,51 @@ +# UpdateMenuNotifRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +## Methods + +### NewUpdateMenuNotifRequest + +`func NewUpdateMenuNotifRequest(merchantID string, ) *UpdateMenuNotifRequest` + +NewUpdateMenuNotifRequest instantiates a new UpdateMenuNotifRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateMenuNotifRequestWithDefaults + +`func NewUpdateMenuNotifRequestWithDefaults() *UpdateMenuNotifRequest` + +NewUpdateMenuNotifRequestWithDefaults instantiates a new UpdateMenuNotifRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *UpdateMenuNotifRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *UpdateMenuNotifRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *UpdateMenuNotifRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateMenuNotificationAPI.md b/docs/UpdateMenuNotificationAPI.md new file mode 100644 index 0000000..647c4bb --- /dev/null +++ b/docs/UpdateMenuNotificationAPI.md @@ -0,0 +1,75 @@ +# \UpdateMenuNotificationAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateMenuNotification**](UpdateMenuNotificationAPI.md#UpdateMenuNotification) | **Post** /partner/v1/merchant/menu/notification | Notify Grab of updated menu + + + +## UpdateMenuNotification + +> UpdateMenuNotification(ctx).ContentType(contentType).Authorization(authorization).UpdateMenuNotifRequest(updateMenuNotifRequest).Execute() + +Notify Grab of updated menu + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + updateMenuNotifRequest := *grabfood.NewUpdateMenuNotifRequest("1-CYNGRUNGSBCCC") // UpdateMenuNotifRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.UpdateMenuNotificationAPI.UpdateMenuNotification(context.Background()).ContentType(contentType).Authorization(authorization).UpdateMenuNotifRequest(updateMenuNotifRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateMenuNotificationAPI.UpdateMenuNotification``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateMenuNotificationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **updateMenuNotifRequest** | [**UpdateMenuNotifRequest**](UpdateMenuNotifRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateMenuRecordAPI.md b/docs/UpdateMenuRecordAPI.md new file mode 100644 index 0000000..1d1a697 --- /dev/null +++ b/docs/UpdateMenuRecordAPI.md @@ -0,0 +1,144 @@ +# \UpdateMenuRecordAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**BatchUpdateMenu**](UpdateMenuRecordAPI.md#BatchUpdateMenu) | **Put** /partner/v1/batch/menu | Batch Update Menu +[**UpdateMenu**](UpdateMenuRecordAPI.md#UpdateMenu) | **Put** /partner/v1/menu | Update menu record + + + +## BatchUpdateMenu + +> BatchUpdateMenuResponse BatchUpdateMenu(ctx).ContentType(contentType).Authorization(authorization).BatchUpdateMenuItem(batchUpdateMenuItem).Execute() + +Batch Update Menu + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + batchUpdateMenuItem := *grabfood.NewBatchUpdateMenuItem("1-CYNGRUNGSBCCC", "ITEM") // BatchUpdateMenuItem | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.UpdateMenuRecordAPI.BatchUpdateMenu(context.Background()).ContentType(contentType).Authorization(authorization).BatchUpdateMenuItem(batchUpdateMenuItem).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateMenuRecordAPI.BatchUpdateMenu``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BatchUpdateMenu`: BatchUpdateMenuResponse + fmt.Fprintf(os.Stdout, "Response from `UpdateMenuRecordAPI.BatchUpdateMenu`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiBatchUpdateMenuRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **batchUpdateMenuItem** | [**BatchUpdateMenuItem**](BatchUpdateMenuItem.md) | | + +### Return type + +[**BatchUpdateMenuResponse**](BatchUpdateMenuResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateMenu + +> UpdateMenu(ctx).ContentType(contentType).Authorization(authorization).UpdateMenuRequest(updateMenuRequest).Execute() + +Update menu record + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + updateMenuRequest := grabfood.update_menu_request{UpdateMenuItem: grabfood.NewUpdateMenuItem("1-CYNGRUNGSBCCC", "ITEM", "ITEM-1")} // UpdateMenuRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.UpdateMenuRecordAPI.UpdateMenu(context.Background()).ContentType(contentType).Authorization(authorization).UpdateMenuRequest(updateMenuRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateMenuRecordAPI.UpdateMenu``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateMenuRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **updateMenuRequest** | [**UpdateMenuRequest**](UpdateMenuRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateMenuRequest.md b/docs/UpdateMenuRequest.md new file mode 100644 index 0000000..43406a4 --- /dev/null +++ b/docs/UpdateMenuRequest.md @@ -0,0 +1,270 @@ +# UpdateMenuRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MerchantID** | **string** | The merchant's ID that is in GrabFood's database. | +**Field** | **string** | The record type that you want to update. | +**Id** | **string** | The record's ID on the partner system. For example, the modifier id in case type is MODIFIER. | +**Price** | Pointer to **int64** | The record's price in minor unit format. | [optional] +**AvailableStatus** | Pointer to **string** | The record's availableStatus. | [optional] +**MaxStock** | Pointer to **int64** | Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. | [optional] +**AdvancedPricings** | Pointer to [**[]UpdateAdvancedPricing**](UpdateAdvancedPricing.md) | Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. | [optional] +**Purchasabilities** | Pointer to [**[]UpdatePurchasability**](UpdatePurchasability.md) | Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. | [optional] +**Name** | **string** | **Only required when updating modifiers.** The record's name. Used as identifier to locate the correct record. | +**IsFree** | Pointer to **bool** | Allows the modifier's price to be explicitly set as zero. Possible values are as follows: * `isFree` && `price == 0` sets the modifier's price to zero. * `isFree` && `price > 0` returns an error message that \"price cannot be set to > 0, if modifier is free”. * `!isFree` && `price > 0` sets the modifier's price to the defined price. * `!isFree` && `price == 0` does not update the modifier's price and reuses the existing price. | [optional] + +## Methods + +### NewUpdateMenuRequest + +`func NewUpdateMenuRequest(merchantID string, field string, id string, name string, ) *UpdateMenuRequest` + +NewUpdateMenuRequest instantiates a new UpdateMenuRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateMenuRequestWithDefaults + +`func NewUpdateMenuRequestWithDefaults() *UpdateMenuRequest` + +NewUpdateMenuRequestWithDefaults instantiates a new UpdateMenuRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetMerchantID + +`func (o *UpdateMenuRequest) GetMerchantID() string` + +GetMerchantID returns the MerchantID field if non-nil, zero value otherwise. + +### GetMerchantIDOk + +`func (o *UpdateMenuRequest) GetMerchantIDOk() (*string, bool)` + +GetMerchantIDOk returns a tuple with the MerchantID field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMerchantID + +`func (o *UpdateMenuRequest) SetMerchantID(v string)` + +SetMerchantID sets MerchantID field to given value. + + +### GetField + +`func (o *UpdateMenuRequest) GetField() string` + +GetField returns the Field field if non-nil, zero value otherwise. + +### GetFieldOk + +`func (o *UpdateMenuRequest) GetFieldOk() (*string, bool)` + +GetFieldOk returns a tuple with the Field field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetField + +`func (o *UpdateMenuRequest) SetField(v string)` + +SetField sets Field field to given value. + + +### GetId + +`func (o *UpdateMenuRequest) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *UpdateMenuRequest) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *UpdateMenuRequest) SetId(v string)` + +SetId sets Id field to given value. + + +### GetPrice + +`func (o *UpdateMenuRequest) GetPrice() int64` + +GetPrice returns the Price field if non-nil, zero value otherwise. + +### GetPriceOk + +`func (o *UpdateMenuRequest) GetPriceOk() (*int64, bool)` + +GetPriceOk returns a tuple with the Price field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPrice + +`func (o *UpdateMenuRequest) SetPrice(v int64)` + +SetPrice sets Price field to given value. + +### HasPrice + +`func (o *UpdateMenuRequest) HasPrice() bool` + +HasPrice returns a boolean if a field has been set. + +### GetAvailableStatus + +`func (o *UpdateMenuRequest) GetAvailableStatus() string` + +GetAvailableStatus returns the AvailableStatus field if non-nil, zero value otherwise. + +### GetAvailableStatusOk + +`func (o *UpdateMenuRequest) GetAvailableStatusOk() (*string, bool)` + +GetAvailableStatusOk returns a tuple with the AvailableStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAvailableStatus + +`func (o *UpdateMenuRequest) SetAvailableStatus(v string)` + +SetAvailableStatus sets AvailableStatus field to given value. + +### HasAvailableStatus + +`func (o *UpdateMenuRequest) HasAvailableStatus() bool` + +HasAvailableStatus returns a boolean if a field has been set. + +### GetMaxStock + +`func (o *UpdateMenuRequest) GetMaxStock() int64` + +GetMaxStock returns the MaxStock field if non-nil, zero value otherwise. + +### GetMaxStockOk + +`func (o *UpdateMenuRequest) GetMaxStockOk() (*int64, bool)` + +GetMaxStockOk returns a tuple with the MaxStock field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMaxStock + +`func (o *UpdateMenuRequest) SetMaxStock(v int64)` + +SetMaxStock sets MaxStock field to given value. + +### HasMaxStock + +`func (o *UpdateMenuRequest) HasMaxStock() bool` + +HasMaxStock returns a boolean if a field has been set. + +### GetAdvancedPricings + +`func (o *UpdateMenuRequest) GetAdvancedPricings() []UpdateAdvancedPricing` + +GetAdvancedPricings returns the AdvancedPricings field if non-nil, zero value otherwise. + +### GetAdvancedPricingsOk + +`func (o *UpdateMenuRequest) GetAdvancedPricingsOk() (*[]UpdateAdvancedPricing, bool)` + +GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAdvancedPricings + +`func (o *UpdateMenuRequest) SetAdvancedPricings(v []UpdateAdvancedPricing)` + +SetAdvancedPricings sets AdvancedPricings field to given value. + +### HasAdvancedPricings + +`func (o *UpdateMenuRequest) HasAdvancedPricings() bool` + +HasAdvancedPricings returns a boolean if a field has been set. + +### GetPurchasabilities + +`func (o *UpdateMenuRequest) GetPurchasabilities() []UpdatePurchasability` + +GetPurchasabilities returns the Purchasabilities field if non-nil, zero value otherwise. + +### GetPurchasabilitiesOk + +`func (o *UpdateMenuRequest) GetPurchasabilitiesOk() (*[]UpdatePurchasability, bool)` + +GetPurchasabilitiesOk returns a tuple with the Purchasabilities field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasabilities + +`func (o *UpdateMenuRequest) SetPurchasabilities(v []UpdatePurchasability)` + +SetPurchasabilities sets Purchasabilities field to given value. + +### HasPurchasabilities + +`func (o *UpdateMenuRequest) HasPurchasabilities() bool` + +HasPurchasabilities returns a boolean if a field has been set. + +### GetName + +`func (o *UpdateMenuRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *UpdateMenuRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *UpdateMenuRequest) SetName(v string)` + +SetName sets Name field to given value. + + +### GetIsFree + +`func (o *UpdateMenuRequest) GetIsFree() bool` + +GetIsFree returns the IsFree field if non-nil, zero value otherwise. + +### GetIsFreeOk + +`func (o *UpdateMenuRequest) GetIsFreeOk() (*bool, bool)` + +GetIsFreeOk returns a tuple with the IsFree field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIsFree + +`func (o *UpdateMenuRequest) SetIsFree(v bool)` + +SetIsFree sets IsFree field to given value. + +### HasIsFree + +`func (o *UpdateMenuRequest) HasIsFree() bool` + +HasIsFree returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateOrderReadyTimeAPI.md b/docs/UpdateOrderReadyTimeAPI.md new file mode 100644 index 0000000..e61142e --- /dev/null +++ b/docs/UpdateOrderReadyTimeAPI.md @@ -0,0 +1,76 @@ +# \UpdateOrderReadyTimeAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateOrderReadyTime**](UpdateOrderReadyTimeAPI.md#UpdateOrderReadyTime) | **Put** /partner/v1/order/readytime | Update new order ready time + + + +## UpdateOrderReadyTime + +> UpdateOrderReadyTime(ctx).ContentType(contentType).Authorization(authorization).NewOrderTimeRequest(newOrderTimeRequest).Execute() + +Update new order ready time + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + "time" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + newOrderTimeRequest := *grabfood.NewNewOrderTimeRequest("123-CYNKLPCVRN5", time.Now()) // NewOrderTimeRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + r, err := apiClient.UpdateOrderReadyTimeAPI.UpdateOrderReadyTime(context.Background()).ContentType(contentType).Authorization(authorization).NewOrderTimeRequest(newOrderTimeRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateOrderReadyTimeAPI.UpdateOrderReadyTime``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateOrderReadyTimeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + **newOrderTimeRequest** | [**NewOrderTimeRequest**](NewOrderTimeRequest.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdatePurchasability.md b/docs/UpdatePurchasability.md new file mode 100644 index 0000000..2f487e1 --- /dev/null +++ b/docs/UpdatePurchasability.md @@ -0,0 +1,82 @@ +# UpdatePurchasability + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Key** | Pointer to **string** | Available service type. | [optional] +**Purchasable** | Pointer to **bool** | | [optional] + +## Methods + +### NewUpdatePurchasability + +`func NewUpdatePurchasability() *UpdatePurchasability` + +NewUpdatePurchasability instantiates a new UpdatePurchasability object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdatePurchasabilityWithDefaults + +`func NewUpdatePurchasabilityWithDefaults() *UpdatePurchasability` + +NewUpdatePurchasabilityWithDefaults instantiates a new UpdatePurchasability object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetKey + +`func (o *UpdatePurchasability) GetKey() string` + +GetKey returns the Key field if non-nil, zero value otherwise. + +### GetKeyOk + +`func (o *UpdatePurchasability) GetKeyOk() (*string, bool)` + +GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetKey + +`func (o *UpdatePurchasability) SetKey(v string)` + +SetKey sets Key field to given value. + +### HasKey + +`func (o *UpdatePurchasability) HasKey() bool` + +HasKey returns a boolean if a field has been set. + +### GetPurchasable + +`func (o *UpdatePurchasability) GetPurchasable() bool` + +GetPurchasable returns the Purchasable field if non-nil, zero value otherwise. + +### GetPurchasableOk + +`func (o *UpdatePurchasability) GetPurchasableOk() (*bool, bool)` + +GetPurchasableOk returns a tuple with the Purchasable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPurchasable + +`func (o *UpdatePurchasability) SetPurchasable(v bool)` + +SetPurchasable sets Purchasable field to given value. + +### HasPurchasable + +`func (o *UpdatePurchasability) HasPurchasable() bool` + +HasPurchasable returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateSpecialHourRequest.md b/docs/UpdateSpecialHourRequest.md new file mode 100644 index 0000000..bc2cc9d --- /dev/null +++ b/docs/UpdateSpecialHourRequest.md @@ -0,0 +1,51 @@ +# UpdateSpecialHourRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialOpeningHours** | [**[]SpecialOpeningHour**](SpecialOpeningHour.md) | An array of objects contain store special hours. Max. 3 array elements. | + +## Methods + +### NewUpdateSpecialHourRequest + +`func NewUpdateSpecialHourRequest(specialOpeningHours []SpecialOpeningHour, ) *UpdateSpecialHourRequest` + +NewUpdateSpecialHourRequest instantiates a new UpdateSpecialHourRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateSpecialHourRequestWithDefaults + +`func NewUpdateSpecialHourRequestWithDefaults() *UpdateSpecialHourRequest` + +NewUpdateSpecialHourRequestWithDefaults instantiates a new UpdateSpecialHourRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSpecialOpeningHours + +`func (o *UpdateSpecialHourRequest) GetSpecialOpeningHours() []SpecialOpeningHour` + +GetSpecialOpeningHours returns the SpecialOpeningHours field if non-nil, zero value otherwise. + +### GetSpecialOpeningHoursOk + +`func (o *UpdateSpecialHourRequest) GetSpecialOpeningHoursOk() (*[]SpecialOpeningHour, bool)` + +GetSpecialOpeningHoursOk returns a tuple with the SpecialOpeningHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSpecialOpeningHours + +`func (o *UpdateSpecialHourRequest) SetSpecialOpeningHours(v []SpecialOpeningHour)` + +SetSpecialOpeningHours sets SpecialOpeningHours field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateSpecialHourResponse.md b/docs/UpdateSpecialHourResponse.md new file mode 100644 index 0000000..060fba3 --- /dev/null +++ b/docs/UpdateSpecialHourResponse.md @@ -0,0 +1,129 @@ +# UpdateSpecialHourResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorReasons** | Pointer to **[]string** | Error message when updating store delivery hour. `null` indicates no error. | [optional] +**OrderCount** | **int64** | Total active order for the day. | +**ScheduledOrderCount** | **int64** | Total scheduled order during store close period. | +**CloseImmediately** | **bool** | Indicate the store status after updating special hours. | + +## Methods + +### NewUpdateSpecialHourResponse + +`func NewUpdateSpecialHourResponse(orderCount int64, scheduledOrderCount int64, closeImmediately bool, ) *UpdateSpecialHourResponse` + +NewUpdateSpecialHourResponse instantiates a new UpdateSpecialHourResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUpdateSpecialHourResponseWithDefaults + +`func NewUpdateSpecialHourResponseWithDefaults() *UpdateSpecialHourResponse` + +NewUpdateSpecialHourResponseWithDefaults instantiates a new UpdateSpecialHourResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrorReasons + +`func (o *UpdateSpecialHourResponse) GetErrorReasons() []string` + +GetErrorReasons returns the ErrorReasons field if non-nil, zero value otherwise. + +### GetErrorReasonsOk + +`func (o *UpdateSpecialHourResponse) GetErrorReasonsOk() (*[]string, bool)` + +GetErrorReasonsOk returns a tuple with the ErrorReasons field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrorReasons + +`func (o *UpdateSpecialHourResponse) SetErrorReasons(v []string)` + +SetErrorReasons sets ErrorReasons field to given value. + +### HasErrorReasons + +`func (o *UpdateSpecialHourResponse) HasErrorReasons() bool` + +HasErrorReasons returns a boolean if a field has been set. + +### SetErrorReasonsNil + +`func (o *UpdateSpecialHourResponse) SetErrorReasonsNil(b bool)` + + SetErrorReasonsNil sets the value for ErrorReasons to be an explicit nil + +### UnsetErrorReasons +`func (o *UpdateSpecialHourResponse) UnsetErrorReasons()` + +UnsetErrorReasons ensures that no value is present for ErrorReasons, not even an explicit nil +### GetOrderCount + +`func (o *UpdateSpecialHourResponse) GetOrderCount() int64` + +GetOrderCount returns the OrderCount field if non-nil, zero value otherwise. + +### GetOrderCountOk + +`func (o *UpdateSpecialHourResponse) GetOrderCountOk() (*int64, bool)` + +GetOrderCountOk returns a tuple with the OrderCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrderCount + +`func (o *UpdateSpecialHourResponse) SetOrderCount(v int64)` + +SetOrderCount sets OrderCount field to given value. + + +### GetScheduledOrderCount + +`func (o *UpdateSpecialHourResponse) GetScheduledOrderCount() int64` + +GetScheduledOrderCount returns the ScheduledOrderCount field if non-nil, zero value otherwise. + +### GetScheduledOrderCountOk + +`func (o *UpdateSpecialHourResponse) GetScheduledOrderCountOk() (*int64, bool)` + +GetScheduledOrderCountOk returns a tuple with the ScheduledOrderCount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetScheduledOrderCount + +`func (o *UpdateSpecialHourResponse) SetScheduledOrderCount(v int64)` + +SetScheduledOrderCount sets ScheduledOrderCount field to given value. + + +### GetCloseImmediately + +`func (o *UpdateSpecialHourResponse) GetCloseImmediately() bool` + +GetCloseImmediately returns the CloseImmediately field if non-nil, zero value otherwise. + +### GetCloseImmediatelyOk + +`func (o *UpdateSpecialHourResponse) GetCloseImmediatelyOk() (*bool, bool)` + +GetCloseImmediatelyOk returns a tuple with the CloseImmediately field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCloseImmediately + +`func (o *UpdateSpecialHourResponse) SetCloseImmediately(v bool)` + +SetCloseImmediately sets CloseImmediately field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UpdateStoreDeliveryHourAPI.md b/docs/UpdateStoreDeliveryHourAPI.md new file mode 100644 index 0000000..a7909b8 --- /dev/null +++ b/docs/UpdateStoreDeliveryHourAPI.md @@ -0,0 +1,83 @@ +# \UpdateStoreDeliveryHourAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateStoreDeliveryHour**](UpdateStoreDeliveryHourAPI.md#UpdateStoreDeliveryHour) | **Put** /partner/v1/merchants/{merchantID}/store/opening-hours | Update Store Delivery Hours + + + +## UpdateStoreDeliveryHour + +> UpdateDeliveryHourResponse UpdateStoreDeliveryHour(ctx, merchantID).ContentType(contentType).Authorization(authorization).UpdateDeliveryHourRequest(updateDeliveryHourRequest).Execute() + +Update Store Delivery Hours + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + updateDeliveryHourRequest := *grabfood.NewUpdateDeliveryHourRequest(*grabfood.NewStoreHour([]grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}), false) // UpdateDeliveryHourRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.UpdateStoreDeliveryHourAPI.UpdateStoreDeliveryHour(context.Background(), merchantID).ContentType(contentType).Authorization(authorization).UpdateDeliveryHourRequest(updateDeliveryHourRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateStoreDeliveryHourAPI.UpdateStoreDeliveryHour``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateStoreDeliveryHour`: UpdateDeliveryHourResponse + fmt.Fprintf(os.Stdout, "Response from `UpdateStoreDeliveryHourAPI.UpdateStoreDeliveryHour`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateStoreDeliveryHourRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + **updateDeliveryHourRequest** | [**UpdateDeliveryHourRequest**](UpdateDeliveryHourRequest.md) | | + +### Return type + +[**UpdateDeliveryHourResponse**](UpdateDeliveryHourResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateStoreDineInHourAPI.md b/docs/UpdateStoreDineInHourAPI.md new file mode 100644 index 0000000..4611886 --- /dev/null +++ b/docs/UpdateStoreDineInHourAPI.md @@ -0,0 +1,83 @@ +# \UpdateStoreDineInHourAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateStoreDineInHour**](UpdateStoreDineInHourAPI.md#UpdateStoreDineInHour) | **Put** /partner/v1/merchants/{merchantID}/store/dine-in-hours | Update Store Dine-in Hours + + + +## UpdateStoreDineInHour + +> UpdateDineInHourResponse UpdateStoreDineInHour(ctx, merchantID).ContentType(contentType).Authorization(authorization).UpdateDineInHourRequest(updateDineInHourRequest).Execute() + +Update Store Dine-in Hours + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + updateDineInHourRequest := *grabfood.NewUpdateDineInHourRequest(*grabfood.NewStoreHour([]grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")}, []grabfood.OpenPeriod{*grabfood.NewOpenPeriod("11:30", "21:30")})) // UpdateDineInHourRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.UpdateStoreDineInHourAPI.UpdateStoreDineInHour(context.Background(), merchantID).ContentType(contentType).Authorization(authorization).UpdateDineInHourRequest(updateDineInHourRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateStoreDineInHourAPI.UpdateStoreDineInHour``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateStoreDineInHour`: UpdateDineInHourResponse + fmt.Fprintf(os.Stdout, "Response from `UpdateStoreDineInHourAPI.UpdateStoreDineInHour`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateStoreDineInHourRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + **updateDineInHourRequest** | [**UpdateDineInHourRequest**](UpdateDineInHourRequest.md) | | + +### Return type + +[**UpdateDineInHourResponse**](UpdateDineInHourResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/UpdateStoreSpecialHourAPI.md b/docs/UpdateStoreSpecialHourAPI.md new file mode 100644 index 0000000..12d27df --- /dev/null +++ b/docs/UpdateStoreSpecialHourAPI.md @@ -0,0 +1,83 @@ +# \UpdateStoreSpecialHourAPI + +All URIs are relative to *https://partner-api.stg-myteksi.com/grabfood-sandbox* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**UpdateStoreSpecialHour**](UpdateStoreSpecialHourAPI.md#UpdateStoreSpecialHour) | **Put** /partner/v2/merchants/{merchantID}/store/special-opening-hour | Update Store Special Hours + + + +## UpdateStoreSpecialHour + +> UpdateSpecialHourResponse UpdateStoreSpecialHour(ctx, merchantID).ContentType(contentType).Authorization(authorization).UpdateSpecialHourRequest(updateSpecialHourRequest).Execute() + +Update Store Special Hours + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + grabfood "github.com/grab/grabfood-api-sdk-go" +) + +func main() { + contentType := "application/json" // string | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. + authorization := "Bearer " // string | Specify the generated authorization token of the bearer type. + merchantID := "1-CYNGRUNGSBCCC" // string | The merchant's ID that is in GrabFood's database. + updateSpecialHourRequest := *grabfood.NewUpdateSpecialHourRequest([]grabfood.SpecialOpeningHour{*grabfood.NewSpecialOpeningHour()}) // UpdateSpecialHourRequest | + + configuration := grabfood.NewConfiguration() + apiClient := grabfood.NewAPIClient(configuration) + resp, r, err := apiClient.UpdateStoreSpecialHourAPI.UpdateStoreSpecialHour(context.Background(), merchantID).ContentType(contentType).Authorization(authorization).UpdateSpecialHourRequest(updateSpecialHourRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UpdateStoreSpecialHourAPI.UpdateStoreSpecialHour``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateStoreSpecialHour`: UpdateSpecialHourResponse + fmt.Fprintf(os.Stdout, "Response from `UpdateStoreSpecialHourAPI.UpdateStoreSpecialHour`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**merchantID** | **string** | The merchant's ID that is in GrabFood's database. | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateStoreSpecialHourRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **contentType** | **string** | The content type of the request body. You must use `application/json` for this header as GrabFood API currently does not support other formats. | + **authorization** | **string** | Specify the generated authorization token of the bearer type. | + + **updateSpecialHourRequest** | [**UpdateSpecialHourRequest**](UpdateSpecialHourRequest.md) | | + +### Return type + +[**UpdateSpecialHourResponse**](UpdateSpecialHourResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/docs/Voucher.md b/docs/Voucher.md new file mode 100644 index 0000000..356e9d8 --- /dev/null +++ b/docs/Voucher.md @@ -0,0 +1,160 @@ +# Voucher + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Title** | Pointer to **string** | The title of the voucher. | [optional] +**DiscountedPrice** | Pointer to **string** | The amount paid after discount is applied in local currency. | [optional] +**OriginalPrice** | Pointer to **string** | The original amount before discount is applied in local currency. | [optional] +**DescriptionInfo** | Pointer to [**VoucherDescriptionInfo**](VoucherDescriptionInfo.md) | | [optional] +**VoucherType** | Pointer to **string** | The type of the dine-in voucher. | [optional] + +## Methods + +### NewVoucher + +`func NewVoucher() *Voucher` + +NewVoucher instantiates a new Voucher object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVoucherWithDefaults + +`func NewVoucherWithDefaults() *Voucher` + +NewVoucherWithDefaults instantiates a new Voucher object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTitle + +`func (o *Voucher) GetTitle() string` + +GetTitle returns the Title field if non-nil, zero value otherwise. + +### GetTitleOk + +`func (o *Voucher) GetTitleOk() (*string, bool)` + +GetTitleOk returns a tuple with the Title field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTitle + +`func (o *Voucher) SetTitle(v string)` + +SetTitle sets Title field to given value. + +### HasTitle + +`func (o *Voucher) HasTitle() bool` + +HasTitle returns a boolean if a field has been set. + +### GetDiscountedPrice + +`func (o *Voucher) GetDiscountedPrice() string` + +GetDiscountedPrice returns the DiscountedPrice field if non-nil, zero value otherwise. + +### GetDiscountedPriceOk + +`func (o *Voucher) GetDiscountedPriceOk() (*string, bool)` + +GetDiscountedPriceOk returns a tuple with the DiscountedPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDiscountedPrice + +`func (o *Voucher) SetDiscountedPrice(v string)` + +SetDiscountedPrice sets DiscountedPrice field to given value. + +### HasDiscountedPrice + +`func (o *Voucher) HasDiscountedPrice() bool` + +HasDiscountedPrice returns a boolean if a field has been set. + +### GetOriginalPrice + +`func (o *Voucher) GetOriginalPrice() string` + +GetOriginalPrice returns the OriginalPrice field if non-nil, zero value otherwise. + +### GetOriginalPriceOk + +`func (o *Voucher) GetOriginalPriceOk() (*string, bool)` + +GetOriginalPriceOk returns a tuple with the OriginalPrice field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOriginalPrice + +`func (o *Voucher) SetOriginalPrice(v string)` + +SetOriginalPrice sets OriginalPrice field to given value. + +### HasOriginalPrice + +`func (o *Voucher) HasOriginalPrice() bool` + +HasOriginalPrice returns a boolean if a field has been set. + +### GetDescriptionInfo + +`func (o *Voucher) GetDescriptionInfo() VoucherDescriptionInfo` + +GetDescriptionInfo returns the DescriptionInfo field if non-nil, zero value otherwise. + +### GetDescriptionInfoOk + +`func (o *Voucher) GetDescriptionInfoOk() (*VoucherDescriptionInfo, bool)` + +GetDescriptionInfoOk returns a tuple with the DescriptionInfo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDescriptionInfo + +`func (o *Voucher) SetDescriptionInfo(v VoucherDescriptionInfo)` + +SetDescriptionInfo sets DescriptionInfo field to given value. + +### HasDescriptionInfo + +`func (o *Voucher) HasDescriptionInfo() bool` + +HasDescriptionInfo returns a boolean if a field has been set. + +### GetVoucherType + +`func (o *Voucher) GetVoucherType() string` + +GetVoucherType returns the VoucherType field if non-nil, zero value otherwise. + +### GetVoucherTypeOk + +`func (o *Voucher) GetVoucherTypeOk() (*string, bool)` + +GetVoucherTypeOk returns a tuple with the VoucherType field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVoucherType + +`func (o *Voucher) SetVoucherType(v string)` + +SetVoucherType sets VoucherType field to given value. + +### HasVoucherType + +`func (o *Voucher) HasVoucherType() bool` + +HasVoucherType returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/VoucherDescriptionInfo.md b/docs/VoucherDescriptionInfo.md new file mode 100644 index 0000000..87c444e --- /dev/null +++ b/docs/VoucherDescriptionInfo.md @@ -0,0 +1,56 @@ +# VoucherDescriptionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Text** | Pointer to **string** | The description of the dine-in voucher. | [optional] + +## Methods + +### NewVoucherDescriptionInfo + +`func NewVoucherDescriptionInfo() *VoucherDescriptionInfo` + +NewVoucherDescriptionInfo instantiates a new VoucherDescriptionInfo object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVoucherDescriptionInfoWithDefaults + +`func NewVoucherDescriptionInfoWithDefaults() *VoucherDescriptionInfo` + +NewVoucherDescriptionInfoWithDefaults instantiates a new VoucherDescriptionInfo object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetText + +`func (o *VoucherDescriptionInfo) GetText() string` + +GetText returns the Text field if non-nil, zero value otherwise. + +### GetTextOk + +`func (o *VoucherDescriptionInfo) GetTextOk() (*string, bool)` + +GetTextOk returns a tuple with the Text field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetText + +`func (o *VoucherDescriptionInfo) SetText(v string)` + +SetText sets Text field to given value. + +### HasText + +`func (o *VoucherDescriptionInfo) HasText() bool` + +HasText returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WorkingHour.md b/docs/WorkingHour.md new file mode 100644 index 0000000..d6be1b6 --- /dev/null +++ b/docs/WorkingHour.md @@ -0,0 +1,212 @@ +# WorkingHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sun** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Mon** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Tue** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Wed** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Thu** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Fri** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] +**Sat** | Pointer to [**WorkingHourDay**](WorkingHourDay.md) | | [optional] + +## Methods + +### NewWorkingHour + +`func NewWorkingHour() *WorkingHour` + +NewWorkingHour instantiates a new WorkingHour object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWorkingHourWithDefaults + +`func NewWorkingHourWithDefaults() *WorkingHour` + +NewWorkingHourWithDefaults instantiates a new WorkingHour object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetSun + +`func (o *WorkingHour) GetSun() WorkingHourDay` + +GetSun returns the Sun field if non-nil, zero value otherwise. + +### GetSunOk + +`func (o *WorkingHour) GetSunOk() (*WorkingHourDay, bool)` + +GetSunOk returns a tuple with the Sun field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSun + +`func (o *WorkingHour) SetSun(v WorkingHourDay)` + +SetSun sets Sun field to given value. + +### HasSun + +`func (o *WorkingHour) HasSun() bool` + +HasSun returns a boolean if a field has been set. + +### GetMon + +`func (o *WorkingHour) GetMon() WorkingHourDay` + +GetMon returns the Mon field if non-nil, zero value otherwise. + +### GetMonOk + +`func (o *WorkingHour) GetMonOk() (*WorkingHourDay, bool)` + +GetMonOk returns a tuple with the Mon field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMon + +`func (o *WorkingHour) SetMon(v WorkingHourDay)` + +SetMon sets Mon field to given value. + +### HasMon + +`func (o *WorkingHour) HasMon() bool` + +HasMon returns a boolean if a field has been set. + +### GetTue + +`func (o *WorkingHour) GetTue() WorkingHourDay` + +GetTue returns the Tue field if non-nil, zero value otherwise. + +### GetTueOk + +`func (o *WorkingHour) GetTueOk() (*WorkingHourDay, bool)` + +GetTueOk returns a tuple with the Tue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTue + +`func (o *WorkingHour) SetTue(v WorkingHourDay)` + +SetTue sets Tue field to given value. + +### HasTue + +`func (o *WorkingHour) HasTue() bool` + +HasTue returns a boolean if a field has been set. + +### GetWed + +`func (o *WorkingHour) GetWed() WorkingHourDay` + +GetWed returns the Wed field if non-nil, zero value otherwise. + +### GetWedOk + +`func (o *WorkingHour) GetWedOk() (*WorkingHourDay, bool)` + +GetWedOk returns a tuple with the Wed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWed + +`func (o *WorkingHour) SetWed(v WorkingHourDay)` + +SetWed sets Wed field to given value. + +### HasWed + +`func (o *WorkingHour) HasWed() bool` + +HasWed returns a boolean if a field has been set. + +### GetThu + +`func (o *WorkingHour) GetThu() WorkingHourDay` + +GetThu returns the Thu field if non-nil, zero value otherwise. + +### GetThuOk + +`func (o *WorkingHour) GetThuOk() (*WorkingHourDay, bool)` + +GetThuOk returns a tuple with the Thu field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetThu + +`func (o *WorkingHour) SetThu(v WorkingHourDay)` + +SetThu sets Thu field to given value. + +### HasThu + +`func (o *WorkingHour) HasThu() bool` + +HasThu returns a boolean if a field has been set. + +### GetFri + +`func (o *WorkingHour) GetFri() WorkingHourDay` + +GetFri returns the Fri field if non-nil, zero value otherwise. + +### GetFriOk + +`func (o *WorkingHour) GetFriOk() (*WorkingHourDay, bool)` + +GetFriOk returns a tuple with the Fri field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFri + +`func (o *WorkingHour) SetFri(v WorkingHourDay)` + +SetFri sets Fri field to given value. + +### HasFri + +`func (o *WorkingHour) HasFri() bool` + +HasFri returns a boolean if a field has been set. + +### GetSat + +`func (o *WorkingHour) GetSat() WorkingHourDay` + +GetSat returns the Sat field if non-nil, zero value otherwise. + +### GetSatOk + +`func (o *WorkingHour) GetSatOk() (*WorkingHourDay, bool)` + +GetSatOk returns a tuple with the Sat field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSat + +`func (o *WorkingHour) SetSat(v WorkingHourDay)` + +SetSat sets Sat field to given value. + +### HasSat + +`func (o *WorkingHour) HasSat() bool` + +HasSat returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WorkingHourDay.md b/docs/WorkingHourDay.md new file mode 100644 index 0000000..e7d6582 --- /dev/null +++ b/docs/WorkingHourDay.md @@ -0,0 +1,66 @@ +# WorkingHourDay + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Periods** | Pointer to [**[]OpenPeriod**](OpenPeriod.md) | An array of open periods. `null` in [ListCampaign](#tag/list-campaign) response if the campaign is available all day. | [optional] + +## Methods + +### NewWorkingHourDay + +`func NewWorkingHourDay() *WorkingHourDay` + +NewWorkingHourDay instantiates a new WorkingHourDay object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewWorkingHourDayWithDefaults + +`func NewWorkingHourDayWithDefaults() *WorkingHourDay` + +NewWorkingHourDayWithDefaults instantiates a new WorkingHourDay object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetPeriods + +`func (o *WorkingHourDay) GetPeriods() []OpenPeriod` + +GetPeriods returns the Periods field if non-nil, zero value otherwise. + +### GetPeriodsOk + +`func (o *WorkingHourDay) GetPeriodsOk() (*[]OpenPeriod, bool)` + +GetPeriodsOk returns a tuple with the Periods field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPeriods + +`func (o *WorkingHourDay) SetPeriods(v []OpenPeriod)` + +SetPeriods sets Periods field to given value. + +### HasPeriods + +`func (o *WorkingHourDay) HasPeriods() bool` + +HasPeriods returns a boolean if a field has been set. + +### SetPeriodsNil + +`func (o *WorkingHourDay) SetPeriodsNil(b bool)` + + SetPeriodsNil sets the value for Periods to be an explicit nil + +### UnsetPeriods +`func (o *WorkingHourDay) UnsetPeriods()` + +UnsetPeriods ensures that no value is present for Periods, not even an explicit nil + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..6f2aca7 --- /dev/null +++ b/go.mod @@ -0,0 +1,6 @@ +module github.com/grab/grabfood-api-sdk-go + +go 1.18 + +require ( +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..c966c8d --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/model_accept_order_request.go b/model_accept_order_request.go new file mode 100644 index 0000000..b5e8bc0 --- /dev/null +++ b/model_accept_order_request.go @@ -0,0 +1,202 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the AcceptOrderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AcceptOrderRequest{} + +// AcceptOrderRequest The manual acceptance or rejection of an order on GrabFood. +type AcceptOrderRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The order's updated state. + ToState string `json:"toState"` + AdditionalProperties map[string]interface{} +} + +type _AcceptOrderRequest AcceptOrderRequest + +// NewAcceptOrderRequest instantiates a new AcceptOrderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAcceptOrderRequest(orderID string, toState string) *AcceptOrderRequest { + this := AcceptOrderRequest{} + this.OrderID = orderID + this.ToState = toState + return &this +} + +// NewAcceptOrderRequestWithDefaults instantiates a new AcceptOrderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAcceptOrderRequestWithDefaults() *AcceptOrderRequest { + this := AcceptOrderRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *AcceptOrderRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *AcceptOrderRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *AcceptOrderRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetToState returns the ToState field value +func (o *AcceptOrderRequest) GetToState() string { + if o == nil { + var ret string + return ret + } + + return o.ToState +} + +// GetToStateOk returns a tuple with the ToState field value +// and a boolean to check if the value has been set. +func (o *AcceptOrderRequest) GetToStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ToState, true +} + +// SetToState sets field value +func (o *AcceptOrderRequest) SetToState(v string) { + o.ToState = v +} + +func (o AcceptOrderRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AcceptOrderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["toState"] = o.ToState + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AcceptOrderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "toState", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAcceptOrderRequest := _AcceptOrderRequest{} + + err = json.Unmarshal(data, &varAcceptOrderRequest) + + if err != nil { + return err + } + + *o = AcceptOrderRequest(varAcceptOrderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "toState") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAcceptOrderRequest struct { + value *AcceptOrderRequest + isSet bool +} + +func (v NullableAcceptOrderRequest) Get() *AcceptOrderRequest { + return v.value +} + +func (v *NullableAcceptOrderRequest) Set(val *AcceptOrderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAcceptOrderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAcceptOrderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAcceptOrderRequest(val *AcceptOrderRequest) *NullableAcceptOrderRequest { + return &NullableAcceptOrderRequest{value: val, isSet: true} +} + +func (v NullableAcceptOrderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAcceptOrderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_address.go b/model_address.go new file mode 100644 index 0000000..55604eb --- /dev/null +++ b/model_address.go @@ -0,0 +1,386 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Address type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Address{} + +// Address A JSON object containing the receiver’s location information. +type Address struct { + // The delivery address' unit number. + UnitNumber *string `json:"unitNumber,omitempty"` + // Instructions for the delivery. + DeliveryInstruction *string `json:"deliveryInstruction,omitempty"` + // POI source + PoiSource *string `json:"poiSource,omitempty"` + // POI ID, empty when poiSource is GRAB. + PoiID *string `json:"poiID,omitempty"` + // The delivery address containing street name, city, postal code, and country. Has value only when poiSource is `GRAB`. + Address *string `json:"address,omitempty"` + // The postcode of the delivery address. Has value only when poiSource is `GRAB`. + Postcode *string `json:"postcode,omitempty"` + Coordinates *Coordinates `json:"coordinates,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Address Address + +// NewAddress instantiates a new Address object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddress() *Address { + this := Address{} + return &this +} + +// NewAddressWithDefaults instantiates a new Address object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddressWithDefaults() *Address { + this := Address{} + return &this +} + +// GetUnitNumber returns the UnitNumber field value if set, zero value otherwise. +func (o *Address) GetUnitNumber() string { + if o == nil || IsNil(o.UnitNumber) { + var ret string + return ret + } + return *o.UnitNumber +} + +// GetUnitNumberOk returns a tuple with the UnitNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetUnitNumberOk() (*string, bool) { + if o == nil || IsNil(o.UnitNumber) { + return nil, false + } + return o.UnitNumber, true +} + +// HasUnitNumber returns a boolean if a field has been set. +func (o *Address) HasUnitNumber() bool { + if o != nil && !IsNil(o.UnitNumber) { + return true + } + + return false +} + +// SetUnitNumber gets a reference to the given string and assigns it to the UnitNumber field. +func (o *Address) SetUnitNumber(v string) { + o.UnitNumber = &v +} + +// GetDeliveryInstruction returns the DeliveryInstruction field value if set, zero value otherwise. +func (o *Address) GetDeliveryInstruction() string { + if o == nil || IsNil(o.DeliveryInstruction) { + var ret string + return ret + } + return *o.DeliveryInstruction +} + +// GetDeliveryInstructionOk returns a tuple with the DeliveryInstruction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetDeliveryInstructionOk() (*string, bool) { + if o == nil || IsNil(o.DeliveryInstruction) { + return nil, false + } + return o.DeliveryInstruction, true +} + +// HasDeliveryInstruction returns a boolean if a field has been set. +func (o *Address) HasDeliveryInstruction() bool { + if o != nil && !IsNil(o.DeliveryInstruction) { + return true + } + + return false +} + +// SetDeliveryInstruction gets a reference to the given string and assigns it to the DeliveryInstruction field. +func (o *Address) SetDeliveryInstruction(v string) { + o.DeliveryInstruction = &v +} + +// GetPoiSource returns the PoiSource field value if set, zero value otherwise. +func (o *Address) GetPoiSource() string { + if o == nil || IsNil(o.PoiSource) { + var ret string + return ret + } + return *o.PoiSource +} + +// GetPoiSourceOk returns a tuple with the PoiSource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetPoiSourceOk() (*string, bool) { + if o == nil || IsNil(o.PoiSource) { + return nil, false + } + return o.PoiSource, true +} + +// HasPoiSource returns a boolean if a field has been set. +func (o *Address) HasPoiSource() bool { + if o != nil && !IsNil(o.PoiSource) { + return true + } + + return false +} + +// SetPoiSource gets a reference to the given string and assigns it to the PoiSource field. +func (o *Address) SetPoiSource(v string) { + o.PoiSource = &v +} + +// GetPoiID returns the PoiID field value if set, zero value otherwise. +func (o *Address) GetPoiID() string { + if o == nil || IsNil(o.PoiID) { + var ret string + return ret + } + return *o.PoiID +} + +// GetPoiIDOk returns a tuple with the PoiID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetPoiIDOk() (*string, bool) { + if o == nil || IsNil(o.PoiID) { + return nil, false + } + return o.PoiID, true +} + +// HasPoiID returns a boolean if a field has been set. +func (o *Address) HasPoiID() bool { + if o != nil && !IsNil(o.PoiID) { + return true + } + + return false +} + +// SetPoiID gets a reference to the given string and assigns it to the PoiID field. +func (o *Address) SetPoiID(v string) { + o.PoiID = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Address) GetAddress() string { + if o == nil || IsNil(o.Address) { + var ret string + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetAddressOk() (*string, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Address) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given string and assigns it to the Address field. +func (o *Address) SetAddress(v string) { + o.Address = &v +} + +// GetPostcode returns the Postcode field value if set, zero value otherwise. +func (o *Address) GetPostcode() string { + if o == nil || IsNil(o.Postcode) { + var ret string + return ret + } + return *o.Postcode +} + +// GetPostcodeOk returns a tuple with the Postcode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetPostcodeOk() (*string, bool) { + if o == nil || IsNil(o.Postcode) { + return nil, false + } + return o.Postcode, true +} + +// HasPostcode returns a boolean if a field has been set. +func (o *Address) HasPostcode() bool { + if o != nil && !IsNil(o.Postcode) { + return true + } + + return false +} + +// SetPostcode gets a reference to the given string and assigns it to the Postcode field. +func (o *Address) SetPostcode(v string) { + o.Postcode = &v +} + +// GetCoordinates returns the Coordinates field value if set, zero value otherwise. +func (o *Address) GetCoordinates() Coordinates { + if o == nil || IsNil(o.Coordinates) { + var ret Coordinates + return ret + } + return *o.Coordinates +} + +// GetCoordinatesOk returns a tuple with the Coordinates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Address) GetCoordinatesOk() (*Coordinates, bool) { + if o == nil || IsNil(o.Coordinates) { + return nil, false + } + return o.Coordinates, true +} + +// HasCoordinates returns a boolean if a field has been set. +func (o *Address) HasCoordinates() bool { + if o != nil && !IsNil(o.Coordinates) { + return true + } + + return false +} + +// SetCoordinates gets a reference to the given Coordinates and assigns it to the Coordinates field. +func (o *Address) SetCoordinates(v Coordinates) { + o.Coordinates = &v +} + +func (o Address) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Address) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.UnitNumber) { + toSerialize["unitNumber"] = o.UnitNumber + } + if !IsNil(o.DeliveryInstruction) { + toSerialize["deliveryInstruction"] = o.DeliveryInstruction + } + if !IsNil(o.PoiSource) { + toSerialize["poiSource"] = o.PoiSource + } + if !IsNil(o.PoiID) { + toSerialize["poiID"] = o.PoiID + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + if !IsNil(o.Postcode) { + toSerialize["postcode"] = o.Postcode + } + if !IsNil(o.Coordinates) { + toSerialize["coordinates"] = o.Coordinates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Address) UnmarshalJSON(data []byte) (err error) { + varAddress := _Address{} + + err = json.Unmarshal(data, &varAddress) + + if err != nil { + return err + } + + *o = Address(varAddress) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "unitNumber") + delete(additionalProperties, "deliveryInstruction") + delete(additionalProperties, "poiSource") + delete(additionalProperties, "poiID") + delete(additionalProperties, "address") + delete(additionalProperties, "postcode") + delete(additionalProperties, "coordinates") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAddress struct { + value *Address + isSet bool +} + +func (v NullableAddress) Get() *Address { + return v.value +} + +func (v *NullableAddress) Set(val *Address) { + v.value = val + v.isSet = true +} + +func (v NullableAddress) IsSet() bool { + return v.isSet +} + +func (v *NullableAddress) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddress(val *Address) *NullableAddress { + return &NullableAddress{value: val, isSet: true} +} + +func (v NullableAddress) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddress) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_advanced_pricing.go b/model_advanced_pricing.go new file mode 100644 index 0000000..23fc0b4 --- /dev/null +++ b/model_advanced_pricing.go @@ -0,0 +1,387 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the AdvancedPricing type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AdvancedPricing{} + +// AdvancedPricing Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. Refer [Service Based Menu](#section/Service-Based-Menu). +type AdvancedPricing struct { + // Service type: `Delivery`, Order type: `Instant`, Channel: `Grab App` + DeliveryOnDemandGrabApp *int64 `json:"Delivery_OnDemand_GrabApp,omitempty"` + // Service type: `Delivery`, Order type: `Scheduled`, Channel: `Grab App` + DeliveryScheduledGrabApp *int64 `json:"Delivery_Scheduled_GrabApp,omitempty"` + // Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Grab App` + SelfPickUpOnDemandGrabApp *int64 `json:"SelfPickUp_OnDemand_GrabApp,omitempty"` + // Service type: `Dine In`, Order type: `Instant`, Channel: `Grab App` + DineInOnDemandGrabApp *int64 `json:"DineIn_OnDemand_GrabApp,omitempty"` + // Service type: `Delivery`, Order type: `Instant`, Channel: `Store Front` + DeliveryOnDemandStoreFront *int64 `json:"Delivery_OnDemand_StoreFront,omitempty"` + // Service type: `Delivery`, Order type: `Scheduled`, Channel: `Store Front` + DeliveryScheduledStoreFront *int64 `json:"Delivery_Scheduled_StoreFront,omitempty"` + // Service type: `Self Pick Up`, Order type: `Instant`, Channel: `Store Front` + SelfPickUpOnDemandStoreFront *int64 `json:"SelfPickUp_OnDemand_StoreFront,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AdvancedPricing AdvancedPricing + +// NewAdvancedPricing instantiates a new AdvancedPricing object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAdvancedPricing() *AdvancedPricing { + this := AdvancedPricing{} + return &this +} + +// NewAdvancedPricingWithDefaults instantiates a new AdvancedPricing object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAdvancedPricingWithDefaults() *AdvancedPricing { + this := AdvancedPricing{} + return &this +} + +// GetDeliveryOnDemandGrabApp returns the DeliveryOnDemandGrabApp field value if set, zero value otherwise. +func (o *AdvancedPricing) GetDeliveryOnDemandGrabApp() int64 { + if o == nil || IsNil(o.DeliveryOnDemandGrabApp) { + var ret int64 + return ret + } + return *o.DeliveryOnDemandGrabApp +} + +// GetDeliveryOnDemandGrabAppOk returns a tuple with the DeliveryOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetDeliveryOnDemandGrabAppOk() (*int64, bool) { + if o == nil || IsNil(o.DeliveryOnDemandGrabApp) { + return nil, false + } + return o.DeliveryOnDemandGrabApp, true +} + +// HasDeliveryOnDemandGrabApp returns a boolean if a field has been set. +func (o *AdvancedPricing) HasDeliveryOnDemandGrabApp() bool { + if o != nil && !IsNil(o.DeliveryOnDemandGrabApp) { + return true + } + + return false +} + +// SetDeliveryOnDemandGrabApp gets a reference to the given int64 and assigns it to the DeliveryOnDemandGrabApp field. +func (o *AdvancedPricing) SetDeliveryOnDemandGrabApp(v int64) { + o.DeliveryOnDemandGrabApp = &v +} + +// GetDeliveryScheduledGrabApp returns the DeliveryScheduledGrabApp field value if set, zero value otherwise. +func (o *AdvancedPricing) GetDeliveryScheduledGrabApp() int64 { + if o == nil || IsNil(o.DeliveryScheduledGrabApp) { + var ret int64 + return ret + } + return *o.DeliveryScheduledGrabApp +} + +// GetDeliveryScheduledGrabAppOk returns a tuple with the DeliveryScheduledGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetDeliveryScheduledGrabAppOk() (*int64, bool) { + if o == nil || IsNil(o.DeliveryScheduledGrabApp) { + return nil, false + } + return o.DeliveryScheduledGrabApp, true +} + +// HasDeliveryScheduledGrabApp returns a boolean if a field has been set. +func (o *AdvancedPricing) HasDeliveryScheduledGrabApp() bool { + if o != nil && !IsNil(o.DeliveryScheduledGrabApp) { + return true + } + + return false +} + +// SetDeliveryScheduledGrabApp gets a reference to the given int64 and assigns it to the DeliveryScheduledGrabApp field. +func (o *AdvancedPricing) SetDeliveryScheduledGrabApp(v int64) { + o.DeliveryScheduledGrabApp = &v +} + +// GetSelfPickUpOnDemandGrabApp returns the SelfPickUpOnDemandGrabApp field value if set, zero value otherwise. +func (o *AdvancedPricing) GetSelfPickUpOnDemandGrabApp() int64 { + if o == nil || IsNil(o.SelfPickUpOnDemandGrabApp) { + var ret int64 + return ret + } + return *o.SelfPickUpOnDemandGrabApp +} + +// GetSelfPickUpOnDemandGrabAppOk returns a tuple with the SelfPickUpOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetSelfPickUpOnDemandGrabAppOk() (*int64, bool) { + if o == nil || IsNil(o.SelfPickUpOnDemandGrabApp) { + return nil, false + } + return o.SelfPickUpOnDemandGrabApp, true +} + +// HasSelfPickUpOnDemandGrabApp returns a boolean if a field has been set. +func (o *AdvancedPricing) HasSelfPickUpOnDemandGrabApp() bool { + if o != nil && !IsNil(o.SelfPickUpOnDemandGrabApp) { + return true + } + + return false +} + +// SetSelfPickUpOnDemandGrabApp gets a reference to the given int64 and assigns it to the SelfPickUpOnDemandGrabApp field. +func (o *AdvancedPricing) SetSelfPickUpOnDemandGrabApp(v int64) { + o.SelfPickUpOnDemandGrabApp = &v +} + +// GetDineInOnDemandGrabApp returns the DineInOnDemandGrabApp field value if set, zero value otherwise. +func (o *AdvancedPricing) GetDineInOnDemandGrabApp() int64 { + if o == nil || IsNil(o.DineInOnDemandGrabApp) { + var ret int64 + return ret + } + return *o.DineInOnDemandGrabApp +} + +// GetDineInOnDemandGrabAppOk returns a tuple with the DineInOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetDineInOnDemandGrabAppOk() (*int64, bool) { + if o == nil || IsNil(o.DineInOnDemandGrabApp) { + return nil, false + } + return o.DineInOnDemandGrabApp, true +} + +// HasDineInOnDemandGrabApp returns a boolean if a field has been set. +func (o *AdvancedPricing) HasDineInOnDemandGrabApp() bool { + if o != nil && !IsNil(o.DineInOnDemandGrabApp) { + return true + } + + return false +} + +// SetDineInOnDemandGrabApp gets a reference to the given int64 and assigns it to the DineInOnDemandGrabApp field. +func (o *AdvancedPricing) SetDineInOnDemandGrabApp(v int64) { + o.DineInOnDemandGrabApp = &v +} + +// GetDeliveryOnDemandStoreFront returns the DeliveryOnDemandStoreFront field value if set, zero value otherwise. +func (o *AdvancedPricing) GetDeliveryOnDemandStoreFront() int64 { + if o == nil || IsNil(o.DeliveryOnDemandStoreFront) { + var ret int64 + return ret + } + return *o.DeliveryOnDemandStoreFront +} + +// GetDeliveryOnDemandStoreFrontOk returns a tuple with the DeliveryOnDemandStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetDeliveryOnDemandStoreFrontOk() (*int64, bool) { + if o == nil || IsNil(o.DeliveryOnDemandStoreFront) { + return nil, false + } + return o.DeliveryOnDemandStoreFront, true +} + +// HasDeliveryOnDemandStoreFront returns a boolean if a field has been set. +func (o *AdvancedPricing) HasDeliveryOnDemandStoreFront() bool { + if o != nil && !IsNil(o.DeliveryOnDemandStoreFront) { + return true + } + + return false +} + +// SetDeliveryOnDemandStoreFront gets a reference to the given int64 and assigns it to the DeliveryOnDemandStoreFront field. +func (o *AdvancedPricing) SetDeliveryOnDemandStoreFront(v int64) { + o.DeliveryOnDemandStoreFront = &v +} + +// GetDeliveryScheduledStoreFront returns the DeliveryScheduledStoreFront field value if set, zero value otherwise. +func (o *AdvancedPricing) GetDeliveryScheduledStoreFront() int64 { + if o == nil || IsNil(o.DeliveryScheduledStoreFront) { + var ret int64 + return ret + } + return *o.DeliveryScheduledStoreFront +} + +// GetDeliveryScheduledStoreFrontOk returns a tuple with the DeliveryScheduledStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetDeliveryScheduledStoreFrontOk() (*int64, bool) { + if o == nil || IsNil(o.DeliveryScheduledStoreFront) { + return nil, false + } + return o.DeliveryScheduledStoreFront, true +} + +// HasDeliveryScheduledStoreFront returns a boolean if a field has been set. +func (o *AdvancedPricing) HasDeliveryScheduledStoreFront() bool { + if o != nil && !IsNil(o.DeliveryScheduledStoreFront) { + return true + } + + return false +} + +// SetDeliveryScheduledStoreFront gets a reference to the given int64 and assigns it to the DeliveryScheduledStoreFront field. +func (o *AdvancedPricing) SetDeliveryScheduledStoreFront(v int64) { + o.DeliveryScheduledStoreFront = &v +} + +// GetSelfPickUpOnDemandStoreFront returns the SelfPickUpOnDemandStoreFront field value if set, zero value otherwise. +func (o *AdvancedPricing) GetSelfPickUpOnDemandStoreFront() int64 { + if o == nil || IsNil(o.SelfPickUpOnDemandStoreFront) { + var ret int64 + return ret + } + return *o.SelfPickUpOnDemandStoreFront +} + +// GetSelfPickUpOnDemandStoreFrontOk returns a tuple with the SelfPickUpOnDemandStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AdvancedPricing) GetSelfPickUpOnDemandStoreFrontOk() (*int64, bool) { + if o == nil || IsNil(o.SelfPickUpOnDemandStoreFront) { + return nil, false + } + return o.SelfPickUpOnDemandStoreFront, true +} + +// HasSelfPickUpOnDemandStoreFront returns a boolean if a field has been set. +func (o *AdvancedPricing) HasSelfPickUpOnDemandStoreFront() bool { + if o != nil && !IsNil(o.SelfPickUpOnDemandStoreFront) { + return true + } + + return false +} + +// SetSelfPickUpOnDemandStoreFront gets a reference to the given int64 and assigns it to the SelfPickUpOnDemandStoreFront field. +func (o *AdvancedPricing) SetSelfPickUpOnDemandStoreFront(v int64) { + o.SelfPickUpOnDemandStoreFront = &v +} + +func (o AdvancedPricing) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AdvancedPricing) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeliveryOnDemandGrabApp) { + toSerialize["Delivery_OnDemand_GrabApp"] = o.DeliveryOnDemandGrabApp + } + if !IsNil(o.DeliveryScheduledGrabApp) { + toSerialize["Delivery_Scheduled_GrabApp"] = o.DeliveryScheduledGrabApp + } + if !IsNil(o.SelfPickUpOnDemandGrabApp) { + toSerialize["SelfPickUp_OnDemand_GrabApp"] = o.SelfPickUpOnDemandGrabApp + } + if !IsNil(o.DineInOnDemandGrabApp) { + toSerialize["DineIn_OnDemand_GrabApp"] = o.DineInOnDemandGrabApp + } + if !IsNil(o.DeliveryOnDemandStoreFront) { + toSerialize["Delivery_OnDemand_StoreFront"] = o.DeliveryOnDemandStoreFront + } + if !IsNil(o.DeliveryScheduledStoreFront) { + toSerialize["Delivery_Scheduled_StoreFront"] = o.DeliveryScheduledStoreFront + } + if !IsNil(o.SelfPickUpOnDemandStoreFront) { + toSerialize["SelfPickUp_OnDemand_StoreFront"] = o.SelfPickUpOnDemandStoreFront + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AdvancedPricing) UnmarshalJSON(data []byte) (err error) { + varAdvancedPricing := _AdvancedPricing{} + + err = json.Unmarshal(data, &varAdvancedPricing) + + if err != nil { + return err + } + + *o = AdvancedPricing(varAdvancedPricing) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "Delivery_OnDemand_GrabApp") + delete(additionalProperties, "Delivery_Scheduled_GrabApp") + delete(additionalProperties, "SelfPickUp_OnDemand_GrabApp") + delete(additionalProperties, "DineIn_OnDemand_GrabApp") + delete(additionalProperties, "Delivery_OnDemand_StoreFront") + delete(additionalProperties, "Delivery_Scheduled_StoreFront") + delete(additionalProperties, "SelfPickUp_OnDemand_StoreFront") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAdvancedPricing struct { + value *AdvancedPricing + isSet bool +} + +func (v NullableAdvancedPricing) Get() *AdvancedPricing { + return v.value +} + +func (v *NullableAdvancedPricing) Set(val *AdvancedPricing) { + v.value = val + v.isSet = true +} + +func (v NullableAdvancedPricing) IsSet() bool { + return v.isSet +} + +func (v *NullableAdvancedPricing) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAdvancedPricing(val *AdvancedPricing) *NullableAdvancedPricing { + return &NullableAdvancedPricing{value: val, isSet: true} +} + +func (v NullableAdvancedPricing) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAdvancedPricing) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_update_menu_item.go b/model_batch_update_menu_item.go new file mode 100644 index 0000000..0be65de --- /dev/null +++ b/model_batch_update_menu_item.go @@ -0,0 +1,240 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the BatchUpdateMenuItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchUpdateMenuItem{} + +// BatchUpdateMenuItem Information about the GrabFood client updating their food menu. +type BatchUpdateMenuItem struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The record type that you want to update. + Field string `json:"field"` + // The items in an array of JSON Object. + MenuEntities []MenuEntity `json:"menuEntities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BatchUpdateMenuItem BatchUpdateMenuItem + +// NewBatchUpdateMenuItem instantiates a new BatchUpdateMenuItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchUpdateMenuItem(merchantID string, field string) *BatchUpdateMenuItem { + this := BatchUpdateMenuItem{} + this.MerchantID = merchantID + this.Field = field + return &this +} + +// NewBatchUpdateMenuItemWithDefaults instantiates a new BatchUpdateMenuItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchUpdateMenuItemWithDefaults() *BatchUpdateMenuItem { + this := BatchUpdateMenuItem{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *BatchUpdateMenuItem) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *BatchUpdateMenuItem) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *BatchUpdateMenuItem) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetField returns the Field field value +func (o *BatchUpdateMenuItem) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *BatchUpdateMenuItem) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *BatchUpdateMenuItem) SetField(v string) { + o.Field = v +} + +// GetMenuEntities returns the MenuEntities field value if set, zero value otherwise. +func (o *BatchUpdateMenuItem) GetMenuEntities() []MenuEntity { + if o == nil || IsNil(o.MenuEntities) { + var ret []MenuEntity + return ret + } + return o.MenuEntities +} + +// GetMenuEntitiesOk returns a tuple with the MenuEntities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BatchUpdateMenuItem) GetMenuEntitiesOk() ([]MenuEntity, bool) { + if o == nil || IsNil(o.MenuEntities) { + return nil, false + } + return o.MenuEntities, true +} + +// HasMenuEntities returns a boolean if a field has been set. +func (o *BatchUpdateMenuItem) HasMenuEntities() bool { + if o != nil && !IsNil(o.MenuEntities) { + return true + } + + return false +} + +// SetMenuEntities gets a reference to the given []MenuEntity and assigns it to the MenuEntities field. +func (o *BatchUpdateMenuItem) SetMenuEntities(v []MenuEntity) { + o.MenuEntities = v +} + +func (o BatchUpdateMenuItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchUpdateMenuItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["field"] = o.Field + if !IsNil(o.MenuEntities) { + toSerialize["menuEntities"] = o.MenuEntities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BatchUpdateMenuItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "field", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBatchUpdateMenuItem := _BatchUpdateMenuItem{} + + err = json.Unmarshal(data, &varBatchUpdateMenuItem) + + if err != nil { + return err + } + + *o = BatchUpdateMenuItem(varBatchUpdateMenuItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "field") + delete(additionalProperties, "menuEntities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBatchUpdateMenuItem struct { + value *BatchUpdateMenuItem + isSet bool +} + +func (v NullableBatchUpdateMenuItem) Get() *BatchUpdateMenuItem { + return v.value +} + +func (v *NullableBatchUpdateMenuItem) Set(val *BatchUpdateMenuItem) { + v.value = val + v.isSet = true +} + +func (v NullableBatchUpdateMenuItem) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchUpdateMenuItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchUpdateMenuItem(val *BatchUpdateMenuItem) *NullableBatchUpdateMenuItem { + return &NullableBatchUpdateMenuItem{value: val, isSet: true} +} + +func (v NullableBatchUpdateMenuItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchUpdateMenuItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_batch_update_menu_response.go b/model_batch_update_menu_response.go new file mode 100644 index 0000000..91c769f --- /dev/null +++ b/model_batch_update_menu_response.go @@ -0,0 +1,236 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the BatchUpdateMenuResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BatchUpdateMenuResponse{} + +// BatchUpdateMenuResponse struct for BatchUpdateMenuResponse +type BatchUpdateMenuResponse struct { + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The status of this request. + Status *string `json:"status,omitempty"` + // The error messages when batch update menu record was partial success/fail. `null` when the request was success. + Errors []MenuEntityError `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BatchUpdateMenuResponse BatchUpdateMenuResponse + +// NewBatchUpdateMenuResponse instantiates a new BatchUpdateMenuResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBatchUpdateMenuResponse() *BatchUpdateMenuResponse { + this := BatchUpdateMenuResponse{} + return &this +} + +// NewBatchUpdateMenuResponseWithDefaults instantiates a new BatchUpdateMenuResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBatchUpdateMenuResponseWithDefaults() *BatchUpdateMenuResponse { + this := BatchUpdateMenuResponse{} + return &this +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *BatchUpdateMenuResponse) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BatchUpdateMenuResponse) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *BatchUpdateMenuResponse) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *BatchUpdateMenuResponse) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *BatchUpdateMenuResponse) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BatchUpdateMenuResponse) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *BatchUpdateMenuResponse) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *BatchUpdateMenuResponse) SetStatus(v string) { + o.Status = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BatchUpdateMenuResponse) GetErrors() []MenuEntityError { + if o == nil { + var ret []MenuEntityError + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BatchUpdateMenuResponse) GetErrorsOk() ([]MenuEntityError, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *BatchUpdateMenuResponse) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []MenuEntityError and assigns it to the Errors field. +func (o *BatchUpdateMenuResponse) SetErrors(v []MenuEntityError) { + o.Errors = v +} + +func (o BatchUpdateMenuResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BatchUpdateMenuResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BatchUpdateMenuResponse) UnmarshalJSON(data []byte) (err error) { + varBatchUpdateMenuResponse := _BatchUpdateMenuResponse{} + + err = json.Unmarshal(data, &varBatchUpdateMenuResponse) + + if err != nil { + return err + } + + *o = BatchUpdateMenuResponse(varBatchUpdateMenuResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "status") + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBatchUpdateMenuResponse struct { + value *BatchUpdateMenuResponse + isSet bool +} + +func (v NullableBatchUpdateMenuResponse) Get() *BatchUpdateMenuResponse { + return v.value +} + +func (v *NullableBatchUpdateMenuResponse) Set(val *BatchUpdateMenuResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBatchUpdateMenuResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBatchUpdateMenuResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBatchUpdateMenuResponse(val *BatchUpdateMenuResponse) *NullableBatchUpdateMenuResponse { + return &NullableBatchUpdateMenuResponse{value: val, isSet: true} +} + +func (v NullableBatchUpdateMenuResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBatchUpdateMenuResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_bind_membership_native_request.go b/model_bind_membership_native_request.go new file mode 100644 index 0000000..76d7c5b --- /dev/null +++ b/model_bind_membership_native_request.go @@ -0,0 +1,210 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the BindMembershipNativeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BindMembershipNativeRequest{} + +// BindMembershipNativeRequest This request submits membership binding request to partner. +type BindMembershipNativeRequest struct { + // The id used to identify an unique grab user. + GrabID string `json:"grabID"` + // Grab user phone number used to login. + PhoneNumber *string `json:"phoneNumber,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BindMembershipNativeRequest BindMembershipNativeRequest + +// NewBindMembershipNativeRequest instantiates a new BindMembershipNativeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBindMembershipNativeRequest(grabID string) *BindMembershipNativeRequest { + this := BindMembershipNativeRequest{} + this.GrabID = grabID + return &this +} + +// NewBindMembershipNativeRequestWithDefaults instantiates a new BindMembershipNativeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBindMembershipNativeRequestWithDefaults() *BindMembershipNativeRequest { + this := BindMembershipNativeRequest{} + return &this +} + +// GetGrabID returns the GrabID field value +func (o *BindMembershipNativeRequest) GetGrabID() string { + if o == nil { + var ret string + return ret + } + + return o.GrabID +} + +// GetGrabIDOk returns a tuple with the GrabID field value +// and a boolean to check if the value has been set. +func (o *BindMembershipNativeRequest) GetGrabIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrabID, true +} + +// SetGrabID sets field value +func (o *BindMembershipNativeRequest) SetGrabID(v string) { + o.GrabID = v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *BindMembershipNativeRequest) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BindMembershipNativeRequest) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *BindMembershipNativeRequest) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *BindMembershipNativeRequest) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +func (o BindMembershipNativeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BindMembershipNativeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["grabID"] = o.GrabID + if !IsNil(o.PhoneNumber) { + toSerialize["phoneNumber"] = o.PhoneNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BindMembershipNativeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "grabID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBindMembershipNativeRequest := _BindMembershipNativeRequest{} + + err = json.Unmarshal(data, &varBindMembershipNativeRequest) + + if err != nil { + return err + } + + *o = BindMembershipNativeRequest(varBindMembershipNativeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "grabID") + delete(additionalProperties, "phoneNumber") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBindMembershipNativeRequest struct { + value *BindMembershipNativeRequest + isSet bool +} + +func (v NullableBindMembershipNativeRequest) Get() *BindMembershipNativeRequest { + return v.value +} + +func (v *NullableBindMembershipNativeRequest) Set(val *BindMembershipNativeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableBindMembershipNativeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableBindMembershipNativeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBindMembershipNativeRequest(val *BindMembershipNativeRequest) *NullableBindMembershipNativeRequest { + return &NullableBindMembershipNativeRequest{value: val, isSet: true} +} + +func (v NullableBindMembershipNativeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBindMembershipNativeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_bind_membership_native_response.go b/model_bind_membership_native_response.go new file mode 100644 index 0000000..a00e146 --- /dev/null +++ b/model_bind_membership_native_response.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the BindMembershipNativeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BindMembershipNativeResponse{} + +// BindMembershipNativeResponse This response returns membershipID after membership binding is successful. +type BindMembershipNativeResponse struct { + // The unique member ID on the partner's database. + MemberID string `json:"memberID"` + AdditionalProperties map[string]interface{} +} + +type _BindMembershipNativeResponse BindMembershipNativeResponse + +// NewBindMembershipNativeResponse instantiates a new BindMembershipNativeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBindMembershipNativeResponse(memberID string) *BindMembershipNativeResponse { + this := BindMembershipNativeResponse{} + this.MemberID = memberID + return &this +} + +// NewBindMembershipNativeResponseWithDefaults instantiates a new BindMembershipNativeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBindMembershipNativeResponseWithDefaults() *BindMembershipNativeResponse { + this := BindMembershipNativeResponse{} + return &this +} + +// GetMemberID returns the MemberID field value +func (o *BindMembershipNativeResponse) GetMemberID() string { + if o == nil { + var ret string + return ret + } + + return o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value +// and a boolean to check if the value has been set. +func (o *BindMembershipNativeResponse) GetMemberIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberID, true +} + +// SetMemberID sets field value +func (o *BindMembershipNativeResponse) SetMemberID(v string) { + o.MemberID = v +} + +func (o BindMembershipNativeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BindMembershipNativeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["memberID"] = o.MemberID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BindMembershipNativeResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "memberID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBindMembershipNativeResponse := _BindMembershipNativeResponse{} + + err = json.Unmarshal(data, &varBindMembershipNativeResponse) + + if err != nil { + return err + } + + *o = BindMembershipNativeResponse(varBindMembershipNativeResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBindMembershipNativeResponse struct { + value *BindMembershipNativeResponse + isSet bool +} + +func (v NullableBindMembershipNativeResponse) Get() *BindMembershipNativeResponse { + return v.value +} + +func (v *NullableBindMembershipNativeResponse) Set(val *BindMembershipNativeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBindMembershipNativeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBindMembershipNativeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBindMembershipNativeResponse(val *BindMembershipNativeResponse) *NullableBindMembershipNativeResponse { + return &NullableBindMembershipNativeResponse{value: val, isSet: true} +} + +func (v NullableBindMembershipNativeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBindMembershipNativeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_campaign.go b/model_campaign.go new file mode 100644 index 0000000..0e9d9de --- /dev/null +++ b/model_campaign.go @@ -0,0 +1,411 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the Campaign type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Campaign{} + +// Campaign A JSON object containing the campaign details for a merchant. Only campaigns that are funded by merchants will be sent. +type Campaign struct { + // The campaign's ID. + Id string `json:"id"` + // The party who created the campaign. Can be created by partners via API, merchants via the merchant app or Grab. + CreatedBy string `json:"createdBy"` + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The campaign's name. + Name string `json:"name"` + Quotas *CampaignQuotas `json:"quotas,omitempty"` + Conditions *CampaignConditions `json:"conditions,omitempty"` + Discount *CampaignDiscount `json:"discount,omitempty"` + // Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. + CustomTag *string `json:"customTag,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Campaign Campaign + +// NewCampaign instantiates a new Campaign object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCampaign(id string, createdBy string, merchantID string, name string) *Campaign { + this := Campaign{} + this.Id = id + this.CreatedBy = createdBy + this.MerchantID = merchantID + this.Name = name + return &this +} + +// NewCampaignWithDefaults instantiates a new Campaign object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCampaignWithDefaults() *Campaign { + this := Campaign{} + return &this +} + +// GetId returns the Id field value +func (o *Campaign) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Campaign) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Campaign) SetId(v string) { + o.Id = v +} + +// GetCreatedBy returns the CreatedBy field value +func (o *Campaign) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *Campaign) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value +func (o *Campaign) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetMerchantID returns the MerchantID field value +func (o *Campaign) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *Campaign) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *Campaign) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetName returns the Name field value +func (o *Campaign) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Campaign) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Campaign) SetName(v string) { + o.Name = v +} + +// GetQuotas returns the Quotas field value if set, zero value otherwise. +func (o *Campaign) GetQuotas() CampaignQuotas { + if o == nil || IsNil(o.Quotas) { + var ret CampaignQuotas + return ret + } + return *o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Campaign) GetQuotasOk() (*CampaignQuotas, bool) { + if o == nil || IsNil(o.Quotas) { + return nil, false + } + return o.Quotas, true +} + +// HasQuotas returns a boolean if a field has been set. +func (o *Campaign) HasQuotas() bool { + if o != nil && !IsNil(o.Quotas) { + return true + } + + return false +} + +// SetQuotas gets a reference to the given CampaignQuotas and assigns it to the Quotas field. +func (o *Campaign) SetQuotas(v CampaignQuotas) { + o.Quotas = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise. +func (o *Campaign) GetConditions() CampaignConditions { + if o == nil || IsNil(o.Conditions) { + var ret CampaignConditions + return ret + } + return *o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Campaign) GetConditionsOk() (*CampaignConditions, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *Campaign) HasConditions() bool { + if o != nil && !IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given CampaignConditions and assigns it to the Conditions field. +func (o *Campaign) SetConditions(v CampaignConditions) { + o.Conditions = &v +} + +// GetDiscount returns the Discount field value if set, zero value otherwise. +func (o *Campaign) GetDiscount() CampaignDiscount { + if o == nil || IsNil(o.Discount) { + var ret CampaignDiscount + return ret + } + return *o.Discount +} + +// GetDiscountOk returns a tuple with the Discount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Campaign) GetDiscountOk() (*CampaignDiscount, bool) { + if o == nil || IsNil(o.Discount) { + return nil, false + } + return o.Discount, true +} + +// HasDiscount returns a boolean if a field has been set. +func (o *Campaign) HasDiscount() bool { + if o != nil && !IsNil(o.Discount) { + return true + } + + return false +} + +// SetDiscount gets a reference to the given CampaignDiscount and assigns it to the Discount field. +func (o *Campaign) SetDiscount(v CampaignDiscount) { + o.Discount = &v +} + +// GetCustomTag returns the CustomTag field value if set, zero value otherwise. +func (o *Campaign) GetCustomTag() string { + if o == nil || IsNil(o.CustomTag) { + var ret string + return ret + } + return *o.CustomTag +} + +// GetCustomTagOk returns a tuple with the CustomTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Campaign) GetCustomTagOk() (*string, bool) { + if o == nil || IsNil(o.CustomTag) { + return nil, false + } + return o.CustomTag, true +} + +// HasCustomTag returns a boolean if a field has been set. +func (o *Campaign) HasCustomTag() bool { + if o != nil && !IsNil(o.CustomTag) { + return true + } + + return false +} + +// SetCustomTag gets a reference to the given string and assigns it to the CustomTag field. +func (o *Campaign) SetCustomTag(v string) { + o.CustomTag = &v +} + +func (o Campaign) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Campaign) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["createdBy"] = o.CreatedBy + toSerialize["merchantID"] = o.MerchantID + toSerialize["name"] = o.Name + if !IsNil(o.Quotas) { + toSerialize["quotas"] = o.Quotas + } + if !IsNil(o.Conditions) { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.Discount) { + toSerialize["discount"] = o.Discount + } + if !IsNil(o.CustomTag) { + toSerialize["customTag"] = o.CustomTag + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Campaign) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "createdBy", + "merchantID", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCampaign := _Campaign{} + + err = json.Unmarshal(data, &varCampaign) + + if err != nil { + return err + } + + *o = Campaign(varCampaign) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "createdBy") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "name") + delete(additionalProperties, "quotas") + delete(additionalProperties, "conditions") + delete(additionalProperties, "discount") + delete(additionalProperties, "customTag") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCampaign struct { + value *Campaign + isSet bool +} + +func (v NullableCampaign) Get() *Campaign { + return v.value +} + +func (v *NullableCampaign) Set(val *Campaign) { + v.value = val + v.isSet = true +} + +func (v NullableCampaign) IsSet() bool { + return v.isSet +} + +func (v *NullableCampaign) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCampaign(val *Campaign) *NullableCampaign { + return &NullableCampaign{value: val, isSet: true} +} + +func (v NullableCampaign) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCampaign) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_campaign_conditions.go b/model_campaign_conditions.go new file mode 100644 index 0000000..2afd82d --- /dev/null +++ b/model_campaign_conditions.go @@ -0,0 +1,346 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the CampaignConditions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CampaignConditions{} + +// CampaignConditions The conditions to apply to a campaign. +type CampaignConditions struct { + // The campaign's start time in UTC format. For example, 2021-09-23T03:30:00Z means 2021-09-23 11:30:00 (UTC +08:00). + StartTime time.Time `json:"startTime"` + // The campaign's end time in UTC format. + EndTime time.Time `json:"endTime"` + // The type of eater eligible for the campaign. * `all` - campaign will be applied to everyone. No limitation on campaign type. * `new` - campaign will be applied to consumers who have not ordered from this store in the last three months. Only applicable to **order-level** campaign. + EaterType string `json:"eaterType"` + // The minimum basket amount to be eligible for the campaign. Only applicable for **order-level** campaign. For example, 10.5 means the basket amount has to be at least $10.50. + MinBasketAmount *float64 `json:"minBasketAmount,omitempty"` + // Specify the bundle quantity for bundle offer campaign. + BundleQuantity *int32 `json:"bundleQuantity,omitempty"` + WorkingHour *WorkingHour `json:"workingHour,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CampaignConditions CampaignConditions + +// NewCampaignConditions instantiates a new CampaignConditions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCampaignConditions(startTime time.Time, endTime time.Time, eaterType string) *CampaignConditions { + this := CampaignConditions{} + this.StartTime = startTime + this.EndTime = endTime + this.EaterType = eaterType + return &this +} + +// NewCampaignConditionsWithDefaults instantiates a new CampaignConditions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCampaignConditionsWithDefaults() *CampaignConditions { + this := CampaignConditions{} + return &this +} + +// GetStartTime returns the StartTime field value +func (o *CampaignConditions) GetStartTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetStartTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartTime, true +} + +// SetStartTime sets field value +func (o *CampaignConditions) SetStartTime(v time.Time) { + o.StartTime = v +} + +// GetEndTime returns the EndTime field value +func (o *CampaignConditions) GetEndTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndTime +} + +// GetEndTimeOk returns a tuple with the EndTime field value +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetEndTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndTime, true +} + +// SetEndTime sets field value +func (o *CampaignConditions) SetEndTime(v time.Time) { + o.EndTime = v +} + +// GetEaterType returns the EaterType field value +func (o *CampaignConditions) GetEaterType() string { + if o == nil { + var ret string + return ret + } + + return o.EaterType +} + +// GetEaterTypeOk returns a tuple with the EaterType field value +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetEaterTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EaterType, true +} + +// SetEaterType sets field value +func (o *CampaignConditions) SetEaterType(v string) { + o.EaterType = v +} + +// GetMinBasketAmount returns the MinBasketAmount field value if set, zero value otherwise. +func (o *CampaignConditions) GetMinBasketAmount() float64 { + if o == nil || IsNil(o.MinBasketAmount) { + var ret float64 + return ret + } + return *o.MinBasketAmount +} + +// GetMinBasketAmountOk returns a tuple with the MinBasketAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetMinBasketAmountOk() (*float64, bool) { + if o == nil || IsNil(o.MinBasketAmount) { + return nil, false + } + return o.MinBasketAmount, true +} + +// HasMinBasketAmount returns a boolean if a field has been set. +func (o *CampaignConditions) HasMinBasketAmount() bool { + if o != nil && !IsNil(o.MinBasketAmount) { + return true + } + + return false +} + +// SetMinBasketAmount gets a reference to the given float64 and assigns it to the MinBasketAmount field. +func (o *CampaignConditions) SetMinBasketAmount(v float64) { + o.MinBasketAmount = &v +} + +// GetBundleQuantity returns the BundleQuantity field value if set, zero value otherwise. +func (o *CampaignConditions) GetBundleQuantity() int32 { + if o == nil || IsNil(o.BundleQuantity) { + var ret int32 + return ret + } + return *o.BundleQuantity +} + +// GetBundleQuantityOk returns a tuple with the BundleQuantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetBundleQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.BundleQuantity) { + return nil, false + } + return o.BundleQuantity, true +} + +// HasBundleQuantity returns a boolean if a field has been set. +func (o *CampaignConditions) HasBundleQuantity() bool { + if o != nil && !IsNil(o.BundleQuantity) { + return true + } + + return false +} + +// SetBundleQuantity gets a reference to the given int32 and assigns it to the BundleQuantity field. +func (o *CampaignConditions) SetBundleQuantity(v int32) { + o.BundleQuantity = &v +} + +// GetWorkingHour returns the WorkingHour field value if set, zero value otherwise. +func (o *CampaignConditions) GetWorkingHour() WorkingHour { + if o == nil || IsNil(o.WorkingHour) { + var ret WorkingHour + return ret + } + return *o.WorkingHour +} + +// GetWorkingHourOk returns a tuple with the WorkingHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignConditions) GetWorkingHourOk() (*WorkingHour, bool) { + if o == nil || IsNil(o.WorkingHour) { + return nil, false + } + return o.WorkingHour, true +} + +// HasWorkingHour returns a boolean if a field has been set. +func (o *CampaignConditions) HasWorkingHour() bool { + if o != nil && !IsNil(o.WorkingHour) { + return true + } + + return false +} + +// SetWorkingHour gets a reference to the given WorkingHour and assigns it to the WorkingHour field. +func (o *CampaignConditions) SetWorkingHour(v WorkingHour) { + o.WorkingHour = &v +} + +func (o CampaignConditions) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CampaignConditions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startTime"] = o.StartTime + toSerialize["endTime"] = o.EndTime + toSerialize["eaterType"] = o.EaterType + if !IsNil(o.MinBasketAmount) { + toSerialize["minBasketAmount"] = o.MinBasketAmount + } + if !IsNil(o.BundleQuantity) { + toSerialize["bundleQuantity"] = o.BundleQuantity + } + if !IsNil(o.WorkingHour) { + toSerialize["workingHour"] = o.WorkingHour + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CampaignConditions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startTime", + "endTime", + "eaterType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCampaignConditions := _CampaignConditions{} + + err = json.Unmarshal(data, &varCampaignConditions) + + if err != nil { + return err + } + + *o = CampaignConditions(varCampaignConditions) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startTime") + delete(additionalProperties, "endTime") + delete(additionalProperties, "eaterType") + delete(additionalProperties, "minBasketAmount") + delete(additionalProperties, "bundleQuantity") + delete(additionalProperties, "workingHour") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCampaignConditions struct { + value *CampaignConditions + isSet bool +} + +func (v NullableCampaignConditions) Get() *CampaignConditions { + return v.value +} + +func (v *NullableCampaignConditions) Set(val *CampaignConditions) { + v.value = val + v.isSet = true +} + +func (v NullableCampaignConditions) IsSet() bool { + return v.isSet +} + +func (v *NullableCampaignConditions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCampaignConditions(val *CampaignConditions) *NullableCampaignConditions { + return &NullableCampaignConditions{value: val, isSet: true} +} + +func (v NullableCampaignConditions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCampaignConditions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_campaign_discount.go b/model_campaign_discount.go new file mode 100644 index 0000000..7367c24 --- /dev/null +++ b/model_campaign_discount.go @@ -0,0 +1,277 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the CampaignDiscount type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CampaignDiscount{} + +// CampaignDiscount The discount detail for a particular campaign when conditions are satisfied. +type CampaignDiscount struct { + // The type of discount + Type string `json:"type"` + // The maximum discount dollar amount. It is **not required** and will be ignored when the `discount.type` is: - `net` - `delivery` - `freeItem` - `bundleSameNet` - `bundleSamePercentage` - `bundleSameFixPrice` - `bundleDiffNet` - `bundleDiffPercentage` - `bundleDiffFixPrice` + Cap *float64 `json:"cap,omitempty"` + // Specify the discount amount. Decimal number is not supported For VN, ID and TH. For example, `10.5` is not allowed and it should be `10.0`. * Dollar amount value when `discount.type` is `net`, `delivery`, `bundleSameNet`, `bundleSameFixPrice`, `bundleDiffNet`, `bundleDiffFixPrice`. * Percentage value (0-100) when `discount.type` is `percentage`, `bundleSamePercentage`, `bundleDiffPercentage`. * **Not required** when `discount.type` is `freeItem`. + Value *float64 `json:"value,omitempty"` + Scope CampaignScope `json:"scope"` + AdditionalProperties map[string]interface{} +} + +type _CampaignDiscount CampaignDiscount + +// NewCampaignDiscount instantiates a new CampaignDiscount object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCampaignDiscount(type_ string, scope CampaignScope) *CampaignDiscount { + this := CampaignDiscount{} + this.Type = type_ + this.Scope = scope + return &this +} + +// NewCampaignDiscountWithDefaults instantiates a new CampaignDiscount object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCampaignDiscountWithDefaults() *CampaignDiscount { + this := CampaignDiscount{} + return &this +} + +// GetType returns the Type field value +func (o *CampaignDiscount) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CampaignDiscount) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CampaignDiscount) SetType(v string) { + o.Type = v +} + +// GetCap returns the Cap field value if set, zero value otherwise. +func (o *CampaignDiscount) GetCap() float64 { + if o == nil || IsNil(o.Cap) { + var ret float64 + return ret + } + return *o.Cap +} + +// GetCapOk returns a tuple with the Cap field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignDiscount) GetCapOk() (*float64, bool) { + if o == nil || IsNil(o.Cap) { + return nil, false + } + return o.Cap, true +} + +// HasCap returns a boolean if a field has been set. +func (o *CampaignDiscount) HasCap() bool { + if o != nil && !IsNil(o.Cap) { + return true + } + + return false +} + +// SetCap gets a reference to the given float64 and assigns it to the Cap field. +func (o *CampaignDiscount) SetCap(v float64) { + o.Cap = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CampaignDiscount) GetValue() float64 { + if o == nil || IsNil(o.Value) { + var ret float64 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignDiscount) GetValueOk() (*float64, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CampaignDiscount) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float64 and assigns it to the Value field. +func (o *CampaignDiscount) SetValue(v float64) { + o.Value = &v +} + +// GetScope returns the Scope field value +func (o *CampaignDiscount) GetScope() CampaignScope { + if o == nil { + var ret CampaignScope + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *CampaignDiscount) GetScopeOk() (*CampaignScope, bool) { + if o == nil { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value +func (o *CampaignDiscount) SetScope(v CampaignScope) { + o.Scope = v +} + +func (o CampaignDiscount) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CampaignDiscount) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if !IsNil(o.Cap) { + toSerialize["cap"] = o.Cap + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + toSerialize["scope"] = o.Scope + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CampaignDiscount) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "scope", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCampaignDiscount := _CampaignDiscount{} + + err = json.Unmarshal(data, &varCampaignDiscount) + + if err != nil { + return err + } + + *o = CampaignDiscount(varCampaignDiscount) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "cap") + delete(additionalProperties, "value") + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCampaignDiscount struct { + value *CampaignDiscount + isSet bool +} + +func (v NullableCampaignDiscount) Get() *CampaignDiscount { + return v.value +} + +func (v *NullableCampaignDiscount) Set(val *CampaignDiscount) { + v.value = val + v.isSet = true +} + +func (v NullableCampaignDiscount) IsSet() bool { + return v.isSet +} + +func (v *NullableCampaignDiscount) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCampaignDiscount(val *CampaignDiscount) *NullableCampaignDiscount { + return &NullableCampaignDiscount{value: val, isSet: true} +} + +func (v NullableCampaignDiscount) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCampaignDiscount) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_campaign_quotas.go b/model_campaign_quotas.go new file mode 100644 index 0000000..750a7e8 --- /dev/null +++ b/model_campaign_quotas.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the CampaignQuotas type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CampaignQuotas{} + +// CampaignQuotas The quotas/limits for a particular campaign. +type CampaignQuotas struct { + // The maximum number of redemptions. Default is unlimited if unspecified. + TotalCount *int64 `json:"totalCount,omitempty"` + // The maximum number of redemptions per user. Default is unlimited if unspecified. + TotalCountPerUser *int64 `json:"totalCountPerUser,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CampaignQuotas CampaignQuotas + +// NewCampaignQuotas instantiates a new CampaignQuotas object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCampaignQuotas() *CampaignQuotas { + this := CampaignQuotas{} + return &this +} + +// NewCampaignQuotasWithDefaults instantiates a new CampaignQuotas object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCampaignQuotasWithDefaults() *CampaignQuotas { + this := CampaignQuotas{} + return &this +} + +// GetTotalCount returns the TotalCount field value if set, zero value otherwise. +func (o *CampaignQuotas) GetTotalCount() int64 { + if o == nil || IsNil(o.TotalCount) { + var ret int64 + return ret + } + return *o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignQuotas) GetTotalCountOk() (*int64, bool) { + if o == nil || IsNil(o.TotalCount) { + return nil, false + } + return o.TotalCount, true +} + +// HasTotalCount returns a boolean if a field has been set. +func (o *CampaignQuotas) HasTotalCount() bool { + if o != nil && !IsNil(o.TotalCount) { + return true + } + + return false +} + +// SetTotalCount gets a reference to the given int64 and assigns it to the TotalCount field. +func (o *CampaignQuotas) SetTotalCount(v int64) { + o.TotalCount = &v +} + +// GetTotalCountPerUser returns the TotalCountPerUser field value if set, zero value otherwise. +func (o *CampaignQuotas) GetTotalCountPerUser() int64 { + if o == nil || IsNil(o.TotalCountPerUser) { + var ret int64 + return ret + } + return *o.TotalCountPerUser +} + +// GetTotalCountPerUserOk returns a tuple with the TotalCountPerUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignQuotas) GetTotalCountPerUserOk() (*int64, bool) { + if o == nil || IsNil(o.TotalCountPerUser) { + return nil, false + } + return o.TotalCountPerUser, true +} + +// HasTotalCountPerUser returns a boolean if a field has been set. +func (o *CampaignQuotas) HasTotalCountPerUser() bool { + if o != nil && !IsNil(o.TotalCountPerUser) { + return true + } + + return false +} + +// SetTotalCountPerUser gets a reference to the given int64 and assigns it to the TotalCountPerUser field. +func (o *CampaignQuotas) SetTotalCountPerUser(v int64) { + o.TotalCountPerUser = &v +} + +func (o CampaignQuotas) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CampaignQuotas) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TotalCount) { + toSerialize["totalCount"] = o.TotalCount + } + if !IsNil(o.TotalCountPerUser) { + toSerialize["totalCountPerUser"] = o.TotalCountPerUser + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CampaignQuotas) UnmarshalJSON(data []byte) (err error) { + varCampaignQuotas := _CampaignQuotas{} + + err = json.Unmarshal(data, &varCampaignQuotas) + + if err != nil { + return err + } + + *o = CampaignQuotas(varCampaignQuotas) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "totalCount") + delete(additionalProperties, "totalCountPerUser") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCampaignQuotas struct { + value *CampaignQuotas + isSet bool +} + +func (v NullableCampaignQuotas) Get() *CampaignQuotas { + return v.value +} + +func (v *NullableCampaignQuotas) Set(val *CampaignQuotas) { + v.value = val + v.isSet = true +} + +func (v NullableCampaignQuotas) IsSet() bool { + return v.isSet +} + +func (v *NullableCampaignQuotas) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCampaignQuotas(val *CampaignQuotas) *NullableCampaignQuotas { + return &NullableCampaignQuotas{value: val, isSet: true} +} + +func (v NullableCampaignQuotas) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCampaignQuotas) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_campaign_scope.go b/model_campaign_scope.go new file mode 100644 index 0000000..7bc278d --- /dev/null +++ b/model_campaign_scope.go @@ -0,0 +1,210 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the CampaignScope type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CampaignScope{} + +// CampaignScope The scope level for a particular campaign. +type CampaignScope struct { + // The scope type for this campaign. * `order` - order level campaign. * `items` - item level campaign or bundle offer. * `category` - category level campaign where all items within applies the same discount. + Type string `json:"type"` + // The list of item IDs in the partner's database applicable for discount when `discount.scope.type` is `items` (or category IDs for `category`). One and only 1 item supported when `discount.type` is: - `freeItem` - `bundleSameNet` - `bundleSamePercentage` - `bundleSameFixPrice` Minimum 2 - Maximum 20 items supported when `discount.type` is: - `bundleDiffNet` - `bundleDiffPercentage` - `bundleDiffFixPrice` + ObjectIDs []string `json:"objectIDs,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CampaignScope CampaignScope + +// NewCampaignScope instantiates a new CampaignScope object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCampaignScope(type_ string) *CampaignScope { + this := CampaignScope{} + this.Type = type_ + return &this +} + +// NewCampaignScopeWithDefaults instantiates a new CampaignScope object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCampaignScopeWithDefaults() *CampaignScope { + this := CampaignScope{} + return &this +} + +// GetType returns the Type field value +func (o *CampaignScope) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CampaignScope) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *CampaignScope) SetType(v string) { + o.Type = v +} + +// GetObjectIDs returns the ObjectIDs field value if set, zero value otherwise. +func (o *CampaignScope) GetObjectIDs() []string { + if o == nil || IsNil(o.ObjectIDs) { + var ret []string + return ret + } + return o.ObjectIDs +} + +// GetObjectIDsOk returns a tuple with the ObjectIDs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CampaignScope) GetObjectIDsOk() ([]string, bool) { + if o == nil || IsNil(o.ObjectIDs) { + return nil, false + } + return o.ObjectIDs, true +} + +// HasObjectIDs returns a boolean if a field has been set. +func (o *CampaignScope) HasObjectIDs() bool { + if o != nil && !IsNil(o.ObjectIDs) { + return true + } + + return false +} + +// SetObjectIDs gets a reference to the given []string and assigns it to the ObjectIDs field. +func (o *CampaignScope) SetObjectIDs(v []string) { + o.ObjectIDs = v +} + +func (o CampaignScope) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CampaignScope) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + if !IsNil(o.ObjectIDs) { + toSerialize["objectIDs"] = o.ObjectIDs + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CampaignScope) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCampaignScope := _CampaignScope{} + + err = json.Unmarshal(data, &varCampaignScope) + + if err != nil { + return err + } + + *o = CampaignScope(varCampaignScope) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "type") + delete(additionalProperties, "objectIDs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCampaignScope struct { + value *CampaignScope + isSet bool +} + +func (v NullableCampaignScope) Get() *CampaignScope { + return v.value +} + +func (v *NullableCampaignScope) Set(val *CampaignScope) { + v.value = val + v.isSet = true +} + +func (v NullableCampaignScope) IsSet() bool { + return v.isSet +} + +func (v *NullableCampaignScope) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCampaignScope(val *CampaignScope) *NullableCampaignScope { + return &NullableCampaignScope{value: val, isSet: true} +} + +func (v NullableCampaignScope) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCampaignScope) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_cancel_code.go b/model_cancel_code.go new file mode 100644 index 0000000..33c0ccc --- /dev/null +++ b/model_cancel_code.go @@ -0,0 +1,118 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// CancelCode The cancel code for a specific cancel reason. +type CancelCode int32 + +// List of cancelCode +const ( + _1001 CancelCode = 1001 + _1002 CancelCode = 1002 + _1003 CancelCode = 1003 + _1004 CancelCode = 1004 +) + +// All allowed values of CancelCode enum +var AllowedCancelCodeEnumValues = []CancelCode{ + 1001, + 1002, + 1003, + 1004, +} + +func (v *CancelCode) UnmarshalJSON(src []byte) error { + var value int32 + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CancelCode(value) + for _, existing := range AllowedCancelCodeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CancelCode", value) +} + +// NewCancelCodeFromValue returns a pointer to a valid CancelCode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCancelCodeFromValue(v int32) (*CancelCode, error) { + ev := CancelCode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CancelCode: valid values are %v", v, AllowedCancelCodeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CancelCode) IsValid() bool { + for _, existing := range AllowedCancelCodeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to cancelCode value +func (v CancelCode) Ptr() *CancelCode { + return &v +} + +type NullableCancelCode struct { + value *CancelCode + isSet bool +} + +func (v NullableCancelCode) Get() *CancelCode { + return v.value +} + +func (v *NullableCancelCode) Set(val *CancelCode) { + v.value = val + v.isSet = true +} + +func (v NullableCancelCode) IsSet() bool { + return v.isSet +} + +func (v *NullableCancelCode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCancelCode(val *CancelCode) *NullableCancelCode { + return &NullableCancelCode{value: val, isSet: true} +} + +func (v NullableCancelCode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCancelCode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_cancel_order_limit_type.go b/model_cancel_order_limit_type.go new file mode 100644 index 0000000..32232a5 --- /dev/null +++ b/model_cancel_order_limit_type.go @@ -0,0 +1,120 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// CancelOrderLimitType The type of the order cancellation limit. +type CancelOrderLimitType string + +// List of cancelOrderLimitType +const ( + NOT_APPROACHING_LIMIT CancelOrderLimitType = "not approaching limit" + APPROACHING_THE_DAILY_LIMIT CancelOrderLimitType = "approaching the daily limit" + APPROACHING_THE_WEEKLY_LIMIT CancelOrderLimitType = "approaching the weekly limit" + APPROACHING_THE_MONTHLY_LIMIT CancelOrderLimitType = "approaching the monthly limit" + EMPTY CancelOrderLimitType = "" +) + +// All allowed values of CancelOrderLimitType enum +var AllowedCancelOrderLimitTypeEnumValues = []CancelOrderLimitType{ + "not approaching limit", + "approaching the daily limit", + "approaching the weekly limit", + "approaching the monthly limit", + "", +} + +func (v *CancelOrderLimitType) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CancelOrderLimitType(value) + for _, existing := range AllowedCancelOrderLimitTypeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CancelOrderLimitType", value) +} + +// NewCancelOrderLimitTypeFromValue returns a pointer to a valid CancelOrderLimitType +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCancelOrderLimitTypeFromValue(v string) (*CancelOrderLimitType, error) { + ev := CancelOrderLimitType(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CancelOrderLimitType: valid values are %v", v, AllowedCancelOrderLimitTypeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CancelOrderLimitType) IsValid() bool { + for _, existing := range AllowedCancelOrderLimitTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to cancelOrderLimitType value +func (v CancelOrderLimitType) Ptr() *CancelOrderLimitType { + return &v +} + +type NullableCancelOrderLimitType struct { + value *CancelOrderLimitType + isSet bool +} + +func (v NullableCancelOrderLimitType) Get() *CancelOrderLimitType { + return v.value +} + +func (v *NullableCancelOrderLimitType) Set(val *CancelOrderLimitType) { + v.value = val + v.isSet = true +} + +func (v NullableCancelOrderLimitType) IsSet() bool { + return v.isSet +} + +func (v *NullableCancelOrderLimitType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCancelOrderLimitType(val *CancelOrderLimitType) *NullableCancelOrderLimitType { + return &NullableCancelOrderLimitType{value: val, isSet: true} +} + +func (v NullableCancelOrderLimitType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCancelOrderLimitType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + diff --git a/model_cancel_order_request.go b/model_cancel_order_request.go new file mode 100644 index 0000000..93e682a --- /dev/null +++ b/model_cancel_order_request.go @@ -0,0 +1,231 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the CancelOrderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CancelOrderRequest{} + +// CancelOrderRequest This request cancels an order on GrabFood. +type CancelOrderRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + CancelCode CancelCode `json:"cancelCode"` + AdditionalProperties map[string]interface{} +} + +type _CancelOrderRequest CancelOrderRequest + +// NewCancelOrderRequest instantiates a new CancelOrderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCancelOrderRequest(orderID string, merchantID string, cancelCode CancelCode) *CancelOrderRequest { + this := CancelOrderRequest{} + this.OrderID = orderID + this.MerchantID = merchantID + this.CancelCode = cancelCode + return &this +} + +// NewCancelOrderRequestWithDefaults instantiates a new CancelOrderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCancelOrderRequestWithDefaults() *CancelOrderRequest { + this := CancelOrderRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *CancelOrderRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *CancelOrderRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *CancelOrderRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetMerchantID returns the MerchantID field value +func (o *CancelOrderRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *CancelOrderRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *CancelOrderRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetCancelCode returns the CancelCode field value +func (o *CancelOrderRequest) GetCancelCode() CancelCode { + if o == nil { + var ret CancelCode + return ret + } + + return o.CancelCode +} + +// GetCancelCodeOk returns a tuple with the CancelCode field value +// and a boolean to check if the value has been set. +func (o *CancelOrderRequest) GetCancelCodeOk() (*CancelCode, bool) { + if o == nil { + return nil, false + } + return &o.CancelCode, true +} + +// SetCancelCode sets field value +func (o *CancelOrderRequest) SetCancelCode(v CancelCode) { + o.CancelCode = v +} + +func (o CancelOrderRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CancelOrderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["merchantID"] = o.MerchantID + toSerialize["cancelCode"] = o.CancelCode + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CancelOrderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "merchantID", + "cancelCode", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCancelOrderRequest := _CancelOrderRequest{} + + err = json.Unmarshal(data, &varCancelOrderRequest) + + if err != nil { + return err + } + + *o = CancelOrderRequest(varCancelOrderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "cancelCode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCancelOrderRequest struct { + value *CancelOrderRequest + isSet bool +} + +func (v NullableCancelOrderRequest) Get() *CancelOrderRequest { + return v.value +} + +func (v *NullableCancelOrderRequest) Set(val *CancelOrderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCancelOrderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCancelOrderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCancelOrderRequest(val *CancelOrderRequest) *NullableCancelOrderRequest { + return &NullableCancelOrderRequest{value: val, isSet: true} +} + +func (v NullableCancelOrderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCancelOrderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_cancel_order_response.go b/model_cancel_order_response.go new file mode 100644 index 0000000..af1891f --- /dev/null +++ b/model_cancel_order_response.go @@ -0,0 +1,196 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the CancelOrderResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CancelOrderResponse{} + +// CancelOrderResponse +type CancelOrderResponse struct { + LimitType *CancelOrderLimitType `json:"limitType,omitempty"` + // The remaining cancellation quota for the merchant. A value is only returned when the nearest remaining cancellation limit is approaching, else it returns 0. + LimitTimes *int64 `json:"limitTimes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CancelOrderResponse CancelOrderResponse + +// NewCancelOrderResponse instantiates a new CancelOrderResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCancelOrderResponse() *CancelOrderResponse { + this := CancelOrderResponse{} + return &this +} + +// NewCancelOrderResponseWithDefaults instantiates a new CancelOrderResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCancelOrderResponseWithDefaults() *CancelOrderResponse { + this := CancelOrderResponse{} + return &this +} + +// GetLimitType returns the LimitType field value if set, zero value otherwise. +func (o *CancelOrderResponse) GetLimitType() CancelOrderLimitType { + if o == nil || IsNil(o.LimitType) { + var ret CancelOrderLimitType + return ret + } + return *o.LimitType +} + +// GetLimitTypeOk returns a tuple with the LimitType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CancelOrderResponse) GetLimitTypeOk() (*CancelOrderLimitType, bool) { + if o == nil || IsNil(o.LimitType) { + return nil, false + } + return o.LimitType, true +} + +// HasLimitType returns a boolean if a field has been set. +func (o *CancelOrderResponse) HasLimitType() bool { + if o != nil && !IsNil(o.LimitType) { + return true + } + + return false +} + +// SetLimitType gets a reference to the given CancelOrderLimitType and assigns it to the LimitType field. +func (o *CancelOrderResponse) SetLimitType(v CancelOrderLimitType) { + o.LimitType = &v +} + +// GetLimitTimes returns the LimitTimes field value if set, zero value otherwise. +func (o *CancelOrderResponse) GetLimitTimes() int64 { + if o == nil || IsNil(o.LimitTimes) { + var ret int64 + return ret + } + return *o.LimitTimes +} + +// GetLimitTimesOk returns a tuple with the LimitTimes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CancelOrderResponse) GetLimitTimesOk() (*int64, bool) { + if o == nil || IsNil(o.LimitTimes) { + return nil, false + } + return o.LimitTimes, true +} + +// HasLimitTimes returns a boolean if a field has been set. +func (o *CancelOrderResponse) HasLimitTimes() bool { + if o != nil && !IsNil(o.LimitTimes) { + return true + } + + return false +} + +// SetLimitTimes gets a reference to the given int64 and assigns it to the LimitTimes field. +func (o *CancelOrderResponse) SetLimitTimes(v int64) { + o.LimitTimes = &v +} + +func (o CancelOrderResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CancelOrderResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LimitType) { + toSerialize["limitType"] = o.LimitType + } + if !IsNil(o.LimitTimes) { + toSerialize["limitTimes"] = o.LimitTimes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CancelOrderResponse) UnmarshalJSON(data []byte) (err error) { + varCancelOrderResponse := _CancelOrderResponse{} + + err = json.Unmarshal(data, &varCancelOrderResponse) + + if err != nil { + return err + } + + *o = CancelOrderResponse(varCancelOrderResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "limitType") + delete(additionalProperties, "limitTimes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCancelOrderResponse struct { + value *CancelOrderResponse + isSet bool +} + +func (v NullableCancelOrderResponse) Get() *CancelOrderResponse { + return v.value +} + +func (v *NullableCancelOrderResponse) Set(val *CancelOrderResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCancelOrderResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCancelOrderResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCancelOrderResponse(val *CancelOrderResponse) *NullableCancelOrderResponse { + return &NullableCancelOrderResponse{value: val, isSet: true} +} + +func (v NullableCancelOrderResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCancelOrderResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_cancel_reason.go b/model_cancel_reason.go new file mode 100644 index 0000000..0ea2803 --- /dev/null +++ b/model_cancel_reason.go @@ -0,0 +1,196 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the CancelReason type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CancelReason{} + +// CancelReason struct for CancelReason +type CancelReason struct { + Code *CancelCode `json:"code,omitempty"` + // The detailed cancel reason for the specific cancel code. - Items are unavailable - I have too many orders now - My shop is closed - My shop is closing soon + Reason *string `json:"reason,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CancelReason CancelReason + +// NewCancelReason instantiates a new CancelReason object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCancelReason() *CancelReason { + this := CancelReason{} + return &this +} + +// NewCancelReasonWithDefaults instantiates a new CancelReason object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCancelReasonWithDefaults() *CancelReason { + this := CancelReason{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *CancelReason) GetCode() CancelCode { + if o == nil || IsNil(o.Code) { + var ret CancelCode + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CancelReason) GetCodeOk() (*CancelCode, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *CancelReason) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given CancelCode and assigns it to the Code field. +func (o *CancelReason) SetCode(v CancelCode) { + o.Code = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *CancelReason) GetReason() string { + if o == nil || IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CancelReason) GetReasonOk() (*string, bool) { + if o == nil || IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *CancelReason) HasReason() bool { + if o != nil && !IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *CancelReason) SetReason(v string) { + o.Reason = &v +} + +func (o CancelReason) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CancelReason) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CancelReason) UnmarshalJSON(data []byte) (err error) { + varCancelReason := _CancelReason{} + + err = json.Unmarshal(data, &varCancelReason) + + if err != nil { + return err + } + + *o = CancelReason(varCancelReason) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "reason") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCancelReason struct { + value *CancelReason + isSet bool +} + +func (v NullableCancelReason) Get() *CancelReason { + return v.value +} + +func (v *NullableCancelReason) Set(val *CancelReason) { + v.value = val + v.isSet = true +} + +func (v NullableCancelReason) IsSet() bool { + return v.isSet +} + +func (v *NullableCancelReason) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCancelReason(val *CancelReason) *NullableCancelReason { + return &NullableCancelReason{value: val, isSet: true} +} + +func (v NullableCancelReason) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCancelReason) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_check_order_cancelable_response.go b/model_check_order_cancelable_response.go new file mode 100644 index 0000000..182119f --- /dev/null +++ b/model_check_order_cancelable_response.go @@ -0,0 +1,310 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the CheckOrderCancelableResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CheckOrderCancelableResponse{} + +// CheckOrderCancelableResponse +type CheckOrderCancelableResponse struct { + // The boolean value to indicate whether an order can be cancelled. + CancelAble *bool `json:"cancelAble,omitempty"` + // The reason for the order to be non-cancelable. + NonCancellationReason *string `json:"nonCancellationReason,omitempty"` + LimitType *CancelOrderLimitType `json:"limitType,omitempty"` + // The remaining cancellation quota for the merchant. A value is only returned when the nearest remaining cancellation limit is approaching, else it returns 0. + LimitTimes *int64 `json:"limitTimes,omitempty"` + // An array of cancel order reasons JSON objects. + CancelReasons []CancelReason `json:"cancelReasons,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CheckOrderCancelableResponse CheckOrderCancelableResponse + +// NewCheckOrderCancelableResponse instantiates a new CheckOrderCancelableResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCheckOrderCancelableResponse() *CheckOrderCancelableResponse { + this := CheckOrderCancelableResponse{} + return &this +} + +// NewCheckOrderCancelableResponseWithDefaults instantiates a new CheckOrderCancelableResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCheckOrderCancelableResponseWithDefaults() *CheckOrderCancelableResponse { + this := CheckOrderCancelableResponse{} + return &this +} + +// GetCancelAble returns the CancelAble field value if set, zero value otherwise. +func (o *CheckOrderCancelableResponse) GetCancelAble() bool { + if o == nil || IsNil(o.CancelAble) { + var ret bool + return ret + } + return *o.CancelAble +} + +// GetCancelAbleOk returns a tuple with the CancelAble field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckOrderCancelableResponse) GetCancelAbleOk() (*bool, bool) { + if o == nil || IsNil(o.CancelAble) { + return nil, false + } + return o.CancelAble, true +} + +// HasCancelAble returns a boolean if a field has been set. +func (o *CheckOrderCancelableResponse) HasCancelAble() bool { + if o != nil && !IsNil(o.CancelAble) { + return true + } + + return false +} + +// SetCancelAble gets a reference to the given bool and assigns it to the CancelAble field. +func (o *CheckOrderCancelableResponse) SetCancelAble(v bool) { + o.CancelAble = &v +} + +// GetNonCancellationReason returns the NonCancellationReason field value if set, zero value otherwise. +func (o *CheckOrderCancelableResponse) GetNonCancellationReason() string { + if o == nil || IsNil(o.NonCancellationReason) { + var ret string + return ret + } + return *o.NonCancellationReason +} + +// GetNonCancellationReasonOk returns a tuple with the NonCancellationReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckOrderCancelableResponse) GetNonCancellationReasonOk() (*string, bool) { + if o == nil || IsNil(o.NonCancellationReason) { + return nil, false + } + return o.NonCancellationReason, true +} + +// HasNonCancellationReason returns a boolean if a field has been set. +func (o *CheckOrderCancelableResponse) HasNonCancellationReason() bool { + if o != nil && !IsNil(o.NonCancellationReason) { + return true + } + + return false +} + +// SetNonCancellationReason gets a reference to the given string and assigns it to the NonCancellationReason field. +func (o *CheckOrderCancelableResponse) SetNonCancellationReason(v string) { + o.NonCancellationReason = &v +} + +// GetLimitType returns the LimitType field value if set, zero value otherwise. +func (o *CheckOrderCancelableResponse) GetLimitType() CancelOrderLimitType { + if o == nil || IsNil(o.LimitType) { + var ret CancelOrderLimitType + return ret + } + return *o.LimitType +} + +// GetLimitTypeOk returns a tuple with the LimitType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckOrderCancelableResponse) GetLimitTypeOk() (*CancelOrderLimitType, bool) { + if o == nil || IsNil(o.LimitType) { + return nil, false + } + return o.LimitType, true +} + +// HasLimitType returns a boolean if a field has been set. +func (o *CheckOrderCancelableResponse) HasLimitType() bool { + if o != nil && !IsNil(o.LimitType) { + return true + } + + return false +} + +// SetLimitType gets a reference to the given CancelOrderLimitType and assigns it to the LimitType field. +func (o *CheckOrderCancelableResponse) SetLimitType(v CancelOrderLimitType) { + o.LimitType = &v +} + +// GetLimitTimes returns the LimitTimes field value if set, zero value otherwise. +func (o *CheckOrderCancelableResponse) GetLimitTimes() int64 { + if o == nil || IsNil(o.LimitTimes) { + var ret int64 + return ret + } + return *o.LimitTimes +} + +// GetLimitTimesOk returns a tuple with the LimitTimes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckOrderCancelableResponse) GetLimitTimesOk() (*int64, bool) { + if o == nil || IsNil(o.LimitTimes) { + return nil, false + } + return o.LimitTimes, true +} + +// HasLimitTimes returns a boolean if a field has been set. +func (o *CheckOrderCancelableResponse) HasLimitTimes() bool { + if o != nil && !IsNil(o.LimitTimes) { + return true + } + + return false +} + +// SetLimitTimes gets a reference to the given int64 and assigns it to the LimitTimes field. +func (o *CheckOrderCancelableResponse) SetLimitTimes(v int64) { + o.LimitTimes = &v +} + +// GetCancelReasons returns the CancelReasons field value if set, zero value otherwise. +func (o *CheckOrderCancelableResponse) GetCancelReasons() []CancelReason { + if o == nil || IsNil(o.CancelReasons) { + var ret []CancelReason + return ret + } + return o.CancelReasons +} + +// GetCancelReasonsOk returns a tuple with the CancelReasons field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CheckOrderCancelableResponse) GetCancelReasonsOk() ([]CancelReason, bool) { + if o == nil || IsNil(o.CancelReasons) { + return nil, false + } + return o.CancelReasons, true +} + +// HasCancelReasons returns a boolean if a field has been set. +func (o *CheckOrderCancelableResponse) HasCancelReasons() bool { + if o != nil && !IsNil(o.CancelReasons) { + return true + } + + return false +} + +// SetCancelReasons gets a reference to the given []CancelReason and assigns it to the CancelReasons field. +func (o *CheckOrderCancelableResponse) SetCancelReasons(v []CancelReason) { + o.CancelReasons = v +} + +func (o CheckOrderCancelableResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CheckOrderCancelableResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CancelAble) { + toSerialize["cancelAble"] = o.CancelAble + } + if !IsNil(o.NonCancellationReason) { + toSerialize["nonCancellationReason"] = o.NonCancellationReason + } + if !IsNil(o.LimitType) { + toSerialize["limitType"] = o.LimitType + } + if !IsNil(o.LimitTimes) { + toSerialize["limitTimes"] = o.LimitTimes + } + if !IsNil(o.CancelReasons) { + toSerialize["cancelReasons"] = o.CancelReasons + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CheckOrderCancelableResponse) UnmarshalJSON(data []byte) (err error) { + varCheckOrderCancelableResponse := _CheckOrderCancelableResponse{} + + err = json.Unmarshal(data, &varCheckOrderCancelableResponse) + + if err != nil { + return err + } + + *o = CheckOrderCancelableResponse(varCheckOrderCancelableResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "cancelAble") + delete(additionalProperties, "nonCancellationReason") + delete(additionalProperties, "limitType") + delete(additionalProperties, "limitTimes") + delete(additionalProperties, "cancelReasons") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCheckOrderCancelableResponse struct { + value *CheckOrderCancelableResponse + isSet bool +} + +func (v NullableCheckOrderCancelableResponse) Get() *CheckOrderCancelableResponse { + return v.value +} + +func (v *NullableCheckOrderCancelableResponse) Set(val *CheckOrderCancelableResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCheckOrderCancelableResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCheckOrderCancelableResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCheckOrderCancelableResponse(val *CheckOrderCancelableResponse) *NullableCheckOrderCancelableResponse { + return &NullableCheckOrderCancelableResponse{value: val, isSet: true} +} + +func (v NullableCheckOrderCancelableResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCheckOrderCancelableResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_coordinates.go b/model_coordinates.go new file mode 100644 index 0000000..ca0892e --- /dev/null +++ b/model_coordinates.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Coordinates type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Coordinates{} + +// Coordinates A JSON object containing the coordinates of the delivery address. Only has value when poiSource is `GRAB`. +type Coordinates struct { + // The latitude coordinates of the delivery address. + Latitude *float64 `json:"latitude,omitempty"` + // The longitude coordinates of the delivery address. + Longitude *float64 `json:"longitude,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Coordinates Coordinates + +// NewCoordinates instantiates a new Coordinates object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCoordinates() *Coordinates { + this := Coordinates{} + return &this +} + +// NewCoordinatesWithDefaults instantiates a new Coordinates object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCoordinatesWithDefaults() *Coordinates { + this := Coordinates{} + return &this +} + +// GetLatitude returns the Latitude field value if set, zero value otherwise. +func (o *Coordinates) GetLatitude() float64 { + if o == nil || IsNil(o.Latitude) { + var ret float64 + return ret + } + return *o.Latitude +} + +// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Coordinates) GetLatitudeOk() (*float64, bool) { + if o == nil || IsNil(o.Latitude) { + return nil, false + } + return o.Latitude, true +} + +// HasLatitude returns a boolean if a field has been set. +func (o *Coordinates) HasLatitude() bool { + if o != nil && !IsNil(o.Latitude) { + return true + } + + return false +} + +// SetLatitude gets a reference to the given float64 and assigns it to the Latitude field. +func (o *Coordinates) SetLatitude(v float64) { + o.Latitude = &v +} + +// GetLongitude returns the Longitude field value if set, zero value otherwise. +func (o *Coordinates) GetLongitude() float64 { + if o == nil || IsNil(o.Longitude) { + var ret float64 + return ret + } + return *o.Longitude +} + +// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Coordinates) GetLongitudeOk() (*float64, bool) { + if o == nil || IsNil(o.Longitude) { + return nil, false + } + return o.Longitude, true +} + +// HasLongitude returns a boolean if a field has been set. +func (o *Coordinates) HasLongitude() bool { + if o != nil && !IsNil(o.Longitude) { + return true + } + + return false +} + +// SetLongitude gets a reference to the given float64 and assigns it to the Longitude field. +func (o *Coordinates) SetLongitude(v float64) { + o.Longitude = &v +} + +func (o Coordinates) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Coordinates) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Latitude) { + toSerialize["latitude"] = o.Latitude + } + if !IsNil(o.Longitude) { + toSerialize["longitude"] = o.Longitude + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Coordinates) UnmarshalJSON(data []byte) (err error) { + varCoordinates := _Coordinates{} + + err = json.Unmarshal(data, &varCoordinates) + + if err != nil { + return err + } + + *o = Coordinates(varCoordinates) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "latitude") + delete(additionalProperties, "longitude") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCoordinates struct { + value *Coordinates + isSet bool +} + +func (v NullableCoordinates) Get() *Coordinates { + return v.value +} + +func (v *NullableCoordinates) Set(val *Coordinates) { + v.value = val + v.isSet = true +} + +func (v NullableCoordinates) IsSet() bool { + return v.isSet +} + +func (v *NullableCoordinates) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCoordinates(val *Coordinates) *NullableCoordinates { + return &NullableCoordinates{value: val, isSet: true} +} + +func (v NullableCoordinates) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCoordinates) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_campaign_request.go b/model_create_campaign_request.go new file mode 100644 index 0000000..c06acad --- /dev/null +++ b/model_create_campaign_request.go @@ -0,0 +1,335 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the CreateCampaignRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCampaignRequest{} + +// CreateCampaignRequest This request creates a campaign for your GrabFood store. +type CreateCampaignRequest struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The campaign's name. + Name string `json:"name"` + Quotas *CampaignQuotas `json:"quotas,omitempty"` + Conditions CampaignConditions `json:"conditions"` + Discount CampaignDiscount `json:"discount"` + // Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. + CustomTag *string `json:"customTag,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCampaignRequest CreateCampaignRequest + +// NewCreateCampaignRequest instantiates a new CreateCampaignRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCampaignRequest(merchantID string, name string, conditions CampaignConditions, discount CampaignDiscount) *CreateCampaignRequest { + this := CreateCampaignRequest{} + this.MerchantID = merchantID + this.Name = name + this.Conditions = conditions + this.Discount = discount + return &this +} + +// NewCreateCampaignRequestWithDefaults instantiates a new CreateCampaignRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCampaignRequestWithDefaults() *CreateCampaignRequest { + this := CreateCampaignRequest{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *CreateCampaignRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *CreateCampaignRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetName returns the Name field value +func (o *CreateCampaignRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateCampaignRequest) SetName(v string) { + o.Name = v +} + +// GetQuotas returns the Quotas field value if set, zero value otherwise. +func (o *CreateCampaignRequest) GetQuotas() CampaignQuotas { + if o == nil || IsNil(o.Quotas) { + var ret CampaignQuotas + return ret + } + return *o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetQuotasOk() (*CampaignQuotas, bool) { + if o == nil || IsNil(o.Quotas) { + return nil, false + } + return o.Quotas, true +} + +// HasQuotas returns a boolean if a field has been set. +func (o *CreateCampaignRequest) HasQuotas() bool { + if o != nil && !IsNil(o.Quotas) { + return true + } + + return false +} + +// SetQuotas gets a reference to the given CampaignQuotas and assigns it to the Quotas field. +func (o *CreateCampaignRequest) SetQuotas(v CampaignQuotas) { + o.Quotas = &v +} + +// GetConditions returns the Conditions field value +func (o *CreateCampaignRequest) GetConditions() CampaignConditions { + if o == nil { + var ret CampaignConditions + return ret + } + + return o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetConditionsOk() (*CampaignConditions, bool) { + if o == nil { + return nil, false + } + return &o.Conditions, true +} + +// SetConditions sets field value +func (o *CreateCampaignRequest) SetConditions(v CampaignConditions) { + o.Conditions = v +} + +// GetDiscount returns the Discount field value +func (o *CreateCampaignRequest) GetDiscount() CampaignDiscount { + if o == nil { + var ret CampaignDiscount + return ret + } + + return o.Discount +} + +// GetDiscountOk returns a tuple with the Discount field value +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetDiscountOk() (*CampaignDiscount, bool) { + if o == nil { + return nil, false + } + return &o.Discount, true +} + +// SetDiscount sets field value +func (o *CreateCampaignRequest) SetDiscount(v CampaignDiscount) { + o.Discount = v +} + +// GetCustomTag returns the CustomTag field value if set, zero value otherwise. +func (o *CreateCampaignRequest) GetCustomTag() string { + if o == nil || IsNil(o.CustomTag) { + var ret string + return ret + } + return *o.CustomTag +} + +// GetCustomTagOk returns a tuple with the CustomTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCampaignRequest) GetCustomTagOk() (*string, bool) { + if o == nil || IsNil(o.CustomTag) { + return nil, false + } + return o.CustomTag, true +} + +// HasCustomTag returns a boolean if a field has been set. +func (o *CreateCampaignRequest) HasCustomTag() bool { + if o != nil && !IsNil(o.CustomTag) { + return true + } + + return false +} + +// SetCustomTag gets a reference to the given string and assigns it to the CustomTag field. +func (o *CreateCampaignRequest) SetCustomTag(v string) { + o.CustomTag = &v +} + +func (o CreateCampaignRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCampaignRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["name"] = o.Name + if !IsNil(o.Quotas) { + toSerialize["quotas"] = o.Quotas + } + toSerialize["conditions"] = o.Conditions + toSerialize["discount"] = o.Discount + if !IsNil(o.CustomTag) { + toSerialize["customTag"] = o.CustomTag + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCampaignRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "name", + "conditions", + "discount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateCampaignRequest := _CreateCampaignRequest{} + + err = json.Unmarshal(data, &varCreateCampaignRequest) + + if err != nil { + return err + } + + *o = CreateCampaignRequest(varCreateCampaignRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "name") + delete(additionalProperties, "quotas") + delete(additionalProperties, "conditions") + delete(additionalProperties, "discount") + delete(additionalProperties, "customTag") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCampaignRequest struct { + value *CreateCampaignRequest + isSet bool +} + +func (v NullableCreateCampaignRequest) Get() *CreateCampaignRequest { + return v.value +} + +func (v *NullableCreateCampaignRequest) Set(val *CreateCampaignRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCampaignRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCampaignRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCampaignRequest(val *CreateCampaignRequest) *NullableCreateCampaignRequest { + return &NullableCreateCampaignRequest{value: val, isSet: true} +} + +func (v NullableCreateCampaignRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCampaignRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_create_campaign_response.go b/model_create_campaign_response.go new file mode 100644 index 0000000..34f1a4f --- /dev/null +++ b/model_create_campaign_response.go @@ -0,0 +1,159 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the CreateCampaignResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateCampaignResponse{} + +// CreateCampaignResponse +type CreateCampaignResponse struct { + // The campaign's ID. + Id *string `json:"id,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateCampaignResponse CreateCampaignResponse + +// NewCreateCampaignResponse instantiates a new CreateCampaignResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateCampaignResponse() *CreateCampaignResponse { + this := CreateCampaignResponse{} + return &this +} + +// NewCreateCampaignResponseWithDefaults instantiates a new CreateCampaignResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateCampaignResponseWithDefaults() *CreateCampaignResponse { + this := CreateCampaignResponse{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateCampaignResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateCampaignResponse) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateCampaignResponse) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateCampaignResponse) SetId(v string) { + o.Id = &v +} + +func (o CreateCampaignResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateCampaignResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateCampaignResponse) UnmarshalJSON(data []byte) (err error) { + varCreateCampaignResponse := _CreateCampaignResponse{} + + err = json.Unmarshal(data, &varCreateCampaignResponse) + + if err != nil { + return err + } + + *o = CreateCampaignResponse(varCreateCampaignResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateCampaignResponse struct { + value *CreateCampaignResponse + isSet bool +} + +func (v NullableCreateCampaignResponse) Get() *CreateCampaignResponse { + return v.value +} + +func (v *NullableCreateCampaignResponse) Set(val *CreateCampaignResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateCampaignResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateCampaignResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateCampaignResponse(val *CreateCampaignResponse) *NullableCreateCampaignResponse { + return &NullableCreateCampaignResponse{value: val, isSet: true} +} + +func (v NullableCreateCampaignResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateCampaignResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_currency.go b/model_currency.go new file mode 100644 index 0000000..02811fb --- /dev/null +++ b/model_currency.go @@ -0,0 +1,232 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the Currency type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Currency{} + +// Currency A JSON object containing code, symbol, and exponent for a given currency. Refer to [Country and Currency](#section/Getting-started/Country-and-currency). +type Currency struct { + // The three-letter ISO currency code. This is the currency that is associated with the payment amount. + Code string `json:"code"` + // The currency symbol. + Symbol string `json:"symbol"` + // The log base 10 of the number of times we have to multiply the major unit to get the minor unit. Should be 0 for VN and 2 for other countries (SG/MY/ID/TH/PH/KH). + Exponent int32 `json:"exponent"` + AdditionalProperties map[string]interface{} +} + +type _Currency Currency + +// NewCurrency instantiates a new Currency object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCurrency(code string, symbol string, exponent int32) *Currency { + this := Currency{} + this.Code = code + this.Symbol = symbol + this.Exponent = exponent + return &this +} + +// NewCurrencyWithDefaults instantiates a new Currency object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCurrencyWithDefaults() *Currency { + this := Currency{} + return &this +} + +// GetCode returns the Code field value +func (o *Currency) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Currency) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Currency) SetCode(v string) { + o.Code = v +} + +// GetSymbol returns the Symbol field value +func (o *Currency) GetSymbol() string { + if o == nil { + var ret string + return ret + } + + return o.Symbol +} + +// GetSymbolOk returns a tuple with the Symbol field value +// and a boolean to check if the value has been set. +func (o *Currency) GetSymbolOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Symbol, true +} + +// SetSymbol sets field value +func (o *Currency) SetSymbol(v string) { + o.Symbol = v +} + +// GetExponent returns the Exponent field value +func (o *Currency) GetExponent() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Exponent +} + +// GetExponentOk returns a tuple with the Exponent field value +// and a boolean to check if the value has been set. +func (o *Currency) GetExponentOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Exponent, true +} + +// SetExponent sets field value +func (o *Currency) SetExponent(v int32) { + o.Exponent = v +} + +func (o Currency) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Currency) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["symbol"] = o.Symbol + toSerialize["exponent"] = o.Exponent + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Currency) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "symbol", + "exponent", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCurrency := _Currency{} + + err = json.Unmarshal(data, &varCurrency) + + if err != nil { + return err + } + + *o = Currency(varCurrency) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "symbol") + delete(additionalProperties, "exponent") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCurrency struct { + value *Currency + isSet bool +} + +func (v NullableCurrency) Get() *Currency { + return v.value +} + +func (v *NullableCurrency) Set(val *Currency) { + v.value = val + v.isSet = true +} + +func (v NullableCurrency) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrency) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrency(val *Currency) *NullableCurrency { + return &NullableCurrency{value: val, isSet: true} +} + +func (v NullableCurrency) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrency) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_dine_in.go b/model_dine_in.go new file mode 100644 index 0000000..a482b40 --- /dev/null +++ b/model_dine_in.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the DineIn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DineIn{} + +// DineIn A JSON object containing order at table information. Present only for dineIn order. **Not available** in [ListOrder](#tag/list-order/operation/list-orders) response. +type DineIn struct { + // Table number. + TableID *string `json:"tableID,omitempty"` + // The number of eaters. + EaterCount *int64 `json:"eaterCount,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DineIn DineIn + +// NewDineIn instantiates a new DineIn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDineIn() *DineIn { + this := DineIn{} + return &this +} + +// NewDineInWithDefaults instantiates a new DineIn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDineInWithDefaults() *DineIn { + this := DineIn{} + return &this +} + +// GetTableID returns the TableID field value if set, zero value otherwise. +func (o *DineIn) GetTableID() string { + if o == nil || IsNil(o.TableID) { + var ret string + return ret + } + return *o.TableID +} + +// GetTableIDOk returns a tuple with the TableID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DineIn) GetTableIDOk() (*string, bool) { + if o == nil || IsNil(o.TableID) { + return nil, false + } + return o.TableID, true +} + +// HasTableID returns a boolean if a field has been set. +func (o *DineIn) HasTableID() bool { + if o != nil && !IsNil(o.TableID) { + return true + } + + return false +} + +// SetTableID gets a reference to the given string and assigns it to the TableID field. +func (o *DineIn) SetTableID(v string) { + o.TableID = &v +} + +// GetEaterCount returns the EaterCount field value if set, zero value otherwise. +func (o *DineIn) GetEaterCount() int64 { + if o == nil || IsNil(o.EaterCount) { + var ret int64 + return ret + } + return *o.EaterCount +} + +// GetEaterCountOk returns a tuple with the EaterCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DineIn) GetEaterCountOk() (*int64, bool) { + if o == nil || IsNil(o.EaterCount) { + return nil, false + } + return o.EaterCount, true +} + +// HasEaterCount returns a boolean if a field has been set. +func (o *DineIn) HasEaterCount() bool { + if o != nil && !IsNil(o.EaterCount) { + return true + } + + return false +} + +// SetEaterCount gets a reference to the given int64 and assigns it to the EaterCount field. +func (o *DineIn) SetEaterCount(v int64) { + o.EaterCount = &v +} + +func (o DineIn) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DineIn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TableID) { + toSerialize["tableID"] = o.TableID + } + if !IsNil(o.EaterCount) { + toSerialize["eaterCount"] = o.EaterCount + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DineIn) UnmarshalJSON(data []byte) (err error) { + varDineIn := _DineIn{} + + err = json.Unmarshal(data, &varDineIn) + + if err != nil { + return err + } + + *o = DineIn(varDineIn) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tableID") + delete(additionalProperties, "eaterCount") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDineIn struct { + value *DineIn + isSet bool +} + +func (v NullableDineIn) Get() *DineIn { + return v.value +} + +func (v *NullableDineIn) Set(val *DineIn) { + v.value = val + v.isSet = true +} + +func (v NullableDineIn) IsSet() bool { + return v.isSet +} + +func (v *NullableDineIn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDineIn(val *DineIn) *NullableDineIn { + return &NullableDineIn{value: val, isSet: true} +} + +func (v NullableDineIn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDineIn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_edit_order_item.go b/model_edit_order_item.go new file mode 100644 index 0000000..e0cfc4d --- /dev/null +++ b/model_edit_order_item.go @@ -0,0 +1,278 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the EditOrderItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EditOrderItem{} + +// EditOrderItem struct for EditOrderItem +type EditOrderItem struct { + // The item's ID in Grab system that can be obtained from the [Submit Order Webhook](#tag/submit-order-webhook/operation/submit-order-webhook) request payload parameters under `items[].grabItemID`, or `items[].outOfStockInstruction.replacementGrabItemID` for item replacement. External item ID from Partner system is only supported when `ADDED` status and `isExternalItemID: true`. + ItemID string `json:"itemID"` + // The item's edited status. Leave empty string if there is no change to the item. + Status string `json:"status"` + // The item's quantity. If the item is not being updated or deleted, use the original quantity. + Quantity *int64 `json:"quantity,omitempty"` + // Only applicable for `ADDED`status. Indicate if the `itemID` is an external item ID. Grab checks for the items that are mapped to the provided item ID, considering their availability. If multiple Grab items are found to be mapped to the provided external item ID, the last updated item will be chosen. If no suitable record is found, an 400 error will be returned to the partner, indicating that the submitted external item ID cannot be edited. + IsExternalItemID *bool `json:"isExternalItemID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EditOrderItem EditOrderItem + +// NewEditOrderItem instantiates a new EditOrderItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEditOrderItem(itemID string, status string) *EditOrderItem { + this := EditOrderItem{} + this.ItemID = itemID + this.Status = status + return &this +} + +// NewEditOrderItemWithDefaults instantiates a new EditOrderItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEditOrderItemWithDefaults() *EditOrderItem { + this := EditOrderItem{} + return &this +} + +// GetItemID returns the ItemID field value +func (o *EditOrderItem) GetItemID() string { + if o == nil { + var ret string + return ret + } + + return o.ItemID +} + +// GetItemIDOk returns a tuple with the ItemID field value +// and a boolean to check if the value has been set. +func (o *EditOrderItem) GetItemIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ItemID, true +} + +// SetItemID sets field value +func (o *EditOrderItem) SetItemID(v string) { + o.ItemID = v +} + +// GetStatus returns the Status field value +func (o *EditOrderItem) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *EditOrderItem) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *EditOrderItem) SetStatus(v string) { + o.Status = v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *EditOrderItem) GetQuantity() int64 { + if o == nil || IsNil(o.Quantity) { + var ret int64 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EditOrderItem) GetQuantityOk() (*int64, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *EditOrderItem) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int64 and assigns it to the Quantity field. +func (o *EditOrderItem) SetQuantity(v int64) { + o.Quantity = &v +} + +// GetIsExternalItemID returns the IsExternalItemID field value if set, zero value otherwise. +func (o *EditOrderItem) GetIsExternalItemID() bool { + if o == nil || IsNil(o.IsExternalItemID) { + var ret bool + return ret + } + return *o.IsExternalItemID +} + +// GetIsExternalItemIDOk returns a tuple with the IsExternalItemID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EditOrderItem) GetIsExternalItemIDOk() (*bool, bool) { + if o == nil || IsNil(o.IsExternalItemID) { + return nil, false + } + return o.IsExternalItemID, true +} + +// HasIsExternalItemID returns a boolean if a field has been set. +func (o *EditOrderItem) HasIsExternalItemID() bool { + if o != nil && !IsNil(o.IsExternalItemID) { + return true + } + + return false +} + +// SetIsExternalItemID gets a reference to the given bool and assigns it to the IsExternalItemID field. +func (o *EditOrderItem) SetIsExternalItemID(v bool) { + o.IsExternalItemID = &v +} + +func (o EditOrderItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EditOrderItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["itemID"] = o.ItemID + toSerialize["status"] = o.Status + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.IsExternalItemID) { + toSerialize["isExternalItemID"] = o.IsExternalItemID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EditOrderItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "itemID", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEditOrderItem := _EditOrderItem{} + + err = json.Unmarshal(data, &varEditOrderItem) + + if err != nil { + return err + } + + *o = EditOrderItem(varEditOrderItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "itemID") + delete(additionalProperties, "status") + delete(additionalProperties, "quantity") + delete(additionalProperties, "isExternalItemID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEditOrderItem struct { + value *EditOrderItem + isSet bool +} + +func (v NullableEditOrderItem) Get() *EditOrderItem { + return v.value +} + +func (v *NullableEditOrderItem) Set(val *EditOrderItem) { + v.value = val + v.isSet = true +} + +func (v NullableEditOrderItem) IsSet() bool { + return v.isSet +} + +func (v *NullableEditOrderItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEditOrderItem(val *EditOrderItem) *NullableEditOrderItem { + return &NullableEditOrderItem{value: val, isSet: true} +} + +func (v NullableEditOrderItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEditOrderItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_edit_order_request.go b/model_edit_order_request.go new file mode 100644 index 0000000..7d71e7f --- /dev/null +++ b/model_edit_order_request.go @@ -0,0 +1,240 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the EditOrderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EditOrderRequest{} + +// EditOrderRequest Information about editing an existing order on GrabFood. +type EditOrderRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // Specify the array of all items in the order, including deleted, added, updated and unchanged items. + Items []EditOrderItem `json:"items"` + // This parameter specifies whether to recalculate the edited order without submitting it. It is intended for testing purposes only. This parameter is set to false by default, which means the edited order will be recalculated and re-submitted to partners. + OnlyRecalculate *bool `json:"onlyRecalculate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EditOrderRequest EditOrderRequest + +// NewEditOrderRequest instantiates a new EditOrderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEditOrderRequest(orderID string, items []EditOrderItem) *EditOrderRequest { + this := EditOrderRequest{} + this.OrderID = orderID + this.Items = items + return &this +} + +// NewEditOrderRequestWithDefaults instantiates a new EditOrderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEditOrderRequestWithDefaults() *EditOrderRequest { + this := EditOrderRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *EditOrderRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *EditOrderRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *EditOrderRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetItems returns the Items field value +func (o *EditOrderRequest) GetItems() []EditOrderItem { + if o == nil { + var ret []EditOrderItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *EditOrderRequest) GetItemsOk() ([]EditOrderItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *EditOrderRequest) SetItems(v []EditOrderItem) { + o.Items = v +} + +// GetOnlyRecalculate returns the OnlyRecalculate field value if set, zero value otherwise. +func (o *EditOrderRequest) GetOnlyRecalculate() bool { + if o == nil || IsNil(o.OnlyRecalculate) { + var ret bool + return ret + } + return *o.OnlyRecalculate +} + +// GetOnlyRecalculateOk returns a tuple with the OnlyRecalculate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EditOrderRequest) GetOnlyRecalculateOk() (*bool, bool) { + if o == nil || IsNil(o.OnlyRecalculate) { + return nil, false + } + return o.OnlyRecalculate, true +} + +// HasOnlyRecalculate returns a boolean if a field has been set. +func (o *EditOrderRequest) HasOnlyRecalculate() bool { + if o != nil && !IsNil(o.OnlyRecalculate) { + return true + } + + return false +} + +// SetOnlyRecalculate gets a reference to the given bool and assigns it to the OnlyRecalculate field. +func (o *EditOrderRequest) SetOnlyRecalculate(v bool) { + o.OnlyRecalculate = &v +} + +func (o EditOrderRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EditOrderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["items"] = o.Items + if !IsNil(o.OnlyRecalculate) { + toSerialize["onlyRecalculate"] = o.OnlyRecalculate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EditOrderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEditOrderRequest := _EditOrderRequest{} + + err = json.Unmarshal(data, &varEditOrderRequest) + + if err != nil { + return err + } + + *o = EditOrderRequest(varEditOrderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "items") + delete(additionalProperties, "onlyRecalculate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEditOrderRequest struct { + value *EditOrderRequest + isSet bool +} + +func (v NullableEditOrderRequest) Get() *EditOrderRequest { + return v.value +} + +func (v *NullableEditOrderRequest) Set(val *EditOrderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEditOrderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEditOrderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEditOrderRequest(val *EditOrderRequest) *NullableEditOrderRequest { + return &NullableEditOrderRequest{value: val, isSet: true} +} + +func (v NullableEditOrderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEditOrderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_error.go b/model_error.go new file mode 100644 index 0000000..d65e9e9 --- /dev/null +++ b/model_error.go @@ -0,0 +1,235 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error struct for Error +type Error struct { + // Target of error + Target *string `json:"target,omitempty"` + // The type of error. + Reason *string `json:"reason,omitempty"` + // The details of the error. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError() *Error { + this := Error{} + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *Error) GetTarget() string { + if o == nil || IsNil(o.Target) { + var ret string + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetTargetOk() (*string, bool) { + if o == nil || IsNil(o.Target) { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *Error) HasTarget() bool { + if o != nil && !IsNil(o.Target) { + return true + } + + return false +} + +// SetTarget gets a reference to the given string and assigns it to the Target field. +func (o *Error) SetTarget(v string) { + o.Target = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *Error) GetReason() string { + if o == nil || IsNil(o.Reason) { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetReasonOk() (*string, bool) { + if o == nil || IsNil(o.Reason) { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *Error) HasReason() bool { + if o != nil && !IsNil(o.Reason) { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *Error) SetReason(v string) { + o.Reason = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *Error) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Error) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *Error) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *Error) SetMessage(v string) { + o.Message = &v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Target) { + toSerialize["target"] = o.Target + } + if !IsNil(o.Reason) { + toSerialize["reason"] = o.Reason + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + varError := _Error{} + + err = json.Unmarshal(data, &varError) + + if err != nil { + return err + } + + *o = Error(varError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "target") + delete(additionalProperties, "reason") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_dine_in_voucher_response.go b/model_get_dine_in_voucher_response.go new file mode 100644 index 0000000..34848b0 --- /dev/null +++ b/model_get_dine_in_voucher_response.go @@ -0,0 +1,348 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GetDineInVoucherResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetDineInVoucherResponse{} + +// GetDineInVoucherResponse +type GetDineInVoucherResponse struct { + // This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. + CertificateID *string `json:"certificateID,omitempty"` + // A short code for the dine-in voucher purchased by the user. + VoucherCode *string `json:"voucherCode,omitempty"` + Voucher *Voucher `json:"voucher,omitempty"` + // The status of the dine-in voucher purchased. Only active voucher is eligible for redemption. + VoucherStatus *string `json:"voucherStatus,omitempty"` + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The dine-in voucher campaign's ID in GrabFood's database. + CampaignID *string `json:"campaignID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetDineInVoucherResponse GetDineInVoucherResponse + +// NewGetDineInVoucherResponse instantiates a new GetDineInVoucherResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetDineInVoucherResponse() *GetDineInVoucherResponse { + this := GetDineInVoucherResponse{} + return &this +} + +// NewGetDineInVoucherResponseWithDefaults instantiates a new GetDineInVoucherResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetDineInVoucherResponseWithDefaults() *GetDineInVoucherResponse { + this := GetDineInVoucherResponse{} + return &this +} + +// GetCertificateID returns the CertificateID field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetCertificateID() string { + if o == nil || IsNil(o.CertificateID) { + var ret string + return ret + } + return *o.CertificateID +} + +// GetCertificateIDOk returns a tuple with the CertificateID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetCertificateIDOk() (*string, bool) { + if o == nil || IsNil(o.CertificateID) { + return nil, false + } + return o.CertificateID, true +} + +// HasCertificateID returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasCertificateID() bool { + if o != nil && !IsNil(o.CertificateID) { + return true + } + + return false +} + +// SetCertificateID gets a reference to the given string and assigns it to the CertificateID field. +func (o *GetDineInVoucherResponse) SetCertificateID(v string) { + o.CertificateID = &v +} + +// GetVoucherCode returns the VoucherCode field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetVoucherCode() string { + if o == nil || IsNil(o.VoucherCode) { + var ret string + return ret + } + return *o.VoucherCode +} + +// GetVoucherCodeOk returns a tuple with the VoucherCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetVoucherCodeOk() (*string, bool) { + if o == nil || IsNil(o.VoucherCode) { + return nil, false + } + return o.VoucherCode, true +} + +// HasVoucherCode returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasVoucherCode() bool { + if o != nil && !IsNil(o.VoucherCode) { + return true + } + + return false +} + +// SetVoucherCode gets a reference to the given string and assigns it to the VoucherCode field. +func (o *GetDineInVoucherResponse) SetVoucherCode(v string) { + o.VoucherCode = &v +} + +// GetVoucher returns the Voucher field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetVoucher() Voucher { + if o == nil || IsNil(o.Voucher) { + var ret Voucher + return ret + } + return *o.Voucher +} + +// GetVoucherOk returns a tuple with the Voucher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetVoucherOk() (*Voucher, bool) { + if o == nil || IsNil(o.Voucher) { + return nil, false + } + return o.Voucher, true +} + +// HasVoucher returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasVoucher() bool { + if o != nil && !IsNil(o.Voucher) { + return true + } + + return false +} + +// SetVoucher gets a reference to the given Voucher and assigns it to the Voucher field. +func (o *GetDineInVoucherResponse) SetVoucher(v Voucher) { + o.Voucher = &v +} + +// GetVoucherStatus returns the VoucherStatus field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetVoucherStatus() string { + if o == nil || IsNil(o.VoucherStatus) { + var ret string + return ret + } + return *o.VoucherStatus +} + +// GetVoucherStatusOk returns a tuple with the VoucherStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetVoucherStatusOk() (*string, bool) { + if o == nil || IsNil(o.VoucherStatus) { + return nil, false + } + return o.VoucherStatus, true +} + +// HasVoucherStatus returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasVoucherStatus() bool { + if o != nil && !IsNil(o.VoucherStatus) { + return true + } + + return false +} + +// SetVoucherStatus gets a reference to the given string and assigns it to the VoucherStatus field. +func (o *GetDineInVoucherResponse) SetVoucherStatus(v string) { + o.VoucherStatus = &v +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *GetDineInVoucherResponse) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetCampaignID returns the CampaignID field value if set, zero value otherwise. +func (o *GetDineInVoucherResponse) GetCampaignID() string { + if o == nil || IsNil(o.CampaignID) { + var ret string + return ret + } + return *o.CampaignID +} + +// GetCampaignIDOk returns a tuple with the CampaignID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetDineInVoucherResponse) GetCampaignIDOk() (*string, bool) { + if o == nil || IsNil(o.CampaignID) { + return nil, false + } + return o.CampaignID, true +} + +// HasCampaignID returns a boolean if a field has been set. +func (o *GetDineInVoucherResponse) HasCampaignID() bool { + if o != nil && !IsNil(o.CampaignID) { + return true + } + + return false +} + +// SetCampaignID gets a reference to the given string and assigns it to the CampaignID field. +func (o *GetDineInVoucherResponse) SetCampaignID(v string) { + o.CampaignID = &v +} + +func (o GetDineInVoucherResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetDineInVoucherResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateID) { + toSerialize["certificateID"] = o.CertificateID + } + if !IsNil(o.VoucherCode) { + toSerialize["voucherCode"] = o.VoucherCode + } + if !IsNil(o.Voucher) { + toSerialize["voucher"] = o.Voucher + } + if !IsNil(o.VoucherStatus) { + toSerialize["voucherStatus"] = o.VoucherStatus + } + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.CampaignID) { + toSerialize["campaignID"] = o.CampaignID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetDineInVoucherResponse) UnmarshalJSON(data []byte) (err error) { + varGetDineInVoucherResponse := _GetDineInVoucherResponse{} + + err = json.Unmarshal(data, &varGetDineInVoucherResponse) + + if err != nil { + return err + } + + *o = GetDineInVoucherResponse(varGetDineInVoucherResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "certificateID") + delete(additionalProperties, "voucherCode") + delete(additionalProperties, "voucher") + delete(additionalProperties, "voucherStatus") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "campaignID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetDineInVoucherResponse struct { + value *GetDineInVoucherResponse + isSet bool +} + +func (v NullableGetDineInVoucherResponse) Get() *GetDineInVoucherResponse { + return v.value +} + +func (v *NullableGetDineInVoucherResponse) Set(val *GetDineInVoucherResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetDineInVoucherResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetDineInVoucherResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetDineInVoucherResponse(val *GetDineInVoucherResponse) *NullableGetDineInVoucherResponse { + return &NullableGetDineInVoucherResponse{value: val, isSet: true} +} + +func (v NullableGetDineInVoucherResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetDineInVoucherResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_membership_native_response.go b/model_get_membership_native_response.go new file mode 100644 index 0000000..2499219 --- /dev/null +++ b/model_get_membership_native_response.go @@ -0,0 +1,234 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GetMembershipNativeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMembershipNativeResponse{} + +// GetMembershipNativeResponse This response returns membership detail. +type GetMembershipNativeResponse struct { + // Status of the memberID. + MembershipStatus *string `json:"membershipStatus,omitempty"` + PointInfo *GetMembershipNativeResponsePointInfo `json:"pointInfo,omitempty"` + // Earliest points expiry date. In `yyyy-mm-dd` format + PointsExpireDate *string `json:"pointsExpireDate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetMembershipNativeResponse GetMembershipNativeResponse + +// NewGetMembershipNativeResponse instantiates a new GetMembershipNativeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMembershipNativeResponse() *GetMembershipNativeResponse { + this := GetMembershipNativeResponse{} + return &this +} + +// NewGetMembershipNativeResponseWithDefaults instantiates a new GetMembershipNativeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMembershipNativeResponseWithDefaults() *GetMembershipNativeResponse { + this := GetMembershipNativeResponse{} + return &this +} + +// GetMembershipStatus returns the MembershipStatus field value if set, zero value otherwise. +func (o *GetMembershipNativeResponse) GetMembershipStatus() string { + if o == nil || IsNil(o.MembershipStatus) { + var ret string + return ret + } + return *o.MembershipStatus +} + +// GetMembershipStatusOk returns a tuple with the MembershipStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponse) GetMembershipStatusOk() (*string, bool) { + if o == nil || IsNil(o.MembershipStatus) { + return nil, false + } + return o.MembershipStatus, true +} + +// HasMembershipStatus returns a boolean if a field has been set. +func (o *GetMembershipNativeResponse) HasMembershipStatus() bool { + if o != nil && !IsNil(o.MembershipStatus) { + return true + } + + return false +} + +// SetMembershipStatus gets a reference to the given string and assigns it to the MembershipStatus field. +func (o *GetMembershipNativeResponse) SetMembershipStatus(v string) { + o.MembershipStatus = &v +} + +// GetPointInfo returns the PointInfo field value if set, zero value otherwise. +func (o *GetMembershipNativeResponse) GetPointInfo() GetMembershipNativeResponsePointInfo { + if o == nil || IsNil(o.PointInfo) { + var ret GetMembershipNativeResponsePointInfo + return ret + } + return *o.PointInfo +} + +// GetPointInfoOk returns a tuple with the PointInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponse) GetPointInfoOk() (*GetMembershipNativeResponsePointInfo, bool) { + if o == nil || IsNil(o.PointInfo) { + return nil, false + } + return o.PointInfo, true +} + +// HasPointInfo returns a boolean if a field has been set. +func (o *GetMembershipNativeResponse) HasPointInfo() bool { + if o != nil && !IsNil(o.PointInfo) { + return true + } + + return false +} + +// SetPointInfo gets a reference to the given GetMembershipNativeResponsePointInfo and assigns it to the PointInfo field. +func (o *GetMembershipNativeResponse) SetPointInfo(v GetMembershipNativeResponsePointInfo) { + o.PointInfo = &v +} + +// GetPointsExpireDate returns the PointsExpireDate field value if set, zero value otherwise. +func (o *GetMembershipNativeResponse) GetPointsExpireDate() string { + if o == nil || IsNil(o.PointsExpireDate) { + var ret string + return ret + } + return *o.PointsExpireDate +} + +// GetPointsExpireDateOk returns a tuple with the PointsExpireDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponse) GetPointsExpireDateOk() (*string, bool) { + if o == nil || IsNil(o.PointsExpireDate) { + return nil, false + } + return o.PointsExpireDate, true +} + +// HasPointsExpireDate returns a boolean if a field has been set. +func (o *GetMembershipNativeResponse) HasPointsExpireDate() bool { + if o != nil && !IsNil(o.PointsExpireDate) { + return true + } + + return false +} + +// SetPointsExpireDate gets a reference to the given string and assigns it to the PointsExpireDate field. +func (o *GetMembershipNativeResponse) SetPointsExpireDate(v string) { + o.PointsExpireDate = &v +} + +func (o GetMembershipNativeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMembershipNativeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MembershipStatus) { + toSerialize["membershipStatus"] = o.MembershipStatus + } + if !IsNil(o.PointInfo) { + toSerialize["pointInfo"] = o.PointInfo + } + if !IsNil(o.PointsExpireDate) { + toSerialize["pointsExpireDate"] = o.PointsExpireDate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMembershipNativeResponse) UnmarshalJSON(data []byte) (err error) { + varGetMembershipNativeResponse := _GetMembershipNativeResponse{} + + err = json.Unmarshal(data, &varGetMembershipNativeResponse) + + if err != nil { + return err + } + + *o = GetMembershipNativeResponse(varGetMembershipNativeResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "membershipStatus") + delete(additionalProperties, "pointInfo") + delete(additionalProperties, "pointsExpireDate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMembershipNativeResponse struct { + value *GetMembershipNativeResponse + isSet bool +} + +func (v NullableGetMembershipNativeResponse) Get() *GetMembershipNativeResponse { + return v.value +} + +func (v *NullableGetMembershipNativeResponse) Set(val *GetMembershipNativeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMembershipNativeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMembershipNativeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMembershipNativeResponse(val *GetMembershipNativeResponse) *NullableGetMembershipNativeResponse { + return &NullableGetMembershipNativeResponse{value: val, isSet: true} +} + +func (v NullableGetMembershipNativeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMembershipNativeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_membership_native_response_point_info.go b/model_get_membership_native_response_point_info.go new file mode 100644 index 0000000..9c3bf6f --- /dev/null +++ b/model_get_membership_native_response_point_info.go @@ -0,0 +1,235 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GetMembershipNativeResponsePointInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMembershipNativeResponsePointInfo{} + +// GetMembershipNativeResponsePointInfo Obtain contains user's point details. +type GetMembershipNativeResponsePointInfo struct { + // Point that user currently obtained. + CurrentPoints *int64 `json:"currentPoints,omitempty"` + // Maximum point that user can obtain. + MaxPoints *int64 `json:"maxPoints,omitempty"` + // Points that would get expired in future. + ExpirePoints *int64 `json:"expirePoints,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetMembershipNativeResponsePointInfo GetMembershipNativeResponsePointInfo + +// NewGetMembershipNativeResponsePointInfo instantiates a new GetMembershipNativeResponsePointInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMembershipNativeResponsePointInfo() *GetMembershipNativeResponsePointInfo { + this := GetMembershipNativeResponsePointInfo{} + return &this +} + +// NewGetMembershipNativeResponsePointInfoWithDefaults instantiates a new GetMembershipNativeResponsePointInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMembershipNativeResponsePointInfoWithDefaults() *GetMembershipNativeResponsePointInfo { + this := GetMembershipNativeResponsePointInfo{} + return &this +} + +// GetCurrentPoints returns the CurrentPoints field value if set, zero value otherwise. +func (o *GetMembershipNativeResponsePointInfo) GetCurrentPoints() int64 { + if o == nil || IsNil(o.CurrentPoints) { + var ret int64 + return ret + } + return *o.CurrentPoints +} + +// GetCurrentPointsOk returns a tuple with the CurrentPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponsePointInfo) GetCurrentPointsOk() (*int64, bool) { + if o == nil || IsNil(o.CurrentPoints) { + return nil, false + } + return o.CurrentPoints, true +} + +// HasCurrentPoints returns a boolean if a field has been set. +func (o *GetMembershipNativeResponsePointInfo) HasCurrentPoints() bool { + if o != nil && !IsNil(o.CurrentPoints) { + return true + } + + return false +} + +// SetCurrentPoints gets a reference to the given int64 and assigns it to the CurrentPoints field. +func (o *GetMembershipNativeResponsePointInfo) SetCurrentPoints(v int64) { + o.CurrentPoints = &v +} + +// GetMaxPoints returns the MaxPoints field value if set, zero value otherwise. +func (o *GetMembershipNativeResponsePointInfo) GetMaxPoints() int64 { + if o == nil || IsNil(o.MaxPoints) { + var ret int64 + return ret + } + return *o.MaxPoints +} + +// GetMaxPointsOk returns a tuple with the MaxPoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponsePointInfo) GetMaxPointsOk() (*int64, bool) { + if o == nil || IsNil(o.MaxPoints) { + return nil, false + } + return o.MaxPoints, true +} + +// HasMaxPoints returns a boolean if a field has been set. +func (o *GetMembershipNativeResponsePointInfo) HasMaxPoints() bool { + if o != nil && !IsNil(o.MaxPoints) { + return true + } + + return false +} + +// SetMaxPoints gets a reference to the given int64 and assigns it to the MaxPoints field. +func (o *GetMembershipNativeResponsePointInfo) SetMaxPoints(v int64) { + o.MaxPoints = &v +} + +// GetExpirePoints returns the ExpirePoints field value if set, zero value otherwise. +func (o *GetMembershipNativeResponsePointInfo) GetExpirePoints() int64 { + if o == nil || IsNil(o.ExpirePoints) { + var ret int64 + return ret + } + return *o.ExpirePoints +} + +// GetExpirePointsOk returns a tuple with the ExpirePoints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipNativeResponsePointInfo) GetExpirePointsOk() (*int64, bool) { + if o == nil || IsNil(o.ExpirePoints) { + return nil, false + } + return o.ExpirePoints, true +} + +// HasExpirePoints returns a boolean if a field has been set. +func (o *GetMembershipNativeResponsePointInfo) HasExpirePoints() bool { + if o != nil && !IsNil(o.ExpirePoints) { + return true + } + + return false +} + +// SetExpirePoints gets a reference to the given int64 and assigns it to the ExpirePoints field. +func (o *GetMembershipNativeResponsePointInfo) SetExpirePoints(v int64) { + o.ExpirePoints = &v +} + +func (o GetMembershipNativeResponsePointInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMembershipNativeResponsePointInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CurrentPoints) { + toSerialize["currentPoints"] = o.CurrentPoints + } + if !IsNil(o.MaxPoints) { + toSerialize["maxPoints"] = o.MaxPoints + } + if !IsNil(o.ExpirePoints) { + toSerialize["expirePoints"] = o.ExpirePoints + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMembershipNativeResponsePointInfo) UnmarshalJSON(data []byte) (err error) { + varGetMembershipNativeResponsePointInfo := _GetMembershipNativeResponsePointInfo{} + + err = json.Unmarshal(data, &varGetMembershipNativeResponsePointInfo) + + if err != nil { + return err + } + + *o = GetMembershipNativeResponsePointInfo(varGetMembershipNativeResponsePointInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "currentPoints") + delete(additionalProperties, "maxPoints") + delete(additionalProperties, "expirePoints") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMembershipNativeResponsePointInfo struct { + value *GetMembershipNativeResponsePointInfo + isSet bool +} + +func (v NullableGetMembershipNativeResponsePointInfo) Get() *GetMembershipNativeResponsePointInfo { + return v.value +} + +func (v *NullableGetMembershipNativeResponsePointInfo) Set(val *GetMembershipNativeResponsePointInfo) { + v.value = val + v.isSet = true +} + +func (v NullableGetMembershipNativeResponsePointInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMembershipNativeResponsePointInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMembershipNativeResponsePointInfo(val *GetMembershipNativeResponsePointInfo) *NullableGetMembershipNativeResponsePointInfo { + return &NullableGetMembershipNativeResponsePointInfo{value: val, isSet: true} +} + +func (v NullableGetMembershipNativeResponsePointInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMembershipNativeResponsePointInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_membership_request.go b/model_get_membership_request.go new file mode 100644 index 0000000..9506868 --- /dev/null +++ b/model_get_membership_request.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMembershipRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMembershipRequest{} + +// GetMembershipRequest This request submits membership unbind request to partner. +type GetMembershipRequest struct { + // The unique member ID on the partner's database. + MemberID string `json:"memberID"` + AdditionalProperties map[string]interface{} +} + +type _GetMembershipRequest GetMembershipRequest + +// NewGetMembershipRequest instantiates a new GetMembershipRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMembershipRequest(memberID string) *GetMembershipRequest { + this := GetMembershipRequest{} + this.MemberID = memberID + return &this +} + +// NewGetMembershipRequestWithDefaults instantiates a new GetMembershipRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMembershipRequestWithDefaults() *GetMembershipRequest { + this := GetMembershipRequest{} + return &this +} + +// GetMemberID returns the MemberID field value +func (o *GetMembershipRequest) GetMemberID() string { + if o == nil { + var ret string + return ret + } + + return o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value +// and a boolean to check if the value has been set. +func (o *GetMembershipRequest) GetMemberIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberID, true +} + +// SetMemberID sets field value +func (o *GetMembershipRequest) SetMemberID(v string) { + o.MemberID = v +} + +func (o GetMembershipRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMembershipRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["memberID"] = o.MemberID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMembershipRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "memberID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMembershipRequest := _GetMembershipRequest{} + + err = json.Unmarshal(data, &varGetMembershipRequest) + + if err != nil { + return err + } + + *o = GetMembershipRequest(varGetMembershipRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMembershipRequest struct { + value *GetMembershipRequest + isSet bool +} + +func (v NullableGetMembershipRequest) Get() *GetMembershipRequest { + return v.value +} + +func (v *NullableGetMembershipRequest) Set(val *GetMembershipRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetMembershipRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMembershipRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMembershipRequest(val *GetMembershipRequest) *NullableGetMembershipRequest { + return &NullableGetMembershipRequest{value: val, isSet: true} +} + +func (v NullableGetMembershipRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMembershipRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_membership_webview_response.go b/model_get_membership_webview_response.go new file mode 100644 index 0000000..1ed419c --- /dev/null +++ b/model_get_membership_webview_response.go @@ -0,0 +1,159 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GetMembershipWebviewResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMembershipWebviewResponse{} + +// GetMembershipWebviewResponse This response returns membership detail. +type GetMembershipWebviewResponse struct { + // Status of the memberID. + MembershipStatus *string `json:"membershipStatus,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetMembershipWebviewResponse GetMembershipWebviewResponse + +// NewGetMembershipWebviewResponse instantiates a new GetMembershipWebviewResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMembershipWebviewResponse() *GetMembershipWebviewResponse { + this := GetMembershipWebviewResponse{} + return &this +} + +// NewGetMembershipWebviewResponseWithDefaults instantiates a new GetMembershipWebviewResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMembershipWebviewResponseWithDefaults() *GetMembershipWebviewResponse { + this := GetMembershipWebviewResponse{} + return &this +} + +// GetMembershipStatus returns the MembershipStatus field value if set, zero value otherwise. +func (o *GetMembershipWebviewResponse) GetMembershipStatus() string { + if o == nil || IsNil(o.MembershipStatus) { + var ret string + return ret + } + return *o.MembershipStatus +} + +// GetMembershipStatusOk returns a tuple with the MembershipStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMembershipWebviewResponse) GetMembershipStatusOk() (*string, bool) { + if o == nil || IsNil(o.MembershipStatus) { + return nil, false + } + return o.MembershipStatus, true +} + +// HasMembershipStatus returns a boolean if a field has been set. +func (o *GetMembershipWebviewResponse) HasMembershipStatus() bool { + if o != nil && !IsNil(o.MembershipStatus) { + return true + } + + return false +} + +// SetMembershipStatus gets a reference to the given string and assigns it to the MembershipStatus field. +func (o *GetMembershipWebviewResponse) SetMembershipStatus(v string) { + o.MembershipStatus = &v +} + +func (o GetMembershipWebviewResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMembershipWebviewResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MembershipStatus) { + toSerialize["membershipStatus"] = o.MembershipStatus + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMembershipWebviewResponse) UnmarshalJSON(data []byte) (err error) { + varGetMembershipWebviewResponse := _GetMembershipWebviewResponse{} + + err = json.Unmarshal(data, &varGetMembershipWebviewResponse) + + if err != nil { + return err + } + + *o = GetMembershipWebviewResponse(varGetMembershipWebviewResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "membershipStatus") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMembershipWebviewResponse struct { + value *GetMembershipWebviewResponse + isSet bool +} + +func (v NullableGetMembershipWebviewResponse) Get() *GetMembershipWebviewResponse { + return v.value +} + +func (v *NullableGetMembershipWebviewResponse) Set(val *GetMembershipWebviewResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMembershipWebviewResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMembershipWebviewResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMembershipWebviewResponse(val *GetMembershipWebviewResponse) *NullableGetMembershipWebviewResponse { + return &NullableGetMembershipWebviewResponse{value: val, isSet: true} +} + +func (v NullableGetMembershipWebviewResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMembershipWebviewResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_menu_new_response.go b/model_get_menu_new_response.go new file mode 100644 index 0000000..80f7eef --- /dev/null +++ b/model_get_menu_new_response.go @@ -0,0 +1,307 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMenuNewResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMenuNewResponse{} + +// GetMenuNewResponse +type GetMenuNewResponse struct { + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The merchant's ID that is on the partner's database. + PartnerMerchantID *string `json:"partnerMerchantID,omitempty"` + Currency Currency `json:"currency"` + // An array of sellingTimes JSON objects. Max 20 allowed. Refer to [Selling Times](#selling-times) for more information. + SellingTimes []SellingTime `json:"sellingTimes"` + // An array of category JSON objects. Max 100 allowed per section. Refer to [Categories](#categories) for more information. + Categories []MenuCategory `json:"categories"` + AdditionalProperties map[string]interface{} +} + +type _GetMenuNewResponse GetMenuNewResponse + +// NewGetMenuNewResponse instantiates a new GetMenuNewResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMenuNewResponse(currency Currency, sellingTimes []SellingTime, categories []MenuCategory) *GetMenuNewResponse { + this := GetMenuNewResponse{} + this.Currency = currency + this.SellingTimes = sellingTimes + this.Categories = categories + return &this +} + +// NewGetMenuNewResponseWithDefaults instantiates a new GetMenuNewResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMenuNewResponseWithDefaults() *GetMenuNewResponse { + this := GetMenuNewResponse{} + return &this +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *GetMenuNewResponse) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMenuNewResponse) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *GetMenuNewResponse) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *GetMenuNewResponse) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetPartnerMerchantID returns the PartnerMerchantID field value if set, zero value otherwise. +func (o *GetMenuNewResponse) GetPartnerMerchantID() string { + if o == nil || IsNil(o.PartnerMerchantID) { + var ret string + return ret + } + return *o.PartnerMerchantID +} + +// GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMenuNewResponse) GetPartnerMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.PartnerMerchantID) { + return nil, false + } + return o.PartnerMerchantID, true +} + +// HasPartnerMerchantID returns a boolean if a field has been set. +func (o *GetMenuNewResponse) HasPartnerMerchantID() bool { + if o != nil && !IsNil(o.PartnerMerchantID) { + return true + } + + return false +} + +// SetPartnerMerchantID gets a reference to the given string and assigns it to the PartnerMerchantID field. +func (o *GetMenuNewResponse) SetPartnerMerchantID(v string) { + o.PartnerMerchantID = &v +} + +// GetCurrency returns the Currency field value +func (o *GetMenuNewResponse) GetCurrency() Currency { + if o == nil { + var ret Currency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *GetMenuNewResponse) GetCurrencyOk() (*Currency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *GetMenuNewResponse) SetCurrency(v Currency) { + o.Currency = v +} + +// GetSellingTimes returns the SellingTimes field value +func (o *GetMenuNewResponse) GetSellingTimes() []SellingTime { + if o == nil { + var ret []SellingTime + return ret + } + + return o.SellingTimes +} + +// GetSellingTimesOk returns a tuple with the SellingTimes field value +// and a boolean to check if the value has been set. +func (o *GetMenuNewResponse) GetSellingTimesOk() ([]SellingTime, bool) { + if o == nil { + return nil, false + } + return o.SellingTimes, true +} + +// SetSellingTimes sets field value +func (o *GetMenuNewResponse) SetSellingTimes(v []SellingTime) { + o.SellingTimes = v +} + +// GetCategories returns the Categories field value +func (o *GetMenuNewResponse) GetCategories() []MenuCategory { + if o == nil { + var ret []MenuCategory + return ret + } + + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value +// and a boolean to check if the value has been set. +func (o *GetMenuNewResponse) GetCategoriesOk() ([]MenuCategory, bool) { + if o == nil { + return nil, false + } + return o.Categories, true +} + +// SetCategories sets field value +func (o *GetMenuNewResponse) SetCategories(v []MenuCategory) { + o.Categories = v +} + +func (o GetMenuNewResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMenuNewResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.PartnerMerchantID) { + toSerialize["partnerMerchantID"] = o.PartnerMerchantID + } + toSerialize["currency"] = o.Currency + toSerialize["sellingTimes"] = o.SellingTimes + toSerialize["categories"] = o.Categories + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMenuNewResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "currency", + "sellingTimes", + "categories", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMenuNewResponse := _GetMenuNewResponse{} + + err = json.Unmarshal(data, &varGetMenuNewResponse) + + if err != nil { + return err + } + + *o = GetMenuNewResponse(varGetMenuNewResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "partnerMerchantID") + delete(additionalProperties, "currency") + delete(additionalProperties, "sellingTimes") + delete(additionalProperties, "categories") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMenuNewResponse struct { + value *GetMenuNewResponse + isSet bool +} + +func (v NullableGetMenuNewResponse) Get() *GetMenuNewResponse { + return v.value +} + +func (v *NullableGetMenuNewResponse) Set(val *GetMenuNewResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMenuNewResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMenuNewResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMenuNewResponse(val *GetMenuNewResponse) *NullableGetMenuNewResponse { + return &NullableGetMenuNewResponse{value: val, isSet: true} +} + +func (v NullableGetMenuNewResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMenuNewResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_menu_old_response.go b/model_get_menu_old_response.go new file mode 100644 index 0000000..97afff4 --- /dev/null +++ b/model_get_menu_old_response.go @@ -0,0 +1,277 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetMenuOldResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetMenuOldResponse{} + +// GetMenuOldResponse +type GetMenuOldResponse struct { + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The merchant's ID that is on the partner's database. + PartnerMerchantID *string `json:"partnerMerchantID,omitempty"` + Currency Currency `json:"currency"` + // An array of section JSON objects. Max 7 allowed. Refer to [Sections](#sections) for more information. + Sections []MenuSection `json:"sections"` + AdditionalProperties map[string]interface{} +} + +type _GetMenuOldResponse GetMenuOldResponse + +// NewGetMenuOldResponse instantiates a new GetMenuOldResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetMenuOldResponse(currency Currency, sections []MenuSection) *GetMenuOldResponse { + this := GetMenuOldResponse{} + this.Currency = currency + this.Sections = sections + return &this +} + +// NewGetMenuOldResponseWithDefaults instantiates a new GetMenuOldResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetMenuOldResponseWithDefaults() *GetMenuOldResponse { + this := GetMenuOldResponse{} + return &this +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *GetMenuOldResponse) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMenuOldResponse) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *GetMenuOldResponse) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *GetMenuOldResponse) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetPartnerMerchantID returns the PartnerMerchantID field value if set, zero value otherwise. +func (o *GetMenuOldResponse) GetPartnerMerchantID() string { + if o == nil || IsNil(o.PartnerMerchantID) { + var ret string + return ret + } + return *o.PartnerMerchantID +} + +// GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetMenuOldResponse) GetPartnerMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.PartnerMerchantID) { + return nil, false + } + return o.PartnerMerchantID, true +} + +// HasPartnerMerchantID returns a boolean if a field has been set. +func (o *GetMenuOldResponse) HasPartnerMerchantID() bool { + if o != nil && !IsNil(o.PartnerMerchantID) { + return true + } + + return false +} + +// SetPartnerMerchantID gets a reference to the given string and assigns it to the PartnerMerchantID field. +func (o *GetMenuOldResponse) SetPartnerMerchantID(v string) { + o.PartnerMerchantID = &v +} + +// GetCurrency returns the Currency field value +func (o *GetMenuOldResponse) GetCurrency() Currency { + if o == nil { + var ret Currency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *GetMenuOldResponse) GetCurrencyOk() (*Currency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *GetMenuOldResponse) SetCurrency(v Currency) { + o.Currency = v +} + +// GetSections returns the Sections field value +func (o *GetMenuOldResponse) GetSections() []MenuSection { + if o == nil { + var ret []MenuSection + return ret + } + + return o.Sections +} + +// GetSectionsOk returns a tuple with the Sections field value +// and a boolean to check if the value has been set. +func (o *GetMenuOldResponse) GetSectionsOk() ([]MenuSection, bool) { + if o == nil { + return nil, false + } + return o.Sections, true +} + +// SetSections sets field value +func (o *GetMenuOldResponse) SetSections(v []MenuSection) { + o.Sections = v +} + +func (o GetMenuOldResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetMenuOldResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.PartnerMerchantID) { + toSerialize["partnerMerchantID"] = o.PartnerMerchantID + } + toSerialize["currency"] = o.Currency + toSerialize["sections"] = o.Sections + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetMenuOldResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "currency", + "sections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetMenuOldResponse := _GetMenuOldResponse{} + + err = json.Unmarshal(data, &varGetMenuOldResponse) + + if err != nil { + return err + } + + *o = GetMenuOldResponse(varGetMenuOldResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "partnerMerchantID") + delete(additionalProperties, "currency") + delete(additionalProperties, "sections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetMenuOldResponse struct { + value *GetMenuOldResponse + isSet bool +} + +func (v NullableGetMenuOldResponse) Get() *GetMenuOldResponse { + return v.value +} + +func (v *NullableGetMenuOldResponse) Set(val *GetMenuOldResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetMenuOldResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetMenuOldResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetMenuOldResponse(val *GetMenuOldResponse) *NullableGetMenuOldResponse { + return &NullableGetMenuOldResponse{value: val, isSet: true} +} + +func (v NullableGetMenuOldResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetMenuOldResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_reward_native_request.go b/model_get_reward_native_request.go new file mode 100644 index 0000000..f8e5553 --- /dev/null +++ b/model_get_reward_native_request.go @@ -0,0 +1,272 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GetRewardNativeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRewardNativeRequest{} + +// GetRewardNativeRequest This request submits membership detail and order value to get reward calculation. +type GetRewardNativeRequest struct { + // The unique member ID on the partner's database. + MemberID *string `json:"memberID,omitempty"` + // Grab merchant's ID. + MerchantID *string `json:"merchantID,omitempty"` + Items []RewardItem `json:"items,omitempty"` + // The post-discount order value. + OrderValue *int64 `json:"orderValue,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetRewardNativeRequest GetRewardNativeRequest + +// NewGetRewardNativeRequest instantiates a new GetRewardNativeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRewardNativeRequest() *GetRewardNativeRequest { + this := GetRewardNativeRequest{} + return &this +} + +// NewGetRewardNativeRequestWithDefaults instantiates a new GetRewardNativeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRewardNativeRequestWithDefaults() *GetRewardNativeRequest { + this := GetRewardNativeRequest{} + return &this +} + +// GetMemberID returns the MemberID field value if set, zero value otherwise. +func (o *GetRewardNativeRequest) GetMemberID() string { + if o == nil || IsNil(o.MemberID) { + var ret string + return ret + } + return *o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRewardNativeRequest) GetMemberIDOk() (*string, bool) { + if o == nil || IsNil(o.MemberID) { + return nil, false + } + return o.MemberID, true +} + +// HasMemberID returns a boolean if a field has been set. +func (o *GetRewardNativeRequest) HasMemberID() bool { + if o != nil && !IsNil(o.MemberID) { + return true + } + + return false +} + +// SetMemberID gets a reference to the given string and assigns it to the MemberID field. +func (o *GetRewardNativeRequest) SetMemberID(v string) { + o.MemberID = &v +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *GetRewardNativeRequest) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRewardNativeRequest) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *GetRewardNativeRequest) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *GetRewardNativeRequest) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetRewardNativeRequest) GetItems() []RewardItem { + if o == nil || IsNil(o.Items) { + var ret []RewardItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRewardNativeRequest) GetItemsOk() ([]RewardItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *GetRewardNativeRequest) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []RewardItem and assigns it to the Items field. +func (o *GetRewardNativeRequest) SetItems(v []RewardItem) { + o.Items = v +} + +// GetOrderValue returns the OrderValue field value if set, zero value otherwise. +func (o *GetRewardNativeRequest) GetOrderValue() int64 { + if o == nil || IsNil(o.OrderValue) { + var ret int64 + return ret + } + return *o.OrderValue +} + +// GetOrderValueOk returns a tuple with the OrderValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRewardNativeRequest) GetOrderValueOk() (*int64, bool) { + if o == nil || IsNil(o.OrderValue) { + return nil, false + } + return o.OrderValue, true +} + +// HasOrderValue returns a boolean if a field has been set. +func (o *GetRewardNativeRequest) HasOrderValue() bool { + if o != nil && !IsNil(o.OrderValue) { + return true + } + + return false +} + +// SetOrderValue gets a reference to the given int64 and assigns it to the OrderValue field. +func (o *GetRewardNativeRequest) SetOrderValue(v int64) { + o.OrderValue = &v +} + +func (o GetRewardNativeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRewardNativeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MemberID) { + toSerialize["memberID"] = o.MemberID + } + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + if !IsNil(o.OrderValue) { + toSerialize["orderValue"] = o.OrderValue + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetRewardNativeRequest) UnmarshalJSON(data []byte) (err error) { + varGetRewardNativeRequest := _GetRewardNativeRequest{} + + err = json.Unmarshal(data, &varGetRewardNativeRequest) + + if err != nil { + return err + } + + *o = GetRewardNativeRequest(varGetRewardNativeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "items") + delete(additionalProperties, "orderValue") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetRewardNativeRequest struct { + value *GetRewardNativeRequest + isSet bool +} + +func (v NullableGetRewardNativeRequest) Get() *GetRewardNativeRequest { + return v.value +} + +func (v *NullableGetRewardNativeRequest) Set(val *GetRewardNativeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGetRewardNativeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRewardNativeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRewardNativeRequest(val *GetRewardNativeRequest) *NullableGetRewardNativeRequest { + return &NullableGetRewardNativeRequest{value: val, isSet: true} +} + +func (v NullableGetRewardNativeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRewardNativeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_get_reward_native_response.go b/model_get_reward_native_response.go new file mode 100644 index 0000000..81eec79 --- /dev/null +++ b/model_get_reward_native_response.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the GetRewardNativeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetRewardNativeResponse{} + +// GetRewardNativeResponse This response returns reward points earn for this order. +type GetRewardNativeResponse struct { + // The reward points earned in this purchase. + Points int64 `json:"points"` + AdditionalProperties map[string]interface{} +} + +type _GetRewardNativeResponse GetRewardNativeResponse + +// NewGetRewardNativeResponse instantiates a new GetRewardNativeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRewardNativeResponse(points int64) *GetRewardNativeResponse { + this := GetRewardNativeResponse{} + this.Points = points + return &this +} + +// NewGetRewardNativeResponseWithDefaults instantiates a new GetRewardNativeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRewardNativeResponseWithDefaults() *GetRewardNativeResponse { + this := GetRewardNativeResponse{} + return &this +} + +// GetPoints returns the Points field value +func (o *GetRewardNativeResponse) GetPoints() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Points +} + +// GetPointsOk returns a tuple with the Points field value +// and a boolean to check if the value has been set. +func (o *GetRewardNativeResponse) GetPointsOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Points, true +} + +// SetPoints sets field value +func (o *GetRewardNativeResponse) SetPoints(v int64) { + o.Points = v +} + +func (o GetRewardNativeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetRewardNativeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["points"] = o.Points + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetRewardNativeResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "points", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGetRewardNativeResponse := _GetRewardNativeResponse{} + + err = json.Unmarshal(data, &varGetRewardNativeResponse) + + if err != nil { + return err + } + + *o = GetRewardNativeResponse(varGetRewardNativeResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "points") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetRewardNativeResponse struct { + value *GetRewardNativeResponse + isSet bool +} + +func (v NullableGetRewardNativeResponse) Get() *GetRewardNativeResponse { + return v.value +} + +func (v *NullableGetRewardNativeResponse) Set(val *GetRewardNativeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetRewardNativeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRewardNativeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRewardNativeResponse(val *GetRewardNativeResponse) *NullableGetRewardNativeResponse { + return &NullableGetRewardNativeResponse{value: val, isSet: true} +} + +func (v NullableGetRewardNativeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRewardNativeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_grab_oauth_request.go b/model_grab_oauth_request.go new file mode 100644 index 0000000..2886be8 --- /dev/null +++ b/model_grab_oauth_request.go @@ -0,0 +1,262 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the GrabOauthRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GrabOauthRequest{} + +// GrabOauthRequest Information about the GrabFood client getting an OAuth 2.0 access token from partners. +type GrabOauthRequest struct { + // The client identifier issued to the client to obtain the OAuth 2.0 access_token. + ClientId string `json:"client_id"` + // The client secret issued to the client to obtain the OAuth 2.0 access_token. + ClientSecret string `json:"client_secret"` + // The grant type for the client to obtain the OAuth 2.0 access_token. + GrantType string `json:"grant_type"` + // The scope for the client to obtain the OAuth 2.0 access_token. + Scope string `json:"scope"` + AdditionalProperties map[string]interface{} +} + +type _GrabOauthRequest GrabOauthRequest + +// NewGrabOauthRequest instantiates a new GrabOauthRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGrabOauthRequest(clientId string, clientSecret string, grantType string, scope string) *GrabOauthRequest { + this := GrabOauthRequest{} + this.ClientId = clientId + this.ClientSecret = clientSecret + this.GrantType = grantType + this.Scope = scope + return &this +} + +// NewGrabOauthRequestWithDefaults instantiates a new GrabOauthRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGrabOauthRequestWithDefaults() *GrabOauthRequest { + this := GrabOauthRequest{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *GrabOauthRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *GrabOauthRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *GrabOauthRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *GrabOauthRequest) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *GrabOauthRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *GrabOauthRequest) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetGrantType returns the GrantType field value +func (o *GrabOauthRequest) GetGrantType() string { + if o == nil { + var ret string + return ret + } + + return o.GrantType +} + +// GetGrantTypeOk returns a tuple with the GrantType field value +// and a boolean to check if the value has been set. +func (o *GrabOauthRequest) GetGrantTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrantType, true +} + +// SetGrantType sets field value +func (o *GrabOauthRequest) SetGrantType(v string) { + o.GrantType = v +} + +// GetScope returns the Scope field value +func (o *GrabOauthRequest) GetScope() string { + if o == nil { + var ret string + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *GrabOauthRequest) GetScopeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value +func (o *GrabOauthRequest) SetScope(v string) { + o.Scope = v +} + +func (o GrabOauthRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GrabOauthRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["grant_type"] = o.GrantType + toSerialize["scope"] = o.Scope + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GrabOauthRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "client_secret", + "grant_type", + "scope", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGrabOauthRequest := _GrabOauthRequest{} + + err = json.Unmarshal(data, &varGrabOauthRequest) + + if err != nil { + return err + } + + *o = GrabOauthRequest(varGrabOauthRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "grant_type") + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGrabOauthRequest struct { + value *GrabOauthRequest + isSet bool +} + +func (v NullableGrabOauthRequest) Get() *GrabOauthRequest { + return v.value +} + +func (v *NullableGrabOauthRequest) Set(val *GrabOauthRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGrabOauthRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGrabOauthRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGrabOauthRequest(val *GrabOauthRequest) *NullableGrabOauthRequest { + return &NullableGrabOauthRequest{value: val, isSet: true} +} + +func (v NullableGrabOauthRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGrabOauthRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_grab_oauth_response.go b/model_grab_oauth_response.go new file mode 100644 index 0000000..ea4a90a --- /dev/null +++ b/model_grab_oauth_response.go @@ -0,0 +1,235 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the GrabOauthResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GrabOauthResponse{} + +// GrabOauthResponse struct for GrabOauthResponse +type GrabOauthResponse struct { + // The OAuth 2.0 access token issued by the partner. + AccessToken *string `json:"access_token,omitempty"` + // The type of token issued which is case insensitive. + TokenType *string `json:"token_type,omitempty"` + // The access token lifespan in seconds. The token is reused till it expires - default is 604799 (7 days). + ExpiresIn *int32 `json:"expires_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GrabOauthResponse GrabOauthResponse + +// NewGrabOauthResponse instantiates a new GrabOauthResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGrabOauthResponse() *GrabOauthResponse { + this := GrabOauthResponse{} + return &this +} + +// NewGrabOauthResponseWithDefaults instantiates a new GrabOauthResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGrabOauthResponseWithDefaults() *GrabOauthResponse { + this := GrabOauthResponse{} + return &this +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise. +func (o *GrabOauthResponse) GetAccessToken() string { + if o == nil || IsNil(o.AccessToken) { + var ret string + return ret + } + return *o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GrabOauthResponse) GetAccessTokenOk() (*string, bool) { + if o == nil || IsNil(o.AccessToken) { + return nil, false + } + return o.AccessToken, true +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *GrabOauthResponse) HasAccessToken() bool { + if o != nil && !IsNil(o.AccessToken) { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field. +func (o *GrabOauthResponse) SetAccessToken(v string) { + o.AccessToken = &v +} + +// GetTokenType returns the TokenType field value if set, zero value otherwise. +func (o *GrabOauthResponse) GetTokenType() string { + if o == nil || IsNil(o.TokenType) { + var ret string + return ret + } + return *o.TokenType +} + +// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GrabOauthResponse) GetTokenTypeOk() (*string, bool) { + if o == nil || IsNil(o.TokenType) { + return nil, false + } + return o.TokenType, true +} + +// HasTokenType returns a boolean if a field has been set. +func (o *GrabOauthResponse) HasTokenType() bool { + if o != nil && !IsNil(o.TokenType) { + return true + } + + return false +} + +// SetTokenType gets a reference to the given string and assigns it to the TokenType field. +func (o *GrabOauthResponse) SetTokenType(v string) { + o.TokenType = &v +} + +// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise. +func (o *GrabOauthResponse) GetExpiresIn() int32 { + if o == nil || IsNil(o.ExpiresIn) { + var ret int32 + return ret + } + return *o.ExpiresIn +} + +// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GrabOauthResponse) GetExpiresInOk() (*int32, bool) { + if o == nil || IsNil(o.ExpiresIn) { + return nil, false + } + return o.ExpiresIn, true +} + +// HasExpiresIn returns a boolean if a field has been set. +func (o *GrabOauthResponse) HasExpiresIn() bool { + if o != nil && !IsNil(o.ExpiresIn) { + return true + } + + return false +} + +// SetExpiresIn gets a reference to the given int32 and assigns it to the ExpiresIn field. +func (o *GrabOauthResponse) SetExpiresIn(v int32) { + o.ExpiresIn = &v +} + +func (o GrabOauthResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GrabOauthResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessToken) { + toSerialize["access_token"] = o.AccessToken + } + if !IsNil(o.TokenType) { + toSerialize["token_type"] = o.TokenType + } + if !IsNil(o.ExpiresIn) { + toSerialize["expires_in"] = o.ExpiresIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GrabOauthResponse) UnmarshalJSON(data []byte) (err error) { + varGrabOauthResponse := _GrabOauthResponse{} + + err = json.Unmarshal(data, &varGrabOauthResponse) + + if err != nil { + return err + } + + *o = GrabOauthResponse(varGrabOauthResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "access_token") + delete(additionalProperties, "token_type") + delete(additionalProperties, "expires_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGrabOauthResponse struct { + value *GrabOauthResponse + isSet bool +} + +func (v NullableGrabOauthResponse) Get() *GrabOauthResponse { + return v.value +} + +func (v *NullableGrabOauthResponse) Set(val *GrabOauthResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGrabOauthResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGrabOauthResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGrabOauthResponse(val *GrabOauthResponse) *NullableGrabOauthResponse { + return &NullableGrabOauthResponse{value: val, isSet: true} +} + +func (v NullableGrabOauthResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGrabOauthResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_campaign_response.go b/model_list_campaign_response.go new file mode 100644 index 0000000..59b2382 --- /dev/null +++ b/model_list_campaign_response.go @@ -0,0 +1,195 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the ListCampaignResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListCampaignResponse{} + +// ListCampaignResponse +type ListCampaignResponse struct { + Ongoing []Campaign `json:"ongoing,omitempty"` + Upcoming []Campaign `json:"upcoming,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListCampaignResponse ListCampaignResponse + +// NewListCampaignResponse instantiates a new ListCampaignResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListCampaignResponse() *ListCampaignResponse { + this := ListCampaignResponse{} + return &this +} + +// NewListCampaignResponseWithDefaults instantiates a new ListCampaignResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListCampaignResponseWithDefaults() *ListCampaignResponse { + this := ListCampaignResponse{} + return &this +} + +// GetOngoing returns the Ongoing field value if set, zero value otherwise. +func (o *ListCampaignResponse) GetOngoing() []Campaign { + if o == nil || IsNil(o.Ongoing) { + var ret []Campaign + return ret + } + return o.Ongoing +} + +// GetOngoingOk returns a tuple with the Ongoing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCampaignResponse) GetOngoingOk() ([]Campaign, bool) { + if o == nil || IsNil(o.Ongoing) { + return nil, false + } + return o.Ongoing, true +} + +// HasOngoing returns a boolean if a field has been set. +func (o *ListCampaignResponse) HasOngoing() bool { + if o != nil && !IsNil(o.Ongoing) { + return true + } + + return false +} + +// SetOngoing gets a reference to the given []Campaign and assigns it to the Ongoing field. +func (o *ListCampaignResponse) SetOngoing(v []Campaign) { + o.Ongoing = v +} + +// GetUpcoming returns the Upcoming field value if set, zero value otherwise. +func (o *ListCampaignResponse) GetUpcoming() []Campaign { + if o == nil || IsNil(o.Upcoming) { + var ret []Campaign + return ret + } + return o.Upcoming +} + +// GetUpcomingOk returns a tuple with the Upcoming field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListCampaignResponse) GetUpcomingOk() ([]Campaign, bool) { + if o == nil || IsNil(o.Upcoming) { + return nil, false + } + return o.Upcoming, true +} + +// HasUpcoming returns a boolean if a field has been set. +func (o *ListCampaignResponse) HasUpcoming() bool { + if o != nil && !IsNil(o.Upcoming) { + return true + } + + return false +} + +// SetUpcoming gets a reference to the given []Campaign and assigns it to the Upcoming field. +func (o *ListCampaignResponse) SetUpcoming(v []Campaign) { + o.Upcoming = v +} + +func (o ListCampaignResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListCampaignResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ongoing) { + toSerialize["ongoing"] = o.Ongoing + } + if !IsNil(o.Upcoming) { + toSerialize["upcoming"] = o.Upcoming + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListCampaignResponse) UnmarshalJSON(data []byte) (err error) { + varListCampaignResponse := _ListCampaignResponse{} + + err = json.Unmarshal(data, &varListCampaignResponse) + + if err != nil { + return err + } + + *o = ListCampaignResponse(varListCampaignResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "ongoing") + delete(additionalProperties, "upcoming") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListCampaignResponse struct { + value *ListCampaignResponse + isSet bool +} + +func (v NullableListCampaignResponse) Get() *ListCampaignResponse { + return v.value +} + +func (v *NullableListCampaignResponse) Set(val *ListCampaignResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListCampaignResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListCampaignResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListCampaignResponse(val *ListCampaignResponse) *NullableListCampaignResponse { + return &NullableListCampaignResponse{value: val, isSet: true} +} + +func (v NullableListCampaignResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListCampaignResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_list_orders_response.go b/model_list_orders_response.go new file mode 100644 index 0000000..34aabf8 --- /dev/null +++ b/model_list_orders_response.go @@ -0,0 +1,196 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the ListOrdersResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListOrdersResponse{} + +// ListOrdersResponse +type ListOrdersResponse struct { + // The boolean value to indicate if there is more order data. If `true`, you can continue requesting with page+1. + More *bool `json:"more,omitempty"` + Orders []Order `json:"orders,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListOrdersResponse ListOrdersResponse + +// NewListOrdersResponse instantiates a new ListOrdersResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListOrdersResponse() *ListOrdersResponse { + this := ListOrdersResponse{} + return &this +} + +// NewListOrdersResponseWithDefaults instantiates a new ListOrdersResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListOrdersResponseWithDefaults() *ListOrdersResponse { + this := ListOrdersResponse{} + return &this +} + +// GetMore returns the More field value if set, zero value otherwise. +func (o *ListOrdersResponse) GetMore() bool { + if o == nil || IsNil(o.More) { + var ret bool + return ret + } + return *o.More +} + +// GetMoreOk returns a tuple with the More field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOrdersResponse) GetMoreOk() (*bool, bool) { + if o == nil || IsNil(o.More) { + return nil, false + } + return o.More, true +} + +// HasMore returns a boolean if a field has been set. +func (o *ListOrdersResponse) HasMore() bool { + if o != nil && !IsNil(o.More) { + return true + } + + return false +} + +// SetMore gets a reference to the given bool and assigns it to the More field. +func (o *ListOrdersResponse) SetMore(v bool) { + o.More = &v +} + +// GetOrders returns the Orders field value if set, zero value otherwise. +func (o *ListOrdersResponse) GetOrders() []Order { + if o == nil || IsNil(o.Orders) { + var ret []Order + return ret + } + return o.Orders +} + +// GetOrdersOk returns a tuple with the Orders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListOrdersResponse) GetOrdersOk() ([]Order, bool) { + if o == nil || IsNil(o.Orders) { + return nil, false + } + return o.Orders, true +} + +// HasOrders returns a boolean if a field has been set. +func (o *ListOrdersResponse) HasOrders() bool { + if o != nil && !IsNil(o.Orders) { + return true + } + + return false +} + +// SetOrders gets a reference to the given []Order and assigns it to the Orders field. +func (o *ListOrdersResponse) SetOrders(v []Order) { + o.Orders = v +} + +func (o ListOrdersResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListOrdersResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.More) { + toSerialize["more"] = o.More + } + if !IsNil(o.Orders) { + toSerialize["orders"] = o.Orders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListOrdersResponse) UnmarshalJSON(data []byte) (err error) { + varListOrdersResponse := _ListOrdersResponse{} + + err = json.Unmarshal(data, &varListOrdersResponse) + + if err != nil { + return err + } + + *o = ListOrdersResponse(varListOrdersResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "more") + delete(additionalProperties, "orders") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListOrdersResponse struct { + value *ListOrdersResponse + isSet bool +} + +func (v NullableListOrdersResponse) Get() *ListOrdersResponse { + return v.value +} + +func (v *NullableListOrdersResponse) Set(val *ListOrdersResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListOrdersResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListOrdersResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListOrdersResponse(val *ListOrdersResponse) *NullableListOrdersResponse { + return &NullableListOrdersResponse{value: val, isSet: true} +} + +func (v NullableListOrdersResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListOrdersResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_mark_order_request.go b/model_mark_order_request.go new file mode 100644 index 0000000..4122f70 --- /dev/null +++ b/model_mark_order_request.go @@ -0,0 +1,202 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MarkOrderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MarkOrderRequest{} + +// MarkOrderRequest This request marks an order as ready for delivery or completed on GrabFood. +type MarkOrderRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The status to be marked accordingly. * `1` - mark order as ready * `2` - mark order as completed and only applicable to **dine-in** orders + MarkStatus int32 `json:"markStatus"` + AdditionalProperties map[string]interface{} +} + +type _MarkOrderRequest MarkOrderRequest + +// NewMarkOrderRequest instantiates a new MarkOrderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMarkOrderRequest(orderID string, markStatus int32) *MarkOrderRequest { + this := MarkOrderRequest{} + this.OrderID = orderID + this.MarkStatus = markStatus + return &this +} + +// NewMarkOrderRequestWithDefaults instantiates a new MarkOrderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMarkOrderRequestWithDefaults() *MarkOrderRequest { + this := MarkOrderRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *MarkOrderRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *MarkOrderRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *MarkOrderRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetMarkStatus returns the MarkStatus field value +func (o *MarkOrderRequest) GetMarkStatus() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MarkStatus +} + +// GetMarkStatusOk returns a tuple with the MarkStatus field value +// and a boolean to check if the value has been set. +func (o *MarkOrderRequest) GetMarkStatusOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MarkStatus, true +} + +// SetMarkStatus sets field value +func (o *MarkOrderRequest) SetMarkStatus(v int32) { + o.MarkStatus = v +} + +func (o MarkOrderRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MarkOrderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["markStatus"] = o.MarkStatus + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MarkOrderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "markStatus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMarkOrderRequest := _MarkOrderRequest{} + + err = json.Unmarshal(data, &varMarkOrderRequest) + + if err != nil { + return err + } + + *o = MarkOrderRequest(varMarkOrderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "markStatus") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMarkOrderRequest struct { + value *MarkOrderRequest + isSet bool +} + +func (v NullableMarkOrderRequest) Get() *MarkOrderRequest { + return v.value +} + +func (v *NullableMarkOrderRequest) Set(val *MarkOrderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMarkOrderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMarkOrderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMarkOrderRequest(val *MarkOrderRequest) *NullableMarkOrderRequest { + return &NullableMarkOrderRequest{value: val, isSet: true} +} + +func (v NullableMarkOrderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMarkOrderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_category.go b/model_menu_category.go new file mode 100644 index 0000000..6067457 --- /dev/null +++ b/model_menu_category.go @@ -0,0 +1,330 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuCategory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuCategory{} + +// MenuCategory struct for MenuCategory +type MenuCategory struct { + // The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. + Id string `json:"id"` + // The name of the category. + Name string `json:"name"` + // Translation of the category name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). + AvailableStatus string `json:"availableStatus"` + // The selling time's ID for the category. All items within the category will apply the same selling time unless there is another selling time specified for the item. + SellingTimeID string `json:"sellingTimeID"` + // An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. + Items []MenuItem `json:"items"` + AdditionalProperties map[string]interface{} +} + +type _MenuCategory MenuCategory + +// NewMenuCategory instantiates a new MenuCategory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuCategory(id string, name string, availableStatus string, sellingTimeID string, items []MenuItem) *MenuCategory { + this := MenuCategory{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + this.SellingTimeID = sellingTimeID + this.Items = items + return &this +} + +// NewMenuCategoryWithDefaults instantiates a new MenuCategory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuCategoryWithDefaults() *MenuCategory { + this := MenuCategory{} + return &this +} + +// GetId returns the Id field value +func (o *MenuCategory) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuCategory) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuCategory) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuCategory) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *MenuCategory) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *MenuCategory) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *MenuCategory) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *MenuCategory) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *MenuCategory) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetSellingTimeID returns the SellingTimeID field value +func (o *MenuCategory) GetSellingTimeID() string { + if o == nil { + var ret string + return ret + } + + return o.SellingTimeID +} + +// GetSellingTimeIDOk returns a tuple with the SellingTimeID field value +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetSellingTimeIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SellingTimeID, true +} + +// SetSellingTimeID sets field value +func (o *MenuCategory) SetSellingTimeID(v string) { + o.SellingTimeID = v +} + +// GetItems returns the Items field value +func (o *MenuCategory) GetItems() []MenuItem { + if o == nil { + var ret []MenuItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *MenuCategory) GetItemsOk() ([]MenuItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *MenuCategory) SetItems(v []MenuItem) { + o.Items = v +} + +func (o MenuCategory) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuCategory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + toSerialize["sellingTimeID"] = o.SellingTimeID + toSerialize["items"] = o.Items + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuCategory) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + "sellingTimeID", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuCategory := _MenuCategory{} + + err = json.Unmarshal(data, &varMenuCategory) + + if err != nil { + return err + } + + *o = MenuCategory(varMenuCategory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "sellingTimeID") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuCategory struct { + value *MenuCategory + isSet bool +} + +func (v NullableMenuCategory) Get() *MenuCategory { + return v.value +} + +func (v *NullableMenuCategory) Set(val *MenuCategory) { + v.value = val + v.isSet = true +} + +func (v NullableMenuCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuCategory(val *MenuCategory) *NullableMenuCategory { + return &NullableMenuCategory{value: val, isSet: true} +} + +func (v NullableMenuCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_entity.go b/model_menu_entity.go new file mode 100644 index 0000000..fb31468 --- /dev/null +++ b/model_menu_entity.go @@ -0,0 +1,349 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuEntity type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuEntity{} + +// MenuEntity struct for MenuEntity +type MenuEntity struct { + // The record's ID on the partner system. For example, the item id in case type is ITEM, modifier id is MODIFIER. + Id *string `json:"id,omitempty"` + // The record's price in minor unit format. + Price *int64 `json:"price,omitempty"` + // The record's availableStatus. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + AvailableStatus *string `json:"availableStatus,omitempty"` + // Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. + MaxStock *int64 `json:"maxStock,omitempty"` + // Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + AdvancedPricings []UpdateAdvancedPricing `json:"advancedPricings,omitempty"` + // Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. + Purchasabilities []UpdatePurchasability `json:"purchasabilities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuEntity MenuEntity + +// NewMenuEntity instantiates a new MenuEntity object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuEntity() *MenuEntity { + this := MenuEntity{} + return &this +} + +// NewMenuEntityWithDefaults instantiates a new MenuEntity object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuEntityWithDefaults() *MenuEntity { + this := MenuEntity{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuEntity) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuEntity) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuEntity) SetId(v string) { + o.Id = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *MenuEntity) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *MenuEntity) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *MenuEntity) SetPrice(v int64) { + o.Price = &v +} + +// GetAvailableStatus returns the AvailableStatus field value if set, zero value otherwise. +func (o *MenuEntity) GetAvailableStatus() string { + if o == nil || IsNil(o.AvailableStatus) { + var ret string + return ret + } + return *o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetAvailableStatusOk() (*string, bool) { + if o == nil || IsNil(o.AvailableStatus) { + return nil, false + } + return o.AvailableStatus, true +} + +// HasAvailableStatus returns a boolean if a field has been set. +func (o *MenuEntity) HasAvailableStatus() bool { + if o != nil && !IsNil(o.AvailableStatus) { + return true + } + + return false +} + +// SetAvailableStatus gets a reference to the given string and assigns it to the AvailableStatus field. +func (o *MenuEntity) SetAvailableStatus(v string) { + o.AvailableStatus = &v +} + +// GetMaxStock returns the MaxStock field value if set, zero value otherwise. +func (o *MenuEntity) GetMaxStock() int64 { + if o == nil || IsNil(o.MaxStock) { + var ret int64 + return ret + } + return *o.MaxStock +} + +// GetMaxStockOk returns a tuple with the MaxStock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetMaxStockOk() (*int64, bool) { + if o == nil || IsNil(o.MaxStock) { + return nil, false + } + return o.MaxStock, true +} + +// HasMaxStock returns a boolean if a field has been set. +func (o *MenuEntity) HasMaxStock() bool { + if o != nil && !IsNil(o.MaxStock) { + return true + } + + return false +} + +// SetMaxStock gets a reference to the given int64 and assigns it to the MaxStock field. +func (o *MenuEntity) SetMaxStock(v int64) { + o.MaxStock = &v +} + +// GetAdvancedPricings returns the AdvancedPricings field value if set, zero value otherwise. +func (o *MenuEntity) GetAdvancedPricings() []UpdateAdvancedPricing { + if o == nil || IsNil(o.AdvancedPricings) { + var ret []UpdateAdvancedPricing + return ret + } + return o.AdvancedPricings +} + +// GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetAdvancedPricingsOk() ([]UpdateAdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricings) { + return nil, false + } + return o.AdvancedPricings, true +} + +// HasAdvancedPricings returns a boolean if a field has been set. +func (o *MenuEntity) HasAdvancedPricings() bool { + if o != nil && !IsNil(o.AdvancedPricings) { + return true + } + + return false +} + +// SetAdvancedPricings gets a reference to the given []UpdateAdvancedPricing and assigns it to the AdvancedPricings field. +func (o *MenuEntity) SetAdvancedPricings(v []UpdateAdvancedPricing) { + o.AdvancedPricings = v +} + +// GetPurchasabilities returns the Purchasabilities field value if set, zero value otherwise. +func (o *MenuEntity) GetPurchasabilities() []UpdatePurchasability { + if o == nil || IsNil(o.Purchasabilities) { + var ret []UpdatePurchasability + return ret + } + return o.Purchasabilities +} + +// GetPurchasabilitiesOk returns a tuple with the Purchasabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntity) GetPurchasabilitiesOk() ([]UpdatePurchasability, bool) { + if o == nil || IsNil(o.Purchasabilities) { + return nil, false + } + return o.Purchasabilities, true +} + +// HasPurchasabilities returns a boolean if a field has been set. +func (o *MenuEntity) HasPurchasabilities() bool { + if o != nil && !IsNil(o.Purchasabilities) { + return true + } + + return false +} + +// SetPurchasabilities gets a reference to the given []UpdatePurchasability and assigns it to the Purchasabilities field. +func (o *MenuEntity) SetPurchasabilities(v []UpdatePurchasability) { + o.Purchasabilities = v +} + +func (o MenuEntity) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuEntity) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !IsNil(o.AvailableStatus) { + toSerialize["availableStatus"] = o.AvailableStatus + } + if !IsNil(o.MaxStock) { + toSerialize["maxStock"] = o.MaxStock + } + if !IsNil(o.AdvancedPricings) { + toSerialize["advancedPricings"] = o.AdvancedPricings + } + if !IsNil(o.Purchasabilities) { + toSerialize["purchasabilities"] = o.Purchasabilities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuEntity) UnmarshalJSON(data []byte) (err error) { + varMenuEntity := _MenuEntity{} + + err = json.Unmarshal(data, &varMenuEntity) + + if err != nil { + return err + } + + *o = MenuEntity(varMenuEntity) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "price") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "maxStock") + delete(additionalProperties, "advancedPricings") + delete(additionalProperties, "purchasabilities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuEntity struct { + value *MenuEntity + isSet bool +} + +func (v NullableMenuEntity) Get() *MenuEntity { + return v.value +} + +func (v *NullableMenuEntity) Set(val *MenuEntity) { + v.value = val + v.isSet = true +} + +func (v NullableMenuEntity) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuEntity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuEntity(val *MenuEntity) *NullableMenuEntity { + return &NullableMenuEntity{value: val, isSet: true} +} + +func (v NullableMenuEntity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuEntity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_entity_error.go b/model_menu_entity_error.go new file mode 100644 index 0000000..b549c8d --- /dev/null +++ b/model_menu_entity_error.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuEntityError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuEntityError{} + +// MenuEntityError struct for MenuEntityError +type MenuEntityError struct { + // The itemID. + EntityID *string `json:"entityID,omitempty"` + // The error message. + ErrMsg *string `json:"errMsg,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuEntityError MenuEntityError + +// NewMenuEntityError instantiates a new MenuEntityError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuEntityError() *MenuEntityError { + this := MenuEntityError{} + return &this +} + +// NewMenuEntityErrorWithDefaults instantiates a new MenuEntityError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuEntityErrorWithDefaults() *MenuEntityError { + this := MenuEntityError{} + return &this +} + +// GetEntityID returns the EntityID field value if set, zero value otherwise. +func (o *MenuEntityError) GetEntityID() string { + if o == nil || IsNil(o.EntityID) { + var ret string + return ret + } + return *o.EntityID +} + +// GetEntityIDOk returns a tuple with the EntityID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntityError) GetEntityIDOk() (*string, bool) { + if o == nil || IsNil(o.EntityID) { + return nil, false + } + return o.EntityID, true +} + +// HasEntityID returns a boolean if a field has been set. +func (o *MenuEntityError) HasEntityID() bool { + if o != nil && !IsNil(o.EntityID) { + return true + } + + return false +} + +// SetEntityID gets a reference to the given string and assigns it to the EntityID field. +func (o *MenuEntityError) SetEntityID(v string) { + o.EntityID = &v +} + +// GetErrMsg returns the ErrMsg field value if set, zero value otherwise. +func (o *MenuEntityError) GetErrMsg() string { + if o == nil || IsNil(o.ErrMsg) { + var ret string + return ret + } + return *o.ErrMsg +} + +// GetErrMsgOk returns a tuple with the ErrMsg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuEntityError) GetErrMsgOk() (*string, bool) { + if o == nil || IsNil(o.ErrMsg) { + return nil, false + } + return o.ErrMsg, true +} + +// HasErrMsg returns a boolean if a field has been set. +func (o *MenuEntityError) HasErrMsg() bool { + if o != nil && !IsNil(o.ErrMsg) { + return true + } + + return false +} + +// SetErrMsg gets a reference to the given string and assigns it to the ErrMsg field. +func (o *MenuEntityError) SetErrMsg(v string) { + o.ErrMsg = &v +} + +func (o MenuEntityError) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuEntityError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.EntityID) { + toSerialize["entityID"] = o.EntityID + } + if !IsNil(o.ErrMsg) { + toSerialize["errMsg"] = o.ErrMsg + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuEntityError) UnmarshalJSON(data []byte) (err error) { + varMenuEntityError := _MenuEntityError{} + + err = json.Unmarshal(data, &varMenuEntityError) + + if err != nil { + return err + } + + *o = MenuEntityError(varMenuEntityError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "entityID") + delete(additionalProperties, "errMsg") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuEntityError struct { + value *MenuEntityError + isSet bool +} + +func (v NullableMenuEntityError) Get() *MenuEntityError { + return v.value +} + +func (v *NullableMenuEntityError) Set(val *MenuEntityError) { + v.value = val + v.isSet = true +} + +func (v NullableMenuEntityError) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuEntityError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuEntityError(val *MenuEntityError) *NullableMenuEntityError { + return &NullableMenuEntityError{value: val, isSet: true} +} + +func (v NullableMenuEntityError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuEntityError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_item.go b/model_menu_item.go new file mode 100644 index 0000000..d9843ce --- /dev/null +++ b/model_menu_item.go @@ -0,0 +1,716 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuItem{} + +// MenuItem struct for MenuItem +type MenuItem struct { + // The item's ID in the partner system. + Id string `json:"id"` + // The name of the item. + Name string `json:"name"` + // Translation of the item name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the item that is in the category. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + AvailableStatus string `json:"availableStatus"` + // The description of the item. There is a custom length limit of 2000 for `VN`. + Description *string `json:"description,omitempty"` + // Translation of the item description. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + DescriptionTranslation *map[string]string `json:"descriptionTranslation,omitempty"` + // The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. + Price int64 `json:"price"` + // An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). + Photos []string `json:"photos,omitempty"` + // The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). + SpecialType *string `json:"specialType,omitempty"` + // **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. + Taxable *bool `json:"taxable,omitempty"` + // The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. + Barcode *string `json:"barcode,omitempty"` + // The selling time's ID for the item. This value overwrites the category's selling time if it is different. Empty value implies the category's selling time will be applied. + SellingTimeID *string `json:"sellingTimeID,omitempty"` + // Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. + MaxStock *int64 `json:"maxStock,omitempty"` + AdvancedPricing *AdvancedPricing `json:"advancedPricing,omitempty"` + Purchasability *Purchasability `json:"purchasability,omitempty"` + // An array of the modifierGroup JSON objects. Max 30 allowed per item. Refer to [Modifier groups](#modifier-groups) for more information. + ModifierGroups []ModifierGroup `json:"modifierGroups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuItem MenuItem + +// NewMenuItem instantiates a new MenuItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuItem(id string, name string, availableStatus string, price int64) *MenuItem { + this := MenuItem{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + this.Price = price + return &this +} + +// NewMenuItemWithDefaults instantiates a new MenuItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuItemWithDefaults() *MenuItem { + this := MenuItem{} + return &this +} + +// GetId returns the Id field value +func (o *MenuItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuItem) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuItem) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *MenuItem) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *MenuItem) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *MenuItem) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *MenuItem) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *MenuItem) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *MenuItem) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MenuItem) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MenuItem) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MenuItem) SetDescription(v string) { + o.Description = &v +} + +// GetDescriptionTranslation returns the DescriptionTranslation field value if set, zero value otherwise. +func (o *MenuItem) GetDescriptionTranslation() map[string]string { + if o == nil || IsNil(o.DescriptionTranslation) { + var ret map[string]string + return ret + } + return *o.DescriptionTranslation +} + +// GetDescriptionTranslationOk returns a tuple with the DescriptionTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetDescriptionTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.DescriptionTranslation) { + return nil, false + } + return o.DescriptionTranslation, true +} + +// HasDescriptionTranslation returns a boolean if a field has been set. +func (o *MenuItem) HasDescriptionTranslation() bool { + if o != nil && !IsNil(o.DescriptionTranslation) { + return true + } + + return false +} + +// SetDescriptionTranslation gets a reference to the given map[string]string and assigns it to the DescriptionTranslation field. +func (o *MenuItem) SetDescriptionTranslation(v map[string]string) { + o.DescriptionTranslation = &v +} + +// GetPrice returns the Price field value +func (o *MenuItem) GetPrice() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *MenuItem) GetPriceOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *MenuItem) SetPrice(v int64) { + o.Price = v +} + +// GetPhotos returns the Photos field value if set, zero value otherwise. +func (o *MenuItem) GetPhotos() []string { + if o == nil || IsNil(o.Photos) { + var ret []string + return ret + } + return o.Photos +} + +// GetPhotosOk returns a tuple with the Photos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetPhotosOk() ([]string, bool) { + if o == nil || IsNil(o.Photos) { + return nil, false + } + return o.Photos, true +} + +// HasPhotos returns a boolean if a field has been set. +func (o *MenuItem) HasPhotos() bool { + if o != nil && !IsNil(o.Photos) { + return true + } + + return false +} + +// SetPhotos gets a reference to the given []string and assigns it to the Photos field. +func (o *MenuItem) SetPhotos(v []string) { + o.Photos = v +} + +// GetSpecialType returns the SpecialType field value if set, zero value otherwise. +func (o *MenuItem) GetSpecialType() string { + if o == nil || IsNil(o.SpecialType) { + var ret string + return ret + } + return *o.SpecialType +} + +// GetSpecialTypeOk returns a tuple with the SpecialType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetSpecialTypeOk() (*string, bool) { + if o == nil || IsNil(o.SpecialType) { + return nil, false + } + return o.SpecialType, true +} + +// HasSpecialType returns a boolean if a field has been set. +func (o *MenuItem) HasSpecialType() bool { + if o != nil && !IsNil(o.SpecialType) { + return true + } + + return false +} + +// SetSpecialType gets a reference to the given string and assigns it to the SpecialType field. +func (o *MenuItem) SetSpecialType(v string) { + o.SpecialType = &v +} + +// GetTaxable returns the Taxable field value if set, zero value otherwise. +func (o *MenuItem) GetTaxable() bool { + if o == nil || IsNil(o.Taxable) { + var ret bool + return ret + } + return *o.Taxable +} + +// GetTaxableOk returns a tuple with the Taxable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetTaxableOk() (*bool, bool) { + if o == nil || IsNil(o.Taxable) { + return nil, false + } + return o.Taxable, true +} + +// HasTaxable returns a boolean if a field has been set. +func (o *MenuItem) HasTaxable() bool { + if o != nil && !IsNil(o.Taxable) { + return true + } + + return false +} + +// SetTaxable gets a reference to the given bool and assigns it to the Taxable field. +func (o *MenuItem) SetTaxable(v bool) { + o.Taxable = &v +} + +// GetBarcode returns the Barcode field value if set, zero value otherwise. +func (o *MenuItem) GetBarcode() string { + if o == nil || IsNil(o.Barcode) { + var ret string + return ret + } + return *o.Barcode +} + +// GetBarcodeOk returns a tuple with the Barcode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetBarcodeOk() (*string, bool) { + if o == nil || IsNil(o.Barcode) { + return nil, false + } + return o.Barcode, true +} + +// HasBarcode returns a boolean if a field has been set. +func (o *MenuItem) HasBarcode() bool { + if o != nil && !IsNil(o.Barcode) { + return true + } + + return false +} + +// SetBarcode gets a reference to the given string and assigns it to the Barcode field. +func (o *MenuItem) SetBarcode(v string) { + o.Barcode = &v +} + +// GetSellingTimeID returns the SellingTimeID field value if set, zero value otherwise. +func (o *MenuItem) GetSellingTimeID() string { + if o == nil || IsNil(o.SellingTimeID) { + var ret string + return ret + } + return *o.SellingTimeID +} + +// GetSellingTimeIDOk returns a tuple with the SellingTimeID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetSellingTimeIDOk() (*string, bool) { + if o == nil || IsNil(o.SellingTimeID) { + return nil, false + } + return o.SellingTimeID, true +} + +// HasSellingTimeID returns a boolean if a field has been set. +func (o *MenuItem) HasSellingTimeID() bool { + if o != nil && !IsNil(o.SellingTimeID) { + return true + } + + return false +} + +// SetSellingTimeID gets a reference to the given string and assigns it to the SellingTimeID field. +func (o *MenuItem) SetSellingTimeID(v string) { + o.SellingTimeID = &v +} + +// GetMaxStock returns the MaxStock field value if set, zero value otherwise. +func (o *MenuItem) GetMaxStock() int64 { + if o == nil || IsNil(o.MaxStock) { + var ret int64 + return ret + } + return *o.MaxStock +} + +// GetMaxStockOk returns a tuple with the MaxStock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetMaxStockOk() (*int64, bool) { + if o == nil || IsNil(o.MaxStock) { + return nil, false + } + return o.MaxStock, true +} + +// HasMaxStock returns a boolean if a field has been set. +func (o *MenuItem) HasMaxStock() bool { + if o != nil && !IsNil(o.MaxStock) { + return true + } + + return false +} + +// SetMaxStock gets a reference to the given int64 and assigns it to the MaxStock field. +func (o *MenuItem) SetMaxStock(v int64) { + o.MaxStock = &v +} + +// GetAdvancedPricing returns the AdvancedPricing field value if set, zero value otherwise. +func (o *MenuItem) GetAdvancedPricing() AdvancedPricing { + if o == nil || IsNil(o.AdvancedPricing) { + var ret AdvancedPricing + return ret + } + return *o.AdvancedPricing +} + +// GetAdvancedPricingOk returns a tuple with the AdvancedPricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetAdvancedPricingOk() (*AdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricing) { + return nil, false + } + return o.AdvancedPricing, true +} + +// HasAdvancedPricing returns a boolean if a field has been set. +func (o *MenuItem) HasAdvancedPricing() bool { + if o != nil && !IsNil(o.AdvancedPricing) { + return true + } + + return false +} + +// SetAdvancedPricing gets a reference to the given AdvancedPricing and assigns it to the AdvancedPricing field. +func (o *MenuItem) SetAdvancedPricing(v AdvancedPricing) { + o.AdvancedPricing = &v +} + +// GetPurchasability returns the Purchasability field value if set, zero value otherwise. +func (o *MenuItem) GetPurchasability() Purchasability { + if o == nil || IsNil(o.Purchasability) { + var ret Purchasability + return ret + } + return *o.Purchasability +} + +// GetPurchasabilityOk returns a tuple with the Purchasability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetPurchasabilityOk() (*Purchasability, bool) { + if o == nil || IsNil(o.Purchasability) { + return nil, false + } + return o.Purchasability, true +} + +// HasPurchasability returns a boolean if a field has been set. +func (o *MenuItem) HasPurchasability() bool { + if o != nil && !IsNil(o.Purchasability) { + return true + } + + return false +} + +// SetPurchasability gets a reference to the given Purchasability and assigns it to the Purchasability field. +func (o *MenuItem) SetPurchasability(v Purchasability) { + o.Purchasability = &v +} + +// GetModifierGroups returns the ModifierGroups field value if set, zero value otherwise. +func (o *MenuItem) GetModifierGroups() []ModifierGroup { + if o == nil || IsNil(o.ModifierGroups) { + var ret []ModifierGroup + return ret + } + return o.ModifierGroups +} + +// GetModifierGroupsOk returns a tuple with the ModifierGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuItem) GetModifierGroupsOk() ([]ModifierGroup, bool) { + if o == nil || IsNil(o.ModifierGroups) { + return nil, false + } + return o.ModifierGroups, true +} + +// HasModifierGroups returns a boolean if a field has been set. +func (o *MenuItem) HasModifierGroups() bool { + if o != nil && !IsNil(o.ModifierGroups) { + return true + } + + return false +} + +// SetModifierGroups gets a reference to the given []ModifierGroup and assigns it to the ModifierGroups field. +func (o *MenuItem) SetModifierGroups(v []ModifierGroup) { + o.ModifierGroups = v +} + +func (o MenuItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DescriptionTranslation) { + toSerialize["descriptionTranslation"] = o.DescriptionTranslation + } + toSerialize["price"] = o.Price + if !IsNil(o.Photos) { + toSerialize["photos"] = o.Photos + } + if !IsNil(o.SpecialType) { + toSerialize["specialType"] = o.SpecialType + } + if !IsNil(o.Taxable) { + toSerialize["taxable"] = o.Taxable + } + if !IsNil(o.Barcode) { + toSerialize["barcode"] = o.Barcode + } + if !IsNil(o.SellingTimeID) { + toSerialize["sellingTimeID"] = o.SellingTimeID + } + if !IsNil(o.MaxStock) { + toSerialize["maxStock"] = o.MaxStock + } + if !IsNil(o.AdvancedPricing) { + toSerialize["advancedPricing"] = o.AdvancedPricing + } + if !IsNil(o.Purchasability) { + toSerialize["purchasability"] = o.Purchasability + } + if !IsNil(o.ModifierGroups) { + toSerialize["modifierGroups"] = o.ModifierGroups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + "price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuItem := _MenuItem{} + + err = json.Unmarshal(data, &varMenuItem) + + if err != nil { + return err + } + + *o = MenuItem(varMenuItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "description") + delete(additionalProperties, "descriptionTranslation") + delete(additionalProperties, "price") + delete(additionalProperties, "photos") + delete(additionalProperties, "specialType") + delete(additionalProperties, "taxable") + delete(additionalProperties, "barcode") + delete(additionalProperties, "sellingTimeID") + delete(additionalProperties, "maxStock") + delete(additionalProperties, "advancedPricing") + delete(additionalProperties, "purchasability") + delete(additionalProperties, "modifierGroups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuItem struct { + value *MenuItem + isSet bool +} + +func (v NullableMenuItem) Get() *MenuItem { + return v.value +} + +func (v *NullableMenuItem) Set(val *MenuItem) { + v.value = val + v.isSet = true +} + +func (v NullableMenuItem) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuItem(val *MenuItem) *NullableMenuItem { + return &NullableMenuItem{value: val, isSet: true} +} + +func (v NullableMenuItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_modifier.go b/model_menu_modifier.go new file mode 100644 index 0000000..e8563cc --- /dev/null +++ b/model_menu_modifier.go @@ -0,0 +1,383 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuModifier type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuModifier{} + +// MenuModifier struct for MenuModifier +type MenuModifier struct { + // The modifier's ID that is on the partner's system. This ID should be unique with a min length of 1 and max of 64. + Id string `json:"id"` + // The name of the modifier. + Name string `json:"name"` + // Translation of the modifier name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the modifier that is in the ModifierGroup. + AvailableStatus string `json:"availableStatus"` + // The modifier's price (excluding tax) in minor format. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). + Price *int64 `json:"price,omitempty"` + // The barcode Number (GTIN). GTIN must be 8, 12, 13, 14 numeric digits. + Barcode *string `json:"barcode,omitempty"` + AdvancedPricing *AdvancedPricing `json:"advancedPricing,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuModifier MenuModifier + +// NewMenuModifier instantiates a new MenuModifier object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuModifier(id string, name string, availableStatus string) *MenuModifier { + this := MenuModifier{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + return &this +} + +// NewMenuModifierWithDefaults instantiates a new MenuModifier object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuModifierWithDefaults() *MenuModifier { + this := MenuModifier{} + return &this +} + +// GetId returns the Id field value +func (o *MenuModifier) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuModifier) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuModifier) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuModifier) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *MenuModifier) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *MenuModifier) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *MenuModifier) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *MenuModifier) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *MenuModifier) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *MenuModifier) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *MenuModifier) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *MenuModifier) SetPrice(v int64) { + o.Price = &v +} + +// GetBarcode returns the Barcode field value if set, zero value otherwise. +func (o *MenuModifier) GetBarcode() string { + if o == nil || IsNil(o.Barcode) { + var ret string + return ret + } + return *o.Barcode +} + +// GetBarcodeOk returns a tuple with the Barcode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetBarcodeOk() (*string, bool) { + if o == nil || IsNil(o.Barcode) { + return nil, false + } + return o.Barcode, true +} + +// HasBarcode returns a boolean if a field has been set. +func (o *MenuModifier) HasBarcode() bool { + if o != nil && !IsNil(o.Barcode) { + return true + } + + return false +} + +// SetBarcode gets a reference to the given string and assigns it to the Barcode field. +func (o *MenuModifier) SetBarcode(v string) { + o.Barcode = &v +} + +// GetAdvancedPricing returns the AdvancedPricing field value if set, zero value otherwise. +func (o *MenuModifier) GetAdvancedPricing() AdvancedPricing { + if o == nil || IsNil(o.AdvancedPricing) { + var ret AdvancedPricing + return ret + } + return *o.AdvancedPricing +} + +// GetAdvancedPricingOk returns a tuple with the AdvancedPricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuModifier) GetAdvancedPricingOk() (*AdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricing) { + return nil, false + } + return o.AdvancedPricing, true +} + +// HasAdvancedPricing returns a boolean if a field has been set. +func (o *MenuModifier) HasAdvancedPricing() bool { + if o != nil && !IsNil(o.AdvancedPricing) { + return true + } + + return false +} + +// SetAdvancedPricing gets a reference to the given AdvancedPricing and assigns it to the AdvancedPricing field. +func (o *MenuModifier) SetAdvancedPricing(v AdvancedPricing) { + o.AdvancedPricing = &v +} + +func (o MenuModifier) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuModifier) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !IsNil(o.Barcode) { + toSerialize["barcode"] = o.Barcode + } + if !IsNil(o.AdvancedPricing) { + toSerialize["advancedPricing"] = o.AdvancedPricing + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuModifier) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuModifier := _MenuModifier{} + + err = json.Unmarshal(data, &varMenuModifier) + + if err != nil { + return err + } + + *o = MenuModifier(varMenuModifier) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "price") + delete(additionalProperties, "barcode") + delete(additionalProperties, "advancedPricing") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuModifier struct { + value *MenuModifier + isSet bool +} + +func (v NullableMenuModifier) Get() *MenuModifier { + return v.value +} + +func (v *NullableMenuModifier) Set(val *MenuModifier) { + v.value = val + v.isSet = true +} + +func (v NullableMenuModifier) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuModifier) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuModifier(val *MenuModifier) *NullableMenuModifier { + return &NullableMenuModifier{value: val, isSet: true} +} + +func (v NullableMenuModifier) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuModifier) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_section.go b/model_menu_section.go new file mode 100644 index 0000000..9266204 --- /dev/null +++ b/model_menu_section.go @@ -0,0 +1,261 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuSection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSection{} + +// MenuSection struct for MenuSection +type MenuSection struct { + // The section's ID in the partner system. + Id string `json:"id"` + // The name of the section. + Name string `json:"name"` + ServiceHours ServiceHours `json:"serviceHours"` + // An array of category JSON objects. Max 100 allowed per section. Refer to [Categories](#categories) for more information. + Categories []MenuSectionCategory `json:"categories"` + AdditionalProperties map[string]interface{} +} + +type _MenuSection MenuSection + +// NewMenuSection instantiates a new MenuSection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSection(id string, name string, serviceHours ServiceHours, categories []MenuSectionCategory) *MenuSection { + this := MenuSection{} + this.Id = id + this.Name = name + this.ServiceHours = serviceHours + this.Categories = categories + return &this +} + +// NewMenuSectionWithDefaults instantiates a new MenuSection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSectionWithDefaults() *MenuSection { + this := MenuSection{} + return &this +} + +// GetId returns the Id field value +func (o *MenuSection) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuSection) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuSection) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuSection) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuSection) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuSection) SetName(v string) { + o.Name = v +} + +// GetServiceHours returns the ServiceHours field value +func (o *MenuSection) GetServiceHours() ServiceHours { + if o == nil { + var ret ServiceHours + return ret + } + + return o.ServiceHours +} + +// GetServiceHoursOk returns a tuple with the ServiceHours field value +// and a boolean to check if the value has been set. +func (o *MenuSection) GetServiceHoursOk() (*ServiceHours, bool) { + if o == nil { + return nil, false + } + return &o.ServiceHours, true +} + +// SetServiceHours sets field value +func (o *MenuSection) SetServiceHours(v ServiceHours) { + o.ServiceHours = v +} + +// GetCategories returns the Categories field value +func (o *MenuSection) GetCategories() []MenuSectionCategory { + if o == nil { + var ret []MenuSectionCategory + return ret + } + + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value +// and a boolean to check if the value has been set. +func (o *MenuSection) GetCategoriesOk() ([]MenuSectionCategory, bool) { + if o == nil { + return nil, false + } + return o.Categories, true +} + +// SetCategories sets field value +func (o *MenuSection) SetCategories(v []MenuSectionCategory) { + o.Categories = v +} + +func (o MenuSection) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["serviceHours"] = o.ServiceHours + toSerialize["categories"] = o.Categories + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "serviceHours", + "categories", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuSection := _MenuSection{} + + err = json.Unmarshal(data, &varMenuSection) + + if err != nil { + return err + } + + *o = MenuSection(varMenuSection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "serviceHours") + delete(additionalProperties, "categories") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSection struct { + value *MenuSection + isSet bool +} + +func (v NullableMenuSection) Get() *MenuSection { + return v.value +} + +func (v *NullableMenuSection) Set(val *MenuSection) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSection) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSection(val *MenuSection) *NullableMenuSection { + return &NullableMenuSection{value: val, isSet: true} +} + +func (v NullableMenuSection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_section_category.go b/model_menu_section_category.go new file mode 100644 index 0000000..340295d --- /dev/null +++ b/model_menu_section_category.go @@ -0,0 +1,300 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuSectionCategory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSectionCategory{} + +// MenuSectionCategory struct for MenuSectionCategory +type MenuSectionCategory struct { + // The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. + Id string `json:"id"` + // The name of the category. + Name string `json:"name"` + // Translation of the category name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). + AvailableStatus string `json:"availableStatus"` + // An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. + Items []MenuSectionCategoryItem `json:"items"` + AdditionalProperties map[string]interface{} +} + +type _MenuSectionCategory MenuSectionCategory + +// NewMenuSectionCategory instantiates a new MenuSectionCategory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSectionCategory(id string, name string, availableStatus string, items []MenuSectionCategoryItem) *MenuSectionCategory { + this := MenuSectionCategory{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + this.Items = items + return &this +} + +// NewMenuSectionCategoryWithDefaults instantiates a new MenuSectionCategory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSectionCategoryWithDefaults() *MenuSectionCategory { + this := MenuSectionCategory{} + return &this +} + +// GetId returns the Id field value +func (o *MenuSectionCategory) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategory) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuSectionCategory) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuSectionCategory) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategory) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuSectionCategory) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *MenuSectionCategory) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategory) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *MenuSectionCategory) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *MenuSectionCategory) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *MenuSectionCategory) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategory) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *MenuSectionCategory) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetItems returns the Items field value +func (o *MenuSectionCategory) GetItems() []MenuSectionCategoryItem { + if o == nil { + var ret []MenuSectionCategoryItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategory) GetItemsOk() ([]MenuSectionCategoryItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *MenuSectionCategory) SetItems(v []MenuSectionCategoryItem) { + o.Items = v +} + +func (o MenuSectionCategory) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSectionCategory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + toSerialize["items"] = o.Items + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSectionCategory) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuSectionCategory := _MenuSectionCategory{} + + err = json.Unmarshal(data, &varMenuSectionCategory) + + if err != nil { + return err + } + + *o = MenuSectionCategory(varMenuSectionCategory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSectionCategory struct { + value *MenuSectionCategory + isSet bool +} + +func (v NullableMenuSectionCategory) Get() *MenuSectionCategory { + return v.value +} + +func (v *NullableMenuSectionCategory) Set(val *MenuSectionCategory) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSectionCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSectionCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSectionCategory(val *MenuSectionCategory) *NullableMenuSectionCategory { + return &NullableMenuSectionCategory{value: val, isSet: true} +} + +func (v NullableMenuSectionCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSectionCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_section_category_item.go b/model_menu_section_category_item.go new file mode 100644 index 0000000..cd889f2 --- /dev/null +++ b/model_menu_section_category_item.go @@ -0,0 +1,678 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the MenuSectionCategoryItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSectionCategoryItem{} + +// MenuSectionCategoryItem struct for MenuSectionCategoryItem +type MenuSectionCategoryItem struct { + // The item's ID in the partner system. + Id string `json:"id"` + // The name of the item. + Name string `json:"name"` + // Translation of the item name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the item that is in the category. Refer to FAQs for more details about [availableStatus](#section/Menu/What-is-availableStatus). Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + AvailableStatus string `json:"availableStatus"` + // The description of the item. There is a custom length limit of 2000 for `VN`. + Description *string `json:"description,omitempty"` + // Translation of the item description. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + DescriptionTranslation *map[string]string `json:"descriptionTranslation,omitempty"` + // The item's price (excluding tax) in minor format. For example: 1900 means $19 with `currency.exponent` as 2. Refer to [FAQ](#section/Menu/Is-the-item-price-with-or-without-tax) for more details. + Price int32 `json:"price"` + // An array string for the item’s image URL links. Refer to FAQs for more details about [images](#section/Menu/What-are-the-recommended-formats-for-an-item-image). + Photos []string `json:"photos,omitempty"` + // The item's special Tag. Refer to FAQs for more details about [specialType](#section/Menu/What's-specialType). + SpecialType *string `json:"specialType,omitempty"` + // **For Indonesia only.** This field allows the configuration for an item to be marked as tax applicable, and marked item would then be included in a commercial invoice to consumers as per the government's regulations. + Taxable *bool `json:"taxable,omitempty"` + // The barcode Number (GTIN). Max 64 allowed. GTIN must be 8, 12, 13, 14 numeric digits. + Barcode *string `json:"barcode,omitempty"` + // Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Empty value implies no limit. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. + MaxStock *int32 `json:"maxStock,omitempty"` + AdvancedPricing *AdvancedPricing `json:"advancedPricing,omitempty"` + Purchasability *Purchasability `json:"purchasability,omitempty"` + // An array of the modifierGroup JSON objects. Max 30 allowed per item. Refer to [Modifier groups](#modifier-groups) for more information. + ModifierGroups []ModifierGroup `json:"modifierGroups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSectionCategoryItem MenuSectionCategoryItem + +// NewMenuSectionCategoryItem instantiates a new MenuSectionCategoryItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSectionCategoryItem(id string, name string, availableStatus string, price int32) *MenuSectionCategoryItem { + this := MenuSectionCategoryItem{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + this.Price = price + return &this +} + +// NewMenuSectionCategoryItemWithDefaults instantiates a new MenuSectionCategoryItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSectionCategoryItemWithDefaults() *MenuSectionCategoryItem { + this := MenuSectionCategoryItem{} + return &this +} + +// GetId returns the Id field value +func (o *MenuSectionCategoryItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MenuSectionCategoryItem) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *MenuSectionCategoryItem) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MenuSectionCategoryItem) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *MenuSectionCategoryItem) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *MenuSectionCategoryItem) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *MenuSectionCategoryItem) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MenuSectionCategoryItem) SetDescription(v string) { + o.Description = &v +} + +// GetDescriptionTranslation returns the DescriptionTranslation field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetDescriptionTranslation() map[string]string { + if o == nil || IsNil(o.DescriptionTranslation) { + var ret map[string]string + return ret + } + return *o.DescriptionTranslation +} + +// GetDescriptionTranslationOk returns a tuple with the DescriptionTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetDescriptionTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.DescriptionTranslation) { + return nil, false + } + return o.DescriptionTranslation, true +} + +// HasDescriptionTranslation returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasDescriptionTranslation() bool { + if o != nil && !IsNil(o.DescriptionTranslation) { + return true + } + + return false +} + +// SetDescriptionTranslation gets a reference to the given map[string]string and assigns it to the DescriptionTranslation field. +func (o *MenuSectionCategoryItem) SetDescriptionTranslation(v map[string]string) { + o.DescriptionTranslation = &v +} + +// GetPrice returns the Price field value +func (o *MenuSectionCategoryItem) GetPrice() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetPriceOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *MenuSectionCategoryItem) SetPrice(v int32) { + o.Price = v +} + +// GetPhotos returns the Photos field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetPhotos() []string { + if o == nil || IsNil(o.Photos) { + var ret []string + return ret + } + return o.Photos +} + +// GetPhotosOk returns a tuple with the Photos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetPhotosOk() ([]string, bool) { + if o == nil || IsNil(o.Photos) { + return nil, false + } + return o.Photos, true +} + +// HasPhotos returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasPhotos() bool { + if o != nil && !IsNil(o.Photos) { + return true + } + + return false +} + +// SetPhotos gets a reference to the given []string and assigns it to the Photos field. +func (o *MenuSectionCategoryItem) SetPhotos(v []string) { + o.Photos = v +} + +// GetSpecialType returns the SpecialType field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetSpecialType() string { + if o == nil || IsNil(o.SpecialType) { + var ret string + return ret + } + return *o.SpecialType +} + +// GetSpecialTypeOk returns a tuple with the SpecialType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetSpecialTypeOk() (*string, bool) { + if o == nil || IsNil(o.SpecialType) { + return nil, false + } + return o.SpecialType, true +} + +// HasSpecialType returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasSpecialType() bool { + if o != nil && !IsNil(o.SpecialType) { + return true + } + + return false +} + +// SetSpecialType gets a reference to the given string and assigns it to the SpecialType field. +func (o *MenuSectionCategoryItem) SetSpecialType(v string) { + o.SpecialType = &v +} + +// GetTaxable returns the Taxable field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetTaxable() bool { + if o == nil || IsNil(o.Taxable) { + var ret bool + return ret + } + return *o.Taxable +} + +// GetTaxableOk returns a tuple with the Taxable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetTaxableOk() (*bool, bool) { + if o == nil || IsNil(o.Taxable) { + return nil, false + } + return o.Taxable, true +} + +// HasTaxable returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasTaxable() bool { + if o != nil && !IsNil(o.Taxable) { + return true + } + + return false +} + +// SetTaxable gets a reference to the given bool and assigns it to the Taxable field. +func (o *MenuSectionCategoryItem) SetTaxable(v bool) { + o.Taxable = &v +} + +// GetBarcode returns the Barcode field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetBarcode() string { + if o == nil || IsNil(o.Barcode) { + var ret string + return ret + } + return *o.Barcode +} + +// GetBarcodeOk returns a tuple with the Barcode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetBarcodeOk() (*string, bool) { + if o == nil || IsNil(o.Barcode) { + return nil, false + } + return o.Barcode, true +} + +// HasBarcode returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasBarcode() bool { + if o != nil && !IsNil(o.Barcode) { + return true + } + + return false +} + +// SetBarcode gets a reference to the given string and assigns it to the Barcode field. +func (o *MenuSectionCategoryItem) SetBarcode(v string) { + o.Barcode = &v +} + +// GetMaxStock returns the MaxStock field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetMaxStock() int32 { + if o == nil || IsNil(o.MaxStock) { + var ret int32 + return ret + } + return *o.MaxStock +} + +// GetMaxStockOk returns a tuple with the MaxStock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetMaxStockOk() (*int32, bool) { + if o == nil || IsNil(o.MaxStock) { + return nil, false + } + return o.MaxStock, true +} + +// HasMaxStock returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasMaxStock() bool { + if o != nil && !IsNil(o.MaxStock) { + return true + } + + return false +} + +// SetMaxStock gets a reference to the given int32 and assigns it to the MaxStock field. +func (o *MenuSectionCategoryItem) SetMaxStock(v int32) { + o.MaxStock = &v +} + +// GetAdvancedPricing returns the AdvancedPricing field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetAdvancedPricing() AdvancedPricing { + if o == nil || IsNil(o.AdvancedPricing) { + var ret AdvancedPricing + return ret + } + return *o.AdvancedPricing +} + +// GetAdvancedPricingOk returns a tuple with the AdvancedPricing field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetAdvancedPricingOk() (*AdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricing) { + return nil, false + } + return o.AdvancedPricing, true +} + +// HasAdvancedPricing returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasAdvancedPricing() bool { + if o != nil && !IsNil(o.AdvancedPricing) { + return true + } + + return false +} + +// SetAdvancedPricing gets a reference to the given AdvancedPricing and assigns it to the AdvancedPricing field. +func (o *MenuSectionCategoryItem) SetAdvancedPricing(v AdvancedPricing) { + o.AdvancedPricing = &v +} + +// GetPurchasability returns the Purchasability field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetPurchasability() Purchasability { + if o == nil || IsNil(o.Purchasability) { + var ret Purchasability + return ret + } + return *o.Purchasability +} + +// GetPurchasabilityOk returns a tuple with the Purchasability field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetPurchasabilityOk() (*Purchasability, bool) { + if o == nil || IsNil(o.Purchasability) { + return nil, false + } + return o.Purchasability, true +} + +// HasPurchasability returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasPurchasability() bool { + if o != nil && !IsNil(o.Purchasability) { + return true + } + + return false +} + +// SetPurchasability gets a reference to the given Purchasability and assigns it to the Purchasability field. +func (o *MenuSectionCategoryItem) SetPurchasability(v Purchasability) { + o.Purchasability = &v +} + +// GetModifierGroups returns the ModifierGroups field value if set, zero value otherwise. +func (o *MenuSectionCategoryItem) GetModifierGroups() []ModifierGroup { + if o == nil || IsNil(o.ModifierGroups) { + var ret []ModifierGroup + return ret + } + return o.ModifierGroups +} + +// GetModifierGroupsOk returns a tuple with the ModifierGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSectionCategoryItem) GetModifierGroupsOk() ([]ModifierGroup, bool) { + if o == nil || IsNil(o.ModifierGroups) { + return nil, false + } + return o.ModifierGroups, true +} + +// HasModifierGroups returns a boolean if a field has been set. +func (o *MenuSectionCategoryItem) HasModifierGroups() bool { + if o != nil && !IsNil(o.ModifierGroups) { + return true + } + + return false +} + +// SetModifierGroups gets a reference to the given []ModifierGroup and assigns it to the ModifierGroups field. +func (o *MenuSectionCategoryItem) SetModifierGroups(v []ModifierGroup) { + o.ModifierGroups = v +} + +func (o MenuSectionCategoryItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSectionCategoryItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DescriptionTranslation) { + toSerialize["descriptionTranslation"] = o.DescriptionTranslation + } + toSerialize["price"] = o.Price + if !IsNil(o.Photos) { + toSerialize["photos"] = o.Photos + } + if !IsNil(o.SpecialType) { + toSerialize["specialType"] = o.SpecialType + } + if !IsNil(o.Taxable) { + toSerialize["taxable"] = o.Taxable + } + if !IsNil(o.Barcode) { + toSerialize["barcode"] = o.Barcode + } + if !IsNil(o.MaxStock) { + toSerialize["maxStock"] = o.MaxStock + } + if !IsNil(o.AdvancedPricing) { + toSerialize["advancedPricing"] = o.AdvancedPricing + } + if !IsNil(o.Purchasability) { + toSerialize["purchasability"] = o.Purchasability + } + if !IsNil(o.ModifierGroups) { + toSerialize["modifierGroups"] = o.ModifierGroups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSectionCategoryItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + "price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuSectionCategoryItem := _MenuSectionCategoryItem{} + + err = json.Unmarshal(data, &varMenuSectionCategoryItem) + + if err != nil { + return err + } + + *o = MenuSectionCategoryItem(varMenuSectionCategoryItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "description") + delete(additionalProperties, "descriptionTranslation") + delete(additionalProperties, "price") + delete(additionalProperties, "photos") + delete(additionalProperties, "specialType") + delete(additionalProperties, "taxable") + delete(additionalProperties, "barcode") + delete(additionalProperties, "maxStock") + delete(additionalProperties, "advancedPricing") + delete(additionalProperties, "purchasability") + delete(additionalProperties, "modifierGroups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSectionCategoryItem struct { + value *MenuSectionCategoryItem + isSet bool +} + +func (v NullableMenuSectionCategoryItem) Get() *MenuSectionCategoryItem { + return v.value +} + +func (v *NullableMenuSectionCategoryItem) Set(val *MenuSectionCategoryItem) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSectionCategoryItem) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSectionCategoryItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSectionCategoryItem(val *MenuSectionCategoryItem) *NullableMenuSectionCategoryItem { + return &NullableMenuSectionCategoryItem{value: val, isSet: true} +} + +func (v NullableMenuSectionCategoryItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSectionCategoryItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail.go b/model_menu_sync_fail.go new file mode 100644 index 0000000..08726b7 --- /dev/null +++ b/model_menu_sync_fail.go @@ -0,0 +1,270 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFail{} + +// MenuSyncFail struct for MenuSyncFail +type MenuSyncFail struct { + Id *string `json:"id,omitempty"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + ServiceHours *MenuSyncFailServiceHours `json:"serviceHours,omitempty"` + Categories []MenuSyncFailCategory `json:"categories,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFail MenuSyncFail + +// NewMenuSyncFail instantiates a new MenuSyncFail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFail() *MenuSyncFail { + this := MenuSyncFail{} + return &this +} + +// NewMenuSyncFailWithDefaults instantiates a new MenuSyncFail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailWithDefaults() *MenuSyncFail { + this := MenuSyncFail{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuSyncFail) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFail) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuSyncFail) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuSyncFail) SetId(v string) { + o.Id = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFail) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFail) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFail) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFail) SetErrors(v []string) { + o.Errors = v +} + +// GetServiceHours returns the ServiceHours field value if set, zero value otherwise. +func (o *MenuSyncFail) GetServiceHours() MenuSyncFailServiceHours { + if o == nil || IsNil(o.ServiceHours) { + var ret MenuSyncFailServiceHours + return ret + } + return *o.ServiceHours +} + +// GetServiceHoursOk returns a tuple with the ServiceHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFail) GetServiceHoursOk() (*MenuSyncFailServiceHours, bool) { + if o == nil || IsNil(o.ServiceHours) { + return nil, false + } + return o.ServiceHours, true +} + +// HasServiceHours returns a boolean if a field has been set. +func (o *MenuSyncFail) HasServiceHours() bool { + if o != nil && !IsNil(o.ServiceHours) { + return true + } + + return false +} + +// SetServiceHours gets a reference to the given MenuSyncFailServiceHours and assigns it to the ServiceHours field. +func (o *MenuSyncFail) SetServiceHours(v MenuSyncFailServiceHours) { + o.ServiceHours = &v +} + +// GetCategories returns the Categories field value if set, zero value otherwise. +func (o *MenuSyncFail) GetCategories() []MenuSyncFailCategory { + if o == nil || IsNil(o.Categories) { + var ret []MenuSyncFailCategory + return ret + } + return o.Categories +} + +// GetCategoriesOk returns a tuple with the Categories field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFail) GetCategoriesOk() ([]MenuSyncFailCategory, bool) { + if o == nil || IsNil(o.Categories) { + return nil, false + } + return o.Categories, true +} + +// HasCategories returns a boolean if a field has been set. +func (o *MenuSyncFail) HasCategories() bool { + if o != nil && !IsNil(o.Categories) { + return true + } + + return false +} + +// SetCategories gets a reference to the given []MenuSyncFailCategory and assigns it to the Categories field. +func (o *MenuSyncFail) SetCategories(v []MenuSyncFailCategory) { + o.Categories = v +} + +func (o MenuSyncFail) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ServiceHours) { + toSerialize["serviceHours"] = o.ServiceHours + } + if !IsNil(o.Categories) { + toSerialize["categories"] = o.Categories + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFail) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFail := _MenuSyncFail{} + + err = json.Unmarshal(data, &varMenuSyncFail) + + if err != nil { + return err + } + + *o = MenuSyncFail(varMenuSyncFail) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "errors") + delete(additionalProperties, "serviceHours") + delete(additionalProperties, "categories") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFail struct { + value *MenuSyncFail + isSet bool +} + +func (v NullableMenuSyncFail) Get() *MenuSyncFail { + return v.value +} + +func (v *NullableMenuSyncFail) Set(val *MenuSyncFail) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFail) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFail(val *MenuSyncFail) *NullableMenuSyncFail { + return &NullableMenuSyncFail{value: val, isSet: true} +} + +func (v NullableMenuSyncFail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail_category.go b/model_menu_sync_fail_category.go new file mode 100644 index 0000000..4b59821 --- /dev/null +++ b/model_menu_sync_fail_category.go @@ -0,0 +1,235 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFailCategory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFailCategory{} + +// MenuSyncFailCategory struct for MenuSyncFailCategory +type MenuSyncFailCategory struct { + // The category's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. + Id *string `json:"id,omitempty"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + // An array of item JSON objects. Max 300 allowed per category. Refer to [Items](#items) for more information. + Items []MenuSyncFailItem `json:"items,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFailCategory MenuSyncFailCategory + +// NewMenuSyncFailCategory instantiates a new MenuSyncFailCategory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFailCategory() *MenuSyncFailCategory { + this := MenuSyncFailCategory{} + return &this +} + +// NewMenuSyncFailCategoryWithDefaults instantiates a new MenuSyncFailCategory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailCategoryWithDefaults() *MenuSyncFailCategory { + this := MenuSyncFailCategory{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuSyncFailCategory) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailCategory) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuSyncFailCategory) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuSyncFailCategory) SetId(v string) { + o.Id = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFailCategory) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailCategory) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFailCategory) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFailCategory) SetErrors(v []string) { + o.Errors = v +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *MenuSyncFailCategory) GetItems() []MenuSyncFailItem { + if o == nil || IsNil(o.Items) { + var ret []MenuSyncFailItem + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailCategory) GetItemsOk() ([]MenuSyncFailItem, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *MenuSyncFailCategory) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []MenuSyncFailItem and assigns it to the Items field. +func (o *MenuSyncFailCategory) SetItems(v []MenuSyncFailItem) { + o.Items = v +} + +func (o MenuSyncFailCategory) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFailCategory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFailCategory) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFailCategory := _MenuSyncFailCategory{} + + err = json.Unmarshal(data, &varMenuSyncFailCategory) + + if err != nil { + return err + } + + *o = MenuSyncFailCategory(varMenuSyncFailCategory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "errors") + delete(additionalProperties, "items") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFailCategory struct { + value *MenuSyncFailCategory + isSet bool +} + +func (v NullableMenuSyncFailCategory) Get() *MenuSyncFailCategory { + return v.value +} + +func (v *NullableMenuSyncFailCategory) Set(val *MenuSyncFailCategory) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFailCategory) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFailCategory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFailCategory(val *MenuSyncFailCategory) *NullableMenuSyncFailCategory { + return &NullableMenuSyncFailCategory{value: val, isSet: true} +} + +func (v NullableMenuSyncFailCategory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFailCategory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail_item.go b/model_menu_sync_fail_item.go new file mode 100644 index 0000000..bd28edb --- /dev/null +++ b/model_menu_sync_fail_item.go @@ -0,0 +1,234 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFailItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFailItem{} + +// MenuSyncFailItem struct for MenuSyncFailItem +type MenuSyncFailItem struct { + // The item's ID in the partner system. + Id *string `json:"id,omitempty"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + ModifierGroups []MenuSyncFailModifierGroup `json:"modifierGroups,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFailItem MenuSyncFailItem + +// NewMenuSyncFailItem instantiates a new MenuSyncFailItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFailItem() *MenuSyncFailItem { + this := MenuSyncFailItem{} + return &this +} + +// NewMenuSyncFailItemWithDefaults instantiates a new MenuSyncFailItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailItemWithDefaults() *MenuSyncFailItem { + this := MenuSyncFailItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuSyncFailItem) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailItem) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuSyncFailItem) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuSyncFailItem) SetId(v string) { + o.Id = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFailItem) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailItem) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFailItem) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFailItem) SetErrors(v []string) { + o.Errors = v +} + +// GetModifierGroups returns the ModifierGroups field value if set, zero value otherwise. +func (o *MenuSyncFailItem) GetModifierGroups() []MenuSyncFailModifierGroup { + if o == nil || IsNil(o.ModifierGroups) { + var ret []MenuSyncFailModifierGroup + return ret + } + return o.ModifierGroups +} + +// GetModifierGroupsOk returns a tuple with the ModifierGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailItem) GetModifierGroupsOk() ([]MenuSyncFailModifierGroup, bool) { + if o == nil || IsNil(o.ModifierGroups) { + return nil, false + } + return o.ModifierGroups, true +} + +// HasModifierGroups returns a boolean if a field has been set. +func (o *MenuSyncFailItem) HasModifierGroups() bool { + if o != nil && !IsNil(o.ModifierGroups) { + return true + } + + return false +} + +// SetModifierGroups gets a reference to the given []MenuSyncFailModifierGroup and assigns it to the ModifierGroups field. +func (o *MenuSyncFailItem) SetModifierGroups(v []MenuSyncFailModifierGroup) { + o.ModifierGroups = v +} + +func (o MenuSyncFailItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFailItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.ModifierGroups) { + toSerialize["modifierGroups"] = o.ModifierGroups + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFailItem) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFailItem := _MenuSyncFailItem{} + + err = json.Unmarshal(data, &varMenuSyncFailItem) + + if err != nil { + return err + } + + *o = MenuSyncFailItem(varMenuSyncFailItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "errors") + delete(additionalProperties, "modifierGroups") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFailItem struct { + value *MenuSyncFailItem + isSet bool +} + +func (v NullableMenuSyncFailItem) Get() *MenuSyncFailItem { + return v.value +} + +func (v *NullableMenuSyncFailItem) Set(val *MenuSyncFailItem) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFailItem) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFailItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFailItem(val *MenuSyncFailItem) *NullableMenuSyncFailItem { + return &NullableMenuSyncFailItem{value: val, isSet: true} +} + +func (v NullableMenuSyncFailItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFailItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail_modifier.go b/model_menu_sync_fail_modifier.go new file mode 100644 index 0000000..98719f9 --- /dev/null +++ b/model_menu_sync_fail_modifier.go @@ -0,0 +1,196 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFailModifier type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFailModifier{} + +// MenuSyncFailModifier struct for MenuSyncFailModifier +type MenuSyncFailModifier struct { + Id *string `json:"id,omitempty"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFailModifier MenuSyncFailModifier + +// NewMenuSyncFailModifier instantiates a new MenuSyncFailModifier object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFailModifier() *MenuSyncFailModifier { + this := MenuSyncFailModifier{} + return &this +} + +// NewMenuSyncFailModifierWithDefaults instantiates a new MenuSyncFailModifier object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailModifierWithDefaults() *MenuSyncFailModifier { + this := MenuSyncFailModifier{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuSyncFailModifier) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailModifier) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuSyncFailModifier) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuSyncFailModifier) SetId(v string) { + o.Id = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFailModifier) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailModifier) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFailModifier) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFailModifier) SetErrors(v []string) { + o.Errors = v +} + +func (o MenuSyncFailModifier) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFailModifier) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFailModifier) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFailModifier := _MenuSyncFailModifier{} + + err = json.Unmarshal(data, &varMenuSyncFailModifier) + + if err != nil { + return err + } + + *o = MenuSyncFailModifier(varMenuSyncFailModifier) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFailModifier struct { + value *MenuSyncFailModifier + isSet bool +} + +func (v NullableMenuSyncFailModifier) Get() *MenuSyncFailModifier { + return v.value +} + +func (v *NullableMenuSyncFailModifier) Set(val *MenuSyncFailModifier) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFailModifier) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFailModifier) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFailModifier(val *MenuSyncFailModifier) *NullableMenuSyncFailModifier { + return &NullableMenuSyncFailModifier{value: val, isSet: true} +} + +func (v NullableMenuSyncFailModifier) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFailModifier) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail_modifier_group.go b/model_menu_sync_fail_modifier_group.go new file mode 100644 index 0000000..f342544 --- /dev/null +++ b/model_menu_sync_fail_modifier_group.go @@ -0,0 +1,233 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFailModifierGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFailModifierGroup{} + +// MenuSyncFailModifierGroup struct for MenuSyncFailModifierGroup +type MenuSyncFailModifierGroup struct { + Id *string `json:"id,omitempty"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + Modifiers []MenuSyncFailModifier `json:"modifiers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFailModifierGroup MenuSyncFailModifierGroup + +// NewMenuSyncFailModifierGroup instantiates a new MenuSyncFailModifierGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFailModifierGroup() *MenuSyncFailModifierGroup { + this := MenuSyncFailModifierGroup{} + return &this +} + +// NewMenuSyncFailModifierGroupWithDefaults instantiates a new MenuSyncFailModifierGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailModifierGroupWithDefaults() *MenuSyncFailModifierGroup { + this := MenuSyncFailModifierGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *MenuSyncFailModifierGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailModifierGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *MenuSyncFailModifierGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *MenuSyncFailModifierGroup) SetId(v string) { + o.Id = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFailModifierGroup) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailModifierGroup) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFailModifierGroup) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFailModifierGroup) SetErrors(v []string) { + o.Errors = v +} + +// GetModifiers returns the Modifiers field value if set, zero value otherwise. +func (o *MenuSyncFailModifierGroup) GetModifiers() []MenuSyncFailModifier { + if o == nil || IsNil(o.Modifiers) { + var ret []MenuSyncFailModifier + return ret + } + return o.Modifiers +} + +// GetModifiersOk returns a tuple with the Modifiers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailModifierGroup) GetModifiersOk() ([]MenuSyncFailModifier, bool) { + if o == nil || IsNil(o.Modifiers) { + return nil, false + } + return o.Modifiers, true +} + +// HasModifiers returns a boolean if a field has been set. +func (o *MenuSyncFailModifierGroup) HasModifiers() bool { + if o != nil && !IsNil(o.Modifiers) { + return true + } + + return false +} + +// SetModifiers gets a reference to the given []MenuSyncFailModifier and assigns it to the Modifiers field. +func (o *MenuSyncFailModifierGroup) SetModifiers(v []MenuSyncFailModifier) { + o.Modifiers = v +} + +func (o MenuSyncFailModifierGroup) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFailModifierGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + if !IsNil(o.Modifiers) { + toSerialize["modifiers"] = o.Modifiers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFailModifierGroup) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFailModifierGroup := _MenuSyncFailModifierGroup{} + + err = json.Unmarshal(data, &varMenuSyncFailModifierGroup) + + if err != nil { + return err + } + + *o = MenuSyncFailModifierGroup(varMenuSyncFailModifierGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "errors") + delete(additionalProperties, "modifiers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFailModifierGroup struct { + value *MenuSyncFailModifierGroup + isSet bool +} + +func (v NullableMenuSyncFailModifierGroup) Get() *MenuSyncFailModifierGroup { + return v.value +} + +func (v *NullableMenuSyncFailModifierGroup) Set(val *MenuSyncFailModifierGroup) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFailModifierGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFailModifierGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFailModifierGroup(val *MenuSyncFailModifierGroup) *NullableMenuSyncFailModifierGroup { + return &NullableMenuSyncFailModifierGroup{value: val, isSet: true} +} + +func (v NullableMenuSyncFailModifierGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFailModifierGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_fail_service_hours.go b/model_menu_sync_fail_service_hours.go new file mode 100644 index 0000000..3977994 --- /dev/null +++ b/model_menu_sync_fail_service_hours.go @@ -0,0 +1,159 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncFailServiceHours type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncFailServiceHours{} + +// MenuSyncFailServiceHours struct for MenuSyncFailServiceHours +type MenuSyncFailServiceHours struct { + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncFailServiceHours MenuSyncFailServiceHours + +// NewMenuSyncFailServiceHours instantiates a new MenuSyncFailServiceHours object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncFailServiceHours() *MenuSyncFailServiceHours { + this := MenuSyncFailServiceHours{} + return &this +} + +// NewMenuSyncFailServiceHoursWithDefaults instantiates a new MenuSyncFailServiceHours object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncFailServiceHoursWithDefaults() *MenuSyncFailServiceHours { + this := MenuSyncFailServiceHours{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncFailServiceHours) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncFailServiceHours) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncFailServiceHours) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncFailServiceHours) SetErrors(v []string) { + o.Errors = v +} + +func (o MenuSyncFailServiceHours) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncFailServiceHours) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncFailServiceHours) UnmarshalJSON(data []byte) (err error) { + varMenuSyncFailServiceHours := _MenuSyncFailServiceHours{} + + err = json.Unmarshal(data, &varMenuSyncFailServiceHours) + + if err != nil { + return err + } + + *o = MenuSyncFailServiceHours(varMenuSyncFailServiceHours) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncFailServiceHours struct { + value *MenuSyncFailServiceHours + isSet bool +} + +func (v NullableMenuSyncFailServiceHours) Get() *MenuSyncFailServiceHours { + return v.value +} + +func (v *NullableMenuSyncFailServiceHours) Set(val *MenuSyncFailServiceHours) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncFailServiceHours) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncFailServiceHours) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncFailServiceHours(val *MenuSyncFailServiceHours) *NullableMenuSyncFailServiceHours { + return &NullableMenuSyncFailServiceHours{value: val, isSet: true} +} + +func (v NullableMenuSyncFailServiceHours) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncFailServiceHours) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_response.go b/model_menu_sync_response.go new file mode 100644 index 0000000..7dd628a --- /dev/null +++ b/model_menu_sync_response.go @@ -0,0 +1,310 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the MenuSyncResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncResponse{} + +// MenuSyncResponse +type MenuSyncResponse struct { + // The Unix time the specified menu was created in GrabFood's database. + CreatedTime time.Time `json:"createdTime"` + // The Unix time the specified menu was created in GrabFood's database. + UpdatedTime time.Time `json:"updatedTime"` + // The status code for this request. See [Menu sync response statuses](#section/Menu-sync-response-statuses) for more information. + Code string `json:"code"` + // An array of strings of error message. + Errors []string `json:"errors,omitempty"` + Sections []MenuSyncFail `json:"sections,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncResponse MenuSyncResponse + +// NewMenuSyncResponse instantiates a new MenuSyncResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncResponse(createdTime time.Time, updatedTime time.Time, code string) *MenuSyncResponse { + this := MenuSyncResponse{} + this.CreatedTime = createdTime + this.UpdatedTime = updatedTime + this.Code = code + return &this +} + +// NewMenuSyncResponseWithDefaults instantiates a new MenuSyncResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncResponseWithDefaults() *MenuSyncResponse { + this := MenuSyncResponse{} + return &this +} + +// GetCreatedTime returns the CreatedTime field value +func (o *MenuSyncResponse) GetCreatedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedTime +} + +// GetCreatedTimeOk returns a tuple with the CreatedTime field value +// and a boolean to check if the value has been set. +func (o *MenuSyncResponse) GetCreatedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedTime, true +} + +// SetCreatedTime sets field value +func (o *MenuSyncResponse) SetCreatedTime(v time.Time) { + o.CreatedTime = v +} + +// GetUpdatedTime returns the UpdatedTime field value +func (o *MenuSyncResponse) GetUpdatedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.UpdatedTime +} + +// GetUpdatedTimeOk returns a tuple with the UpdatedTime field value +// and a boolean to check if the value has been set. +func (o *MenuSyncResponse) GetUpdatedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.UpdatedTime, true +} + +// SetUpdatedTime sets field value +func (o *MenuSyncResponse) SetUpdatedTime(v time.Time) { + o.UpdatedTime = v +} + +// GetCode returns the Code field value +func (o *MenuSyncResponse) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *MenuSyncResponse) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *MenuSyncResponse) SetCode(v string) { + o.Code = v +} + +// GetErrors returns the Errors field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MenuSyncResponse) GetErrors() []string { + if o == nil { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MenuSyncResponse) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncResponse) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncResponse) SetErrors(v []string) { + o.Errors = v +} + +// GetSections returns the Sections field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MenuSyncResponse) GetSections() []MenuSyncFail { + if o == nil { + var ret []MenuSyncFail + return ret + } + return o.Sections +} + +// GetSectionsOk returns a tuple with the Sections field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MenuSyncResponse) GetSectionsOk() ([]MenuSyncFail, bool) { + if o == nil || IsNil(o.Sections) { + return nil, false + } + return o.Sections, true +} + +// HasSections returns a boolean if a field has been set. +func (o *MenuSyncResponse) HasSections() bool { + if o != nil && !IsNil(o.Sections) { + return true + } + + return false +} + +// SetSections gets a reference to the given []MenuSyncFail and assigns it to the Sections field. +func (o *MenuSyncResponse) SetSections(v []MenuSyncFail) { + o.Sections = v +} + +func (o MenuSyncResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdTime"] = o.CreatedTime + toSerialize["updatedTime"] = o.UpdatedTime + toSerialize["code"] = o.Code + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + if o.Sections != nil { + toSerialize["sections"] = o.Sections + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdTime", + "updatedTime", + "code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMenuSyncResponse := _MenuSyncResponse{} + + err = json.Unmarshal(data, &varMenuSyncResponse) + + if err != nil { + return err + } + + *o = MenuSyncResponse(varMenuSyncResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdTime") + delete(additionalProperties, "updatedTime") + delete(additionalProperties, "code") + delete(additionalProperties, "errors") + delete(additionalProperties, "sections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncResponse struct { + value *MenuSyncResponse + isSet bool +} + +func (v NullableMenuSyncResponse) Get() *MenuSyncResponse { + return v.value +} + +func (v *NullableMenuSyncResponse) Set(val *MenuSyncResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncResponse(val *MenuSyncResponse) *NullableMenuSyncResponse { + return &NullableMenuSyncResponse{value: val, isSet: true} +} + +func (v NullableMenuSyncResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_menu_sync_webhook_request.go b/model_menu_sync_webhook_request.go new file mode 100644 index 0000000..7ba3cef --- /dev/null +++ b/model_menu_sync_webhook_request.go @@ -0,0 +1,387 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the MenuSyncWebhookRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MenuSyncWebhookRequest{} + +// MenuSyncWebhookRequest This request pushes the state of a menu sync operation. +type MenuSyncWebhookRequest struct { + // An universally unique identifier (UUID) string. Used to uniquely identify a webhook request. Partners should use this value to distinguish between different webhook requests. If two requests contain the same requestID, only the first request should be considered and later requests **must** be ignored or discarded. + RequestID *string `json:"requestID,omitempty"` + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The merchant's ID that is on the partner's database. + PartnerMerchantID *string `json:"partnerMerchantID,omitempty"` + // An UUID string. Uniquely identifies a menu sync job. This can be found from the [Menu Update Notification](#tag/update-menu-noti) API response header. + JobID *string `json:"jobID,omitempty"` + // Indicates the time of menu sync status change. This is based on ISO_8601/RFC3339. For example: `2022-07-29T15:55:59Z`. + UpdatedAt *string `json:"updatedAt,omitempty"` + // Indicates the state of the menu sync job. + Status *string `json:"status,omitempty"` + // A string array of errors that occurred during processing. This array is empty if the status is not `FAILED`. + Errors []string `json:"errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MenuSyncWebhookRequest MenuSyncWebhookRequest + +// NewMenuSyncWebhookRequest instantiates a new MenuSyncWebhookRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMenuSyncWebhookRequest() *MenuSyncWebhookRequest { + this := MenuSyncWebhookRequest{} + return &this +} + +// NewMenuSyncWebhookRequestWithDefaults instantiates a new MenuSyncWebhookRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMenuSyncWebhookRequestWithDefaults() *MenuSyncWebhookRequest { + this := MenuSyncWebhookRequest{} + return &this +} + +// GetRequestID returns the RequestID field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetRequestID() string { + if o == nil || IsNil(o.RequestID) { + var ret string + return ret + } + return *o.RequestID +} + +// GetRequestIDOk returns a tuple with the RequestID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetRequestIDOk() (*string, bool) { + if o == nil || IsNil(o.RequestID) { + return nil, false + } + return o.RequestID, true +} + +// HasRequestID returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasRequestID() bool { + if o != nil && !IsNil(o.RequestID) { + return true + } + + return false +} + +// SetRequestID gets a reference to the given string and assigns it to the RequestID field. +func (o *MenuSyncWebhookRequest) SetRequestID(v string) { + o.RequestID = &v +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *MenuSyncWebhookRequest) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetPartnerMerchantID returns the PartnerMerchantID field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetPartnerMerchantID() string { + if o == nil || IsNil(o.PartnerMerchantID) { + var ret string + return ret + } + return *o.PartnerMerchantID +} + +// GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetPartnerMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.PartnerMerchantID) { + return nil, false + } + return o.PartnerMerchantID, true +} + +// HasPartnerMerchantID returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasPartnerMerchantID() bool { + if o != nil && !IsNil(o.PartnerMerchantID) { + return true + } + + return false +} + +// SetPartnerMerchantID gets a reference to the given string and assigns it to the PartnerMerchantID field. +func (o *MenuSyncWebhookRequest) SetPartnerMerchantID(v string) { + o.PartnerMerchantID = &v +} + +// GetJobID returns the JobID field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetJobID() string { + if o == nil || IsNil(o.JobID) { + var ret string + return ret + } + return *o.JobID +} + +// GetJobIDOk returns a tuple with the JobID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetJobIDOk() (*string, bool) { + if o == nil || IsNil(o.JobID) { + return nil, false + } + return o.JobID, true +} + +// HasJobID returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasJobID() bool { + if o != nil && !IsNil(o.JobID) { + return true + } + + return false +} + +// SetJobID gets a reference to the given string and assigns it to the JobID field. +func (o *MenuSyncWebhookRequest) SetJobID(v string) { + o.JobID = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *MenuSyncWebhookRequest) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *MenuSyncWebhookRequest) SetStatus(v string) { + o.Status = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *MenuSyncWebhookRequest) GetErrors() []string { + if o == nil || IsNil(o.Errors) { + var ret []string + return ret + } + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MenuSyncWebhookRequest) GetErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.Errors) { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *MenuSyncWebhookRequest) HasErrors() bool { + if o != nil && !IsNil(o.Errors) { + return true + } + + return false +} + +// SetErrors gets a reference to the given []string and assigns it to the Errors field. +func (o *MenuSyncWebhookRequest) SetErrors(v []string) { + o.Errors = v +} + +func (o MenuSyncWebhookRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MenuSyncWebhookRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.RequestID) { + toSerialize["requestID"] = o.RequestID + } + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.PartnerMerchantID) { + toSerialize["partnerMerchantID"] = o.PartnerMerchantID + } + if !IsNil(o.JobID) { + toSerialize["jobID"] = o.JobID + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Errors) { + toSerialize["errors"] = o.Errors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MenuSyncWebhookRequest) UnmarshalJSON(data []byte) (err error) { + varMenuSyncWebhookRequest := _MenuSyncWebhookRequest{} + + err = json.Unmarshal(data, &varMenuSyncWebhookRequest) + + if err != nil { + return err + } + + *o = MenuSyncWebhookRequest(varMenuSyncWebhookRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "requestID") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "partnerMerchantID") + delete(additionalProperties, "jobID") + delete(additionalProperties, "updatedAt") + delete(additionalProperties, "status") + delete(additionalProperties, "errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMenuSyncWebhookRequest struct { + value *MenuSyncWebhookRequest + isSet bool +} + +func (v NullableMenuSyncWebhookRequest) Get() *MenuSyncWebhookRequest { + return v.value +} + +func (v *NullableMenuSyncWebhookRequest) Set(val *MenuSyncWebhookRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMenuSyncWebhookRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMenuSyncWebhookRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMenuSyncWebhookRequest(val *MenuSyncWebhookRequest) *NullableMenuSyncWebhookRequest { + return &NullableMenuSyncWebhookRequest{value: val, isSet: true} +} + +func (v NullableMenuSyncWebhookRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMenuSyncWebhookRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_modifier_group.go b/model_modifier_group.go new file mode 100644 index 0000000..2522ae5 --- /dev/null +++ b/model_modifier_group.go @@ -0,0 +1,376 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the ModifierGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ModifierGroup{} + +// ModifierGroup struct for ModifierGroup +type ModifierGroup struct { + // The ModifierGroup's ID that is on the partner system. This ID should be unique with a min length of 1 and max of 64. + Id string `json:"id"` + // The name of the ModifierGroup for the item that is in the parent category and section. + Name string `json:"name"` + // Translation of the modifier group name. Only support up to 1 translated language. Refer [Menu Translation](#section/Menu-Translation). + NameTranslation *map[string]string `json:"nameTranslation,omitempty"` + // The status for the ModifierGroup that is in the item. + AvailableStatus string `json:"availableStatus"` + // The minimum quantity of the attribute. Refer to FAQs for more details about [selection range](#section/Menu/What-does-the-selection-range-do). + SelectionRangeMin *int32 `json:"selectionRangeMin,omitempty"` + // The maximum quantity of the attribute. Refer to FAQs for more details about [selection range](#section/Menu/What-does-the-selection-range-do). + SelectionRangeMax int32 `json:"selectionRangeMax"` + // An array of modifier JSON objects. Max 100 per modifierGroup. Refer to [Modifiers](#modifiers) for more information. + Modifiers []MenuModifier `json:"modifiers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ModifierGroup ModifierGroup + +// NewModifierGroup instantiates a new ModifierGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewModifierGroup(id string, name string, availableStatus string, selectionRangeMax int32) *ModifierGroup { + this := ModifierGroup{} + this.Id = id + this.Name = name + this.AvailableStatus = availableStatus + this.SelectionRangeMax = selectionRangeMax + return &this +} + +// NewModifierGroupWithDefaults instantiates a new ModifierGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewModifierGroupWithDefaults() *ModifierGroup { + this := ModifierGroup{} + return &this +} + +// GetId returns the Id field value +func (o *ModifierGroup) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ModifierGroup) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ModifierGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ModifierGroup) SetName(v string) { + o.Name = v +} + +// GetNameTranslation returns the NameTranslation field value if set, zero value otherwise. +func (o *ModifierGroup) GetNameTranslation() map[string]string { + if o == nil || IsNil(o.NameTranslation) { + var ret map[string]string + return ret + } + return *o.NameTranslation +} + +// GetNameTranslationOk returns a tuple with the NameTranslation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetNameTranslationOk() (*map[string]string, bool) { + if o == nil || IsNil(o.NameTranslation) { + return nil, false + } + return o.NameTranslation, true +} + +// HasNameTranslation returns a boolean if a field has been set. +func (o *ModifierGroup) HasNameTranslation() bool { + if o != nil && !IsNil(o.NameTranslation) { + return true + } + + return false +} + +// SetNameTranslation gets a reference to the given map[string]string and assigns it to the NameTranslation field. +func (o *ModifierGroup) SetNameTranslation(v map[string]string) { + o.NameTranslation = &v +} + +// GetAvailableStatus returns the AvailableStatus field value +func (o *ModifierGroup) GetAvailableStatus() string { + if o == nil { + var ret string + return ret + } + + return o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetAvailableStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailableStatus, true +} + +// SetAvailableStatus sets field value +func (o *ModifierGroup) SetAvailableStatus(v string) { + o.AvailableStatus = v +} + +// GetSelectionRangeMin returns the SelectionRangeMin field value if set, zero value otherwise. +func (o *ModifierGroup) GetSelectionRangeMin() int32 { + if o == nil || IsNil(o.SelectionRangeMin) { + var ret int32 + return ret + } + return *o.SelectionRangeMin +} + +// GetSelectionRangeMinOk returns a tuple with the SelectionRangeMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetSelectionRangeMinOk() (*int32, bool) { + if o == nil || IsNil(o.SelectionRangeMin) { + return nil, false + } + return o.SelectionRangeMin, true +} + +// HasSelectionRangeMin returns a boolean if a field has been set. +func (o *ModifierGroup) HasSelectionRangeMin() bool { + if o != nil && !IsNil(o.SelectionRangeMin) { + return true + } + + return false +} + +// SetSelectionRangeMin gets a reference to the given int32 and assigns it to the SelectionRangeMin field. +func (o *ModifierGroup) SetSelectionRangeMin(v int32) { + o.SelectionRangeMin = &v +} + +// GetSelectionRangeMax returns the SelectionRangeMax field value +func (o *ModifierGroup) GetSelectionRangeMax() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.SelectionRangeMax +} + +// GetSelectionRangeMaxOk returns a tuple with the SelectionRangeMax field value +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetSelectionRangeMaxOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.SelectionRangeMax, true +} + +// SetSelectionRangeMax sets field value +func (o *ModifierGroup) SetSelectionRangeMax(v int32) { + o.SelectionRangeMax = v +} + +// GetModifiers returns the Modifiers field value if set, zero value otherwise. +func (o *ModifierGroup) GetModifiers() []MenuModifier { + if o == nil || IsNil(o.Modifiers) { + var ret []MenuModifier + return ret + } + return o.Modifiers +} + +// GetModifiersOk returns a tuple with the Modifiers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ModifierGroup) GetModifiersOk() ([]MenuModifier, bool) { + if o == nil || IsNil(o.Modifiers) { + return nil, false + } + return o.Modifiers, true +} + +// HasModifiers returns a boolean if a field has been set. +func (o *ModifierGroup) HasModifiers() bool { + if o != nil && !IsNil(o.Modifiers) { + return true + } + + return false +} + +// SetModifiers gets a reference to the given []MenuModifier and assigns it to the Modifiers field. +func (o *ModifierGroup) SetModifiers(v []MenuModifier) { + o.Modifiers = v +} + +func (o ModifierGroup) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ModifierGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.NameTranslation) { + toSerialize["nameTranslation"] = o.NameTranslation + } + toSerialize["availableStatus"] = o.AvailableStatus + if !IsNil(o.SelectionRangeMin) { + toSerialize["selectionRangeMin"] = o.SelectionRangeMin + } + toSerialize["selectionRangeMax"] = o.SelectionRangeMax + if !IsNil(o.Modifiers) { + toSerialize["modifiers"] = o.Modifiers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ModifierGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "availableStatus", + "selectionRangeMax", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varModifierGroup := _ModifierGroup{} + + err = json.Unmarshal(data, &varModifierGroup) + + if err != nil { + return err + } + + *o = ModifierGroup(varModifierGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "nameTranslation") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "selectionRangeMin") + delete(additionalProperties, "selectionRangeMax") + delete(additionalProperties, "modifiers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableModifierGroup struct { + value *ModifierGroup + isSet bool +} + +func (v NullableModifierGroup) Get() *ModifierGroup { + return v.value +} + +func (v *NullableModifierGroup) Set(val *ModifierGroup) { + v.value = val + v.isSet = true +} + +func (v NullableModifierGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableModifierGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModifierGroup(val *ModifierGroup) *NullableModifierGroup { + return &NullableModifierGroup{value: val, isSet: true} +} + +func (v NullableModifierGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModifierGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_new_order_time_request.go b/model_new_order_time_request.go new file mode 100644 index 0000000..ba4a15b --- /dev/null +++ b/model_new_order_time_request.go @@ -0,0 +1,203 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the NewOrderTimeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NewOrderTimeRequest{} + +// NewOrderTimeRequest This request updates an order with a new ready time on GrabFood. +type NewOrderTimeRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The new order ready time for this order, based on ISO_8601/RFC3339. + NewOrderReadyTime time.Time `json:"newOrderReadyTime"` + AdditionalProperties map[string]interface{} +} + +type _NewOrderTimeRequest NewOrderTimeRequest + +// NewNewOrderTimeRequest instantiates a new NewOrderTimeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNewOrderTimeRequest(orderID string, newOrderReadyTime time.Time) *NewOrderTimeRequest { + this := NewOrderTimeRequest{} + this.OrderID = orderID + this.NewOrderReadyTime = newOrderReadyTime + return &this +} + +// NewNewOrderTimeRequestWithDefaults instantiates a new NewOrderTimeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNewOrderTimeRequestWithDefaults() *NewOrderTimeRequest { + this := NewOrderTimeRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *NewOrderTimeRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *NewOrderTimeRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *NewOrderTimeRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetNewOrderReadyTime returns the NewOrderReadyTime field value +func (o *NewOrderTimeRequest) GetNewOrderReadyTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.NewOrderReadyTime +} + +// GetNewOrderReadyTimeOk returns a tuple with the NewOrderReadyTime field value +// and a boolean to check if the value has been set. +func (o *NewOrderTimeRequest) GetNewOrderReadyTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.NewOrderReadyTime, true +} + +// SetNewOrderReadyTime sets field value +func (o *NewOrderTimeRequest) SetNewOrderReadyTime(v time.Time) { + o.NewOrderReadyTime = v +} + +func (o NewOrderTimeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NewOrderTimeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["newOrderReadyTime"] = o.NewOrderReadyTime + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NewOrderTimeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "newOrderReadyTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNewOrderTimeRequest := _NewOrderTimeRequest{} + + err = json.Unmarshal(data, &varNewOrderTimeRequest) + + if err != nil { + return err + } + + *o = NewOrderTimeRequest(varNewOrderTimeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "newOrderReadyTime") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNewOrderTimeRequest struct { + value *NewOrderTimeRequest + isSet bool +} + +func (v NullableNewOrderTimeRequest) Get() *NewOrderTimeRequest { + return v.value +} + +func (v *NullableNewOrderTimeRequest) Set(val *NewOrderTimeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNewOrderTimeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNewOrderTimeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNewOrderTimeRequest(val *NewOrderTimeRequest) *NullableNewOrderTimeRequest { + return &NullableNewOrderTimeRequest{value: val, isSet: true} +} + +func (v NullableNewOrderTimeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNewOrderTimeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_notify_membership_webview_request.go b/model_notify_membership_webview_request.go new file mode 100644 index 0000000..82aeff2 --- /dev/null +++ b/model_notify_membership_webview_request.go @@ -0,0 +1,273 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the NotifyMembershipWebviewRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotifyMembershipWebviewRequest{} + +// NotifyMembershipWebviewRequest This request submits membership registration request to partner. +type NotifyMembershipWebviewRequest struct { + // The unique member ID on the partner's database. + MemberID *string `json:"memberID,omitempty"` + // The id used to identify an unique grab user. + GrabID *string `json:"grabID,omitempty"` + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // Action completed in partner's webview. + Action *string `json:"action,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotifyMembershipWebviewRequest NotifyMembershipWebviewRequest + +// NewNotifyMembershipWebviewRequest instantiates a new NotifyMembershipWebviewRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotifyMembershipWebviewRequest() *NotifyMembershipWebviewRequest { + this := NotifyMembershipWebviewRequest{} + return &this +} + +// NewNotifyMembershipWebviewRequestWithDefaults instantiates a new NotifyMembershipWebviewRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotifyMembershipWebviewRequestWithDefaults() *NotifyMembershipWebviewRequest { + this := NotifyMembershipWebviewRequest{} + return &this +} + +// GetMemberID returns the MemberID field value if set, zero value otherwise. +func (o *NotifyMembershipWebviewRequest) GetMemberID() string { + if o == nil || IsNil(o.MemberID) { + var ret string + return ret + } + return *o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotifyMembershipWebviewRequest) GetMemberIDOk() (*string, bool) { + if o == nil || IsNil(o.MemberID) { + return nil, false + } + return o.MemberID, true +} + +// HasMemberID returns a boolean if a field has been set. +func (o *NotifyMembershipWebviewRequest) HasMemberID() bool { + if o != nil && !IsNil(o.MemberID) { + return true + } + + return false +} + +// SetMemberID gets a reference to the given string and assigns it to the MemberID field. +func (o *NotifyMembershipWebviewRequest) SetMemberID(v string) { + o.MemberID = &v +} + +// GetGrabID returns the GrabID field value if set, zero value otherwise. +func (o *NotifyMembershipWebviewRequest) GetGrabID() string { + if o == nil || IsNil(o.GrabID) { + var ret string + return ret + } + return *o.GrabID +} + +// GetGrabIDOk returns a tuple with the GrabID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotifyMembershipWebviewRequest) GetGrabIDOk() (*string, bool) { + if o == nil || IsNil(o.GrabID) { + return nil, false + } + return o.GrabID, true +} + +// HasGrabID returns a boolean if a field has been set. +func (o *NotifyMembershipWebviewRequest) HasGrabID() bool { + if o != nil && !IsNil(o.GrabID) { + return true + } + + return false +} + +// SetGrabID gets a reference to the given string and assigns it to the GrabID field. +func (o *NotifyMembershipWebviewRequest) SetGrabID(v string) { + o.GrabID = &v +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *NotifyMembershipWebviewRequest) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotifyMembershipWebviewRequest) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *NotifyMembershipWebviewRequest) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *NotifyMembershipWebviewRequest) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *NotifyMembershipWebviewRequest) GetAction() string { + if o == nil || IsNil(o.Action) { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotifyMembershipWebviewRequest) GetActionOk() (*string, bool) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *NotifyMembershipWebviewRequest) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *NotifyMembershipWebviewRequest) SetAction(v string) { + o.Action = &v +} + +func (o NotifyMembershipWebviewRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotifyMembershipWebviewRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MemberID) { + toSerialize["memberID"] = o.MemberID + } + if !IsNil(o.GrabID) { + toSerialize["grabID"] = o.GrabID + } + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotifyMembershipWebviewRequest) UnmarshalJSON(data []byte) (err error) { + varNotifyMembershipWebviewRequest := _NotifyMembershipWebviewRequest{} + + err = json.Unmarshal(data, &varNotifyMembershipWebviewRequest) + + if err != nil { + return err + } + + *o = NotifyMembershipWebviewRequest(varNotifyMembershipWebviewRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + delete(additionalProperties, "grabID") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotifyMembershipWebviewRequest struct { + value *NotifyMembershipWebviewRequest + isSet bool +} + +func (v NullableNotifyMembershipWebviewRequest) Get() *NotifyMembershipWebviewRequest { + return v.value +} + +func (v *NullableNotifyMembershipWebviewRequest) Set(val *NotifyMembershipWebviewRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNotifyMembershipWebviewRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotifyMembershipWebviewRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotifyMembershipWebviewRequest(val *NotifyMembershipWebviewRequest) *NullableNotifyMembershipWebviewRequest { + return &NullableNotifyMembershipWebviewRequest{value: val, isSet: true} +} + +func (v NullableNotifyMembershipWebviewRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotifyMembershipWebviewRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_open_period.go b/model_open_period.go new file mode 100644 index 0000000..33b9192 --- /dev/null +++ b/model_open_period.go @@ -0,0 +1,202 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OpenPeriod type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OpenPeriod{} + +// OpenPeriod struct for OpenPeriod +type OpenPeriod struct { + // The open start time in 24h format. + StartTime string `json:"startTime"` + // The open start time in 24h format. + EndTime string `json:"endTime"` + AdditionalProperties map[string]interface{} +} + +type _OpenPeriod OpenPeriod + +// NewOpenPeriod instantiates a new OpenPeriod object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOpenPeriod(startTime string, endTime string) *OpenPeriod { + this := OpenPeriod{} + this.StartTime = startTime + this.EndTime = endTime + return &this +} + +// NewOpenPeriodWithDefaults instantiates a new OpenPeriod object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOpenPeriodWithDefaults() *OpenPeriod { + this := OpenPeriod{} + return &this +} + +// GetStartTime returns the StartTime field value +func (o *OpenPeriod) GetStartTime() string { + if o == nil { + var ret string + return ret + } + + return o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value +// and a boolean to check if the value has been set. +func (o *OpenPeriod) GetStartTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StartTime, true +} + +// SetStartTime sets field value +func (o *OpenPeriod) SetStartTime(v string) { + o.StartTime = v +} + +// GetEndTime returns the EndTime field value +func (o *OpenPeriod) GetEndTime() string { + if o == nil { + var ret string + return ret + } + + return o.EndTime +} + +// GetEndTimeOk returns a tuple with the EndTime field value +// and a boolean to check if the value has been set. +func (o *OpenPeriod) GetEndTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndTime, true +} + +// SetEndTime sets field value +func (o *OpenPeriod) SetEndTime(v string) { + o.EndTime = v +} + +func (o OpenPeriod) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OpenPeriod) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startTime"] = o.StartTime + toSerialize["endTime"] = o.EndTime + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OpenPeriod) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startTime", + "endTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOpenPeriod := _OpenPeriod{} + + err = json.Unmarshal(data, &varOpenPeriod) + + if err != nil { + return err + } + + *o = OpenPeriod(varOpenPeriod) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startTime") + delete(additionalProperties, "endTime") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOpenPeriod struct { + value *OpenPeriod + isSet bool +} + +func (v NullableOpenPeriod) Get() *OpenPeriod { + return v.value +} + +func (v *NullableOpenPeriod) Set(val *OpenPeriod) { + v.value = val + v.isSet = true +} + +func (v NullableOpenPeriod) IsSet() bool { + return v.isSet +} + +func (v *NullableOpenPeriod) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOpenPeriod(val *OpenPeriod) *NullableOpenPeriod { + return &NullableOpenPeriod{value: val, isSet: true} +} + +func (v NullableOpenPeriod) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOpenPeriod) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order.go b/model_order.go new file mode 100644 index 0000000..889ced9 --- /dev/null +++ b/model_order.go @@ -0,0 +1,856 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the Order type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Order{} + +// Order A JSON object containing the order information. +type Order struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The GrabFood short order number. This is unique for each merchant per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + ShortOrderNumber string `json:"shortOrderNumber"` + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The merchant's ID that is on the partner's database. + PartnerMerchantID *string `json:"partnerMerchantID,omitempty"` + // The payment method used. Refer to FAQs for more details about [paymentType](#section/Order/Does-the-paymentType-affect-partners). + PaymentType string `json:"paymentType"` + // The boolean value to indicate whether cutlery are needed or not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery). + Cutlery bool `json:"cutlery"` + // The UTC time that a consumer places the order, based on ISO_8601/RFC3339. + OrderTime string `json:"orderTime"` + // The order submit time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. + SubmitTime *time.Time `json:"submitTime,omitempty"` + // The order complete time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. + CompleteTime *time.Time `json:"completeTime,omitempty"` + // The order scheduled time, based on ISO_8601/RFC3339. Empty for non-scheduled orders. + ScheduledTime *string `json:"scheduledTime,omitempty"` + // The state of the order. Only present in the [List Orders](#tag/list-order) response. Refer to [Order States](#section/Order-states). + OrderState *string `json:"orderState,omitempty"` + Currency Currency `json:"currency"` + FeatureFlags OrderFeatureFlags `json:"featureFlags"` + // The items in an array of JSON Object. Refer to [Items](#items) for more information. + Items []OrderItem `json:"items"` + // The campaigns that are applicable for the order.`null` when there is no campaign applied. + Campaigns []OrderCampaign `json:"campaigns,omitempty"` + // An array of promotion objects. Only promotions that are funded by merchants will be sent. + Promos []OrderPromo `json:"promos,omitempty"` + Price OrderPrice `json:"price"` + DineIn *DineIn `json:"dineIn,omitempty"` + Receiver *Receiver `json:"receiver,omitempty"` + OrderReadyEstimation *OrderReadyEstimation `json:"orderReadyEstimation,omitempty"` + // Membership ID for loyalty project. Only present for loyalty program partners. + MembershipID *string `json:"membershipID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Order Order + +// NewOrder instantiates a new Order object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrder(orderID string, shortOrderNumber string, merchantID string, paymentType string, cutlery bool, orderTime string, currency Currency, featureFlags OrderFeatureFlags, items []OrderItem, price OrderPrice) *Order { + this := Order{} + this.OrderID = orderID + this.ShortOrderNumber = shortOrderNumber + this.MerchantID = merchantID + this.PaymentType = paymentType + this.Cutlery = cutlery + this.OrderTime = orderTime + this.Currency = currency + this.FeatureFlags = featureFlags + this.Items = items + this.Price = price + return &this +} + +// NewOrderWithDefaults instantiates a new Order object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderWithDefaults() *Order { + this := Order{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *Order) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *Order) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *Order) SetOrderID(v string) { + o.OrderID = v +} + +// GetShortOrderNumber returns the ShortOrderNumber field value +func (o *Order) GetShortOrderNumber() string { + if o == nil { + var ret string + return ret + } + + return o.ShortOrderNumber +} + +// GetShortOrderNumberOk returns a tuple with the ShortOrderNumber field value +// and a boolean to check if the value has been set. +func (o *Order) GetShortOrderNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortOrderNumber, true +} + +// SetShortOrderNumber sets field value +func (o *Order) SetShortOrderNumber(v string) { + o.ShortOrderNumber = v +} + +// GetMerchantID returns the MerchantID field value +func (o *Order) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *Order) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *Order) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetPartnerMerchantID returns the PartnerMerchantID field value if set, zero value otherwise. +func (o *Order) GetPartnerMerchantID() string { + if o == nil || IsNil(o.PartnerMerchantID) { + var ret string + return ret + } + return *o.PartnerMerchantID +} + +// GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPartnerMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.PartnerMerchantID) { + return nil, false + } + return o.PartnerMerchantID, true +} + +// HasPartnerMerchantID returns a boolean if a field has been set. +func (o *Order) HasPartnerMerchantID() bool { + if o != nil && !IsNil(o.PartnerMerchantID) { + return true + } + + return false +} + +// SetPartnerMerchantID gets a reference to the given string and assigns it to the PartnerMerchantID field. +func (o *Order) SetPartnerMerchantID(v string) { + o.PartnerMerchantID = &v +} + +// GetPaymentType returns the PaymentType field value +func (o *Order) GetPaymentType() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentType +} + +// GetPaymentTypeOk returns a tuple with the PaymentType field value +// and a boolean to check if the value has been set. +func (o *Order) GetPaymentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentType, true +} + +// SetPaymentType sets field value +func (o *Order) SetPaymentType(v string) { + o.PaymentType = v +} + +// GetCutlery returns the Cutlery field value +func (o *Order) GetCutlery() bool { + if o == nil { + var ret bool + return ret + } + + return o.Cutlery +} + +// GetCutleryOk returns a tuple with the Cutlery field value +// and a boolean to check if the value has been set. +func (o *Order) GetCutleryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Cutlery, true +} + +// SetCutlery sets field value +func (o *Order) SetCutlery(v bool) { + o.Cutlery = v +} + +// GetOrderTime returns the OrderTime field value +func (o *Order) GetOrderTime() string { + if o == nil { + var ret string + return ret + } + + return o.OrderTime +} + +// GetOrderTimeOk returns a tuple with the OrderTime field value +// and a boolean to check if the value has been set. +func (o *Order) GetOrderTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderTime, true +} + +// SetOrderTime sets field value +func (o *Order) SetOrderTime(v string) { + o.OrderTime = v +} + +// GetSubmitTime returns the SubmitTime field value if set, zero value otherwise. +func (o *Order) GetSubmitTime() time.Time { + if o == nil || IsNil(o.SubmitTime) { + var ret time.Time + return ret + } + return *o.SubmitTime +} + +// GetSubmitTimeOk returns a tuple with the SubmitTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetSubmitTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.SubmitTime) { + return nil, false + } + return o.SubmitTime, true +} + +// HasSubmitTime returns a boolean if a field has been set. +func (o *Order) HasSubmitTime() bool { + if o != nil && !IsNil(o.SubmitTime) { + return true + } + + return false +} + +// SetSubmitTime gets a reference to the given time.Time and assigns it to the SubmitTime field. +func (o *Order) SetSubmitTime(v time.Time) { + o.SubmitTime = &v +} + +// GetCompleteTime returns the CompleteTime field value if set, zero value otherwise. +func (o *Order) GetCompleteTime() time.Time { + if o == nil || IsNil(o.CompleteTime) { + var ret time.Time + return ret + } + return *o.CompleteTime +} + +// GetCompleteTimeOk returns a tuple with the CompleteTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetCompleteTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.CompleteTime) { + return nil, false + } + return o.CompleteTime, true +} + +// HasCompleteTime returns a boolean if a field has been set. +func (o *Order) HasCompleteTime() bool { + if o != nil && !IsNil(o.CompleteTime) { + return true + } + + return false +} + +// SetCompleteTime gets a reference to the given time.Time and assigns it to the CompleteTime field. +func (o *Order) SetCompleteTime(v time.Time) { + o.CompleteTime = &v +} + +// GetScheduledTime returns the ScheduledTime field value if set, zero value otherwise. +func (o *Order) GetScheduledTime() string { + if o == nil || IsNil(o.ScheduledTime) { + var ret string + return ret + } + return *o.ScheduledTime +} + +// GetScheduledTimeOk returns a tuple with the ScheduledTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetScheduledTimeOk() (*string, bool) { + if o == nil || IsNil(o.ScheduledTime) { + return nil, false + } + return o.ScheduledTime, true +} + +// HasScheduledTime returns a boolean if a field has been set. +func (o *Order) HasScheduledTime() bool { + if o != nil && !IsNil(o.ScheduledTime) { + return true + } + + return false +} + +// SetScheduledTime gets a reference to the given string and assigns it to the ScheduledTime field. +func (o *Order) SetScheduledTime(v string) { + o.ScheduledTime = &v +} + +// GetOrderState returns the OrderState field value if set, zero value otherwise. +func (o *Order) GetOrderState() string { + if o == nil || IsNil(o.OrderState) { + var ret string + return ret + } + return *o.OrderState +} + +// GetOrderStateOk returns a tuple with the OrderState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetOrderStateOk() (*string, bool) { + if o == nil || IsNil(o.OrderState) { + return nil, false + } + return o.OrderState, true +} + +// HasOrderState returns a boolean if a field has been set. +func (o *Order) HasOrderState() bool { + if o != nil && !IsNil(o.OrderState) { + return true + } + + return false +} + +// SetOrderState gets a reference to the given string and assigns it to the OrderState field. +func (o *Order) SetOrderState(v string) { + o.OrderState = &v +} + +// GetCurrency returns the Currency field value +func (o *Order) GetCurrency() Currency { + if o == nil { + var ret Currency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *Order) GetCurrencyOk() (*Currency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *Order) SetCurrency(v Currency) { + o.Currency = v +} + +// GetFeatureFlags returns the FeatureFlags field value +func (o *Order) GetFeatureFlags() OrderFeatureFlags { + if o == nil { + var ret OrderFeatureFlags + return ret + } + + return o.FeatureFlags +} + +// GetFeatureFlagsOk returns a tuple with the FeatureFlags field value +// and a boolean to check if the value has been set. +func (o *Order) GetFeatureFlagsOk() (*OrderFeatureFlags, bool) { + if o == nil { + return nil, false + } + return &o.FeatureFlags, true +} + +// SetFeatureFlags sets field value +func (o *Order) SetFeatureFlags(v OrderFeatureFlags) { + o.FeatureFlags = v +} + +// GetItems returns the Items field value +func (o *Order) GetItems() []OrderItem { + if o == nil { + var ret []OrderItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *Order) GetItemsOk() ([]OrderItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *Order) SetItems(v []OrderItem) { + o.Items = v +} + +// GetCampaigns returns the Campaigns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Order) GetCampaigns() []OrderCampaign { + if o == nil { + var ret []OrderCampaign + return ret + } + return o.Campaigns +} + +// GetCampaignsOk returns a tuple with the Campaigns field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Order) GetCampaignsOk() ([]OrderCampaign, bool) { + if o == nil || IsNil(o.Campaigns) { + return nil, false + } + return o.Campaigns, true +} + +// HasCampaigns returns a boolean if a field has been set. +func (o *Order) HasCampaigns() bool { + if o != nil && !IsNil(o.Campaigns) { + return true + } + + return false +} + +// SetCampaigns gets a reference to the given []OrderCampaign and assigns it to the Campaigns field. +func (o *Order) SetCampaigns(v []OrderCampaign) { + o.Campaigns = v +} + +// GetPromos returns the Promos field value if set, zero value otherwise. +func (o *Order) GetPromos() []OrderPromo { + if o == nil || IsNil(o.Promos) { + var ret []OrderPromo + return ret + } + return o.Promos +} + +// GetPromosOk returns a tuple with the Promos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPromosOk() ([]OrderPromo, bool) { + if o == nil || IsNil(o.Promos) { + return nil, false + } + return o.Promos, true +} + +// HasPromos returns a boolean if a field has been set. +func (o *Order) HasPromos() bool { + if o != nil && !IsNil(o.Promos) { + return true + } + + return false +} + +// SetPromos gets a reference to the given []OrderPromo and assigns it to the Promos field. +func (o *Order) SetPromos(v []OrderPromo) { + o.Promos = v +} + +// GetPrice returns the Price field value +func (o *Order) GetPrice() OrderPrice { + if o == nil { + var ret OrderPrice + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *Order) GetPriceOk() (*OrderPrice, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *Order) SetPrice(v OrderPrice) { + o.Price = v +} + +// GetDineIn returns the DineIn field value if set, zero value otherwise. +func (o *Order) GetDineIn() DineIn { + if o == nil || IsNil(o.DineIn) { + var ret DineIn + return ret + } + return *o.DineIn +} + +// GetDineInOk returns a tuple with the DineIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetDineInOk() (*DineIn, bool) { + if o == nil || IsNil(o.DineIn) { + return nil, false + } + return o.DineIn, true +} + +// HasDineIn returns a boolean if a field has been set. +func (o *Order) HasDineIn() bool { + if o != nil && !IsNil(o.DineIn) { + return true + } + + return false +} + +// SetDineIn gets a reference to the given DineIn and assigns it to the DineIn field. +func (o *Order) SetDineIn(v DineIn) { + o.DineIn = &v +} + +// GetReceiver returns the Receiver field value if set, zero value otherwise. +func (o *Order) GetReceiver() Receiver { + if o == nil || IsNil(o.Receiver) { + var ret Receiver + return ret + } + return *o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetReceiverOk() (*Receiver, bool) { + if o == nil || IsNil(o.Receiver) { + return nil, false + } + return o.Receiver, true +} + +// HasReceiver returns a boolean if a field has been set. +func (o *Order) HasReceiver() bool { + if o != nil && !IsNil(o.Receiver) { + return true + } + + return false +} + +// SetReceiver gets a reference to the given Receiver and assigns it to the Receiver field. +func (o *Order) SetReceiver(v Receiver) { + o.Receiver = &v +} + +// GetOrderReadyEstimation returns the OrderReadyEstimation field value if set, zero value otherwise. +func (o *Order) GetOrderReadyEstimation() OrderReadyEstimation { + if o == nil || IsNil(o.OrderReadyEstimation) { + var ret OrderReadyEstimation + return ret + } + return *o.OrderReadyEstimation +} + +// GetOrderReadyEstimationOk returns a tuple with the OrderReadyEstimation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetOrderReadyEstimationOk() (*OrderReadyEstimation, bool) { + if o == nil || IsNil(o.OrderReadyEstimation) { + return nil, false + } + return o.OrderReadyEstimation, true +} + +// HasOrderReadyEstimation returns a boolean if a field has been set. +func (o *Order) HasOrderReadyEstimation() bool { + if o != nil && !IsNil(o.OrderReadyEstimation) { + return true + } + + return false +} + +// SetOrderReadyEstimation gets a reference to the given OrderReadyEstimation and assigns it to the OrderReadyEstimation field. +func (o *Order) SetOrderReadyEstimation(v OrderReadyEstimation) { + o.OrderReadyEstimation = &v +} + +// GetMembershipID returns the MembershipID field value if set, zero value otherwise. +func (o *Order) GetMembershipID() string { + if o == nil || IsNil(o.MembershipID) { + var ret string + return ret + } + return *o.MembershipID +} + +// GetMembershipIDOk returns a tuple with the MembershipID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetMembershipIDOk() (*string, bool) { + if o == nil || IsNil(o.MembershipID) { + return nil, false + } + return o.MembershipID, true +} + +// HasMembershipID returns a boolean if a field has been set. +func (o *Order) HasMembershipID() bool { + if o != nil && !IsNil(o.MembershipID) { + return true + } + + return false +} + +// SetMembershipID gets a reference to the given string and assigns it to the MembershipID field. +func (o *Order) SetMembershipID(v string) { + o.MembershipID = &v +} + +func (o Order) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Order) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["shortOrderNumber"] = o.ShortOrderNumber + toSerialize["merchantID"] = o.MerchantID + if !IsNil(o.PartnerMerchantID) { + toSerialize["partnerMerchantID"] = o.PartnerMerchantID + } + toSerialize["paymentType"] = o.PaymentType + toSerialize["cutlery"] = o.Cutlery + toSerialize["orderTime"] = o.OrderTime + if !IsNil(o.SubmitTime) { + toSerialize["submitTime"] = o.SubmitTime + } + if !IsNil(o.CompleteTime) { + toSerialize["completeTime"] = o.CompleteTime + } + if !IsNil(o.ScheduledTime) { + toSerialize["scheduledTime"] = o.ScheduledTime + } + if !IsNil(o.OrderState) { + toSerialize["orderState"] = o.OrderState + } + toSerialize["currency"] = o.Currency + toSerialize["featureFlags"] = o.FeatureFlags + toSerialize["items"] = o.Items + if o.Campaigns != nil { + toSerialize["campaigns"] = o.Campaigns + } + if !IsNil(o.Promos) { + toSerialize["promos"] = o.Promos + } + toSerialize["price"] = o.Price + if !IsNil(o.DineIn) { + toSerialize["dineIn"] = o.DineIn + } + if !IsNil(o.Receiver) { + toSerialize["receiver"] = o.Receiver + } + if !IsNil(o.OrderReadyEstimation) { + toSerialize["orderReadyEstimation"] = o.OrderReadyEstimation + } + if !IsNil(o.MembershipID) { + toSerialize["membershipID"] = o.MembershipID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Order) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "shortOrderNumber", + "merchantID", + "paymentType", + "cutlery", + "orderTime", + "currency", + "featureFlags", + "items", + "price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrder := _Order{} + + err = json.Unmarshal(data, &varOrder) + + if err != nil { + return err + } + + *o = Order(varOrder) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "shortOrderNumber") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "partnerMerchantID") + delete(additionalProperties, "paymentType") + delete(additionalProperties, "cutlery") + delete(additionalProperties, "orderTime") + delete(additionalProperties, "submitTime") + delete(additionalProperties, "completeTime") + delete(additionalProperties, "scheduledTime") + delete(additionalProperties, "orderState") + delete(additionalProperties, "currency") + delete(additionalProperties, "featureFlags") + delete(additionalProperties, "items") + delete(additionalProperties, "campaigns") + delete(additionalProperties, "promos") + delete(additionalProperties, "price") + delete(additionalProperties, "dineIn") + delete(additionalProperties, "receiver") + delete(additionalProperties, "orderReadyEstimation") + delete(additionalProperties, "membershipID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrder struct { + value *Order + isSet bool +} + +func (v NullableOrder) Get() *Order { + return v.value +} + +func (v *NullableOrder) Set(val *Order) { + v.value = val + v.isSet = true +} + +func (v NullableOrder) IsSet() bool { + return v.isSet +} + +func (v *NullableOrder) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrder(val *Order) *NullableOrder { + return &NullableOrder{value: val, isSet: true} +} + +func (v NullableOrder) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrder) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_campaign.go b/model_order_campaign.go new file mode 100644 index 0000000..c194319 --- /dev/null +++ b/model_order_campaign.go @@ -0,0 +1,539 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the OrderCampaign type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderCampaign{} + +// OrderCampaign struct for OrderCampaign +type OrderCampaign struct { + // The campaign's ID returned by GrabFood upon campaign creation. + Id *string `json:"id,omitempty"` + // The name of the campaign. This campaign name has been automatically generated by Grab for display in the customer app. + Name *string `json:"name,omitempty"` + // The campaign name provided by the merchant in [Create Campaign](#tag/create-campaign). Whitelist required, reach out to your integration manager. + CampaignNameForMex *string `json:"campaignNameForMex,omitempty"` + // The campaign level. + Level *string `json:"level,omitempty"` + // The type of campaign. + Type *string `json:"type,omitempty"` + // The campaign redemption count in this order. + UsageCount *int64 `json:"usageCount,omitempty"` + // The ratio funded by the merchant in percentage. + MexFundedRatio *int32 `json:"mexFundedRatio,omitempty"` + // The deducted amount in minor unit format. `Item price(tax inclusive) * 20% discount | 2375*0.2` + DeductedAmount *int64 `json:"deductedAmount,omitempty"` + // The part that the campaign is applied. + DeductedPart *string `json:"deductedPart,omitempty"` + // An array of item IDs that get discount under this campaign. `null` if no item applied in this campaign. + AppliedItemIDs []string `json:"appliedItemIDs,omitempty"` + FreeItem *OrderFreeItem `json:"freeItem,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderCampaign OrderCampaign + +// NewOrderCampaign instantiates a new OrderCampaign object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderCampaign() *OrderCampaign { + this := OrderCampaign{} + return &this +} + +// NewOrderCampaignWithDefaults instantiates a new OrderCampaign object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderCampaignWithDefaults() *OrderCampaign { + this := OrderCampaign{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OrderCampaign) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OrderCampaign) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OrderCampaign) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OrderCampaign) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrderCampaign) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrderCampaign) SetName(v string) { + o.Name = &v +} + +// GetCampaignNameForMex returns the CampaignNameForMex field value if set, zero value otherwise. +func (o *OrderCampaign) GetCampaignNameForMex() string { + if o == nil || IsNil(o.CampaignNameForMex) { + var ret string + return ret + } + return *o.CampaignNameForMex +} + +// GetCampaignNameForMexOk returns a tuple with the CampaignNameForMex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetCampaignNameForMexOk() (*string, bool) { + if o == nil || IsNil(o.CampaignNameForMex) { + return nil, false + } + return o.CampaignNameForMex, true +} + +// HasCampaignNameForMex returns a boolean if a field has been set. +func (o *OrderCampaign) HasCampaignNameForMex() bool { + if o != nil && !IsNil(o.CampaignNameForMex) { + return true + } + + return false +} + +// SetCampaignNameForMex gets a reference to the given string and assigns it to the CampaignNameForMex field. +func (o *OrderCampaign) SetCampaignNameForMex(v string) { + o.CampaignNameForMex = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *OrderCampaign) GetLevel() string { + if o == nil || IsNil(o.Level) { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetLevelOk() (*string, bool) { + if o == nil || IsNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *OrderCampaign) HasLevel() bool { + if o != nil && !IsNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *OrderCampaign) SetLevel(v string) { + o.Level = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *OrderCampaign) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *OrderCampaign) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *OrderCampaign) SetType(v string) { + o.Type = &v +} + +// GetUsageCount returns the UsageCount field value if set, zero value otherwise. +func (o *OrderCampaign) GetUsageCount() int64 { + if o == nil || IsNil(o.UsageCount) { + var ret int64 + return ret + } + return *o.UsageCount +} + +// GetUsageCountOk returns a tuple with the UsageCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetUsageCountOk() (*int64, bool) { + if o == nil || IsNil(o.UsageCount) { + return nil, false + } + return o.UsageCount, true +} + +// HasUsageCount returns a boolean if a field has been set. +func (o *OrderCampaign) HasUsageCount() bool { + if o != nil && !IsNil(o.UsageCount) { + return true + } + + return false +} + +// SetUsageCount gets a reference to the given int64 and assigns it to the UsageCount field. +func (o *OrderCampaign) SetUsageCount(v int64) { + o.UsageCount = &v +} + +// GetMexFundedRatio returns the MexFundedRatio field value if set, zero value otherwise. +func (o *OrderCampaign) GetMexFundedRatio() int32 { + if o == nil || IsNil(o.MexFundedRatio) { + var ret int32 + return ret + } + return *o.MexFundedRatio +} + +// GetMexFundedRatioOk returns a tuple with the MexFundedRatio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetMexFundedRatioOk() (*int32, bool) { + if o == nil || IsNil(o.MexFundedRatio) { + return nil, false + } + return o.MexFundedRatio, true +} + +// HasMexFundedRatio returns a boolean if a field has been set. +func (o *OrderCampaign) HasMexFundedRatio() bool { + if o != nil && !IsNil(o.MexFundedRatio) { + return true + } + + return false +} + +// SetMexFundedRatio gets a reference to the given int32 and assigns it to the MexFundedRatio field. +func (o *OrderCampaign) SetMexFundedRatio(v int32) { + o.MexFundedRatio = &v +} + +// GetDeductedAmount returns the DeductedAmount field value if set, zero value otherwise. +func (o *OrderCampaign) GetDeductedAmount() int64 { + if o == nil || IsNil(o.DeductedAmount) { + var ret int64 + return ret + } + return *o.DeductedAmount +} + +// GetDeductedAmountOk returns a tuple with the DeductedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetDeductedAmountOk() (*int64, bool) { + if o == nil || IsNil(o.DeductedAmount) { + return nil, false + } + return o.DeductedAmount, true +} + +// HasDeductedAmount returns a boolean if a field has been set. +func (o *OrderCampaign) HasDeductedAmount() bool { + if o != nil && !IsNil(o.DeductedAmount) { + return true + } + + return false +} + +// SetDeductedAmount gets a reference to the given int64 and assigns it to the DeductedAmount field. +func (o *OrderCampaign) SetDeductedAmount(v int64) { + o.DeductedAmount = &v +} + +// GetDeductedPart returns the DeductedPart field value if set, zero value otherwise. +func (o *OrderCampaign) GetDeductedPart() string { + if o == nil || IsNil(o.DeductedPart) { + var ret string + return ret + } + return *o.DeductedPart +} + +// GetDeductedPartOk returns a tuple with the DeductedPart field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetDeductedPartOk() (*string, bool) { + if o == nil || IsNil(o.DeductedPart) { + return nil, false + } + return o.DeductedPart, true +} + +// HasDeductedPart returns a boolean if a field has been set. +func (o *OrderCampaign) HasDeductedPart() bool { + if o != nil && !IsNil(o.DeductedPart) { + return true + } + + return false +} + +// SetDeductedPart gets a reference to the given string and assigns it to the DeductedPart field. +func (o *OrderCampaign) SetDeductedPart(v string) { + o.DeductedPart = &v +} + +// GetAppliedItemIDs returns the AppliedItemIDs field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrderCampaign) GetAppliedItemIDs() []string { + if o == nil { + var ret []string + return ret + } + return o.AppliedItemIDs +} + +// GetAppliedItemIDsOk returns a tuple with the AppliedItemIDs field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OrderCampaign) GetAppliedItemIDsOk() ([]string, bool) { + if o == nil || IsNil(o.AppliedItemIDs) { + return nil, false + } + return o.AppliedItemIDs, true +} + +// HasAppliedItemIDs returns a boolean if a field has been set. +func (o *OrderCampaign) HasAppliedItemIDs() bool { + if o != nil && !IsNil(o.AppliedItemIDs) { + return true + } + + return false +} + +// SetAppliedItemIDs gets a reference to the given []string and assigns it to the AppliedItemIDs field. +func (o *OrderCampaign) SetAppliedItemIDs(v []string) { + o.AppliedItemIDs = v +} + +// GetFreeItem returns the FreeItem field value if set, zero value otherwise. +func (o *OrderCampaign) GetFreeItem() OrderFreeItem { + if o == nil || IsNil(o.FreeItem) { + var ret OrderFreeItem + return ret + } + return *o.FreeItem +} + +// GetFreeItemOk returns a tuple with the FreeItem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderCampaign) GetFreeItemOk() (*OrderFreeItem, bool) { + if o == nil || IsNil(o.FreeItem) { + return nil, false + } + return o.FreeItem, true +} + +// HasFreeItem returns a boolean if a field has been set. +func (o *OrderCampaign) HasFreeItem() bool { + if o != nil && !IsNil(o.FreeItem) { + return true + } + + return false +} + +// SetFreeItem gets a reference to the given OrderFreeItem and assigns it to the FreeItem field. +func (o *OrderCampaign) SetFreeItem(v OrderFreeItem) { + o.FreeItem = &v +} + +func (o OrderCampaign) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderCampaign) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.CampaignNameForMex) { + toSerialize["campaignNameForMex"] = o.CampaignNameForMex + } + if !IsNil(o.Level) { + toSerialize["level"] = o.Level + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.UsageCount) { + toSerialize["usageCount"] = o.UsageCount + } + if !IsNil(o.MexFundedRatio) { + toSerialize["mexFundedRatio"] = o.MexFundedRatio + } + if !IsNil(o.DeductedAmount) { + toSerialize["deductedAmount"] = o.DeductedAmount + } + if !IsNil(o.DeductedPart) { + toSerialize["deductedPart"] = o.DeductedPart + } + if o.AppliedItemIDs != nil { + toSerialize["appliedItemIDs"] = o.AppliedItemIDs + } + if !IsNil(o.FreeItem) { + toSerialize["freeItem"] = o.FreeItem + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderCampaign) UnmarshalJSON(data []byte) (err error) { + varOrderCampaign := _OrderCampaign{} + + err = json.Unmarshal(data, &varOrderCampaign) + + if err != nil { + return err + } + + *o = OrderCampaign(varOrderCampaign) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "campaignNameForMex") + delete(additionalProperties, "level") + delete(additionalProperties, "type") + delete(additionalProperties, "usageCount") + delete(additionalProperties, "mexFundedRatio") + delete(additionalProperties, "deductedAmount") + delete(additionalProperties, "deductedPart") + delete(additionalProperties, "appliedItemIDs") + delete(additionalProperties, "freeItem") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderCampaign struct { + value *OrderCampaign + isSet bool +} + +func (v NullableOrderCampaign) Get() *OrderCampaign { + return v.value +} + +func (v *NullableOrderCampaign) Set(val *OrderCampaign) { + v.value = val + v.isSet = true +} + +func (v NullableOrderCampaign) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderCampaign) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderCampaign(val *OrderCampaign) *NullableOrderCampaign { + return &NullableOrderCampaign{value: val, isSet: true} +} + +func (v NullableOrderCampaign) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderCampaign) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_delivery_request.go b/model_order_delivery_request.go new file mode 100644 index 0000000..e5166ca --- /dev/null +++ b/model_order_delivery_request.go @@ -0,0 +1,232 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OrderDeliveryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderDeliveryRequest{} + +// OrderDeliveryRequest This request marks an order as delivered on GrabFood. +type OrderDeliveryRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // Specify the order's initial state. + FromState string `json:"fromState"` + // Specify the order's new state. + ToState string `json:"toState"` + AdditionalProperties map[string]interface{} +} + +type _OrderDeliveryRequest OrderDeliveryRequest + +// NewOrderDeliveryRequest instantiates a new OrderDeliveryRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderDeliveryRequest(orderID string, fromState string, toState string) *OrderDeliveryRequest { + this := OrderDeliveryRequest{} + this.OrderID = orderID + this.FromState = fromState + this.ToState = toState + return &this +} + +// NewOrderDeliveryRequestWithDefaults instantiates a new OrderDeliveryRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderDeliveryRequestWithDefaults() *OrderDeliveryRequest { + this := OrderDeliveryRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *OrderDeliveryRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *OrderDeliveryRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *OrderDeliveryRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetFromState returns the FromState field value +func (o *OrderDeliveryRequest) GetFromState() string { + if o == nil { + var ret string + return ret + } + + return o.FromState +} + +// GetFromStateOk returns a tuple with the FromState field value +// and a boolean to check if the value has been set. +func (o *OrderDeliveryRequest) GetFromStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FromState, true +} + +// SetFromState sets field value +func (o *OrderDeliveryRequest) SetFromState(v string) { + o.FromState = v +} + +// GetToState returns the ToState field value +func (o *OrderDeliveryRequest) GetToState() string { + if o == nil { + var ret string + return ret + } + + return o.ToState +} + +// GetToStateOk returns a tuple with the ToState field value +// and a boolean to check if the value has been set. +func (o *OrderDeliveryRequest) GetToStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ToState, true +} + +// SetToState sets field value +func (o *OrderDeliveryRequest) SetToState(v string) { + o.ToState = v +} + +func (o OrderDeliveryRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderDeliveryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["fromState"] = o.FromState + toSerialize["toState"] = o.ToState + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderDeliveryRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "fromState", + "toState", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderDeliveryRequest := _OrderDeliveryRequest{} + + err = json.Unmarshal(data, &varOrderDeliveryRequest) + + if err != nil { + return err + } + + *o = OrderDeliveryRequest(varOrderDeliveryRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "fromState") + delete(additionalProperties, "toState") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderDeliveryRequest struct { + value *OrderDeliveryRequest + isSet bool +} + +func (v NullableOrderDeliveryRequest) Get() *OrderDeliveryRequest { + return v.value +} + +func (v *NullableOrderDeliveryRequest) Set(val *OrderDeliveryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOrderDeliveryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderDeliveryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderDeliveryRequest(val *OrderDeliveryRequest) *NullableOrderDeliveryRequest { + return &NullableOrderDeliveryRequest{value: val, isSet: true} +} + +func (v NullableOrderDeliveryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderDeliveryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_feature_flags.go b/model_order_feature_flags.go new file mode 100644 index 0000000..e91c4ff --- /dev/null +++ b/model_order_feature_flags.go @@ -0,0 +1,240 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OrderFeatureFlags type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderFeatureFlags{} + +// OrderFeatureFlags The featureFlag JSON object containing an order's feature related information. +type OrderFeatureFlags struct { + // The acceptance type for the order. Refer to FAQs for more details about [orderAcceptedType](#section/Order/How-do-I-identify-if-a-particular-order-is-auto-or-manual-acceptance). + OrderAcceptedType string `json:"orderAcceptedType"` + // The type of order. + OrderType string `json:"orderType"` + // A boolean value that indicates if the order is edited. + IsMexEditOrder *bool `json:"isMexEditOrder,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderFeatureFlags OrderFeatureFlags + +// NewOrderFeatureFlags instantiates a new OrderFeatureFlags object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderFeatureFlags(orderAcceptedType string, orderType string) *OrderFeatureFlags { + this := OrderFeatureFlags{} + this.OrderAcceptedType = orderAcceptedType + this.OrderType = orderType + return &this +} + +// NewOrderFeatureFlagsWithDefaults instantiates a new OrderFeatureFlags object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderFeatureFlagsWithDefaults() *OrderFeatureFlags { + this := OrderFeatureFlags{} + return &this +} + +// GetOrderAcceptedType returns the OrderAcceptedType field value +func (o *OrderFeatureFlags) GetOrderAcceptedType() string { + if o == nil { + var ret string + return ret + } + + return o.OrderAcceptedType +} + +// GetOrderAcceptedTypeOk returns a tuple with the OrderAcceptedType field value +// and a boolean to check if the value has been set. +func (o *OrderFeatureFlags) GetOrderAcceptedTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderAcceptedType, true +} + +// SetOrderAcceptedType sets field value +func (o *OrderFeatureFlags) SetOrderAcceptedType(v string) { + o.OrderAcceptedType = v +} + +// GetOrderType returns the OrderType field value +func (o *OrderFeatureFlags) GetOrderType() string { + if o == nil { + var ret string + return ret + } + + return o.OrderType +} + +// GetOrderTypeOk returns a tuple with the OrderType field value +// and a boolean to check if the value has been set. +func (o *OrderFeatureFlags) GetOrderTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderType, true +} + +// SetOrderType sets field value +func (o *OrderFeatureFlags) SetOrderType(v string) { + o.OrderType = v +} + +// GetIsMexEditOrder returns the IsMexEditOrder field value if set, zero value otherwise. +func (o *OrderFeatureFlags) GetIsMexEditOrder() bool { + if o == nil || IsNil(o.IsMexEditOrder) { + var ret bool + return ret + } + return *o.IsMexEditOrder +} + +// GetIsMexEditOrderOk returns a tuple with the IsMexEditOrder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderFeatureFlags) GetIsMexEditOrderOk() (*bool, bool) { + if o == nil || IsNil(o.IsMexEditOrder) { + return nil, false + } + return o.IsMexEditOrder, true +} + +// HasIsMexEditOrder returns a boolean if a field has been set. +func (o *OrderFeatureFlags) HasIsMexEditOrder() bool { + if o != nil && !IsNil(o.IsMexEditOrder) { + return true + } + + return false +} + +// SetIsMexEditOrder gets a reference to the given bool and assigns it to the IsMexEditOrder field. +func (o *OrderFeatureFlags) SetIsMexEditOrder(v bool) { + o.IsMexEditOrder = &v +} + +func (o OrderFeatureFlags) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderFeatureFlags) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderAcceptedType"] = o.OrderAcceptedType + toSerialize["orderType"] = o.OrderType + if !IsNil(o.IsMexEditOrder) { + toSerialize["isMexEditOrder"] = o.IsMexEditOrder + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderFeatureFlags) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderAcceptedType", + "orderType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderFeatureFlags := _OrderFeatureFlags{} + + err = json.Unmarshal(data, &varOrderFeatureFlags) + + if err != nil { + return err + } + + *o = OrderFeatureFlags(varOrderFeatureFlags) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderAcceptedType") + delete(additionalProperties, "orderType") + delete(additionalProperties, "isMexEditOrder") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderFeatureFlags struct { + value *OrderFeatureFlags + isSet bool +} + +func (v NullableOrderFeatureFlags) Get() *OrderFeatureFlags { + return v.value +} + +func (v *NullableOrderFeatureFlags) Set(val *OrderFeatureFlags) { + v.value = val + v.isSet = true +} + +func (v NullableOrderFeatureFlags) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderFeatureFlags) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderFeatureFlags(val *OrderFeatureFlags) *NullableOrderFeatureFlags { + return &NullableOrderFeatureFlags{value: val, isSet: true} +} + +func (v NullableOrderFeatureFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderFeatureFlags) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_free_item.go b/model_order_free_item.go new file mode 100644 index 0000000..3b2b045 --- /dev/null +++ b/model_order_free_item.go @@ -0,0 +1,273 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the OrderFreeItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderFreeItem{} + +// OrderFreeItem Free item information for `freeItem` campaign. +type OrderFreeItem struct { + // The item's ID + Id *string `json:"id,omitempty"` + // The name of the item. + Name *string `json:"name,omitempty"` + // The item's quantity. Maximum is **1**. + Quantity *int32 `json:"quantity,omitempty"` + // The item's price in minor unit format. + Price *int64 `json:"price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderFreeItem OrderFreeItem + +// NewOrderFreeItem instantiates a new OrderFreeItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderFreeItem() *OrderFreeItem { + this := OrderFreeItem{} + return &this +} + +// NewOrderFreeItemWithDefaults instantiates a new OrderFreeItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderFreeItemWithDefaults() *OrderFreeItem { + this := OrderFreeItem{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OrderFreeItem) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderFreeItem) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OrderFreeItem) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OrderFreeItem) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OrderFreeItem) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderFreeItem) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrderFreeItem) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrderFreeItem) SetName(v string) { + o.Name = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *OrderFreeItem) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderFreeItem) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *OrderFreeItem) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *OrderFreeItem) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *OrderFreeItem) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderFreeItem) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *OrderFreeItem) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *OrderFreeItem) SetPrice(v int64) { + o.Price = &v +} + +func (o OrderFreeItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderFreeItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderFreeItem) UnmarshalJSON(data []byte) (err error) { + varOrderFreeItem := _OrderFreeItem{} + + err = json.Unmarshal(data, &varOrderFreeItem) + + if err != nil { + return err + } + + *o = OrderFreeItem(varOrderFreeItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "quantity") + delete(additionalProperties, "price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderFreeItem struct { + value *OrderFreeItem + isSet bool +} + +func (v NullableOrderFreeItem) Get() *OrderFreeItem { + return v.value +} + +func (v *NullableOrderFreeItem) Set(val *OrderFreeItem) { + v.value = val + v.isSet = true +} + +func (v NullableOrderFreeItem) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderFreeItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderFreeItem(val *OrderFreeItem) *NullableOrderFreeItem { + return &NullableOrderFreeItem{value: val, isSet: true} +} + +func (v NullableOrderFreeItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderFreeItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_item.go b/model_order_item.go new file mode 100644 index 0000000..1b9fd2a --- /dev/null +++ b/model_order_item.go @@ -0,0 +1,423 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OrderItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderItem{} + +// OrderItem struct for OrderItem +type OrderItem struct { + // The item's ExternalID in the partner system. + Id string `json:"id"` + // The item's ID in Grab system. Partner can use this field in the `EditOrder` endpoint. + GrabItemID string `json:"grabItemID"` + // The number of the item ordered. + Quantity int32 `json:"quantity"` + // The price (tax-inclusive) in minor format for 1 item and modifiers under it. `Item price(tax inclusive) + Modifier price(tax inclusive) | (2241*1.06)+(165*1.06)=2550`. + Price int64 `json:"price"` + // Tax in minor format for 1 item and all modifiers under it. `0` if tax configuration is absent. `Item tax + Modifier tax | (2241*0.06)+(165*0.06)=144`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). + Tax *int64 `json:"tax,omitempty"` + // An extra note for the merchant. `Blank` if no note from consumer. + Specifications *string `json:"specifications,omitempty"` + OutOfStockInstruction NullableOutOfStockInstruction `json:"outOfStockInstruction,omitempty"` + // An array of JSON objects modifiers. Read [this](#categories) for more information. + Modifiers []OrderItemModifier `json:"modifiers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderItem OrderItem + +// NewOrderItem instantiates a new OrderItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderItem(id string, grabItemID string, quantity int32, price int64) *OrderItem { + this := OrderItem{} + this.Id = id + this.GrabItemID = grabItemID + this.Quantity = quantity + this.Price = price + return &this +} + +// NewOrderItemWithDefaults instantiates a new OrderItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderItemWithDefaults() *OrderItem { + this := OrderItem{} + return &this +} + +// GetId returns the Id field value +func (o *OrderItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *OrderItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *OrderItem) SetId(v string) { + o.Id = v +} + +// GetGrabItemID returns the GrabItemID field value +func (o *OrderItem) GetGrabItemID() string { + if o == nil { + var ret string + return ret + } + + return o.GrabItemID +} + +// GetGrabItemIDOk returns a tuple with the GrabItemID field value +// and a boolean to check if the value has been set. +func (o *OrderItem) GetGrabItemIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrabItemID, true +} + +// SetGrabItemID sets field value +func (o *OrderItem) SetGrabItemID(v string) { + o.GrabItemID = v +} + +// GetQuantity returns the Quantity field value +func (o *OrderItem) GetQuantity() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value +// and a boolean to check if the value has been set. +func (o *OrderItem) GetQuantityOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Quantity, true +} + +// SetQuantity sets field value +func (o *OrderItem) SetQuantity(v int32) { + o.Quantity = v +} + +// GetPrice returns the Price field value +func (o *OrderItem) GetPrice() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *OrderItem) GetPriceOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *OrderItem) SetPrice(v int64) { + o.Price = v +} + +// GetTax returns the Tax field value if set, zero value otherwise. +func (o *OrderItem) GetTax() int64 { + if o == nil || IsNil(o.Tax) { + var ret int64 + return ret + } + return *o.Tax +} + +// GetTaxOk returns a tuple with the Tax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItem) GetTaxOk() (*int64, bool) { + if o == nil || IsNil(o.Tax) { + return nil, false + } + return o.Tax, true +} + +// HasTax returns a boolean if a field has been set. +func (o *OrderItem) HasTax() bool { + if o != nil && !IsNil(o.Tax) { + return true + } + + return false +} + +// SetTax gets a reference to the given int64 and assigns it to the Tax field. +func (o *OrderItem) SetTax(v int64) { + o.Tax = &v +} + +// GetSpecifications returns the Specifications field value if set, zero value otherwise. +func (o *OrderItem) GetSpecifications() string { + if o == nil || IsNil(o.Specifications) { + var ret string + return ret + } + return *o.Specifications +} + +// GetSpecificationsOk returns a tuple with the Specifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItem) GetSpecificationsOk() (*string, bool) { + if o == nil || IsNil(o.Specifications) { + return nil, false + } + return o.Specifications, true +} + +// HasSpecifications returns a boolean if a field has been set. +func (o *OrderItem) HasSpecifications() bool { + if o != nil && !IsNil(o.Specifications) { + return true + } + + return false +} + +// SetSpecifications gets a reference to the given string and assigns it to the Specifications field. +func (o *OrderItem) SetSpecifications(v string) { + o.Specifications = &v +} + +// GetOutOfStockInstruction returns the OutOfStockInstruction field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrderItem) GetOutOfStockInstruction() OutOfStockInstruction { + if o == nil || IsNil(o.OutOfStockInstruction.Get()) { + var ret OutOfStockInstruction + return ret + } + return *o.OutOfStockInstruction.Get() +} + +// GetOutOfStockInstructionOk returns a tuple with the OutOfStockInstruction field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OrderItem) GetOutOfStockInstructionOk() (*OutOfStockInstruction, bool) { + if o == nil { + return nil, false + } + return o.OutOfStockInstruction.Get(), o.OutOfStockInstruction.IsSet() +} + +// HasOutOfStockInstruction returns a boolean if a field has been set. +func (o *OrderItem) HasOutOfStockInstruction() bool { + if o != nil && o.OutOfStockInstruction.IsSet() { + return true + } + + return false +} + +// SetOutOfStockInstruction gets a reference to the given NullableOutOfStockInstruction and assigns it to the OutOfStockInstruction field. +func (o *OrderItem) SetOutOfStockInstruction(v OutOfStockInstruction) { + o.OutOfStockInstruction.Set(&v) +} +// SetOutOfStockInstructionNil sets the value for OutOfStockInstruction to be an explicit nil +func (o *OrderItem) SetOutOfStockInstructionNil() { + o.OutOfStockInstruction.Set(nil) +} + +// UnsetOutOfStockInstruction ensures that no value is present for OutOfStockInstruction, not even an explicit nil +func (o *OrderItem) UnsetOutOfStockInstruction() { + o.OutOfStockInstruction.Unset() +} + +// GetModifiers returns the Modifiers field value if set, zero value otherwise. +func (o *OrderItem) GetModifiers() []OrderItemModifier { + if o == nil || IsNil(o.Modifiers) { + var ret []OrderItemModifier + return ret + } + return o.Modifiers +} + +// GetModifiersOk returns a tuple with the Modifiers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItem) GetModifiersOk() ([]OrderItemModifier, bool) { + if o == nil || IsNil(o.Modifiers) { + return nil, false + } + return o.Modifiers, true +} + +// HasModifiers returns a boolean if a field has been set. +func (o *OrderItem) HasModifiers() bool { + if o != nil && !IsNil(o.Modifiers) { + return true + } + + return false +} + +// SetModifiers gets a reference to the given []OrderItemModifier and assigns it to the Modifiers field. +func (o *OrderItem) SetModifiers(v []OrderItemModifier) { + o.Modifiers = v +} + +func (o OrderItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["grabItemID"] = o.GrabItemID + toSerialize["quantity"] = o.Quantity + toSerialize["price"] = o.Price + if !IsNil(o.Tax) { + toSerialize["tax"] = o.Tax + } + if !IsNil(o.Specifications) { + toSerialize["specifications"] = o.Specifications + } + if o.OutOfStockInstruction.IsSet() { + toSerialize["outOfStockInstruction"] = o.OutOfStockInstruction.Get() + } + if !IsNil(o.Modifiers) { + toSerialize["modifiers"] = o.Modifiers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "grabItemID", + "quantity", + "price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderItem := _OrderItem{} + + err = json.Unmarshal(data, &varOrderItem) + + if err != nil { + return err + } + + *o = OrderItem(varOrderItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "grabItemID") + delete(additionalProperties, "quantity") + delete(additionalProperties, "price") + delete(additionalProperties, "tax") + delete(additionalProperties, "specifications") + delete(additionalProperties, "outOfStockInstruction") + delete(additionalProperties, "modifiers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderItem struct { + value *OrderItem + isSet bool +} + +func (v NullableOrderItem) Get() *OrderItem { + return v.value +} + +func (v *NullableOrderItem) Set(val *OrderItem) { + v.value = val + v.isSet = true +} + +func (v NullableOrderItem) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderItem(val *OrderItem) *NullableOrderItem { + return &NullableOrderItem{value: val, isSet: true} +} + +func (v NullableOrderItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_item_modifier.go b/model_order_item_modifier.go new file mode 100644 index 0000000..8ab562e --- /dev/null +++ b/model_order_item_modifier.go @@ -0,0 +1,273 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the OrderItemModifier type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderItemModifier{} + +// OrderItemModifier struct for OrderItemModifier +type OrderItemModifier struct { + // The modifier's ID that is on the partner's system. + Id *string `json:"id,omitempty"` + // The modifier's price (tax-inclusive) in minor format. `round(165 * (1 + 0.06)) = 175`. + Price *int64 `json:"price,omitempty"` + // Tax in minor format for 1 modifier. `165*0.06=10`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). + Tax *int64 `json:"tax,omitempty"` + // The number of modifiers present. The value is always 1. + Quantity *int32 `json:"quantity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderItemModifier OrderItemModifier + +// NewOrderItemModifier instantiates a new OrderItemModifier object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderItemModifier() *OrderItemModifier { + this := OrderItemModifier{} + return &this +} + +// NewOrderItemModifierWithDefaults instantiates a new OrderItemModifier object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderItemModifierWithDefaults() *OrderItemModifier { + this := OrderItemModifier{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *OrderItemModifier) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItemModifier) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *OrderItemModifier) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *OrderItemModifier) SetId(v string) { + o.Id = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *OrderItemModifier) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItemModifier) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *OrderItemModifier) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *OrderItemModifier) SetPrice(v int64) { + o.Price = &v +} + +// GetTax returns the Tax field value if set, zero value otherwise. +func (o *OrderItemModifier) GetTax() int64 { + if o == nil || IsNil(o.Tax) { + var ret int64 + return ret + } + return *o.Tax +} + +// GetTaxOk returns a tuple with the Tax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItemModifier) GetTaxOk() (*int64, bool) { + if o == nil || IsNil(o.Tax) { + return nil, false + } + return o.Tax, true +} + +// HasTax returns a boolean if a field has been set. +func (o *OrderItemModifier) HasTax() bool { + if o != nil && !IsNil(o.Tax) { + return true + } + + return false +} + +// SetTax gets a reference to the given int64 and assigns it to the Tax field. +func (o *OrderItemModifier) SetTax(v int64) { + o.Tax = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *OrderItemModifier) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderItemModifier) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *OrderItemModifier) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *OrderItemModifier) SetQuantity(v int32) { + o.Quantity = &v +} + +func (o OrderItemModifier) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderItemModifier) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !IsNil(o.Tax) { + toSerialize["tax"] = o.Tax + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderItemModifier) UnmarshalJSON(data []byte) (err error) { + varOrderItemModifier := _OrderItemModifier{} + + err = json.Unmarshal(data, &varOrderItemModifier) + + if err != nil { + return err + } + + *o = OrderItemModifier(varOrderItemModifier) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "price") + delete(additionalProperties, "tax") + delete(additionalProperties, "quantity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderItemModifier struct { + value *OrderItemModifier + isSet bool +} + +func (v NullableOrderItemModifier) Get() *OrderItemModifier { + return v.value +} + +func (v *NullableOrderItemModifier) Set(val *OrderItemModifier) { + v.value = val + v.isSet = true +} + +func (v NullableOrderItemModifier) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderItemModifier) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderItemModifier(val *OrderItemModifier) *NullableOrderItemModifier { + return &NullableOrderItemModifier{value: val, isSet: true} +} + +func (v NullableOrderItemModifier) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderItemModifier) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_price.go b/model_order_price.go new file mode 100644 index 0000000..7963dfa --- /dev/null +++ b/model_order_price.go @@ -0,0 +1,430 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OrderPrice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderPrice{} + +// OrderPrice A JSON object containing order's price in the minor unit format. +type OrderPrice struct { + // Total item and modifier price (tax-inclusive) in the minor unit. `Sum of all (Item price * quantity) | 2550*1=2550`. + Subtotal int64 `json:"subtotal"` + // GrabFood's tax in the minor unit. `(subtotal-merchantFundPromo)* Tax /(1+Tax) | (2550-475)*0.06/1.06=117`. Refer to FAQs for more details about [tax](#section/Order/How-is-tax-calculated). + Tax *int64 `json:"tax,omitempty"` + // Any additional fee charged by merchant, which is 100% paid out to the merchant. Eg. Takeaway, packaging costs, dine-in charge. + MerchantChargeFee *int64 `json:"merchantChargeFee,omitempty"` + // GrabFood's promo fund in the minor unit. Calculated based on funded ratio. + GrabFundPromo *int64 `json:"grabFundPromo,omitempty"` + // The merchant's promo fund in the minor unit. Calculated based on funded ratio. + MerchantFundPromo *int64 `json:"merchantFundPromo,omitempty"` + // The total amount promo applied to the basket items only (item level/order level) in the minor unit. Delivery fee is excluded. `(grabFundPromo + merchantFundPromo) | 300 + 475 = 775` + BasketPromo *int64 `json:"basketPromo,omitempty"` + // The delivery fee in the minor unit. + DeliveryFee *int64 `json:"deliveryFee,omitempty"` + // The total amount consumer paid in the minor unit. `(subtotal + deliveryFee) - (sum of all promo) | (2550+400)-775=2175` + EaterPayment int64 `json:"eaterPayment"` + AdditionalProperties map[string]interface{} +} + +type _OrderPrice OrderPrice + +// NewOrderPrice instantiates a new OrderPrice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderPrice(subtotal int64, eaterPayment int64) *OrderPrice { + this := OrderPrice{} + this.Subtotal = subtotal + this.EaterPayment = eaterPayment + return &this +} + +// NewOrderPriceWithDefaults instantiates a new OrderPrice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderPriceWithDefaults() *OrderPrice { + this := OrderPrice{} + return &this +} + +// GetSubtotal returns the Subtotal field value +func (o *OrderPrice) GetSubtotal() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Subtotal +} + +// GetSubtotalOk returns a tuple with the Subtotal field value +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetSubtotalOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Subtotal, true +} + +// SetSubtotal sets field value +func (o *OrderPrice) SetSubtotal(v int64) { + o.Subtotal = v +} + +// GetTax returns the Tax field value if set, zero value otherwise. +func (o *OrderPrice) GetTax() int64 { + if o == nil || IsNil(o.Tax) { + var ret int64 + return ret + } + return *o.Tax +} + +// GetTaxOk returns a tuple with the Tax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetTaxOk() (*int64, bool) { + if o == nil || IsNil(o.Tax) { + return nil, false + } + return o.Tax, true +} + +// HasTax returns a boolean if a field has been set. +func (o *OrderPrice) HasTax() bool { + if o != nil && !IsNil(o.Tax) { + return true + } + + return false +} + +// SetTax gets a reference to the given int64 and assigns it to the Tax field. +func (o *OrderPrice) SetTax(v int64) { + o.Tax = &v +} + +// GetMerchantChargeFee returns the MerchantChargeFee field value if set, zero value otherwise. +func (o *OrderPrice) GetMerchantChargeFee() int64 { + if o == nil || IsNil(o.MerchantChargeFee) { + var ret int64 + return ret + } + return *o.MerchantChargeFee +} + +// GetMerchantChargeFeeOk returns a tuple with the MerchantChargeFee field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetMerchantChargeFeeOk() (*int64, bool) { + if o == nil || IsNil(o.MerchantChargeFee) { + return nil, false + } + return o.MerchantChargeFee, true +} + +// HasMerchantChargeFee returns a boolean if a field has been set. +func (o *OrderPrice) HasMerchantChargeFee() bool { + if o != nil && !IsNil(o.MerchantChargeFee) { + return true + } + + return false +} + +// SetMerchantChargeFee gets a reference to the given int64 and assigns it to the MerchantChargeFee field. +func (o *OrderPrice) SetMerchantChargeFee(v int64) { + o.MerchantChargeFee = &v +} + +// GetGrabFundPromo returns the GrabFundPromo field value if set, zero value otherwise. +func (o *OrderPrice) GetGrabFundPromo() int64 { + if o == nil || IsNil(o.GrabFundPromo) { + var ret int64 + return ret + } + return *o.GrabFundPromo +} + +// GetGrabFundPromoOk returns a tuple with the GrabFundPromo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetGrabFundPromoOk() (*int64, bool) { + if o == nil || IsNil(o.GrabFundPromo) { + return nil, false + } + return o.GrabFundPromo, true +} + +// HasGrabFundPromo returns a boolean if a field has been set. +func (o *OrderPrice) HasGrabFundPromo() bool { + if o != nil && !IsNil(o.GrabFundPromo) { + return true + } + + return false +} + +// SetGrabFundPromo gets a reference to the given int64 and assigns it to the GrabFundPromo field. +func (o *OrderPrice) SetGrabFundPromo(v int64) { + o.GrabFundPromo = &v +} + +// GetMerchantFundPromo returns the MerchantFundPromo field value if set, zero value otherwise. +func (o *OrderPrice) GetMerchantFundPromo() int64 { + if o == nil || IsNil(o.MerchantFundPromo) { + var ret int64 + return ret + } + return *o.MerchantFundPromo +} + +// GetMerchantFundPromoOk returns a tuple with the MerchantFundPromo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetMerchantFundPromoOk() (*int64, bool) { + if o == nil || IsNil(o.MerchantFundPromo) { + return nil, false + } + return o.MerchantFundPromo, true +} + +// HasMerchantFundPromo returns a boolean if a field has been set. +func (o *OrderPrice) HasMerchantFundPromo() bool { + if o != nil && !IsNil(o.MerchantFundPromo) { + return true + } + + return false +} + +// SetMerchantFundPromo gets a reference to the given int64 and assigns it to the MerchantFundPromo field. +func (o *OrderPrice) SetMerchantFundPromo(v int64) { + o.MerchantFundPromo = &v +} + +// GetBasketPromo returns the BasketPromo field value if set, zero value otherwise. +func (o *OrderPrice) GetBasketPromo() int64 { + if o == nil || IsNil(o.BasketPromo) { + var ret int64 + return ret + } + return *o.BasketPromo +} + +// GetBasketPromoOk returns a tuple with the BasketPromo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetBasketPromoOk() (*int64, bool) { + if o == nil || IsNil(o.BasketPromo) { + return nil, false + } + return o.BasketPromo, true +} + +// HasBasketPromo returns a boolean if a field has been set. +func (o *OrderPrice) HasBasketPromo() bool { + if o != nil && !IsNil(o.BasketPromo) { + return true + } + + return false +} + +// SetBasketPromo gets a reference to the given int64 and assigns it to the BasketPromo field. +func (o *OrderPrice) SetBasketPromo(v int64) { + o.BasketPromo = &v +} + +// GetDeliveryFee returns the DeliveryFee field value if set, zero value otherwise. +func (o *OrderPrice) GetDeliveryFee() int64 { + if o == nil || IsNil(o.DeliveryFee) { + var ret int64 + return ret + } + return *o.DeliveryFee +} + +// GetDeliveryFeeOk returns a tuple with the DeliveryFee field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetDeliveryFeeOk() (*int64, bool) { + if o == nil || IsNil(o.DeliveryFee) { + return nil, false + } + return o.DeliveryFee, true +} + +// HasDeliveryFee returns a boolean if a field has been set. +func (o *OrderPrice) HasDeliveryFee() bool { + if o != nil && !IsNil(o.DeliveryFee) { + return true + } + + return false +} + +// SetDeliveryFee gets a reference to the given int64 and assigns it to the DeliveryFee field. +func (o *OrderPrice) SetDeliveryFee(v int64) { + o.DeliveryFee = &v +} + +// GetEaterPayment returns the EaterPayment field value +func (o *OrderPrice) GetEaterPayment() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.EaterPayment +} + +// GetEaterPaymentOk returns a tuple with the EaterPayment field value +// and a boolean to check if the value has been set. +func (o *OrderPrice) GetEaterPaymentOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.EaterPayment, true +} + +// SetEaterPayment sets field value +func (o *OrderPrice) SetEaterPayment(v int64) { + o.EaterPayment = v +} + +func (o OrderPrice) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderPrice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["subtotal"] = o.Subtotal + if !IsNil(o.Tax) { + toSerialize["tax"] = o.Tax + } + if !IsNil(o.MerchantChargeFee) { + toSerialize["merchantChargeFee"] = o.MerchantChargeFee + } + if !IsNil(o.GrabFundPromo) { + toSerialize["grabFundPromo"] = o.GrabFundPromo + } + if !IsNil(o.MerchantFundPromo) { + toSerialize["merchantFundPromo"] = o.MerchantFundPromo + } + if !IsNil(o.BasketPromo) { + toSerialize["basketPromo"] = o.BasketPromo + } + if !IsNil(o.DeliveryFee) { + toSerialize["deliveryFee"] = o.DeliveryFee + } + toSerialize["eaterPayment"] = o.EaterPayment + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderPrice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "subtotal", + "eaterPayment", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderPrice := _OrderPrice{} + + err = json.Unmarshal(data, &varOrderPrice) + + if err != nil { + return err + } + + *o = OrderPrice(varOrderPrice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "subtotal") + delete(additionalProperties, "tax") + delete(additionalProperties, "merchantChargeFee") + delete(additionalProperties, "grabFundPromo") + delete(additionalProperties, "merchantFundPromo") + delete(additionalProperties, "basketPromo") + delete(additionalProperties, "deliveryFee") + delete(additionalProperties, "eaterPayment") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderPrice struct { + value *OrderPrice + isSet bool +} + +func (v NullableOrderPrice) Get() *OrderPrice { + return v.value +} + +func (v *NullableOrderPrice) Set(val *OrderPrice) { + v.value = val + v.isSet = true +} + +func (v NullableOrderPrice) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderPrice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderPrice(val *OrderPrice) *NullableOrderPrice { + return &NullableOrderPrice{value: val, isSet: true} +} + +func (v NullableOrderPrice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderPrice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_promo.go b/model_order_promo.go new file mode 100644 index 0000000..1def965 --- /dev/null +++ b/model_order_promo.go @@ -0,0 +1,425 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the OrderPromo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderPromo{} + +// OrderPromo struct for OrderPromo +type OrderPromo struct { + // Promo code applied in the order. + Code *string `json:"code,omitempty"` + // Promo description. + Description *string `json:"description,omitempty"` + // Name of the promotion. + Name *string `json:"name,omitempty"` + // Promo amount applied in the order, in local currency. This amount is rounded into whole number. + PromoAmount *int64 `json:"promoAmount,omitempty"` + // The merchant's funded ratio of the promo in percentage. + MexFundedRatio *int32 `json:"mexFundedRatio,omitempty"` + // The merchant's promo fund in the minor unit. Calculated based on merchant funded ratio. + MexFundedAmount *int64 `json:"mexFundedAmount,omitempty"` + // The subtotal of the order basket in minor unit. + TargetedPrice *int64 `json:"targetedPrice,omitempty"` + // Promo amount applied in the order in minor unit. + PromoAmountInMin *int64 `json:"promoAmountInMin,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderPromo OrderPromo + +// NewOrderPromo instantiates a new OrderPromo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderPromo() *OrderPromo { + this := OrderPromo{} + return &this +} + +// NewOrderPromoWithDefaults instantiates a new OrderPromo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderPromoWithDefaults() *OrderPromo { + this := OrderPromo{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *OrderPromo) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *OrderPromo) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *OrderPromo) SetCode(v string) { + o.Code = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *OrderPromo) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *OrderPromo) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *OrderPromo) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OrderPromo) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OrderPromo) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OrderPromo) SetName(v string) { + o.Name = &v +} + +// GetPromoAmount returns the PromoAmount field value if set, zero value otherwise. +func (o *OrderPromo) GetPromoAmount() int64 { + if o == nil || IsNil(o.PromoAmount) { + var ret int64 + return ret + } + return *o.PromoAmount +} + +// GetPromoAmountOk returns a tuple with the PromoAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetPromoAmountOk() (*int64, bool) { + if o == nil || IsNil(o.PromoAmount) { + return nil, false + } + return o.PromoAmount, true +} + +// HasPromoAmount returns a boolean if a field has been set. +func (o *OrderPromo) HasPromoAmount() bool { + if o != nil && !IsNil(o.PromoAmount) { + return true + } + + return false +} + +// SetPromoAmount gets a reference to the given int64 and assigns it to the PromoAmount field. +func (o *OrderPromo) SetPromoAmount(v int64) { + o.PromoAmount = &v +} + +// GetMexFundedRatio returns the MexFundedRatio field value if set, zero value otherwise. +func (o *OrderPromo) GetMexFundedRatio() int32 { + if o == nil || IsNil(o.MexFundedRatio) { + var ret int32 + return ret + } + return *o.MexFundedRatio +} + +// GetMexFundedRatioOk returns a tuple with the MexFundedRatio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetMexFundedRatioOk() (*int32, bool) { + if o == nil || IsNil(o.MexFundedRatio) { + return nil, false + } + return o.MexFundedRatio, true +} + +// HasMexFundedRatio returns a boolean if a field has been set. +func (o *OrderPromo) HasMexFundedRatio() bool { + if o != nil && !IsNil(o.MexFundedRatio) { + return true + } + + return false +} + +// SetMexFundedRatio gets a reference to the given int32 and assigns it to the MexFundedRatio field. +func (o *OrderPromo) SetMexFundedRatio(v int32) { + o.MexFundedRatio = &v +} + +// GetMexFundedAmount returns the MexFundedAmount field value if set, zero value otherwise. +func (o *OrderPromo) GetMexFundedAmount() int64 { + if o == nil || IsNil(o.MexFundedAmount) { + var ret int64 + return ret + } + return *o.MexFundedAmount +} + +// GetMexFundedAmountOk returns a tuple with the MexFundedAmount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetMexFundedAmountOk() (*int64, bool) { + if o == nil || IsNil(o.MexFundedAmount) { + return nil, false + } + return o.MexFundedAmount, true +} + +// HasMexFundedAmount returns a boolean if a field has been set. +func (o *OrderPromo) HasMexFundedAmount() bool { + if o != nil && !IsNil(o.MexFundedAmount) { + return true + } + + return false +} + +// SetMexFundedAmount gets a reference to the given int64 and assigns it to the MexFundedAmount field. +func (o *OrderPromo) SetMexFundedAmount(v int64) { + o.MexFundedAmount = &v +} + +// GetTargetedPrice returns the TargetedPrice field value if set, zero value otherwise. +func (o *OrderPromo) GetTargetedPrice() int64 { + if o == nil || IsNil(o.TargetedPrice) { + var ret int64 + return ret + } + return *o.TargetedPrice +} + +// GetTargetedPriceOk returns a tuple with the TargetedPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetTargetedPriceOk() (*int64, bool) { + if o == nil || IsNil(o.TargetedPrice) { + return nil, false + } + return o.TargetedPrice, true +} + +// HasTargetedPrice returns a boolean if a field has been set. +func (o *OrderPromo) HasTargetedPrice() bool { + if o != nil && !IsNil(o.TargetedPrice) { + return true + } + + return false +} + +// SetTargetedPrice gets a reference to the given int64 and assigns it to the TargetedPrice field. +func (o *OrderPromo) SetTargetedPrice(v int64) { + o.TargetedPrice = &v +} + +// GetPromoAmountInMin returns the PromoAmountInMin field value if set, zero value otherwise. +func (o *OrderPromo) GetPromoAmountInMin() int64 { + if o == nil || IsNil(o.PromoAmountInMin) { + var ret int64 + return ret + } + return *o.PromoAmountInMin +} + +// GetPromoAmountInMinOk returns a tuple with the PromoAmountInMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderPromo) GetPromoAmountInMinOk() (*int64, bool) { + if o == nil || IsNil(o.PromoAmountInMin) { + return nil, false + } + return o.PromoAmountInMin, true +} + +// HasPromoAmountInMin returns a boolean if a field has been set. +func (o *OrderPromo) HasPromoAmountInMin() bool { + if o != nil && !IsNil(o.PromoAmountInMin) { + return true + } + + return false +} + +// SetPromoAmountInMin gets a reference to the given int64 and assigns it to the PromoAmountInMin field. +func (o *OrderPromo) SetPromoAmountInMin(v int64) { + o.PromoAmountInMin = &v +} + +func (o OrderPromo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderPromo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PromoAmount) { + toSerialize["promoAmount"] = o.PromoAmount + } + if !IsNil(o.MexFundedRatio) { + toSerialize["mexFundedRatio"] = o.MexFundedRatio + } + if !IsNil(o.MexFundedAmount) { + toSerialize["mexFundedAmount"] = o.MexFundedAmount + } + if !IsNil(o.TargetedPrice) { + toSerialize["targetedPrice"] = o.TargetedPrice + } + if !IsNil(o.PromoAmountInMin) { + toSerialize["promoAmountInMin"] = o.PromoAmountInMin + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderPromo) UnmarshalJSON(data []byte) (err error) { + varOrderPromo := _OrderPromo{} + + err = json.Unmarshal(data, &varOrderPromo) + + if err != nil { + return err + } + + *o = OrderPromo(varOrderPromo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "description") + delete(additionalProperties, "name") + delete(additionalProperties, "promoAmount") + delete(additionalProperties, "mexFundedRatio") + delete(additionalProperties, "mexFundedAmount") + delete(additionalProperties, "targetedPrice") + delete(additionalProperties, "promoAmountInMin") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderPromo struct { + value *OrderPromo + isSet bool +} + +func (v NullableOrderPromo) Get() *OrderPromo { + return v.value +} + +func (v *NullableOrderPromo) Set(val *OrderPromo) { + v.value = val + v.isSet = true +} + +func (v NullableOrderPromo) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderPromo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderPromo(val *OrderPromo) *NullableOrderPromo { + return &NullableOrderPromo{value: val, isSet: true} +} + +func (v NullableOrderPromo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderPromo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_ready_estimation.go b/model_order_ready_estimation.go new file mode 100644 index 0000000..f4e51c2 --- /dev/null +++ b/model_order_ready_estimation.go @@ -0,0 +1,281 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the OrderReadyEstimation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderReadyEstimation{} + +// OrderReadyEstimation Information related to the order ready time estimation. +type OrderReadyEstimation struct { + // A boolean value indicating if the order ready time can be changed. + AllowChange bool `json:"allowChange"` + // The order ready time for this order estimated by GrabFood, based on ISO_8601/RFC3339. + EstimatedOrderReadyTime time.Time `json:"estimatedOrderReadyTime"` + // The max allowed order ready time for this order, based on ISO_8601/RFC3339. + MaxOrderReadyTime time.Time `json:"maxOrderReadyTime"` + // The new order ready time for this order. Only present after a new order ready time is set (default will be null), based on ISO_8601/RFC3339. + NewOrderReadyTime NullableTime `json:"newOrderReadyTime,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderReadyEstimation OrderReadyEstimation + +// NewOrderReadyEstimation instantiates a new OrderReadyEstimation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderReadyEstimation(allowChange bool, estimatedOrderReadyTime time.Time, maxOrderReadyTime time.Time) *OrderReadyEstimation { + this := OrderReadyEstimation{} + this.AllowChange = allowChange + this.EstimatedOrderReadyTime = estimatedOrderReadyTime + this.MaxOrderReadyTime = maxOrderReadyTime + return &this +} + +// NewOrderReadyEstimationWithDefaults instantiates a new OrderReadyEstimation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderReadyEstimationWithDefaults() *OrderReadyEstimation { + this := OrderReadyEstimation{} + return &this +} + +// GetAllowChange returns the AllowChange field value +func (o *OrderReadyEstimation) GetAllowChange() bool { + if o == nil { + var ret bool + return ret + } + + return o.AllowChange +} + +// GetAllowChangeOk returns a tuple with the AllowChange field value +// and a boolean to check if the value has been set. +func (o *OrderReadyEstimation) GetAllowChangeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AllowChange, true +} + +// SetAllowChange sets field value +func (o *OrderReadyEstimation) SetAllowChange(v bool) { + o.AllowChange = v +} + +// GetEstimatedOrderReadyTime returns the EstimatedOrderReadyTime field value +func (o *OrderReadyEstimation) GetEstimatedOrderReadyTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EstimatedOrderReadyTime +} + +// GetEstimatedOrderReadyTimeOk returns a tuple with the EstimatedOrderReadyTime field value +// and a boolean to check if the value has been set. +func (o *OrderReadyEstimation) GetEstimatedOrderReadyTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EstimatedOrderReadyTime, true +} + +// SetEstimatedOrderReadyTime sets field value +func (o *OrderReadyEstimation) SetEstimatedOrderReadyTime(v time.Time) { + o.EstimatedOrderReadyTime = v +} + +// GetMaxOrderReadyTime returns the MaxOrderReadyTime field value +func (o *OrderReadyEstimation) GetMaxOrderReadyTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.MaxOrderReadyTime +} + +// GetMaxOrderReadyTimeOk returns a tuple with the MaxOrderReadyTime field value +// and a boolean to check if the value has been set. +func (o *OrderReadyEstimation) GetMaxOrderReadyTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.MaxOrderReadyTime, true +} + +// SetMaxOrderReadyTime sets field value +func (o *OrderReadyEstimation) SetMaxOrderReadyTime(v time.Time) { + o.MaxOrderReadyTime = v +} + +// GetNewOrderReadyTime returns the NewOrderReadyTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrderReadyEstimation) GetNewOrderReadyTime() time.Time { + if o == nil || IsNil(o.NewOrderReadyTime.Get()) { + var ret time.Time + return ret + } + return *o.NewOrderReadyTime.Get() +} + +// GetNewOrderReadyTimeOk returns a tuple with the NewOrderReadyTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OrderReadyEstimation) GetNewOrderReadyTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.NewOrderReadyTime.Get(), o.NewOrderReadyTime.IsSet() +} + +// HasNewOrderReadyTime returns a boolean if a field has been set. +func (o *OrderReadyEstimation) HasNewOrderReadyTime() bool { + if o != nil && o.NewOrderReadyTime.IsSet() { + return true + } + + return false +} + +// SetNewOrderReadyTime gets a reference to the given NullableTime and assigns it to the NewOrderReadyTime field. +func (o *OrderReadyEstimation) SetNewOrderReadyTime(v time.Time) { + o.NewOrderReadyTime.Set(&v) +} +// SetNewOrderReadyTimeNil sets the value for NewOrderReadyTime to be an explicit nil +func (o *OrderReadyEstimation) SetNewOrderReadyTimeNil() { + o.NewOrderReadyTime.Set(nil) +} + +// UnsetNewOrderReadyTime ensures that no value is present for NewOrderReadyTime, not even an explicit nil +func (o *OrderReadyEstimation) UnsetNewOrderReadyTime() { + o.NewOrderReadyTime.Unset() +} + +func (o OrderReadyEstimation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderReadyEstimation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["allowChange"] = o.AllowChange + toSerialize["estimatedOrderReadyTime"] = o.EstimatedOrderReadyTime + toSerialize["maxOrderReadyTime"] = o.MaxOrderReadyTime + if o.NewOrderReadyTime.IsSet() { + toSerialize["newOrderReadyTime"] = o.NewOrderReadyTime.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderReadyEstimation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "allowChange", + "estimatedOrderReadyTime", + "maxOrderReadyTime", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderReadyEstimation := _OrderReadyEstimation{} + + err = json.Unmarshal(data, &varOrderReadyEstimation) + + if err != nil { + return err + } + + *o = OrderReadyEstimation(varOrderReadyEstimation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "allowChange") + delete(additionalProperties, "estimatedOrderReadyTime") + delete(additionalProperties, "maxOrderReadyTime") + delete(additionalProperties, "newOrderReadyTime") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderReadyEstimation struct { + value *OrderReadyEstimation + isSet bool +} + +func (v NullableOrderReadyEstimation) Get() *OrderReadyEstimation { + return v.value +} + +func (v *NullableOrderReadyEstimation) Set(val *OrderReadyEstimation) { + v.value = val + v.isSet = true +} + +func (v NullableOrderReadyEstimation) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderReadyEstimation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderReadyEstimation(val *OrderReadyEstimation) *NullableOrderReadyEstimation { + return &NullableOrderReadyEstimation{value: val, isSet: true} +} + +func (v NullableOrderReadyEstimation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderReadyEstimation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_order_state_request.go b/model_order_state_request.go new file mode 100644 index 0000000..b7497dc --- /dev/null +++ b/model_order_state_request.go @@ -0,0 +1,356 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the OrderStateRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OrderStateRequest{} + +// OrderStateRequest This request pushes the state of an order on GrabFood. +type OrderStateRequest struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The current order state. For takeaway orders, only `DELIVERED` and `CANCELLED` states are pushed. + State string `json:"state"` + // The driver's estimated of arrival (ETA) in seconds when the state is `DRIVER_ALLOCATED`. + DriverETA NullableInt32 `json:"driverETA,omitempty"` + // The current order's sub-state. This is in free text so you should only use for reference. Grab may use this for troubleshooting. If you want some analysis, kindly use `state` instead. + Code *string `json:"code,omitempty"` + // Additional information to explain the current order state. May be system status or human entered message. + Message *string `json:"message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OrderStateRequest OrderStateRequest + +// NewOrderStateRequest instantiates a new OrderStateRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOrderStateRequest(merchantID string, orderID string, state string) *OrderStateRequest { + this := OrderStateRequest{} + this.MerchantID = merchantID + this.OrderID = orderID + this.State = state + return &this +} + +// NewOrderStateRequestWithDefaults instantiates a new OrderStateRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOrderStateRequestWithDefaults() *OrderStateRequest { + this := OrderStateRequest{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *OrderStateRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *OrderStateRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *OrderStateRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetOrderID returns the OrderID field value +func (o *OrderStateRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *OrderStateRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *OrderStateRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetState returns the State field value +func (o *OrderStateRequest) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *OrderStateRequest) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *OrderStateRequest) SetState(v string) { + o.State = v +} + +// GetDriverETA returns the DriverETA field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OrderStateRequest) GetDriverETA() int32 { + if o == nil || IsNil(o.DriverETA.Get()) { + var ret int32 + return ret + } + return *o.DriverETA.Get() +} + +// GetDriverETAOk returns a tuple with the DriverETA field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OrderStateRequest) GetDriverETAOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.DriverETA.Get(), o.DriverETA.IsSet() +} + +// HasDriverETA returns a boolean if a field has been set. +func (o *OrderStateRequest) HasDriverETA() bool { + if o != nil && o.DriverETA.IsSet() { + return true + } + + return false +} + +// SetDriverETA gets a reference to the given NullableInt32 and assigns it to the DriverETA field. +func (o *OrderStateRequest) SetDriverETA(v int32) { + o.DriverETA.Set(&v) +} +// SetDriverETANil sets the value for DriverETA to be an explicit nil +func (o *OrderStateRequest) SetDriverETANil() { + o.DriverETA.Set(nil) +} + +// UnsetDriverETA ensures that no value is present for DriverETA, not even an explicit nil +func (o *OrderStateRequest) UnsetDriverETA() { + o.DriverETA.Unset() +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *OrderStateRequest) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderStateRequest) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *OrderStateRequest) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *OrderStateRequest) SetCode(v string) { + o.Code = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *OrderStateRequest) GetMessage() string { + if o == nil || IsNil(o.Message) { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OrderStateRequest) GetMessageOk() (*string, bool) { + if o == nil || IsNil(o.Message) { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *OrderStateRequest) HasMessage() bool { + if o != nil && !IsNil(o.Message) { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *OrderStateRequest) SetMessage(v string) { + o.Message = &v +} + +func (o OrderStateRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OrderStateRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["orderID"] = o.OrderID + toSerialize["state"] = o.State + if o.DriverETA.IsSet() { + toSerialize["driverETA"] = o.DriverETA.Get() + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Message) { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OrderStateRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "orderID", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOrderStateRequest := _OrderStateRequest{} + + err = json.Unmarshal(data, &varOrderStateRequest) + + if err != nil { + return err + } + + *o = OrderStateRequest(varOrderStateRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "orderID") + delete(additionalProperties, "state") + delete(additionalProperties, "driverETA") + delete(additionalProperties, "code") + delete(additionalProperties, "message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOrderStateRequest struct { + value *OrderStateRequest + isSet bool +} + +func (v NullableOrderStateRequest) Get() *OrderStateRequest { + return v.value +} + +func (v *NullableOrderStateRequest) Set(val *OrderStateRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOrderStateRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOrderStateRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOrderStateRequest(val *OrderStateRequest) *NullableOrderStateRequest { + return &NullableOrderStateRequest{value: val, isSet: true} +} + +func (v NullableOrderStateRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOrderStateRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_out_of_stock_instruction.go b/model_out_of_stock_instruction.go new file mode 100644 index 0000000..29c30f7 --- /dev/null +++ b/model_out_of_stock_instruction.go @@ -0,0 +1,273 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the OutOfStockInstruction type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutOfStockInstruction{} + +// OutOfStockInstruction An JSON object that indicates the instructions to be taken by the merchant when the item is out of stock. +type OutOfStockInstruction struct { + // The short instruction message. + Title *string `json:"title,omitempty"` + // Type of out-of-stock instruction chosen by customer. `CONTACT` is disabled by default, kindly reach out to your integration manager if you wish to receive this instruction. + InstructionType *string `json:"instructionType,omitempty"` + // The preferred item's ID in the partner system. Only applicable when the instructionType is `SPECIFIC_ITEM`. + ReplacementItemID *string `json:"replacementItemID,omitempty"` + // The preferred item's ID in the Grab system. Only applicable when the instructionType is `SPECIFIC_ITEM`. + ReplacementGrabItemID *string `json:"replacementGrabItemID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OutOfStockInstruction OutOfStockInstruction + +// NewOutOfStockInstruction instantiates a new OutOfStockInstruction object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutOfStockInstruction() *OutOfStockInstruction { + this := OutOfStockInstruction{} + return &this +} + +// NewOutOfStockInstructionWithDefaults instantiates a new OutOfStockInstruction object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutOfStockInstructionWithDefaults() *OutOfStockInstruction { + this := OutOfStockInstruction{} + return &this +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *OutOfStockInstruction) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutOfStockInstruction) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *OutOfStockInstruction) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *OutOfStockInstruction) SetTitle(v string) { + o.Title = &v +} + +// GetInstructionType returns the InstructionType field value if set, zero value otherwise. +func (o *OutOfStockInstruction) GetInstructionType() string { + if o == nil || IsNil(o.InstructionType) { + var ret string + return ret + } + return *o.InstructionType +} + +// GetInstructionTypeOk returns a tuple with the InstructionType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutOfStockInstruction) GetInstructionTypeOk() (*string, bool) { + if o == nil || IsNil(o.InstructionType) { + return nil, false + } + return o.InstructionType, true +} + +// HasInstructionType returns a boolean if a field has been set. +func (o *OutOfStockInstruction) HasInstructionType() bool { + if o != nil && !IsNil(o.InstructionType) { + return true + } + + return false +} + +// SetInstructionType gets a reference to the given string and assigns it to the InstructionType field. +func (o *OutOfStockInstruction) SetInstructionType(v string) { + o.InstructionType = &v +} + +// GetReplacementItemID returns the ReplacementItemID field value if set, zero value otherwise. +func (o *OutOfStockInstruction) GetReplacementItemID() string { + if o == nil || IsNil(o.ReplacementItemID) { + var ret string + return ret + } + return *o.ReplacementItemID +} + +// GetReplacementItemIDOk returns a tuple with the ReplacementItemID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutOfStockInstruction) GetReplacementItemIDOk() (*string, bool) { + if o == nil || IsNil(o.ReplacementItemID) { + return nil, false + } + return o.ReplacementItemID, true +} + +// HasReplacementItemID returns a boolean if a field has been set. +func (o *OutOfStockInstruction) HasReplacementItemID() bool { + if o != nil && !IsNil(o.ReplacementItemID) { + return true + } + + return false +} + +// SetReplacementItemID gets a reference to the given string and assigns it to the ReplacementItemID field. +func (o *OutOfStockInstruction) SetReplacementItemID(v string) { + o.ReplacementItemID = &v +} + +// GetReplacementGrabItemID returns the ReplacementGrabItemID field value if set, zero value otherwise. +func (o *OutOfStockInstruction) GetReplacementGrabItemID() string { + if o == nil || IsNil(o.ReplacementGrabItemID) { + var ret string + return ret + } + return *o.ReplacementGrabItemID +} + +// GetReplacementGrabItemIDOk returns a tuple with the ReplacementGrabItemID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OutOfStockInstruction) GetReplacementGrabItemIDOk() (*string, bool) { + if o == nil || IsNil(o.ReplacementGrabItemID) { + return nil, false + } + return o.ReplacementGrabItemID, true +} + +// HasReplacementGrabItemID returns a boolean if a field has been set. +func (o *OutOfStockInstruction) HasReplacementGrabItemID() bool { + if o != nil && !IsNil(o.ReplacementGrabItemID) { + return true + } + + return false +} + +// SetReplacementGrabItemID gets a reference to the given string and assigns it to the ReplacementGrabItemID field. +func (o *OutOfStockInstruction) SetReplacementGrabItemID(v string) { + o.ReplacementGrabItemID = &v +} + +func (o OutOfStockInstruction) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OutOfStockInstruction) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.InstructionType) { + toSerialize["instructionType"] = o.InstructionType + } + if !IsNil(o.ReplacementItemID) { + toSerialize["replacementItemID"] = o.ReplacementItemID + } + if !IsNil(o.ReplacementGrabItemID) { + toSerialize["replacementGrabItemID"] = o.ReplacementGrabItemID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OutOfStockInstruction) UnmarshalJSON(data []byte) (err error) { + varOutOfStockInstruction := _OutOfStockInstruction{} + + err = json.Unmarshal(data, &varOutOfStockInstruction) + + if err != nil { + return err + } + + *o = OutOfStockInstruction(varOutOfStockInstruction) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "title") + delete(additionalProperties, "instructionType") + delete(additionalProperties, "replacementItemID") + delete(additionalProperties, "replacementGrabItemID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOutOfStockInstruction struct { + value *OutOfStockInstruction + isSet bool +} + +func (v NullableOutOfStockInstruction) Get() *OutOfStockInstruction { + return v.value +} + +func (v *NullableOutOfStockInstruction) Set(val *OutOfStockInstruction) { + v.value = val + v.isSet = true +} + +func (v NullableOutOfStockInstruction) IsSet() bool { + return v.isSet +} + +func (v *NullableOutOfStockInstruction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutOfStockInstruction(val *OutOfStockInstruction) *NullableOutOfStockInstruction { + return &NullableOutOfStockInstruction{value: val, isSet: true} +} + +func (v NullableOutOfStockInstruction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutOfStockInstruction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_partner_oauth_request.go b/model_partner_oauth_request.go new file mode 100644 index 0000000..a178a4e --- /dev/null +++ b/model_partner_oauth_request.go @@ -0,0 +1,270 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the PartnerOauthRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartnerOauthRequest{} + +// PartnerOauthRequest Information about GrabFood getting an OAuth access token from partners. +type PartnerOauthRequest struct { + // The client identifier issued to obtain the OAuth access token. + ClientId string `json:"client_id"` + // The client secret issued to obtain the OAuth access token. + ClientSecret string `json:"client_secret"` + // Refers to the way an application gets OAuth access token. + GrantType string `json:"grant_type"` + // A space delimited list of partner scopes. + Scope *string `json:"scope,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartnerOauthRequest PartnerOauthRequest + +// NewPartnerOauthRequest instantiates a new PartnerOauthRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartnerOauthRequest(clientId string, clientSecret string, grantType string) *PartnerOauthRequest { + this := PartnerOauthRequest{} + this.ClientId = clientId + this.ClientSecret = clientSecret + this.GrantType = grantType + return &this +} + +// NewPartnerOauthRequestWithDefaults instantiates a new PartnerOauthRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartnerOauthRequestWithDefaults() *PartnerOauthRequest { + this := PartnerOauthRequest{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *PartnerOauthRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *PartnerOauthRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *PartnerOauthRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *PartnerOauthRequest) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *PartnerOauthRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *PartnerOauthRequest) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetGrantType returns the GrantType field value +func (o *PartnerOauthRequest) GetGrantType() string { + if o == nil { + var ret string + return ret + } + + return o.GrantType +} + +// GetGrantTypeOk returns a tuple with the GrantType field value +// and a boolean to check if the value has been set. +func (o *PartnerOauthRequest) GetGrantTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrantType, true +} + +// SetGrantType sets field value +func (o *PartnerOauthRequest) SetGrantType(v string) { + o.GrantType = v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *PartnerOauthRequest) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartnerOauthRequest) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *PartnerOauthRequest) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *PartnerOauthRequest) SetScope(v string) { + o.Scope = &v +} + +func (o PartnerOauthRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartnerOauthRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["grant_type"] = o.GrantType + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartnerOauthRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "client_secret", + "grant_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPartnerOauthRequest := _PartnerOauthRequest{} + + err = json.Unmarshal(data, &varPartnerOauthRequest) + + if err != nil { + return err + } + + *o = PartnerOauthRequest(varPartnerOauthRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "grant_type") + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartnerOauthRequest struct { + value *PartnerOauthRequest + isSet bool +} + +func (v NullablePartnerOauthRequest) Get() *PartnerOauthRequest { + return v.value +} + +func (v *NullablePartnerOauthRequest) Set(val *PartnerOauthRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePartnerOauthRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePartnerOauthRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartnerOauthRequest(val *PartnerOauthRequest) *NullablePartnerOauthRequest { + return &NullablePartnerOauthRequest{value: val, isSet: true} +} + +func (v NullablePartnerOauthRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartnerOauthRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_partner_oauth_response.go b/model_partner_oauth_response.go new file mode 100644 index 0000000..b4a7d1b --- /dev/null +++ b/model_partner_oauth_response.go @@ -0,0 +1,235 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the PartnerOauthResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartnerOauthResponse{} + +// PartnerOauthResponse struct for PartnerOauthResponse +type PartnerOauthResponse struct { + // The OAuth 2.0 access token issued by the partner. + AccessToken *string `json:"access_token,omitempty"` + // The type of token issued which is case insensitive. + TokenType *string `json:"token_type,omitempty"` + // The access token lifespan in seconds. + ExpiresIn *int32 `json:"expires_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartnerOauthResponse PartnerOauthResponse + +// NewPartnerOauthResponse instantiates a new PartnerOauthResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartnerOauthResponse() *PartnerOauthResponse { + this := PartnerOauthResponse{} + return &this +} + +// NewPartnerOauthResponseWithDefaults instantiates a new PartnerOauthResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartnerOauthResponseWithDefaults() *PartnerOauthResponse { + this := PartnerOauthResponse{} + return &this +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise. +func (o *PartnerOauthResponse) GetAccessToken() string { + if o == nil || IsNil(o.AccessToken) { + var ret string + return ret + } + return *o.AccessToken +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartnerOauthResponse) GetAccessTokenOk() (*string, bool) { + if o == nil || IsNil(o.AccessToken) { + return nil, false + } + return o.AccessToken, true +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *PartnerOauthResponse) HasAccessToken() bool { + if o != nil && !IsNil(o.AccessToken) { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field. +func (o *PartnerOauthResponse) SetAccessToken(v string) { + o.AccessToken = &v +} + +// GetTokenType returns the TokenType field value if set, zero value otherwise. +func (o *PartnerOauthResponse) GetTokenType() string { + if o == nil || IsNil(o.TokenType) { + var ret string + return ret + } + return *o.TokenType +} + +// GetTokenTypeOk returns a tuple with the TokenType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartnerOauthResponse) GetTokenTypeOk() (*string, bool) { + if o == nil || IsNil(o.TokenType) { + return nil, false + } + return o.TokenType, true +} + +// HasTokenType returns a boolean if a field has been set. +func (o *PartnerOauthResponse) HasTokenType() bool { + if o != nil && !IsNil(o.TokenType) { + return true + } + + return false +} + +// SetTokenType gets a reference to the given string and assigns it to the TokenType field. +func (o *PartnerOauthResponse) SetTokenType(v string) { + o.TokenType = &v +} + +// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise. +func (o *PartnerOauthResponse) GetExpiresIn() int32 { + if o == nil || IsNil(o.ExpiresIn) { + var ret int32 + return ret + } + return *o.ExpiresIn +} + +// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartnerOauthResponse) GetExpiresInOk() (*int32, bool) { + if o == nil || IsNil(o.ExpiresIn) { + return nil, false + } + return o.ExpiresIn, true +} + +// HasExpiresIn returns a boolean if a field has been set. +func (o *PartnerOauthResponse) HasExpiresIn() bool { + if o != nil && !IsNil(o.ExpiresIn) { + return true + } + + return false +} + +// SetExpiresIn gets a reference to the given int32 and assigns it to the ExpiresIn field. +func (o *PartnerOauthResponse) SetExpiresIn(v int32) { + o.ExpiresIn = &v +} + +func (o PartnerOauthResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartnerOauthResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AccessToken) { + toSerialize["access_token"] = o.AccessToken + } + if !IsNil(o.TokenType) { + toSerialize["token_type"] = o.TokenType + } + if !IsNil(o.ExpiresIn) { + toSerialize["expires_in"] = o.ExpiresIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartnerOauthResponse) UnmarshalJSON(data []byte) (err error) { + varPartnerOauthResponse := _PartnerOauthResponse{} + + err = json.Unmarshal(data, &varPartnerOauthResponse) + + if err != nil { + return err + } + + *o = PartnerOauthResponse(varPartnerOauthResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "access_token") + delete(additionalProperties, "token_type") + delete(additionalProperties, "expires_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartnerOauthResponse struct { + value *PartnerOauthResponse + isSet bool +} + +func (v NullablePartnerOauthResponse) Get() *PartnerOauthResponse { + return v.value +} + +func (v *NullablePartnerOauthResponse) Set(val *PartnerOauthResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePartnerOauthResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePartnerOauthResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartnerOauthResponse(val *PartnerOauthResponse) *NullablePartnerOauthResponse { + return &NullablePartnerOauthResponse{value: val, isSet: true} +} + +func (v NullablePartnerOauthResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartnerOauthResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_pause_store_request.go b/model_pause_store_request.go new file mode 100644 index 0000000..d042199 --- /dev/null +++ b/model_pause_store_request.go @@ -0,0 +1,240 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the PauseStoreRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PauseStoreRequest{} + +// PauseStoreRequest This request pauses a store temporarily for (30 minutes/1 hour/24 hours) or unpauses a store on GrabFood. +type PauseStoreRequest struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // Boolean value to pause or unpause store. + IsPause bool `json:"isPause"` + // The duration to pause the store. Only required when `isPause=true`. + Duration *string `json:"duration,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PauseStoreRequest PauseStoreRequest + +// NewPauseStoreRequest instantiates a new PauseStoreRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPauseStoreRequest(merchantID string, isPause bool) *PauseStoreRequest { + this := PauseStoreRequest{} + this.MerchantID = merchantID + this.IsPause = isPause + return &this +} + +// NewPauseStoreRequestWithDefaults instantiates a new PauseStoreRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPauseStoreRequestWithDefaults() *PauseStoreRequest { + this := PauseStoreRequest{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *PauseStoreRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *PauseStoreRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *PauseStoreRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetIsPause returns the IsPause field value +func (o *PauseStoreRequest) GetIsPause() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsPause +} + +// GetIsPauseOk returns a tuple with the IsPause field value +// and a boolean to check if the value has been set. +func (o *PauseStoreRequest) GetIsPauseOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPause, true +} + +// SetIsPause sets field value +func (o *PauseStoreRequest) SetIsPause(v bool) { + o.IsPause = v +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *PauseStoreRequest) GetDuration() string { + if o == nil || IsNil(o.Duration) { + var ret string + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PauseStoreRequest) GetDurationOk() (*string, bool) { + if o == nil || IsNil(o.Duration) { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *PauseStoreRequest) HasDuration() bool { + if o != nil && !IsNil(o.Duration) { + return true + } + + return false +} + +// SetDuration gets a reference to the given string and assigns it to the Duration field. +func (o *PauseStoreRequest) SetDuration(v string) { + o.Duration = &v +} + +func (o PauseStoreRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PauseStoreRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["isPause"] = o.IsPause + if !IsNil(o.Duration) { + toSerialize["duration"] = o.Duration + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PauseStoreRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "isPause", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPauseStoreRequest := _PauseStoreRequest{} + + err = json.Unmarshal(data, &varPauseStoreRequest) + + if err != nil { + return err + } + + *o = PauseStoreRequest(varPauseStoreRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "isPause") + delete(additionalProperties, "duration") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePauseStoreRequest struct { + value *PauseStoreRequest + isSet bool +} + +func (v NullablePauseStoreRequest) Get() *PauseStoreRequest { + return v.value +} + +func (v *NullablePauseStoreRequest) Set(val *PauseStoreRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePauseStoreRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePauseStoreRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePauseStoreRequest(val *PauseStoreRequest) *NullablePauseStoreRequest { + return &NullablePauseStoreRequest{value: val, isSet: true} +} + +func (v NullablePauseStoreRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePauseStoreRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_purchasability.go b/model_purchasability.go new file mode 100644 index 0000000..6897fec --- /dev/null +++ b/model_purchasability.go @@ -0,0 +1,380 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Purchasability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Purchasability{} + +// Purchasability Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. Refer [Service Based Menu](#section/Service-Based-Menu). +type Purchasability struct { + DeliveryOnDemandGrabApp *bool `json:"Delivery_OnDemand_GrabApp,omitempty"` + DeliveryScheduledGrabApp *bool `json:"Delivery_Scheduled_GrabApp,omitempty"` + SelfPickUpOnDemandGrabApp *bool `json:"SelfPickUp_OnDemand_GrabApp,omitempty"` + DineInOnDemandGrabApp *bool `json:"DineIn_OnDemand_GrabApp,omitempty"` + DeliveryOnDemandStoreFront *bool `json:"Delivery_OnDemand_StoreFront,omitempty"` + DeliveryScheduledStoreFront *bool `json:"Delivery_Scheduled_StoreFront,omitempty"` + SelfPickUpOnDemandStoreFront *bool `json:"SelfPickUp_OnDemand_StoreFront,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Purchasability Purchasability + +// NewPurchasability instantiates a new Purchasability object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPurchasability() *Purchasability { + this := Purchasability{} + return &this +} + +// NewPurchasabilityWithDefaults instantiates a new Purchasability object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPurchasabilityWithDefaults() *Purchasability { + this := Purchasability{} + return &this +} + +// GetDeliveryOnDemandGrabApp returns the DeliveryOnDemandGrabApp field value if set, zero value otherwise. +func (o *Purchasability) GetDeliveryOnDemandGrabApp() bool { + if o == nil || IsNil(o.DeliveryOnDemandGrabApp) { + var ret bool + return ret + } + return *o.DeliveryOnDemandGrabApp +} + +// GetDeliveryOnDemandGrabAppOk returns a tuple with the DeliveryOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetDeliveryOnDemandGrabAppOk() (*bool, bool) { + if o == nil || IsNil(o.DeliveryOnDemandGrabApp) { + return nil, false + } + return o.DeliveryOnDemandGrabApp, true +} + +// HasDeliveryOnDemandGrabApp returns a boolean if a field has been set. +func (o *Purchasability) HasDeliveryOnDemandGrabApp() bool { + if o != nil && !IsNil(o.DeliveryOnDemandGrabApp) { + return true + } + + return false +} + +// SetDeliveryOnDemandGrabApp gets a reference to the given bool and assigns it to the DeliveryOnDemandGrabApp field. +func (o *Purchasability) SetDeliveryOnDemandGrabApp(v bool) { + o.DeliveryOnDemandGrabApp = &v +} + +// GetDeliveryScheduledGrabApp returns the DeliveryScheduledGrabApp field value if set, zero value otherwise. +func (o *Purchasability) GetDeliveryScheduledGrabApp() bool { + if o == nil || IsNil(o.DeliveryScheduledGrabApp) { + var ret bool + return ret + } + return *o.DeliveryScheduledGrabApp +} + +// GetDeliveryScheduledGrabAppOk returns a tuple with the DeliveryScheduledGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetDeliveryScheduledGrabAppOk() (*bool, bool) { + if o == nil || IsNil(o.DeliveryScheduledGrabApp) { + return nil, false + } + return o.DeliveryScheduledGrabApp, true +} + +// HasDeliveryScheduledGrabApp returns a boolean if a field has been set. +func (o *Purchasability) HasDeliveryScheduledGrabApp() bool { + if o != nil && !IsNil(o.DeliveryScheduledGrabApp) { + return true + } + + return false +} + +// SetDeliveryScheduledGrabApp gets a reference to the given bool and assigns it to the DeliveryScheduledGrabApp field. +func (o *Purchasability) SetDeliveryScheduledGrabApp(v bool) { + o.DeliveryScheduledGrabApp = &v +} + +// GetSelfPickUpOnDemandGrabApp returns the SelfPickUpOnDemandGrabApp field value if set, zero value otherwise. +func (o *Purchasability) GetSelfPickUpOnDemandGrabApp() bool { + if o == nil || IsNil(o.SelfPickUpOnDemandGrabApp) { + var ret bool + return ret + } + return *o.SelfPickUpOnDemandGrabApp +} + +// GetSelfPickUpOnDemandGrabAppOk returns a tuple with the SelfPickUpOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetSelfPickUpOnDemandGrabAppOk() (*bool, bool) { + if o == nil || IsNil(o.SelfPickUpOnDemandGrabApp) { + return nil, false + } + return o.SelfPickUpOnDemandGrabApp, true +} + +// HasSelfPickUpOnDemandGrabApp returns a boolean if a field has been set. +func (o *Purchasability) HasSelfPickUpOnDemandGrabApp() bool { + if o != nil && !IsNil(o.SelfPickUpOnDemandGrabApp) { + return true + } + + return false +} + +// SetSelfPickUpOnDemandGrabApp gets a reference to the given bool and assigns it to the SelfPickUpOnDemandGrabApp field. +func (o *Purchasability) SetSelfPickUpOnDemandGrabApp(v bool) { + o.SelfPickUpOnDemandGrabApp = &v +} + +// GetDineInOnDemandGrabApp returns the DineInOnDemandGrabApp field value if set, zero value otherwise. +func (o *Purchasability) GetDineInOnDemandGrabApp() bool { + if o == nil || IsNil(o.DineInOnDemandGrabApp) { + var ret bool + return ret + } + return *o.DineInOnDemandGrabApp +} + +// GetDineInOnDemandGrabAppOk returns a tuple with the DineInOnDemandGrabApp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetDineInOnDemandGrabAppOk() (*bool, bool) { + if o == nil || IsNil(o.DineInOnDemandGrabApp) { + return nil, false + } + return o.DineInOnDemandGrabApp, true +} + +// HasDineInOnDemandGrabApp returns a boolean if a field has been set. +func (o *Purchasability) HasDineInOnDemandGrabApp() bool { + if o != nil && !IsNil(o.DineInOnDemandGrabApp) { + return true + } + + return false +} + +// SetDineInOnDemandGrabApp gets a reference to the given bool and assigns it to the DineInOnDemandGrabApp field. +func (o *Purchasability) SetDineInOnDemandGrabApp(v bool) { + o.DineInOnDemandGrabApp = &v +} + +// GetDeliveryOnDemandStoreFront returns the DeliveryOnDemandStoreFront field value if set, zero value otherwise. +func (o *Purchasability) GetDeliveryOnDemandStoreFront() bool { + if o == nil || IsNil(o.DeliveryOnDemandStoreFront) { + var ret bool + return ret + } + return *o.DeliveryOnDemandStoreFront +} + +// GetDeliveryOnDemandStoreFrontOk returns a tuple with the DeliveryOnDemandStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetDeliveryOnDemandStoreFrontOk() (*bool, bool) { + if o == nil || IsNil(o.DeliveryOnDemandStoreFront) { + return nil, false + } + return o.DeliveryOnDemandStoreFront, true +} + +// HasDeliveryOnDemandStoreFront returns a boolean if a field has been set. +func (o *Purchasability) HasDeliveryOnDemandStoreFront() bool { + if o != nil && !IsNil(o.DeliveryOnDemandStoreFront) { + return true + } + + return false +} + +// SetDeliveryOnDemandStoreFront gets a reference to the given bool and assigns it to the DeliveryOnDemandStoreFront field. +func (o *Purchasability) SetDeliveryOnDemandStoreFront(v bool) { + o.DeliveryOnDemandStoreFront = &v +} + +// GetDeliveryScheduledStoreFront returns the DeliveryScheduledStoreFront field value if set, zero value otherwise. +func (o *Purchasability) GetDeliveryScheduledStoreFront() bool { + if o == nil || IsNil(o.DeliveryScheduledStoreFront) { + var ret bool + return ret + } + return *o.DeliveryScheduledStoreFront +} + +// GetDeliveryScheduledStoreFrontOk returns a tuple with the DeliveryScheduledStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetDeliveryScheduledStoreFrontOk() (*bool, bool) { + if o == nil || IsNil(o.DeliveryScheduledStoreFront) { + return nil, false + } + return o.DeliveryScheduledStoreFront, true +} + +// HasDeliveryScheduledStoreFront returns a boolean if a field has been set. +func (o *Purchasability) HasDeliveryScheduledStoreFront() bool { + if o != nil && !IsNil(o.DeliveryScheduledStoreFront) { + return true + } + + return false +} + +// SetDeliveryScheduledStoreFront gets a reference to the given bool and assigns it to the DeliveryScheduledStoreFront field. +func (o *Purchasability) SetDeliveryScheduledStoreFront(v bool) { + o.DeliveryScheduledStoreFront = &v +} + +// GetSelfPickUpOnDemandStoreFront returns the SelfPickUpOnDemandStoreFront field value if set, zero value otherwise. +func (o *Purchasability) GetSelfPickUpOnDemandStoreFront() bool { + if o == nil || IsNil(o.SelfPickUpOnDemandStoreFront) { + var ret bool + return ret + } + return *o.SelfPickUpOnDemandStoreFront +} + +// GetSelfPickUpOnDemandStoreFrontOk returns a tuple with the SelfPickUpOnDemandStoreFront field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Purchasability) GetSelfPickUpOnDemandStoreFrontOk() (*bool, bool) { + if o == nil || IsNil(o.SelfPickUpOnDemandStoreFront) { + return nil, false + } + return o.SelfPickUpOnDemandStoreFront, true +} + +// HasSelfPickUpOnDemandStoreFront returns a boolean if a field has been set. +func (o *Purchasability) HasSelfPickUpOnDemandStoreFront() bool { + if o != nil && !IsNil(o.SelfPickUpOnDemandStoreFront) { + return true + } + + return false +} + +// SetSelfPickUpOnDemandStoreFront gets a reference to the given bool and assigns it to the SelfPickUpOnDemandStoreFront field. +func (o *Purchasability) SetSelfPickUpOnDemandStoreFront(v bool) { + o.SelfPickUpOnDemandStoreFront = &v +} + +func (o Purchasability) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Purchasability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeliveryOnDemandGrabApp) { + toSerialize["Delivery_OnDemand_GrabApp"] = o.DeliveryOnDemandGrabApp + } + if !IsNil(o.DeliveryScheduledGrabApp) { + toSerialize["Delivery_Scheduled_GrabApp"] = o.DeliveryScheduledGrabApp + } + if !IsNil(o.SelfPickUpOnDemandGrabApp) { + toSerialize["SelfPickUp_OnDemand_GrabApp"] = o.SelfPickUpOnDemandGrabApp + } + if !IsNil(o.DineInOnDemandGrabApp) { + toSerialize["DineIn_OnDemand_GrabApp"] = o.DineInOnDemandGrabApp + } + if !IsNil(o.DeliveryOnDemandStoreFront) { + toSerialize["Delivery_OnDemand_StoreFront"] = o.DeliveryOnDemandStoreFront + } + if !IsNil(o.DeliveryScheduledStoreFront) { + toSerialize["Delivery_Scheduled_StoreFront"] = o.DeliveryScheduledStoreFront + } + if !IsNil(o.SelfPickUpOnDemandStoreFront) { + toSerialize["SelfPickUp_OnDemand_StoreFront"] = o.SelfPickUpOnDemandStoreFront + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Purchasability) UnmarshalJSON(data []byte) (err error) { + varPurchasability := _Purchasability{} + + err = json.Unmarshal(data, &varPurchasability) + + if err != nil { + return err + } + + *o = Purchasability(varPurchasability) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "Delivery_OnDemand_GrabApp") + delete(additionalProperties, "Delivery_Scheduled_GrabApp") + delete(additionalProperties, "SelfPickUp_OnDemand_GrabApp") + delete(additionalProperties, "DineIn_OnDemand_GrabApp") + delete(additionalProperties, "Delivery_OnDemand_StoreFront") + delete(additionalProperties, "Delivery_Scheduled_StoreFront") + delete(additionalProperties, "SelfPickUp_OnDemand_StoreFront") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePurchasability struct { + value *Purchasability + isSet bool +} + +func (v NullablePurchasability) Get() *Purchasability { + return v.value +} + +func (v *NullablePurchasability) Set(val *Purchasability) { + v.value = val + v.isSet = true +} + +func (v NullablePurchasability) IsSet() bool { + return v.isSet +} + +func (v *NullablePurchasability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePurchasability(val *Purchasability) *NullablePurchasability { + return &NullablePurchasability{value: val, isSet: true} +} + +func (v NullablePurchasability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePurchasability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_receiver.go b/model_receiver.go new file mode 100644 index 0000000..8e6d038 --- /dev/null +++ b/model_receiver.go @@ -0,0 +1,234 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Receiver type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Receiver{} + +// Receiver A JSON object containing the receiver information. Currently only for orders that are delivered by the restaurant. +type Receiver struct { + // The name of the receiver. + Name *string `json:"name,omitempty"` + // The receiver's phone number. + Phones *string `json:"phones,omitempty"` + Address *Address `json:"address,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Receiver Receiver + +// NewReceiver instantiates a new Receiver object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReceiver() *Receiver { + this := Receiver{} + return &this +} + +// NewReceiverWithDefaults instantiates a new Receiver object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReceiverWithDefaults() *Receiver { + this := Receiver{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Receiver) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Receiver) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Receiver) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Receiver) SetName(v string) { + o.Name = &v +} + +// GetPhones returns the Phones field value if set, zero value otherwise. +func (o *Receiver) GetPhones() string { + if o == nil || IsNil(o.Phones) { + var ret string + return ret + } + return *o.Phones +} + +// GetPhonesOk returns a tuple with the Phones field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Receiver) GetPhonesOk() (*string, bool) { + if o == nil || IsNil(o.Phones) { + return nil, false + } + return o.Phones, true +} + +// HasPhones returns a boolean if a field has been set. +func (o *Receiver) HasPhones() bool { + if o != nil && !IsNil(o.Phones) { + return true + } + + return false +} + +// SetPhones gets a reference to the given string and assigns it to the Phones field. +func (o *Receiver) SetPhones(v string) { + o.Phones = &v +} + +// GetAddress returns the Address field value if set, zero value otherwise. +func (o *Receiver) GetAddress() Address { + if o == nil || IsNil(o.Address) { + var ret Address + return ret + } + return *o.Address +} + +// GetAddressOk returns a tuple with the Address field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Receiver) GetAddressOk() (*Address, bool) { + if o == nil || IsNil(o.Address) { + return nil, false + } + return o.Address, true +} + +// HasAddress returns a boolean if a field has been set. +func (o *Receiver) HasAddress() bool { + if o != nil && !IsNil(o.Address) { + return true + } + + return false +} + +// SetAddress gets a reference to the given Address and assigns it to the Address field. +func (o *Receiver) SetAddress(v Address) { + o.Address = &v +} + +func (o Receiver) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Receiver) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Phones) { + toSerialize["phones"] = o.Phones + } + if !IsNil(o.Address) { + toSerialize["address"] = o.Address + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Receiver) UnmarshalJSON(data []byte) (err error) { + varReceiver := _Receiver{} + + err = json.Unmarshal(data, &varReceiver) + + if err != nil { + return err + } + + *o = Receiver(varReceiver) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "phones") + delete(additionalProperties, "address") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReceiver struct { + value *Receiver + isSet bool +} + +func (v NullableReceiver) Get() *Receiver { + return v.value +} + +func (v *NullableReceiver) Set(val *Receiver) { + v.value = val + v.isSet = true +} + +func (v NullableReceiver) IsSet() bool { + return v.isSet +} + +func (v *NullableReceiver) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReceiver(val *Receiver) *NullableReceiver { + return &NullableReceiver{value: val, isSet: true} +} + +func (v NullableReceiver) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReceiver) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_redeem_dine_in_voucher_request.go b/model_redeem_dine_in_voucher_request.go new file mode 100644 index 0000000..c991ccb --- /dev/null +++ b/model_redeem_dine_in_voucher_request.go @@ -0,0 +1,202 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedeemDineInVoucherRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedeemDineInVoucherRequest{} + +// RedeemDineInVoucherRequest Dine in voucher redemption +type RedeemDineInVoucherRequest struct { + // This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. + CertificateID string `json:"certificateID"` + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + AdditionalProperties map[string]interface{} +} + +type _RedeemDineInVoucherRequest RedeemDineInVoucherRequest + +// NewRedeemDineInVoucherRequest instantiates a new RedeemDineInVoucherRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedeemDineInVoucherRequest(certificateID string, merchantID string) *RedeemDineInVoucherRequest { + this := RedeemDineInVoucherRequest{} + this.CertificateID = certificateID + this.MerchantID = merchantID + return &this +} + +// NewRedeemDineInVoucherRequestWithDefaults instantiates a new RedeemDineInVoucherRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedeemDineInVoucherRequestWithDefaults() *RedeemDineInVoucherRequest { + this := RedeemDineInVoucherRequest{} + return &this +} + +// GetCertificateID returns the CertificateID field value +func (o *RedeemDineInVoucherRequest) GetCertificateID() string { + if o == nil { + var ret string + return ret + } + + return o.CertificateID +} + +// GetCertificateIDOk returns a tuple with the CertificateID field value +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherRequest) GetCertificateIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CertificateID, true +} + +// SetCertificateID sets field value +func (o *RedeemDineInVoucherRequest) SetCertificateID(v string) { + o.CertificateID = v +} + +// GetMerchantID returns the MerchantID field value +func (o *RedeemDineInVoucherRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *RedeemDineInVoucherRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +func (o RedeemDineInVoucherRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedeemDineInVoucherRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["certificateID"] = o.CertificateID + toSerialize["merchantID"] = o.MerchantID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedeemDineInVoucherRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "certificateID", + "merchantID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedeemDineInVoucherRequest := _RedeemDineInVoucherRequest{} + + err = json.Unmarshal(data, &varRedeemDineInVoucherRequest) + + if err != nil { + return err + } + + *o = RedeemDineInVoucherRequest(varRedeemDineInVoucherRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "certificateID") + delete(additionalProperties, "merchantID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedeemDineInVoucherRequest struct { + value *RedeemDineInVoucherRequest + isSet bool +} + +func (v NullableRedeemDineInVoucherRequest) Get() *RedeemDineInVoucherRequest { + return v.value +} + +func (v *NullableRedeemDineInVoucherRequest) Set(val *RedeemDineInVoucherRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRedeemDineInVoucherRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRedeemDineInVoucherRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedeemDineInVoucherRequest(val *RedeemDineInVoucherRequest) *NullableRedeemDineInVoucherRequest { + return &NullableRedeemDineInVoucherRequest{value: val, isSet: true} +} + +func (v NullableRedeemDineInVoucherRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedeemDineInVoucherRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_redeem_dine_in_voucher_response.go b/model_redeem_dine_in_voucher_response.go new file mode 100644 index 0000000..773ec19 --- /dev/null +++ b/model_redeem_dine_in_voucher_response.go @@ -0,0 +1,347 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the RedeemDineInVoucherResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedeemDineInVoucherResponse{} + +// RedeemDineInVoucherResponse +type RedeemDineInVoucherResponse struct { + // This certificateID is decoded from scanning the QR code, and 1:1 mapping with `voucherCode`. + CertificateID *string `json:"certificateID,omitempty"` + // A short code for the dine-in voucher purchased by the user. + VoucherCode *string `json:"voucherCode,omitempty"` + Voucher *Voucher `json:"voucher,omitempty"` + RedeemResult *RedeemResult `json:"redeemResult,omitempty"` + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The dine-in voucher campaign's ID in GrabFood's database. + CampaignID *string `json:"campaignID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RedeemDineInVoucherResponse RedeemDineInVoucherResponse + +// NewRedeemDineInVoucherResponse instantiates a new RedeemDineInVoucherResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedeemDineInVoucherResponse() *RedeemDineInVoucherResponse { + this := RedeemDineInVoucherResponse{} + return &this +} + +// NewRedeemDineInVoucherResponseWithDefaults instantiates a new RedeemDineInVoucherResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedeemDineInVoucherResponseWithDefaults() *RedeemDineInVoucherResponse { + this := RedeemDineInVoucherResponse{} + return &this +} + +// GetCertificateID returns the CertificateID field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetCertificateID() string { + if o == nil || IsNil(o.CertificateID) { + var ret string + return ret + } + return *o.CertificateID +} + +// GetCertificateIDOk returns a tuple with the CertificateID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetCertificateIDOk() (*string, bool) { + if o == nil || IsNil(o.CertificateID) { + return nil, false + } + return o.CertificateID, true +} + +// HasCertificateID returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasCertificateID() bool { + if o != nil && !IsNil(o.CertificateID) { + return true + } + + return false +} + +// SetCertificateID gets a reference to the given string and assigns it to the CertificateID field. +func (o *RedeemDineInVoucherResponse) SetCertificateID(v string) { + o.CertificateID = &v +} + +// GetVoucherCode returns the VoucherCode field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetVoucherCode() string { + if o == nil || IsNil(o.VoucherCode) { + var ret string + return ret + } + return *o.VoucherCode +} + +// GetVoucherCodeOk returns a tuple with the VoucherCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetVoucherCodeOk() (*string, bool) { + if o == nil || IsNil(o.VoucherCode) { + return nil, false + } + return o.VoucherCode, true +} + +// HasVoucherCode returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasVoucherCode() bool { + if o != nil && !IsNil(o.VoucherCode) { + return true + } + + return false +} + +// SetVoucherCode gets a reference to the given string and assigns it to the VoucherCode field. +func (o *RedeemDineInVoucherResponse) SetVoucherCode(v string) { + o.VoucherCode = &v +} + +// GetVoucher returns the Voucher field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetVoucher() Voucher { + if o == nil || IsNil(o.Voucher) { + var ret Voucher + return ret + } + return *o.Voucher +} + +// GetVoucherOk returns a tuple with the Voucher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetVoucherOk() (*Voucher, bool) { + if o == nil || IsNil(o.Voucher) { + return nil, false + } + return o.Voucher, true +} + +// HasVoucher returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasVoucher() bool { + if o != nil && !IsNil(o.Voucher) { + return true + } + + return false +} + +// SetVoucher gets a reference to the given Voucher and assigns it to the Voucher field. +func (o *RedeemDineInVoucherResponse) SetVoucher(v Voucher) { + o.Voucher = &v +} + +// GetRedeemResult returns the RedeemResult field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetRedeemResult() RedeemResult { + if o == nil || IsNil(o.RedeemResult) { + var ret RedeemResult + return ret + } + return *o.RedeemResult +} + +// GetRedeemResultOk returns a tuple with the RedeemResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetRedeemResultOk() (*RedeemResult, bool) { + if o == nil || IsNil(o.RedeemResult) { + return nil, false + } + return o.RedeemResult, true +} + +// HasRedeemResult returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasRedeemResult() bool { + if o != nil && !IsNil(o.RedeemResult) { + return true + } + + return false +} + +// SetRedeemResult gets a reference to the given RedeemResult and assigns it to the RedeemResult field. +func (o *RedeemDineInVoucherResponse) SetRedeemResult(v RedeemResult) { + o.RedeemResult = &v +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *RedeemDineInVoucherResponse) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetCampaignID returns the CampaignID field value if set, zero value otherwise. +func (o *RedeemDineInVoucherResponse) GetCampaignID() string { + if o == nil || IsNil(o.CampaignID) { + var ret string + return ret + } + return *o.CampaignID +} + +// GetCampaignIDOk returns a tuple with the CampaignID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemDineInVoucherResponse) GetCampaignIDOk() (*string, bool) { + if o == nil || IsNil(o.CampaignID) { + return nil, false + } + return o.CampaignID, true +} + +// HasCampaignID returns a boolean if a field has been set. +func (o *RedeemDineInVoucherResponse) HasCampaignID() bool { + if o != nil && !IsNil(o.CampaignID) { + return true + } + + return false +} + +// SetCampaignID gets a reference to the given string and assigns it to the CampaignID field. +func (o *RedeemDineInVoucherResponse) SetCampaignID(v string) { + o.CampaignID = &v +} + +func (o RedeemDineInVoucherResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedeemDineInVoucherResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CertificateID) { + toSerialize["certificateID"] = o.CertificateID + } + if !IsNil(o.VoucherCode) { + toSerialize["voucherCode"] = o.VoucherCode + } + if !IsNil(o.Voucher) { + toSerialize["voucher"] = o.Voucher + } + if !IsNil(o.RedeemResult) { + toSerialize["redeemResult"] = o.RedeemResult + } + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.CampaignID) { + toSerialize["campaignID"] = o.CampaignID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedeemDineInVoucherResponse) UnmarshalJSON(data []byte) (err error) { + varRedeemDineInVoucherResponse := _RedeemDineInVoucherResponse{} + + err = json.Unmarshal(data, &varRedeemDineInVoucherResponse) + + if err != nil { + return err + } + + *o = RedeemDineInVoucherResponse(varRedeemDineInVoucherResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "certificateID") + delete(additionalProperties, "voucherCode") + delete(additionalProperties, "voucher") + delete(additionalProperties, "redeemResult") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "campaignID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedeemDineInVoucherResponse struct { + value *RedeemDineInVoucherResponse + isSet bool +} + +func (v NullableRedeemDineInVoucherResponse) Get() *RedeemDineInVoucherResponse { + return v.value +} + +func (v *NullableRedeemDineInVoucherResponse) Set(val *RedeemDineInVoucherResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRedeemDineInVoucherResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRedeemDineInVoucherResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedeemDineInVoucherResponse(val *RedeemDineInVoucherResponse) *NullableRedeemDineInVoucherResponse { + return &NullableRedeemDineInVoucherResponse{value: val, isSet: true} +} + +func (v NullableRedeemDineInVoucherResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedeemDineInVoucherResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_redeem_result.go b/model_redeem_result.go new file mode 100644 index 0000000..b4fb5b9 --- /dev/null +++ b/model_redeem_result.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the RedeemResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedeemResult{} + +// RedeemResult A JSON object containing dine-in voucher details. +type RedeemResult struct { + // To indicate whether the dine-in voucher redemption succeeded. + Success *bool `json:"success,omitempty"` + // The code for the reason of failed redemption. Empty if the `success` is true. * `VOUCHER_REDEEMED` - The voucher has already been redeemed. * `INVALID_STATE` - The current status of voucher is EXPIRED or REFUNDED. * `REDEEM_FAILED` - Internal service error. * `INVALID_MERCHANT` - Voucher not applicable for this merchant. * `INVALID_ID` - Invalid certificateID. + Code *string `json:"code,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RedeemResult RedeemResult + +// NewRedeemResult instantiates a new RedeemResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedeemResult() *RedeemResult { + this := RedeemResult{} + return &this +} + +// NewRedeemResultWithDefaults instantiates a new RedeemResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedeemResultWithDefaults() *RedeemResult { + this := RedeemResult{} + return &this +} + +// GetSuccess returns the Success field value if set, zero value otherwise. +func (o *RedeemResult) GetSuccess() bool { + if o == nil || IsNil(o.Success) { + var ret bool + return ret + } + return *o.Success +} + +// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemResult) GetSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.Success) { + return nil, false + } + return o.Success, true +} + +// HasSuccess returns a boolean if a field has been set. +func (o *RedeemResult) HasSuccess() bool { + if o != nil && !IsNil(o.Success) { + return true + } + + return false +} + +// SetSuccess gets a reference to the given bool and assigns it to the Success field. +func (o *RedeemResult) SetSuccess(v bool) { + o.Success = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *RedeemResult) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedeemResult) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *RedeemResult) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *RedeemResult) SetCode(v string) { + o.Code = &v +} + +func (o RedeemResult) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedeemResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Success) { + toSerialize["success"] = o.Success + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedeemResult) UnmarshalJSON(data []byte) (err error) { + varRedeemResult := _RedeemResult{} + + err = json.Unmarshal(data, &varRedeemResult) + + if err != nil { + return err + } + + *o = RedeemResult(varRedeemResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "success") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedeemResult struct { + value *RedeemResult + isSet bool +} + +func (v NullableRedeemResult) Get() *RedeemResult { + return v.value +} + +func (v *NullableRedeemResult) Set(val *RedeemResult) { + v.value = val + v.isSet = true +} + +func (v NullableRedeemResult) IsSet() bool { + return v.isSet +} + +func (v *NullableRedeemResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedeemResult(val *RedeemResult) *NullableRedeemResult { + return &NullableRedeemResult{value: val, isSet: true} +} + +func (v NullableRedeemResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedeemResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_register_membership_native_request.go b/model_register_membership_native_request.go new file mode 100644 index 0000000..c75caff --- /dev/null +++ b/model_register_membership_native_request.go @@ -0,0 +1,286 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the RegisterMembershipNativeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterMembershipNativeRequest{} + +// RegisterMembershipNativeRequest This request submits membership registration request to partner. +type RegisterMembershipNativeRequest struct { + // The id used to identify an unique grab user. + GrabID string `json:"grabID"` + // Grab user's phone number for registration. + PhoneNumber *string `json:"phoneNumber,omitempty"` + // Grab user's name for registration. + Name *string `json:"name,omitempty"` + // Grab user's email address for registration. + Email *string `json:"email,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RegisterMembershipNativeRequest RegisterMembershipNativeRequest + +// NewRegisterMembershipNativeRequest instantiates a new RegisterMembershipNativeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegisterMembershipNativeRequest(grabID string) *RegisterMembershipNativeRequest { + this := RegisterMembershipNativeRequest{} + this.GrabID = grabID + return &this +} + +// NewRegisterMembershipNativeRequestWithDefaults instantiates a new RegisterMembershipNativeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegisterMembershipNativeRequestWithDefaults() *RegisterMembershipNativeRequest { + this := RegisterMembershipNativeRequest{} + return &this +} + +// GetGrabID returns the GrabID field value +func (o *RegisterMembershipNativeRequest) GetGrabID() string { + if o == nil { + var ret string + return ret + } + + return o.GrabID +} + +// GetGrabIDOk returns a tuple with the GrabID field value +// and a boolean to check if the value has been set. +func (o *RegisterMembershipNativeRequest) GetGrabIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GrabID, true +} + +// SetGrabID sets field value +func (o *RegisterMembershipNativeRequest) SetGrabID(v string) { + o.GrabID = v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *RegisterMembershipNativeRequest) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegisterMembershipNativeRequest) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *RegisterMembershipNativeRequest) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *RegisterMembershipNativeRequest) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *RegisterMembershipNativeRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegisterMembershipNativeRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *RegisterMembershipNativeRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *RegisterMembershipNativeRequest) SetName(v string) { + o.Name = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *RegisterMembershipNativeRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegisterMembershipNativeRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *RegisterMembershipNativeRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *RegisterMembershipNativeRequest) SetEmail(v string) { + o.Email = &v +} + +func (o RegisterMembershipNativeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegisterMembershipNativeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["grabID"] = o.GrabID + if !IsNil(o.PhoneNumber) { + toSerialize["phoneNumber"] = o.PhoneNumber + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RegisterMembershipNativeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "grabID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegisterMembershipNativeRequest := _RegisterMembershipNativeRequest{} + + err = json.Unmarshal(data, &varRegisterMembershipNativeRequest) + + if err != nil { + return err + } + + *o = RegisterMembershipNativeRequest(varRegisterMembershipNativeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "grabID") + delete(additionalProperties, "phoneNumber") + delete(additionalProperties, "name") + delete(additionalProperties, "email") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRegisterMembershipNativeRequest struct { + value *RegisterMembershipNativeRequest + isSet bool +} + +func (v NullableRegisterMembershipNativeRequest) Get() *RegisterMembershipNativeRequest { + return v.value +} + +func (v *NullableRegisterMembershipNativeRequest) Set(val *RegisterMembershipNativeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterMembershipNativeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterMembershipNativeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterMembershipNativeRequest(val *RegisterMembershipNativeRequest) *NullableRegisterMembershipNativeRequest { + return &NullableRegisterMembershipNativeRequest{value: val, isSet: true} +} + +func (v NullableRegisterMembershipNativeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterMembershipNativeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_register_membership_native_response.go b/model_register_membership_native_response.go new file mode 100644 index 0000000..f84ee83 --- /dev/null +++ b/model_register_membership_native_response.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the RegisterMembershipNativeResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegisterMembershipNativeResponse{} + +// RegisterMembershipNativeResponse This response returns membershipID after membership binding is successful. +type RegisterMembershipNativeResponse struct { + // The unique member ID on the partner's database. + MemberID string `json:"memberID"` + AdditionalProperties map[string]interface{} +} + +type _RegisterMembershipNativeResponse RegisterMembershipNativeResponse + +// NewRegisterMembershipNativeResponse instantiates a new RegisterMembershipNativeResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegisterMembershipNativeResponse(memberID string) *RegisterMembershipNativeResponse { + this := RegisterMembershipNativeResponse{} + this.MemberID = memberID + return &this +} + +// NewRegisterMembershipNativeResponseWithDefaults instantiates a new RegisterMembershipNativeResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegisterMembershipNativeResponseWithDefaults() *RegisterMembershipNativeResponse { + this := RegisterMembershipNativeResponse{} + return &this +} + +// GetMemberID returns the MemberID field value +func (o *RegisterMembershipNativeResponse) GetMemberID() string { + if o == nil { + var ret string + return ret + } + + return o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value +// and a boolean to check if the value has been set. +func (o *RegisterMembershipNativeResponse) GetMemberIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberID, true +} + +// SetMemberID sets field value +func (o *RegisterMembershipNativeResponse) SetMemberID(v string) { + o.MemberID = v +} + +func (o RegisterMembershipNativeResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegisterMembershipNativeResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["memberID"] = o.MemberID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RegisterMembershipNativeResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "memberID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegisterMembershipNativeResponse := _RegisterMembershipNativeResponse{} + + err = json.Unmarshal(data, &varRegisterMembershipNativeResponse) + + if err != nil { + return err + } + + *o = RegisterMembershipNativeResponse(varRegisterMembershipNativeResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRegisterMembershipNativeResponse struct { + value *RegisterMembershipNativeResponse + isSet bool +} + +func (v NullableRegisterMembershipNativeResponse) Get() *RegisterMembershipNativeResponse { + return v.value +} + +func (v *NullableRegisterMembershipNativeResponse) Set(val *RegisterMembershipNativeResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRegisterMembershipNativeResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRegisterMembershipNativeResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegisterMembershipNativeResponse(val *RegisterMembershipNativeResponse) *NullableRegisterMembershipNativeResponse { + return &NullableRegisterMembershipNativeResponse{value: val, isSet: true} +} + +func (v NullableRegisterMembershipNativeResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegisterMembershipNativeResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_reward_item.go b/model_reward_item.go new file mode 100644 index 0000000..f792337 --- /dev/null +++ b/model_reward_item.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the RewardItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RewardItem{} + +// RewardItem struct for RewardItem +type RewardItem struct { + // The item's ID in partner system. + ItemID *string `json:"itemID,omitempty"` + // The item's quantity. + Quantity *int32 `json:"quantity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RewardItem RewardItem + +// NewRewardItem instantiates a new RewardItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRewardItem() *RewardItem { + this := RewardItem{} + return &this +} + +// NewRewardItemWithDefaults instantiates a new RewardItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRewardItemWithDefaults() *RewardItem { + this := RewardItem{} + return &this +} + +// GetItemID returns the ItemID field value if set, zero value otherwise. +func (o *RewardItem) GetItemID() string { + if o == nil || IsNil(o.ItemID) { + var ret string + return ret + } + return *o.ItemID +} + +// GetItemIDOk returns a tuple with the ItemID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RewardItem) GetItemIDOk() (*string, bool) { + if o == nil || IsNil(o.ItemID) { + return nil, false + } + return o.ItemID, true +} + +// HasItemID returns a boolean if a field has been set. +func (o *RewardItem) HasItemID() bool { + if o != nil && !IsNil(o.ItemID) { + return true + } + + return false +} + +// SetItemID gets a reference to the given string and assigns it to the ItemID field. +func (o *RewardItem) SetItemID(v string) { + o.ItemID = &v +} + +// GetQuantity returns the Quantity field value if set, zero value otherwise. +func (o *RewardItem) GetQuantity() int32 { + if o == nil || IsNil(o.Quantity) { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RewardItem) GetQuantityOk() (*int32, bool) { + if o == nil || IsNil(o.Quantity) { + return nil, false + } + return o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *RewardItem) HasQuantity() bool { + if o != nil && !IsNil(o.Quantity) { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *RewardItem) SetQuantity(v int32) { + o.Quantity = &v +} + +func (o RewardItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RewardItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ItemID) { + toSerialize["itemID"] = o.ItemID + } + if !IsNil(o.Quantity) { + toSerialize["quantity"] = o.Quantity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RewardItem) UnmarshalJSON(data []byte) (err error) { + varRewardItem := _RewardItem{} + + err = json.Unmarshal(data, &varRewardItem) + + if err != nil { + return err + } + + *o = RewardItem(varRewardItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "itemID") + delete(additionalProperties, "quantity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRewardItem struct { + value *RewardItem + isSet bool +} + +func (v NullableRewardItem) Get() *RewardItem { + return v.value +} + +func (v *NullableRewardItem) Set(val *RewardItem) { + v.value = val + v.isSet = true +} + +func (v NullableRewardItem) IsSet() bool { + return v.isSet +} + +func (v *NullableRewardItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRewardItem(val *RewardItem) *NullableRewardItem { + return &NullableRewardItem{value: val, isSet: true} +} + +func (v NullableRewardItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRewardItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_selling_time.go b/model_selling_time.go new file mode 100644 index 0000000..1ac5c99 --- /dev/null +++ b/model_selling_time.go @@ -0,0 +1,310 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the SellingTime type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SellingTime{} + +// SellingTime struct for SellingTime +type SellingTime struct { + // The selling time group start time in date & time format. + StartTime *string `json:"startTime,omitempty"` + // The selling time group end time in date & time format. + EndTime *string `json:"endTime,omitempty"` + // The selling time's ID on the partner system. This ID should be unique with length min 1 and max 64. + Id *string `json:"id,omitempty"` + // The name of the selling time. + Name *string `json:"name,omitempty"` + ServiceHours *ServiceHours `json:"serviceHours,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SellingTime SellingTime + +// NewSellingTime instantiates a new SellingTime object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSellingTime() *SellingTime { + this := SellingTime{} + return &this +} + +// NewSellingTimeWithDefaults instantiates a new SellingTime object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSellingTimeWithDefaults() *SellingTime { + this := SellingTime{} + return &this +} + +// GetStartTime returns the StartTime field value if set, zero value otherwise. +func (o *SellingTime) GetStartTime() string { + if o == nil || IsNil(o.StartTime) { + var ret string + return ret + } + return *o.StartTime +} + +// GetStartTimeOk returns a tuple with the StartTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SellingTime) GetStartTimeOk() (*string, bool) { + if o == nil || IsNil(o.StartTime) { + return nil, false + } + return o.StartTime, true +} + +// HasStartTime returns a boolean if a field has been set. +func (o *SellingTime) HasStartTime() bool { + if o != nil && !IsNil(o.StartTime) { + return true + } + + return false +} + +// SetStartTime gets a reference to the given string and assigns it to the StartTime field. +func (o *SellingTime) SetStartTime(v string) { + o.StartTime = &v +} + +// GetEndTime returns the EndTime field value if set, zero value otherwise. +func (o *SellingTime) GetEndTime() string { + if o == nil || IsNil(o.EndTime) { + var ret string + return ret + } + return *o.EndTime +} + +// GetEndTimeOk returns a tuple with the EndTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SellingTime) GetEndTimeOk() (*string, bool) { + if o == nil || IsNil(o.EndTime) { + return nil, false + } + return o.EndTime, true +} + +// HasEndTime returns a boolean if a field has been set. +func (o *SellingTime) HasEndTime() bool { + if o != nil && !IsNil(o.EndTime) { + return true + } + + return false +} + +// SetEndTime gets a reference to the given string and assigns it to the EndTime field. +func (o *SellingTime) SetEndTime(v string) { + o.EndTime = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SellingTime) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SellingTime) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SellingTime) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SellingTime) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SellingTime) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SellingTime) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SellingTime) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SellingTime) SetName(v string) { + o.Name = &v +} + +// GetServiceHours returns the ServiceHours field value if set, zero value otherwise. +func (o *SellingTime) GetServiceHours() ServiceHours { + if o == nil || IsNil(o.ServiceHours) { + var ret ServiceHours + return ret + } + return *o.ServiceHours +} + +// GetServiceHoursOk returns a tuple with the ServiceHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SellingTime) GetServiceHoursOk() (*ServiceHours, bool) { + if o == nil || IsNil(o.ServiceHours) { + return nil, false + } + return o.ServiceHours, true +} + +// HasServiceHours returns a boolean if a field has been set. +func (o *SellingTime) HasServiceHours() bool { + if o != nil && !IsNil(o.ServiceHours) { + return true + } + + return false +} + +// SetServiceHours gets a reference to the given ServiceHours and assigns it to the ServiceHours field. +func (o *SellingTime) SetServiceHours(v ServiceHours) { + o.ServiceHours = &v +} + +func (o SellingTime) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SellingTime) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StartTime) { + toSerialize["startTime"] = o.StartTime + } + if !IsNil(o.EndTime) { + toSerialize["endTime"] = o.EndTime + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ServiceHours) { + toSerialize["serviceHours"] = o.ServiceHours + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SellingTime) UnmarshalJSON(data []byte) (err error) { + varSellingTime := _SellingTime{} + + err = json.Unmarshal(data, &varSellingTime) + + if err != nil { + return err + } + + *o = SellingTime(varSellingTime) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startTime") + delete(additionalProperties, "endTime") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "serviceHours") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSellingTime struct { + value *SellingTime + isSet bool +} + +func (v NullableSellingTime) Get() *SellingTime { + return v.value +} + +func (v *NullableSellingTime) Set(val *SellingTime) { + v.value = val + v.isSet = true +} + +func (v NullableSellingTime) IsSet() bool { + return v.isSet +} + +func (v *NullableSellingTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSellingTime(val *SellingTime) *NullableSellingTime { + return &NullableSellingTime{value: val, isSet: true} +} + +func (v NullableSellingTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSellingTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_service_hour.go b/model_service_hour.go new file mode 100644 index 0000000..659fe27 --- /dev/null +++ b/model_service_hour.go @@ -0,0 +1,210 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceHour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceHour{} + +// ServiceHour A JSON object serviceHour for each day. +type ServiceHour struct { + // The period type for when the outlet is open. - OpenPeriod = open only in given periods - OpenAllDay = open 24 hours - CloseAllDay = closed 24 hours + OpenPeriodType string `json:"openPeriodType"` + // An array of open periods. Only required when `openPeriodType` is **OpenPeriod** + Periods []OpenPeriod `json:"periods,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ServiceHour ServiceHour + +// NewServiceHour instantiates a new ServiceHour object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceHour(openPeriodType string) *ServiceHour { + this := ServiceHour{} + this.OpenPeriodType = openPeriodType + return &this +} + +// NewServiceHourWithDefaults instantiates a new ServiceHour object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceHourWithDefaults() *ServiceHour { + this := ServiceHour{} + return &this +} + +// GetOpenPeriodType returns the OpenPeriodType field value +func (o *ServiceHour) GetOpenPeriodType() string { + if o == nil { + var ret string + return ret + } + + return o.OpenPeriodType +} + +// GetOpenPeriodTypeOk returns a tuple with the OpenPeriodType field value +// and a boolean to check if the value has been set. +func (o *ServiceHour) GetOpenPeriodTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OpenPeriodType, true +} + +// SetOpenPeriodType sets field value +func (o *ServiceHour) SetOpenPeriodType(v string) { + o.OpenPeriodType = v +} + +// GetPeriods returns the Periods field value if set, zero value otherwise. +func (o *ServiceHour) GetPeriods() []OpenPeriod { + if o == nil || IsNil(o.Periods) { + var ret []OpenPeriod + return ret + } + return o.Periods +} + +// GetPeriodsOk returns a tuple with the Periods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceHour) GetPeriodsOk() ([]OpenPeriod, bool) { + if o == nil || IsNil(o.Periods) { + return nil, false + } + return o.Periods, true +} + +// HasPeriods returns a boolean if a field has been set. +func (o *ServiceHour) HasPeriods() bool { + if o != nil && !IsNil(o.Periods) { + return true + } + + return false +} + +// SetPeriods gets a reference to the given []OpenPeriod and assigns it to the Periods field. +func (o *ServiceHour) SetPeriods(v []OpenPeriod) { + o.Periods = v +} + +func (o ServiceHour) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceHour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["openPeriodType"] = o.OpenPeriodType + if !IsNil(o.Periods) { + toSerialize["periods"] = o.Periods + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceHour) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "openPeriodType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceHour := _ServiceHour{} + + err = json.Unmarshal(data, &varServiceHour) + + if err != nil { + return err + } + + *o = ServiceHour(varServiceHour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "openPeriodType") + delete(additionalProperties, "periods") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceHour struct { + value *ServiceHour + isSet bool +} + +func (v NullableServiceHour) Get() *ServiceHour { + return v.value +} + +func (v *NullableServiceHour) Set(val *ServiceHour) { + v.value = val + v.isSet = true +} + +func (v NullableServiceHour) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceHour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceHour(val *ServiceHour) *NullableServiceHour { + return &NullableServiceHour{value: val, isSet: true} +} + +func (v NullableServiceHour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceHour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_service_hours.go b/model_service_hours.go new file mode 100644 index 0000000..3a0138b --- /dev/null +++ b/model_service_hours.go @@ -0,0 +1,345 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceHours type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceHours{} + +// ServiceHours A JSON object with serviceHours for each day of the week. +type ServiceHours struct { + Mon ServiceHour `json:"mon"` + Tue ServiceHour `json:"tue"` + Wed ServiceHour `json:"wed"` + Thu ServiceHour `json:"thu"` + Fri ServiceHour `json:"fri"` + Sat ServiceHour `json:"sat"` + Sun ServiceHour `json:"sun"` + AdditionalProperties map[string]interface{} +} + +type _ServiceHours ServiceHours + +// NewServiceHours instantiates a new ServiceHours object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceHours(mon ServiceHour, tue ServiceHour, wed ServiceHour, thu ServiceHour, fri ServiceHour, sat ServiceHour, sun ServiceHour) *ServiceHours { + this := ServiceHours{} + this.Mon = mon + this.Tue = tue + this.Wed = wed + this.Thu = thu + this.Fri = fri + this.Sat = sat + this.Sun = sun + return &this +} + +// NewServiceHoursWithDefaults instantiates a new ServiceHours object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceHoursWithDefaults() *ServiceHours { + this := ServiceHours{} + return &this +} + +// GetMon returns the Mon field value +func (o *ServiceHours) GetMon() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Mon +} + +// GetMonOk returns a tuple with the Mon field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetMonOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Mon, true +} + +// SetMon sets field value +func (o *ServiceHours) SetMon(v ServiceHour) { + o.Mon = v +} + +// GetTue returns the Tue field value +func (o *ServiceHours) GetTue() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Tue +} + +// GetTueOk returns a tuple with the Tue field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetTueOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Tue, true +} + +// SetTue sets field value +func (o *ServiceHours) SetTue(v ServiceHour) { + o.Tue = v +} + +// GetWed returns the Wed field value +func (o *ServiceHours) GetWed() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Wed +} + +// GetWedOk returns a tuple with the Wed field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetWedOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Wed, true +} + +// SetWed sets field value +func (o *ServiceHours) SetWed(v ServiceHour) { + o.Wed = v +} + +// GetThu returns the Thu field value +func (o *ServiceHours) GetThu() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Thu +} + +// GetThuOk returns a tuple with the Thu field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetThuOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Thu, true +} + +// SetThu sets field value +func (o *ServiceHours) SetThu(v ServiceHour) { + o.Thu = v +} + +// GetFri returns the Fri field value +func (o *ServiceHours) GetFri() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Fri +} + +// GetFriOk returns a tuple with the Fri field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetFriOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Fri, true +} + +// SetFri sets field value +func (o *ServiceHours) SetFri(v ServiceHour) { + o.Fri = v +} + +// GetSat returns the Sat field value +func (o *ServiceHours) GetSat() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Sat +} + +// GetSatOk returns a tuple with the Sat field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetSatOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Sat, true +} + +// SetSat sets field value +func (o *ServiceHours) SetSat(v ServiceHour) { + o.Sat = v +} + +// GetSun returns the Sun field value +func (o *ServiceHours) GetSun() ServiceHour { + if o == nil { + var ret ServiceHour + return ret + } + + return o.Sun +} + +// GetSunOk returns a tuple with the Sun field value +// and a boolean to check if the value has been set. +func (o *ServiceHours) GetSunOk() (*ServiceHour, bool) { + if o == nil { + return nil, false + } + return &o.Sun, true +} + +// SetSun sets field value +func (o *ServiceHours) SetSun(v ServiceHour) { + o.Sun = v +} + +func (o ServiceHours) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceHours) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["mon"] = o.Mon + toSerialize["tue"] = o.Tue + toSerialize["wed"] = o.Wed + toSerialize["thu"] = o.Thu + toSerialize["fri"] = o.Fri + toSerialize["sat"] = o.Sat + toSerialize["sun"] = o.Sun + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceHours) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mon", + "tue", + "wed", + "thu", + "fri", + "sat", + "sun", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceHours := _ServiceHours{} + + err = json.Unmarshal(data, &varServiceHours) + + if err != nil { + return err + } + + *o = ServiceHours(varServiceHours) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "mon") + delete(additionalProperties, "tue") + delete(additionalProperties, "wed") + delete(additionalProperties, "thu") + delete(additionalProperties, "fri") + delete(additionalProperties, "sat") + delete(additionalProperties, "sun") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceHours struct { + value *ServiceHours + isSet bool +} + +func (v NullableServiceHours) Get() *ServiceHours { + return v.value +} + +func (v *NullableServiceHours) Set(val *ServiceHours) { + v.value = val + v.isSet = true +} + +func (v NullableServiceHours) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceHours) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceHours(val *ServiceHours) *NullableServiceHours { + return &NullableServiceHours{value: val, isSet: true} +} + +func (v NullableServiceHours) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceHours) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_special_opening_hour.go b/model_special_opening_hour.go new file mode 100644 index 0000000..bd5d2dc --- /dev/null +++ b/model_special_opening_hour.go @@ -0,0 +1,271 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the SpecialOpeningHour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpecialOpeningHour{} + +// SpecialOpeningHour struct for SpecialOpeningHour +type SpecialOpeningHour struct { + // The start date of store special opening hours. + StartDate *string `json:"startDate,omitempty"` + // The end date of store special opening hours. + EndDate *string `json:"endDate,omitempty"` + Metadata *SpecialOpeningHourMetadata `json:"metadata,omitempty"` + OpeningHours *SpecialOpeningHourOpeningHours `json:"openingHours,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpecialOpeningHour SpecialOpeningHour + +// NewSpecialOpeningHour instantiates a new SpecialOpeningHour object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpecialOpeningHour() *SpecialOpeningHour { + this := SpecialOpeningHour{} + return &this +} + +// NewSpecialOpeningHourWithDefaults instantiates a new SpecialOpeningHour object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpecialOpeningHourWithDefaults() *SpecialOpeningHour { + this := SpecialOpeningHour{} + return &this +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *SpecialOpeningHour) GetStartDate() string { + if o == nil || IsNil(o.StartDate) { + var ret string + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHour) GetStartDateOk() (*string, bool) { + if o == nil || IsNil(o.StartDate) { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *SpecialOpeningHour) HasStartDate() bool { + if o != nil && !IsNil(o.StartDate) { + return true + } + + return false +} + +// SetStartDate gets a reference to the given string and assigns it to the StartDate field. +func (o *SpecialOpeningHour) SetStartDate(v string) { + o.StartDate = &v +} + +// GetEndDate returns the EndDate field value if set, zero value otherwise. +func (o *SpecialOpeningHour) GetEndDate() string { + if o == nil || IsNil(o.EndDate) { + var ret string + return ret + } + return *o.EndDate +} + +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHour) GetEndDateOk() (*string, bool) { + if o == nil || IsNil(o.EndDate) { + return nil, false + } + return o.EndDate, true +} + +// HasEndDate returns a boolean if a field has been set. +func (o *SpecialOpeningHour) HasEndDate() bool { + if o != nil && !IsNil(o.EndDate) { + return true + } + + return false +} + +// SetEndDate gets a reference to the given string and assigns it to the EndDate field. +func (o *SpecialOpeningHour) SetEndDate(v string) { + o.EndDate = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SpecialOpeningHour) GetMetadata() SpecialOpeningHourMetadata { + if o == nil || IsNil(o.Metadata) { + var ret SpecialOpeningHourMetadata + return ret + } + return *o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHour) GetMetadataOk() (*SpecialOpeningHourMetadata, bool) { + if o == nil || IsNil(o.Metadata) { + return nil, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SpecialOpeningHour) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given SpecialOpeningHourMetadata and assigns it to the Metadata field. +func (o *SpecialOpeningHour) SetMetadata(v SpecialOpeningHourMetadata) { + o.Metadata = &v +} + +// GetOpeningHours returns the OpeningHours field value if set, zero value otherwise. +func (o *SpecialOpeningHour) GetOpeningHours() SpecialOpeningHourOpeningHours { + if o == nil || IsNil(o.OpeningHours) { + var ret SpecialOpeningHourOpeningHours + return ret + } + return *o.OpeningHours +} + +// GetOpeningHoursOk returns a tuple with the OpeningHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHour) GetOpeningHoursOk() (*SpecialOpeningHourOpeningHours, bool) { + if o == nil || IsNil(o.OpeningHours) { + return nil, false + } + return o.OpeningHours, true +} + +// HasOpeningHours returns a boolean if a field has been set. +func (o *SpecialOpeningHour) HasOpeningHours() bool { + if o != nil && !IsNil(o.OpeningHours) { + return true + } + + return false +} + +// SetOpeningHours gets a reference to the given SpecialOpeningHourOpeningHours and assigns it to the OpeningHours field. +func (o *SpecialOpeningHour) SetOpeningHours(v SpecialOpeningHourOpeningHours) { + o.OpeningHours = &v +} + +func (o SpecialOpeningHour) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpecialOpeningHour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.StartDate) { + toSerialize["startDate"] = o.StartDate + } + if !IsNil(o.EndDate) { + toSerialize["endDate"] = o.EndDate + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.OpeningHours) { + toSerialize["openingHours"] = o.OpeningHours + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpecialOpeningHour) UnmarshalJSON(data []byte) (err error) { + varSpecialOpeningHour := _SpecialOpeningHour{} + + err = json.Unmarshal(data, &varSpecialOpeningHour) + + if err != nil { + return err + } + + *o = SpecialOpeningHour(varSpecialOpeningHour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "startDate") + delete(additionalProperties, "endDate") + delete(additionalProperties, "metadata") + delete(additionalProperties, "openingHours") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpecialOpeningHour struct { + value *SpecialOpeningHour + isSet bool +} + +func (v NullableSpecialOpeningHour) Get() *SpecialOpeningHour { + return v.value +} + +func (v *NullableSpecialOpeningHour) Set(val *SpecialOpeningHour) { + v.value = val + v.isSet = true +} + +func (v NullableSpecialOpeningHour) IsSet() bool { + return v.isSet +} + +func (v *NullableSpecialOpeningHour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpecialOpeningHour(val *SpecialOpeningHour) *NullableSpecialOpeningHour { + return &NullableSpecialOpeningHour{value: val, isSet: true} +} + +func (v NullableSpecialOpeningHour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpecialOpeningHour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_special_opening_hour_metadata.go b/model_special_opening_hour_metadata.go new file mode 100644 index 0000000..a550502 --- /dev/null +++ b/model_special_opening_hour_metadata.go @@ -0,0 +1,159 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the SpecialOpeningHourMetadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpecialOpeningHourMetadata{} + +// SpecialOpeningHourMetadata Contains special opening hour info. +type SpecialOpeningHourMetadata struct { + // Description of the special opening hour. + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpecialOpeningHourMetadata SpecialOpeningHourMetadata + +// NewSpecialOpeningHourMetadata instantiates a new SpecialOpeningHourMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpecialOpeningHourMetadata() *SpecialOpeningHourMetadata { + this := SpecialOpeningHourMetadata{} + return &this +} + +// NewSpecialOpeningHourMetadataWithDefaults instantiates a new SpecialOpeningHourMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpecialOpeningHourMetadataWithDefaults() *SpecialOpeningHourMetadata { + this := SpecialOpeningHourMetadata{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SpecialOpeningHourMetadata) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHourMetadata) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SpecialOpeningHourMetadata) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SpecialOpeningHourMetadata) SetDescription(v string) { + o.Description = &v +} + +func (o SpecialOpeningHourMetadata) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpecialOpeningHourMetadata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpecialOpeningHourMetadata) UnmarshalJSON(data []byte) (err error) { + varSpecialOpeningHourMetadata := _SpecialOpeningHourMetadata{} + + err = json.Unmarshal(data, &varSpecialOpeningHourMetadata) + + if err != nil { + return err + } + + *o = SpecialOpeningHourMetadata(varSpecialOpeningHourMetadata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpecialOpeningHourMetadata struct { + value *SpecialOpeningHourMetadata + isSet bool +} + +func (v NullableSpecialOpeningHourMetadata) Get() *SpecialOpeningHourMetadata { + return v.value +} + +func (v *NullableSpecialOpeningHourMetadata) Set(val *SpecialOpeningHourMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableSpecialOpeningHourMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableSpecialOpeningHourMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpecialOpeningHourMetadata(val *SpecialOpeningHourMetadata) *NullableSpecialOpeningHourMetadata { + return &NullableSpecialOpeningHourMetadata{value: val, isSet: true} +} + +func (v NullableSpecialOpeningHourMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpecialOpeningHourMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_special_opening_hour_opening_hours.go b/model_special_opening_hour_opening_hours.go new file mode 100644 index 0000000..9a2b39d --- /dev/null +++ b/model_special_opening_hour_opening_hours.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the SpecialOpeningHourOpeningHours type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SpecialOpeningHourOpeningHours{} + +// SpecialOpeningHourOpeningHours Store special opening hour period. +type SpecialOpeningHourOpeningHours struct { + // The period type for when the outlet is open. + OpenPeriodType *string `json:"openPeriodType,omitempty"` + // An array of open periods. Maximum of 3 periods. + Periods []OpenPeriod `json:"periods,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SpecialOpeningHourOpeningHours SpecialOpeningHourOpeningHours + +// NewSpecialOpeningHourOpeningHours instantiates a new SpecialOpeningHourOpeningHours object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSpecialOpeningHourOpeningHours() *SpecialOpeningHourOpeningHours { + this := SpecialOpeningHourOpeningHours{} + return &this +} + +// NewSpecialOpeningHourOpeningHoursWithDefaults instantiates a new SpecialOpeningHourOpeningHours object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSpecialOpeningHourOpeningHoursWithDefaults() *SpecialOpeningHourOpeningHours { + this := SpecialOpeningHourOpeningHours{} + return &this +} + +// GetOpenPeriodType returns the OpenPeriodType field value if set, zero value otherwise. +func (o *SpecialOpeningHourOpeningHours) GetOpenPeriodType() string { + if o == nil || IsNil(o.OpenPeriodType) { + var ret string + return ret + } + return *o.OpenPeriodType +} + +// GetOpenPeriodTypeOk returns a tuple with the OpenPeriodType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHourOpeningHours) GetOpenPeriodTypeOk() (*string, bool) { + if o == nil || IsNil(o.OpenPeriodType) { + return nil, false + } + return o.OpenPeriodType, true +} + +// HasOpenPeriodType returns a boolean if a field has been set. +func (o *SpecialOpeningHourOpeningHours) HasOpenPeriodType() bool { + if o != nil && !IsNil(o.OpenPeriodType) { + return true + } + + return false +} + +// SetOpenPeriodType gets a reference to the given string and assigns it to the OpenPeriodType field. +func (o *SpecialOpeningHourOpeningHours) SetOpenPeriodType(v string) { + o.OpenPeriodType = &v +} + +// GetPeriods returns the Periods field value if set, zero value otherwise. +func (o *SpecialOpeningHourOpeningHours) GetPeriods() []OpenPeriod { + if o == nil || IsNil(o.Periods) { + var ret []OpenPeriod + return ret + } + return o.Periods +} + +// GetPeriodsOk returns a tuple with the Periods field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SpecialOpeningHourOpeningHours) GetPeriodsOk() ([]OpenPeriod, bool) { + if o == nil || IsNil(o.Periods) { + return nil, false + } + return o.Periods, true +} + +// HasPeriods returns a boolean if a field has been set. +func (o *SpecialOpeningHourOpeningHours) HasPeriods() bool { + if o != nil && !IsNil(o.Periods) { + return true + } + + return false +} + +// SetPeriods gets a reference to the given []OpenPeriod and assigns it to the Periods field. +func (o *SpecialOpeningHourOpeningHours) SetPeriods(v []OpenPeriod) { + o.Periods = v +} + +func (o SpecialOpeningHourOpeningHours) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SpecialOpeningHourOpeningHours) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.OpenPeriodType) { + toSerialize["openPeriodType"] = o.OpenPeriodType + } + if !IsNil(o.Periods) { + toSerialize["periods"] = o.Periods + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SpecialOpeningHourOpeningHours) UnmarshalJSON(data []byte) (err error) { + varSpecialOpeningHourOpeningHours := _SpecialOpeningHourOpeningHours{} + + err = json.Unmarshal(data, &varSpecialOpeningHourOpeningHours) + + if err != nil { + return err + } + + *o = SpecialOpeningHourOpeningHours(varSpecialOpeningHourOpeningHours) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "openPeriodType") + delete(additionalProperties, "periods") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSpecialOpeningHourOpeningHours struct { + value *SpecialOpeningHourOpeningHours + isSet bool +} + +func (v NullableSpecialOpeningHourOpeningHours) Get() *SpecialOpeningHourOpeningHours { + return v.value +} + +func (v *NullableSpecialOpeningHourOpeningHours) Set(val *SpecialOpeningHourOpeningHours) { + v.value = val + v.isSet = true +} + +func (v NullableSpecialOpeningHourOpeningHours) IsSet() bool { + return v.isSet +} + +func (v *NullableSpecialOpeningHourOpeningHours) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSpecialOpeningHourOpeningHours(val *SpecialOpeningHourOpeningHours) *NullableSpecialOpeningHourOpeningHours { + return &NullableSpecialOpeningHourOpeningHours{value: val, isSet: true} +} + +func (v NullableSpecialOpeningHourOpeningHours) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSpecialOpeningHourOpeningHours) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_store_hour.go b/model_store_hour.go new file mode 100644 index 0000000..19a2239 --- /dev/null +++ b/model_store_hour.go @@ -0,0 +1,352 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the StoreHour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StoreHour{} + +// StoreHour A JSON object that describes the store hour for each day. +type StoreHour struct { + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Mon []OpenPeriod `json:"mon"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Tue []OpenPeriod `json:"tue"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Wed []OpenPeriod `json:"wed"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Thu []OpenPeriod `json:"thu"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Fri []OpenPeriod `json:"fri"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Sat []OpenPeriod `json:"sat"` + // An array of open periods. Maximum of 3 periods. Blank indicates store close. + Sun []OpenPeriod `json:"sun"` + AdditionalProperties map[string]interface{} +} + +type _StoreHour StoreHour + +// NewStoreHour instantiates a new StoreHour object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStoreHour(mon []OpenPeriod, tue []OpenPeriod, wed []OpenPeriod, thu []OpenPeriod, fri []OpenPeriod, sat []OpenPeriod, sun []OpenPeriod) *StoreHour { + this := StoreHour{} + this.Mon = mon + this.Tue = tue + this.Wed = wed + this.Thu = thu + this.Fri = fri + this.Sat = sat + this.Sun = sun + return &this +} + +// NewStoreHourWithDefaults instantiates a new StoreHour object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStoreHourWithDefaults() *StoreHour { + this := StoreHour{} + return &this +} + +// GetMon returns the Mon field value +func (o *StoreHour) GetMon() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Mon +} + +// GetMonOk returns a tuple with the Mon field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetMonOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Mon, true +} + +// SetMon sets field value +func (o *StoreHour) SetMon(v []OpenPeriod) { + o.Mon = v +} + +// GetTue returns the Tue field value +func (o *StoreHour) GetTue() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Tue +} + +// GetTueOk returns a tuple with the Tue field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetTueOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Tue, true +} + +// SetTue sets field value +func (o *StoreHour) SetTue(v []OpenPeriod) { + o.Tue = v +} + +// GetWed returns the Wed field value +func (o *StoreHour) GetWed() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Wed +} + +// GetWedOk returns a tuple with the Wed field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetWedOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Wed, true +} + +// SetWed sets field value +func (o *StoreHour) SetWed(v []OpenPeriod) { + o.Wed = v +} + +// GetThu returns the Thu field value +func (o *StoreHour) GetThu() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Thu +} + +// GetThuOk returns a tuple with the Thu field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetThuOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Thu, true +} + +// SetThu sets field value +func (o *StoreHour) SetThu(v []OpenPeriod) { + o.Thu = v +} + +// GetFri returns the Fri field value +func (o *StoreHour) GetFri() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Fri +} + +// GetFriOk returns a tuple with the Fri field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetFriOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Fri, true +} + +// SetFri sets field value +func (o *StoreHour) SetFri(v []OpenPeriod) { + o.Fri = v +} + +// GetSat returns the Sat field value +func (o *StoreHour) GetSat() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Sat +} + +// GetSatOk returns a tuple with the Sat field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetSatOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Sat, true +} + +// SetSat sets field value +func (o *StoreHour) SetSat(v []OpenPeriod) { + o.Sat = v +} + +// GetSun returns the Sun field value +func (o *StoreHour) GetSun() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + + return o.Sun +} + +// GetSunOk returns a tuple with the Sun field value +// and a boolean to check if the value has been set. +func (o *StoreHour) GetSunOk() ([]OpenPeriod, bool) { + if o == nil { + return nil, false + } + return o.Sun, true +} + +// SetSun sets field value +func (o *StoreHour) SetSun(v []OpenPeriod) { + o.Sun = v +} + +func (o StoreHour) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StoreHour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["mon"] = o.Mon + toSerialize["tue"] = o.Tue + toSerialize["wed"] = o.Wed + toSerialize["thu"] = o.Thu + toSerialize["fri"] = o.Fri + toSerialize["sat"] = o.Sat + toSerialize["sun"] = o.Sun + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StoreHour) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mon", + "tue", + "wed", + "thu", + "fri", + "sat", + "sun", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStoreHour := _StoreHour{} + + err = json.Unmarshal(data, &varStoreHour) + + if err != nil { + return err + } + + *o = StoreHour(varStoreHour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "mon") + delete(additionalProperties, "tue") + delete(additionalProperties, "wed") + delete(additionalProperties, "thu") + delete(additionalProperties, "fri") + delete(additionalProperties, "sat") + delete(additionalProperties, "sun") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStoreHour struct { + value *StoreHour + isSet bool +} + +func (v NullableStoreHour) Get() *StoreHour { + return v.value +} + +func (v *NullableStoreHour) Set(val *StoreHour) { + v.value = val + v.isSet = true +} + +func (v NullableStoreHour) IsSet() bool { + return v.isSet +} + +func (v *NullableStoreHour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStoreHour(val *StoreHour) *NullableStoreHour { + return &NullableStoreHour{value: val, isSet: true} +} + +func (v NullableStoreHour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStoreHour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_store_hour_response.go b/model_store_hour_response.go new file mode 100644 index 0000000..0314829 --- /dev/null +++ b/model_store_hour_response.go @@ -0,0 +1,233 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the StoreHourResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StoreHourResponse{} + +// StoreHourResponse Object contain store hour info +type StoreHourResponse struct { + DineInHour *StoreHour `json:"dineInHour,omitempty"` + OpeningHour *StoreHour `json:"openingHour,omitempty"` + // The store's special opening hours. + SpecialOpeningHours []SpecialOpeningHour `json:"specialOpeningHours,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _StoreHourResponse StoreHourResponse + +// NewStoreHourResponse instantiates a new StoreHourResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStoreHourResponse() *StoreHourResponse { + this := StoreHourResponse{} + return &this +} + +// NewStoreHourResponseWithDefaults instantiates a new StoreHourResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStoreHourResponseWithDefaults() *StoreHourResponse { + this := StoreHourResponse{} + return &this +} + +// GetDineInHour returns the DineInHour field value if set, zero value otherwise. +func (o *StoreHourResponse) GetDineInHour() StoreHour { + if o == nil || IsNil(o.DineInHour) { + var ret StoreHour + return ret + } + return *o.DineInHour +} + +// GetDineInHourOk returns a tuple with the DineInHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreHourResponse) GetDineInHourOk() (*StoreHour, bool) { + if o == nil || IsNil(o.DineInHour) { + return nil, false + } + return o.DineInHour, true +} + +// HasDineInHour returns a boolean if a field has been set. +func (o *StoreHourResponse) HasDineInHour() bool { + if o != nil && !IsNil(o.DineInHour) { + return true + } + + return false +} + +// SetDineInHour gets a reference to the given StoreHour and assigns it to the DineInHour field. +func (o *StoreHourResponse) SetDineInHour(v StoreHour) { + o.DineInHour = &v +} + +// GetOpeningHour returns the OpeningHour field value if set, zero value otherwise. +func (o *StoreHourResponse) GetOpeningHour() StoreHour { + if o == nil || IsNil(o.OpeningHour) { + var ret StoreHour + return ret + } + return *o.OpeningHour +} + +// GetOpeningHourOk returns a tuple with the OpeningHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreHourResponse) GetOpeningHourOk() (*StoreHour, bool) { + if o == nil || IsNil(o.OpeningHour) { + return nil, false + } + return o.OpeningHour, true +} + +// HasOpeningHour returns a boolean if a field has been set. +func (o *StoreHourResponse) HasOpeningHour() bool { + if o != nil && !IsNil(o.OpeningHour) { + return true + } + + return false +} + +// SetOpeningHour gets a reference to the given StoreHour and assigns it to the OpeningHour field. +func (o *StoreHourResponse) SetOpeningHour(v StoreHour) { + o.OpeningHour = &v +} + +// GetSpecialOpeningHours returns the SpecialOpeningHours field value if set, zero value otherwise. +func (o *StoreHourResponse) GetSpecialOpeningHours() []SpecialOpeningHour { + if o == nil || IsNil(o.SpecialOpeningHours) { + var ret []SpecialOpeningHour + return ret + } + return o.SpecialOpeningHours +} + +// GetSpecialOpeningHoursOk returns a tuple with the SpecialOpeningHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *StoreHourResponse) GetSpecialOpeningHoursOk() ([]SpecialOpeningHour, bool) { + if o == nil || IsNil(o.SpecialOpeningHours) { + return nil, false + } + return o.SpecialOpeningHours, true +} + +// HasSpecialOpeningHours returns a boolean if a field has been set. +func (o *StoreHourResponse) HasSpecialOpeningHours() bool { + if o != nil && !IsNil(o.SpecialOpeningHours) { + return true + } + + return false +} + +// SetSpecialOpeningHours gets a reference to the given []SpecialOpeningHour and assigns it to the SpecialOpeningHours field. +func (o *StoreHourResponse) SetSpecialOpeningHours(v []SpecialOpeningHour) { + o.SpecialOpeningHours = v +} + +func (o StoreHourResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StoreHourResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DineInHour) { + toSerialize["dineInHour"] = o.DineInHour + } + if !IsNil(o.OpeningHour) { + toSerialize["openingHour"] = o.OpeningHour + } + if !IsNil(o.SpecialOpeningHours) { + toSerialize["specialOpeningHours"] = o.SpecialOpeningHours + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StoreHourResponse) UnmarshalJSON(data []byte) (err error) { + varStoreHourResponse := _StoreHourResponse{} + + err = json.Unmarshal(data, &varStoreHourResponse) + + if err != nil { + return err + } + + *o = StoreHourResponse(varStoreHourResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "dineInHour") + delete(additionalProperties, "openingHour") + delete(additionalProperties, "specialOpeningHours") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStoreHourResponse struct { + value *StoreHourResponse + isSet bool +} + +func (v NullableStoreHourResponse) Get() *StoreHourResponse { + return v.value +} + +func (v *NullableStoreHourResponse) Set(val *StoreHourResponse) { + v.value = val + v.isSet = true +} + +func (v NullableStoreHourResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableStoreHourResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStoreHourResponse(val *StoreHourResponse) *NullableStoreHourResponse { + return &NullableStoreHourResponse{value: val, isSet: true} +} + +func (v NullableStoreHourResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStoreHourResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_store_status_response.go b/model_store_status_response.go new file mode 100644 index 0000000..2ec1c64 --- /dev/null +++ b/model_store_status_response.go @@ -0,0 +1,232 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the StoreStatusResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StoreStatusResponse{} + +// StoreStatusResponse Object contains store status info +type StoreStatusResponse struct { + // The code of store close reason. Blank indicates store is currently open. + CloseReason string `json:"closeReason"` + // Indicate whether the store is in special opening hour range. + IsInSpecialOpeningHourRange bool `json:"isInSpecialOpeningHourRange"` + // Indicate whether the store is open. + IsOpen bool `json:"isOpen"` + AdditionalProperties map[string]interface{} +} + +type _StoreStatusResponse StoreStatusResponse + +// NewStoreStatusResponse instantiates a new StoreStatusResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStoreStatusResponse(closeReason string, isInSpecialOpeningHourRange bool, isOpen bool) *StoreStatusResponse { + this := StoreStatusResponse{} + this.CloseReason = closeReason + this.IsInSpecialOpeningHourRange = isInSpecialOpeningHourRange + this.IsOpen = isOpen + return &this +} + +// NewStoreStatusResponseWithDefaults instantiates a new StoreStatusResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStoreStatusResponseWithDefaults() *StoreStatusResponse { + this := StoreStatusResponse{} + return &this +} + +// GetCloseReason returns the CloseReason field value +func (o *StoreStatusResponse) GetCloseReason() string { + if o == nil { + var ret string + return ret + } + + return o.CloseReason +} + +// GetCloseReasonOk returns a tuple with the CloseReason field value +// and a boolean to check if the value has been set. +func (o *StoreStatusResponse) GetCloseReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CloseReason, true +} + +// SetCloseReason sets field value +func (o *StoreStatusResponse) SetCloseReason(v string) { + o.CloseReason = v +} + +// GetIsInSpecialOpeningHourRange returns the IsInSpecialOpeningHourRange field value +func (o *StoreStatusResponse) GetIsInSpecialOpeningHourRange() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsInSpecialOpeningHourRange +} + +// GetIsInSpecialOpeningHourRangeOk returns a tuple with the IsInSpecialOpeningHourRange field value +// and a boolean to check if the value has been set. +func (o *StoreStatusResponse) GetIsInSpecialOpeningHourRangeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsInSpecialOpeningHourRange, true +} + +// SetIsInSpecialOpeningHourRange sets field value +func (o *StoreStatusResponse) SetIsInSpecialOpeningHourRange(v bool) { + o.IsInSpecialOpeningHourRange = v +} + +// GetIsOpen returns the IsOpen field value +func (o *StoreStatusResponse) GetIsOpen() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsOpen +} + +// GetIsOpenOk returns a tuple with the IsOpen field value +// and a boolean to check if the value has been set. +func (o *StoreStatusResponse) GetIsOpenOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsOpen, true +} + +// SetIsOpen sets field value +func (o *StoreStatusResponse) SetIsOpen(v bool) { + o.IsOpen = v +} + +func (o StoreStatusResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StoreStatusResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["closeReason"] = o.CloseReason + toSerialize["isInSpecialOpeningHourRange"] = o.IsInSpecialOpeningHourRange + toSerialize["isOpen"] = o.IsOpen + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StoreStatusResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "closeReason", + "isInSpecialOpeningHourRange", + "isOpen", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStoreStatusResponse := _StoreStatusResponse{} + + err = json.Unmarshal(data, &varStoreStatusResponse) + + if err != nil { + return err + } + + *o = StoreStatusResponse(varStoreStatusResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "closeReason") + delete(additionalProperties, "isInSpecialOpeningHourRange") + delete(additionalProperties, "isOpen") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStoreStatusResponse struct { + value *StoreStatusResponse + isSet bool +} + +func (v NullableStoreStatusResponse) Get() *StoreStatusResponse { + return v.value +} + +func (v *NullableStoreStatusResponse) Set(val *StoreStatusResponse) { + v.value = val + v.isSet = true +} + +func (v NullableStoreStatusResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableStoreStatusResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStoreStatusResponse(val *StoreStatusResponse) *NullableStoreStatusResponse { + return &NullableStoreStatusResponse{value: val, isSet: true} +} + +func (v NullableStoreStatusResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStoreStatusResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_submit_order_request.go b/model_submit_order_request.go new file mode 100644 index 0000000..f9e8aae --- /dev/null +++ b/model_submit_order_request.go @@ -0,0 +1,856 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "time" + "fmt" +) + +// checks if the SubmitOrderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SubmitOrderRequest{} + +// SubmitOrderRequest A JSON object containing the order information. +type SubmitOrderRequest struct { + // The order's ID that is returned from GrabFood. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + OrderID string `json:"orderID"` + // The GrabFood short order number. This is unique for each merchant per day. Refer to FAQs for more details about [orderID and shortOrderNumber](#section/Order/What's-the-difference-between-orderID-and-shortOrderNumber). + ShortOrderNumber string `json:"shortOrderNumber"` + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The merchant's ID that is on the partner's database. + PartnerMerchantID *string `json:"partnerMerchantID,omitempty"` + // The payment method used. Refer to FAQs for more details about [paymentType](#section/Order/Does-the-paymentType-affect-partners). + PaymentType string `json:"paymentType"` + // The boolean value to indicate whether cutlery are needed or not. Refer to FAQs for more details about [cutlery](#section/Order/What-do-the-true-or-false-values-mean-for-cutlery). + Cutlery bool `json:"cutlery"` + // The UTC time that a consumer places the order, based on ISO_8601/RFC3339. + OrderTime string `json:"orderTime"` + // The order submit time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. + SubmitTime *time.Time `json:"submitTime,omitempty"` + // The order complete time, based on ISO_8601/RFC3339. Only present in the [List Orders](#tag/list-order) response. + CompleteTime *time.Time `json:"completeTime,omitempty"` + // The order scheduled time, based on ISO_8601/RFC3339. Empty for non-scheduled orders. + ScheduledTime *string `json:"scheduledTime,omitempty"` + // The state of the order. Only present in the [List Orders](#tag/list-order) response. Refer to [Order States](#section/Order-states). + OrderState *string `json:"orderState,omitempty"` + Currency Currency `json:"currency"` + FeatureFlags OrderFeatureFlags `json:"featureFlags"` + // The items in an array of JSON Object. Refer to [Items](#items) for more information. + Items []OrderItem `json:"items"` + // The campaigns that are applicable for the order.`null` when there is no campaign applied. + Campaigns []OrderCampaign `json:"campaigns,omitempty"` + // An array of promotion objects. Only promotions that are funded by merchants will be sent. + Promos []OrderPromo `json:"promos,omitempty"` + Price OrderPrice `json:"price"` + DineIn *DineIn `json:"dineIn,omitempty"` + Receiver *Receiver `json:"receiver,omitempty"` + OrderReadyEstimation *OrderReadyEstimation `json:"orderReadyEstimation,omitempty"` + // Membership ID for loyalty project. Only present for loyalty program partners. + MembershipID *string `json:"membershipID,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SubmitOrderRequest SubmitOrderRequest + +// NewSubmitOrderRequest instantiates a new SubmitOrderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSubmitOrderRequest(orderID string, shortOrderNumber string, merchantID string, paymentType string, cutlery bool, orderTime string, currency Currency, featureFlags OrderFeatureFlags, items []OrderItem, price OrderPrice) *SubmitOrderRequest { + this := SubmitOrderRequest{} + this.OrderID = orderID + this.ShortOrderNumber = shortOrderNumber + this.MerchantID = merchantID + this.PaymentType = paymentType + this.Cutlery = cutlery + this.OrderTime = orderTime + this.Currency = currency + this.FeatureFlags = featureFlags + this.Items = items + this.Price = price + return &this +} + +// NewSubmitOrderRequestWithDefaults instantiates a new SubmitOrderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSubmitOrderRequestWithDefaults() *SubmitOrderRequest { + this := SubmitOrderRequest{} + return &this +} + +// GetOrderID returns the OrderID field value +func (o *SubmitOrderRequest) GetOrderID() string { + if o == nil { + var ret string + return ret + } + + return o.OrderID +} + +// GetOrderIDOk returns a tuple with the OrderID field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetOrderIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderID, true +} + +// SetOrderID sets field value +func (o *SubmitOrderRequest) SetOrderID(v string) { + o.OrderID = v +} + +// GetShortOrderNumber returns the ShortOrderNumber field value +func (o *SubmitOrderRequest) GetShortOrderNumber() string { + if o == nil { + var ret string + return ret + } + + return o.ShortOrderNumber +} + +// GetShortOrderNumberOk returns a tuple with the ShortOrderNumber field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetShortOrderNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortOrderNumber, true +} + +// SetShortOrderNumber sets field value +func (o *SubmitOrderRequest) SetShortOrderNumber(v string) { + o.ShortOrderNumber = v +} + +// GetMerchantID returns the MerchantID field value +func (o *SubmitOrderRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *SubmitOrderRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetPartnerMerchantID returns the PartnerMerchantID field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetPartnerMerchantID() string { + if o == nil || IsNil(o.PartnerMerchantID) { + var ret string + return ret + } + return *o.PartnerMerchantID +} + +// GetPartnerMerchantIDOk returns a tuple with the PartnerMerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetPartnerMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.PartnerMerchantID) { + return nil, false + } + return o.PartnerMerchantID, true +} + +// HasPartnerMerchantID returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasPartnerMerchantID() bool { + if o != nil && !IsNil(o.PartnerMerchantID) { + return true + } + + return false +} + +// SetPartnerMerchantID gets a reference to the given string and assigns it to the PartnerMerchantID field. +func (o *SubmitOrderRequest) SetPartnerMerchantID(v string) { + o.PartnerMerchantID = &v +} + +// GetPaymentType returns the PaymentType field value +func (o *SubmitOrderRequest) GetPaymentType() string { + if o == nil { + var ret string + return ret + } + + return o.PaymentType +} + +// GetPaymentTypeOk returns a tuple with the PaymentType field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetPaymentTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PaymentType, true +} + +// SetPaymentType sets field value +func (o *SubmitOrderRequest) SetPaymentType(v string) { + o.PaymentType = v +} + +// GetCutlery returns the Cutlery field value +func (o *SubmitOrderRequest) GetCutlery() bool { + if o == nil { + var ret bool + return ret + } + + return o.Cutlery +} + +// GetCutleryOk returns a tuple with the Cutlery field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetCutleryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Cutlery, true +} + +// SetCutlery sets field value +func (o *SubmitOrderRequest) SetCutlery(v bool) { + o.Cutlery = v +} + +// GetOrderTime returns the OrderTime field value +func (o *SubmitOrderRequest) GetOrderTime() string { + if o == nil { + var ret string + return ret + } + + return o.OrderTime +} + +// GetOrderTimeOk returns a tuple with the OrderTime field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetOrderTimeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OrderTime, true +} + +// SetOrderTime sets field value +func (o *SubmitOrderRequest) SetOrderTime(v string) { + o.OrderTime = v +} + +// GetSubmitTime returns the SubmitTime field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetSubmitTime() time.Time { + if o == nil || IsNil(o.SubmitTime) { + var ret time.Time + return ret + } + return *o.SubmitTime +} + +// GetSubmitTimeOk returns a tuple with the SubmitTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetSubmitTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.SubmitTime) { + return nil, false + } + return o.SubmitTime, true +} + +// HasSubmitTime returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasSubmitTime() bool { + if o != nil && !IsNil(o.SubmitTime) { + return true + } + + return false +} + +// SetSubmitTime gets a reference to the given time.Time and assigns it to the SubmitTime field. +func (o *SubmitOrderRequest) SetSubmitTime(v time.Time) { + o.SubmitTime = &v +} + +// GetCompleteTime returns the CompleteTime field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetCompleteTime() time.Time { + if o == nil || IsNil(o.CompleteTime) { + var ret time.Time + return ret + } + return *o.CompleteTime +} + +// GetCompleteTimeOk returns a tuple with the CompleteTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetCompleteTimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.CompleteTime) { + return nil, false + } + return o.CompleteTime, true +} + +// HasCompleteTime returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasCompleteTime() bool { + if o != nil && !IsNil(o.CompleteTime) { + return true + } + + return false +} + +// SetCompleteTime gets a reference to the given time.Time and assigns it to the CompleteTime field. +func (o *SubmitOrderRequest) SetCompleteTime(v time.Time) { + o.CompleteTime = &v +} + +// GetScheduledTime returns the ScheduledTime field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetScheduledTime() string { + if o == nil || IsNil(o.ScheduledTime) { + var ret string + return ret + } + return *o.ScheduledTime +} + +// GetScheduledTimeOk returns a tuple with the ScheduledTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetScheduledTimeOk() (*string, bool) { + if o == nil || IsNil(o.ScheduledTime) { + return nil, false + } + return o.ScheduledTime, true +} + +// HasScheduledTime returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasScheduledTime() bool { + if o != nil && !IsNil(o.ScheduledTime) { + return true + } + + return false +} + +// SetScheduledTime gets a reference to the given string and assigns it to the ScheduledTime field. +func (o *SubmitOrderRequest) SetScheduledTime(v string) { + o.ScheduledTime = &v +} + +// GetOrderState returns the OrderState field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetOrderState() string { + if o == nil || IsNil(o.OrderState) { + var ret string + return ret + } + return *o.OrderState +} + +// GetOrderStateOk returns a tuple with the OrderState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetOrderStateOk() (*string, bool) { + if o == nil || IsNil(o.OrderState) { + return nil, false + } + return o.OrderState, true +} + +// HasOrderState returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasOrderState() bool { + if o != nil && !IsNil(o.OrderState) { + return true + } + + return false +} + +// SetOrderState gets a reference to the given string and assigns it to the OrderState field. +func (o *SubmitOrderRequest) SetOrderState(v string) { + o.OrderState = &v +} + +// GetCurrency returns the Currency field value +func (o *SubmitOrderRequest) GetCurrency() Currency { + if o == nil { + var ret Currency + return ret + } + + return o.Currency +} + +// GetCurrencyOk returns a tuple with the Currency field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetCurrencyOk() (*Currency, bool) { + if o == nil { + return nil, false + } + return &o.Currency, true +} + +// SetCurrency sets field value +func (o *SubmitOrderRequest) SetCurrency(v Currency) { + o.Currency = v +} + +// GetFeatureFlags returns the FeatureFlags field value +func (o *SubmitOrderRequest) GetFeatureFlags() OrderFeatureFlags { + if o == nil { + var ret OrderFeatureFlags + return ret + } + + return o.FeatureFlags +} + +// GetFeatureFlagsOk returns a tuple with the FeatureFlags field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetFeatureFlagsOk() (*OrderFeatureFlags, bool) { + if o == nil { + return nil, false + } + return &o.FeatureFlags, true +} + +// SetFeatureFlags sets field value +func (o *SubmitOrderRequest) SetFeatureFlags(v OrderFeatureFlags) { + o.FeatureFlags = v +} + +// GetItems returns the Items field value +func (o *SubmitOrderRequest) GetItems() []OrderItem { + if o == nil { + var ret []OrderItem + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetItemsOk() ([]OrderItem, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SubmitOrderRequest) SetItems(v []OrderItem) { + o.Items = v +} + +// GetCampaigns returns the Campaigns field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SubmitOrderRequest) GetCampaigns() []OrderCampaign { + if o == nil { + var ret []OrderCampaign + return ret + } + return o.Campaigns +} + +// GetCampaignsOk returns a tuple with the Campaigns field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SubmitOrderRequest) GetCampaignsOk() ([]OrderCampaign, bool) { + if o == nil || IsNil(o.Campaigns) { + return nil, false + } + return o.Campaigns, true +} + +// HasCampaigns returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasCampaigns() bool { + if o != nil && !IsNil(o.Campaigns) { + return true + } + + return false +} + +// SetCampaigns gets a reference to the given []OrderCampaign and assigns it to the Campaigns field. +func (o *SubmitOrderRequest) SetCampaigns(v []OrderCampaign) { + o.Campaigns = v +} + +// GetPromos returns the Promos field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetPromos() []OrderPromo { + if o == nil || IsNil(o.Promos) { + var ret []OrderPromo + return ret + } + return o.Promos +} + +// GetPromosOk returns a tuple with the Promos field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetPromosOk() ([]OrderPromo, bool) { + if o == nil || IsNil(o.Promos) { + return nil, false + } + return o.Promos, true +} + +// HasPromos returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasPromos() bool { + if o != nil && !IsNil(o.Promos) { + return true + } + + return false +} + +// SetPromos gets a reference to the given []OrderPromo and assigns it to the Promos field. +func (o *SubmitOrderRequest) SetPromos(v []OrderPromo) { + o.Promos = v +} + +// GetPrice returns the Price field value +func (o *SubmitOrderRequest) GetPrice() OrderPrice { + if o == nil { + var ret OrderPrice + return ret + } + + return o.Price +} + +// GetPriceOk returns a tuple with the Price field value +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetPriceOk() (*OrderPrice, bool) { + if o == nil { + return nil, false + } + return &o.Price, true +} + +// SetPrice sets field value +func (o *SubmitOrderRequest) SetPrice(v OrderPrice) { + o.Price = v +} + +// GetDineIn returns the DineIn field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetDineIn() DineIn { + if o == nil || IsNil(o.DineIn) { + var ret DineIn + return ret + } + return *o.DineIn +} + +// GetDineInOk returns a tuple with the DineIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetDineInOk() (*DineIn, bool) { + if o == nil || IsNil(o.DineIn) { + return nil, false + } + return o.DineIn, true +} + +// HasDineIn returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasDineIn() bool { + if o != nil && !IsNil(o.DineIn) { + return true + } + + return false +} + +// SetDineIn gets a reference to the given DineIn and assigns it to the DineIn field. +func (o *SubmitOrderRequest) SetDineIn(v DineIn) { + o.DineIn = &v +} + +// GetReceiver returns the Receiver field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetReceiver() Receiver { + if o == nil || IsNil(o.Receiver) { + var ret Receiver + return ret + } + return *o.Receiver +} + +// GetReceiverOk returns a tuple with the Receiver field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetReceiverOk() (*Receiver, bool) { + if o == nil || IsNil(o.Receiver) { + return nil, false + } + return o.Receiver, true +} + +// HasReceiver returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasReceiver() bool { + if o != nil && !IsNil(o.Receiver) { + return true + } + + return false +} + +// SetReceiver gets a reference to the given Receiver and assigns it to the Receiver field. +func (o *SubmitOrderRequest) SetReceiver(v Receiver) { + o.Receiver = &v +} + +// GetOrderReadyEstimation returns the OrderReadyEstimation field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetOrderReadyEstimation() OrderReadyEstimation { + if o == nil || IsNil(o.OrderReadyEstimation) { + var ret OrderReadyEstimation + return ret + } + return *o.OrderReadyEstimation +} + +// GetOrderReadyEstimationOk returns a tuple with the OrderReadyEstimation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetOrderReadyEstimationOk() (*OrderReadyEstimation, bool) { + if o == nil || IsNil(o.OrderReadyEstimation) { + return nil, false + } + return o.OrderReadyEstimation, true +} + +// HasOrderReadyEstimation returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasOrderReadyEstimation() bool { + if o != nil && !IsNil(o.OrderReadyEstimation) { + return true + } + + return false +} + +// SetOrderReadyEstimation gets a reference to the given OrderReadyEstimation and assigns it to the OrderReadyEstimation field. +func (o *SubmitOrderRequest) SetOrderReadyEstimation(v OrderReadyEstimation) { + o.OrderReadyEstimation = &v +} + +// GetMembershipID returns the MembershipID field value if set, zero value otherwise. +func (o *SubmitOrderRequest) GetMembershipID() string { + if o == nil || IsNil(o.MembershipID) { + var ret string + return ret + } + return *o.MembershipID +} + +// GetMembershipIDOk returns a tuple with the MembershipID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SubmitOrderRequest) GetMembershipIDOk() (*string, bool) { + if o == nil || IsNil(o.MembershipID) { + return nil, false + } + return o.MembershipID, true +} + +// HasMembershipID returns a boolean if a field has been set. +func (o *SubmitOrderRequest) HasMembershipID() bool { + if o != nil && !IsNil(o.MembershipID) { + return true + } + + return false +} + +// SetMembershipID gets a reference to the given string and assigns it to the MembershipID field. +func (o *SubmitOrderRequest) SetMembershipID(v string) { + o.MembershipID = &v +} + +func (o SubmitOrderRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SubmitOrderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["orderID"] = o.OrderID + toSerialize["shortOrderNumber"] = o.ShortOrderNumber + toSerialize["merchantID"] = o.MerchantID + if !IsNil(o.PartnerMerchantID) { + toSerialize["partnerMerchantID"] = o.PartnerMerchantID + } + toSerialize["paymentType"] = o.PaymentType + toSerialize["cutlery"] = o.Cutlery + toSerialize["orderTime"] = o.OrderTime + if !IsNil(o.SubmitTime) { + toSerialize["submitTime"] = o.SubmitTime + } + if !IsNil(o.CompleteTime) { + toSerialize["completeTime"] = o.CompleteTime + } + if !IsNil(o.ScheduledTime) { + toSerialize["scheduledTime"] = o.ScheduledTime + } + if !IsNil(o.OrderState) { + toSerialize["orderState"] = o.OrderState + } + toSerialize["currency"] = o.Currency + toSerialize["featureFlags"] = o.FeatureFlags + toSerialize["items"] = o.Items + if o.Campaigns != nil { + toSerialize["campaigns"] = o.Campaigns + } + if !IsNil(o.Promos) { + toSerialize["promos"] = o.Promos + } + toSerialize["price"] = o.Price + if !IsNil(o.DineIn) { + toSerialize["dineIn"] = o.DineIn + } + if !IsNil(o.Receiver) { + toSerialize["receiver"] = o.Receiver + } + if !IsNil(o.OrderReadyEstimation) { + toSerialize["orderReadyEstimation"] = o.OrderReadyEstimation + } + if !IsNil(o.MembershipID) { + toSerialize["membershipID"] = o.MembershipID + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SubmitOrderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderID", + "shortOrderNumber", + "merchantID", + "paymentType", + "cutlery", + "orderTime", + "currency", + "featureFlags", + "items", + "price", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSubmitOrderRequest := _SubmitOrderRequest{} + + err = json.Unmarshal(data, &varSubmitOrderRequest) + + if err != nil { + return err + } + + *o = SubmitOrderRequest(varSubmitOrderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "orderID") + delete(additionalProperties, "shortOrderNumber") + delete(additionalProperties, "merchantID") + delete(additionalProperties, "partnerMerchantID") + delete(additionalProperties, "paymentType") + delete(additionalProperties, "cutlery") + delete(additionalProperties, "orderTime") + delete(additionalProperties, "submitTime") + delete(additionalProperties, "completeTime") + delete(additionalProperties, "scheduledTime") + delete(additionalProperties, "orderState") + delete(additionalProperties, "currency") + delete(additionalProperties, "featureFlags") + delete(additionalProperties, "items") + delete(additionalProperties, "campaigns") + delete(additionalProperties, "promos") + delete(additionalProperties, "price") + delete(additionalProperties, "dineIn") + delete(additionalProperties, "receiver") + delete(additionalProperties, "orderReadyEstimation") + delete(additionalProperties, "membershipID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSubmitOrderRequest struct { + value *SubmitOrderRequest + isSet bool +} + +func (v NullableSubmitOrderRequest) Get() *SubmitOrderRequest { + return v.value +} + +func (v *NullableSubmitOrderRequest) Set(val *SubmitOrderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSubmitOrderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSubmitOrderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubmitOrderRequest(val *SubmitOrderRequest) *NullableSubmitOrderRequest { + return &NullableSubmitOrderRequest{value: val, isSet: true} +} + +func (v NullableSubmitOrderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubmitOrderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_unbind_membership_native_request.go b/model_unbind_membership_native_request.go new file mode 100644 index 0000000..f8e4e81 --- /dev/null +++ b/model_unbind_membership_native_request.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UnbindMembershipNativeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnbindMembershipNativeRequest{} + +// UnbindMembershipNativeRequest This request submits membership unbind request to partner. +type UnbindMembershipNativeRequest struct { + // The unique member ID on the partner's database. + MemberID string `json:"memberID"` + AdditionalProperties map[string]interface{} +} + +type _UnbindMembershipNativeRequest UnbindMembershipNativeRequest + +// NewUnbindMembershipNativeRequest instantiates a new UnbindMembershipNativeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnbindMembershipNativeRequest(memberID string) *UnbindMembershipNativeRequest { + this := UnbindMembershipNativeRequest{} + this.MemberID = memberID + return &this +} + +// NewUnbindMembershipNativeRequestWithDefaults instantiates a new UnbindMembershipNativeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnbindMembershipNativeRequestWithDefaults() *UnbindMembershipNativeRequest { + this := UnbindMembershipNativeRequest{} + return &this +} + +// GetMemberID returns the MemberID field value +func (o *UnbindMembershipNativeRequest) GetMemberID() string { + if o == nil { + var ret string + return ret + } + + return o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value +// and a boolean to check if the value has been set. +func (o *UnbindMembershipNativeRequest) GetMemberIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberID, true +} + +// SetMemberID sets field value +func (o *UnbindMembershipNativeRequest) SetMemberID(v string) { + o.MemberID = v +} + +func (o UnbindMembershipNativeRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnbindMembershipNativeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["memberID"] = o.MemberID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UnbindMembershipNativeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "memberID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUnbindMembershipNativeRequest := _UnbindMembershipNativeRequest{} + + err = json.Unmarshal(data, &varUnbindMembershipNativeRequest) + + if err != nil { + return err + } + + *o = UnbindMembershipNativeRequest(varUnbindMembershipNativeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUnbindMembershipNativeRequest struct { + value *UnbindMembershipNativeRequest + isSet bool +} + +func (v NullableUnbindMembershipNativeRequest) Get() *UnbindMembershipNativeRequest { + return v.value +} + +func (v *NullableUnbindMembershipNativeRequest) Set(val *UnbindMembershipNativeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUnbindMembershipNativeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUnbindMembershipNativeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnbindMembershipNativeRequest(val *UnbindMembershipNativeRequest) *NullableUnbindMembershipNativeRequest { + return &NullableUnbindMembershipNativeRequest{value: val, isSet: true} +} + +func (v NullableUnbindMembershipNativeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnbindMembershipNativeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_unlink_membership_webview_request.go b/model_unlink_membership_webview_request.go new file mode 100644 index 0000000..5e13e43 --- /dev/null +++ b/model_unlink_membership_webview_request.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UnlinkMembershipWebviewRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnlinkMembershipWebviewRequest{} + +// UnlinkMembershipWebviewRequest This request submits membership unbind request to partner. +type UnlinkMembershipWebviewRequest struct { + // The unique member ID on the partner's database. + MemberID string `json:"memberID"` + AdditionalProperties map[string]interface{} +} + +type _UnlinkMembershipWebviewRequest UnlinkMembershipWebviewRequest + +// NewUnlinkMembershipWebviewRequest instantiates a new UnlinkMembershipWebviewRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnlinkMembershipWebviewRequest(memberID string) *UnlinkMembershipWebviewRequest { + this := UnlinkMembershipWebviewRequest{} + this.MemberID = memberID + return &this +} + +// NewUnlinkMembershipWebviewRequestWithDefaults instantiates a new UnlinkMembershipWebviewRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnlinkMembershipWebviewRequestWithDefaults() *UnlinkMembershipWebviewRequest { + this := UnlinkMembershipWebviewRequest{} + return &this +} + +// GetMemberID returns the MemberID field value +func (o *UnlinkMembershipWebviewRequest) GetMemberID() string { + if o == nil { + var ret string + return ret + } + + return o.MemberID +} + +// GetMemberIDOk returns a tuple with the MemberID field value +// and a boolean to check if the value has been set. +func (o *UnlinkMembershipWebviewRequest) GetMemberIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MemberID, true +} + +// SetMemberID sets field value +func (o *UnlinkMembershipWebviewRequest) SetMemberID(v string) { + o.MemberID = v +} + +func (o UnlinkMembershipWebviewRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnlinkMembershipWebviewRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["memberID"] = o.MemberID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UnlinkMembershipWebviewRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "memberID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUnlinkMembershipWebviewRequest := _UnlinkMembershipWebviewRequest{} + + err = json.Unmarshal(data, &varUnlinkMembershipWebviewRequest) + + if err != nil { + return err + } + + *o = UnlinkMembershipWebviewRequest(varUnlinkMembershipWebviewRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "memberID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUnlinkMembershipWebviewRequest struct { + value *UnlinkMembershipWebviewRequest + isSet bool +} + +func (v NullableUnlinkMembershipWebviewRequest) Get() *UnlinkMembershipWebviewRequest { + return v.value +} + +func (v *NullableUnlinkMembershipWebviewRequest) Set(val *UnlinkMembershipWebviewRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUnlinkMembershipWebviewRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUnlinkMembershipWebviewRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnlinkMembershipWebviewRequest(val *UnlinkMembershipWebviewRequest) *NullableUnlinkMembershipWebviewRequest { + return &NullableUnlinkMembershipWebviewRequest{value: val, isSet: true} +} + +func (v NullableUnlinkMembershipWebviewRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnlinkMembershipWebviewRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_advanced_pricing.go b/model_update_advanced_pricing.go new file mode 100644 index 0000000..878f24a --- /dev/null +++ b/model_update_advanced_pricing.go @@ -0,0 +1,197 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the UpdateAdvancedPricing type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAdvancedPricing{} + +// UpdateAdvancedPricing struct for UpdateAdvancedPricing +type UpdateAdvancedPricing struct { + // Available service type. + Key *string `json:"key,omitempty"` + // Price in minor unit. + Price *int64 `json:"price,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateAdvancedPricing UpdateAdvancedPricing + +// NewUpdateAdvancedPricing instantiates a new UpdateAdvancedPricing object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAdvancedPricing() *UpdateAdvancedPricing { + this := UpdateAdvancedPricing{} + return &this +} + +// NewUpdateAdvancedPricingWithDefaults instantiates a new UpdateAdvancedPricing object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAdvancedPricingWithDefaults() *UpdateAdvancedPricing { + this := UpdateAdvancedPricing{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *UpdateAdvancedPricing) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAdvancedPricing) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *UpdateAdvancedPricing) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *UpdateAdvancedPricing) SetKey(v string) { + o.Key = &v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *UpdateAdvancedPricing) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAdvancedPricing) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *UpdateAdvancedPricing) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *UpdateAdvancedPricing) SetPrice(v int64) { + o.Price = &v +} + +func (o UpdateAdvancedPricing) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAdvancedPricing) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateAdvancedPricing) UnmarshalJSON(data []byte) (err error) { + varUpdateAdvancedPricing := _UpdateAdvancedPricing{} + + err = json.Unmarshal(data, &varUpdateAdvancedPricing) + + if err != nil { + return err + } + + *o = UpdateAdvancedPricing(varUpdateAdvancedPricing) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "price") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateAdvancedPricing struct { + value *UpdateAdvancedPricing + isSet bool +} + +func (v NullableUpdateAdvancedPricing) Get() *UpdateAdvancedPricing { + return v.value +} + +func (v *NullableUpdateAdvancedPricing) Set(val *UpdateAdvancedPricing) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAdvancedPricing) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAdvancedPricing) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAdvancedPricing(val *UpdateAdvancedPricing) *NullableUpdateAdvancedPricing { + return &NullableUpdateAdvancedPricing{value: val, isSet: true} +} + +func (v NullableUpdateAdvancedPricing) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAdvancedPricing) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_campaign_request.go b/model_update_campaign_request.go new file mode 100644 index 0000000..7500d46 --- /dev/null +++ b/model_update_campaign_request.go @@ -0,0 +1,346 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the UpdateCampaignRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateCampaignRequest{} + +// UpdateCampaignRequest This request updates a campaign for your GrabFood store. +type UpdateCampaignRequest struct { + // The merchant's ID that is in GrabFood's database. + MerchantID *string `json:"merchantID,omitempty"` + // The campaign's name. + Name *string `json:"name,omitempty"` + Quotas *CampaignQuotas `json:"quotas,omitempty"` + Conditions *CampaignConditions `json:"conditions,omitempty"` + Discount *CampaignDiscount `json:"discount,omitempty"` + // Specify the tag for custom bundle offer campaign. Only whitelisted partner is supported as of now. + CustomTag *string `json:"customTag,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateCampaignRequest UpdateCampaignRequest + +// NewUpdateCampaignRequest instantiates a new UpdateCampaignRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateCampaignRequest() *UpdateCampaignRequest { + this := UpdateCampaignRequest{} + return &this +} + +// NewUpdateCampaignRequestWithDefaults instantiates a new UpdateCampaignRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateCampaignRequestWithDefaults() *UpdateCampaignRequest { + this := UpdateCampaignRequest{} + return &this +} + +// GetMerchantID returns the MerchantID field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetMerchantID() string { + if o == nil || IsNil(o.MerchantID) { + var ret string + return ret + } + return *o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetMerchantIDOk() (*string, bool) { + if o == nil || IsNil(o.MerchantID) { + return nil, false + } + return o.MerchantID, true +} + +// HasMerchantID returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasMerchantID() bool { + if o != nil && !IsNil(o.MerchantID) { + return true + } + + return false +} + +// SetMerchantID gets a reference to the given string and assigns it to the MerchantID field. +func (o *UpdateCampaignRequest) SetMerchantID(v string) { + o.MerchantID = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateCampaignRequest) SetName(v string) { + o.Name = &v +} + +// GetQuotas returns the Quotas field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetQuotas() CampaignQuotas { + if o == nil || IsNil(o.Quotas) { + var ret CampaignQuotas + return ret + } + return *o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetQuotasOk() (*CampaignQuotas, bool) { + if o == nil || IsNil(o.Quotas) { + return nil, false + } + return o.Quotas, true +} + +// HasQuotas returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasQuotas() bool { + if o != nil && !IsNil(o.Quotas) { + return true + } + + return false +} + +// SetQuotas gets a reference to the given CampaignQuotas and assigns it to the Quotas field. +func (o *UpdateCampaignRequest) SetQuotas(v CampaignQuotas) { + o.Quotas = &v +} + +// GetConditions returns the Conditions field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetConditions() CampaignConditions { + if o == nil || IsNil(o.Conditions) { + var ret CampaignConditions + return ret + } + return *o.Conditions +} + +// GetConditionsOk returns a tuple with the Conditions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetConditionsOk() (*CampaignConditions, bool) { + if o == nil || IsNil(o.Conditions) { + return nil, false + } + return o.Conditions, true +} + +// HasConditions returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasConditions() bool { + if o != nil && !IsNil(o.Conditions) { + return true + } + + return false +} + +// SetConditions gets a reference to the given CampaignConditions and assigns it to the Conditions field. +func (o *UpdateCampaignRequest) SetConditions(v CampaignConditions) { + o.Conditions = &v +} + +// GetDiscount returns the Discount field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetDiscount() CampaignDiscount { + if o == nil || IsNil(o.Discount) { + var ret CampaignDiscount + return ret + } + return *o.Discount +} + +// GetDiscountOk returns a tuple with the Discount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetDiscountOk() (*CampaignDiscount, bool) { + if o == nil || IsNil(o.Discount) { + return nil, false + } + return o.Discount, true +} + +// HasDiscount returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasDiscount() bool { + if o != nil && !IsNil(o.Discount) { + return true + } + + return false +} + +// SetDiscount gets a reference to the given CampaignDiscount and assigns it to the Discount field. +func (o *UpdateCampaignRequest) SetDiscount(v CampaignDiscount) { + o.Discount = &v +} + +// GetCustomTag returns the CustomTag field value if set, zero value otherwise. +func (o *UpdateCampaignRequest) GetCustomTag() string { + if o == nil || IsNil(o.CustomTag) { + var ret string + return ret + } + return *o.CustomTag +} + +// GetCustomTagOk returns a tuple with the CustomTag field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateCampaignRequest) GetCustomTagOk() (*string, bool) { + if o == nil || IsNil(o.CustomTag) { + return nil, false + } + return o.CustomTag, true +} + +// HasCustomTag returns a boolean if a field has been set. +func (o *UpdateCampaignRequest) HasCustomTag() bool { + if o != nil && !IsNil(o.CustomTag) { + return true + } + + return false +} + +// SetCustomTag gets a reference to the given string and assigns it to the CustomTag field. +func (o *UpdateCampaignRequest) SetCustomTag(v string) { + o.CustomTag = &v +} + +func (o UpdateCampaignRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateCampaignRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MerchantID) { + toSerialize["merchantID"] = o.MerchantID + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Quotas) { + toSerialize["quotas"] = o.Quotas + } + if !IsNil(o.Conditions) { + toSerialize["conditions"] = o.Conditions + } + if !IsNil(o.Discount) { + toSerialize["discount"] = o.Discount + } + if !IsNil(o.CustomTag) { + toSerialize["customTag"] = o.CustomTag + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateCampaignRequest) UnmarshalJSON(data []byte) (err error) { + varUpdateCampaignRequest := _UpdateCampaignRequest{} + + err = json.Unmarshal(data, &varUpdateCampaignRequest) + + if err != nil { + return err + } + + *o = UpdateCampaignRequest(varUpdateCampaignRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "name") + delete(additionalProperties, "quotas") + delete(additionalProperties, "conditions") + delete(additionalProperties, "discount") + delete(additionalProperties, "customTag") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateCampaignRequest struct { + value *UpdateCampaignRequest + isSet bool +} + +func (v NullableUpdateCampaignRequest) Get() *UpdateCampaignRequest { + return v.value +} + +func (v *NullableUpdateCampaignRequest) Set(val *UpdateCampaignRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateCampaignRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateCampaignRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateCampaignRequest(val *UpdateCampaignRequest) *NullableUpdateCampaignRequest { + return &NullableUpdateCampaignRequest{value: val, isSet: true} +} + +func (v NullableUpdateCampaignRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateCampaignRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_delivery_hour_request.go b/model_update_delivery_hour_request.go new file mode 100644 index 0000000..53db8f2 --- /dev/null +++ b/model_update_delivery_hour_request.go @@ -0,0 +1,201 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDeliveryHourRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDeliveryHourRequest{} + +// UpdateDeliveryHourRequest Object contains store delivery hours. +type UpdateDeliveryHourRequest struct { + OpeningHour StoreHour `json:"openingHour"` + // To enable force update store delivery hours. Error will be returned if set to false while there is ongoing order. + Force bool `json:"force"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDeliveryHourRequest UpdateDeliveryHourRequest + +// NewUpdateDeliveryHourRequest instantiates a new UpdateDeliveryHourRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDeliveryHourRequest(openingHour StoreHour, force bool) *UpdateDeliveryHourRequest { + this := UpdateDeliveryHourRequest{} + this.OpeningHour = openingHour + this.Force = force + return &this +} + +// NewUpdateDeliveryHourRequestWithDefaults instantiates a new UpdateDeliveryHourRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDeliveryHourRequestWithDefaults() *UpdateDeliveryHourRequest { + this := UpdateDeliveryHourRequest{} + return &this +} + +// GetOpeningHour returns the OpeningHour field value +func (o *UpdateDeliveryHourRequest) GetOpeningHour() StoreHour { + if o == nil { + var ret StoreHour + return ret + } + + return o.OpeningHour +} + +// GetOpeningHourOk returns a tuple with the OpeningHour field value +// and a boolean to check if the value has been set. +func (o *UpdateDeliveryHourRequest) GetOpeningHourOk() (*StoreHour, bool) { + if o == nil { + return nil, false + } + return &o.OpeningHour, true +} + +// SetOpeningHour sets field value +func (o *UpdateDeliveryHourRequest) SetOpeningHour(v StoreHour) { + o.OpeningHour = v +} + +// GetForce returns the Force field value +func (o *UpdateDeliveryHourRequest) GetForce() bool { + if o == nil { + var ret bool + return ret + } + + return o.Force +} + +// GetForceOk returns a tuple with the Force field value +// and a boolean to check if the value has been set. +func (o *UpdateDeliveryHourRequest) GetForceOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Force, true +} + +// SetForce sets field value +func (o *UpdateDeliveryHourRequest) SetForce(v bool) { + o.Force = v +} + +func (o UpdateDeliveryHourRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDeliveryHourRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["openingHour"] = o.OpeningHour + toSerialize["force"] = o.Force + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDeliveryHourRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "openingHour", + "force", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDeliveryHourRequest := _UpdateDeliveryHourRequest{} + + err = json.Unmarshal(data, &varUpdateDeliveryHourRequest) + + if err != nil { + return err + } + + *o = UpdateDeliveryHourRequest(varUpdateDeliveryHourRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "openingHour") + delete(additionalProperties, "force") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDeliveryHourRequest struct { + value *UpdateDeliveryHourRequest + isSet bool +} + +func (v NullableUpdateDeliveryHourRequest) Get() *UpdateDeliveryHourRequest { + return v.value +} + +func (v *NullableUpdateDeliveryHourRequest) Set(val *UpdateDeliveryHourRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDeliveryHourRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDeliveryHourRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDeliveryHourRequest(val *UpdateDeliveryHourRequest) *NullableUpdateDeliveryHourRequest { + return &NullableUpdateDeliveryHourRequest{value: val, isSet: true} +} + +func (v NullableUpdateDeliveryHourRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDeliveryHourRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_delivery_hour_response.go b/model_update_delivery_hour_response.go new file mode 100644 index 0000000..280e92a --- /dev/null +++ b/model_update_delivery_hour_response.go @@ -0,0 +1,271 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDeliveryHourResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDeliveryHourResponse{} + +// UpdateDeliveryHourResponse Object contain update store delivery hour response +type UpdateDeliveryHourResponse struct { + // Error message when updating store delivery hour. `null` indicates no error. + ErrorReasons []string `json:"errorReasons,omitempty"` + // Total active order for the day. + OrderCount int64 `json:"orderCount"` + // Total scheduled order during store close period. + ScheduledOrderCount int64 `json:"scheduledOrderCount"` + // Indicate the store status after updating delivery hours. + CloseImmediately bool `json:"closeImmediately"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDeliveryHourResponse UpdateDeliveryHourResponse + +// NewUpdateDeliveryHourResponse instantiates a new UpdateDeliveryHourResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDeliveryHourResponse(orderCount int64, scheduledOrderCount int64, closeImmediately bool) *UpdateDeliveryHourResponse { + this := UpdateDeliveryHourResponse{} + this.OrderCount = orderCount + this.ScheduledOrderCount = scheduledOrderCount + this.CloseImmediately = closeImmediately + return &this +} + +// NewUpdateDeliveryHourResponseWithDefaults instantiates a new UpdateDeliveryHourResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDeliveryHourResponseWithDefaults() *UpdateDeliveryHourResponse { + this := UpdateDeliveryHourResponse{} + return &this +} + +// GetErrorReasons returns the ErrorReasons field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateDeliveryHourResponse) GetErrorReasons() []string { + if o == nil { + var ret []string + return ret + } + return o.ErrorReasons +} + +// GetErrorReasonsOk returns a tuple with the ErrorReasons field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateDeliveryHourResponse) GetErrorReasonsOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorReasons) { + return nil, false + } + return o.ErrorReasons, true +} + +// HasErrorReasons returns a boolean if a field has been set. +func (o *UpdateDeliveryHourResponse) HasErrorReasons() bool { + if o != nil && !IsNil(o.ErrorReasons) { + return true + } + + return false +} + +// SetErrorReasons gets a reference to the given []string and assigns it to the ErrorReasons field. +func (o *UpdateDeliveryHourResponse) SetErrorReasons(v []string) { + o.ErrorReasons = v +} + +// GetOrderCount returns the OrderCount field value +func (o *UpdateDeliveryHourResponse) GetOrderCount() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.OrderCount +} + +// GetOrderCountOk returns a tuple with the OrderCount field value +// and a boolean to check if the value has been set. +func (o *UpdateDeliveryHourResponse) GetOrderCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OrderCount, true +} + +// SetOrderCount sets field value +func (o *UpdateDeliveryHourResponse) SetOrderCount(v int64) { + o.OrderCount = v +} + +// GetScheduledOrderCount returns the ScheduledOrderCount field value +func (o *UpdateDeliveryHourResponse) GetScheduledOrderCount() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ScheduledOrderCount +} + +// GetScheduledOrderCountOk returns a tuple with the ScheduledOrderCount field value +// and a boolean to check if the value has been set. +func (o *UpdateDeliveryHourResponse) GetScheduledOrderCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ScheduledOrderCount, true +} + +// SetScheduledOrderCount sets field value +func (o *UpdateDeliveryHourResponse) SetScheduledOrderCount(v int64) { + o.ScheduledOrderCount = v +} + +// GetCloseImmediately returns the CloseImmediately field value +func (o *UpdateDeliveryHourResponse) GetCloseImmediately() bool { + if o == nil { + var ret bool + return ret + } + + return o.CloseImmediately +} + +// GetCloseImmediatelyOk returns a tuple with the CloseImmediately field value +// and a boolean to check if the value has been set. +func (o *UpdateDeliveryHourResponse) GetCloseImmediatelyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CloseImmediately, true +} + +// SetCloseImmediately sets field value +func (o *UpdateDeliveryHourResponse) SetCloseImmediately(v bool) { + o.CloseImmediately = v +} + +func (o UpdateDeliveryHourResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDeliveryHourResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ErrorReasons != nil { + toSerialize["errorReasons"] = o.ErrorReasons + } + toSerialize["orderCount"] = o.OrderCount + toSerialize["scheduledOrderCount"] = o.ScheduledOrderCount + toSerialize["closeImmediately"] = o.CloseImmediately + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDeliveryHourResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderCount", + "scheduledOrderCount", + "closeImmediately", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDeliveryHourResponse := _UpdateDeliveryHourResponse{} + + err = json.Unmarshal(data, &varUpdateDeliveryHourResponse) + + if err != nil { + return err + } + + *o = UpdateDeliveryHourResponse(varUpdateDeliveryHourResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "errorReasons") + delete(additionalProperties, "orderCount") + delete(additionalProperties, "scheduledOrderCount") + delete(additionalProperties, "closeImmediately") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDeliveryHourResponse struct { + value *UpdateDeliveryHourResponse + isSet bool +} + +func (v NullableUpdateDeliveryHourResponse) Get() *UpdateDeliveryHourResponse { + return v.value +} + +func (v *NullableUpdateDeliveryHourResponse) Set(val *UpdateDeliveryHourResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDeliveryHourResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDeliveryHourResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDeliveryHourResponse(val *UpdateDeliveryHourResponse) *NullableUpdateDeliveryHourResponse { + return &NullableUpdateDeliveryHourResponse{value: val, isSet: true} +} + +func (v NullableUpdateDeliveryHourResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDeliveryHourResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_dine_in_hour_request.go b/model_update_dine_in_hour_request.go new file mode 100644 index 0000000..7ae59a1 --- /dev/null +++ b/model_update_dine_in_hour_request.go @@ -0,0 +1,171 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateDineInHourRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDineInHourRequest{} + +// UpdateDineInHourRequest Object contains store dine-in hours. +type UpdateDineInHourRequest struct { + DineInHour StoreHour `json:"dineInHour"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDineInHourRequest UpdateDineInHourRequest + +// NewUpdateDineInHourRequest instantiates a new UpdateDineInHourRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDineInHourRequest(dineInHour StoreHour) *UpdateDineInHourRequest { + this := UpdateDineInHourRequest{} + this.DineInHour = dineInHour + return &this +} + +// NewUpdateDineInHourRequestWithDefaults instantiates a new UpdateDineInHourRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDineInHourRequestWithDefaults() *UpdateDineInHourRequest { + this := UpdateDineInHourRequest{} + return &this +} + +// GetDineInHour returns the DineInHour field value +func (o *UpdateDineInHourRequest) GetDineInHour() StoreHour { + if o == nil { + var ret StoreHour + return ret + } + + return o.DineInHour +} + +// GetDineInHourOk returns a tuple with the DineInHour field value +// and a boolean to check if the value has been set. +func (o *UpdateDineInHourRequest) GetDineInHourOk() (*StoreHour, bool) { + if o == nil { + return nil, false + } + return &o.DineInHour, true +} + +// SetDineInHour sets field value +func (o *UpdateDineInHourRequest) SetDineInHour(v StoreHour) { + o.DineInHour = v +} + +func (o UpdateDineInHourRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDineInHourRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["dineInHour"] = o.DineInHour + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDineInHourRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "dineInHour", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateDineInHourRequest := _UpdateDineInHourRequest{} + + err = json.Unmarshal(data, &varUpdateDineInHourRequest) + + if err != nil { + return err + } + + *o = UpdateDineInHourRequest(varUpdateDineInHourRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "dineInHour") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDineInHourRequest struct { + value *UpdateDineInHourRequest + isSet bool +} + +func (v NullableUpdateDineInHourRequest) Get() *UpdateDineInHourRequest { + return v.value +} + +func (v *NullableUpdateDineInHourRequest) Set(val *UpdateDineInHourRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDineInHourRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDineInHourRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDineInHourRequest(val *UpdateDineInHourRequest) *NullableUpdateDineInHourRequest { + return &NullableUpdateDineInHourRequest{value: val, isSet: true} +} + +func (v NullableUpdateDineInHourRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDineInHourRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_dine_in_hour_response.go b/model_update_dine_in_hour_response.go new file mode 100644 index 0000000..0e2c7fd --- /dev/null +++ b/model_update_dine_in_hour_response.go @@ -0,0 +1,160 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the UpdateDineInHourResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateDineInHourResponse{} + +// UpdateDineInHourResponse Object contain update store dine-in hour response +type UpdateDineInHourResponse struct { + // Error message when updating store dine-in hour. `null` indicates no error. + ErrorReasons []string `json:"errorReasons,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateDineInHourResponse UpdateDineInHourResponse + +// NewUpdateDineInHourResponse instantiates a new UpdateDineInHourResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateDineInHourResponse() *UpdateDineInHourResponse { + this := UpdateDineInHourResponse{} + return &this +} + +// NewUpdateDineInHourResponseWithDefaults instantiates a new UpdateDineInHourResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateDineInHourResponseWithDefaults() *UpdateDineInHourResponse { + this := UpdateDineInHourResponse{} + return &this +} + +// GetErrorReasons returns the ErrorReasons field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateDineInHourResponse) GetErrorReasons() []string { + if o == nil { + var ret []string + return ret + } + return o.ErrorReasons +} + +// GetErrorReasonsOk returns a tuple with the ErrorReasons field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateDineInHourResponse) GetErrorReasonsOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorReasons) { + return nil, false + } + return o.ErrorReasons, true +} + +// HasErrorReasons returns a boolean if a field has been set. +func (o *UpdateDineInHourResponse) HasErrorReasons() bool { + if o != nil && !IsNil(o.ErrorReasons) { + return true + } + + return false +} + +// SetErrorReasons gets a reference to the given []string and assigns it to the ErrorReasons field. +func (o *UpdateDineInHourResponse) SetErrorReasons(v []string) { + o.ErrorReasons = v +} + +func (o UpdateDineInHourResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateDineInHourResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ErrorReasons != nil { + toSerialize["errorReasons"] = o.ErrorReasons + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateDineInHourResponse) UnmarshalJSON(data []byte) (err error) { + varUpdateDineInHourResponse := _UpdateDineInHourResponse{} + + err = json.Unmarshal(data, &varUpdateDineInHourResponse) + + if err != nil { + return err + } + + *o = UpdateDineInHourResponse(varUpdateDineInHourResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "errorReasons") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateDineInHourResponse struct { + value *UpdateDineInHourResponse + isSet bool +} + +func (v NullableUpdateDineInHourResponse) Get() *UpdateDineInHourResponse { + return v.value +} + +func (v *NullableUpdateDineInHourResponse) Set(val *UpdateDineInHourResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateDineInHourResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateDineInHourResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateDineInHourResponse(val *UpdateDineInHourResponse) *NullableUpdateDineInHourResponse { + return &NullableUpdateDineInHourResponse{value: val, isSet: true} +} + +func (v NullableUpdateDineInHourResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateDineInHourResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_menu_item.go b/model_update_menu_item.go new file mode 100644 index 0000000..d36ed0f --- /dev/null +++ b/model_update_menu_item.go @@ -0,0 +1,422 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateMenuItem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateMenuItem{} + +// UpdateMenuItem Information about the GrabFood client updating their food menu. +type UpdateMenuItem struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The record type that you want to update. + Field string `json:"field"` + // The record's ID on the partner system. For example, the item id in case type is ITEM. + Id string `json:"id"` + // The record's price in minor unit format. + Price *int64 `json:"price,omitempty"` + // The record's availableStatus. Note: In order to set an item as \"UNAVAILABLE\", it is required to update both the `availableStatus` and `maxStock` fields, whereby the `maxStock` value should be set to 0. + AvailableStatus *string `json:"availableStatus,omitempty"` + // Available stocks under inventory for this item. Auto reduce when there is order placed for this item. Note: It is necessary to set `maxStock` to 0 if the `availableStatus` of the item is \"UNAVAILABLE\". Item will be set to \"AVAILABLE\" if `maxStock` > 0. + MaxStock *int64 `json:"maxStock,omitempty"` + // Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + AdvancedPricings []UpdateAdvancedPricing `json:"advancedPricings,omitempty"` + // Purchasability is set to true by default for all service type, unless it is explicitly set to false. Modifier will reuse it’s item’s purchasability. + Purchasabilities []UpdatePurchasability `json:"purchasabilities,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateMenuItem UpdateMenuItem + +// NewUpdateMenuItem instantiates a new UpdateMenuItem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateMenuItem(merchantID string, field string, id string) *UpdateMenuItem { + this := UpdateMenuItem{} + this.MerchantID = merchantID + this.Field = field + this.Id = id + return &this +} + +// NewUpdateMenuItemWithDefaults instantiates a new UpdateMenuItem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateMenuItemWithDefaults() *UpdateMenuItem { + this := UpdateMenuItem{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *UpdateMenuItem) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *UpdateMenuItem) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetField returns the Field field value +func (o *UpdateMenuItem) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *UpdateMenuItem) SetField(v string) { + o.Field = v +} + +// GetId returns the Id field value +func (o *UpdateMenuItem) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *UpdateMenuItem) SetId(v string) { + o.Id = v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *UpdateMenuItem) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *UpdateMenuItem) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *UpdateMenuItem) SetPrice(v int64) { + o.Price = &v +} + +// GetAvailableStatus returns the AvailableStatus field value if set, zero value otherwise. +func (o *UpdateMenuItem) GetAvailableStatus() string { + if o == nil || IsNil(o.AvailableStatus) { + var ret string + return ret + } + return *o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetAvailableStatusOk() (*string, bool) { + if o == nil || IsNil(o.AvailableStatus) { + return nil, false + } + return o.AvailableStatus, true +} + +// HasAvailableStatus returns a boolean if a field has been set. +func (o *UpdateMenuItem) HasAvailableStatus() bool { + if o != nil && !IsNil(o.AvailableStatus) { + return true + } + + return false +} + +// SetAvailableStatus gets a reference to the given string and assigns it to the AvailableStatus field. +func (o *UpdateMenuItem) SetAvailableStatus(v string) { + o.AvailableStatus = &v +} + +// GetMaxStock returns the MaxStock field value if set, zero value otherwise. +func (o *UpdateMenuItem) GetMaxStock() int64 { + if o == nil || IsNil(o.MaxStock) { + var ret int64 + return ret + } + return *o.MaxStock +} + +// GetMaxStockOk returns a tuple with the MaxStock field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetMaxStockOk() (*int64, bool) { + if o == nil || IsNil(o.MaxStock) { + return nil, false + } + return o.MaxStock, true +} + +// HasMaxStock returns a boolean if a field has been set. +func (o *UpdateMenuItem) HasMaxStock() bool { + if o != nil && !IsNil(o.MaxStock) { + return true + } + + return false +} + +// SetMaxStock gets a reference to the given int64 and assigns it to the MaxStock field. +func (o *UpdateMenuItem) SetMaxStock(v int64) { + o.MaxStock = &v +} + +// GetAdvancedPricings returns the AdvancedPricings field value if set, zero value otherwise. +func (o *UpdateMenuItem) GetAdvancedPricings() []UpdateAdvancedPricing { + if o == nil || IsNil(o.AdvancedPricings) { + var ret []UpdateAdvancedPricing + return ret + } + return o.AdvancedPricings +} + +// GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetAdvancedPricingsOk() ([]UpdateAdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricings) { + return nil, false + } + return o.AdvancedPricings, true +} + +// HasAdvancedPricings returns a boolean if a field has been set. +func (o *UpdateMenuItem) HasAdvancedPricings() bool { + if o != nil && !IsNil(o.AdvancedPricings) { + return true + } + + return false +} + +// SetAdvancedPricings gets a reference to the given []UpdateAdvancedPricing and assigns it to the AdvancedPricings field. +func (o *UpdateMenuItem) SetAdvancedPricings(v []UpdateAdvancedPricing) { + o.AdvancedPricings = v +} + +// GetPurchasabilities returns the Purchasabilities field value if set, zero value otherwise. +func (o *UpdateMenuItem) GetPurchasabilities() []UpdatePurchasability { + if o == nil || IsNil(o.Purchasabilities) { + var ret []UpdatePurchasability + return ret + } + return o.Purchasabilities +} + +// GetPurchasabilitiesOk returns a tuple with the Purchasabilities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuItem) GetPurchasabilitiesOk() ([]UpdatePurchasability, bool) { + if o == nil || IsNil(o.Purchasabilities) { + return nil, false + } + return o.Purchasabilities, true +} + +// HasPurchasabilities returns a boolean if a field has been set. +func (o *UpdateMenuItem) HasPurchasabilities() bool { + if o != nil && !IsNil(o.Purchasabilities) { + return true + } + + return false +} + +// SetPurchasabilities gets a reference to the given []UpdatePurchasability and assigns it to the Purchasabilities field. +func (o *UpdateMenuItem) SetPurchasabilities(v []UpdatePurchasability) { + o.Purchasabilities = v +} + +func (o UpdateMenuItem) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateMenuItem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["field"] = o.Field + toSerialize["id"] = o.Id + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + if !IsNil(o.AvailableStatus) { + toSerialize["availableStatus"] = o.AvailableStatus + } + if !IsNil(o.MaxStock) { + toSerialize["maxStock"] = o.MaxStock + } + if !IsNil(o.AdvancedPricings) { + toSerialize["advancedPricings"] = o.AdvancedPricings + } + if !IsNil(o.Purchasabilities) { + toSerialize["purchasabilities"] = o.Purchasabilities + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateMenuItem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "field", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateMenuItem := _UpdateMenuItem{} + + err = json.Unmarshal(data, &varUpdateMenuItem) + + if err != nil { + return err + } + + *o = UpdateMenuItem(varUpdateMenuItem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "field") + delete(additionalProperties, "id") + delete(additionalProperties, "price") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "maxStock") + delete(additionalProperties, "advancedPricings") + delete(additionalProperties, "purchasabilities") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateMenuItem struct { + value *UpdateMenuItem + isSet bool +} + +func (v NullableUpdateMenuItem) Get() *UpdateMenuItem { + return v.value +} + +func (v *NullableUpdateMenuItem) Set(val *UpdateMenuItem) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateMenuItem) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateMenuItem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateMenuItem(val *UpdateMenuItem) *NullableUpdateMenuItem { + return &NullableUpdateMenuItem{value: val, isSet: true} +} + +func (v NullableUpdateMenuItem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateMenuItem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_menu_modifier.go b/model_update_menu_modifier.go new file mode 100644 index 0000000..ccd8d90 --- /dev/null +++ b/model_update_menu_modifier.go @@ -0,0 +1,414 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateMenuModifier type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateMenuModifier{} + +// UpdateMenuModifier Information about the GrabFood client updating their food menu. +type UpdateMenuModifier struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + // The record type that you want to update. + Field string `json:"field"` + // The record's ID on the partner system. For example, the modifier id in case type is MODIFIER. + Id string `json:"id"` + // The record's price in minor unit format. + Price *int64 `json:"price,omitempty"` + // **Only required when updating modifiers.** The record's name. Used as identifier to locate the correct record. + Name string `json:"name"` + // The record's availableStatus. + AvailableStatus *string `json:"availableStatus,omitempty"` + // Allows the modifier's price to be explicitly set as zero. Possible values are as follows: * `isFree` && `price == 0` sets the modifier's price to zero. * `isFree` && `price > 0` returns an error message that \"price cannot be set to > 0, if modifier is free”. * `!isFree` && `price > 0` sets the modifier's price to the defined price. * `!isFree` && `price == 0` does not update the modifier's price and reuses the existing price. + IsFree *bool `json:"isFree,omitempty"` + // Price configuration (in minor unit) for different service, order type and channel combination. If a service type does not have a specified price, it will utilize the default price of the item. + AdvancedPricings []UpdateAdvancedPricing `json:"advancedPricings,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdateMenuModifier UpdateMenuModifier + +// NewUpdateMenuModifier instantiates a new UpdateMenuModifier object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateMenuModifier(merchantID string, field string, id string, name string) *UpdateMenuModifier { + this := UpdateMenuModifier{} + this.MerchantID = merchantID + this.Field = field + this.Id = id + this.Name = name + return &this +} + +// NewUpdateMenuModifierWithDefaults instantiates a new UpdateMenuModifier object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateMenuModifierWithDefaults() *UpdateMenuModifier { + this := UpdateMenuModifier{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *UpdateMenuModifier) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *UpdateMenuModifier) SetMerchantID(v string) { + o.MerchantID = v +} + +// GetField returns the Field field value +func (o *UpdateMenuModifier) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *UpdateMenuModifier) SetField(v string) { + o.Field = v +} + +// GetId returns the Id field value +func (o *UpdateMenuModifier) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *UpdateMenuModifier) SetId(v string) { + o.Id = v +} + +// GetPrice returns the Price field value if set, zero value otherwise. +func (o *UpdateMenuModifier) GetPrice() int64 { + if o == nil || IsNil(o.Price) { + var ret int64 + return ret + } + return *o.Price +} + +// GetPriceOk returns a tuple with the Price field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetPriceOk() (*int64, bool) { + if o == nil || IsNil(o.Price) { + return nil, false + } + return o.Price, true +} + +// HasPrice returns a boolean if a field has been set. +func (o *UpdateMenuModifier) HasPrice() bool { + if o != nil && !IsNil(o.Price) { + return true + } + + return false +} + +// SetPrice gets a reference to the given int64 and assigns it to the Price field. +func (o *UpdateMenuModifier) SetPrice(v int64) { + o.Price = &v +} + +// GetName returns the Name field value +func (o *UpdateMenuModifier) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UpdateMenuModifier) SetName(v string) { + o.Name = v +} + +// GetAvailableStatus returns the AvailableStatus field value if set, zero value otherwise. +func (o *UpdateMenuModifier) GetAvailableStatus() string { + if o == nil || IsNil(o.AvailableStatus) { + var ret string + return ret + } + return *o.AvailableStatus +} + +// GetAvailableStatusOk returns a tuple with the AvailableStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetAvailableStatusOk() (*string, bool) { + if o == nil || IsNil(o.AvailableStatus) { + return nil, false + } + return o.AvailableStatus, true +} + +// HasAvailableStatus returns a boolean if a field has been set. +func (o *UpdateMenuModifier) HasAvailableStatus() bool { + if o != nil && !IsNil(o.AvailableStatus) { + return true + } + + return false +} + +// SetAvailableStatus gets a reference to the given string and assigns it to the AvailableStatus field. +func (o *UpdateMenuModifier) SetAvailableStatus(v string) { + o.AvailableStatus = &v +} + +// GetIsFree returns the IsFree field value if set, zero value otherwise. +func (o *UpdateMenuModifier) GetIsFree() bool { + if o == nil || IsNil(o.IsFree) { + var ret bool + return ret + } + return *o.IsFree +} + +// GetIsFreeOk returns a tuple with the IsFree field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetIsFreeOk() (*bool, bool) { + if o == nil || IsNil(o.IsFree) { + return nil, false + } + return o.IsFree, true +} + +// HasIsFree returns a boolean if a field has been set. +func (o *UpdateMenuModifier) HasIsFree() bool { + if o != nil && !IsNil(o.IsFree) { + return true + } + + return false +} + +// SetIsFree gets a reference to the given bool and assigns it to the IsFree field. +func (o *UpdateMenuModifier) SetIsFree(v bool) { + o.IsFree = &v +} + +// GetAdvancedPricings returns the AdvancedPricings field value if set, zero value otherwise. +func (o *UpdateMenuModifier) GetAdvancedPricings() []UpdateAdvancedPricing { + if o == nil || IsNil(o.AdvancedPricings) { + var ret []UpdateAdvancedPricing + return ret + } + return o.AdvancedPricings +} + +// GetAdvancedPricingsOk returns a tuple with the AdvancedPricings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateMenuModifier) GetAdvancedPricingsOk() ([]UpdateAdvancedPricing, bool) { + if o == nil || IsNil(o.AdvancedPricings) { + return nil, false + } + return o.AdvancedPricings, true +} + +// HasAdvancedPricings returns a boolean if a field has been set. +func (o *UpdateMenuModifier) HasAdvancedPricings() bool { + if o != nil && !IsNil(o.AdvancedPricings) { + return true + } + + return false +} + +// SetAdvancedPricings gets a reference to the given []UpdateAdvancedPricing and assigns it to the AdvancedPricings field. +func (o *UpdateMenuModifier) SetAdvancedPricings(v []UpdateAdvancedPricing) { + o.AdvancedPricings = v +} + +func (o UpdateMenuModifier) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateMenuModifier) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + toSerialize["field"] = o.Field + toSerialize["id"] = o.Id + if !IsNil(o.Price) { + toSerialize["price"] = o.Price + } + toSerialize["name"] = o.Name + if !IsNil(o.AvailableStatus) { + toSerialize["availableStatus"] = o.AvailableStatus + } + if !IsNil(o.IsFree) { + toSerialize["isFree"] = o.IsFree + } + if !IsNil(o.AdvancedPricings) { + toSerialize["advancedPricings"] = o.AdvancedPricings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateMenuModifier) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + "field", + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateMenuModifier := _UpdateMenuModifier{} + + err = json.Unmarshal(data, &varUpdateMenuModifier) + + if err != nil { + return err + } + + *o = UpdateMenuModifier(varUpdateMenuModifier) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + delete(additionalProperties, "field") + delete(additionalProperties, "id") + delete(additionalProperties, "price") + delete(additionalProperties, "name") + delete(additionalProperties, "availableStatus") + delete(additionalProperties, "isFree") + delete(additionalProperties, "advancedPricings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateMenuModifier struct { + value *UpdateMenuModifier + isSet bool +} + +func (v NullableUpdateMenuModifier) Get() *UpdateMenuModifier { + return v.value +} + +func (v *NullableUpdateMenuModifier) Set(val *UpdateMenuModifier) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateMenuModifier) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateMenuModifier) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateMenuModifier(val *UpdateMenuModifier) *NullableUpdateMenuModifier { + return &NullableUpdateMenuModifier{value: val, isSet: true} +} + +func (v NullableUpdateMenuModifier) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateMenuModifier) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_menu_notif_request.go b/model_update_menu_notif_request.go new file mode 100644 index 0000000..e0ad685 --- /dev/null +++ b/model_update_menu_notif_request.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateMenuNotifRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateMenuNotifRequest{} + +// UpdateMenuNotifRequest This request notifies GrabFood about the partner's updated food menu. +type UpdateMenuNotifRequest struct { + // The merchant's ID that is in GrabFood's database. + MerchantID string `json:"merchantID"` + AdditionalProperties map[string]interface{} +} + +type _UpdateMenuNotifRequest UpdateMenuNotifRequest + +// NewUpdateMenuNotifRequest instantiates a new UpdateMenuNotifRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateMenuNotifRequest(merchantID string) *UpdateMenuNotifRequest { + this := UpdateMenuNotifRequest{} + this.MerchantID = merchantID + return &this +} + +// NewUpdateMenuNotifRequestWithDefaults instantiates a new UpdateMenuNotifRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateMenuNotifRequestWithDefaults() *UpdateMenuNotifRequest { + this := UpdateMenuNotifRequest{} + return &this +} + +// GetMerchantID returns the MerchantID field value +func (o *UpdateMenuNotifRequest) GetMerchantID() string { + if o == nil { + var ret string + return ret + } + + return o.MerchantID +} + +// GetMerchantIDOk returns a tuple with the MerchantID field value +// and a boolean to check if the value has been set. +func (o *UpdateMenuNotifRequest) GetMerchantIDOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MerchantID, true +} + +// SetMerchantID sets field value +func (o *UpdateMenuNotifRequest) SetMerchantID(v string) { + o.MerchantID = v +} + +func (o UpdateMenuNotifRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateMenuNotifRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["merchantID"] = o.MerchantID + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateMenuNotifRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "merchantID", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateMenuNotifRequest := _UpdateMenuNotifRequest{} + + err = json.Unmarshal(data, &varUpdateMenuNotifRequest) + + if err != nil { + return err + } + + *o = UpdateMenuNotifRequest(varUpdateMenuNotifRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "merchantID") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateMenuNotifRequest struct { + value *UpdateMenuNotifRequest + isSet bool +} + +func (v NullableUpdateMenuNotifRequest) Get() *UpdateMenuNotifRequest { + return v.value +} + +func (v *NullableUpdateMenuNotifRequest) Set(val *UpdateMenuNotifRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateMenuNotifRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateMenuNotifRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateMenuNotifRequest(val *UpdateMenuNotifRequest) *NullableUpdateMenuNotifRequest { + return &NullableUpdateMenuNotifRequest{value: val, isSet: true} +} + +func (v NullableUpdateMenuNotifRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateMenuNotifRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_menu_request.go b/model_update_menu_request.go new file mode 100644 index 0000000..c890c4c --- /dev/null +++ b/model_update_menu_request.go @@ -0,0 +1,160 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "gopkg.in/validator.v2" + "fmt" +) + +// UpdateMenuRequest - struct for UpdateMenuRequest +type UpdateMenuRequest struct { + UpdateMenuItem *UpdateMenuItem + UpdateMenuModifier *UpdateMenuModifier +} + +// UpdateMenuItemAsUpdateMenuRequest is a convenience function that returns UpdateMenuItem wrapped in UpdateMenuRequest +func UpdateMenuItemAsUpdateMenuRequest(v *UpdateMenuItem) UpdateMenuRequest { + return UpdateMenuRequest{ + UpdateMenuItem: v, + } +} + +// UpdateMenuModifierAsUpdateMenuRequest is a convenience function that returns UpdateMenuModifier wrapped in UpdateMenuRequest +func UpdateMenuModifierAsUpdateMenuRequest(v *UpdateMenuModifier) UpdateMenuRequest { + return UpdateMenuRequest{ + UpdateMenuModifier: v, + } +} + + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *UpdateMenuRequest) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into UpdateMenuItem + err = newStrictDecoder(data).Decode(&dst.UpdateMenuItem) + if err == nil { + jsonUpdateMenuItem, _ := json.Marshal(dst.UpdateMenuItem) + if string(jsonUpdateMenuItem) == "{}" { // empty struct + dst.UpdateMenuItem = nil + } else { + if err = validator.Validate(dst.UpdateMenuItem); err != nil { + dst.UpdateMenuItem = nil + } else { + match++ + } + } + } else { + dst.UpdateMenuItem = nil + } + + // try to unmarshal data into UpdateMenuModifier + err = newStrictDecoder(data).Decode(&dst.UpdateMenuModifier) + if err == nil { + jsonUpdateMenuModifier, _ := json.Marshal(dst.UpdateMenuModifier) + if string(jsonUpdateMenuModifier) == "{}" { // empty struct + dst.UpdateMenuModifier = nil + } else { + if err = validator.Validate(dst.UpdateMenuModifier); err != nil { + dst.UpdateMenuModifier = nil + } else { + match++ + } + } + } else { + dst.UpdateMenuModifier = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.UpdateMenuItem = nil + dst.UpdateMenuModifier = nil + + return fmt.Errorf("data matches more than one schema in oneOf(UpdateMenuRequest)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(UpdateMenuRequest)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src UpdateMenuRequest) MarshalJSON() ([]byte, error) { + if src.UpdateMenuItem != nil { + return json.Marshal(&src.UpdateMenuItem) + } + + if src.UpdateMenuModifier != nil { + return json.Marshal(&src.UpdateMenuModifier) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *UpdateMenuRequest) GetActualInstance() (interface{}) { + if obj == nil { + return nil + } + if obj.UpdateMenuItem != nil { + return obj.UpdateMenuItem + } + + if obj.UpdateMenuModifier != nil { + return obj.UpdateMenuModifier + } + + // all schemas are nil + return nil +} + +type NullableUpdateMenuRequest struct { + value *UpdateMenuRequest + isSet bool +} + +func (v NullableUpdateMenuRequest) Get() *UpdateMenuRequest { + return v.value +} + +func (v *NullableUpdateMenuRequest) Set(val *UpdateMenuRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateMenuRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateMenuRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateMenuRequest(val *UpdateMenuRequest) *NullableUpdateMenuRequest { + return &NullableUpdateMenuRequest{value: val, isSet: true} +} + +func (v NullableUpdateMenuRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateMenuRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_purchasability.go b/model_update_purchasability.go new file mode 100644 index 0000000..6a723b4 --- /dev/null +++ b/model_update_purchasability.go @@ -0,0 +1,196 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the UpdatePurchasability type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdatePurchasability{} + +// UpdatePurchasability struct for UpdatePurchasability +type UpdatePurchasability struct { + // Available service type. + Key *string `json:"key,omitempty"` + Purchasable *bool `json:"purchasable,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UpdatePurchasability UpdatePurchasability + +// NewUpdatePurchasability instantiates a new UpdatePurchasability object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdatePurchasability() *UpdatePurchasability { + this := UpdatePurchasability{} + return &this +} + +// NewUpdatePurchasabilityWithDefaults instantiates a new UpdatePurchasability object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdatePurchasabilityWithDefaults() *UpdatePurchasability { + this := UpdatePurchasability{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *UpdatePurchasability) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePurchasability) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *UpdatePurchasability) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *UpdatePurchasability) SetKey(v string) { + o.Key = &v +} + +// GetPurchasable returns the Purchasable field value if set, zero value otherwise. +func (o *UpdatePurchasability) GetPurchasable() bool { + if o == nil || IsNil(o.Purchasable) { + var ret bool + return ret + } + return *o.Purchasable +} + +// GetPurchasableOk returns a tuple with the Purchasable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePurchasability) GetPurchasableOk() (*bool, bool) { + if o == nil || IsNil(o.Purchasable) { + return nil, false + } + return o.Purchasable, true +} + +// HasPurchasable returns a boolean if a field has been set. +func (o *UpdatePurchasability) HasPurchasable() bool { + if o != nil && !IsNil(o.Purchasable) { + return true + } + + return false +} + +// SetPurchasable gets a reference to the given bool and assigns it to the Purchasable field. +func (o *UpdatePurchasability) SetPurchasable(v bool) { + o.Purchasable = &v +} + +func (o UpdatePurchasability) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdatePurchasability) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Purchasable) { + toSerialize["purchasable"] = o.Purchasable + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdatePurchasability) UnmarshalJSON(data []byte) (err error) { + varUpdatePurchasability := _UpdatePurchasability{} + + err = json.Unmarshal(data, &varUpdatePurchasability) + + if err != nil { + return err + } + + *o = UpdatePurchasability(varUpdatePurchasability) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + delete(additionalProperties, "purchasable") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdatePurchasability struct { + value *UpdatePurchasability + isSet bool +} + +func (v NullableUpdatePurchasability) Get() *UpdatePurchasability { + return v.value +} + +func (v *NullableUpdatePurchasability) Set(val *UpdatePurchasability) { + v.value = val + v.isSet = true +} + +func (v NullableUpdatePurchasability) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdatePurchasability) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdatePurchasability(val *UpdatePurchasability) *NullableUpdatePurchasability { + return &NullableUpdatePurchasability{value: val, isSet: true} +} + +func (v NullableUpdatePurchasability) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdatePurchasability) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_special_hour_request.go b/model_update_special_hour_request.go new file mode 100644 index 0000000..9d71000 --- /dev/null +++ b/model_update_special_hour_request.go @@ -0,0 +1,172 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateSpecialHourRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSpecialHourRequest{} + +// UpdateSpecialHourRequest Object contains store special hours. +type UpdateSpecialHourRequest struct { + // An array of objects contain store special hours. Max. 3 array elements. + SpecialOpeningHours []SpecialOpeningHour `json:"specialOpeningHours"` + AdditionalProperties map[string]interface{} +} + +type _UpdateSpecialHourRequest UpdateSpecialHourRequest + +// NewUpdateSpecialHourRequest instantiates a new UpdateSpecialHourRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSpecialHourRequest(specialOpeningHours []SpecialOpeningHour) *UpdateSpecialHourRequest { + this := UpdateSpecialHourRequest{} + this.SpecialOpeningHours = specialOpeningHours + return &this +} + +// NewUpdateSpecialHourRequestWithDefaults instantiates a new UpdateSpecialHourRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSpecialHourRequestWithDefaults() *UpdateSpecialHourRequest { + this := UpdateSpecialHourRequest{} + return &this +} + +// GetSpecialOpeningHours returns the SpecialOpeningHours field value +func (o *UpdateSpecialHourRequest) GetSpecialOpeningHours() []SpecialOpeningHour { + if o == nil { + var ret []SpecialOpeningHour + return ret + } + + return o.SpecialOpeningHours +} + +// GetSpecialOpeningHoursOk returns a tuple with the SpecialOpeningHours field value +// and a boolean to check if the value has been set. +func (o *UpdateSpecialHourRequest) GetSpecialOpeningHoursOk() ([]SpecialOpeningHour, bool) { + if o == nil { + return nil, false + } + return o.SpecialOpeningHours, true +} + +// SetSpecialOpeningHours sets field value +func (o *UpdateSpecialHourRequest) SetSpecialOpeningHours(v []SpecialOpeningHour) { + o.SpecialOpeningHours = v +} + +func (o UpdateSpecialHourRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSpecialHourRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["specialOpeningHours"] = o.SpecialOpeningHours + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateSpecialHourRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "specialOpeningHours", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateSpecialHourRequest := _UpdateSpecialHourRequest{} + + err = json.Unmarshal(data, &varUpdateSpecialHourRequest) + + if err != nil { + return err + } + + *o = UpdateSpecialHourRequest(varUpdateSpecialHourRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "specialOpeningHours") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateSpecialHourRequest struct { + value *UpdateSpecialHourRequest + isSet bool +} + +func (v NullableUpdateSpecialHourRequest) Get() *UpdateSpecialHourRequest { + return v.value +} + +func (v *NullableUpdateSpecialHourRequest) Set(val *UpdateSpecialHourRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSpecialHourRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSpecialHourRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSpecialHourRequest(val *UpdateSpecialHourRequest) *NullableUpdateSpecialHourRequest { + return &NullableUpdateSpecialHourRequest{value: val, isSet: true} +} + +func (v NullableUpdateSpecialHourRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSpecialHourRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_update_special_hour_response.go b/model_update_special_hour_response.go new file mode 100644 index 0000000..b7ae290 --- /dev/null +++ b/model_update_special_hour_response.go @@ -0,0 +1,271 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" + "fmt" +) + +// checks if the UpdateSpecialHourResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSpecialHourResponse{} + +// UpdateSpecialHourResponse Object contain update store special hour response +type UpdateSpecialHourResponse struct { + // Error message when updating store delivery hour. `null` indicates no error. + ErrorReasons []string `json:"errorReasons,omitempty"` + // Total active order for the day. + OrderCount int64 `json:"orderCount"` + // Total scheduled order during store close period. + ScheduledOrderCount int64 `json:"scheduledOrderCount"` + // Indicate the store status after updating special hours. + CloseImmediately bool `json:"closeImmediately"` + AdditionalProperties map[string]interface{} +} + +type _UpdateSpecialHourResponse UpdateSpecialHourResponse + +// NewUpdateSpecialHourResponse instantiates a new UpdateSpecialHourResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSpecialHourResponse(orderCount int64, scheduledOrderCount int64, closeImmediately bool) *UpdateSpecialHourResponse { + this := UpdateSpecialHourResponse{} + this.OrderCount = orderCount + this.ScheduledOrderCount = scheduledOrderCount + this.CloseImmediately = closeImmediately + return &this +} + +// NewUpdateSpecialHourResponseWithDefaults instantiates a new UpdateSpecialHourResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSpecialHourResponseWithDefaults() *UpdateSpecialHourResponse { + this := UpdateSpecialHourResponse{} + return &this +} + +// GetErrorReasons returns the ErrorReasons field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateSpecialHourResponse) GetErrorReasons() []string { + if o == nil { + var ret []string + return ret + } + return o.ErrorReasons +} + +// GetErrorReasonsOk returns a tuple with the ErrorReasons field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateSpecialHourResponse) GetErrorReasonsOk() ([]string, bool) { + if o == nil || IsNil(o.ErrorReasons) { + return nil, false + } + return o.ErrorReasons, true +} + +// HasErrorReasons returns a boolean if a field has been set. +func (o *UpdateSpecialHourResponse) HasErrorReasons() bool { + if o != nil && !IsNil(o.ErrorReasons) { + return true + } + + return false +} + +// SetErrorReasons gets a reference to the given []string and assigns it to the ErrorReasons field. +func (o *UpdateSpecialHourResponse) SetErrorReasons(v []string) { + o.ErrorReasons = v +} + +// GetOrderCount returns the OrderCount field value +func (o *UpdateSpecialHourResponse) GetOrderCount() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.OrderCount +} + +// GetOrderCountOk returns a tuple with the OrderCount field value +// and a boolean to check if the value has been set. +func (o *UpdateSpecialHourResponse) GetOrderCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.OrderCount, true +} + +// SetOrderCount sets field value +func (o *UpdateSpecialHourResponse) SetOrderCount(v int64) { + o.OrderCount = v +} + +// GetScheduledOrderCount returns the ScheduledOrderCount field value +func (o *UpdateSpecialHourResponse) GetScheduledOrderCount() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ScheduledOrderCount +} + +// GetScheduledOrderCountOk returns a tuple with the ScheduledOrderCount field value +// and a boolean to check if the value has been set. +func (o *UpdateSpecialHourResponse) GetScheduledOrderCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ScheduledOrderCount, true +} + +// SetScheduledOrderCount sets field value +func (o *UpdateSpecialHourResponse) SetScheduledOrderCount(v int64) { + o.ScheduledOrderCount = v +} + +// GetCloseImmediately returns the CloseImmediately field value +func (o *UpdateSpecialHourResponse) GetCloseImmediately() bool { + if o == nil { + var ret bool + return ret + } + + return o.CloseImmediately +} + +// GetCloseImmediatelyOk returns a tuple with the CloseImmediately field value +// and a boolean to check if the value has been set. +func (o *UpdateSpecialHourResponse) GetCloseImmediatelyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CloseImmediately, true +} + +// SetCloseImmediately sets field value +func (o *UpdateSpecialHourResponse) SetCloseImmediately(v bool) { + o.CloseImmediately = v +} + +func (o UpdateSpecialHourResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSpecialHourResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.ErrorReasons != nil { + toSerialize["errorReasons"] = o.ErrorReasons + } + toSerialize["orderCount"] = o.OrderCount + toSerialize["scheduledOrderCount"] = o.ScheduledOrderCount + toSerialize["closeImmediately"] = o.CloseImmediately + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UpdateSpecialHourResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "orderCount", + "scheduledOrderCount", + "closeImmediately", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err; + } + + for _, requiredProperty := range(requiredProperties) { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateSpecialHourResponse := _UpdateSpecialHourResponse{} + + err = json.Unmarshal(data, &varUpdateSpecialHourResponse) + + if err != nil { + return err + } + + *o = UpdateSpecialHourResponse(varUpdateSpecialHourResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "errorReasons") + delete(additionalProperties, "orderCount") + delete(additionalProperties, "scheduledOrderCount") + delete(additionalProperties, "closeImmediately") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUpdateSpecialHourResponse struct { + value *UpdateSpecialHourResponse + isSet bool +} + +func (v NullableUpdateSpecialHourResponse) Get() *UpdateSpecialHourResponse { + return v.value +} + +func (v *NullableUpdateSpecialHourResponse) Set(val *UpdateSpecialHourResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSpecialHourResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSpecialHourResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSpecialHourResponse(val *UpdateSpecialHourResponse) *NullableUpdateSpecialHourResponse { + return &NullableUpdateSpecialHourResponse{value: val, isSet: true} +} + +func (v NullableUpdateSpecialHourResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSpecialHourResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_voucher.go b/model_voucher.go new file mode 100644 index 0000000..a72441f --- /dev/null +++ b/model_voucher.go @@ -0,0 +1,310 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the Voucher type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Voucher{} + +// Voucher A JSON object containing dine-in voucher details. +type Voucher struct { + // The title of the voucher. + Title *string `json:"title,omitempty"` + // The amount paid after discount is applied in local currency. + DiscountedPrice *string `json:"discountedPrice,omitempty"` + // The original amount before discount is applied in local currency. + OriginalPrice *string `json:"originalPrice,omitempty"` + DescriptionInfo *VoucherDescriptionInfo `json:"descriptionInfo,omitempty"` + // The type of the dine-in voucher. + VoucherType *string `json:"voucherType,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Voucher Voucher + +// NewVoucher instantiates a new Voucher object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVoucher() *Voucher { + this := Voucher{} + return &this +} + +// NewVoucherWithDefaults instantiates a new Voucher object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVoucherWithDefaults() *Voucher { + this := Voucher{} + return &this +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *Voucher) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Voucher) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *Voucher) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *Voucher) SetTitle(v string) { + o.Title = &v +} + +// GetDiscountedPrice returns the DiscountedPrice field value if set, zero value otherwise. +func (o *Voucher) GetDiscountedPrice() string { + if o == nil || IsNil(o.DiscountedPrice) { + var ret string + return ret + } + return *o.DiscountedPrice +} + +// GetDiscountedPriceOk returns a tuple with the DiscountedPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Voucher) GetDiscountedPriceOk() (*string, bool) { + if o == nil || IsNil(o.DiscountedPrice) { + return nil, false + } + return o.DiscountedPrice, true +} + +// HasDiscountedPrice returns a boolean if a field has been set. +func (o *Voucher) HasDiscountedPrice() bool { + if o != nil && !IsNil(o.DiscountedPrice) { + return true + } + + return false +} + +// SetDiscountedPrice gets a reference to the given string and assigns it to the DiscountedPrice field. +func (o *Voucher) SetDiscountedPrice(v string) { + o.DiscountedPrice = &v +} + +// GetOriginalPrice returns the OriginalPrice field value if set, zero value otherwise. +func (o *Voucher) GetOriginalPrice() string { + if o == nil || IsNil(o.OriginalPrice) { + var ret string + return ret + } + return *o.OriginalPrice +} + +// GetOriginalPriceOk returns a tuple with the OriginalPrice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Voucher) GetOriginalPriceOk() (*string, bool) { + if o == nil || IsNil(o.OriginalPrice) { + return nil, false + } + return o.OriginalPrice, true +} + +// HasOriginalPrice returns a boolean if a field has been set. +func (o *Voucher) HasOriginalPrice() bool { + if o != nil && !IsNil(o.OriginalPrice) { + return true + } + + return false +} + +// SetOriginalPrice gets a reference to the given string and assigns it to the OriginalPrice field. +func (o *Voucher) SetOriginalPrice(v string) { + o.OriginalPrice = &v +} + +// GetDescriptionInfo returns the DescriptionInfo field value if set, zero value otherwise. +func (o *Voucher) GetDescriptionInfo() VoucherDescriptionInfo { + if o == nil || IsNil(o.DescriptionInfo) { + var ret VoucherDescriptionInfo + return ret + } + return *o.DescriptionInfo +} + +// GetDescriptionInfoOk returns a tuple with the DescriptionInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Voucher) GetDescriptionInfoOk() (*VoucherDescriptionInfo, bool) { + if o == nil || IsNil(o.DescriptionInfo) { + return nil, false + } + return o.DescriptionInfo, true +} + +// HasDescriptionInfo returns a boolean if a field has been set. +func (o *Voucher) HasDescriptionInfo() bool { + if o != nil && !IsNil(o.DescriptionInfo) { + return true + } + + return false +} + +// SetDescriptionInfo gets a reference to the given VoucherDescriptionInfo and assigns it to the DescriptionInfo field. +func (o *Voucher) SetDescriptionInfo(v VoucherDescriptionInfo) { + o.DescriptionInfo = &v +} + +// GetVoucherType returns the VoucherType field value if set, zero value otherwise. +func (o *Voucher) GetVoucherType() string { + if o == nil || IsNil(o.VoucherType) { + var ret string + return ret + } + return *o.VoucherType +} + +// GetVoucherTypeOk returns a tuple with the VoucherType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Voucher) GetVoucherTypeOk() (*string, bool) { + if o == nil || IsNil(o.VoucherType) { + return nil, false + } + return o.VoucherType, true +} + +// HasVoucherType returns a boolean if a field has been set. +func (o *Voucher) HasVoucherType() bool { + if o != nil && !IsNil(o.VoucherType) { + return true + } + + return false +} + +// SetVoucherType gets a reference to the given string and assigns it to the VoucherType field. +func (o *Voucher) SetVoucherType(v string) { + o.VoucherType = &v +} + +func (o Voucher) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Voucher) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.DiscountedPrice) { + toSerialize["discountedPrice"] = o.DiscountedPrice + } + if !IsNil(o.OriginalPrice) { + toSerialize["originalPrice"] = o.OriginalPrice + } + if !IsNil(o.DescriptionInfo) { + toSerialize["descriptionInfo"] = o.DescriptionInfo + } + if !IsNil(o.VoucherType) { + toSerialize["voucherType"] = o.VoucherType + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Voucher) UnmarshalJSON(data []byte) (err error) { + varVoucher := _Voucher{} + + err = json.Unmarshal(data, &varVoucher) + + if err != nil { + return err + } + + *o = Voucher(varVoucher) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "title") + delete(additionalProperties, "discountedPrice") + delete(additionalProperties, "originalPrice") + delete(additionalProperties, "descriptionInfo") + delete(additionalProperties, "voucherType") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVoucher struct { + value *Voucher + isSet bool +} + +func (v NullableVoucher) Get() *Voucher { + return v.value +} + +func (v *NullableVoucher) Set(val *Voucher) { + v.value = val + v.isSet = true +} + +func (v NullableVoucher) IsSet() bool { + return v.isSet +} + +func (v *NullableVoucher) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVoucher(val *Voucher) *NullableVoucher { + return &NullableVoucher{value: val, isSet: true} +} + +func (v NullableVoucher) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVoucher) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_voucher_description_info.go b/model_voucher_description_info.go new file mode 100644 index 0000000..ebf7d55 --- /dev/null +++ b/model_voucher_description_info.go @@ -0,0 +1,159 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the VoucherDescriptionInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VoucherDescriptionInfo{} + +// VoucherDescriptionInfo A JSON object containing dine-in voucher's description information. +type VoucherDescriptionInfo struct { + // The description of the dine-in voucher. + Text *string `json:"text,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _VoucherDescriptionInfo VoucherDescriptionInfo + +// NewVoucherDescriptionInfo instantiates a new VoucherDescriptionInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVoucherDescriptionInfo() *VoucherDescriptionInfo { + this := VoucherDescriptionInfo{} + return &this +} + +// NewVoucherDescriptionInfoWithDefaults instantiates a new VoucherDescriptionInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVoucherDescriptionInfoWithDefaults() *VoucherDescriptionInfo { + this := VoucherDescriptionInfo{} + return &this +} + +// GetText returns the Text field value if set, zero value otherwise. +func (o *VoucherDescriptionInfo) GetText() string { + if o == nil || IsNil(o.Text) { + var ret string + return ret + } + return *o.Text +} + +// GetTextOk returns a tuple with the Text field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VoucherDescriptionInfo) GetTextOk() (*string, bool) { + if o == nil || IsNil(o.Text) { + return nil, false + } + return o.Text, true +} + +// HasText returns a boolean if a field has been set. +func (o *VoucherDescriptionInfo) HasText() bool { + if o != nil && !IsNil(o.Text) { + return true + } + + return false +} + +// SetText gets a reference to the given string and assigns it to the Text field. +func (o *VoucherDescriptionInfo) SetText(v string) { + o.Text = &v +} + +func (o VoucherDescriptionInfo) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VoucherDescriptionInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Text) { + toSerialize["text"] = o.Text + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VoucherDescriptionInfo) UnmarshalJSON(data []byte) (err error) { + varVoucherDescriptionInfo := _VoucherDescriptionInfo{} + + err = json.Unmarshal(data, &varVoucherDescriptionInfo) + + if err != nil { + return err + } + + *o = VoucherDescriptionInfo(varVoucherDescriptionInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "text") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVoucherDescriptionInfo struct { + value *VoucherDescriptionInfo + isSet bool +} + +func (v NullableVoucherDescriptionInfo) Get() *VoucherDescriptionInfo { + return v.value +} + +func (v *NullableVoucherDescriptionInfo) Set(val *VoucherDescriptionInfo) { + v.value = val + v.isSet = true +} + +func (v NullableVoucherDescriptionInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableVoucherDescriptionInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVoucherDescriptionInfo(val *VoucherDescriptionInfo) *NullableVoucherDescriptionInfo { + return &NullableVoucherDescriptionInfo{value: val, isSet: true} +} + +func (v NullableVoucherDescriptionInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVoucherDescriptionInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_working_hour.go b/model_working_hour.go new file mode 100644 index 0000000..0d457e6 --- /dev/null +++ b/model_working_hour.go @@ -0,0 +1,380 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the WorkingHour type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WorkingHour{} + +// WorkingHour A JSON object that describes the workingHour for each day. +type WorkingHour struct { + Sun *WorkingHourDay `json:"sun,omitempty"` + Mon *WorkingHourDay `json:"mon,omitempty"` + Tue *WorkingHourDay `json:"tue,omitempty"` + Wed *WorkingHourDay `json:"wed,omitempty"` + Thu *WorkingHourDay `json:"thu,omitempty"` + Fri *WorkingHourDay `json:"fri,omitempty"` + Sat *WorkingHourDay `json:"sat,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WorkingHour WorkingHour + +// NewWorkingHour instantiates a new WorkingHour object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWorkingHour() *WorkingHour { + this := WorkingHour{} + return &this +} + +// NewWorkingHourWithDefaults instantiates a new WorkingHour object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWorkingHourWithDefaults() *WorkingHour { + this := WorkingHour{} + return &this +} + +// GetSun returns the Sun field value if set, zero value otherwise. +func (o *WorkingHour) GetSun() WorkingHourDay { + if o == nil || IsNil(o.Sun) { + var ret WorkingHourDay + return ret + } + return *o.Sun +} + +// GetSunOk returns a tuple with the Sun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetSunOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Sun) { + return nil, false + } + return o.Sun, true +} + +// HasSun returns a boolean if a field has been set. +func (o *WorkingHour) HasSun() bool { + if o != nil && !IsNil(o.Sun) { + return true + } + + return false +} + +// SetSun gets a reference to the given WorkingHourDay and assigns it to the Sun field. +func (o *WorkingHour) SetSun(v WorkingHourDay) { + o.Sun = &v +} + +// GetMon returns the Mon field value if set, zero value otherwise. +func (o *WorkingHour) GetMon() WorkingHourDay { + if o == nil || IsNil(o.Mon) { + var ret WorkingHourDay + return ret + } + return *o.Mon +} + +// GetMonOk returns a tuple with the Mon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetMonOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Mon) { + return nil, false + } + return o.Mon, true +} + +// HasMon returns a boolean if a field has been set. +func (o *WorkingHour) HasMon() bool { + if o != nil && !IsNil(o.Mon) { + return true + } + + return false +} + +// SetMon gets a reference to the given WorkingHourDay and assigns it to the Mon field. +func (o *WorkingHour) SetMon(v WorkingHourDay) { + o.Mon = &v +} + +// GetTue returns the Tue field value if set, zero value otherwise. +func (o *WorkingHour) GetTue() WorkingHourDay { + if o == nil || IsNil(o.Tue) { + var ret WorkingHourDay + return ret + } + return *o.Tue +} + +// GetTueOk returns a tuple with the Tue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetTueOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Tue) { + return nil, false + } + return o.Tue, true +} + +// HasTue returns a boolean if a field has been set. +func (o *WorkingHour) HasTue() bool { + if o != nil && !IsNil(o.Tue) { + return true + } + + return false +} + +// SetTue gets a reference to the given WorkingHourDay and assigns it to the Tue field. +func (o *WorkingHour) SetTue(v WorkingHourDay) { + o.Tue = &v +} + +// GetWed returns the Wed field value if set, zero value otherwise. +func (o *WorkingHour) GetWed() WorkingHourDay { + if o == nil || IsNil(o.Wed) { + var ret WorkingHourDay + return ret + } + return *o.Wed +} + +// GetWedOk returns a tuple with the Wed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetWedOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Wed) { + return nil, false + } + return o.Wed, true +} + +// HasWed returns a boolean if a field has been set. +func (o *WorkingHour) HasWed() bool { + if o != nil && !IsNil(o.Wed) { + return true + } + + return false +} + +// SetWed gets a reference to the given WorkingHourDay and assigns it to the Wed field. +func (o *WorkingHour) SetWed(v WorkingHourDay) { + o.Wed = &v +} + +// GetThu returns the Thu field value if set, zero value otherwise. +func (o *WorkingHour) GetThu() WorkingHourDay { + if o == nil || IsNil(o.Thu) { + var ret WorkingHourDay + return ret + } + return *o.Thu +} + +// GetThuOk returns a tuple with the Thu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetThuOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Thu) { + return nil, false + } + return o.Thu, true +} + +// HasThu returns a boolean if a field has been set. +func (o *WorkingHour) HasThu() bool { + if o != nil && !IsNil(o.Thu) { + return true + } + + return false +} + +// SetThu gets a reference to the given WorkingHourDay and assigns it to the Thu field. +func (o *WorkingHour) SetThu(v WorkingHourDay) { + o.Thu = &v +} + +// GetFri returns the Fri field value if set, zero value otherwise. +func (o *WorkingHour) GetFri() WorkingHourDay { + if o == nil || IsNil(o.Fri) { + var ret WorkingHourDay + return ret + } + return *o.Fri +} + +// GetFriOk returns a tuple with the Fri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetFriOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Fri) { + return nil, false + } + return o.Fri, true +} + +// HasFri returns a boolean if a field has been set. +func (o *WorkingHour) HasFri() bool { + if o != nil && !IsNil(o.Fri) { + return true + } + + return false +} + +// SetFri gets a reference to the given WorkingHourDay and assigns it to the Fri field. +func (o *WorkingHour) SetFri(v WorkingHourDay) { + o.Fri = &v +} + +// GetSat returns the Sat field value if set, zero value otherwise. +func (o *WorkingHour) GetSat() WorkingHourDay { + if o == nil || IsNil(o.Sat) { + var ret WorkingHourDay + return ret + } + return *o.Sat +} + +// GetSatOk returns a tuple with the Sat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkingHour) GetSatOk() (*WorkingHourDay, bool) { + if o == nil || IsNil(o.Sat) { + return nil, false + } + return o.Sat, true +} + +// HasSat returns a boolean if a field has been set. +func (o *WorkingHour) HasSat() bool { + if o != nil && !IsNil(o.Sat) { + return true + } + + return false +} + +// SetSat gets a reference to the given WorkingHourDay and assigns it to the Sat field. +func (o *WorkingHour) SetSat(v WorkingHourDay) { + o.Sat = &v +} + +func (o WorkingHour) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WorkingHour) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Sun) { + toSerialize["sun"] = o.Sun + } + if !IsNil(o.Mon) { + toSerialize["mon"] = o.Mon + } + if !IsNil(o.Tue) { + toSerialize["tue"] = o.Tue + } + if !IsNil(o.Wed) { + toSerialize["wed"] = o.Wed + } + if !IsNil(o.Thu) { + toSerialize["thu"] = o.Thu + } + if !IsNil(o.Fri) { + toSerialize["fri"] = o.Fri + } + if !IsNil(o.Sat) { + toSerialize["sat"] = o.Sat + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WorkingHour) UnmarshalJSON(data []byte) (err error) { + varWorkingHour := _WorkingHour{} + + err = json.Unmarshal(data, &varWorkingHour) + + if err != nil { + return err + } + + *o = WorkingHour(varWorkingHour) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "sun") + delete(additionalProperties, "mon") + delete(additionalProperties, "tue") + delete(additionalProperties, "wed") + delete(additionalProperties, "thu") + delete(additionalProperties, "fri") + delete(additionalProperties, "sat") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWorkingHour struct { + value *WorkingHour + isSet bool +} + +func (v NullableWorkingHour) Get() *WorkingHour { + return v.value +} + +func (v *NullableWorkingHour) Set(val *WorkingHour) { + v.value = val + v.isSet = true +} + +func (v NullableWorkingHour) IsSet() bool { + return v.isSet +} + +func (v *NullableWorkingHour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWorkingHour(val *WorkingHour) *NullableWorkingHour { + return &NullableWorkingHour{value: val, isSet: true} +} + +func (v NullableWorkingHour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWorkingHour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/model_working_hour_day.go b/model_working_hour_day.go new file mode 100644 index 0000000..423c5eb --- /dev/null +++ b/model_working_hour_day.go @@ -0,0 +1,160 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "encoding/json" +) + +// checks if the WorkingHourDay type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WorkingHourDay{} + +// WorkingHourDay A JSON object for workingHour for a day. +type WorkingHourDay struct { + // An array of open periods. `null` in [ListCampaign](#tag/list-campaign) response if the campaign is available all day. + Periods []OpenPeriod `json:"periods,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WorkingHourDay WorkingHourDay + +// NewWorkingHourDay instantiates a new WorkingHourDay object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWorkingHourDay() *WorkingHourDay { + this := WorkingHourDay{} + return &this +} + +// NewWorkingHourDayWithDefaults instantiates a new WorkingHourDay object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWorkingHourDayWithDefaults() *WorkingHourDay { + this := WorkingHourDay{} + return &this +} + +// GetPeriods returns the Periods field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WorkingHourDay) GetPeriods() []OpenPeriod { + if o == nil { + var ret []OpenPeriod + return ret + } + return o.Periods +} + +// GetPeriodsOk returns a tuple with the Periods field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WorkingHourDay) GetPeriodsOk() ([]OpenPeriod, bool) { + if o == nil || IsNil(o.Periods) { + return nil, false + } + return o.Periods, true +} + +// HasPeriods returns a boolean if a field has been set. +func (o *WorkingHourDay) HasPeriods() bool { + if o != nil && !IsNil(o.Periods) { + return true + } + + return false +} + +// SetPeriods gets a reference to the given []OpenPeriod and assigns it to the Periods field. +func (o *WorkingHourDay) SetPeriods(v []OpenPeriod) { + o.Periods = v +} + +func (o WorkingHourDay) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WorkingHourDay) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Periods != nil { + toSerialize["periods"] = o.Periods + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WorkingHourDay) UnmarshalJSON(data []byte) (err error) { + varWorkingHourDay := _WorkingHourDay{} + + err = json.Unmarshal(data, &varWorkingHourDay) + + if err != nil { + return err + } + + *o = WorkingHourDay(varWorkingHourDay) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "periods") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWorkingHourDay struct { + value *WorkingHourDay + isSet bool +} + +func (v NullableWorkingHourDay) Get() *WorkingHourDay { + return v.value +} + +func (v *NullableWorkingHourDay) Set(val *WorkingHourDay) { + v.value = val + v.isSet = true +} + +func (v NullableWorkingHourDay) IsSet() bool { + return v.isSet +} + +func (v *NullableWorkingHourDay) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWorkingHourDay(val *WorkingHourDay) *NullableWorkingHourDay { + return &NullableWorkingHourDay{value: val, isSet: true} +} + +func (v NullableWorkingHourDay) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWorkingHourDay) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/response.go b/response.go new file mode 100644 index 0000000..9e5ef46 --- /dev/null +++ b/response.go @@ -0,0 +1,50 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..ceb2115 --- /dev/null +++ b/utils.go @@ -0,0 +1,364 @@ +// Copyright 2024 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. +// Use of this source code is governed by an MIT-style license that can be found in the LICENSE file + +/* +GrabFood + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: 1.1.3 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package grabfood + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} \ No newline at end of file