1use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum DeleteProjectsBySlugError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum DeleteProjectsBySlugDomainsByHostError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum DeleteProjectsBySlugStarError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum GetProjectsError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum GetProjectsBySlugError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum GetProjectsBySlugDeploymentsError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum GetProjectsBySlugDeploymentsByIdError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum GetProjectsBySlugDomainsError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetProjectsBySlugReleasesError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum GetProjectsBySlugShotError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum GetProjectsEdgeError {
92 Status503(models::EdgeState),
93 UnknownValue(serde_json::Value),
94}
95
96#[derive(Debug, Clone, Serialize, Deserialize)]
98#[serde(untagged)]
99pub enum GetProjectsSitesError {
100 UnknownValue(serde_json::Value),
101}
102
103#[derive(Debug, Clone, Serialize, Deserialize)]
105#[serde(untagged)]
106pub enum GetProjectsSitesBySlugError {
107 UnknownValue(serde_json::Value),
108}
109
110#[derive(Debug, Clone, Serialize, Deserialize)]
112#[serde(untagged)]
113pub enum GetProjectsTagsError {
114 UnknownValue(serde_json::Value),
115}
116
117#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum PatchProjectsBySlugError {
121 UnknownValue(serde_json::Value),
122}
123
124#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum PostProjectsError {
128 UnknownValue(serde_json::Value),
129}
130
131#[derive(Debug, Clone, Serialize, Deserialize)]
133#[serde(untagged)]
134pub enum PostProjectsBySlugDeployError {
135 UnknownValue(serde_json::Value),
136}
137
138#[derive(Debug, Clone, Serialize, Deserialize)]
140#[serde(untagged)]
141pub enum PostProjectsBySlugDeploymentsError {
142 UnknownValue(serde_json::Value),
143}
144
145#[derive(Debug, Clone, Serialize, Deserialize)]
147#[serde(untagged)]
148pub enum PostProjectsBySlugDeploymentsByIdCompleteError {
149 UnknownValue(serde_json::Value),
150}
151
152#[derive(Debug, Clone, Serialize, Deserialize)]
154#[serde(untagged)]
155pub enum PostProjectsBySlugDomainsError {
156 UnknownValue(serde_json::Value),
157}
158
159#[derive(Debug, Clone, Serialize, Deserialize)]
161#[serde(untagged)]
162pub enum PostProjectsBySlugDomainsByHostVerifyError {
163 UnknownValue(serde_json::Value),
164}
165
166#[derive(Debug, Clone, Serialize, Deserialize)]
168#[serde(untagged)]
169pub enum PostProjectsBySlugPublishError {
170 UnknownValue(serde_json::Value),
171}
172
173#[derive(Debug, Clone, Serialize, Deserialize)]
175#[serde(untagged)]
176pub enum PostProjectsBySlugPurgeError {
177 UnknownValue(serde_json::Value),
178}
179
180#[derive(Debug, Clone, Serialize, Deserialize)]
182#[serde(untagged)]
183pub enum PostProjectsBySlugReleasesError {
184 UnknownValue(serde_json::Value),
185}
186
187#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum PostProjectsBySlugReleasesByReleaseActivateError {
191 UnknownValue(serde_json::Value),
192}
193
194#[derive(Debug, Clone, Serialize, Deserialize)]
196#[serde(untagged)]
197pub enum PostProjectsForkError {
198 UnknownValue(serde_json::Value),
199}
200
201#[derive(Debug, Clone, Serialize, Deserialize)]
203#[serde(untagged)]
204pub enum PostProjectsSitesError {
205 UnknownValue(serde_json::Value),
206}
207
208#[derive(Debug, Clone, Serialize, Deserialize)]
210#[serde(untagged)]
211pub enum PostProjectsSitesDeployError {
212 UnknownValue(serde_json::Value),
213}
214
215#[derive(Debug, Clone, Serialize, Deserialize)]
217#[serde(untagged)]
218pub enum PutProjectsBySlugStarError {
219 UnknownValue(serde_json::Value),
220}
221
222
223pub async fn delete_projects_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<DeleteProjectsBySlugError>> {
225 let p_slug = slug;
227
228 let uri_str = format!("{}/v1/projects/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
229 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
230
231 if let Some(ref user_agent) = configuration.user_agent {
232 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
233 }
234 if let Some(ref token) = configuration.bearer_access_token {
235 req_builder = req_builder.bearer_auth(token.to_owned());
236 };
237
238 let req = req_builder.build()?;
239 let resp = configuration.client.execute(req).await?;
240
241 let status = resp.status();
242
243 if !status.is_client_error() && !status.is_server_error() {
244 Ok(())
245 } else {
246 let content = resp.text().await?;
247 let entity: Option<DeleteProjectsBySlugError> = serde_json::from_str(&content).ok();
248 Err(Error::ResponseError(ResponseContent { status, content, entity }))
249 }
250}
251
252pub async fn delete_projects_by_slug_domains_by_host(configuration: &configuration::Configuration, slug: &str, host: &str) -> Result<(), Error<DeleteProjectsBySlugDomainsByHostError>> {
254 let p_slug = slug;
256 let p_host = host;
257
258 let uri_str = format!("{}/v1/projects/{slug}/domains/{host}", configuration.base_path, slug=crate::apis::urlencode(p_slug), host=crate::apis::urlencode(p_host));
259 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
260
261 if let Some(ref user_agent) = configuration.user_agent {
262 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
263 }
264 if let Some(ref token) = configuration.bearer_access_token {
265 req_builder = req_builder.bearer_auth(token.to_owned());
266 };
267
268 let req = req_builder.build()?;
269 let resp = configuration.client.execute(req).await?;
270
271 let status = resp.status();
272
273 if !status.is_client_error() && !status.is_server_error() {
274 Ok(())
275 } else {
276 let content = resp.text().await?;
277 let entity: Option<DeleteProjectsBySlugDomainsByHostError> = serde_json::from_str(&content).ok();
278 Err(Error::ResponseError(ResponseContent { status, content, entity }))
279 }
280}
281
282pub async fn delete_projects_by_slug_star(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsStar, Error<DeleteProjectsBySlugStarError>> {
284 let p_slug = slug;
286
287 let uri_str = format!("{}/v1/projects/{slug}/star", configuration.base_path, slug=crate::apis::urlencode(p_slug));
288 let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
289
290 if let Some(ref user_agent) = configuration.user_agent {
291 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
292 }
293 if let Some(ref token) = configuration.bearer_access_token {
294 req_builder = req_builder.bearer_auth(token.to_owned());
295 };
296
297 let req = req_builder.build()?;
298 let resp = configuration.client.execute(req).await?;
299
300 let status = resp.status();
301 let content_type = resp
302 .headers()
303 .get("content-type")
304 .and_then(|v| v.to_str().ok())
305 .unwrap_or("application/octet-stream");
306 let content_type = super::ContentType::from(content_type);
307
308 if !status.is_client_error() && !status.is_server_error() {
309 let content = resp.text().await?;
310 match content_type {
311 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
312 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsStar`"))),
313 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::ProjectsStar`")))),
314 }
315 } else {
316 let content = resp.text().await?;
317 let entity: Option<DeleteProjectsBySlugStarError> = serde_json::from_str(&content).ok();
318 Err(Error::ResponseError(ResponseContent { status, content, entity }))
319 }
320}
321
322pub async fn get_projects(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProjectsProject>, Error<GetProjectsError>> {
324
325 let uri_str = format!("{}/v1/projects", configuration.base_path);
326 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
327
328 if let Some(ref user_agent) = configuration.user_agent {
329 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
330 }
331 if let Some(ref token) = configuration.bearer_access_token {
332 req_builder = req_builder.bearer_auth(token.to_owned());
333 };
334
335 let req = req_builder.build()?;
336 let resp = configuration.client.execute(req).await?;
337
338 let status = resp.status();
339 let content_type = resp
340 .headers()
341 .get("content-type")
342 .and_then(|v| v.to_str().ok())
343 .unwrap_or("application/octet-stream");
344 let content_type = super::ContentType::from(content_type);
345
346 if !status.is_client_error() && !status.is_server_error() {
347 let content = resp.text().await?;
348 match content_type {
349 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
350 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProjectsProject>`"))),
351 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProjectsProject>`")))),
352 }
353 } else {
354 let content = resp.text().await?;
355 let entity: Option<GetProjectsError> = serde_json::from_str(&content).ok();
356 Err(Error::ResponseError(ResponseContent { status, content, entity }))
357 }
358}
359
360pub async fn get_projects_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsProject, Error<GetProjectsBySlugError>> {
362 let p_slug = slug;
364
365 let uri_str = format!("{}/v1/projects/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
366 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
367
368 if let Some(ref user_agent) = configuration.user_agent {
369 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
370 }
371 if let Some(ref token) = configuration.bearer_access_token {
372 req_builder = req_builder.bearer_auth(token.to_owned());
373 };
374
375 let req = req_builder.build()?;
376 let resp = configuration.client.execute(req).await?;
377
378 let status = resp.status();
379 let content_type = resp
380 .headers()
381 .get("content-type")
382 .and_then(|v| v.to_str().ok())
383 .unwrap_or("application/octet-stream");
384 let content_type = super::ContentType::from(content_type);
385
386 if !status.is_client_error() && !status.is_server_error() {
387 let content = resp.text().await?;
388 match content_type {
389 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
390 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsProject`"))),
391 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::ProjectsProject`")))),
392 }
393 } else {
394 let content = resp.text().await?;
395 let entity: Option<GetProjectsBySlugError> = serde_json::from_str(&content).ok();
396 Err(Error::ResponseError(ResponseContent { status, content, entity }))
397 }
398}
399
400pub async fn get_projects_by_slug_deployments(configuration: &configuration::Configuration, slug: &str) -> Result<Vec<models::ProjectsDeployment>, Error<GetProjectsBySlugDeploymentsError>> {
402 let p_slug = slug;
404
405 let uri_str = format!("{}/v1/projects/{slug}/deployments", configuration.base_path, slug=crate::apis::urlencode(p_slug));
406 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
407
408 if let Some(ref user_agent) = configuration.user_agent {
409 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
410 }
411 if let Some(ref token) = configuration.bearer_access_token {
412 req_builder = req_builder.bearer_auth(token.to_owned());
413 };
414
415 let req = req_builder.build()?;
416 let resp = configuration.client.execute(req).await?;
417
418 let status = resp.status();
419 let content_type = resp
420 .headers()
421 .get("content-type")
422 .and_then(|v| v.to_str().ok())
423 .unwrap_or("application/octet-stream");
424 let content_type = super::ContentType::from(content_type);
425
426 if !status.is_client_error() && !status.is_server_error() {
427 let content = resp.text().await?;
428 match content_type {
429 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
430 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProjectsDeployment>`"))),
431 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProjectsDeployment>`")))),
432 }
433 } else {
434 let content = resp.text().await?;
435 let entity: Option<GetProjectsBySlugDeploymentsError> = serde_json::from_str(&content).ok();
436 Err(Error::ResponseError(ResponseContent { status, content, entity }))
437 }
438}
439
440pub async fn get_projects_by_slug_deployments_by_id(configuration: &configuration::Configuration, slug: &str, id: &str) -> Result<models::ProjectsDeployment, Error<GetProjectsBySlugDeploymentsByIdError>> {
442 let p_slug = slug;
444 let p_id = id;
445
446 let uri_str = format!("{}/v1/projects/{slug}/deployments/{id}", configuration.base_path, slug=crate::apis::urlencode(p_slug), id=crate::apis::urlencode(p_id));
447 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
448
449 if let Some(ref user_agent) = configuration.user_agent {
450 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
451 }
452 if let Some(ref token) = configuration.bearer_access_token {
453 req_builder = req_builder.bearer_auth(token.to_owned());
454 };
455
456 let req = req_builder.build()?;
457 let resp = configuration.client.execute(req).await?;
458
459 let status = resp.status();
460 let content_type = resp
461 .headers()
462 .get("content-type")
463 .and_then(|v| v.to_str().ok())
464 .unwrap_or("application/octet-stream");
465 let content_type = super::ContentType::from(content_type);
466
467 if !status.is_client_error() && !status.is_server_error() {
468 let content = resp.text().await?;
469 match content_type {
470 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
471 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDeployment`"))),
472 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::ProjectsDeployment`")))),
473 }
474 } else {
475 let content = resp.text().await?;
476 let entity: Option<GetProjectsBySlugDeploymentsByIdError> = serde_json::from_str(&content).ok();
477 Err(Error::ResponseError(ResponseContent { status, content, entity }))
478 }
479}
480
481pub async fn get_projects_by_slug_domains(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsDomains, Error<GetProjectsBySlugDomainsError>> {
483 let p_slug = slug;
485
486 let uri_str = format!("{}/v1/projects/{slug}/domains", configuration.base_path, slug=crate::apis::urlencode(p_slug));
487 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
488
489 if let Some(ref user_agent) = configuration.user_agent {
490 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
491 }
492 if let Some(ref token) = configuration.bearer_access_token {
493 req_builder = req_builder.bearer_auth(token.to_owned());
494 };
495
496 let req = req_builder.build()?;
497 let resp = configuration.client.execute(req).await?;
498
499 let status = resp.status();
500 let content_type = resp
501 .headers()
502 .get("content-type")
503 .and_then(|v| v.to_str().ok())
504 .unwrap_or("application/octet-stream");
505 let content_type = super::ContentType::from(content_type);
506
507 if !status.is_client_error() && !status.is_server_error() {
508 let content = resp.text().await?;
509 match content_type {
510 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
511 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDomains`"))),
512 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::ProjectsDomains`")))),
513 }
514 } else {
515 let content = resp.text().await?;
516 let entity: Option<GetProjectsBySlugDomainsError> = serde_json::from_str(&content).ok();
517 Err(Error::ResponseError(ResponseContent { status, content, entity }))
518 }
519}
520
521pub async fn get_projects_by_slug_releases(configuration: &configuration::Configuration, slug: &str) -> Result<Vec<models::ProjectsRelease>, Error<GetProjectsBySlugReleasesError>> {
523 let p_slug = slug;
525
526 let uri_str = format!("{}/v1/projects/{slug}/releases", configuration.base_path, slug=crate::apis::urlencode(p_slug));
527 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
528
529 if let Some(ref user_agent) = configuration.user_agent {
530 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
531 }
532 if let Some(ref token) = configuration.bearer_access_token {
533 req_builder = req_builder.bearer_auth(token.to_owned());
534 };
535
536 let req = req_builder.build()?;
537 let resp = configuration.client.execute(req).await?;
538
539 let status = resp.status();
540 let content_type = resp
541 .headers()
542 .get("content-type")
543 .and_then(|v| v.to_str().ok())
544 .unwrap_or("application/octet-stream");
545 let content_type = super::ContentType::from(content_type);
546
547 if !status.is_client_error() && !status.is_server_error() {
548 let content = resp.text().await?;
549 match content_type {
550 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
551 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProjectsRelease>`"))),
552 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProjectsRelease>`")))),
553 }
554 } else {
555 let content = resp.text().await?;
556 let entity: Option<GetProjectsBySlugReleasesError> = serde_json::from_str(&content).ok();
557 Err(Error::ResponseError(ResponseContent { status, content, entity }))
558 }
559}
560
561pub async fn get_projects_by_slug_shot(configuration: &configuration::Configuration, slug: &str) -> Result<(), Error<GetProjectsBySlugShotError>> {
563 let p_slug = slug;
565
566 let uri_str = format!("{}/v1/projects/{slug}/shot", configuration.base_path, slug=crate::apis::urlencode(p_slug));
567 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
568
569 if let Some(ref user_agent) = configuration.user_agent {
570 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
571 }
572 if let Some(ref token) = configuration.bearer_access_token {
573 req_builder = req_builder.bearer_auth(token.to_owned());
574 };
575
576 let req = req_builder.build()?;
577 let resp = configuration.client.execute(req).await?;
578
579 let status = resp.status();
580
581 if !status.is_client_error() && !status.is_server_error() {
582 Ok(())
583 } else {
584 let content = resp.text().await?;
585 let entity: Option<GetProjectsBySlugShotError> = serde_json::from_str(&content).ok();
586 Err(Error::ResponseError(ResponseContent { status, content, entity }))
587 }
588}
589
590pub async fn get_projects_edge(configuration: &configuration::Configuration, ) -> Result<models::EdgeState, Error<GetProjectsEdgeError>> {
592
593 let uri_str = format!("{}/v1/projects/edge", configuration.base_path);
594 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
595
596 if let Some(ref user_agent) = configuration.user_agent {
597 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
598 }
599 if let Some(ref token) = configuration.bearer_access_token {
600 req_builder = req_builder.bearer_auth(token.to_owned());
601 };
602
603 let req = req_builder.build()?;
604 let resp = configuration.client.execute(req).await?;
605
606 let status = resp.status();
607 let content_type = resp
608 .headers()
609 .get("content-type")
610 .and_then(|v| v.to_str().ok())
611 .unwrap_or("application/octet-stream");
612 let content_type = super::ContentType::from(content_type);
613
614 if !status.is_client_error() && !status.is_server_error() {
615 let content = resp.text().await?;
616 match content_type {
617 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
618 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::EdgeState`"))),
619 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::EdgeState`")))),
620 }
621 } else {
622 let content = resp.text().await?;
623 let entity: Option<GetProjectsEdgeError> = serde_json::from_str(&content).ok();
624 Err(Error::ResponseError(ResponseContent { status, content, entity }))
625 }
626}
627
628pub async fn get_projects_sites(configuration: &configuration::Configuration, ) -> Result<Vec<models::ProjectsSite>, Error<GetProjectsSitesError>> {
630
631 let uri_str = format!("{}/v1/projects/sites", configuration.base_path);
632 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
633
634 if let Some(ref user_agent) = configuration.user_agent {
635 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
636 }
637 if let Some(ref token) = configuration.bearer_access_token {
638 req_builder = req_builder.bearer_auth(token.to_owned());
639 };
640
641 let req = req_builder.build()?;
642 let resp = configuration.client.execute(req).await?;
643
644 let status = resp.status();
645 let content_type = resp
646 .headers()
647 .get("content-type")
648 .and_then(|v| v.to_str().ok())
649 .unwrap_or("application/octet-stream");
650 let content_type = super::ContentType::from(content_type);
651
652 if !status.is_client_error() && !status.is_server_error() {
653 let content = resp.text().await?;
654 match content_type {
655 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
656 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ProjectsSite>`"))),
657 ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ProjectsSite>`")))),
658 }
659 } else {
660 let content = resp.text().await?;
661 let entity: Option<GetProjectsSitesError> = serde_json::from_str(&content).ok();
662 Err(Error::ResponseError(ResponseContent { status, content, entity }))
663 }
664}
665
666pub async fn get_projects_sites_by_slug(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsSite, Error<GetProjectsSitesBySlugError>> {
668 let p_slug = slug;
670
671 let uri_str = format!("{}/v1/projects/sites/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
672 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
673
674 if let Some(ref user_agent) = configuration.user_agent {
675 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
676 }
677 if let Some(ref token) = configuration.bearer_access_token {
678 req_builder = req_builder.bearer_auth(token.to_owned());
679 };
680
681 let req = req_builder.build()?;
682 let resp = configuration.client.execute(req).await?;
683
684 let status = resp.status();
685 let content_type = resp
686 .headers()
687 .get("content-type")
688 .and_then(|v| v.to_str().ok())
689 .unwrap_or("application/octet-stream");
690 let content_type = super::ContentType::from(content_type);
691
692 if !status.is_client_error() && !status.is_server_error() {
693 let content = resp.text().await?;
694 match content_type {
695 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
696 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsSite`"))),
697 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::ProjectsSite`")))),
698 }
699 } else {
700 let content = resp.text().await?;
701 let entity: Option<GetProjectsSitesBySlugError> = serde_json::from_str(&content).ok();
702 Err(Error::ResponseError(ResponseContent { status, content, entity }))
703 }
704}
705
706pub async fn get_projects_tags(configuration: &configuration::Configuration, ) -> Result<models::TagConfig, Error<GetProjectsTagsError>> {
708
709 let uri_str = format!("{}/v1/projects/tags", configuration.base_path);
710 let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
711
712 if let Some(ref user_agent) = configuration.user_agent {
713 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
714 }
715 if let Some(ref token) = configuration.bearer_access_token {
716 req_builder = req_builder.bearer_auth(token.to_owned());
717 };
718
719 let req = req_builder.build()?;
720 let resp = configuration.client.execute(req).await?;
721
722 let status = resp.status();
723 let content_type = resp
724 .headers()
725 .get("content-type")
726 .and_then(|v| v.to_str().ok())
727 .unwrap_or("application/octet-stream");
728 let content_type = super::ContentType::from(content_type);
729
730 if !status.is_client_error() && !status.is_server_error() {
731 let content = resp.text().await?;
732 match content_type {
733 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
734 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TagConfig`"))),
735 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::TagConfig`")))),
736 }
737 } else {
738 let content = resp.text().await?;
739 let entity: Option<GetProjectsTagsError> = serde_json::from_str(&content).ok();
740 Err(Error::ResponseError(ResponseContent { status, content, entity }))
741 }
742}
743
744pub async fn patch_projects_by_slug(configuration: &configuration::Configuration, slug: &str, projects_update: models::ProjectsUpdate) -> Result<models::ProjectsProject, Error<PatchProjectsBySlugError>> {
746 let p_slug = slug;
748 let p_projects_update = projects_update;
749
750 let uri_str = format!("{}/v1/projects/{slug}", configuration.base_path, slug=crate::apis::urlencode(p_slug));
751 let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
752
753 if let Some(ref user_agent) = configuration.user_agent {
754 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
755 }
756 if let Some(ref token) = configuration.bearer_access_token {
757 req_builder = req_builder.bearer_auth(token.to_owned());
758 };
759 req_builder = req_builder.json(&p_projects_update);
760
761 let req = req_builder.build()?;
762 let resp = configuration.client.execute(req).await?;
763
764 let status = resp.status();
765 let content_type = resp
766 .headers()
767 .get("content-type")
768 .and_then(|v| v.to_str().ok())
769 .unwrap_or("application/octet-stream");
770 let content_type = super::ContentType::from(content_type);
771
772 if !status.is_client_error() && !status.is_server_error() {
773 let content = resp.text().await?;
774 match content_type {
775 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
776 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsProject`"))),
777 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::ProjectsProject`")))),
778 }
779 } else {
780 let content = resp.text().await?;
781 let entity: Option<PatchProjectsBySlugError> = serde_json::from_str(&content).ok();
782 Err(Error::ResponseError(ResponseContent { status, content, entity }))
783 }
784}
785
786pub async fn post_projects(configuration: &configuration::Configuration, projects_create: models::ProjectsCreate) -> Result<models::ProjectsProject, Error<PostProjectsError>> {
788 let p_projects_create = projects_create;
790
791 let uri_str = format!("{}/v1/projects", configuration.base_path);
792 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
793
794 if let Some(ref user_agent) = configuration.user_agent {
795 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
796 }
797 if let Some(ref token) = configuration.bearer_access_token {
798 req_builder = req_builder.bearer_auth(token.to_owned());
799 };
800 req_builder = req_builder.json(&p_projects_create);
801
802 let req = req_builder.build()?;
803 let resp = configuration.client.execute(req).await?;
804
805 let status = resp.status();
806 let content_type = resp
807 .headers()
808 .get("content-type")
809 .and_then(|v| v.to_str().ok())
810 .unwrap_or("application/octet-stream");
811 let content_type = super::ContentType::from(content_type);
812
813 if !status.is_client_error() && !status.is_server_error() {
814 let content = resp.text().await?;
815 match content_type {
816 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
817 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsProject`"))),
818 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::ProjectsProject`")))),
819 }
820 } else {
821 let content = resp.text().await?;
822 let entity: Option<PostProjectsError> = serde_json::from_str(&content).ok();
823 Err(Error::ResponseError(ResponseContent { status, content, entity }))
824 }
825}
826
827pub async fn post_projects_by_slug_deploy(configuration: &configuration::Configuration, slug: &str, body: Option<Vec<u8>>) -> Result<models::ProjectsDeployment, Error<PostProjectsBySlugDeployError>> {
829 let p_slug = slug;
831 let p_body = body;
832
833 let uri_str = format!("{}/v1/projects/{slug}/deploy", configuration.base_path, slug=crate::apis::urlencode(p_slug));
834 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
835
836 if let Some(ref user_agent) = configuration.user_agent {
837 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
838 }
839 if let Some(ref token) = configuration.bearer_access_token {
840 req_builder = req_builder.bearer_auth(token.to_owned());
841 };
842 if let Some(body) = p_body {
843 req_builder = req_builder.body(body);
844 }
845
846 let req = req_builder.build()?;
847 let resp = configuration.client.execute(req).await?;
848
849 let status = resp.status();
850 let content_type = resp
851 .headers()
852 .get("content-type")
853 .and_then(|v| v.to_str().ok())
854 .unwrap_or("application/octet-stream");
855 let content_type = super::ContentType::from(content_type);
856
857 if !status.is_client_error() && !status.is_server_error() {
858 let content = resp.text().await?;
859 match content_type {
860 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
861 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDeployment`"))),
862 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::ProjectsDeployment`")))),
863 }
864 } else {
865 let content = resp.text().await?;
866 let entity: Option<PostProjectsBySlugDeployError> = serde_json::from_str(&content).ok();
867 Err(Error::ResponseError(ResponseContent { status, content, entity }))
868 }
869}
870
871pub async fn post_projects_by_slug_deployments(configuration: &configuration::Configuration, slug: &str, projects_deploy_start: models::ProjectsDeployStart) -> Result<models::ProjectsDeployment, Error<PostProjectsBySlugDeploymentsError>> {
873 let p_slug = slug;
875 let p_projects_deploy_start = projects_deploy_start;
876
877 let uri_str = format!("{}/v1/projects/{slug}/deployments", configuration.base_path, slug=crate::apis::urlencode(p_slug));
878 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
879
880 if let Some(ref user_agent) = configuration.user_agent {
881 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
882 }
883 if let Some(ref token) = configuration.bearer_access_token {
884 req_builder = req_builder.bearer_auth(token.to_owned());
885 };
886 req_builder = req_builder.json(&p_projects_deploy_start);
887
888 let req = req_builder.build()?;
889 let resp = configuration.client.execute(req).await?;
890
891 let status = resp.status();
892 let content_type = resp
893 .headers()
894 .get("content-type")
895 .and_then(|v| v.to_str().ok())
896 .unwrap_or("application/octet-stream");
897 let content_type = super::ContentType::from(content_type);
898
899 if !status.is_client_error() && !status.is_server_error() {
900 let content = resp.text().await?;
901 match content_type {
902 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
903 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDeployment`"))),
904 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::ProjectsDeployment`")))),
905 }
906 } else {
907 let content = resp.text().await?;
908 let entity: Option<PostProjectsBySlugDeploymentsError> = serde_json::from_str(&content).ok();
909 Err(Error::ResponseError(ResponseContent { status, content, entity }))
910 }
911}
912
913pub async fn post_projects_by_slug_deployments_by_id_complete(configuration: &configuration::Configuration, slug: &str, id: &str, projects_complete: models::ProjectsComplete) -> Result<models::ProjectsDeployment, Error<PostProjectsBySlugDeploymentsByIdCompleteError>> {
915 let p_slug = slug;
917 let p_id = id;
918 let p_projects_complete = projects_complete;
919
920 let uri_str = format!("{}/v1/projects/{slug}/deployments/{id}/complete", configuration.base_path, slug=crate::apis::urlencode(p_slug), id=crate::apis::urlencode(p_id));
921 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
922
923 if let Some(ref user_agent) = configuration.user_agent {
924 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
925 }
926 if let Some(ref token) = configuration.bearer_access_token {
927 req_builder = req_builder.bearer_auth(token.to_owned());
928 };
929 req_builder = req_builder.json(&p_projects_complete);
930
931 let req = req_builder.build()?;
932 let resp = configuration.client.execute(req).await?;
933
934 let status = resp.status();
935 let content_type = resp
936 .headers()
937 .get("content-type")
938 .and_then(|v| v.to_str().ok())
939 .unwrap_or("application/octet-stream");
940 let content_type = super::ContentType::from(content_type);
941
942 if !status.is_client_error() && !status.is_server_error() {
943 let content = resp.text().await?;
944 match content_type {
945 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
946 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDeployment`"))),
947 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::ProjectsDeployment`")))),
948 }
949 } else {
950 let content = resp.text().await?;
951 let entity: Option<PostProjectsBySlugDeploymentsByIdCompleteError> = serde_json::from_str(&content).ok();
952 Err(Error::ResponseError(ResponseContent { status, content, entity }))
953 }
954}
955
956pub async fn post_projects_by_slug_domains(configuration: &configuration::Configuration, slug: &str, projects_domains_bind: models::ProjectsDomainsBind) -> Result<models::ProjectsBoundDomains, Error<PostProjectsBySlugDomainsError>> {
958 let p_slug = slug;
960 let p_projects_domains_bind = projects_domains_bind;
961
962 let uri_str = format!("{}/v1/projects/{slug}/domains", configuration.base_path, slug=crate::apis::urlencode(p_slug));
963 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
964
965 if let Some(ref user_agent) = configuration.user_agent {
966 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
967 }
968 if let Some(ref token) = configuration.bearer_access_token {
969 req_builder = req_builder.bearer_auth(token.to_owned());
970 };
971 req_builder = req_builder.json(&p_projects_domains_bind);
972
973 let req = req_builder.build()?;
974 let resp = configuration.client.execute(req).await?;
975
976 let status = resp.status();
977 let content_type = resp
978 .headers()
979 .get("content-type")
980 .and_then(|v| v.to_str().ok())
981 .unwrap_or("application/octet-stream");
982 let content_type = super::ContentType::from(content_type);
983
984 if !status.is_client_error() && !status.is_server_error() {
985 let content = resp.text().await?;
986 match content_type {
987 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
988 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsBoundDomains`"))),
989 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::ProjectsBoundDomains`")))),
990 }
991 } else {
992 let content = resp.text().await?;
993 let entity: Option<PostProjectsBySlugDomainsError> = serde_json::from_str(&content).ok();
994 Err(Error::ResponseError(ResponseContent { status, content, entity }))
995 }
996}
997
998pub async fn post_projects_by_slug_domains_by_host_verify(configuration: &configuration::Configuration, slug: &str, host: &str) -> Result<models::ProjectsDomain, Error<PostProjectsBySlugDomainsByHostVerifyError>> {
1000 let p_slug = slug;
1002 let p_host = host;
1003
1004 let uri_str = format!("{}/v1/projects/{slug}/domains/{host}/verify", configuration.base_path, slug=crate::apis::urlencode(p_slug), host=crate::apis::urlencode(p_host));
1005 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1006
1007 if let Some(ref user_agent) = configuration.user_agent {
1008 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1009 }
1010 if let Some(ref token) = configuration.bearer_access_token {
1011 req_builder = req_builder.bearer_auth(token.to_owned());
1012 };
1013
1014 let req = req_builder.build()?;
1015 let resp = configuration.client.execute(req).await?;
1016
1017 let status = resp.status();
1018 let content_type = resp
1019 .headers()
1020 .get("content-type")
1021 .and_then(|v| v.to_str().ok())
1022 .unwrap_or("application/octet-stream");
1023 let content_type = super::ContentType::from(content_type);
1024
1025 if !status.is_client_error() && !status.is_server_error() {
1026 let content = resp.text().await?;
1027 match content_type {
1028 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1029 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsDomain`"))),
1030 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::ProjectsDomain`")))),
1031 }
1032 } else {
1033 let content = resp.text().await?;
1034 let entity: Option<PostProjectsBySlugDomainsByHostVerifyError> = serde_json::from_str(&content).ok();
1035 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1036 }
1037}
1038
1039pub async fn post_projects_by_slug_publish(configuration: &configuration::Configuration, slug: &str, projects_publish: models::ProjectsPublish) -> Result<models::ProjectsRelease, Error<PostProjectsBySlugPublishError>> {
1041 let p_slug = slug;
1043 let p_projects_publish = projects_publish;
1044
1045 let uri_str = format!("{}/v1/projects/{slug}/publish", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1046 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1047
1048 if let Some(ref user_agent) = configuration.user_agent {
1049 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1050 }
1051 if let Some(ref token) = configuration.bearer_access_token {
1052 req_builder = req_builder.bearer_auth(token.to_owned());
1053 };
1054 req_builder = req_builder.json(&p_projects_publish);
1055
1056 let req = req_builder.build()?;
1057 let resp = configuration.client.execute(req).await?;
1058
1059 let status = resp.status();
1060 let content_type = resp
1061 .headers()
1062 .get("content-type")
1063 .and_then(|v| v.to_str().ok())
1064 .unwrap_or("application/octet-stream");
1065 let content_type = super::ContentType::from(content_type);
1066
1067 if !status.is_client_error() && !status.is_server_error() {
1068 let content = resp.text().await?;
1069 match content_type {
1070 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1071 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsRelease`"))),
1072 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::ProjectsRelease`")))),
1073 }
1074 } else {
1075 let content = resp.text().await?;
1076 let entity: Option<PostProjectsBySlugPublishError> = serde_json::from_str(&content).ok();
1077 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1078 }
1079}
1080
1081pub async fn post_projects_by_slug_purge(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsProject, Error<PostProjectsBySlugPurgeError>> {
1083 let p_slug = slug;
1085
1086 let uri_str = format!("{}/v1/projects/{slug}/purge", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1087 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1088
1089 if let Some(ref user_agent) = configuration.user_agent {
1090 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1091 }
1092 if let Some(ref token) = configuration.bearer_access_token {
1093 req_builder = req_builder.bearer_auth(token.to_owned());
1094 };
1095
1096 let req = req_builder.build()?;
1097 let resp = configuration.client.execute(req).await?;
1098
1099 let status = resp.status();
1100 let content_type = resp
1101 .headers()
1102 .get("content-type")
1103 .and_then(|v| v.to_str().ok())
1104 .unwrap_or("application/octet-stream");
1105 let content_type = super::ContentType::from(content_type);
1106
1107 if !status.is_client_error() && !status.is_server_error() {
1108 let content = resp.text().await?;
1109 match content_type {
1110 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1111 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsProject`"))),
1112 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::ProjectsProject`")))),
1113 }
1114 } else {
1115 let content = resp.text().await?;
1116 let entity: Option<PostProjectsBySlugPurgeError> = serde_json::from_str(&content).ok();
1117 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1118 }
1119}
1120
1121pub async fn post_projects_by_slug_releases(configuration: &configuration::Configuration, slug: &str, projects_publish: models::ProjectsPublish) -> Result<models::ProjectsRelease, Error<PostProjectsBySlugReleasesError>> {
1123 let p_slug = slug;
1125 let p_projects_publish = projects_publish;
1126
1127 let uri_str = format!("{}/v1/projects/{slug}/releases", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1128 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1129
1130 if let Some(ref user_agent) = configuration.user_agent {
1131 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1132 }
1133 if let Some(ref token) = configuration.bearer_access_token {
1134 req_builder = req_builder.bearer_auth(token.to_owned());
1135 };
1136 req_builder = req_builder.json(&p_projects_publish);
1137
1138 let req = req_builder.build()?;
1139 let resp = configuration.client.execute(req).await?;
1140
1141 let status = resp.status();
1142 let content_type = resp
1143 .headers()
1144 .get("content-type")
1145 .and_then(|v| v.to_str().ok())
1146 .unwrap_or("application/octet-stream");
1147 let content_type = super::ContentType::from(content_type);
1148
1149 if !status.is_client_error() && !status.is_server_error() {
1150 let content = resp.text().await?;
1151 match content_type {
1152 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1153 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsRelease`"))),
1154 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::ProjectsRelease`")))),
1155 }
1156 } else {
1157 let content = resp.text().await?;
1158 let entity: Option<PostProjectsBySlugReleasesError> = serde_json::from_str(&content).ok();
1159 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1160 }
1161}
1162
1163pub async fn post_projects_by_slug_releases_by_release_activate(configuration: &configuration::Configuration, slug: &str, release: &str) -> Result<models::ProjectsRelease, Error<PostProjectsBySlugReleasesByReleaseActivateError>> {
1165 let p_slug = slug;
1167 let p_release = release;
1168
1169 let uri_str = format!("{}/v1/projects/{slug}/releases/{release}/activate", configuration.base_path, slug=crate::apis::urlencode(p_slug), release=crate::apis::urlencode(p_release));
1170 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1171
1172 if let Some(ref user_agent) = configuration.user_agent {
1173 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1174 }
1175 if let Some(ref token) = configuration.bearer_access_token {
1176 req_builder = req_builder.bearer_auth(token.to_owned());
1177 };
1178
1179 let req = req_builder.build()?;
1180 let resp = configuration.client.execute(req).await?;
1181
1182 let status = resp.status();
1183 let content_type = resp
1184 .headers()
1185 .get("content-type")
1186 .and_then(|v| v.to_str().ok())
1187 .unwrap_or("application/octet-stream");
1188 let content_type = super::ContentType::from(content_type);
1189
1190 if !status.is_client_error() && !status.is_server_error() {
1191 let content = resp.text().await?;
1192 match content_type {
1193 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1194 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsRelease`"))),
1195 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::ProjectsRelease`")))),
1196 }
1197 } else {
1198 let content = resp.text().await?;
1199 let entity: Option<PostProjectsBySlugReleasesByReleaseActivateError> = serde_json::from_str(&content).ok();
1200 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1201 }
1202}
1203
1204pub async fn post_projects_fork(configuration: &configuration::Configuration, projects_fork: models::ProjectsFork) -> Result<models::ProjectsProject, Error<PostProjectsForkError>> {
1206 let p_projects_fork = projects_fork;
1208
1209 let uri_str = format!("{}/v1/projects/fork", configuration.base_path);
1210 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1211
1212 if let Some(ref user_agent) = configuration.user_agent {
1213 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1214 }
1215 if let Some(ref token) = configuration.bearer_access_token {
1216 req_builder = req_builder.bearer_auth(token.to_owned());
1217 };
1218 req_builder = req_builder.json(&p_projects_fork);
1219
1220 let req = req_builder.build()?;
1221 let resp = configuration.client.execute(req).await?;
1222
1223 let status = resp.status();
1224 let content_type = resp
1225 .headers()
1226 .get("content-type")
1227 .and_then(|v| v.to_str().ok())
1228 .unwrap_or("application/octet-stream");
1229 let content_type = super::ContentType::from(content_type);
1230
1231 if !status.is_client_error() && !status.is_server_error() {
1232 let content = resp.text().await?;
1233 match content_type {
1234 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1235 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsProject`"))),
1236 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::ProjectsProject`")))),
1237 }
1238 } else {
1239 let content = resp.text().await?;
1240 let entity: Option<PostProjectsForkError> = serde_json::from_str(&content).ok();
1241 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1242 }
1243}
1244
1245pub async fn post_projects_sites(configuration: &configuration::Configuration, projects_build_site: models::ProjectsBuildSite) -> Result<models::ProjectsSiteDeploy, Error<PostProjectsSitesError>> {
1247 let p_projects_build_site = projects_build_site;
1249
1250 let uri_str = format!("{}/v1/projects/sites", configuration.base_path);
1251 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1252
1253 if let Some(ref user_agent) = configuration.user_agent {
1254 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1255 }
1256 if let Some(ref token) = configuration.bearer_access_token {
1257 req_builder = req_builder.bearer_auth(token.to_owned());
1258 };
1259 req_builder = req_builder.json(&p_projects_build_site);
1260
1261 let req = req_builder.build()?;
1262 let resp = configuration.client.execute(req).await?;
1263
1264 let status = resp.status();
1265 let content_type = resp
1266 .headers()
1267 .get("content-type")
1268 .and_then(|v| v.to_str().ok())
1269 .unwrap_or("application/octet-stream");
1270 let content_type = super::ContentType::from(content_type);
1271
1272 if !status.is_client_error() && !status.is_server_error() {
1273 let content = resp.text().await?;
1274 match content_type {
1275 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1276 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsSiteDeploy`"))),
1277 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::ProjectsSiteDeploy`")))),
1278 }
1279 } else {
1280 let content = resp.text().await?;
1281 let entity: Option<PostProjectsSitesError> = serde_json::from_str(&content).ok();
1282 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1283 }
1284}
1285
1286pub async fn post_projects_sites_deploy(configuration: &configuration::Configuration, projects_deploy_site: models::ProjectsDeploySite) -> Result<models::ProjectsSiteDeploy, Error<PostProjectsSitesDeployError>> {
1288 let p_projects_deploy_site = projects_deploy_site;
1290
1291 let uri_str = format!("{}/v1/projects/sites/deploy", configuration.base_path);
1292 let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1293
1294 if let Some(ref user_agent) = configuration.user_agent {
1295 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1296 }
1297 if let Some(ref token) = configuration.bearer_access_token {
1298 req_builder = req_builder.bearer_auth(token.to_owned());
1299 };
1300 req_builder = req_builder.json(&p_projects_deploy_site);
1301
1302 let req = req_builder.build()?;
1303 let resp = configuration.client.execute(req).await?;
1304
1305 let status = resp.status();
1306 let content_type = resp
1307 .headers()
1308 .get("content-type")
1309 .and_then(|v| v.to_str().ok())
1310 .unwrap_or("application/octet-stream");
1311 let content_type = super::ContentType::from(content_type);
1312
1313 if !status.is_client_error() && !status.is_server_error() {
1314 let content = resp.text().await?;
1315 match content_type {
1316 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1317 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsSiteDeploy`"))),
1318 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::ProjectsSiteDeploy`")))),
1319 }
1320 } else {
1321 let content = resp.text().await?;
1322 let entity: Option<PostProjectsSitesDeployError> = serde_json::from_str(&content).ok();
1323 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1324 }
1325}
1326
1327pub async fn put_projects_by_slug_star(configuration: &configuration::Configuration, slug: &str) -> Result<models::ProjectsStar, Error<PutProjectsBySlugStarError>> {
1329 let p_slug = slug;
1331
1332 let uri_str = format!("{}/v1/projects/{slug}/star", configuration.base_path, slug=crate::apis::urlencode(p_slug));
1333 let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1334
1335 if let Some(ref user_agent) = configuration.user_agent {
1336 req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1337 }
1338 if let Some(ref token) = configuration.bearer_access_token {
1339 req_builder = req_builder.bearer_auth(token.to_owned());
1340 };
1341
1342 let req = req_builder.build()?;
1343 let resp = configuration.client.execute(req).await?;
1344
1345 let status = resp.status();
1346 let content_type = resp
1347 .headers()
1348 .get("content-type")
1349 .and_then(|v| v.to_str().ok())
1350 .unwrap_or("application/octet-stream");
1351 let content_type = super::ContentType::from(content_type);
1352
1353 if !status.is_client_error() && !status.is_server_error() {
1354 let content = resp.text().await?;
1355 match content_type {
1356 ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1357 ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ProjectsStar`"))),
1358 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::ProjectsStar`")))),
1359 }
1360 } else {
1361 let content = resp.text().await?;
1362 let entity: Option<PutProjectsBySlugStarError> = serde_json::from_str(&content).ok();
1363 Err(Error::ResponseError(ResponseContent { status, content, entity }))
1364 }
1365}
1366