Class: Quandoo::ReservationEnquiriesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/quandoo/api/reservation_enquiries_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ReservationEnquiriesApi

Returns a new instance of ReservationEnquiriesApi.



19
20
21
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_reservation_enquiry1(body, opts = {}) ⇒ CreatedReservationEnquiryData

Create reservation enquiries 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": "[email protected]", "phoneNumber": "017312345678", "locale": "de_DE", "country": "DE", "subscriptions": [ { "id": "QUANDOO" }, { "id": "MERCHANT" } ] }, "tracking": { "agent": { "id": 3 }, "cookie": { "tracking": "ff819cdc9", "referenceId": "07f53b36" } } }‘ https://host/vX/reservation-enquiries “` Example response: “` { "reservationEnquiry": { "id": "07f53b36-3f48-11e5-a151-feff819cdc9f" }, "customer": { "id": "2cc29cba-1e1f-4af6-8184-386e19c891ec" }, "links": [ { "href": "https://host/vX/merchants/15", "method": "GET", "rel": "get-merchant" }, { "href": "https://host/vX/merchants/15/reservation-settings", "method": "GET", "rel": "reservation-settings" }, { "href": "https://host/vX/merchants/15/availabilities", "method": "GET", "rel": "availability_days" }, { "href": "https://host/vX/merchants/15/availabilities/2015-06-22/times", "method": "GET", "rel": "availability" } ] } “`

Parameters:

  • body

    Reservation enquiry data

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 27

def create_reservation_enquiry1(body, opts = {})
  data, _status_code, _headers = create_reservation_enquiry1_with_http_info(body, opts)
  data
end

#create_reservation_enquiry1_with_http_info(body, opts = {}) ⇒ Array<(CreatedReservationEnquiryData, Fixnum, Hash)>

Create reservation enquiries 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 &#x60;HTTP 400&#x60; 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: &#x60;&#x60;&#x60; curl -H &quot;Content-Type: application/json&quot; -X POST -d &#39; { &quot;reservationEnquiry&quot;: { &quot;id&quot;: &quot;07f53b36-3f48-11e5-a151-feff819cdc9f&quot;, &quot;merchantId&quot;: 15, &quot;capacity&quot;: 10, &quot;startDateTime&quot;: &quot;2015-06-22T12:00:00+00:00&quot;, &quot;endDateTime&quot;: &quot;2015-06-22T17:00:00+00:00&quot;, &quot;message&quot;: &quot;Customer specific message&quot; }, &quot;customer&quot;: { &quot;id&quot;: &quot;659b9f4b-cd1a-4dc9-a5c3-8ef6bacbade5&quot;, &quot;firstName&quot;: &quot;Hans&quot;, &quot;lastName&quot;: &quot;Wurst&quot;, &quot;emailAddress&quot;: &quot;[email protected]&quot;, &quot;phoneNumber&quot;: &quot;017312345678&quot;, &quot;locale&quot;: &quot;de_DE&quot;, &quot;country&quot;: &quot;DE&quot;, &quot;subscriptions&quot;: [ { &quot;id&quot;: &quot;QUANDOO&quot; }, { &quot;id&quot;: &quot;MERCHANT&quot; } ] }, &quot;tracking&quot;: { &quot;agent&quot;: { &quot;id&quot;: 3 }, &quot;cookie&quot;: { &quot;tracking&quot;: &quot;ff819cdc9&quot;, &quot;referenceId&quot;: &quot;07f53b36&quot; } } }&#39; https://host/vX/reservation-enquiries &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { &quot;reservationEnquiry&quot;: { &quot;id&quot;: &quot;07f53b36-3f48-11e5-a151-feff819cdc9f&quot; }, &quot;customer&quot;: { &quot;id&quot;: &quot;2cc29cba-1e1f-4af6-8184-386e19c891ec&quot; }, &quot;links&quot;: [ { &quot;href&quot;: &quot;https://host/vX/merchants/15&quot;, &quot;method&quot;: &quot;GET&quot;, &quot;rel&quot;: &quot;get-merchant&quot; }, { &quot;href&quot;: &quot;https://host/vX/merchants/15/reservation-settings&quot;, &quot;method&quot;: &quot;GET&quot;, &quot;rel&quot;: &quot;reservation-settings&quot; }, { &quot;href&quot;: &quot;https://host/vX/merchants/15/availabilities&quot;, &quot;method&quot;: &quot;GET&quot;, &quot;rel&quot;: &quot;availability_days&quot; }, { &quot;href&quot;: &quot;https://host/vX/merchants/15/availabilities/2015-06-22/times&quot;, &quot;method&quot;: &quot;GET&quot;, &quot;rel&quot;: &quot;availability&quot; } ] } &#x60;&#x60;&#x60;

Parameters:

  • body

    Reservation enquiry data

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 37

def create_reservation_enquiry1_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.create_reservation_enquiry1 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ReservationEnquiriesApi.create_reservation_enquiry1"
  end
  # resource path
  local_var_path = '/v1/reservation-enquiries'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['API_TOKEN']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CreatedReservationEnquiryData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReservationEnquiriesApi#create_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_messages_for_reservation_enquiry1(reservation_enquiry_id, opts = {}) ⇒ ReservationEnquiryMessageList

Get all messages of a reservation enquiry 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/vX/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f/messages “` Example response: “` { "messages": [ { "senderType": "CUSTOMER", "message": "Customer specific message", "creationDate": "2018-05-04T09:26:53Z" } ] } “`

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



81
82
83
84
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 81

def get_messages_for_reservation_enquiry1(reservation_enquiry_id, opts = {})
  data, _status_code, _headers = get_messages_for_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts)
  data
end

#get_messages_for_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {}) ⇒ Array<(ReservationEnquiryMessageList, Fixnum, Hash)>

Get all messages of a reservation enquiry 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation enquiry with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the agent is not authenticated, if the agent doesn&#39;t have permissions or the reservation enquiry doesn&#39;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: &#x60;&#x60;&#x60; curl https://host/vX/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f/messages &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { &quot;messages&quot;: [ { &quot;senderType&quot;: &quot;CUSTOMER&quot;, &quot;message&quot;: &quot;Customer specific message&quot;, &quot;creationDate&quot;: &quot;2018-05-04T09:26:53Z&quot; } ] } &#x60;&#x60;&#x60;

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 91

def get_messages_for_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.get_messages_for_reservation_enquiry1 ...'
  end
  # verify the required parameter 'reservation_enquiry_id' is set
  if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
    fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.get_messages_for_reservation_enquiry1"
  end
  # resource path
  local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}/messages'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['API_TOKEN']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ReservationEnquiryMessageList')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReservationEnquiriesApi#get_messages_for_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reservation_enquiry1(reservation_enquiry_id, opts = {}) ⇒ GetReservationEnquiryData

Get reservation enquiry by id 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/vX/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" } “`

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



131
132
133
134
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 131

def get_reservation_enquiry1(reservation_enquiry_id, opts = {})
  data, _status_code, _headers = get_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts)
  data
end

#get_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {}) ⇒ Array<(GetReservationEnquiryData, Fixnum, Hash)>

Get reservation enquiry by id 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 &#x60;HTTP 404 - Not Found&#x60; if the reservation enquiry with the specified id could not be found. It will return &#x60;HTTP 403 - Forbidden&#x60; if the agent is not authenticated, if the agent doesn&#39;t have permissions or the reservation enquiry doesn&#39;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: &#x60;&#x60;&#x60; curl https://host/vX/reservation-enquiries/07f53b36-3f48-11e5-a151-feff819cdc9f &#x60;&#x60;&#x60; Example response: &#x60;&#x60;&#x60; { &quot;id&quot;: &quot;07f53b36-3f48-11e5-a151-feff819cdc9f&quot;, &quot;merchantId&quot;: 1384, &quot;customerId&quot;: &quot;35fff464-142c-48ac-a0c6-ed72a1615664&quot;, &quot;capacity&quot;: 4, &quot;startTime&quot;: &quot;2015-06-22T12:00:00+00:00&quot;, &quot;endTime&quot;: &quot;2015-06-22T13:00:00+00:00&quot;, &quot;status&quot;: &quot;NEW&quot; } &#x60;&#x60;&#x60;

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(GetReservationEnquiryData, Fixnum, Hash)>)

    GetReservationEnquiryData data, response status code and response headers



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 141

def get_reservation_enquiry1_with_http_info(reservation_enquiry_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.get_reservation_enquiry1 ...'
  end
  # verify the required parameter 'reservation_enquiry_id' is set
  if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
    fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.get_reservation_enquiry1"
  end
  # resource path
  local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['API_TOKEN']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'GetReservationEnquiryData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReservationEnquiriesApi#get_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_reservation_enquiry1(reservation_enquiry_id, body, opts = {}) ⇒ nil

Update status of reservation enquiry by id 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

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • body

    New reservation enquiry status

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


182
183
184
185
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 182

def update_reservation_enquiry1(reservation_enquiry_id, body, opts = {})
  update_reservation_enquiry1_with_http_info(reservation_enquiry_id, body, opts)
  nil
end

#update_reservation_enquiry1_with_http_info(reservation_enquiry_id, body, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update status of reservation enquiry by id This endpoint allows to update the status of a reservation enquiry with the given ID. The allowed status transitions are as following: * NEW –&gt; IN_PROGRESS –&gt; ACCEPTED/REJECTED * ACCEPTED &lt;–&gt; REJECTED The endpoint will return &#x60;HTTP 404 - Not Found&#x60; if the reservation enquiry with the specified id could not be found. The endpoint will return &#x60;HTTP 400 - Bad Request&#x60; if the specified status is wrong. The endpoint will return &#x60;HTTP 409 - Conflict&#x60; if the status change is invalid. The endpoint will return &#x60;HTTP 403 - Forbidden&#x60; if the agent is not authenticated, if the agent doesn&#39;t have permissions or the reservation enquiry doesn&#39;t belong to the authenticated agent. ####Request: * reservationEnquiryId: Agent-specific ID of the requested reservation enquiry * reservationEnquiryData: The new enquiry status

Parameters:

  • reservation_enquiry_id

    Id of the reservation enquiry

  • body

    New reservation enquiry status

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/quandoo/api/reservation_enquiries_api.rb', line 193

def update_reservation_enquiry1_with_http_info(reservation_enquiry_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ReservationEnquiriesApi.update_reservation_enquiry1 ...'
  end
  # verify the required parameter 'reservation_enquiry_id' is set
  if @api_client.config.client_side_validation && reservation_enquiry_id.nil?
    fail ArgumentError, "Missing the required parameter 'reservation_enquiry_id' when calling ReservationEnquiriesApi.update_reservation_enquiry1"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ReservationEnquiriesApi.update_reservation_enquiry1"
  end
  # resource path
  local_var_path = '/v1/reservation-enquiries/{reservationEnquiryId}'.sub('{' + 'reservationEnquiryId' + '}', reservation_enquiry_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['API_TOKEN']
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ReservationEnquiriesApi#update_reservation_enquiry1\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end