osdm_sys/apis/
booking_part_api.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`create_booking_booked_offers_ancillaries`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum CreateBookingBookedOffersAncillariesError {
22    Status400(models::Problem),
23    Status401(models::Problem),
24    Status403(models::Problem),
25    Status404(models::Problem),
26    Status406(models::Problem),
27    Status415(models::Problem),
28    Status500(models::Problem),
29    Status501(models::Problem),
30    Status503(models::Problem),
31    DefaultResponse(models::Problem),
32    UnknownValue(serde_json::Value),
33}
34
35/// struct for typed errors of method [`create_booking_booked_offers_parts`]
36#[derive(Debug, Clone, Serialize, Deserialize)]
37#[serde(untagged)]
38pub enum CreateBookingBookedOffersPartsError {
39    Status400(models::Problem),
40    Status401(models::Problem),
41    Status403(models::Problem),
42    Status404(models::Problem),
43    Status406(models::Problem),
44    Status415(models::Problem),
45    Status500(models::Problem),
46    Status501(models::Problem),
47    Status503(models::Problem),
48    DefaultResponse(models::Problem),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`create_booking_booked_offers_reservations`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum CreateBookingBookedOffersReservationsError {
56    Status400(models::Problem),
57    Status401(models::Problem),
58    Status403(models::Problem),
59    Status404(models::Problem),
60    Status406(models::Problem),
61    Status415(models::Problem),
62    Status500(models::Problem),
63    Status501(models::Problem),
64    Status503(models::Problem),
65    DefaultResponse(models::Problem),
66    UnknownValue(serde_json::Value),
67}
68
69/// struct for typed errors of method [`delete_booking_booked_offers_admission`]
70#[derive(Debug, Clone, Serialize, Deserialize)]
71#[serde(untagged)]
72pub enum DeleteBookingBookedOffersAdmissionError {
73    Status400(models::Problem),
74    Status401(models::Problem),
75    Status403(models::Problem),
76    Status404(models::Problem),
77    Status406(models::Problem),
78    Status409(models::Problem),
79    Status415(models::Problem),
80    Status500(models::Problem),
81    Status501(models::Problem),
82    Status503(models::Problem),
83    DefaultResponse(models::Problem),
84    UnknownValue(serde_json::Value),
85}
86
87/// struct for typed errors of method [`delete_booking_booked_offers_ancillary`]
88#[derive(Debug, Clone, Serialize, Deserialize)]
89#[serde(untagged)]
90pub enum DeleteBookingBookedOffersAncillaryError {
91    Status400(models::Problem),
92    Status401(models::Problem),
93    Status403(models::Problem),
94    Status404(models::Problem),
95    Status406(models::Problem),
96    Status409(models::Problem),
97    Status415(models::Problem),
98    Status500(models::Problem),
99    Status501(models::Problem),
100    Status503(models::Problem),
101    DefaultResponse(models::Problem),
102    UnknownValue(serde_json::Value),
103}
104
105/// struct for typed errors of method [`delete_booking_booked_offers_parts`]
106#[derive(Debug, Clone, Serialize, Deserialize)]
107#[serde(untagged)]
108pub enum DeleteBookingBookedOffersPartsError {
109    Status400(models::Problem),
110    Status401(models::Problem),
111    Status403(models::Problem),
112    Status404(models::Problem),
113    Status406(models::Problem),
114    Status409(models::Problem),
115    Status415(models::Problem),
116    Status500(models::Problem),
117    Status501(models::Problem),
118    Status503(models::Problem),
119    DefaultResponse(models::Problem),
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`delete_booking_booked_offers_reservations`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum DeleteBookingBookedOffersReservationsError {
127    Status400(models::Problem),
128    Status401(models::Problem),
129    Status403(models::Problem),
130    Status404(models::Problem),
131    Status406(models::Problem),
132    Status409(models::Problem),
133    Status415(models::Problem),
134    Status500(models::Problem),
135    Status501(models::Problem),
136    Status503(models::Problem),
137    DefaultResponse(models::Problem),
138    UnknownValue(serde_json::Value),
139}
140
141
142/// *DEPRECATED* in favour to unified endpoint handling both ancillaries and reservations.  Adds an ancillary to a booking. A provider can decide to allow or reject additional admissions, reservations or ancillaries on an confirmed booking. 
143#[deprecated]
144pub async fn create_booking_booked_offers_ancillaries(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, booked_offer_ancillary_request: models::BookedOfferAncillaryRequest, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>, idempotency_key: Option<&str>) -> Result<models::BookedOfferAncillaryResponse, Error<CreateBookingBookedOffersAncillariesError>> {
145    // add a prefix to parameters to efficiently prevent name collisions
146    let p_path_booking_id = booking_id;
147    let p_path_booked_offer_id = booked_offer_id;
148    let p_body_booked_offer_ancillary_request = booked_offer_ancillary_request;
149    let p_header_requestor = requestor;
150    let p_header_accept_language = accept_language;
151    let p_header_traceparent = traceparent;
152    let p_header_tracestate = tracestate;
153    let p_header_idempotency_key = idempotency_key;
154
155    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/ancillaries", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id));
156    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
157
158    if let Some(ref user_agent) = configuration.user_agent {
159        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
160    }
161    if let Some(param_value) = p_header_requestor {
162        req_builder = req_builder.header("Requestor", param_value.to_string());
163    }
164    if let Some(param_value) = p_header_accept_language {
165        req_builder = req_builder.header("Accept-Language", param_value.to_string());
166    }
167    if let Some(param_value) = p_header_traceparent {
168        req_builder = req_builder.header("traceparent", param_value.to_string());
169    }
170    if let Some(param_value) = p_header_tracestate {
171        req_builder = req_builder.header("tracestate", param_value.to_string());
172    }
173    if let Some(param_value) = p_header_idempotency_key {
174        req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
175    }
176    if let Some(ref token) = configuration.oauth_access_token {
177        req_builder = req_builder.bearer_auth(token.to_owned());
178    };
179    req_builder = req_builder.json(&p_body_booked_offer_ancillary_request);
180
181    let req = req_builder.build()?;
182    let resp = configuration.client.execute(req).await?;
183
184    let status = resp.status();
185    let content_type = resp
186        .headers()
187        .get("content-type")
188        .and_then(|v| v.to_str().ok())
189        .unwrap_or("application/octet-stream");
190    let content_type = super::ContentType::from(content_type);
191
192    if !status.is_client_error() && !status.is_server_error() {
193        let content = resp.text().await?;
194        match content_type {
195            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
196            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BookedOfferAncillaryResponse`"))),
197            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BookedOfferAncillaryResponse`")))),
198        }
199    } else {
200        let content = resp.text().await?;
201        let entity: Option<CreateBookingBookedOffersAncillariesError> = serde_json::from_str(&content).ok();
202        Err(Error::ResponseError(ResponseContent { status, content, entity }))
203    }
204}
205
206/// Adds a reservation or an ancillary to a booking. A provider can decide to allow or reject additional admissions, reservations or ancillaries on an confirmed booking. 
207pub async fn create_booking_booked_offers_parts(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, booked_offer_part_request: models::BookedOfferPartRequest, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>, idempotency_key: Option<&str>) -> Result<models::BookedOfferPartResponse, Error<CreateBookingBookedOffersPartsError>> {
208    // add a prefix to parameters to efficiently prevent name collisions
209    let p_path_booking_id = booking_id;
210    let p_path_booked_offer_id = booked_offer_id;
211    let p_body_booked_offer_part_request = booked_offer_part_request;
212    let p_header_requestor = requestor;
213    let p_header_accept_language = accept_language;
214    let p_header_traceparent = traceparent;
215    let p_header_tracestate = tracestate;
216    let p_header_idempotency_key = idempotency_key;
217
218    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/offer-parts", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id));
219    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
220
221    if let Some(ref user_agent) = configuration.user_agent {
222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
223    }
224    if let Some(param_value) = p_header_requestor {
225        req_builder = req_builder.header("Requestor", param_value.to_string());
226    }
227    if let Some(param_value) = p_header_accept_language {
228        req_builder = req_builder.header("Accept-Language", param_value.to_string());
229    }
230    if let Some(param_value) = p_header_traceparent {
231        req_builder = req_builder.header("traceparent", param_value.to_string());
232    }
233    if let Some(param_value) = p_header_tracestate {
234        req_builder = req_builder.header("tracestate", param_value.to_string());
235    }
236    if let Some(param_value) = p_header_idempotency_key {
237        req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
238    }
239    if let Some(ref token) = configuration.oauth_access_token {
240        req_builder = req_builder.bearer_auth(token.to_owned());
241    };
242    req_builder = req_builder.json(&p_body_booked_offer_part_request);
243
244    let req = req_builder.build()?;
245    let resp = configuration.client.execute(req).await?;
246
247    let status = resp.status();
248    let content_type = resp
249        .headers()
250        .get("content-type")
251        .and_then(|v| v.to_str().ok())
252        .unwrap_or("application/octet-stream");
253    let content_type = super::ContentType::from(content_type);
254
255    if !status.is_client_error() && !status.is_server_error() {
256        let content = resp.text().await?;
257        match content_type {
258            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
259            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BookedOfferPartResponse`"))),
260            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BookedOfferPartResponse`")))),
261        }
262    } else {
263        let content = resp.text().await?;
264        let entity: Option<CreateBookingBookedOffersPartsError> = serde_json::from_str(&content).ok();
265        Err(Error::ResponseError(ResponseContent { status, content, entity }))
266    }
267}
268
269/// *DEPRECATED* in favour to unified endpoint handling both ancillaries and reservations.  Adds a reservation to a booking. A provider can decide to allow or reject additional admissions, reservations or ancillaries on an confirmed booking. 
270#[deprecated]
271pub async fn create_booking_booked_offers_reservations(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, booked_offer_reservation_request: models::BookedOfferReservationRequest, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>, idempotency_key: Option<&str>) -> Result<models::BookedOfferReservationResponse, Error<CreateBookingBookedOffersReservationsError>> {
272    // add a prefix to parameters to efficiently prevent name collisions
273    let p_path_booking_id = booking_id;
274    let p_path_booked_offer_id = booked_offer_id;
275    let p_body_booked_offer_reservation_request = booked_offer_reservation_request;
276    let p_header_requestor = requestor;
277    let p_header_accept_language = accept_language;
278    let p_header_traceparent = traceparent;
279    let p_header_tracestate = tracestate;
280    let p_header_idempotency_key = idempotency_key;
281
282    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/reservations", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id));
283    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
284
285    if let Some(ref user_agent) = configuration.user_agent {
286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
287    }
288    if let Some(param_value) = p_header_requestor {
289        req_builder = req_builder.header("Requestor", param_value.to_string());
290    }
291    if let Some(param_value) = p_header_accept_language {
292        req_builder = req_builder.header("Accept-Language", param_value.to_string());
293    }
294    if let Some(param_value) = p_header_traceparent {
295        req_builder = req_builder.header("traceparent", param_value.to_string());
296    }
297    if let Some(param_value) = p_header_tracestate {
298        req_builder = req_builder.header("tracestate", param_value.to_string());
299    }
300    if let Some(param_value) = p_header_idempotency_key {
301        req_builder = req_builder.header("Idempotency-Key", param_value.to_string());
302    }
303    if let Some(ref token) = configuration.oauth_access_token {
304        req_builder = req_builder.bearer_auth(token.to_owned());
305    };
306    req_builder = req_builder.json(&p_body_booked_offer_reservation_request);
307
308    let req = req_builder.build()?;
309    let resp = configuration.client.execute(req).await?;
310
311    let status = resp.status();
312    let content_type = resp
313        .headers()
314        .get("content-type")
315        .and_then(|v| v.to_str().ok())
316        .unwrap_or("application/octet-stream");
317    let content_type = super::ContentType::from(content_type);
318
319    if !status.is_client_error() && !status.is_server_error() {
320        let content = resp.text().await?;
321        match content_type {
322            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
323            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BookedOfferReservationResponse`"))),
324            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BookedOfferReservationResponse`")))),
325        }
326    } else {
327        let content = resp.text().await?;
328        let entity: Option<CreateBookingBookedOffersReservationsError> = serde_json::from_str(&content).ok();
329        Err(Error::ResponseError(ResponseContent { status, content, entity }))
330    }
331}
332
333/// Removes an admission from pre-booked booking.It is up to the provider to change or remove dependent bookedOfferParts or to reject the request. A repricing might occur. 
334pub async fn delete_booking_booked_offers_admission(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, admission_id: &str, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>) -> Result<(), Error<DeleteBookingBookedOffersAdmissionError>> {
335    // add a prefix to parameters to efficiently prevent name collisions
336    let p_path_booking_id = booking_id;
337    let p_path_booked_offer_id = booked_offer_id;
338    let p_path_admission_id = admission_id;
339    let p_header_requestor = requestor;
340    let p_header_accept_language = accept_language;
341    let p_header_traceparent = traceparent;
342    let p_header_tracestate = tracestate;
343
344    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/admissions/{admissionId}", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id), admissionId=crate::apis::urlencode(p_path_admission_id));
345    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
346
347    if let Some(ref user_agent) = configuration.user_agent {
348        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
349    }
350    if let Some(param_value) = p_header_requestor {
351        req_builder = req_builder.header("Requestor", param_value.to_string());
352    }
353    if let Some(param_value) = p_header_accept_language {
354        req_builder = req_builder.header("Accept-Language", param_value.to_string());
355    }
356    if let Some(param_value) = p_header_traceparent {
357        req_builder = req_builder.header("traceparent", param_value.to_string());
358    }
359    if let Some(param_value) = p_header_tracestate {
360        req_builder = req_builder.header("tracestate", param_value.to_string());
361    }
362    if let Some(ref token) = configuration.oauth_access_token {
363        req_builder = req_builder.bearer_auth(token.to_owned());
364    };
365
366    let req = req_builder.build()?;
367    let resp = configuration.client.execute(req).await?;
368
369    let status = resp.status();
370
371    if !status.is_client_error() && !status.is_server_error() {
372        Ok(())
373    } else {
374        let content = resp.text().await?;
375        let entity: Option<DeleteBookingBookedOffersAdmissionError> = serde_json::from_str(&content).ok();
376        Err(Error::ResponseError(ResponseContent { status, content, entity }))
377    }
378}
379
380#[deprecated]
381pub async fn delete_booking_booked_offers_ancillary(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, ancillary_id: &str, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>) -> Result<(), Error<DeleteBookingBookedOffersAncillaryError>> {
382    // add a prefix to parameters to efficiently prevent name collisions
383    let p_path_booking_id = booking_id;
384    let p_path_booked_offer_id = booked_offer_id;
385    let p_path_ancillary_id = ancillary_id;
386    let p_header_requestor = requestor;
387    let p_header_accept_language = accept_language;
388    let p_header_traceparent = traceparent;
389    let p_header_tracestate = tracestate;
390
391    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/ancillaries/{ancillaryId}", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id), ancillaryId=crate::apis::urlencode(p_path_ancillary_id));
392    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
393
394    if let Some(ref user_agent) = configuration.user_agent {
395        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
396    }
397    if let Some(param_value) = p_header_requestor {
398        req_builder = req_builder.header("Requestor", param_value.to_string());
399    }
400    if let Some(param_value) = p_header_accept_language {
401        req_builder = req_builder.header("Accept-Language", param_value.to_string());
402    }
403    if let Some(param_value) = p_header_traceparent {
404        req_builder = req_builder.header("traceparent", param_value.to_string());
405    }
406    if let Some(param_value) = p_header_tracestate {
407        req_builder = req_builder.header("tracestate", param_value.to_string());
408    }
409    if let Some(ref token) = configuration.oauth_access_token {
410        req_builder = req_builder.bearer_auth(token.to_owned());
411    };
412
413    let req = req_builder.build()?;
414    let resp = configuration.client.execute(req).await?;
415
416    let status = resp.status();
417
418    if !status.is_client_error() && !status.is_server_error() {
419        Ok(())
420    } else {
421        let content = resp.text().await?;
422        let entity: Option<DeleteBookingBookedOffersAncillaryError> = serde_json::from_str(&content).ok();
423        Err(Error::ResponseError(ResponseContent { status, content, entity }))
424    }
425}
426
427pub async fn delete_booking_booked_offers_parts(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, booked_offer_part_delete_request: models::BookedOfferPartDeleteRequest, requestor: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>) -> Result<(), Error<DeleteBookingBookedOffersPartsError>> {
428    // add a prefix to parameters to efficiently prevent name collisions
429    let p_path_booking_id = booking_id;
430    let p_path_booked_offer_id = booked_offer_id;
431    let p_body_booked_offer_part_delete_request = booked_offer_part_delete_request;
432    let p_header_requestor = requestor;
433    let p_header_traceparent = traceparent;
434    let p_header_tracestate = tracestate;
435
436    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/offer-parts", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id));
437    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
438
439    if let Some(ref user_agent) = configuration.user_agent {
440        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
441    }
442    if let Some(param_value) = p_header_requestor {
443        req_builder = req_builder.header("Requestor", param_value.to_string());
444    }
445    if let Some(param_value) = p_header_traceparent {
446        req_builder = req_builder.header("traceparent", param_value.to_string());
447    }
448    if let Some(param_value) = p_header_tracestate {
449        req_builder = req_builder.header("tracestate", param_value.to_string());
450    }
451    if let Some(ref token) = configuration.oauth_access_token {
452        req_builder = req_builder.bearer_auth(token.to_owned());
453    };
454    req_builder = req_builder.json(&p_body_booked_offer_part_delete_request);
455
456    let req = req_builder.build()?;
457    let resp = configuration.client.execute(req).await?;
458
459    let status = resp.status();
460
461    if !status.is_client_error() && !status.is_server_error() {
462        Ok(())
463    } else {
464        let content = resp.text().await?;
465        let entity: Option<DeleteBookingBookedOffersPartsError> = serde_json::from_str(&content).ok();
466        Err(Error::ResponseError(ResponseContent { status, content, entity }))
467    }
468}
469
470#[deprecated]
471pub async fn delete_booking_booked_offers_reservations(configuration: &configuration::Configuration, booking_id: &str, booked_offer_id: &str, reservation_id: &str, requestor: Option<&str>, accept_language: Option<&str>, traceparent: Option<&str>, tracestate: Option<&str>) -> Result<(), Error<DeleteBookingBookedOffersReservationsError>> {
472    // add a prefix to parameters to efficiently prevent name collisions
473    let p_path_booking_id = booking_id;
474    let p_path_booked_offer_id = booked_offer_id;
475    let p_path_reservation_id = reservation_id;
476    let p_header_requestor = requestor;
477    let p_header_accept_language = accept_language;
478    let p_header_traceparent = traceparent;
479    let p_header_tracestate = tracestate;
480
481    let uri_str = format!("{}/bookings/{bookingId}/booked-offers/{bookedOfferId}/reservations/{reservationId}", configuration.base_path, bookingId=crate::apis::urlencode(p_path_booking_id), bookedOfferId=crate::apis::urlencode(p_path_booked_offer_id), reservationId=crate::apis::urlencode(p_path_reservation_id));
482    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
483
484    if let Some(ref user_agent) = configuration.user_agent {
485        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
486    }
487    if let Some(param_value) = p_header_requestor {
488        req_builder = req_builder.header("Requestor", param_value.to_string());
489    }
490    if let Some(param_value) = p_header_accept_language {
491        req_builder = req_builder.header("Accept-Language", param_value.to_string());
492    }
493    if let Some(param_value) = p_header_traceparent {
494        req_builder = req_builder.header("traceparent", param_value.to_string());
495    }
496    if let Some(param_value) = p_header_tracestate {
497        req_builder = req_builder.header("tracestate", param_value.to_string());
498    }
499    if let Some(ref token) = configuration.oauth_access_token {
500        req_builder = req_builder.bearer_auth(token.to_owned());
501    };
502
503    let req = req_builder.build()?;
504    let resp = configuration.client.execute(req).await?;
505
506    let status = resp.status();
507
508    if !status.is_client_error() && !status.is_server_error() {
509        Ok(())
510    } else {
511        let content = resp.text().await?;
512        let entity: Option<DeleteBookingBookedOffersReservationsError> = serde_json::from_str(&content).ok();
513        Err(Error::ResponseError(ResponseContent { status, content, entity }))
514    }
515}
516