1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum GetHubProjectBySourceError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum GetHubProjectExportError {
29 UnknownValue(serde_json::Value),
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum PublishHubAppError {
36 UnknownValue(serde_json::Value),
37}
38
39#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum PublishHubDraftError {
43 UnknownValue(serde_json::Value),
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum PublishHubFlowError {
50 UnknownValue(serde_json::Value),
51}
52
53#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum PublishHubFlowRecordingError {
57 UnknownValue(serde_json::Value),
58}
59
60#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum PublishHubMigrationsError {
64 UnknownValue(serde_json::Value),
65}
66
67#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum PublishHubPipelineRecordingError {
71 UnknownValue(serde_json::Value),
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum PublishHubProjectLogoError {
78 UnknownValue(serde_json::Value),
79}
80
81#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum PublishHubRawAppError {
85 UnknownValue(serde_json::Value),
86}
87
88#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum PublishHubRawAppEmbedError {
92 UnknownValue(serde_json::Value),
93}
94
95#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum PublishHubRawAppRecordingError {
99 UnknownValue(serde_json::Value),
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum PublishHubResourceTypeError {
106 UnknownValue(serde_json::Value),
107}
108
109#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum PublishHubResourcesError {
113 UnknownValue(serde_json::Value),
114}
115
116#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum PublishHubScriptError {
120 UnknownValue(serde_json::Value),
121}
122
123#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum PublishHubScriptRecordingError {
127 UnknownValue(serde_json::Value),
128}
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum PublishHubTriggersError {
134 UnknownValue(serde_json::Value),
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum SubmitHubProjectError {
141 UnknownValue(serde_json::Value),
142}
143
144
145pub async fn get_hub_project_by_source(configuration: &configuration::Configuration, workspace: &str, folder: &str) -> Result<String, Error<GetHubProjectBySourceError>> {
147 let local_var_configuration = configuration;
148
149 let local_var_client = &local_var_configuration.client;
150
151 let local_var_uri_str = format!("{}/w/{workspace}/hub/project", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
152 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
153
154 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
155 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
156 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
157 }
158 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
159 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
160 };
161
162 let local_var_req = local_var_req_builder.build()?;
163 let local_var_resp = local_var_client.execute(local_var_req).await?;
164
165 let local_var_status = local_var_resp.status();
166 let local_var_content = local_var_resp.text().await?;
167
168 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
169 crate::from_str_patched(&local_var_content).map_err(Error::from)
170 } else {
171 let local_var_entity: Option<GetHubProjectBySourceError> = crate::from_str_patched(&local_var_content).ok();
172 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
173 Err(Error::ResponseError(local_var_error))
174 }
175}
176
177pub async fn get_hub_project_export(configuration: &configuration::Configuration, workspace: &str, slug: &str, folder: Option<&str>) -> Result<String, Error<GetHubProjectExportError>> {
179 let local_var_configuration = configuration;
180
181 let local_var_client = &local_var_configuration.client;
182
183 let local_var_uri_str = format!("{}/w/{workspace}/hub/projects/{slug}/export", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), slug=crate::apis::urlencode(slug));
184 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
185
186 if let Some(ref local_var_str) = folder {
187 local_var_req_builder = local_var_req_builder.query(&[("folder", &local_var_str.to_string())]);
188 }
189 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
190 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
191 }
192 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
193 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
194 };
195
196 let local_var_req = local_var_req_builder.build()?;
197 let local_var_resp = local_var_client.execute(local_var_req).await?;
198
199 let local_var_status = local_var_resp.status();
200 let local_var_content = local_var_resp.text().await?;
201
202 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
203 crate::from_str_patched(&local_var_content).map_err(Error::from)
204 } else {
205 let local_var_entity: Option<GetHubProjectExportError> = crate::from_str_patched(&local_var_content).ok();
206 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
207 Err(Error::ResponseError(local_var_error))
208 }
209}
210
211pub async fn publish_hub_app(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_app_body: models::PublishAppBody) -> Result<String, Error<PublishHubAppError>> {
213 let local_var_configuration = configuration;
214
215 let local_var_client = &local_var_configuration.client;
216
217 let local_var_uri_str = format!("{}/w/{workspace}/hub/apps", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
218 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
219
220 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
221 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
222 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
223 }
224 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
225 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
226 };
227 local_var_req_builder = local_var_req_builder.json(&publish_app_body);
228
229 let local_var_req = local_var_req_builder.build()?;
230 let local_var_resp = local_var_client.execute(local_var_req).await?;
231
232 let local_var_status = local_var_resp.status();
233 let local_var_content = local_var_resp.text().await?;
234
235 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
236 crate::from_str_patched(&local_var_content).map_err(Error::from)
237 } else {
238 let local_var_entity: Option<PublishHubAppError> = crate::from_str_patched(&local_var_content).ok();
239 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
240 Err(Error::ResponseError(local_var_error))
241 }
242}
243
244pub async fn publish_hub_draft(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_draft_body: models::PublishDraftBody) -> Result<String, Error<PublishHubDraftError>> {
246 let local_var_configuration = configuration;
247
248 let local_var_client = &local_var_configuration.client;
249
250 let local_var_uri_str = format!("{}/w/{workspace}/hub/publish_draft", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
251 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
252
253 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
254 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
255 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
256 }
257 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
258 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
259 };
260 local_var_req_builder = local_var_req_builder.json(&publish_draft_body);
261
262 let local_var_req = local_var_req_builder.build()?;
263 let local_var_resp = local_var_client.execute(local_var_req).await?;
264
265 let local_var_status = local_var_resp.status();
266 let local_var_content = local_var_resp.text().await?;
267
268 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
269 crate::from_str_patched(&local_var_content).map_err(Error::from)
270 } else {
271 let local_var_entity: Option<PublishHubDraftError> = crate::from_str_patched(&local_var_content).ok();
272 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
273 Err(Error::ResponseError(local_var_error))
274 }
275}
276
277pub async fn publish_hub_flow(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_flow_body: models::PublishFlowBody) -> Result<String, Error<PublishHubFlowError>> {
279 let local_var_configuration = configuration;
280
281 let local_var_client = &local_var_configuration.client;
282
283 let local_var_uri_str = format!("{}/w/{workspace}/hub/flows", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
284 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
285
286 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
287 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
288 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
289 }
290 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
291 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
292 };
293 local_var_req_builder = local_var_req_builder.json(&publish_flow_body);
294
295 let local_var_req = local_var_req_builder.build()?;
296 let local_var_resp = local_var_client.execute(local_var_req).await?;
297
298 let local_var_status = local_var_resp.status();
299 let local_var_content = local_var_resp.text().await?;
300
301 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
302 crate::from_str_patched(&local_var_content).map_err(Error::from)
303 } else {
304 let local_var_entity: Option<PublishHubFlowError> = crate::from_str_patched(&local_var_content).ok();
305 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
306 Err(Error::ResponseError(local_var_error))
307 }
308}
309
310pub async fn publish_hub_flow_recording(configuration: &configuration::Configuration, workspace: &str, flow_id: i64, folder: &str, recording_body: models::RecordingBody) -> Result<String, Error<PublishHubFlowRecordingError>> {
312 let local_var_configuration = configuration;
313
314 let local_var_client = &local_var_configuration.client;
315
316 let local_var_uri_str = format!("{}/w/{workspace}/hub/flows/{flow_id}/recording", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), flow_id=flow_id);
317 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
318
319 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
320 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
321 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
322 }
323 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
324 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
325 };
326 local_var_req_builder = local_var_req_builder.json(&recording_body);
327
328 let local_var_req = local_var_req_builder.build()?;
329 let local_var_resp = local_var_client.execute(local_var_req).await?;
330
331 let local_var_status = local_var_resp.status();
332 let local_var_content = local_var_resp.text().await?;
333
334 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
335 crate::from_str_patched(&local_var_content).map_err(Error::from)
336 } else {
337 let local_var_entity: Option<PublishHubFlowRecordingError> = crate::from_str_patched(&local_var_content).ok();
338 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
339 Err(Error::ResponseError(local_var_error))
340 }
341}
342
343pub async fn publish_hub_migrations(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_migrations_body: models::PublishMigrationsBody) -> Result<String, Error<PublishHubMigrationsError>> {
345 let local_var_configuration = configuration;
346
347 let local_var_client = &local_var_configuration.client;
348
349 let local_var_uri_str = format!("{}/w/{workspace}/hub/migrations", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
350 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
351
352 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
353 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
354 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
355 }
356 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
357 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
358 };
359 local_var_req_builder = local_var_req_builder.json(&publish_migrations_body);
360
361 let local_var_req = local_var_req_builder.build()?;
362 let local_var_resp = local_var_client.execute(local_var_req).await?;
363
364 let local_var_status = local_var_resp.status();
365 let local_var_content = local_var_resp.text().await?;
366
367 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
368 crate::from_str_patched(&local_var_content).map_err(Error::from)
369 } else {
370 let local_var_entity: Option<PublishHubMigrationsError> = crate::from_str_patched(&local_var_content).ok();
371 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
372 Err(Error::ResponseError(local_var_error))
373 }
374}
375
376pub async fn publish_hub_pipeline_recording(configuration: &configuration::Configuration, workspace: &str, slug: &str, folder: &str, pipeline_recording_body: models::PipelineRecordingBody) -> Result<String, Error<PublishHubPipelineRecordingError>> {
378 let local_var_configuration = configuration;
379
380 let local_var_client = &local_var_configuration.client;
381
382 let local_var_uri_str = format!("{}/w/{workspace}/hub/projects/{slug}/pipeline_recording", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), slug=crate::apis::urlencode(slug));
383 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
384
385 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
386 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
387 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
388 }
389 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
390 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
391 };
392 local_var_req_builder = local_var_req_builder.json(&pipeline_recording_body);
393
394 let local_var_req = local_var_req_builder.build()?;
395 let local_var_resp = local_var_client.execute(local_var_req).await?;
396
397 let local_var_status = local_var_resp.status();
398 let local_var_content = local_var_resp.text().await?;
399
400 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
401 crate::from_str_patched(&local_var_content).map_err(Error::from)
402 } else {
403 let local_var_entity: Option<PublishHubPipelineRecordingError> = crate::from_str_patched(&local_var_content).ok();
404 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
405 Err(Error::ResponseError(local_var_error))
406 }
407}
408
409pub async fn publish_hub_project_logo(configuration: &configuration::Configuration, workspace: &str, slug: &str, folder: &str, project_logo_body: models::ProjectLogoBody) -> Result<String, Error<PublishHubProjectLogoError>> {
411 let local_var_configuration = configuration;
412
413 let local_var_client = &local_var_configuration.client;
414
415 let local_var_uri_str = format!("{}/w/{workspace}/hub/projects/{slug}/logo", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), slug=crate::apis::urlencode(slug));
416 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
417
418 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
419 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
420 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
421 }
422 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
423 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
424 };
425 local_var_req_builder = local_var_req_builder.json(&project_logo_body);
426
427 let local_var_req = local_var_req_builder.build()?;
428 let local_var_resp = local_var_client.execute(local_var_req).await?;
429
430 let local_var_status = local_var_resp.status();
431 let local_var_content = local_var_resp.text().await?;
432
433 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
434 crate::from_str_patched(&local_var_content).map_err(Error::from)
435 } else {
436 let local_var_entity: Option<PublishHubProjectLogoError> = crate::from_str_patched(&local_var_content).ok();
437 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
438 Err(Error::ResponseError(local_var_error))
439 }
440}
441
442pub async fn publish_hub_raw_app(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_raw_app_body: models::PublishRawAppBody) -> Result<String, Error<PublishHubRawAppError>> {
444 let local_var_configuration = configuration;
445
446 let local_var_client = &local_var_configuration.client;
447
448 let local_var_uri_str = format!("{}/w/{workspace}/hub/raw_apps", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
449 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
450
451 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
452 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
453 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
454 }
455 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
456 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
457 };
458 local_var_req_builder = local_var_req_builder.json(&publish_raw_app_body);
459
460 let local_var_req = local_var_req_builder.build()?;
461 let local_var_resp = local_var_client.execute(local_var_req).await?;
462
463 let local_var_status = local_var_resp.status();
464 let local_var_content = local_var_resp.text().await?;
465
466 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
467 crate::from_str_patched(&local_var_content).map_err(Error::from)
468 } else {
469 let local_var_entity: Option<PublishHubRawAppError> = crate::from_str_patched(&local_var_content).ok();
470 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
471 Err(Error::ResponseError(local_var_error))
472 }
473}
474
475pub async fn publish_hub_raw_app_embed(configuration: &configuration::Configuration, workspace: &str, id: i64, folder: &str, raw_app_embed_body: models::RawAppEmbedBody) -> Result<String, Error<PublishHubRawAppEmbedError>> {
477 let local_var_configuration = configuration;
478
479 let local_var_client = &local_var_configuration.client;
480
481 let local_var_uri_str = format!("{}/w/{workspace}/hub/raw_apps/{id}/embed", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
482 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
483
484 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
485 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
486 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
487 }
488 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
489 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
490 };
491 local_var_req_builder = local_var_req_builder.json(&raw_app_embed_body);
492
493 let local_var_req = local_var_req_builder.build()?;
494 let local_var_resp = local_var_client.execute(local_var_req).await?;
495
496 let local_var_status = local_var_resp.status();
497 let local_var_content = local_var_resp.text().await?;
498
499 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
500 crate::from_str_patched(&local_var_content).map_err(Error::from)
501 } else {
502 let local_var_entity: Option<PublishHubRawAppEmbedError> = crate::from_str_patched(&local_var_content).ok();
503 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
504 Err(Error::ResponseError(local_var_error))
505 }
506}
507
508pub async fn publish_hub_raw_app_recording(configuration: &configuration::Configuration, workspace: &str, id: i64, folder: &str, recording_body: models::RecordingBody) -> Result<String, Error<PublishHubRawAppRecordingError>> {
510 let local_var_configuration = configuration;
511
512 let local_var_client = &local_var_configuration.client;
513
514 let local_var_uri_str = format!("{}/w/{workspace}/hub/raw_apps/{id}/recording", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), id=id);
515 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
516
517 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
518 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
519 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
520 }
521 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
522 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
523 };
524 local_var_req_builder = local_var_req_builder.json(&recording_body);
525
526 let local_var_req = local_var_req_builder.build()?;
527 let local_var_resp = local_var_client.execute(local_var_req).await?;
528
529 let local_var_status = local_var_resp.status();
530 let local_var_content = local_var_resp.text().await?;
531
532 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
533 crate::from_str_patched(&local_var_content).map_err(Error::from)
534 } else {
535 let local_var_entity: Option<PublishHubRawAppRecordingError> = crate::from_str_patched(&local_var_content).ok();
536 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
537 Err(Error::ResponseError(local_var_error))
538 }
539}
540
541pub async fn publish_hub_resource_type(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_resource_type_body: models::PublishResourceTypeBody) -> Result<String, Error<PublishHubResourceTypeError>> {
543 let local_var_configuration = configuration;
544
545 let local_var_client = &local_var_configuration.client;
546
547 let local_var_uri_str = format!("{}/w/{workspace}/hub/resource_types", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
548 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
549
550 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
551 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
552 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
553 }
554 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
555 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
556 };
557 local_var_req_builder = local_var_req_builder.json(&publish_resource_type_body);
558
559 let local_var_req = local_var_req_builder.build()?;
560 let local_var_resp = local_var_client.execute(local_var_req).await?;
561
562 let local_var_status = local_var_resp.status();
563 let local_var_content = local_var_resp.text().await?;
564
565 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
566 crate::from_str_patched(&local_var_content).map_err(Error::from)
567 } else {
568 let local_var_entity: Option<PublishHubResourceTypeError> = crate::from_str_patched(&local_var_content).ok();
569 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
570 Err(Error::ResponseError(local_var_error))
571 }
572}
573
574pub async fn publish_hub_resources(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_resources_body: models::PublishResourcesBody) -> Result<String, Error<PublishHubResourcesError>> {
576 let local_var_configuration = configuration;
577
578 let local_var_client = &local_var_configuration.client;
579
580 let local_var_uri_str = format!("{}/w/{workspace}/hub/resources", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
581 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
582
583 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
584 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
585 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
586 }
587 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
588 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
589 };
590 local_var_req_builder = local_var_req_builder.json(&publish_resources_body);
591
592 let local_var_req = local_var_req_builder.build()?;
593 let local_var_resp = local_var_client.execute(local_var_req).await?;
594
595 let local_var_status = local_var_resp.status();
596 let local_var_content = local_var_resp.text().await?;
597
598 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
599 crate::from_str_patched(&local_var_content).map_err(Error::from)
600 } else {
601 let local_var_entity: Option<PublishHubResourcesError> = crate::from_str_patched(&local_var_content).ok();
602 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
603 Err(Error::ResponseError(local_var_error))
604 }
605}
606
607pub async fn publish_hub_script(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_script_body: models::PublishScriptBody) -> Result<String, Error<PublishHubScriptError>> {
609 let local_var_configuration = configuration;
610
611 let local_var_client = &local_var_configuration.client;
612
613 let local_var_uri_str = format!("{}/w/{workspace}/hub/scripts", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
614 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
615
616 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
617 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
618 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
619 }
620 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
621 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
622 };
623 local_var_req_builder = local_var_req_builder.json(&publish_script_body);
624
625 let local_var_req = local_var_req_builder.build()?;
626 let local_var_resp = local_var_client.execute(local_var_req).await?;
627
628 let local_var_status = local_var_resp.status();
629 let local_var_content = local_var_resp.text().await?;
630
631 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
632 crate::from_str_patched(&local_var_content).map_err(Error::from)
633 } else {
634 let local_var_entity: Option<PublishHubScriptError> = crate::from_str_patched(&local_var_content).ok();
635 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
636 Err(Error::ResponseError(local_var_error))
637 }
638}
639
640pub async fn publish_hub_script_recording(configuration: &configuration::Configuration, workspace: &str, ask_id: i64, folder: &str, recording_body: models::RecordingBody) -> Result<String, Error<PublishHubScriptRecordingError>> {
642 let local_var_configuration = configuration;
643
644 let local_var_client = &local_var_configuration.client;
645
646 let local_var_uri_str = format!("{}/w/{workspace}/hub/scripts/{ask_id}/recording", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), ask_id=ask_id);
647 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
648
649 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
650 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
651 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
652 }
653 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
654 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
655 };
656 local_var_req_builder = local_var_req_builder.json(&recording_body);
657
658 let local_var_req = local_var_req_builder.build()?;
659 let local_var_resp = local_var_client.execute(local_var_req).await?;
660
661 let local_var_status = local_var_resp.status();
662 let local_var_content = local_var_resp.text().await?;
663
664 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
665 crate::from_str_patched(&local_var_content).map_err(Error::from)
666 } else {
667 let local_var_entity: Option<PublishHubScriptRecordingError> = crate::from_str_patched(&local_var_content).ok();
668 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
669 Err(Error::ResponseError(local_var_error))
670 }
671}
672
673pub async fn publish_hub_triggers(configuration: &configuration::Configuration, workspace: &str, folder: &str, publish_triggers_body: models::PublishTriggersBody) -> Result<String, Error<PublishHubTriggersError>> {
675 let local_var_configuration = configuration;
676
677 let local_var_client = &local_var_configuration.client;
678
679 let local_var_uri_str = format!("{}/w/{workspace}/hub/triggers", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
680 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
681
682 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
683 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
684 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
685 }
686 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
687 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
688 };
689 local_var_req_builder = local_var_req_builder.json(&publish_triggers_body);
690
691 let local_var_req = local_var_req_builder.build()?;
692 let local_var_resp = local_var_client.execute(local_var_req).await?;
693
694 let local_var_status = local_var_resp.status();
695 let local_var_content = local_var_resp.text().await?;
696
697 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
698 crate::from_str_patched(&local_var_content).map_err(Error::from)
699 } else {
700 let local_var_entity: Option<PublishHubTriggersError> = crate::from_str_patched(&local_var_content).ok();
701 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
702 Err(Error::ResponseError(local_var_error))
703 }
704}
705
706pub async fn submit_hub_project(configuration: &configuration::Configuration, workspace: &str, slug: &str, folder: &str) -> Result<String, Error<SubmitHubProjectError>> {
708 let local_var_configuration = configuration;
709
710 let local_var_client = &local_var_configuration.client;
711
712 let local_var_uri_str = format!("{}/w/{workspace}/hub/projects/{slug}/submit", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), slug=crate::apis::urlencode(slug));
713 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
714
715 local_var_req_builder = local_var_req_builder.query(&[("folder", &folder.to_string())]);
716 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
717 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
718 }
719 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
720 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
721 };
722
723 let local_var_req = local_var_req_builder.build()?;
724 let local_var_resp = local_var_client.execute(local_var_req).await?;
725
726 let local_var_status = local_var_resp.status();
727 let local_var_content = local_var_resp.text().await?;
728
729 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
730 crate::from_str_patched(&local_var_content).map_err(Error::from)
731 } else {
732 let local_var_entity: Option<SubmitHubProjectError> = crate::from_str_patched(&local_var_content).ok();
733 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
734 Err(Error::ResponseError(local_var_error))
735 }
736}
737