quandoo 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +197 -0
- data/Rakefile +8 -0
- data/config.json +8 -0
- data/docs/AgentTracking.md +8 -0
- data/docs/AreaDto.md +10 -0
- data/docs/AvailabilitiesApi.md +132 -0
- data/docs/ChainDto.md +9 -0
- data/docs/ChangedReviewDto.md +10 -0
- data/docs/CoordinatesDto.md +9 -0
- data/docs/CreateReviewDto.md +10 -0
- data/docs/CreatedMasterCustomer.md +8 -0
- data/docs/CreatedReservation.md +11 -0
- data/docs/CreatedReservationData.md +10 -0
- data/docs/CreatedReservationEnquiry.md +8 -0
- data/docs/CreatedReservationEnquiryData.md +10 -0
- data/docs/CustomerDataList.md +10 -0
- data/docs/CustomerDto.md +10 -0
- data/docs/CustomerResponse.md +17 -0
- data/docs/CustomerReviewData.md +11 -0
- data/docs/CustomerStatisticsData.md +10 -0
- data/docs/CustomersApi.md +183 -0
- data/docs/DealData.md +10 -0
- data/docs/DocumentDto.md +11 -0
- data/docs/ErrorResponse.md +9 -0
- data/docs/GetReservationEnquiryData.md +14 -0
- data/docs/GetReviewDto.md +14 -0
- data/docs/GetReviewsDto.md +11 -0
- data/docs/ImageDto.md +8 -0
- data/docs/LinkRelationDto.md +10 -0
- data/docs/LocationDto.md +9 -0
- data/docs/MarketingSettingDto.md +9 -0
- data/docs/MenusApi.md +300 -0
- data/docs/MerchantAddressDto.md +12 -0
- data/docs/MerchantAvailabilityDaysDto.md +9 -0
- data/docs/MerchantAvailabilityDto.md +11 -0
- data/docs/MerchantAvailabilityDtoList.md +10 -0
- data/docs/MerchantCustomer.md +15 -0
- data/docs/MerchantCustomerData.md +21 -0
- data/docs/MerchantDetailsDto.md +24 -0
- data/docs/MerchantDetailsDtoList.md +11 -0
- data/docs/MerchantMenuCategoryDto.md +10 -0
- data/docs/MerchantMenuDto.md +13 -0
- data/docs/MerchantMenuItemDto.md +11 -0
- data/docs/MerchantMenusDto.md +8 -0
- data/docs/MerchantReservation.md +18 -0
- data/docs/MerchantReservationData.md +10 -0
- data/docs/MerchantReservationEnquiry.md +13 -0
- data/docs/MerchantReservationEnquiryData.md +10 -0
- data/docs/MerchantReservationSettingsDto.md +18 -0
- data/docs/MerchantSubscription.md +8 -0
- data/docs/MerchantVaultSettingsDto.md +11 -0
- data/docs/MerchantWithRecommendationsDto.md +10 -0
- data/docs/MerchantsApi.md +334 -0
- data/docs/OpeningTimesDto.md +8 -0
- data/docs/ReservationData.md +18 -0
- data/docs/ReservationDataList.md +8 -0
- data/docs/ReservationDetails.md +11 -0
- data/docs/ReservationEnquiriesApi.md +230 -0
- data/docs/ReservationEnquiryMessageData.md +10 -0
- data/docs/ReservationEnquiryMessageList.md +8 -0
- data/docs/ReservationMenuData.md +8 -0
- data/docs/ReservationMenuItemData.md +12 -0
- data/docs/ReservationSettingsApi.md +56 -0
- data/docs/ReservationsApi.md +168 -0
- data/docs/RestCookie.md +9 -0
- data/docs/ReviewDto.md +12 -0
- data/docs/ReviewDtoList.md +11 -0
- data/docs/ReviewsApi.md +235 -0
- data/docs/StandardOpeningTimesDto.md +7 -0
- data/docs/StatusApi.md +90 -0
- data/docs/TagGroupDto.md +9 -0
- data/docs/Tracking.md +9 -0
- data/docs/TranslatedTagDto.md +9 -0
- data/docs/UpdateReservationData.md +8 -0
- data/docs/UpdateReservationEnquiryData.md +8 -0
- data/docs/UpdateReviewDto.md +10 -0
- data/docs/ValidationsApi.md +59 -0
- data/git_push.sh +55 -0
- data/lib/quandoo.rb +113 -0
- data/lib/quandoo/api/availabilities_api.rb +171 -0
- data/lib/quandoo/api/customers_api.rb +185 -0
- data/lib/quandoo/api/menus_api.rb +301 -0
- data/lib/quandoo/api/merchants_api.rb +357 -0
- data/lib/quandoo/api/reservation_enquiries_api.rb +232 -0
- data/lib/quandoo/api/reservation_settings_api.rb +73 -0
- data/lib/quandoo/api/reservations_api.rb +178 -0
- data/lib/quandoo/api/reviews_api.rb +241 -0
- data/lib/quandoo/api/status_api.rb +111 -0
- data/lib/quandoo/api/validations_api.rb +76 -0
- data/lib/quandoo/api_client.rb +389 -0
- data/lib/quandoo/api_error.rb +38 -0
- data/lib/quandoo/configuration.rb +216 -0
- data/lib/quandoo/models/agent_tracking.rb +189 -0
- data/lib/quandoo/models/area_dto.rb +204 -0
- data/lib/quandoo/models/chain_dto.rb +192 -0
- data/lib/quandoo/models/changed_review_dto.rb +250 -0
- data/lib/quandoo/models/coordinates_dto.rb +192 -0
- data/lib/quandoo/models/create_review_dto.rb +214 -0
- data/lib/quandoo/models/created_master_customer.rb +189 -0
- data/lib/quandoo/models/created_reservation.rb +229 -0
- data/lib/quandoo/models/created_reservation_data.rb +221 -0
- data/lib/quandoo/models/created_reservation_enquiry.rb +189 -0
- data/lib/quandoo/models/created_reservation_enquiry_data.rb +221 -0
- data/lib/quandoo/models/customer_data_list.rb +203 -0
- data/lib/quandoo/models/customer_dto.rb +201 -0
- data/lib/quandoo/models/customer_response.rb +362 -0
- data/lib/quandoo/models/customer_review_data.rb +214 -0
- data/lib/quandoo/models/customer_statistics_data.rb +219 -0
- data/lib/quandoo/models/deal_data.rb +253 -0
- data/lib/quandoo/models/document_dto.rb +210 -0
- data/lib/quandoo/models/error_response.rb +226 -0
- data/lib/quandoo/models/get_reservation_enquiry_data.rb +249 -0
- data/lib/quandoo/models/get_review_dto.rb +288 -0
- data/lib/quandoo/models/get_reviews_dto.rb +216 -0
- data/lib/quandoo/models/image_dto.rb +183 -0
- data/lib/quandoo/models/link_relation_dto.rb +235 -0
- data/lib/quandoo/models/location_dto.rb +192 -0
- data/lib/quandoo/models/marketing_setting_dto.rb +238 -0
- data/lib/quandoo/models/merchant_address_dto.rb +219 -0
- data/lib/quandoo/models/merchant_availability_days_dto.rb +198 -0
- data/lib/quandoo/models/merchant_availability_dto.rb +226 -0
- data/lib/quandoo/models/merchant_availability_dto_list.rb +215 -0
- data/lib/quandoo/models/merchant_customer.rb +271 -0
- data/lib/quandoo/models/merchant_customer_data.rb +390 -0
- data/lib/quandoo/models/merchant_details_dto.rb +402 -0
- data/lib/quandoo/models/merchant_details_dto_list.rb +218 -0
- data/lib/quandoo/models/merchant_menu_category_dto.rb +216 -0
- data/lib/quandoo/models/merchant_menu_dto.rb +251 -0
- data/lib/quandoo/models/merchant_menu_item_dto.rb +224 -0
- data/lib/quandoo/models/merchant_menus_dto.rb +185 -0
- data/lib/quandoo/models/merchant_reservation.rb +301 -0
- data/lib/quandoo/models/merchant_reservation_data.rb +219 -0
- data/lib/quandoo/models/merchant_reservation_enquiry.rb +311 -0
- data/lib/quandoo/models/merchant_reservation_enquiry_data.rb +219 -0
- data/lib/quandoo/models/merchant_reservation_settings_dto.rb +290 -0
- data/lib/quandoo/models/merchant_subscription.rb +217 -0
- data/lib/quandoo/models/merchant_vault_settings_dto.rb +231 -0
- data/lib/quandoo/models/merchant_with_recommendations_dto.rb +248 -0
- data/lib/quandoo/models/opening_times_dto.rb +189 -0
- data/lib/quandoo/models/reservation_data.rb +331 -0
- data/lib/quandoo/models/reservation_data_list.rb +185 -0
- data/lib/quandoo/models/reservation_details.rb +229 -0
- data/lib/quandoo/models/reservation_enquiry_message_data.rb +241 -0
- data/lib/quandoo/models/reservation_enquiry_message_list.rb +185 -0
- data/lib/quandoo/models/reservation_menu_data.rb +190 -0
- data/lib/quandoo/models/reservation_menu_item_data.rb +219 -0
- data/lib/quandoo/models/rest_cookie.rb +194 -0
- data/lib/quandoo/models/review_dto.rb +238 -0
- data/lib/quandoo/models/review_dto_list.rb +218 -0
- data/lib/quandoo/models/standard_opening_times_dto.rb +174 -0
- data/lib/quandoo/models/tag_group_dto.rb +228 -0
- data/lib/quandoo/models/tracking.rb +199 -0
- data/lib/quandoo/models/translated_tag_dto.rb +192 -0
- data/lib/quandoo/models/update_reservation_data.rb +189 -0
- data/lib/quandoo/models/update_reservation_enquiry_data.rb +184 -0
- data/lib/quandoo/models/update_review_dto.rb +209 -0
- data/lib/quandoo/version.rb +15 -0
- data/quandoo.gemspec +45 -0
- data/spec/api/availabilities_api_spec.rb +69 -0
- data/spec/api/customers_api_spec.rb +75 -0
- data/spec/api/menus_api_spec.rb +100 -0
- data/spec/api/merchants_api_spec.rb +119 -0
- data/spec/api/reservation_enquiries_api_spec.rb +84 -0
- data/spec/api/reservation_settings_api_spec.rb +47 -0
- data/spec/api/reservations_api_spec.rb +72 -0
- data/spec/api/reviews_api_spec.rb +86 -0
- data/spec/api/status_api_spec.rb +57 -0
- data/spec/api/validations_api_spec.rb +48 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/agent_tracking_spec.rb +41 -0
- data/spec/models/area_dto_spec.rb +53 -0
- data/spec/models/chain_dto_spec.rb +47 -0
- data/spec/models/changed_review_dto_spec.rb +57 -0
- data/spec/models/coordinates_dto_spec.rb +47 -0
- data/spec/models/create_review_dto_spec.rb +53 -0
- data/spec/models/created_master_customer_spec.rb +41 -0
- data/spec/models/created_reservation_data_spec.rb +53 -0
- data/spec/models/created_reservation_enquiry_data_spec.rb +53 -0
- data/spec/models/created_reservation_enquiry_spec.rb +41 -0
- data/spec/models/created_reservation_spec.rb +59 -0
- data/spec/models/customer_data_list_spec.rb +53 -0
- data/spec/models/customer_dto_spec.rb +53 -0
- data/spec/models/customer_response_spec.rb +99 -0
- data/spec/models/customer_review_data_spec.rb +59 -0
- data/spec/models/customer_statistics_data_spec.rb +53 -0
- data/spec/models/deal_data_spec.rb +57 -0
- data/spec/models/document_dto_spec.rb +59 -0
- data/spec/models/error_response_spec.rb +51 -0
- data/spec/models/get_reservation_enquiry_data_spec.rb +77 -0
- data/spec/models/get_review_dto_spec.rb +81 -0
- data/spec/models/get_reviews_dto_spec.rb +59 -0
- data/spec/models/image_dto_spec.rb +41 -0
- data/spec/models/link_relation_dto_spec.rb +57 -0
- data/spec/models/location_dto_spec.rb +47 -0
- data/spec/models/marketing_setting_dto_spec.rb +55 -0
- data/spec/models/merchant_address_dto_spec.rb +65 -0
- data/spec/models/merchant_availability_days_dto_spec.rb +47 -0
- data/spec/models/merchant_availability_dto_list_spec.rb +53 -0
- data/spec/models/merchant_availability_dto_spec.rb +59 -0
- data/spec/models/merchant_customer_data_spec.rb +119 -0
- data/spec/models/merchant_customer_spec.rb +83 -0
- data/spec/models/merchant_details_dto_list_spec.rb +59 -0
- data/spec/models/merchant_details_dto_spec.rb +137 -0
- data/spec/models/merchant_menu_category_dto_spec.rb +53 -0
- data/spec/models/merchant_menu_dto_spec.rb +71 -0
- data/spec/models/merchant_menu_item_dto_spec.rb +59 -0
- data/spec/models/merchant_menus_dto_spec.rb +41 -0
- data/spec/models/merchant_reservation_data_spec.rb +53 -0
- data/spec/models/merchant_reservation_enquiry_data_spec.rb +53 -0
- data/spec/models/merchant_reservation_enquiry_spec.rb +71 -0
- data/spec/models/merchant_reservation_settings_dto_spec.rb +101 -0
- data/spec/models/merchant_reservation_spec.rb +101 -0
- data/spec/models/merchant_subscription_spec.rb +45 -0
- data/spec/models/merchant_vault_settings_dto_spec.rb +59 -0
- data/spec/models/merchant_with_recommendations_dto_spec.rb +57 -0
- data/spec/models/opening_times_dto_spec.rb +41 -0
- data/spec/models/reservation_data_list_spec.rb +41 -0
- data/spec/models/reservation_data_spec.rb +101 -0
- data/spec/models/reservation_details_spec.rb +59 -0
- data/spec/models/reservation_enquiry_message_data_spec.rb +57 -0
- data/spec/models/reservation_enquiry_message_list_spec.rb +41 -0
- data/spec/models/reservation_menu_data_spec.rb +41 -0
- data/spec/models/reservation_menu_item_data_spec.rb +65 -0
- data/spec/models/rest_cookie_spec.rb +47 -0
- data/spec/models/review_dto_list_spec.rb +59 -0
- data/spec/models/review_dto_spec.rb +65 -0
- data/spec/models/standard_opening_times_dto_spec.rb +35 -0
- data/spec/models/tag_group_dto_spec.rb +51 -0
- data/spec/models/tracking_spec.rb +47 -0
- data/spec/models/translated_tag_dto_spec.rb +47 -0
- data/spec/models/update_reservation_data_spec.rb +41 -0
- data/spec/models/update_reservation_enquiry_data_spec.rb +41 -0
- data/spec/models/update_review_dto_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +538 -0
@@ -0,0 +1,232 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Quandoo
|
16
|
+
class ReservationEnquiriesApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create reservation enquiries
|
23
|
+
# This endpoint allows to create a reservation enquiry for a certain capacity, start and end time. It also requires certain customer information. All optional fields can be either omitted or set to null. The endpoint is idempotent, which means sending the same request twice will not create another reservation enquiry. For that purpose the client is required to generate an agent-specific unique ID for each request. The endpoint will return status `HTTP 400` should any of the required parameters be missing or formatted incorrectly. See schema for details. ####Request: The request needs to have 3 objects: reservation enquiry, customer and tracking information. * **reservationEnquiry**: Information about the merchant and the enquiry. * **id**: The unique identifier of the reservation enquiry for the calling agent (Agent dependent field) or NULL if the agent identifier should be created. Optional. * **merchantId**: The ID of the merchant at which this enquiry will be made. **Required**. * **capacity**: The capacity (people count) of the reservation enquiry. **Required**. * **startDateTime**: The start date and time when the customer wants to make a reservation. Format: yyyy-MM-ddTHH:mm:ssZ. **Required**. * **endDateTime**: The expected date and time for the reservation to end accordingly to the customer. Format: yyyy-MM-ddTHH:mm:ssZ. **Required**. * **message**: A free-text message to the merchant. Max of 5000 characters. **Required**. * **customer**: Information on the customer making the reservation. * **id**: Identifier of the customer for the calling agent. Agent dependent field. Optional. * **firstName**: The first name of the customer. Optional. * **lastName**: The last name of the customer. Optional. * **emailAddress**: The email address of the customer. **Required**. * **phoneNumber**: The phone number of the customer. Without country code, since it will be assumed from the country field. Example: 030120765890. **Required**. * **locale**: The locale of the customer. E.g. de_DE. **Required**. * **country**: The 2 letter ISO country of the customer. E.g DE. **Required** * **subscriptions**: List of requested subscriptions e.g. QUANDOO, MERCHANT. Optional. * **tracking**: Third party information used to track customer and reservation enquiry. * **agent**: The id of the agent creating this reservation enquiry. **Required**. * **cookie**: Cookie information to be stored with this reservation. Optional. ####Response: The response returns information on the created reservation enquiry and the customer along with relevant links to follow. * **reservationEnquiry**: Information on the created reservation enquiry. * **id**: Agent-specific id set for the reservation enquiry. * **customer**: Information on the customer. * **id**: Agent-specific id set for the customer. * **links**: Related links that can be followed based on this response. Example curl: ``` curl -H \"Content-Type: application/json\" -X POST -d ' { \"reservationEnquiry\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 15, \"capacity\": 10, \"startDateTime\": \"2015-06-22T12:00:00+00:00\", \"endDateTime\": \"2015-06-22T17:00:00+00:00\", \"message\": \"Customer specific message\" }, \"customer\": { \"id\": \"659b9f4b-cd1a-4dc9-a5c3-8ef6bacbade5\", \"firstName\": \"Hans\", \"lastName\": \"Wurst\", \"emailAddress\": \"hans.wurst@foo.bar\", \"phoneNumber\": \"017312345678\", \"locale\": \"de_DE\", \"country\": \"DE\", \"subscriptions\": [ { \"id\": \"QUANDOO\" }, { \"id\": \"MERCHANT\" } ] }, \"tracking\": { \"agent\": { \"id\": 3 }, \"cookie\": { \"tracking\": \"ff819cdc9\", \"referenceId\": \"07f53b36\" } } }' https://{host}/v{X}/reservation-enquiries ``` Example response: ``` { \"reservationEnquiry\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\" }, \"customer\": { \"id\": \"2cc29cba-1e1f-4af6-8184-386e19c891ec\" }, \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"get-merchant\" }, { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"reservation-settings\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities\", \"method\": \"GET\", \"rel\": \"availability_days\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities/2015-06-22/times\", \"method\": \"GET\", \"rel\": \"availability\" } ] } ```
|
24
|
+
# @param body Reservation enquiry data
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [CreatedReservationEnquiryData]
|
27
|
+
def create_reservation_enquiry1(body, opts = {})
|
28
|
+
data, _status_code, _headers = create_reservation_enquiry1_with_http_info(body, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create reservation enquiries
|
33
|
+
# This endpoint allows to create a reservation enquiry for a certain capacity, start and end time. It also requires certain customer information. All optional fields can be either omitted or set to null. The endpoint is idempotent, which means sending the same request twice will not create another reservation enquiry. For that purpose the client is required to generate an agent-specific unique ID for each request. The endpoint will return status `HTTP 400` should any of the required parameters be missing or formatted incorrectly. See schema for details. ####Request: The request needs to have 3 objects: reservation enquiry, customer and tracking information. * **reservationEnquiry**: Information about the merchant and the enquiry. * **id**: The unique identifier of the reservation enquiry for the calling agent (Agent dependent field) or NULL if the agent identifier should be created. Optional. * **merchantId**: The ID of the merchant at which this enquiry will be made. **Required**. * **capacity**: The capacity (people count) of the reservation enquiry. **Required**. * **startDateTime**: The start date and time when the customer wants to make a reservation. Format: yyyy-MM-ddTHH:mm:ssZ. **Required**. * **endDateTime**: The expected date and time for the reservation to end accordingly to the customer. Format: yyyy-MM-ddTHH:mm:ssZ. **Required**. * **message**: A free-text message to the merchant. Max of 5000 characters. **Required**. * **customer**: Information on the customer making the reservation. * **id**: Identifier of the customer for the calling agent. Agent dependent field. Optional. * **firstName**: The first name of the customer. Optional. * **lastName**: The last name of the customer. Optional. * **emailAddress**: The email address of the customer. **Required**. * **phoneNumber**: The phone number of the customer. Without country code, since it will be assumed from the country field. Example: 030120765890. **Required**. * **locale**: The locale of the customer. E.g. de_DE. **Required**. * **country**: The 2 letter ISO country of the customer. E.g DE. **Required** * **subscriptions**: List of requested subscriptions e.g. QUANDOO, MERCHANT. Optional. * **tracking**: Third party information used to track customer and reservation enquiry. * **agent**: The id of the agent creating this reservation enquiry. **Required**. * **cookie**: Cookie information to be stored with this reservation. Optional. ####Response: The response returns information on the created reservation enquiry and the customer along with relevant links to follow. * **reservationEnquiry**: Information on the created reservation enquiry. * **id**: Agent-specific id set for the reservation enquiry. * **customer**: Information on the customer. * **id**: Agent-specific id set for the customer. * **links**: Related links that can be followed based on this response. Example curl: ``` curl -H \"Content-Type: application/json\" -X POST -d ' { \"reservationEnquiry\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 15, \"capacity\": 10, \"startDateTime\": \"2015-06-22T12:00:00+00:00\", \"endDateTime\": \"2015-06-22T17:00:00+00:00\", \"message\": \"Customer specific message\" }, \"customer\": { \"id\": \"659b9f4b-cd1a-4dc9-a5c3-8ef6bacbade5\", \"firstName\": \"Hans\", \"lastName\": \"Wurst\", \"emailAddress\": \"hans.wurst@foo.bar\", \"phoneNumber\": \"017312345678\", \"locale\": \"de_DE\", \"country\": \"DE\", \"subscriptions\": [ { \"id\": \"QUANDOO\" }, { \"id\": \"MERCHANT\" } ] }, \"tracking\": { \"agent\": { \"id\": 3 }, \"cookie\": { \"tracking\": \"ff819cdc9\", \"referenceId\": \"07f53b36\" } } }' https://{host}/v{X}/reservation-enquiries ``` Example response: ``` { \"reservationEnquiry\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\" }, \"customer\": { \"id\": \"2cc29cba-1e1f-4af6-8184-386e19c891ec\" }, \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"get-merchant\" }, { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"reservation-settings\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities\", \"method\": \"GET\", \"rel\": \"availability_days\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities/2015-06-22/times\", \"method\": \"GET\", \"rel\": \"availability\" } ] } ```
|
34
|
+
# @param body Reservation enquiry data
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(CreatedReservationEnquiryData, Fixnum, Hash)>] CreatedReservationEnquiryData data, response status code and response headers
|
37
|
+
def create_reservation_enquiry1_with_http_info(body, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.create_reservation_enquiry1 ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'body' is set
|
42
|
+
if @api_client.config.client_side_validation && body.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ReservationEnquiriesApi.create_reservation_enquiry1"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v1/reservation-enquiries'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
# HTTP header 'Content-Type'
|
56
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
57
|
+
|
58
|
+
# form parameters
|
59
|
+
form_params = {}
|
60
|
+
|
61
|
+
# http body (model)
|
62
|
+
post_body = @api_client.object_to_http_body(body)
|
63
|
+
auth_names = ['API_TOKEN']
|
64
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
65
|
+
:header_params => header_params,
|
66
|
+
:query_params => query_params,
|
67
|
+
:form_params => form_params,
|
68
|
+
:body => post_body,
|
69
|
+
:auth_names => auth_names,
|
70
|
+
:return_type => 'CreatedReservationEnquiryData')
|
71
|
+
if @api_client.config.debugging
|
72
|
+
@api_client.config.logger.debug "API called: ReservationEnquiriesApi#create_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
73
|
+
end
|
74
|
+
return data, status_code, headers
|
75
|
+
end
|
76
|
+
# Get all messages of a reservation enquiry
|
77
|
+
# This endpoint allows an agent to get all messages of a reservation enquiry. The id of the reservation enquiry is agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry ####Response: The response will contain a _list_ of messages. Each one containing the following fields: * **senderType**: If this message was sent by the customer or by the merchant * **creationDate**: The date time that this message was created. Format: yyyy-MM-ddTHH:mm:ssZ * **message**: The text of the message itself. Example curl: ``` curl https://{host}/v{X}/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f/messages ``` Example response: ``` { \"messages\": [ { \"senderType\": \"CUSTOMER\", \"message\": \"Customer specific message\", \"creationDate\": \"2018-05-04T09:26:53Z\" } ] } ```
|
78
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @return [ReservationEnquiryMessageList]
|
81
|
+
def get_messages_for_reservation_enquiry1(reservation_enquiry_id, opts = {})
|
82
|
+
data, _status_code, _headers = get_messages_for_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts)
|
83
|
+
data
|
84
|
+
end
|
85
|
+
|
86
|
+
# Get all messages of a reservation enquiry
|
87
|
+
# This endpoint allows an agent to get all messages of a reservation enquiry. The id of the reservation enquiry is agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry ####Response: The response will contain a _list_ of messages. Each one containing the following fields: * **senderType**: If this message was sent by the customer or by the merchant * **creationDate**: The date time that this message was created. Format: yyyy-MM-ddTHH:mm:ssZ * **message**: The text of the message itself. Example curl: ``` curl https://{host}/v{X}/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f/messages ``` Example response: ``` { \"messages\": [ { \"senderType\": \"CUSTOMER\", \"message\": \"Customer specific message\", \"creationDate\": \"2018-05-04T09:26:53Z\" } ] } ```
|
88
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [Array<(ReservationEnquiryMessageList, Fixnum, Hash)>] ReservationEnquiryMessageList data, response status code and response headers
|
91
|
+
def get_messages_for_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {})
|
92
|
+
if @api_client.config.debugging
|
93
|
+
@api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.get_messages_for_reservation_enquiry1 ...'
|
94
|
+
end
|
95
|
+
# verify the required parameter 'reservation_enquiry_id' is set
|
96
|
+
if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
|
97
|
+
fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.get_messages_for_reservation_enquiry1"
|
98
|
+
end
|
99
|
+
# resource path
|
100
|
+
local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}/messages'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)
|
101
|
+
|
102
|
+
# query parameters
|
103
|
+
query_params = {}
|
104
|
+
|
105
|
+
# header parameters
|
106
|
+
header_params = {}
|
107
|
+
|
108
|
+
# form parameters
|
109
|
+
form_params = {}
|
110
|
+
|
111
|
+
# http body (model)
|
112
|
+
post_body = nil
|
113
|
+
auth_names = ['API_TOKEN']
|
114
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
115
|
+
:header_params => header_params,
|
116
|
+
:query_params => query_params,
|
117
|
+
:form_params => form_params,
|
118
|
+
:body => post_body,
|
119
|
+
:auth_names => auth_names,
|
120
|
+
:return_type => 'ReservationEnquiryMessageList')
|
121
|
+
if @api_client.config.debugging
|
122
|
+
@api_client.config.logger.debug "API called: ReservationEnquiriesApi#get_messages_for_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
123
|
+
end
|
124
|
+
return data, status_code, headers
|
125
|
+
end
|
126
|
+
# Get reservation enquiry by id
|
127
|
+
# This endpoint allows an agent to get an reservation enquiry by id. The id is agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry ####Response: * **id**: The agent-dependent unique id of the reservation enquiry * **merchantId**: The ID of the merchant at which this reservation enquiry was made * **customerId**: The ID of the customer to which this reservation enquiry belongs * **capacity**: The capacity (people count) of the reservation enquiry * **startDateTime**: The start date time of the reservation enquiry. Format: yyyy-MM-ddTHH:mm:ssZ * **endDateTime**: The end date time of the reservation enquiry. Format: yyyy-MM-ddTHH:mm:ssZ * **status**: The status of the reservation enquiry which can be one of: NEW, IN_PROGRESS, ACCEPTED or REJECTED Example curl: ``` curl https://{host}/v{X}/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f ``` Example response: ``` { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 1384, \"customerId\": \"35fff464-142c-48ac-a0c6-ed72a1615664\", \"capacity\": 4, \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"status\": \"NEW\" } ```
|
128
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
129
|
+
# @param [Hash] opts the optional parameters
|
130
|
+
# @return [GetReservationEnquiryData]
|
131
|
+
def get_reservation_enquiry1(reservation_enquiry_id, opts = {})
|
132
|
+
data, _status_code, _headers = get_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts)
|
133
|
+
data
|
134
|
+
end
|
135
|
+
|
136
|
+
# Get reservation enquiry by id
|
137
|
+
# This endpoint allows an agent to get an reservation enquiry by id. The id is agent-specific. The agent needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry ####Response: * **id**: The agent-dependent unique id of the reservation enquiry * **merchantId**: The ID of the merchant at which this reservation enquiry was made * **customerId**: The ID of the customer to which this reservation enquiry belongs * **capacity**: The capacity (people count) of the reservation enquiry * **startDateTime**: The start date time of the reservation enquiry. Format: yyyy-MM-ddTHH:mm:ssZ * **endDateTime**: The end date time of the reservation enquiry. Format: yyyy-MM-ddTHH:mm:ssZ * **status**: The status of the reservation enquiry which can be one of: NEW, IN_PROGRESS, ACCEPTED or REJECTED Example curl: ``` curl https://{host}/v{X}/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f ``` Example response: ``` { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 1384, \"customerId\": \"35fff464-142c-48ac-a0c6-ed72a1615664\", \"capacity\": 4, \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"status\": \"NEW\" } ```
|
138
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
139
|
+
# @param [Hash] opts the optional parameters
|
140
|
+
# @return [Array<(GetReservationEnquiryData, Fixnum, Hash)>] GetReservationEnquiryData data, response status code and response headers
|
141
|
+
def get_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {})
|
142
|
+
if @api_client.config.debugging
|
143
|
+
@api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.get_reservation_enquiry1 ...'
|
144
|
+
end
|
145
|
+
# verify the required parameter 'reservation_enquiry_id' is set
|
146
|
+
if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
|
147
|
+
fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.get_reservation_enquiry1"
|
148
|
+
end
|
149
|
+
# resource path
|
150
|
+
local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)
|
151
|
+
|
152
|
+
# query parameters
|
153
|
+
query_params = {}
|
154
|
+
|
155
|
+
# header parameters
|
156
|
+
header_params = {}
|
157
|
+
|
158
|
+
# form parameters
|
159
|
+
form_params = {}
|
160
|
+
|
161
|
+
# http body (model)
|
162
|
+
post_body = nil
|
163
|
+
auth_names = ['API_TOKEN']
|
164
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
165
|
+
:header_params => header_params,
|
166
|
+
:query_params => query_params,
|
167
|
+
:form_params => form_params,
|
168
|
+
:body => post_body,
|
169
|
+
:auth_names => auth_names,
|
170
|
+
:return_type => 'GetReservationEnquiryData')
|
171
|
+
if @api_client.config.debugging
|
172
|
+
@api_client.config.logger.debug "API called: ReservationEnquiriesApi#get_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
173
|
+
end
|
174
|
+
return data, status_code, headers
|
175
|
+
end
|
176
|
+
# Update status of reservation enquiry by id
|
177
|
+
# This endpoint allows to update the status of a reservation enquiry with the given ID. The allowed status transitions are as following: * NEW --> IN_PROGRESS --> {ACCEPTED/REJECTED} * ACCEPTED <--> REJECTED The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. The endpoint will return `HTTP 400 - Bad Request` if the specified status is wrong. The endpoint will return `HTTP 409 - Conflict` if the status change is invalid. The endpoint will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry * **reservationEnquiryData**: The new enquiry status
|
178
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
179
|
+
# @param body New reservation enquiry status
|
180
|
+
# @param [Hash] opts the optional parameters
|
181
|
+
# @return [nil]
|
182
|
+
def update_reservation_enquiry1(reservation_enquiry_id, body, opts = {})
|
183
|
+
update_reservation_enquiry1_with_http_info(reservation_enquiry_id, body, opts)
|
184
|
+
nil
|
185
|
+
end
|
186
|
+
|
187
|
+
# Update status of reservation enquiry by id
|
188
|
+
# This endpoint allows to update the status of a reservation enquiry with the given ID. The allowed status transitions are as following: * NEW --> IN_PROGRESS --> {ACCEPTED/REJECTED} * ACCEPTED <--> REJECTED The endpoint will return `HTTP 404 - Not Found` if the reservation enquiry with the specified id could not be found. The endpoint will return `HTTP 400 - Bad Request` if the specified status is wrong. The endpoint will return `HTTP 409 - Conflict` if the status change is invalid. The endpoint will return `HTTP 403 - Forbidden` if the agent is not authenticated, if the agent doesn't have permissions or the reservation enquiry doesn't belong to the authenticated agent. ####Request: * **reservationEnquiryId**: Agent-specific ID of the requested reservation enquiry * **reservationEnquiryData**: The new enquiry status
|
189
|
+
# @param reservation_enquiry_id Id of the reservation enquiry
|
190
|
+
# @param body New reservation enquiry status
|
191
|
+
# @param [Hash] opts the optional parameters
|
192
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
193
|
+
def update_reservation_enquiry1_with_http_info(reservation_enquiry_id, body, opts = {})
|
194
|
+
if @api_client.config.debugging
|
195
|
+
@api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.update_reservation_enquiry1 ...'
|
196
|
+
end
|
197
|
+
# verify the required parameter 'reservation_enquiry_id' is set
|
198
|
+
if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
|
199
|
+
fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.update_reservation_enquiry1"
|
200
|
+
end
|
201
|
+
# verify the required parameter 'body' is set
|
202
|
+
if @api_client.config.client_side_validation && body.nil?
|
203
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ReservationEnquiriesApi.update_reservation_enquiry1"
|
204
|
+
end
|
205
|
+
# resource path
|
206
|
+
local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)
|
207
|
+
|
208
|
+
# query parameters
|
209
|
+
query_params = {}
|
210
|
+
|
211
|
+
# header parameters
|
212
|
+
header_params = {}
|
213
|
+
|
214
|
+
# form parameters
|
215
|
+
form_params = {}
|
216
|
+
|
217
|
+
# http body (model)
|
218
|
+
post_body = @api_client.object_to_http_body(body)
|
219
|
+
auth_names = ['API_TOKEN']
|
220
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
221
|
+
:header_params => header_params,
|
222
|
+
:query_params => query_params,
|
223
|
+
:form_params => form_params,
|
224
|
+
:body => post_body,
|
225
|
+
:auth_names => auth_names)
|
226
|
+
if @api_client.config.debugging
|
227
|
+
@api_client.config.logger.debug "API called: ReservationEnquiriesApi#update_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
228
|
+
end
|
229
|
+
return data, status_code, headers
|
230
|
+
end
|
231
|
+
end
|
232
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Quandoo
|
16
|
+
class ReservationSettingsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Get merchant reservation settings
|
23
|
+
# This endpoint provides all data that is required to initiate the reservation flow and is not part of the search endpoint. Example curl: ``` curl https://{host}/v{X}/merchants/15/reservation-settings ``` Example response: ``` { \"areaIds\": [ { \"id\": 2, \"name\": \"Garden\", \"priority\": 10 } ], \"areaSelectionRequired\": true, \"capacities\": [ 1, 2, 3, 4, 5, 6 ], \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"parent\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities\", \"method\": \"GET\", \"rel\": \"availability_days\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities/2017-01-01/times\", \"method\": \"GET\", \"rel\": \"availability\" } ], \"merchantNewsletterSelectionRequired\": true, \"minimumCapacityForEnquiries\": 10, \"onlineReservationInterval\": 60, \"reservationEnquiryEnabled\": true, \"specialTerms\": \"This is any custom string for special terms\", \"automaticConfirmation\": true, \"ccvEnabled\": true } ```
|
24
|
+
# @param merchant_id Id of the merchant
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [MerchantReservationSettingsDto]
|
27
|
+
def reservation_settings1(merchant_id, opts = {})
|
28
|
+
data, _status_code, _headers = reservation_settings1_with_http_info(merchant_id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Get merchant reservation settings
|
33
|
+
# This endpoint provides all data that is required to initiate the reservation flow and is not part of the search endpoint. Example curl: ``` curl https://{host}/v{X}/merchants/15/reservation-settings ``` Example response: ``` { \"areaIds\": [ { \"id\": 2, \"name\": \"Garden\", \"priority\": 10 } ], \"areaSelectionRequired\": true, \"capacities\": [ 1, 2, 3, 4, 5, 6 ], \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15\", \"method\": \"GET\", \"rel\": \"parent\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities\", \"method\": \"GET\", \"rel\": \"availability_days\" }, { \"href\": \"https://{host}/v{X}/merchants/15/availabilities/2017-01-01/times\", \"method\": \"GET\", \"rel\": \"availability\" } ], \"merchantNewsletterSelectionRequired\": true, \"minimumCapacityForEnquiries\": 10, \"onlineReservationInterval\": 60, \"reservationEnquiryEnabled\": true, \"specialTerms\": \"This is any custom string for special terms\", \"automaticConfirmation\": true, \"ccvEnabled\": true } ```
|
34
|
+
# @param merchant_id Id of the merchant
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(MerchantReservationSettingsDto, Fixnum, Hash)>] MerchantReservationSettingsDto data, response status code and response headers
|
37
|
+
def reservation_settings1_with_http_info(merchant_id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ReservationSettingsApi.reservation_settings1 ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'merchant_id' is set
|
42
|
+
if @api_client.config.client_side_validation && merchant_id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'merchant_id' when calling ReservationSettingsApi.reservation_settings1"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v1/merchants/{merchantId}/reservation-settings'.sub('{' + 'merchantId' + '}', merchant_id.to_s)
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = nil
|
59
|
+
auth_names = []
|
60
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'MerchantReservationSettingsDto')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: ReservationSettingsApi#reservation_settings1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,178 @@
|
|
1
|
+
=begin
|
2
|
+
#Quandoo API Documentation
|
3
|
+
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.5
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'uri'
|
14
|
+
|
15
|
+
module Quandoo
|
16
|
+
class ReservationsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create reservations
|
23
|
+
# This endpoint allows to create a reservation for a certain capacity, date and time. It also requires certain customer information. All optional fields can be either omitted or set to null. The endpoint is idempotent, which means sending the same request twice will not create another reservation. For that purpose the client is required to generate an agent-specific unique ID for the reservation. The endpoint will return status `HTTP 409` should the reservation option specified by the given parameters not be bookable anymore. The endpoint will return status `HTTP 400` should any of the required parameters be missing or formatted incorrectly. See schema for details. ####Request: The request needs to have 3 objects for reservation, customer and tracking information. * **reservation**: Information about the reservation. * **id**: The identifier of the reservation for the calling agent (Agent-dependent field). Optional. * **merchantId**: The ID of the merchant at which this reservation will be made. **Required**. * **capacity**: The capacity (people count) of the reservation. **Required**. * **areaId**: The ID of the area this reservation should be in. Optional. * **dateTime**: The date and time when the reservation will take place. Format: yyyy-MM-ddTHH:mm:ssZ. **Required** * Z can be used, example: `2019-03-23T19:15:00Z` meaning UTC * a time zone offset can be specified, example: `2019-03-23T20:15:00+01:00` * **orderId**: The id of the order to which this reservation is associated. Optional. * **extraInfo**: Any extra information that the customer likes to provide. Optional. * **promoCode**: A promotion code which should be used with this reservation. Optional. * **creditCardVaultSettingsId**: A credit card vault settings to be used by this reservation. Optional. * **recurringCardDetailId**:A customer credit card reference to be used if credit card vault should be applied. Optional. * **deals**: A list of deals which should be used with this reservation. Type can be SPECIAL, OFFER or DISCOUNT. Optional. * **customer**: Information on the customer making the reservation. * **id**: Identifier of the customer for the calling agent. Agent dependent field. Optional. * **firstName**: The first name of the customer. Optional. * **lastName**: The last name of the customer. Optional. * **emailAddress**: The email address of the customer. **Required**. * **phoneNumber**: The phone number of the customer. Without country code, since it will be assumed from the country field. Example: 030120765890. **Required**. * **locale**: The locale of the customer. E.g. de_DE. **Required**. * **country**: The 2 letter ISO country of the customer. E.g DE. **Required** * **subscriptions**: List of requested subscriptions e.g. QUANDOO, MERCHANT. Optional. * **tracking**: Third party information used to track customer and reservations. * **agent**: The id of the agent creating this request and partner references if any. **Required**. * **cookie**: Cookie information to be stored with this reservation. Optional. ####Response: The response returns information on the created reservation and the customer along with relevant links to follow. * **reservation**: Information on the created reservation. * **id**: Agent-specific id set for the reservation. * **number**: Quandoo internal identifier of the reservation. * **status**: Status for the created reservation. eg. \"CREATED\" * **quandooId**: Quandoo public identifier for the reservation. * **customer**: Information on the customer making the reservation. * **id**: Agent-specific id set for the customer. * **links**: Related links that can be followed based on this response. Example curl: ``` curl -H \"Content-Type: application/json\" -X POST -d ' { \"reservation\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 15, \"capacity\": 2, \"areaId\": 1, \"dateTime\": \"2015-06-22T12:00:00+00:00\", \"orderId\": \"a7e9fa78-b167-4c25-921a-8da675b5f03a\", \"extraInfo\": \"Some text\", \"promoCode\": \"PROMO123\", \"deals\": [ { \"id\": \"a7db794d-6a0a-43fb-b680-3b30058af7a8\", \"count\": 2, \"type\": \"OFFER\" } ] }, \"customer\": { \"id\": \"659b9f4b-cd1a-4dc9-a5c3-8ef6bacbade5\", \"firstName\": \"Hans\", \"lastName\": \"Wurst\", \"emailAddress\": \"hans.wurst@foo.bar\", \"phoneNumber\": \"017312345678\", \"locale\": \"de_DE\", \"country\": \"DE\", \"subscriptions\": [ { \"id\": \"QUANDOO\" }, { \"id\": \"MERCHANT\" } ] }, \"tracking\": { \"agent\": { \"id\": 3 }, \"cookie\": { \"tracking\": \"ff819cdc9\", \"referenceId\": \"07f53b36\" } } }' https://{host}/v{X}/reservations ``` Example response: ``` { \"reservation\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"number\": 708457891, \"status\": \"CREATED\", \"quandooId\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\" }, \"customer\": { \"id\": \"01a53b36-3f48-11e5-a151-feff819cdc9f\" }, \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"parent\" } ] } ```
|
24
|
+
# @param body Reservation data
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [CreatedReservationData]
|
27
|
+
def create_reservation1(body, opts = {})
|
28
|
+
data, _status_code, _headers = create_reservation1_with_http_info(body, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Create reservations
|
33
|
+
# This endpoint allows to create a reservation for a certain capacity, date and time. It also requires certain customer information. All optional fields can be either omitted or set to null. The endpoint is idempotent, which means sending the same request twice will not create another reservation. For that purpose the client is required to generate an agent-specific unique ID for the reservation. The endpoint will return status `HTTP 409` should the reservation option specified by the given parameters not be bookable anymore. The endpoint will return status `HTTP 400` should any of the required parameters be missing or formatted incorrectly. See schema for details. ####Request: The request needs to have 3 objects for reservation, customer and tracking information. * **reservation**: Information about the reservation. * **id**: The identifier of the reservation for the calling agent (Agent-dependent field). Optional. * **merchantId**: The ID of the merchant at which this reservation will be made. **Required**. * **capacity**: The capacity (people count) of the reservation. **Required**. * **areaId**: The ID of the area this reservation should be in. Optional. * **dateTime**: The date and time when the reservation will take place. Format: yyyy-MM-ddTHH:mm:ssZ. **Required** * Z can be used, example: `2019-03-23T19:15:00Z` meaning UTC * a time zone offset can be specified, example: `2019-03-23T20:15:00+01:00` * **orderId**: The id of the order to which this reservation is associated. Optional. * **extraInfo**: Any extra information that the customer likes to provide. Optional. * **promoCode**: A promotion code which should be used with this reservation. Optional. * **creditCardVaultSettingsId**: A credit card vault settings to be used by this reservation. Optional. * **recurringCardDetailId**:A customer credit card reference to be used if credit card vault should be applied. Optional. * **deals**: A list of deals which should be used with this reservation. Type can be SPECIAL, OFFER or DISCOUNT. Optional. * **customer**: Information on the customer making the reservation. * **id**: Identifier of the customer for the calling agent. Agent dependent field. Optional. * **firstName**: The first name of the customer. Optional. * **lastName**: The last name of the customer. Optional. * **emailAddress**: The email address of the customer. **Required**. * **phoneNumber**: The phone number of the customer. Without country code, since it will be assumed from the country field. Example: 030120765890. **Required**. * **locale**: The locale of the customer. E.g. de_DE. **Required**. * **country**: The 2 letter ISO country of the customer. E.g DE. **Required** * **subscriptions**: List of requested subscriptions e.g. QUANDOO, MERCHANT. Optional. * **tracking**: Third party information used to track customer and reservations. * **agent**: The id of the agent creating this request and partner references if any. **Required**. * **cookie**: Cookie information to be stored with this reservation. Optional. ####Response: The response returns information on the created reservation and the customer along with relevant links to follow. * **reservation**: Information on the created reservation. * **id**: Agent-specific id set for the reservation. * **number**: Quandoo internal identifier of the reservation. * **status**: Status for the created reservation. eg. \"CREATED\" * **quandooId**: Quandoo public identifier for the reservation. * **customer**: Information on the customer making the reservation. * **id**: Agent-specific id set for the customer. * **links**: Related links that can be followed based on this response. Example curl: ``` curl -H \"Content-Type: application/json\" -X POST -d ' { \"reservation\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"merchantId\": 15, \"capacity\": 2, \"areaId\": 1, \"dateTime\": \"2015-06-22T12:00:00+00:00\", \"orderId\": \"a7e9fa78-b167-4c25-921a-8da675b5f03a\", \"extraInfo\": \"Some text\", \"promoCode\": \"PROMO123\", \"deals\": [ { \"id\": \"a7db794d-6a0a-43fb-b680-3b30058af7a8\", \"count\": 2, \"type\": \"OFFER\" } ] }, \"customer\": { \"id\": \"659b9f4b-cd1a-4dc9-a5c3-8ef6bacbade5\", \"firstName\": \"Hans\", \"lastName\": \"Wurst\", \"emailAddress\": \"hans.wurst@foo.bar\", \"phoneNumber\": \"017312345678\", \"locale\": \"de_DE\", \"country\": \"DE\", \"subscriptions\": [ { \"id\": \"QUANDOO\" }, { \"id\": \"MERCHANT\" } ] }, \"tracking\": { \"agent\": { \"id\": 3 }, \"cookie\": { \"tracking\": \"ff819cdc9\", \"referenceId\": \"07f53b36\" } } }' https://{host}/v{X}/reservations ``` Example response: ``` { \"reservation\": { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"number\": 708457891, \"status\": \"CREATED\", \"quandooId\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\" }, \"customer\": { \"id\": \"01a53b36-3f48-11e5-a151-feff819cdc9f\" }, \"links\": [ { \"href\": \"https://{host}/v{X}/merchants/15/reservation-settings\", \"method\": \"GET\", \"rel\": \"parent\" } ] } ```
|
34
|
+
# @param body Reservation data
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(CreatedReservationData, Fixnum, Hash)>] CreatedReservationData data, response status code and response headers
|
37
|
+
def create_reservation1_with_http_info(body, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.create_reservation1 ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'body' is set
|
42
|
+
if @api_client.config.client_side_validation && body.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ReservationsApi.create_reservation1"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/v1/reservations'
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = {}
|
53
|
+
|
54
|
+
# form parameters
|
55
|
+
form_params = {}
|
56
|
+
|
57
|
+
# http body (model)
|
58
|
+
post_body = @api_client.object_to_http_body(body)
|
59
|
+
auth_names = []
|
60
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => 'CreatedReservationData')
|
67
|
+
if @api_client.config.debugging
|
68
|
+
@api_client.config.logger.debug "API called: ReservationsApi#create_reservation1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
69
|
+
end
|
70
|
+
return data, status_code, headers
|
71
|
+
end
|
72
|
+
# Get reservation by id
|
73
|
+
# This endpoint allows an agent or a user to get a reservation by id. The id is either agent-specific or a public id. The agent/user needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent/user is not authenticated, if the agent/user doesn't have permissions, if the reservation doesn't belong to the authenticated agent or if the user doesn't have permissions to see objects from the merchant owner of the reservation ####Request: * **reservationId**: Agent-specific or public ID of the requested reservation ####Response: * **id**: Agent-specific or public ID of the requested reservation * **number**: Quandoo internal identifier of the reservation * **quandooId**: The public id of this reservation on quandoo system. * **status**: The status of the reservation eg. CREATED, CONFIRMED, CUSTOMER CANCELED etc. * **startTime**: The start time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **endTime**: The end time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **capacity**: The capacity (people count) of the reservation * **merchantId**: The ID of the merchant at which this reservation was made. * **customerId**: The public ID of the customer to which this reservation belongs * **promoCode**: The promotion code associated with this reservation. Optional. * **extraInfo**: extra information that the customer provided for the reservation. Optional. * **links**: Related links that can be followed based on this response. * **createdAt**: The date the reservation was created. Format: `yyyy-MM-ddTHH:mm:ssZ` * **updatedAt**: The date the reservation was last updated. Format: `yyyy-MM-ddTHH:mm:ssZ` Example curl: ``` curl https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f ``` Example response: ``` { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"number\": 1092454812, \"quandooId\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"status\": \"CREATED\", \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"capacity\": 4, \"merchantId\": 1384, \"customerId\": \"35fff464-142c-48ac-a0c6-ed72a1615664\", \"promocode\": \"SOME_CAMPAIGN_CODE\", \"extraInfo\": \"request for baby chair\", \"links\": [ { \"href\": \"https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\", \"method\": \"PATCH\", \"rel\": \"update\" } ], \"createdAt\": \"2015-06-01T15:21:54Z\", \"updatedAt\": \"2015-06-01T18:45:30Z\" } ```
|
74
|
+
# @param reservation_id Id of the reservation
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @return [ReservationData]
|
77
|
+
def get_reservation1(reservation_id, opts = {})
|
78
|
+
data, _status_code, _headers = get_reservation1_with_http_info(reservation_id, opts)
|
79
|
+
data
|
80
|
+
end
|
81
|
+
|
82
|
+
# Get reservation by id
|
83
|
+
# This endpoint allows an agent or a user to get a reservation by id. The id is either agent-specific or a public id. The agent/user needs to be authenticated. The endpoint will return `HTTP 404 - Not Found` if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` if the agent/user is not authenticated, if the agent/user doesn't have permissions, if the reservation doesn't belong to the authenticated agent or if the user doesn't have permissions to see objects from the merchant owner of the reservation ####Request: * **reservationId**: Agent-specific or public ID of the requested reservation ####Response: * **id**: Agent-specific or public ID of the requested reservation * **number**: Quandoo internal identifier of the reservation * **quandooId**: The public id of this reservation on quandoo system. * **status**: The status of the reservation eg. CREATED, CONFIRMED, CUSTOMER CANCELED etc. * **startTime**: The start time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **endTime**: The end time of the reservation. Format: `yyyy-MM-ddTHH:mm:ssZ` * **capacity**: The capacity (people count) of the reservation * **merchantId**: The ID of the merchant at which this reservation was made. * **customerId**: The public ID of the customer to which this reservation belongs * **promoCode**: The promotion code associated with this reservation. Optional. * **extraInfo**: extra information that the customer provided for the reservation. Optional. * **links**: Related links that can be followed based on this response. * **createdAt**: The date the reservation was created. Format: `yyyy-MM-ddTHH:mm:ssZ` * **updatedAt**: The date the reservation was last updated. Format: `yyyy-MM-ddTHH:mm:ssZ` Example curl: ``` curl https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f ``` Example response: ``` { \"id\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"number\": 1092454812, \"quandooId\": \"07f53b36-3f48-11e5-a151-feff819cdc9f\", \"status\": \"CREATED\", \"startTime\": \"2015-06-22T12:00:00+00:00\", \"endTime\": \"2015-06-22T13:00:00+00:00\", \"capacity\": 4, \"merchantId\": 1384, \"customerId\": \"35fff464-142c-48ac-a0c6-ed72a1615664\", \"promocode\": \"SOME_CAMPAIGN_CODE\", \"extraInfo\": \"request for baby chair\", \"links\": [ { \"href\": \"https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f\", \"method\": \"PATCH\", \"rel\": \"update\" } ], \"createdAt\": \"2015-06-01T15:21:54Z\", \"updatedAt\": \"2015-06-01T18:45:30Z\" } ```
|
84
|
+
# @param reservation_id Id of the reservation
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [Array<(ReservationData, Fixnum, Hash)>] ReservationData data, response status code and response headers
|
87
|
+
def get_reservation1_with_http_info(reservation_id, opts = {})
|
88
|
+
if @api_client.config.debugging
|
89
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.get_reservation1 ...'
|
90
|
+
end
|
91
|
+
# verify the required parameter 'reservation_id' is set
|
92
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
93
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.get_reservation1"
|
94
|
+
end
|
95
|
+
# resource path
|
96
|
+
local_var_path = '/v1/reservations/{reservationId}'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
|
97
|
+
|
98
|
+
# query parameters
|
99
|
+
query_params = {}
|
100
|
+
|
101
|
+
# header parameters
|
102
|
+
header_params = {}
|
103
|
+
|
104
|
+
# form parameters
|
105
|
+
form_params = {}
|
106
|
+
|
107
|
+
# http body (model)
|
108
|
+
post_body = nil
|
109
|
+
auth_names = ['API_TOKEN']
|
110
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
111
|
+
:header_params => header_params,
|
112
|
+
:query_params => query_params,
|
113
|
+
:form_params => form_params,
|
114
|
+
:body => post_body,
|
115
|
+
:auth_names => auth_names,
|
116
|
+
:return_type => 'ReservationData')
|
117
|
+
if @api_client.config.debugging
|
118
|
+
@api_client.config.logger.debug "API called: ReservationsApi#get_reservation1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
119
|
+
end
|
120
|
+
return data, status_code, headers
|
121
|
+
end
|
122
|
+
# Update reservation by id
|
123
|
+
# This endpoint allows an agent to update a reservation by id. The id is agent-specific. The agent needs to be authenticated. ####Request: * **reservationId**: Agent-specific ID of the requested reservation. Taken as a path parameter. * **reservation.status**: New status for the reservation. When is present then all parameters below should be omitted! * **reservation.capacity**: The capacity (people count) of the reservation. * **reservation.areaId**: The ID of the area this reservation should be in. * **reservation.dateTime**: The date and time when the reservation will take place. Format: yyyy-MM-ddTHH:mm:ssZ. For updating status request body should contain only reservation.status. Valid status values depend on the current status of reservation and can be `CUSTOMER_CANCELED` or `RECONFIRMED`. * `CUSTOMER_CANCELED` is valid if current status is one of the below: * CREATED * CONFIRMED * AUTOMATIC_CONFIRMED * NOTIFICATION_REQUESTED * NOTIFIED * RECONFIRMED * `RECONFIRMED` is valid if current status is one of the below: * CONFIRMED * AUTOMATIC_CONFIRMED * NOTIFICATION_REQUESTED * NOTIFIED If reservation.status field is not present then reservation data will be updated and reservation's status will be reset. Depending on `Automatic confirmation for online reservations` setting, reservation's status will be set to CREATED or AUTOMATIC_CONFIRMED. ####Response: The endpoint will return `HTTP 200 - OK` if update was successful. It will return `HTTP 404 - Not Found` error if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` error if the agent is not authenticated, if the agent doesn't have permissions or the reservation doesn't belong to the authenticated agent. It will return `HTTP 409 - Conflict` error if reservation has menu, smart offers, made by IOVOX, has conflict in status, time or other conflicts. Example curl: ``` curl -H \"Content-Type: application/json\" -X PATCH -d ' { \"reservation\": { \"status\": \"CUSTOMER_CANCELED\" } } ' https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f ```
|
124
|
+
# @param reservation_id Id of the reservation
|
125
|
+
# @param body New reservation status
|
126
|
+
# @param [Hash] opts the optional parameters
|
127
|
+
# @return [nil]
|
128
|
+
def update_reservation1(reservation_id, body, opts = {})
|
129
|
+
update_reservation1_with_http_info(reservation_id, body, opts)
|
130
|
+
nil
|
131
|
+
end
|
132
|
+
|
133
|
+
# Update reservation by id
|
134
|
+
# This endpoint allows an agent to update a reservation by id. The id is agent-specific. The agent needs to be authenticated. ####Request: * **reservationId**: Agent-specific ID of the requested reservation. Taken as a path parameter. * **reservation.status**: New status for the reservation. When is present then all parameters below should be omitted! * **reservation.capacity**: The capacity (people count) of the reservation. * **reservation.areaId**: The ID of the area this reservation should be in. * **reservation.dateTime**: The date and time when the reservation will take place. Format: yyyy-MM-ddTHH:mm:ssZ. For updating status request body should contain only reservation.status. Valid status values depend on the current status of reservation and can be `CUSTOMER_CANCELED` or `RECONFIRMED`. * `CUSTOMER_CANCELED` is valid if current status is one of the below: * CREATED * CONFIRMED * AUTOMATIC_CONFIRMED * NOTIFICATION_REQUESTED * NOTIFIED * RECONFIRMED * `RECONFIRMED` is valid if current status is one of the below: * CONFIRMED * AUTOMATIC_CONFIRMED * NOTIFICATION_REQUESTED * NOTIFIED If reservation.status field is not present then reservation data will be updated and reservation's status will be reset. Depending on `Automatic confirmation for online reservations` setting, reservation's status will be set to CREATED or AUTOMATIC_CONFIRMED. ####Response: The endpoint will return `HTTP 200 - OK` if update was successful. It will return `HTTP 404 - Not Found` error if the reservation with the specified id could not be found. It will return `HTTP 403 - Forbidden` error if the agent is not authenticated, if the agent doesn't have permissions or the reservation doesn't belong to the authenticated agent. It will return `HTTP 409 - Conflict` error if reservation has menu, smart offers, made by IOVOX, has conflict in status, time or other conflicts. Example curl: ``` curl -H \"Content-Type: application/json\" -X PATCH -d ' { \"reservation\": { \"status\": \"CUSTOMER_CANCELED\" } } ' https://{host}/v{X}/reservations/07f53b36-3f48-11e5-a151-feff819cdc9f ```
|
135
|
+
# @param reservation_id Id of the reservation
|
136
|
+
# @param body New reservation status
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
139
|
+
def update_reservation1_with_http_info(reservation_id, body, opts = {})
|
140
|
+
if @api_client.config.debugging
|
141
|
+
@api_client.config.logger.debug 'Calling API: ReservationsApi.update_reservation1 ...'
|
142
|
+
end
|
143
|
+
# verify the required parameter 'reservation_id' is set
|
144
|
+
if @api_client.config.client_side_validation && reservation_id.nil?
|
145
|
+
fail ArgumentError, "Missing the required parameter 'reservation_id' when calling ReservationsApi.update_reservation1"
|
146
|
+
end
|
147
|
+
# verify the required parameter 'body' is set
|
148
|
+
if @api_client.config.client_side_validation && body.nil?
|
149
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ReservationsApi.update_reservation1"
|
150
|
+
end
|
151
|
+
# resource path
|
152
|
+
local_var_path = '/v1/reservations/{reservationId}'.sub('{' + 'reservationId' + '}', reservation_id.to_s)
|
153
|
+
|
154
|
+
# query parameters
|
155
|
+
query_params = {}
|
156
|
+
|
157
|
+
# header parameters
|
158
|
+
header_params = {}
|
159
|
+
|
160
|
+
# form parameters
|
161
|
+
form_params = {}
|
162
|
+
|
163
|
+
# http body (model)
|
164
|
+
post_body = @api_client.object_to_http_body(body)
|
165
|
+
auth_names = ['API_TOKEN']
|
166
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
167
|
+
:header_params => header_params,
|
168
|
+
:query_params => query_params,
|
169
|
+
:form_params => form_params,
|
170
|
+
:body => post_body,
|
171
|
+
:auth_names => auth_names)
|
172
|
+
if @api_client.config.debugging
|
173
|
+
@api_client.config.logger.debug "API called: ReservationsApi#update_reservation1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
174
|
+
end
|
175
|
+
return data, status_code, headers
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|