1#![allow(unused_mut)]
4#![allow(unused_variables)]
5#![allow(unused_imports)]
6#![allow(clippy::redundant_clone)]
7#![allow(clippy::too_many_arguments)]
8#![allow(clippy::module_inception)]
9pub mod models;
10#[derive(Clone)]
11pub struct Client {
12 endpoint: azure_core::http::Url,
13 credential: crate::Credential,
14 scopes: Vec<String>,
15 pipeline: azure_core::http::Pipeline,
16}
17#[derive(Clone)]
18pub struct ClientBuilder {
19 credential: crate::Credential,
20 endpoint: Option<azure_core::http::Url>,
21 scopes: Option<Vec<String>>,
22 options: azure_core::http::ClientOptions,
23}
24azure_core::static_url!(DEFAULT_ENDPOINT, "https://vsrm.dev.azure.com");
25impl ClientBuilder {
26 #[doc = "Create a new instance of `ClientBuilder`."]
27 #[must_use]
28 pub fn new(credential: crate::Credential) -> Self {
29 Self {
30 credential,
31 endpoint: None,
32 scopes: None,
33 options: azure_core::http::ClientOptions::default(),
34 }
35 }
36 #[doc = "Set the endpoint."]
37 #[must_use]
38 pub fn endpoint(mut self, endpoint: impl Into<azure_core::http::Url>) -> Self {
39 self.endpoint = Some(endpoint.into());
40 self
41 }
42 #[doc = "Set the scopes."]
43 #[must_use]
44 pub fn scopes(mut self, scopes: &[&str]) -> Self {
45 self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
46 self
47 }
48 #[doc = "Set the retry options."]
49 #[must_use]
50 pub fn retry(mut self, retry: impl Into<azure_core::http::RetryOptions>) -> Self {
51 self.options.retry = Some(retry.into());
52 self
53 }
54 #[doc = "Set the transport options."]
55 #[must_use]
56 pub fn transport(mut self, transport: impl Into<azure_core::http::TransportOptions>) -> Self {
57 self.options.transport = Some(transport.into());
58 self
59 }
60 #[doc = "Set per-call policies."]
61 #[must_use]
62 pub fn per_call_policies(
63 mut self,
64 policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
65 ) -> Self {
66 self.options.per_call_policies = policies.into();
67 self
68 }
69 #[doc = "Set per-try policies."]
70 #[must_use]
71 pub fn per_try_policies(
72 mut self,
73 policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
74 ) -> Self {
75 self.options.per_try_policies = policies.into();
76 self
77 }
78 #[doc = "Convert the builder into a `Client` instance."]
79 pub fn build(self) -> Client {
80 let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
81 let scopes = self
82 .scopes
83 .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]);
84 Client::new(endpoint, self.credential, scopes, self.options)
85 }
86}
87impl Client {
88 pub(crate) fn endpoint(&self) -> &azure_core::http::Url {
89 &self.endpoint
90 }
91 pub(crate) fn token_credential(&self) -> &crate::Credential {
92 &self.credential
93 }
94 pub(crate) fn scopes(&self) -> Vec<&str> {
95 self.scopes.iter().map(String::as_str).collect()
96 }
97 pub(crate) async fn send(
98 &self,
99 request: &mut azure_core::http::Request,
100 ) -> azure_core::Result<azure_core::http::Response> {
101 let context = azure_core::http::Context::default();
102 self.pipeline.send(&context, request).await
103 }
104 #[doc = "Create a new `ClientBuilder`."]
105 #[must_use]
106 pub fn builder(credential: crate::Credential) -> ClientBuilder {
107 ClientBuilder::new(credential)
108 }
109 #[doc = "Create a new `Client`."]
110 #[must_use]
111 pub fn new(
112 endpoint: impl Into<azure_core::http::Url>,
113 credential: crate::Credential,
114 scopes: Vec<String>,
115 options: azure_core::http::ClientOptions,
116 ) -> Self {
117 let endpoint = endpoint.into();
118 let pipeline = azure_core::http::Pipeline::new(
119 option_env!("CARGO_PKG_NAME"),
120 option_env!("CARGO_PKG_VERSION"),
121 options,
122 Vec::new(),
123 Vec::new(),
124 );
125 Self {
126 endpoint,
127 credential,
128 scopes,
129 pipeline,
130 }
131 }
132 pub fn approvals_client(&self) -> approvals::Client {
133 approvals::Client(self.clone())
134 }
135 pub fn attachments_client(&self) -> attachments::Client {
136 attachments::Client(self.clone())
137 }
138 pub fn definitions_client(&self) -> definitions::Client {
139 definitions::Client(self.clone())
140 }
141 pub fn deployments_client(&self) -> deployments::Client {
142 deployments::Client(self.clone())
143 }
144 pub fn folders_client(&self) -> folders::Client {
145 folders::Client(self.clone())
146 }
147 pub fn gates_client(&self) -> gates::Client {
148 gates::Client(self.clone())
149 }
150 pub fn manual_interventions_client(&self) -> manual_interventions::Client {
151 manual_interventions::Client(self.clone())
152 }
153 pub fn releases_client(&self) -> releases::Client {
154 releases::Client(self.clone())
155 }
156}
157pub mod releases {
158 use super::models;
159 #[cfg(not(target_arch = "wasm32"))]
160 use futures::future::BoxFuture;
161 #[cfg(target_arch = "wasm32")]
162 use futures::future::LocalBoxFuture as BoxFuture;
163 pub struct Client(pub(crate) super::Client);
164 impl Client {
165 #[doc = "Get a Release"]
166 #[doc = ""]
167 #[doc = "Arguments:"]
168 #[doc = "* `organization`: The name of the Azure DevOps organization."]
169 #[doc = "* `project`: Project ID or project name"]
170 #[doc = "* `release_id`: Id of the release."]
171 pub fn get_release(
172 &self,
173 organization: impl Into<String>,
174 project: impl Into<String>,
175 release_id: i32,
176 ) -> get_release::RequestBuilder {
177 get_release::RequestBuilder {
178 client: self.0.clone(),
179 organization: organization.into(),
180 project: project.into(),
181 release_id,
182 approval_filters: None,
183 property_filters: None,
184 expand: None,
185 top_gate_records: None,
186 }
187 }
188 #[doc = "Get a list of releases"]
189 #[doc = ""]
190 #[doc = "Arguments:"]
191 #[doc = "* `organization`: The name of the Azure DevOps organization."]
192 #[doc = "* `project`: Project ID or project name"]
193 pub fn list(
194 &self,
195 organization: impl Into<String>,
196 project: impl Into<String>,
197 ) -> list::RequestBuilder {
198 list::RequestBuilder {
199 client: self.0.clone(),
200 organization: organization.into(),
201 project: project.into(),
202 definition_id: None,
203 definition_environment_id: None,
204 search_text: None,
205 created_by: None,
206 status_filter: None,
207 environment_status_filter: None,
208 min_created_time: None,
209 max_created_time: None,
210 query_order: None,
211 top: None,
212 continuation_token: None,
213 expand: None,
214 artifact_type_id: None,
215 source_id: None,
216 artifact_version_id: None,
217 source_branch_filter: None,
218 is_deleted: None,
219 tag_filter: None,
220 property_filters: None,
221 release_id_filter: None,
222 path: None,
223 }
224 }
225 #[doc = "Create a release."]
226 #[doc = ""]
227 #[doc = "Arguments:"]
228 #[doc = "* `organization`: The name of the Azure DevOps organization."]
229 #[doc = "* `body`: Metadata to create a release."]
230 #[doc = "* `project`: Project ID or project name"]
231 pub fn create(
232 &self,
233 organization: impl Into<String>,
234 body: impl Into<models::ReleaseStartMetadata>,
235 project: impl Into<String>,
236 ) -> create::RequestBuilder {
237 create::RequestBuilder {
238 client: self.0.clone(),
239 organization: organization.into(),
240 body: body.into(),
241 project: project.into(),
242 }
243 }
244 #[doc = "Get release for a given revision number."]
245 #[doc = ""]
246 #[doc = "Arguments:"]
247 #[doc = "* `organization`: The name of the Azure DevOps organization."]
248 #[doc = "* `project`: Project ID or project name"]
249 #[doc = "* `release_id`: Id of the release."]
250 #[doc = "* `definition_snapshot_revision`: Definition snapshot revision number."]
251 pub fn get_release_revision(
252 &self,
253 organization: impl Into<String>,
254 project: impl Into<String>,
255 release_id: i32,
256 definition_snapshot_revision: i32,
257 ) -> get_release_revision::RequestBuilder {
258 get_release_revision::RequestBuilder {
259 client: self.0.clone(),
260 organization: organization.into(),
261 project: project.into(),
262 release_id,
263 definition_snapshot_revision,
264 }
265 }
266 #[doc = "Update a complete release object."]
267 #[doc = ""]
268 #[doc = "Arguments:"]
269 #[doc = "* `organization`: The name of the Azure DevOps organization."]
270 #[doc = "* `body`: Release object for update."]
271 #[doc = "* `project`: Project ID or project name"]
272 #[doc = "* `release_id`: Id of the release to update."]
273 pub fn update_release(
274 &self,
275 organization: impl Into<String>,
276 body: impl Into<models::Release>,
277 project: impl Into<String>,
278 release_id: i32,
279 ) -> update_release::RequestBuilder {
280 update_release::RequestBuilder {
281 client: self.0.clone(),
282 organization: organization.into(),
283 body: body.into(),
284 project: project.into(),
285 release_id,
286 }
287 }
288 #[doc = "Update few properties of a release."]
289 #[doc = ""]
290 #[doc = "Arguments:"]
291 #[doc = "* `organization`: The name of the Azure DevOps organization."]
292 #[doc = "* `body`: Properties of release to update."]
293 #[doc = "* `project`: Project ID or project name"]
294 #[doc = "* `release_id`: Id of the release to update."]
295 pub fn update_release_resource(
296 &self,
297 organization: impl Into<String>,
298 body: impl Into<models::ReleaseUpdateMetadata>,
299 project: impl Into<String>,
300 release_id: i32,
301 ) -> update_release_resource::RequestBuilder {
302 update_release_resource::RequestBuilder {
303 client: self.0.clone(),
304 organization: organization.into(),
305 body: body.into(),
306 project: project.into(),
307 release_id,
308 }
309 }
310 #[doc = "Get a release environment."]
311 #[doc = ""]
312 #[doc = "Arguments:"]
313 #[doc = "* `organization`: The name of the Azure DevOps organization."]
314 #[doc = "* `project`: Project ID or project name"]
315 #[doc = "* `release_id`: Id of the release."]
316 #[doc = "* `environment_id`: Id of the release environment."]
317 pub fn get_release_environment(
318 &self,
319 organization: impl Into<String>,
320 project: impl Into<String>,
321 release_id: i32,
322 environment_id: i32,
323 ) -> get_release_environment::RequestBuilder {
324 get_release_environment::RequestBuilder {
325 client: self.0.clone(),
326 organization: organization.into(),
327 project: project.into(),
328 release_id,
329 environment_id,
330 expand: None,
331 }
332 }
333 #[doc = "Update the status of a release environment"]
334 #[doc = ""]
335 #[doc = "Arguments:"]
336 #[doc = "* `organization`: The name of the Azure DevOps organization."]
337 #[doc = "* `body`: Environment update meta data."]
338 #[doc = "* `project`: Project ID or project name"]
339 #[doc = "* `release_id`: Id of the release."]
340 #[doc = "* `environment_id`: Id of release environment."]
341 pub fn update_release_environment(
342 &self,
343 organization: impl Into<String>,
344 body: impl Into<models::ReleaseEnvironmentUpdateMetadata>,
345 project: impl Into<String>,
346 release_id: i32,
347 environment_id: i32,
348 ) -> update_release_environment::RequestBuilder {
349 update_release_environment::RequestBuilder {
350 client: self.0.clone(),
351 organization: organization.into(),
352 body: body.into(),
353 project: project.into(),
354 release_id,
355 environment_id,
356 }
357 }
358 #[doc = "Gets the task log of a release as a plain text file."]
359 #[doc = ""]
360 #[doc = "Arguments:"]
361 #[doc = "* `organization`: The name of the Azure DevOps organization."]
362 #[doc = "* `project`: Project ID or project name"]
363 #[doc = "* `release_id`: Id of the release."]
364 #[doc = "* `environment_id`: Id of release environment."]
365 #[doc = "* `release_deploy_phase_id`: Release deploy phase Id."]
366 #[doc = "* `task_id`: ReleaseTask Id for the log."]
367 pub fn get_task_log(
368 &self,
369 organization: impl Into<String>,
370 project: impl Into<String>,
371 release_id: i32,
372 environment_id: i32,
373 release_deploy_phase_id: i32,
374 task_id: i32,
375 ) -> get_task_log::RequestBuilder {
376 get_task_log::RequestBuilder {
377 client: self.0.clone(),
378 organization: organization.into(),
379 project: project.into(),
380 release_id,
381 environment_id,
382 release_deploy_phase_id,
383 task_id,
384 start_line: None,
385 end_line: None,
386 }
387 }
388 #[doc = "Get logs for a release Id."]
389 #[doc = ""]
390 #[doc = "Arguments:"]
391 #[doc = "* `organization`: The name of the Azure DevOps organization."]
392 #[doc = "* `project`: Project ID or project name"]
393 #[doc = "* `release_id`: Id of the release."]
394 pub fn get_logs(
395 &self,
396 organization: impl Into<String>,
397 project: impl Into<String>,
398 release_id: i32,
399 ) -> get_logs::RequestBuilder {
400 get_logs::RequestBuilder {
401 client: self.0.clone(),
402 organization: organization.into(),
403 project: project.into(),
404 release_id,
405 }
406 }
407 }
408 pub mod get_release {
409 use super::models;
410 #[cfg(not(target_arch = "wasm32"))]
411 use futures::future::BoxFuture;
412 #[cfg(target_arch = "wasm32")]
413 use futures::future::LocalBoxFuture as BoxFuture;
414 #[derive(Debug)]
415 pub struct Response(azure_core::http::Response);
416 impl Response {
417 pub async fn into_raw_body(self) -> azure_core::Result<models::Release> {
418 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
419 let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
420 azure_core::error::Error::full(
421 azure_core::error::ErrorKind::DataConversion,
422 e,
423 format!(
424 "Failed to deserialize response:\n{}",
425 String::from_utf8_lossy(&bytes)
426 ),
427 )
428 })?;
429 Ok(body)
430 }
431 pub fn into_raw_response(self) -> azure_core::http::Response {
432 self.0
433 }
434 pub fn as_raw_response(&self) -> &azure_core::http::Response {
435 &self.0
436 }
437 }
438 impl From<Response> for azure_core::http::Response {
439 fn from(rsp: Response) -> Self {
440 rsp.into_raw_response()
441 }
442 }
443 impl AsRef<azure_core::http::Response> for Response {
444 fn as_ref(&self) -> &azure_core::http::Response {
445 self.as_raw_response()
446 }
447 }
448 #[derive(Clone)]
449 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
450 #[doc = r""]
451 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
452 #[doc = r" parameters can be chained."]
453 #[doc = r""]
454 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
455 #[doc = r" converts the [`RequestBuilder`] into a future,"]
456 #[doc = r" executes the request and returns a `Result` with the parsed"]
457 #[doc = r" response."]
458 #[doc = r""]
459 #[doc = r" If you need lower-level access to the raw response details"]
460 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
461 #[doc = r" can finalize the request using the"]
462 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
463 #[doc = r" that resolves to a lower-level [`Response`] value."]
464 pub struct RequestBuilder {
465 pub(crate) client: super::super::Client,
466 pub(crate) organization: String,
467 pub(crate) project: String,
468 pub(crate) release_id: i32,
469 pub(crate) approval_filters: Option<String>,
470 pub(crate) property_filters: Option<String>,
471 pub(crate) expand: Option<String>,
472 pub(crate) top_gate_records: Option<i32>,
473 }
474 impl RequestBuilder {
475 #[doc = "A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default"]
476 pub fn approval_filters(mut self, approval_filters: impl Into<String>) -> Self {
477 self.approval_filters = Some(approval_filters.into());
478 self
479 }
480 #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included."]
481 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
482 self.property_filters = Some(property_filters.into());
483 self
484 }
485 #[doc = "A property that should be expanded in the release."]
486 pub fn expand(mut self, expand: impl Into<String>) -> Self {
487 self.expand = Some(expand.into());
488 self
489 }
490 #[doc = "Number of release gate records to get. Default is 5."]
491 pub fn top_gate_records(mut self, top_gate_records: i32) -> Self {
492 self.top_gate_records = Some(top_gate_records);
493 self
494 }
495 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
496 #[doc = ""]
497 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
498 #[doc = "However, this function can provide more flexibility when required."]
499 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
500 Box::pin({
501 let this = self.clone();
502 async move {
503 let url = this.url()?;
504 let mut req =
505 azure_core::http::Request::new(url, azure_core::http::Method::Get);
506 if let Some(auth_header) = this
507 .client
508 .token_credential()
509 .http_authorization_header(&this.client.scopes())
510 .await?
511 {
512 req.insert_header(
513 azure_core::http::headers::AUTHORIZATION,
514 auth_header,
515 );
516 }
517 if let Some(approval_filters) = &this.approval_filters {
518 req.url_mut()
519 .query_pairs_mut()
520 .append_pair("approvalFilters", approval_filters);
521 }
522 if let Some(property_filters) = &this.property_filters {
523 req.url_mut()
524 .query_pairs_mut()
525 .append_pair("propertyFilters", property_filters);
526 }
527 if let Some(expand) = &this.expand {
528 req.url_mut()
529 .query_pairs_mut()
530 .append_pair("$expand", expand);
531 }
532 if let Some(top_gate_records) = &this.top_gate_records {
533 req.url_mut()
534 .query_pairs_mut()
535 .append_pair("$topGateRecords", &top_gate_records.to_string());
536 }
537 let req_body = azure_core::Bytes::new();
538 req.set_body(req_body);
539 Ok(Response(this.client.send(&mut req).await?))
540 }
541 })
542 }
543 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
544 let mut url = azure_core::http::Url::parse(&format!(
545 "{}/{}/{}/_apis/release/releases/{}?",
546 self.client.endpoint(),
547 &self.organization,
548 &self.project,
549 &self.release_id
550 ))?;
551 let has_api_version_already = url
552 .query_pairs()
553 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
554 if !has_api_version_already {
555 url.query_pairs_mut().append_pair(
556 azure_core::http::headers::query_param::API_VERSION,
557 "7.1-preview",
558 );
559 }
560 Ok(url)
561 }
562 }
563 impl std::future::IntoFuture for RequestBuilder {
564 type Output = azure_core::Result<models::Release>;
565 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Release>>;
566 #[doc = "Returns a future that sends the request and returns the parsed response body."]
567 #[doc = ""]
568 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
569 #[doc = ""]
570 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
571 fn into_future(self) -> Self::IntoFuture {
572 Box::pin(async move { self.send().await?.into_raw_body().await })
573 }
574 }
575 }
576 pub mod list {
577 use super::models;
578 #[cfg(not(target_arch = "wasm32"))]
579 use futures::future::BoxFuture;
580 #[cfg(target_arch = "wasm32")]
581 use futures::future::LocalBoxFuture as BoxFuture;
582 #[derive(Debug)]
583 pub struct Response(azure_core::http::Response);
584 impl Response {
585 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseList> {
586 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
587 let body: models::ReleaseList = serde_json::from_slice(&bytes).map_err(|e| {
588 azure_core::error::Error::full(
589 azure_core::error::ErrorKind::DataConversion,
590 e,
591 format!(
592 "Failed to deserialize response:\n{}",
593 String::from_utf8_lossy(&bytes)
594 ),
595 )
596 })?;
597 Ok(body)
598 }
599 pub fn into_raw_response(self) -> azure_core::http::Response {
600 self.0
601 }
602 pub fn as_raw_response(&self) -> &azure_core::http::Response {
603 &self.0
604 }
605 }
606 impl From<Response> for azure_core::http::Response {
607 fn from(rsp: Response) -> Self {
608 rsp.into_raw_response()
609 }
610 }
611 impl AsRef<azure_core::http::Response> for Response {
612 fn as_ref(&self) -> &azure_core::http::Response {
613 self.as_raw_response()
614 }
615 }
616 #[derive(Clone)]
617 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
618 #[doc = r""]
619 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
620 #[doc = r" parameters can be chained."]
621 #[doc = r""]
622 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
623 #[doc = r" converts the [`RequestBuilder`] into a future,"]
624 #[doc = r" executes the request and returns a `Result` with the parsed"]
625 #[doc = r" response."]
626 #[doc = r""]
627 #[doc = r" If you need lower-level access to the raw response details"]
628 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
629 #[doc = r" can finalize the request using the"]
630 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
631 #[doc = r" that resolves to a lower-level [`Response`] value."]
632 pub struct RequestBuilder {
633 pub(crate) client: super::super::Client,
634 pub(crate) organization: String,
635 pub(crate) project: String,
636 pub(crate) definition_id: Option<i32>,
637 pub(crate) definition_environment_id: Option<i32>,
638 pub(crate) search_text: Option<String>,
639 pub(crate) created_by: Option<String>,
640 pub(crate) status_filter: Option<String>,
641 pub(crate) environment_status_filter: Option<i32>,
642 pub(crate) min_created_time: Option<time::OffsetDateTime>,
643 pub(crate) max_created_time: Option<time::OffsetDateTime>,
644 pub(crate) query_order: Option<String>,
645 pub(crate) top: Option<i32>,
646 pub(crate) continuation_token: Option<i32>,
647 pub(crate) expand: Option<String>,
648 pub(crate) artifact_type_id: Option<String>,
649 pub(crate) source_id: Option<String>,
650 pub(crate) artifact_version_id: Option<String>,
651 pub(crate) source_branch_filter: Option<String>,
652 pub(crate) is_deleted: Option<bool>,
653 pub(crate) tag_filter: Option<String>,
654 pub(crate) property_filters: Option<String>,
655 pub(crate) release_id_filter: Option<String>,
656 pub(crate) path: Option<String>,
657 }
658 impl RequestBuilder {
659 #[doc = "Releases from this release definition Id."]
660 pub fn definition_id(mut self, definition_id: i32) -> Self {
661 self.definition_id = Some(definition_id);
662 self
663 }
664 pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self {
665 self.definition_environment_id = Some(definition_environment_id);
666 self
667 }
668 #[doc = "Releases with names containing searchText."]
669 pub fn search_text(mut self, search_text: impl Into<String>) -> Self {
670 self.search_text = Some(search_text.into());
671 self
672 }
673 #[doc = "Releases created by this user."]
674 pub fn created_by(mut self, created_by: impl Into<String>) -> Self {
675 self.created_by = Some(created_by.into());
676 self
677 }
678 #[doc = "Releases that have this status."]
679 pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self {
680 self.status_filter = Some(status_filter.into());
681 self
682 }
683 pub fn environment_status_filter(mut self, environment_status_filter: i32) -> Self {
684 self.environment_status_filter = Some(environment_status_filter);
685 self
686 }
687 #[doc = "Releases that were created after this time."]
688 pub fn min_created_time(
689 mut self,
690 min_created_time: impl Into<time::OffsetDateTime>,
691 ) -> Self {
692 self.min_created_time = Some(min_created_time.into());
693 self
694 }
695 #[doc = "Releases that were created before this time."]
696 pub fn max_created_time(
697 mut self,
698 max_created_time: impl Into<time::OffsetDateTime>,
699 ) -> Self {
700 self.max_created_time = Some(max_created_time.into());
701 self
702 }
703 #[doc = "Gets the results in the defined order of created date for releases. Default is descending."]
704 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
705 self.query_order = Some(query_order.into());
706 self
707 }
708 #[doc = "Number of releases to get. Default is 50."]
709 pub fn top(mut self, top: i32) -> Self {
710 self.top = Some(top);
711 self
712 }
713 #[doc = "Gets the releases after the continuation token provided."]
714 pub fn continuation_token(mut self, continuation_token: i32) -> Self {
715 self.continuation_token = Some(continuation_token);
716 self
717 }
718 #[doc = "The property that should be expanded in the list of releases."]
719 pub fn expand(mut self, expand: impl Into<String>) -> Self {
720 self.expand = Some(expand.into());
721 self
722 }
723 #[doc = "Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."]
724 pub fn artifact_type_id(mut self, artifact_type_id: impl Into<String>) -> Self {
725 self.artifact_type_id = Some(artifact_type_id.into());
726 self
727 }
728 #[doc = "Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."]
729 pub fn source_id(mut self, source_id: impl Into<String>) -> Self {
730 self.source_id = Some(source_id.into());
731 self
732 }
733 #[doc = "Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId."]
734 pub fn artifact_version_id(mut self, artifact_version_id: impl Into<String>) -> Self {
735 self.artifact_version_id = Some(artifact_version_id.into());
736 self
737 }
738 #[doc = "Releases with given sourceBranchFilter will be returned."]
739 pub fn source_branch_filter(mut self, source_branch_filter: impl Into<String>) -> Self {
740 self.source_branch_filter = Some(source_branch_filter.into());
741 self
742 }
743 #[doc = "Gets the soft deleted releases, if true."]
744 pub fn is_deleted(mut self, is_deleted: bool) -> Self {
745 self.is_deleted = Some(is_deleted);
746 self
747 }
748 #[doc = "A comma-delimited list of tags. Only releases with these tags will be returned."]
749 pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self {
750 self.tag_filter = Some(tag_filter.into());
751 self
752 }
753 #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not."]
754 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
755 self.property_filters = Some(property_filters.into());
756 self
757 }
758 #[doc = "A comma-delimited list of releases Ids. Only releases with these Ids will be returned."]
759 pub fn release_id_filter(mut self, release_id_filter: impl Into<String>) -> Self {
760 self.release_id_filter = Some(release_id_filter.into());
761 self
762 }
763 #[doc = "Releases under this folder path will be returned"]
764 pub fn path(mut self, path: impl Into<String>) -> Self {
765 self.path = Some(path.into());
766 self
767 }
768 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
769 #[doc = ""]
770 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
771 #[doc = "However, this function can provide more flexibility when required."]
772 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
773 Box::pin({
774 let this = self.clone();
775 async move {
776 let url = this.url()?;
777 let mut req =
778 azure_core::http::Request::new(url, azure_core::http::Method::Get);
779 if let Some(auth_header) = this
780 .client
781 .token_credential()
782 .http_authorization_header(&this.client.scopes())
783 .await?
784 {
785 req.insert_header(
786 azure_core::http::headers::AUTHORIZATION,
787 auth_header,
788 );
789 }
790 if let Some(definition_id) = &this.definition_id {
791 req.url_mut()
792 .query_pairs_mut()
793 .append_pair("definitionId", &definition_id.to_string());
794 }
795 if let Some(definition_environment_id) = &this.definition_environment_id {
796 req.url_mut().query_pairs_mut().append_pair(
797 "definitionEnvironmentId",
798 &definition_environment_id.to_string(),
799 );
800 }
801 if let Some(search_text) = &this.search_text {
802 req.url_mut()
803 .query_pairs_mut()
804 .append_pair("searchText", search_text);
805 }
806 if let Some(created_by) = &this.created_by {
807 req.url_mut()
808 .query_pairs_mut()
809 .append_pair("createdBy", created_by);
810 }
811 if let Some(status_filter) = &this.status_filter {
812 req.url_mut()
813 .query_pairs_mut()
814 .append_pair("statusFilter", status_filter);
815 }
816 if let Some(environment_status_filter) = &this.environment_status_filter {
817 req.url_mut().query_pairs_mut().append_pair(
818 "environmentStatusFilter",
819 &environment_status_filter.to_string(),
820 );
821 }
822 if let Some(min_created_time) = &this.min_created_time {
823 req.url_mut()
824 .query_pairs_mut()
825 .append_pair("minCreatedTime", &min_created_time.to_string());
826 }
827 if let Some(max_created_time) = &this.max_created_time {
828 req.url_mut()
829 .query_pairs_mut()
830 .append_pair("maxCreatedTime", &max_created_time.to_string());
831 }
832 if let Some(query_order) = &this.query_order {
833 req.url_mut()
834 .query_pairs_mut()
835 .append_pair("queryOrder", query_order);
836 }
837 if let Some(top) = &this.top {
838 req.url_mut()
839 .query_pairs_mut()
840 .append_pair("$top", &top.to_string());
841 }
842 if let Some(continuation_token) = &this.continuation_token {
843 req.url_mut()
844 .query_pairs_mut()
845 .append_pair("continuationToken", &continuation_token.to_string());
846 }
847 if let Some(expand) = &this.expand {
848 req.url_mut()
849 .query_pairs_mut()
850 .append_pair("$expand", expand);
851 }
852 if let Some(artifact_type_id) = &this.artifact_type_id {
853 req.url_mut()
854 .query_pairs_mut()
855 .append_pair("artifactTypeId", artifact_type_id);
856 }
857 if let Some(source_id) = &this.source_id {
858 req.url_mut()
859 .query_pairs_mut()
860 .append_pair("sourceId", source_id);
861 }
862 if let Some(artifact_version_id) = &this.artifact_version_id {
863 req.url_mut()
864 .query_pairs_mut()
865 .append_pair("artifactVersionId", artifact_version_id);
866 }
867 if let Some(source_branch_filter) = &this.source_branch_filter {
868 req.url_mut()
869 .query_pairs_mut()
870 .append_pair("sourceBranchFilter", source_branch_filter);
871 }
872 if let Some(is_deleted) = &this.is_deleted {
873 req.url_mut()
874 .query_pairs_mut()
875 .append_pair("isDeleted", &is_deleted.to_string());
876 }
877 if let Some(tag_filter) = &this.tag_filter {
878 req.url_mut()
879 .query_pairs_mut()
880 .append_pair("tagFilter", tag_filter);
881 }
882 if let Some(property_filters) = &this.property_filters {
883 req.url_mut()
884 .query_pairs_mut()
885 .append_pair("propertyFilters", property_filters);
886 }
887 if let Some(release_id_filter) = &this.release_id_filter {
888 req.url_mut()
889 .query_pairs_mut()
890 .append_pair("releaseIdFilter", release_id_filter);
891 }
892 if let Some(path) = &this.path {
893 req.url_mut().query_pairs_mut().append_pair("path", path);
894 }
895 let req_body = azure_core::Bytes::new();
896 req.set_body(req_body);
897 Ok(Response(this.client.send(&mut req).await?))
898 }
899 })
900 }
901 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
902 let mut url = azure_core::http::Url::parse(&format!(
903 "{}/{}/{}/_apis/release/releases",
904 self.client.endpoint(),
905 &self.organization,
906 &self.project
907 ))?;
908 let has_api_version_already = url
909 .query_pairs()
910 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
911 if !has_api_version_already {
912 url.query_pairs_mut().append_pair(
913 azure_core::http::headers::query_param::API_VERSION,
914 "7.1-preview",
915 );
916 }
917 Ok(url)
918 }
919 }
920 impl std::future::IntoFuture for RequestBuilder {
921 type Output = azure_core::Result<models::ReleaseList>;
922 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseList>>;
923 #[doc = "Returns a future that sends the request and returns the parsed response body."]
924 #[doc = ""]
925 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
926 #[doc = ""]
927 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
928 fn into_future(self) -> Self::IntoFuture {
929 Box::pin(async move { self.send().await?.into_raw_body().await })
930 }
931 }
932 }
933 pub mod create {
934 use super::models;
935 #[cfg(not(target_arch = "wasm32"))]
936 use futures::future::BoxFuture;
937 #[cfg(target_arch = "wasm32")]
938 use futures::future::LocalBoxFuture as BoxFuture;
939 #[derive(Debug)]
940 pub struct Response(azure_core::http::Response);
941 impl Response {
942 pub async fn into_raw_body(self) -> azure_core::Result<models::Release> {
943 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
944 let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
945 azure_core::error::Error::full(
946 azure_core::error::ErrorKind::DataConversion,
947 e,
948 format!(
949 "Failed to deserialize response:\n{}",
950 String::from_utf8_lossy(&bytes)
951 ),
952 )
953 })?;
954 Ok(body)
955 }
956 pub fn into_raw_response(self) -> azure_core::http::Response {
957 self.0
958 }
959 pub fn as_raw_response(&self) -> &azure_core::http::Response {
960 &self.0
961 }
962 }
963 impl From<Response> for azure_core::http::Response {
964 fn from(rsp: Response) -> Self {
965 rsp.into_raw_response()
966 }
967 }
968 impl AsRef<azure_core::http::Response> for Response {
969 fn as_ref(&self) -> &azure_core::http::Response {
970 self.as_raw_response()
971 }
972 }
973 #[derive(Clone)]
974 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
975 #[doc = r""]
976 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
977 #[doc = r" parameters can be chained."]
978 #[doc = r""]
979 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
980 #[doc = r" converts the [`RequestBuilder`] into a future,"]
981 #[doc = r" executes the request and returns a `Result` with the parsed"]
982 #[doc = r" response."]
983 #[doc = r""]
984 #[doc = r" If you need lower-level access to the raw response details"]
985 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
986 #[doc = r" can finalize the request using the"]
987 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
988 #[doc = r" that resolves to a lower-level [`Response`] value."]
989 pub struct RequestBuilder {
990 pub(crate) client: super::super::Client,
991 pub(crate) organization: String,
992 pub(crate) body: models::ReleaseStartMetadata,
993 pub(crate) project: String,
994 }
995 impl RequestBuilder {
996 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
997 #[doc = ""]
998 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
999 #[doc = "However, this function can provide more flexibility when required."]
1000 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1001 Box::pin({
1002 let this = self.clone();
1003 async move {
1004 let url = this.url()?;
1005 let mut req =
1006 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1007 if let Some(auth_header) = this
1008 .client
1009 .token_credential()
1010 .http_authorization_header(&this.client.scopes())
1011 .await?
1012 {
1013 req.insert_header(
1014 azure_core::http::headers::AUTHORIZATION,
1015 auth_header,
1016 );
1017 }
1018 req.insert_header("content-type", "application/json");
1019 let req_body = azure_core::json::to_json(&this.body)?;
1020 req.set_body(req_body);
1021 Ok(Response(this.client.send(&mut req).await?))
1022 }
1023 })
1024 }
1025 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1026 let mut url = azure_core::http::Url::parse(&format!(
1027 "{}/{}/{}/_apis/release/releases",
1028 self.client.endpoint(),
1029 &self.organization,
1030 &self.project
1031 ))?;
1032 let has_api_version_already = url
1033 .query_pairs()
1034 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1035 if !has_api_version_already {
1036 url.query_pairs_mut().append_pair(
1037 azure_core::http::headers::query_param::API_VERSION,
1038 "7.1-preview",
1039 );
1040 }
1041 Ok(url)
1042 }
1043 }
1044 impl std::future::IntoFuture for RequestBuilder {
1045 type Output = azure_core::Result<models::Release>;
1046 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Release>>;
1047 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1048 #[doc = ""]
1049 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1050 #[doc = ""]
1051 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1052 fn into_future(self) -> Self::IntoFuture {
1053 Box::pin(async move { self.send().await?.into_raw_body().await })
1054 }
1055 }
1056 }
1057 pub mod get_release_revision {
1058 use super::models;
1059 #[cfg(not(target_arch = "wasm32"))]
1060 use futures::future::BoxFuture;
1061 #[cfg(target_arch = "wasm32")]
1062 use futures::future::LocalBoxFuture as BoxFuture;
1063 #[derive(Debug)]
1064 pub struct Response(azure_core::http::Response);
1065 impl Response {
1066 pub async fn into_raw_body(self) -> azure_core::Result<String> {
1067 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1068 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
1069 azure_core::error::Error::full(
1070 azure_core::error::ErrorKind::DataConversion,
1071 e,
1072 format!(
1073 "Failed to deserialize response:\n{}",
1074 String::from_utf8_lossy(&bytes)
1075 ),
1076 )
1077 })?;
1078 Ok(body)
1079 }
1080 pub fn into_raw_response(self) -> azure_core::http::Response {
1081 self.0
1082 }
1083 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1084 &self.0
1085 }
1086 }
1087 impl From<Response> for azure_core::http::Response {
1088 fn from(rsp: Response) -> Self {
1089 rsp.into_raw_response()
1090 }
1091 }
1092 impl AsRef<azure_core::http::Response> for Response {
1093 fn as_ref(&self) -> &azure_core::http::Response {
1094 self.as_raw_response()
1095 }
1096 }
1097 #[derive(Clone)]
1098 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1099 #[doc = r""]
1100 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1101 #[doc = r" parameters can be chained."]
1102 #[doc = r""]
1103 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1104 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1105 #[doc = r" executes the request and returns a `Result` with the parsed"]
1106 #[doc = r" response."]
1107 #[doc = r""]
1108 #[doc = r" If you need lower-level access to the raw response details"]
1109 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1110 #[doc = r" can finalize the request using the"]
1111 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1112 #[doc = r" that resolves to a lower-level [`Response`] value."]
1113 pub struct RequestBuilder {
1114 pub(crate) client: super::super::Client,
1115 pub(crate) organization: String,
1116 pub(crate) project: String,
1117 pub(crate) release_id: i32,
1118 pub(crate) definition_snapshot_revision: i32,
1119 }
1120 impl RequestBuilder {
1121 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1122 #[doc = ""]
1123 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1124 #[doc = "However, this function can provide more flexibility when required."]
1125 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1126 Box::pin({
1127 let this = self.clone();
1128 async move {
1129 let url = this.url()?;
1130 let mut req =
1131 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1132 if let Some(auth_header) = this
1133 .client
1134 .token_credential()
1135 .http_authorization_header(&this.client.scopes())
1136 .await?
1137 {
1138 req.insert_header(
1139 azure_core::http::headers::AUTHORIZATION,
1140 auth_header,
1141 );
1142 }
1143 let definition_snapshot_revision = &this.definition_snapshot_revision;
1144 req.url_mut().query_pairs_mut().append_pair(
1145 "definitionSnapshotRevision",
1146 &definition_snapshot_revision.to_string(),
1147 );
1148 let req_body = azure_core::Bytes::new();
1149 req.set_body(req_body);
1150 Ok(Response(this.client.send(&mut req).await?))
1151 }
1152 })
1153 }
1154 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1155 let mut url = azure_core::http::Url::parse(&format!(
1156 "{}/{}/{}/_apis/release/releases/{}",
1157 self.client.endpoint(),
1158 &self.organization,
1159 &self.project,
1160 &self.release_id
1161 ))?;
1162 let has_api_version_already = url
1163 .query_pairs()
1164 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1165 if !has_api_version_already {
1166 url.query_pairs_mut().append_pair(
1167 azure_core::http::headers::query_param::API_VERSION,
1168 "7.1-preview",
1169 );
1170 }
1171 Ok(url)
1172 }
1173 }
1174 impl std::future::IntoFuture for RequestBuilder {
1175 type Output = azure_core::Result<String>;
1176 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
1177 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1178 #[doc = ""]
1179 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1180 #[doc = ""]
1181 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1182 fn into_future(self) -> Self::IntoFuture {
1183 Box::pin(async move { self.send().await?.into_raw_body().await })
1184 }
1185 }
1186 }
1187 pub mod update_release {
1188 use super::models;
1189 #[cfg(not(target_arch = "wasm32"))]
1190 use futures::future::BoxFuture;
1191 #[cfg(target_arch = "wasm32")]
1192 use futures::future::LocalBoxFuture as BoxFuture;
1193 #[derive(Debug)]
1194 pub struct Response(azure_core::http::Response);
1195 impl Response {
1196 pub async fn into_raw_body(self) -> azure_core::Result<models::Release> {
1197 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1198 let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
1199 azure_core::error::Error::full(
1200 azure_core::error::ErrorKind::DataConversion,
1201 e,
1202 format!(
1203 "Failed to deserialize response:\n{}",
1204 String::from_utf8_lossy(&bytes)
1205 ),
1206 )
1207 })?;
1208 Ok(body)
1209 }
1210 pub fn into_raw_response(self) -> azure_core::http::Response {
1211 self.0
1212 }
1213 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1214 &self.0
1215 }
1216 }
1217 impl From<Response> for azure_core::http::Response {
1218 fn from(rsp: Response) -> Self {
1219 rsp.into_raw_response()
1220 }
1221 }
1222 impl AsRef<azure_core::http::Response> for Response {
1223 fn as_ref(&self) -> &azure_core::http::Response {
1224 self.as_raw_response()
1225 }
1226 }
1227 #[derive(Clone)]
1228 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1229 #[doc = r""]
1230 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1231 #[doc = r" parameters can be chained."]
1232 #[doc = r""]
1233 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1234 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1235 #[doc = r" executes the request and returns a `Result` with the parsed"]
1236 #[doc = r" response."]
1237 #[doc = r""]
1238 #[doc = r" If you need lower-level access to the raw response details"]
1239 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1240 #[doc = r" can finalize the request using the"]
1241 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1242 #[doc = r" that resolves to a lower-level [`Response`] value."]
1243 pub struct RequestBuilder {
1244 pub(crate) client: super::super::Client,
1245 pub(crate) organization: String,
1246 pub(crate) body: models::Release,
1247 pub(crate) project: String,
1248 pub(crate) release_id: i32,
1249 }
1250 impl RequestBuilder {
1251 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1252 #[doc = ""]
1253 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1254 #[doc = "However, this function can provide more flexibility when required."]
1255 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1256 Box::pin({
1257 let this = self.clone();
1258 async move {
1259 let url = this.url()?;
1260 let mut req =
1261 azure_core::http::Request::new(url, azure_core::http::Method::Put);
1262 if let Some(auth_header) = this
1263 .client
1264 .token_credential()
1265 .http_authorization_header(&this.client.scopes())
1266 .await?
1267 {
1268 req.insert_header(
1269 azure_core::http::headers::AUTHORIZATION,
1270 auth_header,
1271 );
1272 }
1273 req.insert_header("content-type", "application/json");
1274 let req_body = azure_core::json::to_json(&this.body)?;
1275 req.set_body(req_body);
1276 Ok(Response(this.client.send(&mut req).await?))
1277 }
1278 })
1279 }
1280 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1281 let mut url = azure_core::http::Url::parse(&format!(
1282 "{}/{}/{}/_apis/release/releases/{}",
1283 self.client.endpoint(),
1284 &self.organization,
1285 &self.project,
1286 &self.release_id
1287 ))?;
1288 let has_api_version_already = url
1289 .query_pairs()
1290 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1291 if !has_api_version_already {
1292 url.query_pairs_mut().append_pair(
1293 azure_core::http::headers::query_param::API_VERSION,
1294 "7.1-preview",
1295 );
1296 }
1297 Ok(url)
1298 }
1299 }
1300 impl std::future::IntoFuture for RequestBuilder {
1301 type Output = azure_core::Result<models::Release>;
1302 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Release>>;
1303 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1304 #[doc = ""]
1305 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1306 #[doc = ""]
1307 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1308 fn into_future(self) -> Self::IntoFuture {
1309 Box::pin(async move { self.send().await?.into_raw_body().await })
1310 }
1311 }
1312 }
1313 pub mod update_release_resource {
1314 use super::models;
1315 #[cfg(not(target_arch = "wasm32"))]
1316 use futures::future::BoxFuture;
1317 #[cfg(target_arch = "wasm32")]
1318 use futures::future::LocalBoxFuture as BoxFuture;
1319 #[derive(Debug)]
1320 pub struct Response(azure_core::http::Response);
1321 impl Response {
1322 pub async fn into_raw_body(self) -> azure_core::Result<models::Release> {
1323 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1324 let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
1325 azure_core::error::Error::full(
1326 azure_core::error::ErrorKind::DataConversion,
1327 e,
1328 format!(
1329 "Failed to deserialize response:\n{}",
1330 String::from_utf8_lossy(&bytes)
1331 ),
1332 )
1333 })?;
1334 Ok(body)
1335 }
1336 pub fn into_raw_response(self) -> azure_core::http::Response {
1337 self.0
1338 }
1339 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1340 &self.0
1341 }
1342 }
1343 impl From<Response> for azure_core::http::Response {
1344 fn from(rsp: Response) -> Self {
1345 rsp.into_raw_response()
1346 }
1347 }
1348 impl AsRef<azure_core::http::Response> for Response {
1349 fn as_ref(&self) -> &azure_core::http::Response {
1350 self.as_raw_response()
1351 }
1352 }
1353 #[derive(Clone)]
1354 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1355 #[doc = r""]
1356 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1357 #[doc = r" parameters can be chained."]
1358 #[doc = r""]
1359 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1360 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1361 #[doc = r" executes the request and returns a `Result` with the parsed"]
1362 #[doc = r" response."]
1363 #[doc = r""]
1364 #[doc = r" If you need lower-level access to the raw response details"]
1365 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1366 #[doc = r" can finalize the request using the"]
1367 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1368 #[doc = r" that resolves to a lower-level [`Response`] value."]
1369 pub struct RequestBuilder {
1370 pub(crate) client: super::super::Client,
1371 pub(crate) organization: String,
1372 pub(crate) body: models::ReleaseUpdateMetadata,
1373 pub(crate) project: String,
1374 pub(crate) release_id: i32,
1375 }
1376 impl RequestBuilder {
1377 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1378 #[doc = ""]
1379 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1380 #[doc = "However, this function can provide more flexibility when required."]
1381 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1382 Box::pin({
1383 let this = self.clone();
1384 async move {
1385 let url = this.url()?;
1386 let mut req =
1387 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1388 if let Some(auth_header) = this
1389 .client
1390 .token_credential()
1391 .http_authorization_header(&this.client.scopes())
1392 .await?
1393 {
1394 req.insert_header(
1395 azure_core::http::headers::AUTHORIZATION,
1396 auth_header,
1397 );
1398 }
1399 req.insert_header("content-type", "application/json");
1400 let req_body = azure_core::json::to_json(&this.body)?;
1401 req.set_body(req_body);
1402 Ok(Response(this.client.send(&mut req).await?))
1403 }
1404 })
1405 }
1406 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1407 let mut url = azure_core::http::Url::parse(&format!(
1408 "{}/{}/{}/_apis/release/releases/{}",
1409 self.client.endpoint(),
1410 &self.organization,
1411 &self.project,
1412 &self.release_id
1413 ))?;
1414 let has_api_version_already = url
1415 .query_pairs()
1416 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1417 if !has_api_version_already {
1418 url.query_pairs_mut().append_pair(
1419 azure_core::http::headers::query_param::API_VERSION,
1420 "7.1-preview",
1421 );
1422 }
1423 Ok(url)
1424 }
1425 }
1426 impl std::future::IntoFuture for RequestBuilder {
1427 type Output = azure_core::Result<models::Release>;
1428 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Release>>;
1429 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1430 #[doc = ""]
1431 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1432 #[doc = ""]
1433 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1434 fn into_future(self) -> Self::IntoFuture {
1435 Box::pin(async move { self.send().await?.into_raw_body().await })
1436 }
1437 }
1438 }
1439 pub mod get_release_environment {
1440 use super::models;
1441 #[cfg(not(target_arch = "wasm32"))]
1442 use futures::future::BoxFuture;
1443 #[cfg(target_arch = "wasm32")]
1444 use futures::future::LocalBoxFuture as BoxFuture;
1445 #[derive(Debug)]
1446 pub struct Response(azure_core::http::Response);
1447 impl Response {
1448 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseEnvironment> {
1449 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1450 let body: models::ReleaseEnvironment =
1451 serde_json::from_slice(&bytes).map_err(|e| {
1452 azure_core::error::Error::full(
1453 azure_core::error::ErrorKind::DataConversion,
1454 e,
1455 format!(
1456 "Failed to deserialize response:\n{}",
1457 String::from_utf8_lossy(&bytes)
1458 ),
1459 )
1460 })?;
1461 Ok(body)
1462 }
1463 pub fn into_raw_response(self) -> azure_core::http::Response {
1464 self.0
1465 }
1466 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1467 &self.0
1468 }
1469 }
1470 impl From<Response> for azure_core::http::Response {
1471 fn from(rsp: Response) -> Self {
1472 rsp.into_raw_response()
1473 }
1474 }
1475 impl AsRef<azure_core::http::Response> for Response {
1476 fn as_ref(&self) -> &azure_core::http::Response {
1477 self.as_raw_response()
1478 }
1479 }
1480 #[derive(Clone)]
1481 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1482 #[doc = r""]
1483 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1484 #[doc = r" parameters can be chained."]
1485 #[doc = r""]
1486 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1487 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1488 #[doc = r" executes the request and returns a `Result` with the parsed"]
1489 #[doc = r" response."]
1490 #[doc = r""]
1491 #[doc = r" If you need lower-level access to the raw response details"]
1492 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1493 #[doc = r" can finalize the request using the"]
1494 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1495 #[doc = r" that resolves to a lower-level [`Response`] value."]
1496 pub struct RequestBuilder {
1497 pub(crate) client: super::super::Client,
1498 pub(crate) organization: String,
1499 pub(crate) project: String,
1500 pub(crate) release_id: i32,
1501 pub(crate) environment_id: i32,
1502 pub(crate) expand: Option<String>,
1503 }
1504 impl RequestBuilder {
1505 #[doc = "A property that should be expanded in the environment."]
1506 pub fn expand(mut self, expand: impl Into<String>) -> Self {
1507 self.expand = Some(expand.into());
1508 self
1509 }
1510 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1511 #[doc = ""]
1512 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1513 #[doc = "However, this function can provide more flexibility when required."]
1514 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1515 Box::pin({
1516 let this = self.clone();
1517 async move {
1518 let url = this.url()?;
1519 let mut req =
1520 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1521 if let Some(auth_header) = this
1522 .client
1523 .token_credential()
1524 .http_authorization_header(&this.client.scopes())
1525 .await?
1526 {
1527 req.insert_header(
1528 azure_core::http::headers::AUTHORIZATION,
1529 auth_header,
1530 );
1531 }
1532 if let Some(expand) = &this.expand {
1533 req.url_mut()
1534 .query_pairs_mut()
1535 .append_pair("$expand", expand);
1536 }
1537 let req_body = azure_core::Bytes::new();
1538 req.set_body(req_body);
1539 Ok(Response(this.client.send(&mut req).await?))
1540 }
1541 })
1542 }
1543 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1544 let mut url = azure_core::http::Url::parse(&format!(
1545 "{}/{}/{}/_apis/Release/releases/{}/environments/{}",
1546 self.client.endpoint(),
1547 &self.organization,
1548 &self.project,
1549 &self.release_id,
1550 &self.environment_id
1551 ))?;
1552 let has_api_version_already = url
1553 .query_pairs()
1554 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1555 if !has_api_version_already {
1556 url.query_pairs_mut().append_pair(
1557 azure_core::http::headers::query_param::API_VERSION,
1558 "7.1-preview",
1559 );
1560 }
1561 Ok(url)
1562 }
1563 }
1564 impl std::future::IntoFuture for RequestBuilder {
1565 type Output = azure_core::Result<models::ReleaseEnvironment>;
1566 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>;
1567 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1568 #[doc = ""]
1569 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1570 #[doc = ""]
1571 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1572 fn into_future(self) -> Self::IntoFuture {
1573 Box::pin(async move { self.send().await?.into_raw_body().await })
1574 }
1575 }
1576 }
1577 pub mod update_release_environment {
1578 use super::models;
1579 #[cfg(not(target_arch = "wasm32"))]
1580 use futures::future::BoxFuture;
1581 #[cfg(target_arch = "wasm32")]
1582 use futures::future::LocalBoxFuture as BoxFuture;
1583 #[derive(Debug)]
1584 pub struct Response(azure_core::http::Response);
1585 impl Response {
1586 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseEnvironment> {
1587 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1588 let body: models::ReleaseEnvironment =
1589 serde_json::from_slice(&bytes).map_err(|e| {
1590 azure_core::error::Error::full(
1591 azure_core::error::ErrorKind::DataConversion,
1592 e,
1593 format!(
1594 "Failed to deserialize response:\n{}",
1595 String::from_utf8_lossy(&bytes)
1596 ),
1597 )
1598 })?;
1599 Ok(body)
1600 }
1601 pub fn into_raw_response(self) -> azure_core::http::Response {
1602 self.0
1603 }
1604 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1605 &self.0
1606 }
1607 }
1608 impl From<Response> for azure_core::http::Response {
1609 fn from(rsp: Response) -> Self {
1610 rsp.into_raw_response()
1611 }
1612 }
1613 impl AsRef<azure_core::http::Response> for Response {
1614 fn as_ref(&self) -> &azure_core::http::Response {
1615 self.as_raw_response()
1616 }
1617 }
1618 #[derive(Clone)]
1619 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1620 #[doc = r""]
1621 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1622 #[doc = r" parameters can be chained."]
1623 #[doc = r""]
1624 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1625 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1626 #[doc = r" executes the request and returns a `Result` with the parsed"]
1627 #[doc = r" response."]
1628 #[doc = r""]
1629 #[doc = r" If you need lower-level access to the raw response details"]
1630 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1631 #[doc = r" can finalize the request using the"]
1632 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1633 #[doc = r" that resolves to a lower-level [`Response`] value."]
1634 pub struct RequestBuilder {
1635 pub(crate) client: super::super::Client,
1636 pub(crate) organization: String,
1637 pub(crate) body: models::ReleaseEnvironmentUpdateMetadata,
1638 pub(crate) project: String,
1639 pub(crate) release_id: i32,
1640 pub(crate) environment_id: i32,
1641 }
1642 impl RequestBuilder {
1643 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1644 #[doc = ""]
1645 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1646 #[doc = "However, this function can provide more flexibility when required."]
1647 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1648 Box::pin({
1649 let this = self.clone();
1650 async move {
1651 let url = this.url()?;
1652 let mut req =
1653 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1654 if let Some(auth_header) = this
1655 .client
1656 .token_credential()
1657 .http_authorization_header(&this.client.scopes())
1658 .await?
1659 {
1660 req.insert_header(
1661 azure_core::http::headers::AUTHORIZATION,
1662 auth_header,
1663 );
1664 }
1665 req.insert_header("content-type", "application/json");
1666 let req_body = azure_core::json::to_json(&this.body)?;
1667 req.set_body(req_body);
1668 Ok(Response(this.client.send(&mut req).await?))
1669 }
1670 })
1671 }
1672 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1673 let mut url = azure_core::http::Url::parse(&format!(
1674 "{}/{}/{}/_apis/Release/releases/{}/environments/{}",
1675 self.client.endpoint(),
1676 &self.organization,
1677 &self.project,
1678 &self.release_id,
1679 &self.environment_id
1680 ))?;
1681 let has_api_version_already = url
1682 .query_pairs()
1683 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1684 if !has_api_version_already {
1685 url.query_pairs_mut().append_pair(
1686 azure_core::http::headers::query_param::API_VERSION,
1687 "7.1-preview",
1688 );
1689 }
1690 Ok(url)
1691 }
1692 }
1693 impl std::future::IntoFuture for RequestBuilder {
1694 type Output = azure_core::Result<models::ReleaseEnvironment>;
1695 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>;
1696 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1697 #[doc = ""]
1698 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1699 #[doc = ""]
1700 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1701 fn into_future(self) -> Self::IntoFuture {
1702 Box::pin(async move { self.send().await?.into_raw_body().await })
1703 }
1704 }
1705 }
1706 pub mod get_task_log {
1707 use super::models;
1708 #[cfg(not(target_arch = "wasm32"))]
1709 use futures::future::BoxFuture;
1710 #[cfg(target_arch = "wasm32")]
1711 use futures::future::LocalBoxFuture as BoxFuture;
1712 #[derive(Debug)]
1713 pub struct Response(azure_core::http::Response);
1714 impl Response {
1715 pub async fn into_raw_body(self) -> azure_core::Result<String> {
1716 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1717 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
1718 azure_core::error::Error::full(
1719 azure_core::error::ErrorKind::DataConversion,
1720 e,
1721 format!(
1722 "Failed to deserialize response:\n{}",
1723 String::from_utf8_lossy(&bytes)
1724 ),
1725 )
1726 })?;
1727 Ok(body)
1728 }
1729 pub fn into_raw_response(self) -> azure_core::http::Response {
1730 self.0
1731 }
1732 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1733 &self.0
1734 }
1735 }
1736 impl From<Response> for azure_core::http::Response {
1737 fn from(rsp: Response) -> Self {
1738 rsp.into_raw_response()
1739 }
1740 }
1741 impl AsRef<azure_core::http::Response> for Response {
1742 fn as_ref(&self) -> &azure_core::http::Response {
1743 self.as_raw_response()
1744 }
1745 }
1746 #[derive(Clone)]
1747 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1748 #[doc = r""]
1749 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1750 #[doc = r" parameters can be chained."]
1751 #[doc = r""]
1752 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1753 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1754 #[doc = r" executes the request and returns a `Result` with the parsed"]
1755 #[doc = r" response."]
1756 #[doc = r""]
1757 #[doc = r" If you need lower-level access to the raw response details"]
1758 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1759 #[doc = r" can finalize the request using the"]
1760 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1761 #[doc = r" that resolves to a lower-level [`Response`] value."]
1762 pub struct RequestBuilder {
1763 pub(crate) client: super::super::Client,
1764 pub(crate) organization: String,
1765 pub(crate) project: String,
1766 pub(crate) release_id: i32,
1767 pub(crate) environment_id: i32,
1768 pub(crate) release_deploy_phase_id: i32,
1769 pub(crate) task_id: i32,
1770 pub(crate) start_line: Option<i64>,
1771 pub(crate) end_line: Option<i64>,
1772 }
1773 impl RequestBuilder {
1774 #[doc = "Starting line number for logs"]
1775 pub fn start_line(mut self, start_line: i64) -> Self {
1776 self.start_line = Some(start_line);
1777 self
1778 }
1779 #[doc = "Ending line number for logs"]
1780 pub fn end_line(mut self, end_line: i64) -> Self {
1781 self.end_line = Some(end_line);
1782 self
1783 }
1784 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1785 #[doc = ""]
1786 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1787 #[doc = "However, this function can provide more flexibility when required."]
1788 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1789 Box::pin({
1790 let this = self.clone();
1791 async move {
1792 let url = this.url()?;
1793 let mut req =
1794 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1795 if let Some(auth_header) = this
1796 .client
1797 .token_credential()
1798 .http_authorization_header(&this.client.scopes())
1799 .await?
1800 {
1801 req.insert_header(
1802 azure_core::http::headers::AUTHORIZATION,
1803 auth_header,
1804 );
1805 }
1806 if let Some(start_line) = &this.start_line {
1807 req.url_mut()
1808 .query_pairs_mut()
1809 .append_pair("startLine", &start_line.to_string());
1810 }
1811 if let Some(end_line) = &this.end_line {
1812 req.url_mut()
1813 .query_pairs_mut()
1814 .append_pair("endLine", &end_line.to_string());
1815 }
1816 let req_body = azure_core::Bytes::new();
1817 req.set_body(req_body);
1818 Ok(Response(this.client.send(&mut req).await?))
1819 }
1820 })
1821 }
1822 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1823 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . release_deploy_phase_id , & self . task_id)) ? ;
1824 let has_api_version_already = url
1825 .query_pairs()
1826 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1827 if !has_api_version_already {
1828 url.query_pairs_mut().append_pair(
1829 azure_core::http::headers::query_param::API_VERSION,
1830 "7.1-preview",
1831 );
1832 }
1833 Ok(url)
1834 }
1835 }
1836 impl std::future::IntoFuture for RequestBuilder {
1837 type Output = azure_core::Result<String>;
1838 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
1839 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1840 #[doc = ""]
1841 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1842 #[doc = ""]
1843 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1844 fn into_future(self) -> Self::IntoFuture {
1845 Box::pin(async move { self.send().await?.into_raw_body().await })
1846 }
1847 }
1848 }
1849 pub mod get_logs {
1850 use super::models;
1851 #[cfg(not(target_arch = "wasm32"))]
1852 use futures::future::BoxFuture;
1853 #[cfg(target_arch = "wasm32")]
1854 use futures::future::LocalBoxFuture as BoxFuture;
1855 #[derive(Debug)]
1856 pub struct Response(azure_core::http::Response);
1857 impl Response {
1858 pub async fn into_raw_body(self) -> azure_core::Result<String> {
1859 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1860 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
1861 azure_core::error::Error::full(
1862 azure_core::error::ErrorKind::DataConversion,
1863 e,
1864 format!(
1865 "Failed to deserialize response:\n{}",
1866 String::from_utf8_lossy(&bytes)
1867 ),
1868 )
1869 })?;
1870 Ok(body)
1871 }
1872 pub fn into_raw_response(self) -> azure_core::http::Response {
1873 self.0
1874 }
1875 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1876 &self.0
1877 }
1878 }
1879 impl From<Response> for azure_core::http::Response {
1880 fn from(rsp: Response) -> Self {
1881 rsp.into_raw_response()
1882 }
1883 }
1884 impl AsRef<azure_core::http::Response> for Response {
1885 fn as_ref(&self) -> &azure_core::http::Response {
1886 self.as_raw_response()
1887 }
1888 }
1889 #[derive(Clone)]
1890 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1891 #[doc = r""]
1892 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1893 #[doc = r" parameters can be chained."]
1894 #[doc = r""]
1895 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1896 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1897 #[doc = r" executes the request and returns a `Result` with the parsed"]
1898 #[doc = r" response."]
1899 #[doc = r""]
1900 #[doc = r" If you need lower-level access to the raw response details"]
1901 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1902 #[doc = r" can finalize the request using the"]
1903 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1904 #[doc = r" that resolves to a lower-level [`Response`] value."]
1905 pub struct RequestBuilder {
1906 pub(crate) client: super::super::Client,
1907 pub(crate) organization: String,
1908 pub(crate) project: String,
1909 pub(crate) release_id: i32,
1910 }
1911 impl RequestBuilder {
1912 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1913 #[doc = ""]
1914 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1915 #[doc = "However, this function can provide more flexibility when required."]
1916 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1917 Box::pin({
1918 let this = self.clone();
1919 async move {
1920 let url = this.url()?;
1921 let mut req =
1922 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1923 if let Some(auth_header) = this
1924 .client
1925 .token_credential()
1926 .http_authorization_header(&this.client.scopes())
1927 .await?
1928 {
1929 req.insert_header(
1930 azure_core::http::headers::AUTHORIZATION,
1931 auth_header,
1932 );
1933 }
1934 let req_body = azure_core::Bytes::new();
1935 req.set_body(req_body);
1936 Ok(Response(this.client.send(&mut req).await?))
1937 }
1938 })
1939 }
1940 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1941 let mut url = azure_core::http::Url::parse(&format!(
1942 "{}/{}/{}/_apis/release/releases/{}/logs",
1943 self.client.endpoint(),
1944 &self.organization,
1945 &self.project,
1946 &self.release_id
1947 ))?;
1948 let has_api_version_already = url
1949 .query_pairs()
1950 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1951 if !has_api_version_already {
1952 url.query_pairs_mut().append_pair(
1953 azure_core::http::headers::query_param::API_VERSION,
1954 "7.1-preview",
1955 );
1956 }
1957 Ok(url)
1958 }
1959 }
1960 impl std::future::IntoFuture for RequestBuilder {
1961 type Output = azure_core::Result<String>;
1962 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
1963 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1964 #[doc = ""]
1965 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1966 #[doc = ""]
1967 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1968 fn into_future(self) -> Self::IntoFuture {
1969 Box::pin(async move { self.send().await?.into_raw_body().await })
1970 }
1971 }
1972 }
1973}
1974pub mod approvals {
1975 use super::models;
1976 #[cfg(not(target_arch = "wasm32"))]
1977 use futures::future::BoxFuture;
1978 #[cfg(target_arch = "wasm32")]
1979 use futures::future::LocalBoxFuture as BoxFuture;
1980 pub struct Client(pub(crate) super::Client);
1981 impl Client {
1982 #[doc = "Get a list of approvals"]
1983 #[doc = ""]
1984 #[doc = "Arguments:"]
1985 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1986 #[doc = "* `project`: Project ID or project name"]
1987 pub fn list(
1988 &self,
1989 organization: impl Into<String>,
1990 project: impl Into<String>,
1991 ) -> list::RequestBuilder {
1992 list::RequestBuilder {
1993 client: self.0.clone(),
1994 organization: organization.into(),
1995 project: project.into(),
1996 assigned_to_filter: None,
1997 status_filter: None,
1998 release_ids_filter: None,
1999 type_filter: None,
2000 top: None,
2001 continuation_token: None,
2002 query_order: None,
2003 include_my_group_approvals: None,
2004 }
2005 }
2006 #[doc = "Update status of an approval"]
2007 #[doc = ""]
2008 #[doc = "Arguments:"]
2009 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2010 #[doc = "* `body`: ReleaseApproval object having status, approver and comments."]
2011 #[doc = "* `project`: Project ID or project name"]
2012 #[doc = "* `approval_id`: Id of the approval."]
2013 pub fn update(
2014 &self,
2015 organization: impl Into<String>,
2016 body: impl Into<models::ReleaseApproval>,
2017 project: impl Into<String>,
2018 approval_id: i32,
2019 ) -> update::RequestBuilder {
2020 update::RequestBuilder {
2021 client: self.0.clone(),
2022 organization: organization.into(),
2023 body: body.into(),
2024 project: project.into(),
2025 approval_id,
2026 }
2027 }
2028 }
2029 pub mod list {
2030 use super::models;
2031 #[cfg(not(target_arch = "wasm32"))]
2032 use futures::future::BoxFuture;
2033 #[cfg(target_arch = "wasm32")]
2034 use futures::future::LocalBoxFuture as BoxFuture;
2035 #[derive(Debug)]
2036 pub struct Response(azure_core::http::Response);
2037 impl Response {
2038 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseApprovalList> {
2039 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2040 let body: models::ReleaseApprovalList =
2041 serde_json::from_slice(&bytes).map_err(|e| {
2042 azure_core::error::Error::full(
2043 azure_core::error::ErrorKind::DataConversion,
2044 e,
2045 format!(
2046 "Failed to deserialize response:\n{}",
2047 String::from_utf8_lossy(&bytes)
2048 ),
2049 )
2050 })?;
2051 Ok(body)
2052 }
2053 pub fn into_raw_response(self) -> azure_core::http::Response {
2054 self.0
2055 }
2056 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2057 &self.0
2058 }
2059 }
2060 impl From<Response> for azure_core::http::Response {
2061 fn from(rsp: Response) -> Self {
2062 rsp.into_raw_response()
2063 }
2064 }
2065 impl AsRef<azure_core::http::Response> for Response {
2066 fn as_ref(&self) -> &azure_core::http::Response {
2067 self.as_raw_response()
2068 }
2069 }
2070 #[derive(Clone)]
2071 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2072 #[doc = r""]
2073 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2074 #[doc = r" parameters can be chained."]
2075 #[doc = r""]
2076 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2077 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2078 #[doc = r" executes the request and returns a `Result` with the parsed"]
2079 #[doc = r" response."]
2080 #[doc = r""]
2081 #[doc = r" If you need lower-level access to the raw response details"]
2082 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2083 #[doc = r" can finalize the request using the"]
2084 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2085 #[doc = r" that resolves to a lower-level [`Response`] value."]
2086 pub struct RequestBuilder {
2087 pub(crate) client: super::super::Client,
2088 pub(crate) organization: String,
2089 pub(crate) project: String,
2090 pub(crate) assigned_to_filter: Option<String>,
2091 pub(crate) status_filter: Option<String>,
2092 pub(crate) release_ids_filter: Option<String>,
2093 pub(crate) type_filter: Option<String>,
2094 pub(crate) top: Option<i32>,
2095 pub(crate) continuation_token: Option<i32>,
2096 pub(crate) query_order: Option<String>,
2097 pub(crate) include_my_group_approvals: Option<bool>,
2098 }
2099 impl RequestBuilder {
2100 #[doc = "Approvals assigned to this user."]
2101 pub fn assigned_to_filter(mut self, assigned_to_filter: impl Into<String>) -> Self {
2102 self.assigned_to_filter = Some(assigned_to_filter.into());
2103 self
2104 }
2105 #[doc = "Approvals with this status. Default is 'pending'."]
2106 pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self {
2107 self.status_filter = Some(status_filter.into());
2108 self
2109 }
2110 #[doc = "Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4."]
2111 pub fn release_ids_filter(mut self, release_ids_filter: impl Into<String>) -> Self {
2112 self.release_ids_filter = Some(release_ids_filter.into());
2113 self
2114 }
2115 #[doc = "Approval with this type."]
2116 pub fn type_filter(mut self, type_filter: impl Into<String>) -> Self {
2117 self.type_filter = Some(type_filter.into());
2118 self
2119 }
2120 #[doc = "Number of approvals to get. Default is 50."]
2121 pub fn top(mut self, top: i32) -> Self {
2122 self.top = Some(top);
2123 self
2124 }
2125 #[doc = "Gets the approvals after the continuation token provided."]
2126 pub fn continuation_token(mut self, continuation_token: i32) -> Self {
2127 self.continuation_token = Some(continuation_token);
2128 self
2129 }
2130 #[doc = "Gets the results in the defined order of created approvals. Default is 'descending'."]
2131 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
2132 self.query_order = Some(query_order.into());
2133 self
2134 }
2135 #[doc = "'true' to include my group approvals. Default is 'false'."]
2136 pub fn include_my_group_approvals(mut self, include_my_group_approvals: bool) -> Self {
2137 self.include_my_group_approvals = Some(include_my_group_approvals);
2138 self
2139 }
2140 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2141 #[doc = ""]
2142 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2143 #[doc = "However, this function can provide more flexibility when required."]
2144 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2145 Box::pin({
2146 let this = self.clone();
2147 async move {
2148 let url = this.url()?;
2149 let mut req =
2150 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2151 if let Some(auth_header) = this
2152 .client
2153 .token_credential()
2154 .http_authorization_header(&this.client.scopes())
2155 .await?
2156 {
2157 req.insert_header(
2158 azure_core::http::headers::AUTHORIZATION,
2159 auth_header,
2160 );
2161 }
2162 if let Some(assigned_to_filter) = &this.assigned_to_filter {
2163 req.url_mut()
2164 .query_pairs_mut()
2165 .append_pair("assignedToFilter", assigned_to_filter);
2166 }
2167 if let Some(status_filter) = &this.status_filter {
2168 req.url_mut()
2169 .query_pairs_mut()
2170 .append_pair("statusFilter", status_filter);
2171 }
2172 if let Some(release_ids_filter) = &this.release_ids_filter {
2173 req.url_mut()
2174 .query_pairs_mut()
2175 .append_pair("releaseIdsFilter", release_ids_filter);
2176 }
2177 if let Some(type_filter) = &this.type_filter {
2178 req.url_mut()
2179 .query_pairs_mut()
2180 .append_pair("typeFilter", type_filter);
2181 }
2182 if let Some(top) = &this.top {
2183 req.url_mut()
2184 .query_pairs_mut()
2185 .append_pair("top", &top.to_string());
2186 }
2187 if let Some(continuation_token) = &this.continuation_token {
2188 req.url_mut()
2189 .query_pairs_mut()
2190 .append_pair("continuationToken", &continuation_token.to_string());
2191 }
2192 if let Some(query_order) = &this.query_order {
2193 req.url_mut()
2194 .query_pairs_mut()
2195 .append_pair("queryOrder", query_order);
2196 }
2197 if let Some(include_my_group_approvals) = &this.include_my_group_approvals {
2198 req.url_mut().query_pairs_mut().append_pair(
2199 "includeMyGroupApprovals",
2200 &include_my_group_approvals.to_string(),
2201 );
2202 }
2203 let req_body = azure_core::Bytes::new();
2204 req.set_body(req_body);
2205 Ok(Response(this.client.send(&mut req).await?))
2206 }
2207 })
2208 }
2209 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2210 let mut url = azure_core::http::Url::parse(&format!(
2211 "{}/{}/{}/_apis/release/approvals",
2212 self.client.endpoint(),
2213 &self.organization,
2214 &self.project
2215 ))?;
2216 let has_api_version_already = url
2217 .query_pairs()
2218 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2219 if !has_api_version_already {
2220 url.query_pairs_mut().append_pair(
2221 azure_core::http::headers::query_param::API_VERSION,
2222 "7.1-preview",
2223 );
2224 }
2225 Ok(url)
2226 }
2227 }
2228 impl std::future::IntoFuture for RequestBuilder {
2229 type Output = azure_core::Result<models::ReleaseApprovalList>;
2230 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseApprovalList>>;
2231 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2232 #[doc = ""]
2233 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2234 #[doc = ""]
2235 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2236 fn into_future(self) -> Self::IntoFuture {
2237 Box::pin(async move { self.send().await?.into_raw_body().await })
2238 }
2239 }
2240 }
2241 pub mod update {
2242 use super::models;
2243 #[cfg(not(target_arch = "wasm32"))]
2244 use futures::future::BoxFuture;
2245 #[cfg(target_arch = "wasm32")]
2246 use futures::future::LocalBoxFuture as BoxFuture;
2247 #[derive(Debug)]
2248 pub struct Response(azure_core::http::Response);
2249 impl Response {
2250 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseApproval> {
2251 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2252 let body: models::ReleaseApproval =
2253 serde_json::from_slice(&bytes).map_err(|e| {
2254 azure_core::error::Error::full(
2255 azure_core::error::ErrorKind::DataConversion,
2256 e,
2257 format!(
2258 "Failed to deserialize response:\n{}",
2259 String::from_utf8_lossy(&bytes)
2260 ),
2261 )
2262 })?;
2263 Ok(body)
2264 }
2265 pub fn into_raw_response(self) -> azure_core::http::Response {
2266 self.0
2267 }
2268 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2269 &self.0
2270 }
2271 }
2272 impl From<Response> for azure_core::http::Response {
2273 fn from(rsp: Response) -> Self {
2274 rsp.into_raw_response()
2275 }
2276 }
2277 impl AsRef<azure_core::http::Response> for Response {
2278 fn as_ref(&self) -> &azure_core::http::Response {
2279 self.as_raw_response()
2280 }
2281 }
2282 #[derive(Clone)]
2283 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2284 #[doc = r""]
2285 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2286 #[doc = r" parameters can be chained."]
2287 #[doc = r""]
2288 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2289 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2290 #[doc = r" executes the request and returns a `Result` with the parsed"]
2291 #[doc = r" response."]
2292 #[doc = r""]
2293 #[doc = r" If you need lower-level access to the raw response details"]
2294 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2295 #[doc = r" can finalize the request using the"]
2296 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2297 #[doc = r" that resolves to a lower-level [`Response`] value."]
2298 pub struct RequestBuilder {
2299 pub(crate) client: super::super::Client,
2300 pub(crate) organization: String,
2301 pub(crate) body: models::ReleaseApproval,
2302 pub(crate) project: String,
2303 pub(crate) approval_id: i32,
2304 }
2305 impl RequestBuilder {
2306 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2307 #[doc = ""]
2308 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2309 #[doc = "However, this function can provide more flexibility when required."]
2310 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2311 Box::pin({
2312 let this = self.clone();
2313 async move {
2314 let url = this.url()?;
2315 let mut req =
2316 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
2317 if let Some(auth_header) = this
2318 .client
2319 .token_credential()
2320 .http_authorization_header(&this.client.scopes())
2321 .await?
2322 {
2323 req.insert_header(
2324 azure_core::http::headers::AUTHORIZATION,
2325 auth_header,
2326 );
2327 }
2328 req.insert_header("content-type", "application/json");
2329 let req_body = azure_core::json::to_json(&this.body)?;
2330 req.set_body(req_body);
2331 Ok(Response(this.client.send(&mut req).await?))
2332 }
2333 })
2334 }
2335 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2336 let mut url = azure_core::http::Url::parse(&format!(
2337 "{}/{}/{}/_apis/release/approvals/{}",
2338 self.client.endpoint(),
2339 &self.organization,
2340 &self.project,
2341 &self.approval_id
2342 ))?;
2343 let has_api_version_already = url
2344 .query_pairs()
2345 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2346 if !has_api_version_already {
2347 url.query_pairs_mut().append_pair(
2348 azure_core::http::headers::query_param::API_VERSION,
2349 "7.1-preview",
2350 );
2351 }
2352 Ok(url)
2353 }
2354 }
2355 impl std::future::IntoFuture for RequestBuilder {
2356 type Output = azure_core::Result<models::ReleaseApproval>;
2357 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseApproval>>;
2358 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2359 #[doc = ""]
2360 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2361 #[doc = ""]
2362 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2363 fn into_future(self) -> Self::IntoFuture {
2364 Box::pin(async move { self.send().await?.into_raw_body().await })
2365 }
2366 }
2367 }
2368}
2369pub mod definitions {
2370 use super::models;
2371 #[cfg(not(target_arch = "wasm32"))]
2372 use futures::future::BoxFuture;
2373 #[cfg(target_arch = "wasm32")]
2374 use futures::future::LocalBoxFuture as BoxFuture;
2375 pub struct Client(pub(crate) super::Client);
2376 impl Client {
2377 #[doc = "Get a list of release definitions."]
2378 #[doc = ""]
2379 #[doc = "Arguments:"]
2380 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2381 #[doc = "* `project`: Project ID or project name"]
2382 pub fn list(
2383 &self,
2384 organization: impl Into<String>,
2385 project: impl Into<String>,
2386 ) -> list::RequestBuilder {
2387 list::RequestBuilder {
2388 client: self.0.clone(),
2389 organization: organization.into(),
2390 project: project.into(),
2391 search_text: None,
2392 expand: None,
2393 artifact_type: None,
2394 artifact_source_id: None,
2395 top: None,
2396 continuation_token: None,
2397 query_order: None,
2398 path: None,
2399 is_exact_name_match: None,
2400 tag_filter: None,
2401 property_filters: None,
2402 definition_id_filter: None,
2403 is_deleted: None,
2404 search_text_contains_folder_name: None,
2405 }
2406 }
2407 #[doc = "Create a release definition"]
2408 #[doc = ""]
2409 #[doc = "Arguments:"]
2410 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2411 #[doc = "* `body`: release definition object to create."]
2412 #[doc = "* `project`: Project ID or project name"]
2413 pub fn create(
2414 &self,
2415 organization: impl Into<String>,
2416 body: impl Into<models::ReleaseDefinition>,
2417 project: impl Into<String>,
2418 ) -> create::RequestBuilder {
2419 create::RequestBuilder {
2420 client: self.0.clone(),
2421 organization: organization.into(),
2422 body: body.into(),
2423 project: project.into(),
2424 }
2425 }
2426 #[doc = "Update a release definition."]
2427 #[doc = ""]
2428 #[doc = "Arguments:"]
2429 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2430 #[doc = "* `body`: Release definition object to update."]
2431 #[doc = "* `project`: Project ID or project name"]
2432 pub fn update(
2433 &self,
2434 organization: impl Into<String>,
2435 body: impl Into<models::ReleaseDefinition>,
2436 project: impl Into<String>,
2437 ) -> update::RequestBuilder {
2438 update::RequestBuilder {
2439 client: self.0.clone(),
2440 organization: organization.into(),
2441 body: body.into(),
2442 project: project.into(),
2443 }
2444 }
2445 #[doc = "Get a release definition."]
2446 #[doc = ""]
2447 #[doc = "Arguments:"]
2448 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2449 #[doc = "* `project`: Project ID or project name"]
2450 #[doc = "* `definition_id`: Id of the release definition."]
2451 pub fn get(
2452 &self,
2453 organization: impl Into<String>,
2454 project: impl Into<String>,
2455 definition_id: i32,
2456 ) -> get::RequestBuilder {
2457 get::RequestBuilder {
2458 client: self.0.clone(),
2459 organization: organization.into(),
2460 project: project.into(),
2461 definition_id,
2462 property_filters: None,
2463 }
2464 }
2465 #[doc = "Delete a release definition."]
2466 #[doc = ""]
2467 #[doc = "Arguments:"]
2468 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2469 #[doc = "* `project`: Project ID or project name"]
2470 #[doc = "* `definition_id`: Id of the release definition."]
2471 pub fn delete(
2472 &self,
2473 organization: impl Into<String>,
2474 project: impl Into<String>,
2475 definition_id: i32,
2476 ) -> delete::RequestBuilder {
2477 delete::RequestBuilder {
2478 client: self.0.clone(),
2479 organization: organization.into(),
2480 project: project.into(),
2481 definition_id,
2482 comment: None,
2483 force_delete: None,
2484 }
2485 }
2486 #[doc = "Get revision history for a release definition"]
2487 #[doc = ""]
2488 #[doc = "Arguments:"]
2489 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2490 #[doc = "* `project`: Project ID or project name"]
2491 #[doc = "* `definition_id`: Id of the definition."]
2492 pub fn get_release_definition_history(
2493 &self,
2494 organization: impl Into<String>,
2495 project: impl Into<String>,
2496 definition_id: i32,
2497 ) -> get_release_definition_history::RequestBuilder {
2498 get_release_definition_history::RequestBuilder {
2499 client: self.0.clone(),
2500 organization: organization.into(),
2501 project: project.into(),
2502 definition_id,
2503 }
2504 }
2505 #[doc = "Get release definition for a given definition_id and revision"]
2506 #[doc = ""]
2507 #[doc = "Arguments:"]
2508 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2509 #[doc = "* `project`: Project ID or project name"]
2510 #[doc = "* `definition_id`: Id of the definition."]
2511 #[doc = "* `revision`: Id of the revision."]
2512 pub fn get_definition_revision(
2513 &self,
2514 organization: impl Into<String>,
2515 project: impl Into<String>,
2516 definition_id: i32,
2517 revision: i32,
2518 ) -> get_definition_revision::RequestBuilder {
2519 get_definition_revision::RequestBuilder {
2520 client: self.0.clone(),
2521 organization: organization.into(),
2522 project: project.into(),
2523 definition_id,
2524 revision,
2525 }
2526 }
2527 }
2528 pub mod list {
2529 use super::models;
2530 #[cfg(not(target_arch = "wasm32"))]
2531 use futures::future::BoxFuture;
2532 #[cfg(target_arch = "wasm32")]
2533 use futures::future::LocalBoxFuture as BoxFuture;
2534 #[derive(Debug)]
2535 pub struct Response(azure_core::http::Response);
2536 impl Response {
2537 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseDefinitionList> {
2538 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2539 let body: models::ReleaseDefinitionList =
2540 serde_json::from_slice(&bytes).map_err(|e| {
2541 azure_core::error::Error::full(
2542 azure_core::error::ErrorKind::DataConversion,
2543 e,
2544 format!(
2545 "Failed to deserialize response:\n{}",
2546 String::from_utf8_lossy(&bytes)
2547 ),
2548 )
2549 })?;
2550 Ok(body)
2551 }
2552 pub fn into_raw_response(self) -> azure_core::http::Response {
2553 self.0
2554 }
2555 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2556 &self.0
2557 }
2558 }
2559 impl From<Response> for azure_core::http::Response {
2560 fn from(rsp: Response) -> Self {
2561 rsp.into_raw_response()
2562 }
2563 }
2564 impl AsRef<azure_core::http::Response> for Response {
2565 fn as_ref(&self) -> &azure_core::http::Response {
2566 self.as_raw_response()
2567 }
2568 }
2569 #[derive(Clone)]
2570 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2571 #[doc = r""]
2572 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2573 #[doc = r" parameters can be chained."]
2574 #[doc = r""]
2575 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2576 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2577 #[doc = r" executes the request and returns a `Result` with the parsed"]
2578 #[doc = r" response."]
2579 #[doc = r""]
2580 #[doc = r" If you need lower-level access to the raw response details"]
2581 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2582 #[doc = r" can finalize the request using the"]
2583 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2584 #[doc = r" that resolves to a lower-level [`Response`] value."]
2585 pub struct RequestBuilder {
2586 pub(crate) client: super::super::Client,
2587 pub(crate) organization: String,
2588 pub(crate) project: String,
2589 pub(crate) search_text: Option<String>,
2590 pub(crate) expand: Option<String>,
2591 pub(crate) artifact_type: Option<String>,
2592 pub(crate) artifact_source_id: Option<String>,
2593 pub(crate) top: Option<i32>,
2594 pub(crate) continuation_token: Option<String>,
2595 pub(crate) query_order: Option<String>,
2596 pub(crate) path: Option<String>,
2597 pub(crate) is_exact_name_match: Option<bool>,
2598 pub(crate) tag_filter: Option<String>,
2599 pub(crate) property_filters: Option<String>,
2600 pub(crate) definition_id_filter: Option<String>,
2601 pub(crate) is_deleted: Option<bool>,
2602 pub(crate) search_text_contains_folder_name: Option<bool>,
2603 }
2604 impl RequestBuilder {
2605 #[doc = "Get release definitions with names containing searchText."]
2606 pub fn search_text(mut self, search_text: impl Into<String>) -> Self {
2607 self.search_text = Some(search_text.into());
2608 self
2609 }
2610 #[doc = "The properties that should be expanded in the list of Release definitions."]
2611 pub fn expand(mut self, expand: impl Into<String>) -> Self {
2612 self.expand = Some(expand.into());
2613 self
2614 }
2615 #[doc = "Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."]
2616 pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self {
2617 self.artifact_type = Some(artifact_type.into());
2618 self
2619 }
2620 #[doc = "Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."]
2621 pub fn artifact_source_id(mut self, artifact_source_id: impl Into<String>) -> Self {
2622 self.artifact_source_id = Some(artifact_source_id.into());
2623 self
2624 }
2625 #[doc = "Number of release definitions to get."]
2626 pub fn top(mut self, top: i32) -> Self {
2627 self.top = Some(top);
2628 self
2629 }
2630 #[doc = "Gets the release definitions after the continuation token provided."]
2631 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
2632 self.continuation_token = Some(continuation_token.into());
2633 self
2634 }
2635 #[doc = "Gets the results in the defined order. Default is 'IdAscending'."]
2636 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
2637 self.query_order = Some(query_order.into());
2638 self
2639 }
2640 #[doc = "Gets the release definitions under the specified path."]
2641 pub fn path(mut self, path: impl Into<String>) -> Self {
2642 self.path = Some(path.into());
2643 self
2644 }
2645 #[doc = "'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'."]
2646 pub fn is_exact_name_match(mut self, is_exact_name_match: bool) -> Self {
2647 self.is_exact_name_match = Some(is_exact_name_match);
2648 self
2649 }
2650 #[doc = "A comma-delimited list of tags. Only release definitions with these tags will be returned."]
2651 pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self {
2652 self.tag_filter = Some(tag_filter.into());
2653 self
2654 }
2655 #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not."]
2656 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
2657 self.property_filters = Some(property_filters.into());
2658 self
2659 }
2660 #[doc = "A comma-delimited list of release definitions to retrieve."]
2661 pub fn definition_id_filter(mut self, definition_id_filter: impl Into<String>) -> Self {
2662 self.definition_id_filter = Some(definition_id_filter.into());
2663 self
2664 }
2665 #[doc = "'true' to get release definitions that has been deleted. Default is 'false'"]
2666 pub fn is_deleted(mut self, is_deleted: bool) -> Self {
2667 self.is_deleted = Some(is_deleted);
2668 self
2669 }
2670 #[doc = "'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'."]
2671 pub fn search_text_contains_folder_name(
2672 mut self,
2673 search_text_contains_folder_name: bool,
2674 ) -> Self {
2675 self.search_text_contains_folder_name = Some(search_text_contains_folder_name);
2676 self
2677 }
2678 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2679 #[doc = ""]
2680 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2681 #[doc = "However, this function can provide more flexibility when required."]
2682 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2683 Box::pin({
2684 let this = self.clone();
2685 async move {
2686 let url = this.url()?;
2687 let mut req =
2688 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2689 if let Some(auth_header) = this
2690 .client
2691 .token_credential()
2692 .http_authorization_header(&this.client.scopes())
2693 .await?
2694 {
2695 req.insert_header(
2696 azure_core::http::headers::AUTHORIZATION,
2697 auth_header,
2698 );
2699 }
2700 if let Some(search_text) = &this.search_text {
2701 req.url_mut()
2702 .query_pairs_mut()
2703 .append_pair("searchText", search_text);
2704 }
2705 if let Some(expand) = &this.expand {
2706 req.url_mut()
2707 .query_pairs_mut()
2708 .append_pair("$expand", expand);
2709 }
2710 if let Some(artifact_type) = &this.artifact_type {
2711 req.url_mut()
2712 .query_pairs_mut()
2713 .append_pair("artifactType", artifact_type);
2714 }
2715 if let Some(artifact_source_id) = &this.artifact_source_id {
2716 req.url_mut()
2717 .query_pairs_mut()
2718 .append_pair("artifactSourceId", artifact_source_id);
2719 }
2720 if let Some(top) = &this.top {
2721 req.url_mut()
2722 .query_pairs_mut()
2723 .append_pair("$top", &top.to_string());
2724 }
2725 if let Some(continuation_token) = &this.continuation_token {
2726 req.url_mut()
2727 .query_pairs_mut()
2728 .append_pair("continuationToken", continuation_token);
2729 }
2730 if let Some(query_order) = &this.query_order {
2731 req.url_mut()
2732 .query_pairs_mut()
2733 .append_pair("queryOrder", query_order);
2734 }
2735 if let Some(path) = &this.path {
2736 req.url_mut().query_pairs_mut().append_pair("path", path);
2737 }
2738 if let Some(is_exact_name_match) = &this.is_exact_name_match {
2739 req.url_mut()
2740 .query_pairs_mut()
2741 .append_pair("isExactNameMatch", &is_exact_name_match.to_string());
2742 }
2743 if let Some(tag_filter) = &this.tag_filter {
2744 req.url_mut()
2745 .query_pairs_mut()
2746 .append_pair("tagFilter", tag_filter);
2747 }
2748 if let Some(property_filters) = &this.property_filters {
2749 req.url_mut()
2750 .query_pairs_mut()
2751 .append_pair("propertyFilters", property_filters);
2752 }
2753 if let Some(definition_id_filter) = &this.definition_id_filter {
2754 req.url_mut()
2755 .query_pairs_mut()
2756 .append_pair("definitionIdFilter", definition_id_filter);
2757 }
2758 if let Some(is_deleted) = &this.is_deleted {
2759 req.url_mut()
2760 .query_pairs_mut()
2761 .append_pair("isDeleted", &is_deleted.to_string());
2762 }
2763 if let Some(search_text_contains_folder_name) =
2764 &this.search_text_contains_folder_name
2765 {
2766 req.url_mut().query_pairs_mut().append_pair(
2767 "searchTextContainsFolderName",
2768 &search_text_contains_folder_name.to_string(),
2769 );
2770 }
2771 let req_body = azure_core::Bytes::new();
2772 req.set_body(req_body);
2773 Ok(Response(this.client.send(&mut req).await?))
2774 }
2775 })
2776 }
2777 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2778 let mut url = azure_core::http::Url::parse(&format!(
2779 "{}/{}/{}/_apis/release/definitions",
2780 self.client.endpoint(),
2781 &self.organization,
2782 &self.project
2783 ))?;
2784 let has_api_version_already = url
2785 .query_pairs()
2786 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2787 if !has_api_version_already {
2788 url.query_pairs_mut().append_pair(
2789 azure_core::http::headers::query_param::API_VERSION,
2790 "7.1-preview",
2791 );
2792 }
2793 Ok(url)
2794 }
2795 }
2796 impl std::future::IntoFuture for RequestBuilder {
2797 type Output = azure_core::Result<models::ReleaseDefinitionList>;
2798 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseDefinitionList>>;
2799 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2800 #[doc = ""]
2801 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2802 #[doc = ""]
2803 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2804 fn into_future(self) -> Self::IntoFuture {
2805 Box::pin(async move { self.send().await?.into_raw_body().await })
2806 }
2807 }
2808 }
2809 pub mod create {
2810 use super::models;
2811 #[cfg(not(target_arch = "wasm32"))]
2812 use futures::future::BoxFuture;
2813 #[cfg(target_arch = "wasm32")]
2814 use futures::future::LocalBoxFuture as BoxFuture;
2815 #[derive(Debug)]
2816 pub struct Response(azure_core::http::Response);
2817 impl Response {
2818 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseDefinition> {
2819 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2820 let body: models::ReleaseDefinition =
2821 serde_json::from_slice(&bytes).map_err(|e| {
2822 azure_core::error::Error::full(
2823 azure_core::error::ErrorKind::DataConversion,
2824 e,
2825 format!(
2826 "Failed to deserialize response:\n{}",
2827 String::from_utf8_lossy(&bytes)
2828 ),
2829 )
2830 })?;
2831 Ok(body)
2832 }
2833 pub fn into_raw_response(self) -> azure_core::http::Response {
2834 self.0
2835 }
2836 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2837 &self.0
2838 }
2839 }
2840 impl From<Response> for azure_core::http::Response {
2841 fn from(rsp: Response) -> Self {
2842 rsp.into_raw_response()
2843 }
2844 }
2845 impl AsRef<azure_core::http::Response> for Response {
2846 fn as_ref(&self) -> &azure_core::http::Response {
2847 self.as_raw_response()
2848 }
2849 }
2850 #[derive(Clone)]
2851 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2852 #[doc = r""]
2853 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2854 #[doc = r" parameters can be chained."]
2855 #[doc = r""]
2856 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2857 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2858 #[doc = r" executes the request and returns a `Result` with the parsed"]
2859 #[doc = r" response."]
2860 #[doc = r""]
2861 #[doc = r" If you need lower-level access to the raw response details"]
2862 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2863 #[doc = r" can finalize the request using the"]
2864 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2865 #[doc = r" that resolves to a lower-level [`Response`] value."]
2866 pub struct RequestBuilder {
2867 pub(crate) client: super::super::Client,
2868 pub(crate) organization: String,
2869 pub(crate) body: models::ReleaseDefinition,
2870 pub(crate) project: String,
2871 }
2872 impl RequestBuilder {
2873 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2874 #[doc = ""]
2875 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2876 #[doc = "However, this function can provide more flexibility when required."]
2877 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2878 Box::pin({
2879 let this = self.clone();
2880 async move {
2881 let url = this.url()?;
2882 let mut req =
2883 azure_core::http::Request::new(url, azure_core::http::Method::Post);
2884 if let Some(auth_header) = this
2885 .client
2886 .token_credential()
2887 .http_authorization_header(&this.client.scopes())
2888 .await?
2889 {
2890 req.insert_header(
2891 azure_core::http::headers::AUTHORIZATION,
2892 auth_header,
2893 );
2894 }
2895 req.insert_header("content-type", "application/json");
2896 let req_body = azure_core::json::to_json(&this.body)?;
2897 req.set_body(req_body);
2898 Ok(Response(this.client.send(&mut req).await?))
2899 }
2900 })
2901 }
2902 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2903 let mut url = azure_core::http::Url::parse(&format!(
2904 "{}/{}/{}/_apis/release/definitions",
2905 self.client.endpoint(),
2906 &self.organization,
2907 &self.project
2908 ))?;
2909 let has_api_version_already = url
2910 .query_pairs()
2911 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2912 if !has_api_version_already {
2913 url.query_pairs_mut().append_pair(
2914 azure_core::http::headers::query_param::API_VERSION,
2915 "7.1-preview",
2916 );
2917 }
2918 Ok(url)
2919 }
2920 }
2921 impl std::future::IntoFuture for RequestBuilder {
2922 type Output = azure_core::Result<models::ReleaseDefinition>;
2923 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
2924 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2925 #[doc = ""]
2926 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2927 #[doc = ""]
2928 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2929 fn into_future(self) -> Self::IntoFuture {
2930 Box::pin(async move { self.send().await?.into_raw_body().await })
2931 }
2932 }
2933 }
2934 pub mod update {
2935 use super::models;
2936 #[cfg(not(target_arch = "wasm32"))]
2937 use futures::future::BoxFuture;
2938 #[cfg(target_arch = "wasm32")]
2939 use futures::future::LocalBoxFuture as BoxFuture;
2940 #[derive(Debug)]
2941 pub struct Response(azure_core::http::Response);
2942 impl Response {
2943 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseDefinition> {
2944 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2945 let body: models::ReleaseDefinition =
2946 serde_json::from_slice(&bytes).map_err(|e| {
2947 azure_core::error::Error::full(
2948 azure_core::error::ErrorKind::DataConversion,
2949 e,
2950 format!(
2951 "Failed to deserialize response:\n{}",
2952 String::from_utf8_lossy(&bytes)
2953 ),
2954 )
2955 })?;
2956 Ok(body)
2957 }
2958 pub fn into_raw_response(self) -> azure_core::http::Response {
2959 self.0
2960 }
2961 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2962 &self.0
2963 }
2964 }
2965 impl From<Response> for azure_core::http::Response {
2966 fn from(rsp: Response) -> Self {
2967 rsp.into_raw_response()
2968 }
2969 }
2970 impl AsRef<azure_core::http::Response> for Response {
2971 fn as_ref(&self) -> &azure_core::http::Response {
2972 self.as_raw_response()
2973 }
2974 }
2975 #[derive(Clone)]
2976 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2977 #[doc = r""]
2978 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2979 #[doc = r" parameters can be chained."]
2980 #[doc = r""]
2981 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2982 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2983 #[doc = r" executes the request and returns a `Result` with the parsed"]
2984 #[doc = r" response."]
2985 #[doc = r""]
2986 #[doc = r" If you need lower-level access to the raw response details"]
2987 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2988 #[doc = r" can finalize the request using the"]
2989 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2990 #[doc = r" that resolves to a lower-level [`Response`] value."]
2991 pub struct RequestBuilder {
2992 pub(crate) client: super::super::Client,
2993 pub(crate) organization: String,
2994 pub(crate) body: models::ReleaseDefinition,
2995 pub(crate) project: String,
2996 }
2997 impl RequestBuilder {
2998 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2999 #[doc = ""]
3000 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3001 #[doc = "However, this function can provide more flexibility when required."]
3002 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3003 Box::pin({
3004 let this = self.clone();
3005 async move {
3006 let url = this.url()?;
3007 let mut req =
3008 azure_core::http::Request::new(url, azure_core::http::Method::Put);
3009 if let Some(auth_header) = this
3010 .client
3011 .token_credential()
3012 .http_authorization_header(&this.client.scopes())
3013 .await?
3014 {
3015 req.insert_header(
3016 azure_core::http::headers::AUTHORIZATION,
3017 auth_header,
3018 );
3019 }
3020 req.insert_header("content-type", "application/json");
3021 let req_body = azure_core::json::to_json(&this.body)?;
3022 req.set_body(req_body);
3023 Ok(Response(this.client.send(&mut req).await?))
3024 }
3025 })
3026 }
3027 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3028 let mut url = azure_core::http::Url::parse(&format!(
3029 "{}/{}/{}/_apis/release/definitions",
3030 self.client.endpoint(),
3031 &self.organization,
3032 &self.project
3033 ))?;
3034 let has_api_version_already = url
3035 .query_pairs()
3036 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3037 if !has_api_version_already {
3038 url.query_pairs_mut().append_pair(
3039 azure_core::http::headers::query_param::API_VERSION,
3040 "7.1-preview",
3041 );
3042 }
3043 Ok(url)
3044 }
3045 }
3046 impl std::future::IntoFuture for RequestBuilder {
3047 type Output = azure_core::Result<models::ReleaseDefinition>;
3048 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
3049 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3050 #[doc = ""]
3051 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3052 #[doc = ""]
3053 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3054 fn into_future(self) -> Self::IntoFuture {
3055 Box::pin(async move { self.send().await?.into_raw_body().await })
3056 }
3057 }
3058 }
3059 pub mod get {
3060 use super::models;
3061 #[cfg(not(target_arch = "wasm32"))]
3062 use futures::future::BoxFuture;
3063 #[cfg(target_arch = "wasm32")]
3064 use futures::future::LocalBoxFuture as BoxFuture;
3065 #[derive(Debug)]
3066 pub struct Response(azure_core::http::Response);
3067 impl Response {
3068 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseDefinition> {
3069 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3070 let body: models::ReleaseDefinition =
3071 serde_json::from_slice(&bytes).map_err(|e| {
3072 azure_core::error::Error::full(
3073 azure_core::error::ErrorKind::DataConversion,
3074 e,
3075 format!(
3076 "Failed to deserialize response:\n{}",
3077 String::from_utf8_lossy(&bytes)
3078 ),
3079 )
3080 })?;
3081 Ok(body)
3082 }
3083 pub fn into_raw_response(self) -> azure_core::http::Response {
3084 self.0
3085 }
3086 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3087 &self.0
3088 }
3089 }
3090 impl From<Response> for azure_core::http::Response {
3091 fn from(rsp: Response) -> Self {
3092 rsp.into_raw_response()
3093 }
3094 }
3095 impl AsRef<azure_core::http::Response> for Response {
3096 fn as_ref(&self) -> &azure_core::http::Response {
3097 self.as_raw_response()
3098 }
3099 }
3100 #[derive(Clone)]
3101 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3102 #[doc = r""]
3103 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3104 #[doc = r" parameters can be chained."]
3105 #[doc = r""]
3106 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3107 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3108 #[doc = r" executes the request and returns a `Result` with the parsed"]
3109 #[doc = r" response."]
3110 #[doc = r""]
3111 #[doc = r" If you need lower-level access to the raw response details"]
3112 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3113 #[doc = r" can finalize the request using the"]
3114 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3115 #[doc = r" that resolves to a lower-level [`Response`] value."]
3116 pub struct RequestBuilder {
3117 pub(crate) client: super::super::Client,
3118 pub(crate) organization: String,
3119 pub(crate) project: String,
3120 pub(crate) definition_id: i32,
3121 pub(crate) property_filters: Option<String>,
3122 }
3123 impl RequestBuilder {
3124 #[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included."]
3125 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
3126 self.property_filters = Some(property_filters.into());
3127 self
3128 }
3129 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3130 #[doc = ""]
3131 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3132 #[doc = "However, this function can provide more flexibility when required."]
3133 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3134 Box::pin({
3135 let this = self.clone();
3136 async move {
3137 let url = this.url()?;
3138 let mut req =
3139 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3140 if let Some(auth_header) = this
3141 .client
3142 .token_credential()
3143 .http_authorization_header(&this.client.scopes())
3144 .await?
3145 {
3146 req.insert_header(
3147 azure_core::http::headers::AUTHORIZATION,
3148 auth_header,
3149 );
3150 }
3151 if let Some(property_filters) = &this.property_filters {
3152 req.url_mut()
3153 .query_pairs_mut()
3154 .append_pair("propertyFilters", property_filters);
3155 }
3156 let req_body = azure_core::Bytes::new();
3157 req.set_body(req_body);
3158 Ok(Response(this.client.send(&mut req).await?))
3159 }
3160 })
3161 }
3162 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3163 let mut url = azure_core::http::Url::parse(&format!(
3164 "{}/{}/{}/_apis/release/definitions/{}",
3165 self.client.endpoint(),
3166 &self.organization,
3167 &self.project,
3168 &self.definition_id
3169 ))?;
3170 let has_api_version_already = url
3171 .query_pairs()
3172 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3173 if !has_api_version_already {
3174 url.query_pairs_mut().append_pair(
3175 azure_core::http::headers::query_param::API_VERSION,
3176 "7.1-preview",
3177 );
3178 }
3179 Ok(url)
3180 }
3181 }
3182 impl std::future::IntoFuture for RequestBuilder {
3183 type Output = azure_core::Result<models::ReleaseDefinition>;
3184 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
3185 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3186 #[doc = ""]
3187 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3188 #[doc = ""]
3189 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3190 fn into_future(self) -> Self::IntoFuture {
3191 Box::pin(async move { self.send().await?.into_raw_body().await })
3192 }
3193 }
3194 }
3195 pub mod delete {
3196 use super::models;
3197 #[cfg(not(target_arch = "wasm32"))]
3198 use futures::future::BoxFuture;
3199 #[cfg(target_arch = "wasm32")]
3200 use futures::future::LocalBoxFuture as BoxFuture;
3201 #[derive(Debug)]
3202 pub struct Response(azure_core::http::Response);
3203 impl Response {
3204 pub fn into_raw_response(self) -> azure_core::http::Response {
3205 self.0
3206 }
3207 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3208 &self.0
3209 }
3210 }
3211 impl From<Response> for azure_core::http::Response {
3212 fn from(rsp: Response) -> Self {
3213 rsp.into_raw_response()
3214 }
3215 }
3216 impl AsRef<azure_core::http::Response> for Response {
3217 fn as_ref(&self) -> &azure_core::http::Response {
3218 self.as_raw_response()
3219 }
3220 }
3221 #[derive(Clone)]
3222 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3223 #[doc = r""]
3224 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3225 #[doc = r" parameters can be chained."]
3226 #[doc = r""]
3227 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3228 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3229 #[doc = r" executes the request and returns a `Result` with the parsed"]
3230 #[doc = r" response."]
3231 #[doc = r""]
3232 #[doc = r" If you need lower-level access to the raw response details"]
3233 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3234 #[doc = r" can finalize the request using the"]
3235 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3236 #[doc = r" that resolves to a lower-level [`Response`] value."]
3237 pub struct RequestBuilder {
3238 pub(crate) client: super::super::Client,
3239 pub(crate) organization: String,
3240 pub(crate) project: String,
3241 pub(crate) definition_id: i32,
3242 pub(crate) comment: Option<String>,
3243 pub(crate) force_delete: Option<bool>,
3244 }
3245 impl RequestBuilder {
3246 #[doc = "Comment for deleting a release definition."]
3247 pub fn comment(mut self, comment: impl Into<String>) -> Self {
3248 self.comment = Some(comment.into());
3249 self
3250 }
3251 #[doc = "'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'."]
3252 pub fn force_delete(mut self, force_delete: bool) -> Self {
3253 self.force_delete = Some(force_delete);
3254 self
3255 }
3256 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3257 #[doc = ""]
3258 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3259 #[doc = "However, this function can provide more flexibility when required."]
3260 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3261 Box::pin({
3262 let this = self.clone();
3263 async move {
3264 let url = this.url()?;
3265 let mut req =
3266 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
3267 if let Some(auth_header) = this
3268 .client
3269 .token_credential()
3270 .http_authorization_header(&this.client.scopes())
3271 .await?
3272 {
3273 req.insert_header(
3274 azure_core::http::headers::AUTHORIZATION,
3275 auth_header,
3276 );
3277 }
3278 if let Some(comment) = &this.comment {
3279 req.url_mut()
3280 .query_pairs_mut()
3281 .append_pair("comment", comment);
3282 }
3283 if let Some(force_delete) = &this.force_delete {
3284 req.url_mut()
3285 .query_pairs_mut()
3286 .append_pair("forceDelete", &force_delete.to_string());
3287 }
3288 let req_body = azure_core::Bytes::new();
3289 req.set_body(req_body);
3290 Ok(Response(this.client.send(&mut req).await?))
3291 }
3292 })
3293 }
3294 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3295 let mut url = azure_core::http::Url::parse(&format!(
3296 "{}/{}/{}/_apis/release/definitions/{}",
3297 self.client.endpoint(),
3298 &self.organization,
3299 &self.project,
3300 &self.definition_id
3301 ))?;
3302 let has_api_version_already = url
3303 .query_pairs()
3304 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3305 if !has_api_version_already {
3306 url.query_pairs_mut().append_pair(
3307 azure_core::http::headers::query_param::API_VERSION,
3308 "7.1-preview",
3309 );
3310 }
3311 Ok(url)
3312 }
3313 }
3314 impl std::future::IntoFuture for RequestBuilder {
3315 type Output = azure_core::Result<()>;
3316 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
3317 #[doc = "Returns a future that sends the request and waits for the response."]
3318 #[doc = ""]
3319 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3320 #[doc = ""]
3321 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3322 fn into_future(self) -> Self::IntoFuture {
3323 Box::pin(async move {
3324 let _rsp = self.send().await?;
3325 Ok(())
3326 })
3327 }
3328 }
3329 }
3330 pub mod get_release_definition_history {
3331 use super::models;
3332 #[cfg(not(target_arch = "wasm32"))]
3333 use futures::future::BoxFuture;
3334 #[cfg(target_arch = "wasm32")]
3335 use futures::future::LocalBoxFuture as BoxFuture;
3336 #[derive(Debug)]
3337 pub struct Response(azure_core::http::Response);
3338 impl Response {
3339 pub async fn into_raw_body(
3340 self,
3341 ) -> azure_core::Result<models::ReleaseDefinitionRevisionList> {
3342 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3343 let body: models::ReleaseDefinitionRevisionList = serde_json::from_slice(&bytes)
3344 .map_err(|e| {
3345 azure_core::error::Error::full(
3346 azure_core::error::ErrorKind::DataConversion,
3347 e,
3348 format!(
3349 "Failed to deserialize response:\n{}",
3350 String::from_utf8_lossy(&bytes)
3351 ),
3352 )
3353 })?;
3354 Ok(body)
3355 }
3356 pub fn into_raw_response(self) -> azure_core::http::Response {
3357 self.0
3358 }
3359 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3360 &self.0
3361 }
3362 }
3363 impl From<Response> for azure_core::http::Response {
3364 fn from(rsp: Response) -> Self {
3365 rsp.into_raw_response()
3366 }
3367 }
3368 impl AsRef<azure_core::http::Response> for Response {
3369 fn as_ref(&self) -> &azure_core::http::Response {
3370 self.as_raw_response()
3371 }
3372 }
3373 #[derive(Clone)]
3374 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3375 #[doc = r""]
3376 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3377 #[doc = r" parameters can be chained."]
3378 #[doc = r""]
3379 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3380 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3381 #[doc = r" executes the request and returns a `Result` with the parsed"]
3382 #[doc = r" response."]
3383 #[doc = r""]
3384 #[doc = r" If you need lower-level access to the raw response details"]
3385 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3386 #[doc = r" can finalize the request using the"]
3387 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3388 #[doc = r" that resolves to a lower-level [`Response`] value."]
3389 pub struct RequestBuilder {
3390 pub(crate) client: super::super::Client,
3391 pub(crate) organization: String,
3392 pub(crate) project: String,
3393 pub(crate) definition_id: i32,
3394 }
3395 impl RequestBuilder {
3396 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3397 #[doc = ""]
3398 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3399 #[doc = "However, this function can provide more flexibility when required."]
3400 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3401 Box::pin({
3402 let this = self.clone();
3403 async move {
3404 let url = this.url()?;
3405 let mut req =
3406 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3407 if let Some(auth_header) = this
3408 .client
3409 .token_credential()
3410 .http_authorization_header(&this.client.scopes())
3411 .await?
3412 {
3413 req.insert_header(
3414 azure_core::http::headers::AUTHORIZATION,
3415 auth_header,
3416 );
3417 }
3418 let req_body = azure_core::Bytes::new();
3419 req.set_body(req_body);
3420 Ok(Response(this.client.send(&mut req).await?))
3421 }
3422 })
3423 }
3424 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3425 let mut url = azure_core::http::Url::parse(&format!(
3426 "{}/{}/{}/_apis/Release/definitions/{}/revisions",
3427 self.client.endpoint(),
3428 &self.organization,
3429 &self.project,
3430 &self.definition_id
3431 ))?;
3432 let has_api_version_already = url
3433 .query_pairs()
3434 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3435 if !has_api_version_already {
3436 url.query_pairs_mut().append_pair(
3437 azure_core::http::headers::query_param::API_VERSION,
3438 "7.1-preview",
3439 );
3440 }
3441 Ok(url)
3442 }
3443 }
3444 impl std::future::IntoFuture for RequestBuilder {
3445 type Output = azure_core::Result<models::ReleaseDefinitionRevisionList>;
3446 type IntoFuture =
3447 BoxFuture<'static, azure_core::Result<models::ReleaseDefinitionRevisionList>>;
3448 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3449 #[doc = ""]
3450 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3451 #[doc = ""]
3452 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3453 fn into_future(self) -> Self::IntoFuture {
3454 Box::pin(async move { self.send().await?.into_raw_body().await })
3455 }
3456 }
3457 }
3458 pub mod get_definition_revision {
3459 use super::models;
3460 #[cfg(not(target_arch = "wasm32"))]
3461 use futures::future::BoxFuture;
3462 #[cfg(target_arch = "wasm32")]
3463 use futures::future::LocalBoxFuture as BoxFuture;
3464 #[derive(Debug)]
3465 pub struct Response(azure_core::http::Response);
3466 impl Response {
3467 pub async fn into_raw_body(self) -> azure_core::Result<String> {
3468 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3469 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
3470 azure_core::error::Error::full(
3471 azure_core::error::ErrorKind::DataConversion,
3472 e,
3473 format!(
3474 "Failed to deserialize response:\n{}",
3475 String::from_utf8_lossy(&bytes)
3476 ),
3477 )
3478 })?;
3479 Ok(body)
3480 }
3481 pub fn into_raw_response(self) -> azure_core::http::Response {
3482 self.0
3483 }
3484 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3485 &self.0
3486 }
3487 }
3488 impl From<Response> for azure_core::http::Response {
3489 fn from(rsp: Response) -> Self {
3490 rsp.into_raw_response()
3491 }
3492 }
3493 impl AsRef<azure_core::http::Response> for Response {
3494 fn as_ref(&self) -> &azure_core::http::Response {
3495 self.as_raw_response()
3496 }
3497 }
3498 #[derive(Clone)]
3499 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3500 #[doc = r""]
3501 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3502 #[doc = r" parameters can be chained."]
3503 #[doc = r""]
3504 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3505 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3506 #[doc = r" executes the request and returns a `Result` with the parsed"]
3507 #[doc = r" response."]
3508 #[doc = r""]
3509 #[doc = r" If you need lower-level access to the raw response details"]
3510 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3511 #[doc = r" can finalize the request using the"]
3512 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3513 #[doc = r" that resolves to a lower-level [`Response`] value."]
3514 pub struct RequestBuilder {
3515 pub(crate) client: super::super::Client,
3516 pub(crate) organization: String,
3517 pub(crate) project: String,
3518 pub(crate) definition_id: i32,
3519 pub(crate) revision: i32,
3520 }
3521 impl RequestBuilder {
3522 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3523 #[doc = ""]
3524 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3525 #[doc = "However, this function can provide more flexibility when required."]
3526 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3527 Box::pin({
3528 let this = self.clone();
3529 async move {
3530 let url = this.url()?;
3531 let mut req =
3532 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3533 if let Some(auth_header) = this
3534 .client
3535 .token_credential()
3536 .http_authorization_header(&this.client.scopes())
3537 .await?
3538 {
3539 req.insert_header(
3540 azure_core::http::headers::AUTHORIZATION,
3541 auth_header,
3542 );
3543 }
3544 let req_body = azure_core::Bytes::new();
3545 req.set_body(req_body);
3546 Ok(Response(this.client.send(&mut req).await?))
3547 }
3548 })
3549 }
3550 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3551 let mut url = azure_core::http::Url::parse(&format!(
3552 "{}/{}/{}/_apis/Release/definitions/{}/revisions/{}",
3553 self.client.endpoint(),
3554 &self.organization,
3555 &self.project,
3556 &self.definition_id,
3557 &self.revision
3558 ))?;
3559 let has_api_version_already = url
3560 .query_pairs()
3561 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3562 if !has_api_version_already {
3563 url.query_pairs_mut().append_pair(
3564 azure_core::http::headers::query_param::API_VERSION,
3565 "7.1-preview",
3566 );
3567 }
3568 Ok(url)
3569 }
3570 }
3571 impl std::future::IntoFuture for RequestBuilder {
3572 type Output = azure_core::Result<String>;
3573 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
3574 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3575 #[doc = ""]
3576 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3577 #[doc = ""]
3578 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3579 fn into_future(self) -> Self::IntoFuture {
3580 Box::pin(async move { self.send().await?.into_raw_body().await })
3581 }
3582 }
3583 }
3584}
3585pub mod deployments {
3586 use super::models;
3587 #[cfg(not(target_arch = "wasm32"))]
3588 use futures::future::BoxFuture;
3589 #[cfg(target_arch = "wasm32")]
3590 use futures::future::LocalBoxFuture as BoxFuture;
3591 pub struct Client(pub(crate) super::Client);
3592 impl Client {
3593 #[doc = "Arguments:"]
3594 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3595 #[doc = "* `project`: Project ID or project name"]
3596 pub fn list(
3597 &self,
3598 organization: impl Into<String>,
3599 project: impl Into<String>,
3600 ) -> list::RequestBuilder {
3601 list::RequestBuilder {
3602 client: self.0.clone(),
3603 organization: organization.into(),
3604 project: project.into(),
3605 definition_id: None,
3606 definition_environment_id: None,
3607 created_by: None,
3608 min_modified_time: None,
3609 max_modified_time: None,
3610 deployment_status: None,
3611 operation_status: None,
3612 latest_attempts_only: None,
3613 query_order: None,
3614 top: None,
3615 continuation_token: None,
3616 created_for: None,
3617 min_started_time: None,
3618 max_started_time: None,
3619 source_branch: None,
3620 }
3621 }
3622 }
3623 pub mod list {
3624 use super::models;
3625 #[cfg(not(target_arch = "wasm32"))]
3626 use futures::future::BoxFuture;
3627 #[cfg(target_arch = "wasm32")]
3628 use futures::future::LocalBoxFuture as BoxFuture;
3629 #[derive(Debug)]
3630 pub struct Response(azure_core::http::Response);
3631 impl Response {
3632 pub async fn into_raw_body(self) -> azure_core::Result<models::DeploymentList> {
3633 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3634 let body: models::DeploymentList = serde_json::from_slice(&bytes).map_err(|e| {
3635 azure_core::error::Error::full(
3636 azure_core::error::ErrorKind::DataConversion,
3637 e,
3638 format!(
3639 "Failed to deserialize response:\n{}",
3640 String::from_utf8_lossy(&bytes)
3641 ),
3642 )
3643 })?;
3644 Ok(body)
3645 }
3646 pub fn into_raw_response(self) -> azure_core::http::Response {
3647 self.0
3648 }
3649 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3650 &self.0
3651 }
3652 }
3653 impl From<Response> for azure_core::http::Response {
3654 fn from(rsp: Response) -> Self {
3655 rsp.into_raw_response()
3656 }
3657 }
3658 impl AsRef<azure_core::http::Response> for Response {
3659 fn as_ref(&self) -> &azure_core::http::Response {
3660 self.as_raw_response()
3661 }
3662 }
3663 #[derive(Clone)]
3664 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3665 #[doc = r""]
3666 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3667 #[doc = r" parameters can be chained."]
3668 #[doc = r""]
3669 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3670 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3671 #[doc = r" executes the request and returns a `Result` with the parsed"]
3672 #[doc = r" response."]
3673 #[doc = r""]
3674 #[doc = r" If you need lower-level access to the raw response details"]
3675 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3676 #[doc = r" can finalize the request using the"]
3677 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3678 #[doc = r" that resolves to a lower-level [`Response`] value."]
3679 pub struct RequestBuilder {
3680 pub(crate) client: super::super::Client,
3681 pub(crate) organization: String,
3682 pub(crate) project: String,
3683 pub(crate) definition_id: Option<i32>,
3684 pub(crate) definition_environment_id: Option<i32>,
3685 pub(crate) created_by: Option<String>,
3686 pub(crate) min_modified_time: Option<time::OffsetDateTime>,
3687 pub(crate) max_modified_time: Option<time::OffsetDateTime>,
3688 pub(crate) deployment_status: Option<String>,
3689 pub(crate) operation_status: Option<String>,
3690 pub(crate) latest_attempts_only: Option<bool>,
3691 pub(crate) query_order: Option<String>,
3692 pub(crate) top: Option<i32>,
3693 pub(crate) continuation_token: Option<i32>,
3694 pub(crate) created_for: Option<String>,
3695 pub(crate) min_started_time: Option<time::OffsetDateTime>,
3696 pub(crate) max_started_time: Option<time::OffsetDateTime>,
3697 pub(crate) source_branch: Option<String>,
3698 }
3699 impl RequestBuilder {
3700 pub fn definition_id(mut self, definition_id: i32) -> Self {
3701 self.definition_id = Some(definition_id);
3702 self
3703 }
3704 pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self {
3705 self.definition_environment_id = Some(definition_environment_id);
3706 self
3707 }
3708 pub fn created_by(mut self, created_by: impl Into<String>) -> Self {
3709 self.created_by = Some(created_by.into());
3710 self
3711 }
3712 pub fn min_modified_time(
3713 mut self,
3714 min_modified_time: impl Into<time::OffsetDateTime>,
3715 ) -> Self {
3716 self.min_modified_time = Some(min_modified_time.into());
3717 self
3718 }
3719 pub fn max_modified_time(
3720 mut self,
3721 max_modified_time: impl Into<time::OffsetDateTime>,
3722 ) -> Self {
3723 self.max_modified_time = Some(max_modified_time.into());
3724 self
3725 }
3726 pub fn deployment_status(mut self, deployment_status: impl Into<String>) -> Self {
3727 self.deployment_status = Some(deployment_status.into());
3728 self
3729 }
3730 pub fn operation_status(mut self, operation_status: impl Into<String>) -> Self {
3731 self.operation_status = Some(operation_status.into());
3732 self
3733 }
3734 pub fn latest_attempts_only(mut self, latest_attempts_only: bool) -> Self {
3735 self.latest_attempts_only = Some(latest_attempts_only);
3736 self
3737 }
3738 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
3739 self.query_order = Some(query_order.into());
3740 self
3741 }
3742 pub fn top(mut self, top: i32) -> Self {
3743 self.top = Some(top);
3744 self
3745 }
3746 pub fn continuation_token(mut self, continuation_token: i32) -> Self {
3747 self.continuation_token = Some(continuation_token);
3748 self
3749 }
3750 pub fn created_for(mut self, created_for: impl Into<String>) -> Self {
3751 self.created_for = Some(created_for.into());
3752 self
3753 }
3754 pub fn min_started_time(
3755 mut self,
3756 min_started_time: impl Into<time::OffsetDateTime>,
3757 ) -> Self {
3758 self.min_started_time = Some(min_started_time.into());
3759 self
3760 }
3761 pub fn max_started_time(
3762 mut self,
3763 max_started_time: impl Into<time::OffsetDateTime>,
3764 ) -> Self {
3765 self.max_started_time = Some(max_started_time.into());
3766 self
3767 }
3768 pub fn source_branch(mut self, source_branch: impl Into<String>) -> Self {
3769 self.source_branch = Some(source_branch.into());
3770 self
3771 }
3772 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3773 #[doc = ""]
3774 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3775 #[doc = "However, this function can provide more flexibility when required."]
3776 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3777 Box::pin({
3778 let this = self.clone();
3779 async move {
3780 let url = this.url()?;
3781 let mut req =
3782 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3783 if let Some(auth_header) = this
3784 .client
3785 .token_credential()
3786 .http_authorization_header(&this.client.scopes())
3787 .await?
3788 {
3789 req.insert_header(
3790 azure_core::http::headers::AUTHORIZATION,
3791 auth_header,
3792 );
3793 }
3794 if let Some(definition_id) = &this.definition_id {
3795 req.url_mut()
3796 .query_pairs_mut()
3797 .append_pair("definitionId", &definition_id.to_string());
3798 }
3799 if let Some(definition_environment_id) = &this.definition_environment_id {
3800 req.url_mut().query_pairs_mut().append_pair(
3801 "definitionEnvironmentId",
3802 &definition_environment_id.to_string(),
3803 );
3804 }
3805 if let Some(created_by) = &this.created_by {
3806 req.url_mut()
3807 .query_pairs_mut()
3808 .append_pair("createdBy", created_by);
3809 }
3810 if let Some(min_modified_time) = &this.min_modified_time {
3811 req.url_mut()
3812 .query_pairs_mut()
3813 .append_pair("minModifiedTime", &min_modified_time.to_string());
3814 }
3815 if let Some(max_modified_time) = &this.max_modified_time {
3816 req.url_mut()
3817 .query_pairs_mut()
3818 .append_pair("maxModifiedTime", &max_modified_time.to_string());
3819 }
3820 if let Some(deployment_status) = &this.deployment_status {
3821 req.url_mut()
3822 .query_pairs_mut()
3823 .append_pair("deploymentStatus", deployment_status);
3824 }
3825 if let Some(operation_status) = &this.operation_status {
3826 req.url_mut()
3827 .query_pairs_mut()
3828 .append_pair("operationStatus", operation_status);
3829 }
3830 if let Some(latest_attempts_only) = &this.latest_attempts_only {
3831 req.url_mut().query_pairs_mut().append_pair(
3832 "latestAttemptsOnly",
3833 &latest_attempts_only.to_string(),
3834 );
3835 }
3836 if let Some(query_order) = &this.query_order {
3837 req.url_mut()
3838 .query_pairs_mut()
3839 .append_pair("queryOrder", query_order);
3840 }
3841 if let Some(top) = &this.top {
3842 req.url_mut()
3843 .query_pairs_mut()
3844 .append_pair("$top", &top.to_string());
3845 }
3846 if let Some(continuation_token) = &this.continuation_token {
3847 req.url_mut()
3848 .query_pairs_mut()
3849 .append_pair("continuationToken", &continuation_token.to_string());
3850 }
3851 if let Some(created_for) = &this.created_for {
3852 req.url_mut()
3853 .query_pairs_mut()
3854 .append_pair("createdFor", created_for);
3855 }
3856 if let Some(min_started_time) = &this.min_started_time {
3857 req.url_mut()
3858 .query_pairs_mut()
3859 .append_pair("minStartedTime", &min_started_time.to_string());
3860 }
3861 if let Some(max_started_time) = &this.max_started_time {
3862 req.url_mut()
3863 .query_pairs_mut()
3864 .append_pair("maxStartedTime", &max_started_time.to_string());
3865 }
3866 if let Some(source_branch) = &this.source_branch {
3867 req.url_mut()
3868 .query_pairs_mut()
3869 .append_pair("sourceBranch", source_branch);
3870 }
3871 let req_body = azure_core::Bytes::new();
3872 req.set_body(req_body);
3873 Ok(Response(this.client.send(&mut req).await?))
3874 }
3875 })
3876 }
3877 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3878 let mut url = azure_core::http::Url::parse(&format!(
3879 "{}/{}/{}/_apis/release/deployments",
3880 self.client.endpoint(),
3881 &self.organization,
3882 &self.project
3883 ))?;
3884 let has_api_version_already = url
3885 .query_pairs()
3886 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3887 if !has_api_version_already {
3888 url.query_pairs_mut().append_pair(
3889 azure_core::http::headers::query_param::API_VERSION,
3890 "7.1-preview",
3891 );
3892 }
3893 Ok(url)
3894 }
3895 }
3896 impl std::future::IntoFuture for RequestBuilder {
3897 type Output = azure_core::Result<models::DeploymentList>;
3898 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentList>>;
3899 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3900 #[doc = ""]
3901 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3902 #[doc = ""]
3903 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3904 fn into_future(self) -> Self::IntoFuture {
3905 Box::pin(async move { self.send().await?.into_raw_body().await })
3906 }
3907 }
3908 }
3909}
3910pub mod folders {
3911 use super::models;
3912 #[cfg(not(target_arch = "wasm32"))]
3913 use futures::future::BoxFuture;
3914 #[cfg(target_arch = "wasm32")]
3915 use futures::future::LocalBoxFuture as BoxFuture;
3916 pub struct Client(pub(crate) super::Client);
3917 impl Client {
3918 #[doc = "Gets folders."]
3919 #[doc = ""]
3920 #[doc = "Arguments:"]
3921 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3922 #[doc = "* `project`: Project ID or project name"]
3923 #[doc = "* `path`: Path of the folder."]
3924 pub fn list(
3925 &self,
3926 organization: impl Into<String>,
3927 project: impl Into<String>,
3928 path: impl Into<String>,
3929 ) -> list::RequestBuilder {
3930 list::RequestBuilder {
3931 client: self.0.clone(),
3932 organization: organization.into(),
3933 project: project.into(),
3934 path: path.into(),
3935 query_order: None,
3936 }
3937 }
3938 #[doc = "This method is no longer supported. Use CreateFolder with folder parameter API."]
3939 #[doc = ""]
3940 #[doc = "Arguments:"]
3941 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3942 #[doc = "* `body`: folder."]
3943 #[doc = "* `project`: Project ID or project name"]
3944 #[doc = "* `path`: Path of the folder."]
3945 pub fn create(
3946 &self,
3947 organization: impl Into<String>,
3948 body: impl Into<models::Folder>,
3949 project: impl Into<String>,
3950 path: impl Into<String>,
3951 ) -> create::RequestBuilder {
3952 create::RequestBuilder {
3953 client: self.0.clone(),
3954 organization: organization.into(),
3955 body: body.into(),
3956 project: project.into(),
3957 path: path.into(),
3958 }
3959 }
3960 #[doc = "Updates an existing folder at given existing path."]
3961 #[doc = ""]
3962 #[doc = "Arguments:"]
3963 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3964 #[doc = "* `body`: folder."]
3965 #[doc = "* `project`: Project ID or project name"]
3966 #[doc = "* `path`: Path of the folder to update."]
3967 pub fn update(
3968 &self,
3969 organization: impl Into<String>,
3970 body: impl Into<models::Folder>,
3971 project: impl Into<String>,
3972 path: impl Into<String>,
3973 ) -> update::RequestBuilder {
3974 update::RequestBuilder {
3975 client: self.0.clone(),
3976 organization: organization.into(),
3977 body: body.into(),
3978 project: project.into(),
3979 path: path.into(),
3980 }
3981 }
3982 #[doc = "Deletes a definition folder for given folder name and path and all it's existing definitions."]
3983 #[doc = ""]
3984 #[doc = "Arguments:"]
3985 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3986 #[doc = "* `project`: Project ID or project name"]
3987 #[doc = "* `path`: Path of the folder to delete."]
3988 pub fn delete(
3989 &self,
3990 organization: impl Into<String>,
3991 project: impl Into<String>,
3992 path: impl Into<String>,
3993 ) -> delete::RequestBuilder {
3994 delete::RequestBuilder {
3995 client: self.0.clone(),
3996 organization: organization.into(),
3997 project: project.into(),
3998 path: path.into(),
3999 }
4000 }
4001 }
4002 pub mod list {
4003 use super::models;
4004 #[cfg(not(target_arch = "wasm32"))]
4005 use futures::future::BoxFuture;
4006 #[cfg(target_arch = "wasm32")]
4007 use futures::future::LocalBoxFuture as BoxFuture;
4008 #[derive(Debug)]
4009 pub struct Response(azure_core::http::Response);
4010 impl Response {
4011 pub async fn into_raw_body(self) -> azure_core::Result<models::FolderList> {
4012 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4013 let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| {
4014 azure_core::error::Error::full(
4015 azure_core::error::ErrorKind::DataConversion,
4016 e,
4017 format!(
4018 "Failed to deserialize response:\n{}",
4019 String::from_utf8_lossy(&bytes)
4020 ),
4021 )
4022 })?;
4023 Ok(body)
4024 }
4025 pub fn into_raw_response(self) -> azure_core::http::Response {
4026 self.0
4027 }
4028 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4029 &self.0
4030 }
4031 }
4032 impl From<Response> for azure_core::http::Response {
4033 fn from(rsp: Response) -> Self {
4034 rsp.into_raw_response()
4035 }
4036 }
4037 impl AsRef<azure_core::http::Response> for Response {
4038 fn as_ref(&self) -> &azure_core::http::Response {
4039 self.as_raw_response()
4040 }
4041 }
4042 #[derive(Clone)]
4043 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4044 #[doc = r""]
4045 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4046 #[doc = r" parameters can be chained."]
4047 #[doc = r""]
4048 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4049 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4050 #[doc = r" executes the request and returns a `Result` with the parsed"]
4051 #[doc = r" response."]
4052 #[doc = r""]
4053 #[doc = r" If you need lower-level access to the raw response details"]
4054 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4055 #[doc = r" can finalize the request using the"]
4056 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4057 #[doc = r" that resolves to a lower-level [`Response`] value."]
4058 pub struct RequestBuilder {
4059 pub(crate) client: super::super::Client,
4060 pub(crate) organization: String,
4061 pub(crate) project: String,
4062 pub(crate) path: String,
4063 pub(crate) query_order: Option<String>,
4064 }
4065 impl RequestBuilder {
4066 #[doc = "Gets the results in the defined order. Default is 'None'."]
4067 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
4068 self.query_order = Some(query_order.into());
4069 self
4070 }
4071 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4072 #[doc = ""]
4073 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4074 #[doc = "However, this function can provide more flexibility when required."]
4075 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4076 Box::pin({
4077 let this = self.clone();
4078 async move {
4079 let url = this.url()?;
4080 let mut req =
4081 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4082 if let Some(auth_header) = this
4083 .client
4084 .token_credential()
4085 .http_authorization_header(&this.client.scopes())
4086 .await?
4087 {
4088 req.insert_header(
4089 azure_core::http::headers::AUTHORIZATION,
4090 auth_header,
4091 );
4092 }
4093 if let Some(query_order) = &this.query_order {
4094 req.url_mut()
4095 .query_pairs_mut()
4096 .append_pair("queryOrder", query_order);
4097 }
4098 let req_body = azure_core::Bytes::new();
4099 req.set_body(req_body);
4100 Ok(Response(this.client.send(&mut req).await?))
4101 }
4102 })
4103 }
4104 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4105 let mut url = azure_core::http::Url::parse(&format!(
4106 "{}/{}/{}/_apis/release/folders/{}",
4107 self.client.endpoint(),
4108 &self.organization,
4109 &self.project,
4110 &self.path
4111 ))?;
4112 let has_api_version_already = url
4113 .query_pairs()
4114 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4115 if !has_api_version_already {
4116 url.query_pairs_mut().append_pair(
4117 azure_core::http::headers::query_param::API_VERSION,
4118 "7.1-preview",
4119 );
4120 }
4121 Ok(url)
4122 }
4123 }
4124 impl std::future::IntoFuture for RequestBuilder {
4125 type Output = azure_core::Result<models::FolderList>;
4126 type IntoFuture = BoxFuture<'static, azure_core::Result<models::FolderList>>;
4127 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4128 #[doc = ""]
4129 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4130 #[doc = ""]
4131 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4132 fn into_future(self) -> Self::IntoFuture {
4133 Box::pin(async move { self.send().await?.into_raw_body().await })
4134 }
4135 }
4136 }
4137 pub mod create {
4138 use super::models;
4139 #[cfg(not(target_arch = "wasm32"))]
4140 use futures::future::BoxFuture;
4141 #[cfg(target_arch = "wasm32")]
4142 use futures::future::LocalBoxFuture as BoxFuture;
4143 #[derive(Debug)]
4144 pub struct Response(azure_core::http::Response);
4145 impl Response {
4146 pub async fn into_raw_body(self) -> azure_core::Result<models::Folder> {
4147 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4148 let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| {
4149 azure_core::error::Error::full(
4150 azure_core::error::ErrorKind::DataConversion,
4151 e,
4152 format!(
4153 "Failed to deserialize response:\n{}",
4154 String::from_utf8_lossy(&bytes)
4155 ),
4156 )
4157 })?;
4158 Ok(body)
4159 }
4160 pub fn into_raw_response(self) -> azure_core::http::Response {
4161 self.0
4162 }
4163 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4164 &self.0
4165 }
4166 }
4167 impl From<Response> for azure_core::http::Response {
4168 fn from(rsp: Response) -> Self {
4169 rsp.into_raw_response()
4170 }
4171 }
4172 impl AsRef<azure_core::http::Response> for Response {
4173 fn as_ref(&self) -> &azure_core::http::Response {
4174 self.as_raw_response()
4175 }
4176 }
4177 #[derive(Clone)]
4178 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4179 #[doc = r""]
4180 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4181 #[doc = r" parameters can be chained."]
4182 #[doc = r""]
4183 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4184 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4185 #[doc = r" executes the request and returns a `Result` with the parsed"]
4186 #[doc = r" response."]
4187 #[doc = r""]
4188 #[doc = r" If you need lower-level access to the raw response details"]
4189 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4190 #[doc = r" can finalize the request using the"]
4191 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4192 #[doc = r" that resolves to a lower-level [`Response`] value."]
4193 pub struct RequestBuilder {
4194 pub(crate) client: super::super::Client,
4195 pub(crate) organization: String,
4196 pub(crate) body: models::Folder,
4197 pub(crate) project: String,
4198 pub(crate) path: String,
4199 }
4200 impl RequestBuilder {
4201 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4202 #[doc = ""]
4203 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4204 #[doc = "However, this function can provide more flexibility when required."]
4205 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4206 Box::pin({
4207 let this = self.clone();
4208 async move {
4209 let url = this.url()?;
4210 let mut req =
4211 azure_core::http::Request::new(url, azure_core::http::Method::Post);
4212 if let Some(auth_header) = this
4213 .client
4214 .token_credential()
4215 .http_authorization_header(&this.client.scopes())
4216 .await?
4217 {
4218 req.insert_header(
4219 azure_core::http::headers::AUTHORIZATION,
4220 auth_header,
4221 );
4222 }
4223 req.insert_header("content-type", "application/json");
4224 let req_body = azure_core::json::to_json(&this.body)?;
4225 req.set_body(req_body);
4226 Ok(Response(this.client.send(&mut req).await?))
4227 }
4228 })
4229 }
4230 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4231 let mut url = azure_core::http::Url::parse(&format!(
4232 "{}/{}/{}/_apis/release/folders/{}",
4233 self.client.endpoint(),
4234 &self.organization,
4235 &self.project,
4236 &self.path
4237 ))?;
4238 let has_api_version_already = url
4239 .query_pairs()
4240 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4241 if !has_api_version_already {
4242 url.query_pairs_mut().append_pair(
4243 azure_core::http::headers::query_param::API_VERSION,
4244 "7.1-preview",
4245 );
4246 }
4247 Ok(url)
4248 }
4249 }
4250 impl std::future::IntoFuture for RequestBuilder {
4251 type Output = azure_core::Result<models::Folder>;
4252 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Folder>>;
4253 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4254 #[doc = ""]
4255 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4256 #[doc = ""]
4257 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4258 fn into_future(self) -> Self::IntoFuture {
4259 Box::pin(async move { self.send().await?.into_raw_body().await })
4260 }
4261 }
4262 }
4263 pub mod update {
4264 use super::models;
4265 #[cfg(not(target_arch = "wasm32"))]
4266 use futures::future::BoxFuture;
4267 #[cfg(target_arch = "wasm32")]
4268 use futures::future::LocalBoxFuture as BoxFuture;
4269 #[derive(Debug)]
4270 pub struct Response(azure_core::http::Response);
4271 impl Response {
4272 pub async fn into_raw_body(self) -> azure_core::Result<models::Folder> {
4273 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4274 let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| {
4275 azure_core::error::Error::full(
4276 azure_core::error::ErrorKind::DataConversion,
4277 e,
4278 format!(
4279 "Failed to deserialize response:\n{}",
4280 String::from_utf8_lossy(&bytes)
4281 ),
4282 )
4283 })?;
4284 Ok(body)
4285 }
4286 pub fn into_raw_response(self) -> azure_core::http::Response {
4287 self.0
4288 }
4289 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4290 &self.0
4291 }
4292 }
4293 impl From<Response> for azure_core::http::Response {
4294 fn from(rsp: Response) -> Self {
4295 rsp.into_raw_response()
4296 }
4297 }
4298 impl AsRef<azure_core::http::Response> for Response {
4299 fn as_ref(&self) -> &azure_core::http::Response {
4300 self.as_raw_response()
4301 }
4302 }
4303 #[derive(Clone)]
4304 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4305 #[doc = r""]
4306 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4307 #[doc = r" parameters can be chained."]
4308 #[doc = r""]
4309 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4310 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4311 #[doc = r" executes the request and returns a `Result` with the parsed"]
4312 #[doc = r" response."]
4313 #[doc = r""]
4314 #[doc = r" If you need lower-level access to the raw response details"]
4315 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4316 #[doc = r" can finalize the request using the"]
4317 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4318 #[doc = r" that resolves to a lower-level [`Response`] value."]
4319 pub struct RequestBuilder {
4320 pub(crate) client: super::super::Client,
4321 pub(crate) organization: String,
4322 pub(crate) body: models::Folder,
4323 pub(crate) project: String,
4324 pub(crate) path: String,
4325 }
4326 impl RequestBuilder {
4327 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4328 #[doc = ""]
4329 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4330 #[doc = "However, this function can provide more flexibility when required."]
4331 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4332 Box::pin({
4333 let this = self.clone();
4334 async move {
4335 let url = this.url()?;
4336 let mut req =
4337 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
4338 if let Some(auth_header) = this
4339 .client
4340 .token_credential()
4341 .http_authorization_header(&this.client.scopes())
4342 .await?
4343 {
4344 req.insert_header(
4345 azure_core::http::headers::AUTHORIZATION,
4346 auth_header,
4347 );
4348 }
4349 req.insert_header("content-type", "application/json");
4350 let req_body = azure_core::json::to_json(&this.body)?;
4351 req.set_body(req_body);
4352 Ok(Response(this.client.send(&mut req).await?))
4353 }
4354 })
4355 }
4356 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4357 let mut url = azure_core::http::Url::parse(&format!(
4358 "{}/{}/{}/_apis/release/folders/{}",
4359 self.client.endpoint(),
4360 &self.organization,
4361 &self.project,
4362 &self.path
4363 ))?;
4364 let has_api_version_already = url
4365 .query_pairs()
4366 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4367 if !has_api_version_already {
4368 url.query_pairs_mut().append_pair(
4369 azure_core::http::headers::query_param::API_VERSION,
4370 "7.1-preview",
4371 );
4372 }
4373 Ok(url)
4374 }
4375 }
4376 impl std::future::IntoFuture for RequestBuilder {
4377 type Output = azure_core::Result<models::Folder>;
4378 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Folder>>;
4379 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4380 #[doc = ""]
4381 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4382 #[doc = ""]
4383 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4384 fn into_future(self) -> Self::IntoFuture {
4385 Box::pin(async move { self.send().await?.into_raw_body().await })
4386 }
4387 }
4388 }
4389 pub mod delete {
4390 use super::models;
4391 #[cfg(not(target_arch = "wasm32"))]
4392 use futures::future::BoxFuture;
4393 #[cfg(target_arch = "wasm32")]
4394 use futures::future::LocalBoxFuture as BoxFuture;
4395 #[derive(Debug)]
4396 pub struct Response(azure_core::http::Response);
4397 impl Response {
4398 pub fn into_raw_response(self) -> azure_core::http::Response {
4399 self.0
4400 }
4401 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4402 &self.0
4403 }
4404 }
4405 impl From<Response> for azure_core::http::Response {
4406 fn from(rsp: Response) -> Self {
4407 rsp.into_raw_response()
4408 }
4409 }
4410 impl AsRef<azure_core::http::Response> for Response {
4411 fn as_ref(&self) -> &azure_core::http::Response {
4412 self.as_raw_response()
4413 }
4414 }
4415 #[derive(Clone)]
4416 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4417 #[doc = r""]
4418 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4419 #[doc = r" parameters can be chained."]
4420 #[doc = r""]
4421 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4422 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4423 #[doc = r" executes the request and returns a `Result` with the parsed"]
4424 #[doc = r" response."]
4425 #[doc = r""]
4426 #[doc = r" If you need lower-level access to the raw response details"]
4427 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4428 #[doc = r" can finalize the request using the"]
4429 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4430 #[doc = r" that resolves to a lower-level [`Response`] value."]
4431 pub struct RequestBuilder {
4432 pub(crate) client: super::super::Client,
4433 pub(crate) organization: String,
4434 pub(crate) project: String,
4435 pub(crate) path: String,
4436 }
4437 impl RequestBuilder {
4438 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4439 #[doc = ""]
4440 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4441 #[doc = "However, this function can provide more flexibility when required."]
4442 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4443 Box::pin({
4444 let this = self.clone();
4445 async move {
4446 let url = this.url()?;
4447 let mut req =
4448 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
4449 if let Some(auth_header) = this
4450 .client
4451 .token_credential()
4452 .http_authorization_header(&this.client.scopes())
4453 .await?
4454 {
4455 req.insert_header(
4456 azure_core::http::headers::AUTHORIZATION,
4457 auth_header,
4458 );
4459 }
4460 let req_body = azure_core::Bytes::new();
4461 req.set_body(req_body);
4462 Ok(Response(this.client.send(&mut req).await?))
4463 }
4464 })
4465 }
4466 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4467 let mut url = azure_core::http::Url::parse(&format!(
4468 "{}/{}/{}/_apis/release/folders/{}",
4469 self.client.endpoint(),
4470 &self.organization,
4471 &self.project,
4472 &self.path
4473 ))?;
4474 let has_api_version_already = url
4475 .query_pairs()
4476 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4477 if !has_api_version_already {
4478 url.query_pairs_mut().append_pair(
4479 azure_core::http::headers::query_param::API_VERSION,
4480 "7.1-preview",
4481 );
4482 }
4483 Ok(url)
4484 }
4485 }
4486 impl std::future::IntoFuture for RequestBuilder {
4487 type Output = azure_core::Result<()>;
4488 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
4489 #[doc = "Returns a future that sends the request and waits for the response."]
4490 #[doc = ""]
4491 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4492 #[doc = ""]
4493 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4494 fn into_future(self) -> Self::IntoFuture {
4495 Box::pin(async move {
4496 let _rsp = self.send().await?;
4497 Ok(())
4498 })
4499 }
4500 }
4501 }
4502}
4503pub mod gates {
4504 use super::models;
4505 #[cfg(not(target_arch = "wasm32"))]
4506 use futures::future::BoxFuture;
4507 #[cfg(target_arch = "wasm32")]
4508 use futures::future::LocalBoxFuture as BoxFuture;
4509 pub struct Client(pub(crate) super::Client);
4510 impl Client {
4511 #[doc = "Updates the gate for a deployment."]
4512 #[doc = ""]
4513 #[doc = "Arguments:"]
4514 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4515 #[doc = "* `body`: Metadata to patch the Release Gates."]
4516 #[doc = "* `project`: Project ID or project name"]
4517 #[doc = "* `gate_step_id`: Gate step Id."]
4518 pub fn update(
4519 &self,
4520 organization: impl Into<String>,
4521 body: impl Into<models::GateUpdateMetadata>,
4522 project: impl Into<String>,
4523 gate_step_id: i32,
4524 ) -> update::RequestBuilder {
4525 update::RequestBuilder {
4526 client: self.0.clone(),
4527 organization: organization.into(),
4528 body: body.into(),
4529 project: project.into(),
4530 gate_step_id,
4531 }
4532 }
4533 }
4534 pub mod update {
4535 use super::models;
4536 #[cfg(not(target_arch = "wasm32"))]
4537 use futures::future::BoxFuture;
4538 #[cfg(target_arch = "wasm32")]
4539 use futures::future::LocalBoxFuture as BoxFuture;
4540 #[derive(Debug)]
4541 pub struct Response(azure_core::http::Response);
4542 impl Response {
4543 pub async fn into_raw_body(self) -> azure_core::Result<models::ReleaseGates> {
4544 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4545 let body: models::ReleaseGates = serde_json::from_slice(&bytes).map_err(|e| {
4546 azure_core::error::Error::full(
4547 azure_core::error::ErrorKind::DataConversion,
4548 e,
4549 format!(
4550 "Failed to deserialize response:\n{}",
4551 String::from_utf8_lossy(&bytes)
4552 ),
4553 )
4554 })?;
4555 Ok(body)
4556 }
4557 pub fn into_raw_response(self) -> azure_core::http::Response {
4558 self.0
4559 }
4560 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4561 &self.0
4562 }
4563 }
4564 impl From<Response> for azure_core::http::Response {
4565 fn from(rsp: Response) -> Self {
4566 rsp.into_raw_response()
4567 }
4568 }
4569 impl AsRef<azure_core::http::Response> for Response {
4570 fn as_ref(&self) -> &azure_core::http::Response {
4571 self.as_raw_response()
4572 }
4573 }
4574 #[derive(Clone)]
4575 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4576 #[doc = r""]
4577 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4578 #[doc = r" parameters can be chained."]
4579 #[doc = r""]
4580 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4581 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4582 #[doc = r" executes the request and returns a `Result` with the parsed"]
4583 #[doc = r" response."]
4584 #[doc = r""]
4585 #[doc = r" If you need lower-level access to the raw response details"]
4586 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4587 #[doc = r" can finalize the request using the"]
4588 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4589 #[doc = r" that resolves to a lower-level [`Response`] value."]
4590 pub struct RequestBuilder {
4591 pub(crate) client: super::super::Client,
4592 pub(crate) organization: String,
4593 pub(crate) body: models::GateUpdateMetadata,
4594 pub(crate) project: String,
4595 pub(crate) gate_step_id: i32,
4596 }
4597 impl RequestBuilder {
4598 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4599 #[doc = ""]
4600 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4601 #[doc = "However, this function can provide more flexibility when required."]
4602 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4603 Box::pin({
4604 let this = self.clone();
4605 async move {
4606 let url = this.url()?;
4607 let mut req =
4608 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
4609 if let Some(auth_header) = this
4610 .client
4611 .token_credential()
4612 .http_authorization_header(&this.client.scopes())
4613 .await?
4614 {
4615 req.insert_header(
4616 azure_core::http::headers::AUTHORIZATION,
4617 auth_header,
4618 );
4619 }
4620 req.insert_header("content-type", "application/json");
4621 let req_body = azure_core::json::to_json(&this.body)?;
4622 req.set_body(req_body);
4623 Ok(Response(this.client.send(&mut req).await?))
4624 }
4625 })
4626 }
4627 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4628 let mut url = azure_core::http::Url::parse(&format!(
4629 "{}/{}/{}/_apis/release/gates/{}",
4630 self.client.endpoint(),
4631 &self.organization,
4632 &self.project,
4633 &self.gate_step_id
4634 ))?;
4635 let has_api_version_already = url
4636 .query_pairs()
4637 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4638 if !has_api_version_already {
4639 url.query_pairs_mut().append_pair(
4640 azure_core::http::headers::query_param::API_VERSION,
4641 "7.1-preview",
4642 );
4643 }
4644 Ok(url)
4645 }
4646 }
4647 impl std::future::IntoFuture for RequestBuilder {
4648 type Output = azure_core::Result<models::ReleaseGates>;
4649 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReleaseGates>>;
4650 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4651 #[doc = ""]
4652 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4653 #[doc = ""]
4654 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4655 fn into_future(self) -> Self::IntoFuture {
4656 Box::pin(async move { self.send().await?.into_raw_body().await })
4657 }
4658 }
4659 }
4660}
4661pub mod attachments {
4662 use super::models;
4663 #[cfg(not(target_arch = "wasm32"))]
4664 use futures::future::BoxFuture;
4665 #[cfg(target_arch = "wasm32")]
4666 use futures::future::LocalBoxFuture as BoxFuture;
4667 pub struct Client(pub(crate) super::Client);
4668 impl Client {
4669 #[doc = "Get the release task attachments."]
4670 #[doc = ""]
4671 #[doc = "Arguments:"]
4672 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4673 #[doc = "* `project`: Project ID or project name"]
4674 #[doc = "* `release_id`: Id of the release."]
4675 #[doc = "* `environment_id`: Id of the release environment."]
4676 #[doc = "* `attempt_id`: Attempt number of deployment."]
4677 #[doc = "* `plan_id`: Plan Id of the deploy phase."]
4678 #[doc = "* `type_`: Type of the attachment."]
4679 pub fn get_release_task_attachments(
4680 &self,
4681 organization: impl Into<String>,
4682 project: impl Into<String>,
4683 release_id: i32,
4684 environment_id: i32,
4685 attempt_id: i32,
4686 plan_id: impl Into<String>,
4687 type_: impl Into<String>,
4688 ) -> get_release_task_attachments::RequestBuilder {
4689 get_release_task_attachments::RequestBuilder {
4690 client: self.0.clone(),
4691 organization: organization.into(),
4692 project: project.into(),
4693 release_id,
4694 environment_id,
4695 attempt_id,
4696 plan_id: plan_id.into(),
4697 type_: type_.into(),
4698 }
4699 }
4700 #[doc = "Get a release task attachment."]
4701 #[doc = ""]
4702 #[doc = "Arguments:"]
4703 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4704 #[doc = "* `project`: Project ID or project name"]
4705 #[doc = "* `release_id`: Id of the release."]
4706 #[doc = "* `environment_id`: Id of the release environment."]
4707 #[doc = "* `attempt_id`: Attempt number of deployment."]
4708 #[doc = "* `plan_id`: Plan Id of the deploy phase."]
4709 #[doc = "* `timeline_id`: Timeline Id of the task."]
4710 #[doc = "* `record_id`: Record Id of attachment."]
4711 #[doc = "* `type_`: Type of the attachment."]
4712 #[doc = "* `name`: Name of the attachment."]
4713 pub fn get_release_task_attachment_content(
4714 &self,
4715 organization: impl Into<String>,
4716 project: impl Into<String>,
4717 release_id: i32,
4718 environment_id: i32,
4719 attempt_id: i32,
4720 plan_id: impl Into<String>,
4721 timeline_id: impl Into<String>,
4722 record_id: impl Into<String>,
4723 type_: impl Into<String>,
4724 name: impl Into<String>,
4725 ) -> get_release_task_attachment_content::RequestBuilder {
4726 get_release_task_attachment_content::RequestBuilder {
4727 client: self.0.clone(),
4728 organization: organization.into(),
4729 project: project.into(),
4730 release_id,
4731 environment_id,
4732 attempt_id,
4733 plan_id: plan_id.into(),
4734 timeline_id: timeline_id.into(),
4735 record_id: record_id.into(),
4736 type_: type_.into(),
4737 name: name.into(),
4738 }
4739 }
4740 #[doc = "GetTaskAttachments API is deprecated. Use GetReleaseTaskAttachments API instead."]
4741 #[doc = ""]
4742 #[doc = "Arguments:"]
4743 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4744 #[doc = "* `project`: Project ID or project name"]
4745 #[doc = "* `release_id`: Id of the release."]
4746 #[doc = "* `environment_id`: Id of the release environment."]
4747 #[doc = "* `attempt_id`: Attempt number of deployment."]
4748 #[doc = "* `timeline_id`: Timeline Id of the task."]
4749 #[doc = "* `type_`: Type of the attachment."]
4750 pub fn get_task_attachments(
4751 &self,
4752 organization: impl Into<String>,
4753 project: impl Into<String>,
4754 release_id: i32,
4755 environment_id: i32,
4756 attempt_id: i32,
4757 timeline_id: impl Into<String>,
4758 type_: impl Into<String>,
4759 ) -> get_task_attachments::RequestBuilder {
4760 get_task_attachments::RequestBuilder {
4761 client: self.0.clone(),
4762 organization: organization.into(),
4763 project: project.into(),
4764 release_id,
4765 environment_id,
4766 attempt_id,
4767 timeline_id: timeline_id.into(),
4768 type_: type_.into(),
4769 }
4770 }
4771 #[doc = "GetTaskAttachmentContent API is deprecated. Use GetReleaseTaskAttachmentContent API instead."]
4772 #[doc = ""]
4773 #[doc = "Arguments:"]
4774 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4775 #[doc = "* `project`: Project ID or project name"]
4776 #[doc = "* `release_id`: Id of the release."]
4777 #[doc = "* `environment_id`: Id of the release environment."]
4778 #[doc = "* `attempt_id`: Attempt number of deployment."]
4779 #[doc = "* `timeline_id`: Timeline Id of the task."]
4780 #[doc = "* `record_id`: Record Id of attachment."]
4781 #[doc = "* `type_`: Type of the attachment."]
4782 #[doc = "* `name`: Name of the attachment."]
4783 pub fn get_task_attachment_content(
4784 &self,
4785 organization: impl Into<String>,
4786 project: impl Into<String>,
4787 release_id: i32,
4788 environment_id: i32,
4789 attempt_id: i32,
4790 timeline_id: impl Into<String>,
4791 record_id: impl Into<String>,
4792 type_: impl Into<String>,
4793 name: impl Into<String>,
4794 ) -> get_task_attachment_content::RequestBuilder {
4795 get_task_attachment_content::RequestBuilder {
4796 client: self.0.clone(),
4797 organization: organization.into(),
4798 project: project.into(),
4799 release_id,
4800 environment_id,
4801 attempt_id,
4802 timeline_id: timeline_id.into(),
4803 record_id: record_id.into(),
4804 type_: type_.into(),
4805 name: name.into(),
4806 }
4807 }
4808 }
4809 pub mod get_release_task_attachments {
4810 use super::models;
4811 #[cfg(not(target_arch = "wasm32"))]
4812 use futures::future::BoxFuture;
4813 #[cfg(target_arch = "wasm32")]
4814 use futures::future::LocalBoxFuture as BoxFuture;
4815 #[derive(Debug)]
4816 pub struct Response(azure_core::http::Response);
4817 impl Response {
4818 pub async fn into_raw_body(
4819 self,
4820 ) -> azure_core::Result<models::ReleaseTaskAttachmentList> {
4821 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4822 let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes)
4823 .map_err(|e| {
4824 azure_core::error::Error::full(
4825 azure_core::error::ErrorKind::DataConversion,
4826 e,
4827 format!(
4828 "Failed to deserialize response:\n{}",
4829 String::from_utf8_lossy(&bytes)
4830 ),
4831 )
4832 })?;
4833 Ok(body)
4834 }
4835 pub fn into_raw_response(self) -> azure_core::http::Response {
4836 self.0
4837 }
4838 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4839 &self.0
4840 }
4841 }
4842 impl From<Response> for azure_core::http::Response {
4843 fn from(rsp: Response) -> Self {
4844 rsp.into_raw_response()
4845 }
4846 }
4847 impl AsRef<azure_core::http::Response> for Response {
4848 fn as_ref(&self) -> &azure_core::http::Response {
4849 self.as_raw_response()
4850 }
4851 }
4852 #[derive(Clone)]
4853 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4854 #[doc = r""]
4855 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4856 #[doc = r" parameters can be chained."]
4857 #[doc = r""]
4858 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4859 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4860 #[doc = r" executes the request and returns a `Result` with the parsed"]
4861 #[doc = r" response."]
4862 #[doc = r""]
4863 #[doc = r" If you need lower-level access to the raw response details"]
4864 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4865 #[doc = r" can finalize the request using the"]
4866 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4867 #[doc = r" that resolves to a lower-level [`Response`] value."]
4868 pub struct RequestBuilder {
4869 pub(crate) client: super::super::Client,
4870 pub(crate) organization: String,
4871 pub(crate) project: String,
4872 pub(crate) release_id: i32,
4873 pub(crate) environment_id: i32,
4874 pub(crate) attempt_id: i32,
4875 pub(crate) plan_id: String,
4876 pub(crate) type_: String,
4877 }
4878 impl RequestBuilder {
4879 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4880 #[doc = ""]
4881 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4882 #[doc = "However, this function can provide more flexibility when required."]
4883 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4884 Box::pin({
4885 let this = self.clone();
4886 async move {
4887 let url = this.url()?;
4888 let mut req =
4889 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4890 if let Some(auth_header) = this
4891 .client
4892 .token_credential()
4893 .http_authorization_header(&this.client.scopes())
4894 .await?
4895 {
4896 req.insert_header(
4897 azure_core::http::headers::AUTHORIZATION,
4898 auth_header,
4899 );
4900 }
4901 let req_body = azure_core::Bytes::new();
4902 req.set_body(req_body);
4903 Ok(Response(this.client.send(&mut req).await?))
4904 }
4905 })
4906 }
4907 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4908 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . type_)) ? ;
4909 let has_api_version_already = url
4910 .query_pairs()
4911 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4912 if !has_api_version_already {
4913 url.query_pairs_mut().append_pair(
4914 azure_core::http::headers::query_param::API_VERSION,
4915 "7.1-preview",
4916 );
4917 }
4918 Ok(url)
4919 }
4920 }
4921 impl std::future::IntoFuture for RequestBuilder {
4922 type Output = azure_core::Result<models::ReleaseTaskAttachmentList>;
4923 type IntoFuture =
4924 BoxFuture<'static, azure_core::Result<models::ReleaseTaskAttachmentList>>;
4925 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4926 #[doc = ""]
4927 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4928 #[doc = ""]
4929 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4930 fn into_future(self) -> Self::IntoFuture {
4931 Box::pin(async move { self.send().await?.into_raw_body().await })
4932 }
4933 }
4934 }
4935 pub mod get_release_task_attachment_content {
4936 use super::models;
4937 #[cfg(not(target_arch = "wasm32"))]
4938 use futures::future::BoxFuture;
4939 #[cfg(target_arch = "wasm32")]
4940 use futures::future::LocalBoxFuture as BoxFuture;
4941 #[derive(Debug)]
4942 pub struct Response(azure_core::http::Response);
4943 impl Response {
4944 pub async fn into_raw_body(self) -> azure_core::Result<String> {
4945 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4946 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
4947 azure_core::error::Error::full(
4948 azure_core::error::ErrorKind::DataConversion,
4949 e,
4950 format!(
4951 "Failed to deserialize response:\n{}",
4952 String::from_utf8_lossy(&bytes)
4953 ),
4954 )
4955 })?;
4956 Ok(body)
4957 }
4958 pub fn into_raw_response(self) -> azure_core::http::Response {
4959 self.0
4960 }
4961 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4962 &self.0
4963 }
4964 }
4965 impl From<Response> for azure_core::http::Response {
4966 fn from(rsp: Response) -> Self {
4967 rsp.into_raw_response()
4968 }
4969 }
4970 impl AsRef<azure_core::http::Response> for Response {
4971 fn as_ref(&self) -> &azure_core::http::Response {
4972 self.as_raw_response()
4973 }
4974 }
4975 #[derive(Clone)]
4976 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4977 #[doc = r""]
4978 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4979 #[doc = r" parameters can be chained."]
4980 #[doc = r""]
4981 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4982 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4983 #[doc = r" executes the request and returns a `Result` with the parsed"]
4984 #[doc = r" response."]
4985 #[doc = r""]
4986 #[doc = r" If you need lower-level access to the raw response details"]
4987 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4988 #[doc = r" can finalize the request using the"]
4989 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4990 #[doc = r" that resolves to a lower-level [`Response`] value."]
4991 pub struct RequestBuilder {
4992 pub(crate) client: super::super::Client,
4993 pub(crate) organization: String,
4994 pub(crate) project: String,
4995 pub(crate) release_id: i32,
4996 pub(crate) environment_id: i32,
4997 pub(crate) attempt_id: i32,
4998 pub(crate) plan_id: String,
4999 pub(crate) timeline_id: String,
5000 pub(crate) record_id: String,
5001 pub(crate) type_: String,
5002 pub(crate) name: String,
5003 }
5004 impl RequestBuilder {
5005 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5006 #[doc = ""]
5007 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5008 #[doc = "However, this function can provide more flexibility when required."]
5009 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5010 Box::pin({
5011 let this = self.clone();
5012 async move {
5013 let url = this.url()?;
5014 let mut req =
5015 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5016 if let Some(auth_header) = this
5017 .client
5018 .token_credential()
5019 .http_authorization_header(&this.client.scopes())
5020 .await?
5021 {
5022 req.insert_header(
5023 azure_core::http::headers::AUTHORIZATION,
5024 auth_header,
5025 );
5026 }
5027 let req_body = azure_core::Bytes::new();
5028 req.set_body(req_body);
5029 Ok(Response(this.client.send(&mut req).await?))
5030 }
5031 })
5032 }
5033 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5034 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . plan_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ;
5035 let has_api_version_already = url
5036 .query_pairs()
5037 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5038 if !has_api_version_already {
5039 url.query_pairs_mut().append_pair(
5040 azure_core::http::headers::query_param::API_VERSION,
5041 "7.1-preview",
5042 );
5043 }
5044 Ok(url)
5045 }
5046 }
5047 impl std::future::IntoFuture for RequestBuilder {
5048 type Output = azure_core::Result<String>;
5049 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
5050 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5051 #[doc = ""]
5052 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5053 #[doc = ""]
5054 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5055 fn into_future(self) -> Self::IntoFuture {
5056 Box::pin(async move { self.send().await?.into_raw_body().await })
5057 }
5058 }
5059 }
5060 pub mod get_task_attachments {
5061 use super::models;
5062 #[cfg(not(target_arch = "wasm32"))]
5063 use futures::future::BoxFuture;
5064 #[cfg(target_arch = "wasm32")]
5065 use futures::future::LocalBoxFuture as BoxFuture;
5066 #[derive(Debug)]
5067 pub struct Response(azure_core::http::Response);
5068 impl Response {
5069 pub async fn into_raw_body(
5070 self,
5071 ) -> azure_core::Result<models::ReleaseTaskAttachmentList> {
5072 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5073 let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes)
5074 .map_err(|e| {
5075 azure_core::error::Error::full(
5076 azure_core::error::ErrorKind::DataConversion,
5077 e,
5078 format!(
5079 "Failed to deserialize response:\n{}",
5080 String::from_utf8_lossy(&bytes)
5081 ),
5082 )
5083 })?;
5084 Ok(body)
5085 }
5086 pub fn into_raw_response(self) -> azure_core::http::Response {
5087 self.0
5088 }
5089 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5090 &self.0
5091 }
5092 }
5093 impl From<Response> for azure_core::http::Response {
5094 fn from(rsp: Response) -> Self {
5095 rsp.into_raw_response()
5096 }
5097 }
5098 impl AsRef<azure_core::http::Response> for Response {
5099 fn as_ref(&self) -> &azure_core::http::Response {
5100 self.as_raw_response()
5101 }
5102 }
5103 #[derive(Clone)]
5104 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5105 #[doc = r""]
5106 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5107 #[doc = r" parameters can be chained."]
5108 #[doc = r""]
5109 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5110 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5111 #[doc = r" executes the request and returns a `Result` with the parsed"]
5112 #[doc = r" response."]
5113 #[doc = r""]
5114 #[doc = r" If you need lower-level access to the raw response details"]
5115 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5116 #[doc = r" can finalize the request using the"]
5117 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5118 #[doc = r" that resolves to a lower-level [`Response`] value."]
5119 pub struct RequestBuilder {
5120 pub(crate) client: super::super::Client,
5121 pub(crate) organization: String,
5122 pub(crate) project: String,
5123 pub(crate) release_id: i32,
5124 pub(crate) environment_id: i32,
5125 pub(crate) attempt_id: i32,
5126 pub(crate) timeline_id: String,
5127 pub(crate) type_: String,
5128 }
5129 impl RequestBuilder {
5130 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5131 #[doc = ""]
5132 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5133 #[doc = "However, this function can provide more flexibility when required."]
5134 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5135 Box::pin({
5136 let this = self.clone();
5137 async move {
5138 let url = this.url()?;
5139 let mut req =
5140 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5141 if let Some(auth_header) = this
5142 .client
5143 .token_credential()
5144 .http_authorization_header(&this.client.scopes())
5145 .await?
5146 {
5147 req.insert_header(
5148 azure_core::http::headers::AUTHORIZATION,
5149 auth_header,
5150 );
5151 }
5152 let req_body = azure_core::Bytes::new();
5153 req.set_body(req_body);
5154 Ok(Response(this.client.send(&mut req).await?))
5155 }
5156 })
5157 }
5158 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5159 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . type_)) ? ;
5160 let has_api_version_already = url
5161 .query_pairs()
5162 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5163 if !has_api_version_already {
5164 url.query_pairs_mut().append_pair(
5165 azure_core::http::headers::query_param::API_VERSION,
5166 "7.1-preview",
5167 );
5168 }
5169 Ok(url)
5170 }
5171 }
5172 impl std::future::IntoFuture for RequestBuilder {
5173 type Output = azure_core::Result<models::ReleaseTaskAttachmentList>;
5174 type IntoFuture =
5175 BoxFuture<'static, azure_core::Result<models::ReleaseTaskAttachmentList>>;
5176 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5177 #[doc = ""]
5178 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5179 #[doc = ""]
5180 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5181 fn into_future(self) -> Self::IntoFuture {
5182 Box::pin(async move { self.send().await?.into_raw_body().await })
5183 }
5184 }
5185 }
5186 pub mod get_task_attachment_content {
5187 use super::models;
5188 #[cfg(not(target_arch = "wasm32"))]
5189 use futures::future::BoxFuture;
5190 #[cfg(target_arch = "wasm32")]
5191 use futures::future::LocalBoxFuture as BoxFuture;
5192 #[derive(Debug)]
5193 pub struct Response(azure_core::http::Response);
5194 impl Response {
5195 pub async fn into_raw_body(self) -> azure_core::Result<String> {
5196 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5197 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
5198 azure_core::error::Error::full(
5199 azure_core::error::ErrorKind::DataConversion,
5200 e,
5201 format!(
5202 "Failed to deserialize response:\n{}",
5203 String::from_utf8_lossy(&bytes)
5204 ),
5205 )
5206 })?;
5207 Ok(body)
5208 }
5209 pub fn into_raw_response(self) -> azure_core::http::Response {
5210 self.0
5211 }
5212 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5213 &self.0
5214 }
5215 }
5216 impl From<Response> for azure_core::http::Response {
5217 fn from(rsp: Response) -> Self {
5218 rsp.into_raw_response()
5219 }
5220 }
5221 impl AsRef<azure_core::http::Response> for Response {
5222 fn as_ref(&self) -> &azure_core::http::Response {
5223 self.as_raw_response()
5224 }
5225 }
5226 #[derive(Clone)]
5227 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5228 #[doc = r""]
5229 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5230 #[doc = r" parameters can be chained."]
5231 #[doc = r""]
5232 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5233 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5234 #[doc = r" executes the request and returns a `Result` with the parsed"]
5235 #[doc = r" response."]
5236 #[doc = r""]
5237 #[doc = r" If you need lower-level access to the raw response details"]
5238 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5239 #[doc = r" can finalize the request using the"]
5240 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5241 #[doc = r" that resolves to a lower-level [`Response`] value."]
5242 pub struct RequestBuilder {
5243 pub(crate) client: super::super::Client,
5244 pub(crate) organization: String,
5245 pub(crate) project: String,
5246 pub(crate) release_id: i32,
5247 pub(crate) environment_id: i32,
5248 pub(crate) attempt_id: i32,
5249 pub(crate) timeline_id: String,
5250 pub(crate) record_id: String,
5251 pub(crate) type_: String,
5252 pub(crate) name: String,
5253 }
5254 impl RequestBuilder {
5255 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5256 #[doc = ""]
5257 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5258 #[doc = "However, this function can provide more flexibility when required."]
5259 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5260 Box::pin({
5261 let this = self.clone();
5262 async move {
5263 let url = this.url()?;
5264 let mut req =
5265 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5266 if let Some(auth_header) = this
5267 .client
5268 .token_credential()
5269 .http_authorization_header(&this.client.scopes())
5270 .await?
5271 {
5272 req.insert_header(
5273 azure_core::http::headers::AUTHORIZATION,
5274 auth_header,
5275 );
5276 }
5277 let req_body = azure_core::Bytes::new();
5278 req.set_body(req_body);
5279 Ok(Response(this.client.send(&mut req).await?))
5280 }
5281 })
5282 }
5283 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5284 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , self . client . endpoint () , & self . organization , & self . project , & self . release_id , & self . environment_id , & self . attempt_id , & self . timeline_id , & self . record_id , & self . type_ , & self . name)) ? ;
5285 let has_api_version_already = url
5286 .query_pairs()
5287 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5288 if !has_api_version_already {
5289 url.query_pairs_mut().append_pair(
5290 azure_core::http::headers::query_param::API_VERSION,
5291 "7.1-preview",
5292 );
5293 }
5294 Ok(url)
5295 }
5296 }
5297 impl std::future::IntoFuture for RequestBuilder {
5298 type Output = azure_core::Result<String>;
5299 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
5300 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5301 #[doc = ""]
5302 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5303 #[doc = ""]
5304 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5305 fn into_future(self) -> Self::IntoFuture {
5306 Box::pin(async move { self.send().await?.into_raw_body().await })
5307 }
5308 }
5309 }
5310}
5311pub mod manual_interventions {
5312 use super::models;
5313 #[cfg(not(target_arch = "wasm32"))]
5314 use futures::future::BoxFuture;
5315 #[cfg(target_arch = "wasm32")]
5316 use futures::future::LocalBoxFuture as BoxFuture;
5317 pub struct Client(pub(crate) super::Client);
5318 impl Client {
5319 #[doc = "List all manual interventions for a given release."]
5320 #[doc = ""]
5321 #[doc = "Arguments:"]
5322 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5323 #[doc = "* `project`: Project ID or project name"]
5324 #[doc = "* `release_id`: Id of the release."]
5325 pub fn list(
5326 &self,
5327 organization: impl Into<String>,
5328 project: impl Into<String>,
5329 release_id: i32,
5330 ) -> list::RequestBuilder {
5331 list::RequestBuilder {
5332 client: self.0.clone(),
5333 organization: organization.into(),
5334 project: project.into(),
5335 release_id,
5336 }
5337 }
5338 #[doc = "Get manual intervention for a given release and manual intervention id."]
5339 #[doc = ""]
5340 #[doc = "Arguments:"]
5341 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5342 #[doc = "* `project`: Project ID or project name"]
5343 #[doc = "* `release_id`: Id of the release."]
5344 #[doc = "* `manual_intervention_id`: Id of the manual intervention."]
5345 pub fn get(
5346 &self,
5347 organization: impl Into<String>,
5348 project: impl Into<String>,
5349 release_id: i32,
5350 manual_intervention_id: i32,
5351 ) -> get::RequestBuilder {
5352 get::RequestBuilder {
5353 client: self.0.clone(),
5354 organization: organization.into(),
5355 project: project.into(),
5356 release_id,
5357 manual_intervention_id,
5358 }
5359 }
5360 #[doc = "Update manual intervention."]
5361 #[doc = ""]
5362 #[doc = "Arguments:"]
5363 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5364 #[doc = "* `body`: Meta data to update manual intervention."]
5365 #[doc = "* `project`: Project ID or project name"]
5366 #[doc = "* `release_id`: Id of the release."]
5367 #[doc = "* `manual_intervention_id`: Id of the manual intervention."]
5368 pub fn update(
5369 &self,
5370 organization: impl Into<String>,
5371 body: impl Into<models::ManualInterventionUpdateMetadata>,
5372 project: impl Into<String>,
5373 release_id: i32,
5374 manual_intervention_id: i32,
5375 ) -> update::RequestBuilder {
5376 update::RequestBuilder {
5377 client: self.0.clone(),
5378 organization: organization.into(),
5379 body: body.into(),
5380 project: project.into(),
5381 release_id,
5382 manual_intervention_id,
5383 }
5384 }
5385 }
5386 pub mod list {
5387 use super::models;
5388 #[cfg(not(target_arch = "wasm32"))]
5389 use futures::future::BoxFuture;
5390 #[cfg(target_arch = "wasm32")]
5391 use futures::future::LocalBoxFuture as BoxFuture;
5392 #[derive(Debug)]
5393 pub struct Response(azure_core::http::Response);
5394 impl Response {
5395 pub async fn into_raw_body(self) -> azure_core::Result<models::ManualInterventionList> {
5396 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5397 let body: models::ManualInterventionList =
5398 serde_json::from_slice(&bytes).map_err(|e| {
5399 azure_core::error::Error::full(
5400 azure_core::error::ErrorKind::DataConversion,
5401 e,
5402 format!(
5403 "Failed to deserialize response:\n{}",
5404 String::from_utf8_lossy(&bytes)
5405 ),
5406 )
5407 })?;
5408 Ok(body)
5409 }
5410 pub fn into_raw_response(self) -> azure_core::http::Response {
5411 self.0
5412 }
5413 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5414 &self.0
5415 }
5416 }
5417 impl From<Response> for azure_core::http::Response {
5418 fn from(rsp: Response) -> Self {
5419 rsp.into_raw_response()
5420 }
5421 }
5422 impl AsRef<azure_core::http::Response> for Response {
5423 fn as_ref(&self) -> &azure_core::http::Response {
5424 self.as_raw_response()
5425 }
5426 }
5427 #[derive(Clone)]
5428 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5429 #[doc = r""]
5430 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5431 #[doc = r" parameters can be chained."]
5432 #[doc = r""]
5433 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5434 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5435 #[doc = r" executes the request and returns a `Result` with the parsed"]
5436 #[doc = r" response."]
5437 #[doc = r""]
5438 #[doc = r" If you need lower-level access to the raw response details"]
5439 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5440 #[doc = r" can finalize the request using the"]
5441 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5442 #[doc = r" that resolves to a lower-level [`Response`] value."]
5443 pub struct RequestBuilder {
5444 pub(crate) client: super::super::Client,
5445 pub(crate) organization: String,
5446 pub(crate) project: String,
5447 pub(crate) release_id: i32,
5448 }
5449 impl RequestBuilder {
5450 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5451 #[doc = ""]
5452 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5453 #[doc = "However, this function can provide more flexibility when required."]
5454 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5455 Box::pin({
5456 let this = self.clone();
5457 async move {
5458 let url = this.url()?;
5459 let mut req =
5460 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5461 if let Some(auth_header) = this
5462 .client
5463 .token_credential()
5464 .http_authorization_header(&this.client.scopes())
5465 .await?
5466 {
5467 req.insert_header(
5468 azure_core::http::headers::AUTHORIZATION,
5469 auth_header,
5470 );
5471 }
5472 let req_body = azure_core::Bytes::new();
5473 req.set_body(req_body);
5474 Ok(Response(this.client.send(&mut req).await?))
5475 }
5476 })
5477 }
5478 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5479 let mut url = azure_core::http::Url::parse(&format!(
5480 "{}/{}/{}/_apis/Release/releases/{}/manualinterventions",
5481 self.client.endpoint(),
5482 &self.organization,
5483 &self.project,
5484 &self.release_id
5485 ))?;
5486 let has_api_version_already = url
5487 .query_pairs()
5488 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5489 if !has_api_version_already {
5490 url.query_pairs_mut().append_pair(
5491 azure_core::http::headers::query_param::API_VERSION,
5492 "7.1-preview",
5493 );
5494 }
5495 Ok(url)
5496 }
5497 }
5498 impl std::future::IntoFuture for RequestBuilder {
5499 type Output = azure_core::Result<models::ManualInterventionList>;
5500 type IntoFuture =
5501 BoxFuture<'static, azure_core::Result<models::ManualInterventionList>>;
5502 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5503 #[doc = ""]
5504 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5505 #[doc = ""]
5506 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5507 fn into_future(self) -> Self::IntoFuture {
5508 Box::pin(async move { self.send().await?.into_raw_body().await })
5509 }
5510 }
5511 }
5512 pub mod get {
5513 use super::models;
5514 #[cfg(not(target_arch = "wasm32"))]
5515 use futures::future::BoxFuture;
5516 #[cfg(target_arch = "wasm32")]
5517 use futures::future::LocalBoxFuture as BoxFuture;
5518 #[derive(Debug)]
5519 pub struct Response(azure_core::http::Response);
5520 impl Response {
5521 pub async fn into_raw_body(self) -> azure_core::Result<models::ManualIntervention> {
5522 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5523 let body: models::ManualIntervention =
5524 serde_json::from_slice(&bytes).map_err(|e| {
5525 azure_core::error::Error::full(
5526 azure_core::error::ErrorKind::DataConversion,
5527 e,
5528 format!(
5529 "Failed to deserialize response:\n{}",
5530 String::from_utf8_lossy(&bytes)
5531 ),
5532 )
5533 })?;
5534 Ok(body)
5535 }
5536 pub fn into_raw_response(self) -> azure_core::http::Response {
5537 self.0
5538 }
5539 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5540 &self.0
5541 }
5542 }
5543 impl From<Response> for azure_core::http::Response {
5544 fn from(rsp: Response) -> Self {
5545 rsp.into_raw_response()
5546 }
5547 }
5548 impl AsRef<azure_core::http::Response> for Response {
5549 fn as_ref(&self) -> &azure_core::http::Response {
5550 self.as_raw_response()
5551 }
5552 }
5553 #[derive(Clone)]
5554 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5555 #[doc = r""]
5556 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5557 #[doc = r" parameters can be chained."]
5558 #[doc = r""]
5559 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5560 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5561 #[doc = r" executes the request and returns a `Result` with the parsed"]
5562 #[doc = r" response."]
5563 #[doc = r""]
5564 #[doc = r" If you need lower-level access to the raw response details"]
5565 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5566 #[doc = r" can finalize the request using the"]
5567 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5568 #[doc = r" that resolves to a lower-level [`Response`] value."]
5569 pub struct RequestBuilder {
5570 pub(crate) client: super::super::Client,
5571 pub(crate) organization: String,
5572 pub(crate) project: String,
5573 pub(crate) release_id: i32,
5574 pub(crate) manual_intervention_id: i32,
5575 }
5576 impl RequestBuilder {
5577 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5578 #[doc = ""]
5579 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5580 #[doc = "However, this function can provide more flexibility when required."]
5581 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5582 Box::pin({
5583 let this = self.clone();
5584 async move {
5585 let url = this.url()?;
5586 let mut req =
5587 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5588 if let Some(auth_header) = this
5589 .client
5590 .token_credential()
5591 .http_authorization_header(&this.client.scopes())
5592 .await?
5593 {
5594 req.insert_header(
5595 azure_core::http::headers::AUTHORIZATION,
5596 auth_header,
5597 );
5598 }
5599 let req_body = azure_core::Bytes::new();
5600 req.set_body(req_body);
5601 Ok(Response(this.client.send(&mut req).await?))
5602 }
5603 })
5604 }
5605 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5606 let mut url = azure_core::http::Url::parse(&format!(
5607 "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}",
5608 self.client.endpoint(),
5609 &self.organization,
5610 &self.project,
5611 &self.release_id,
5612 &self.manual_intervention_id
5613 ))?;
5614 let has_api_version_already = url
5615 .query_pairs()
5616 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5617 if !has_api_version_already {
5618 url.query_pairs_mut().append_pair(
5619 azure_core::http::headers::query_param::API_VERSION,
5620 "7.1-preview",
5621 );
5622 }
5623 Ok(url)
5624 }
5625 }
5626 impl std::future::IntoFuture for RequestBuilder {
5627 type Output = azure_core::Result<models::ManualIntervention>;
5628 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManualIntervention>>;
5629 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5630 #[doc = ""]
5631 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5632 #[doc = ""]
5633 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5634 fn into_future(self) -> Self::IntoFuture {
5635 Box::pin(async move { self.send().await?.into_raw_body().await })
5636 }
5637 }
5638 }
5639 pub mod update {
5640 use super::models;
5641 #[cfg(not(target_arch = "wasm32"))]
5642 use futures::future::BoxFuture;
5643 #[cfg(target_arch = "wasm32")]
5644 use futures::future::LocalBoxFuture as BoxFuture;
5645 #[derive(Debug)]
5646 pub struct Response(azure_core::http::Response);
5647 impl Response {
5648 pub async fn into_raw_body(self) -> azure_core::Result<models::ManualIntervention> {
5649 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5650 let body: models::ManualIntervention =
5651 serde_json::from_slice(&bytes).map_err(|e| {
5652 azure_core::error::Error::full(
5653 azure_core::error::ErrorKind::DataConversion,
5654 e,
5655 format!(
5656 "Failed to deserialize response:\n{}",
5657 String::from_utf8_lossy(&bytes)
5658 ),
5659 )
5660 })?;
5661 Ok(body)
5662 }
5663 pub fn into_raw_response(self) -> azure_core::http::Response {
5664 self.0
5665 }
5666 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5667 &self.0
5668 }
5669 }
5670 impl From<Response> for azure_core::http::Response {
5671 fn from(rsp: Response) -> Self {
5672 rsp.into_raw_response()
5673 }
5674 }
5675 impl AsRef<azure_core::http::Response> for Response {
5676 fn as_ref(&self) -> &azure_core::http::Response {
5677 self.as_raw_response()
5678 }
5679 }
5680 #[derive(Clone)]
5681 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5682 #[doc = r""]
5683 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5684 #[doc = r" parameters can be chained."]
5685 #[doc = r""]
5686 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5687 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5688 #[doc = r" executes the request and returns a `Result` with the parsed"]
5689 #[doc = r" response."]
5690 #[doc = r""]
5691 #[doc = r" If you need lower-level access to the raw response details"]
5692 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5693 #[doc = r" can finalize the request using the"]
5694 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5695 #[doc = r" that resolves to a lower-level [`Response`] value."]
5696 pub struct RequestBuilder {
5697 pub(crate) client: super::super::Client,
5698 pub(crate) organization: String,
5699 pub(crate) body: models::ManualInterventionUpdateMetadata,
5700 pub(crate) project: String,
5701 pub(crate) release_id: i32,
5702 pub(crate) manual_intervention_id: i32,
5703 }
5704 impl RequestBuilder {
5705 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5706 #[doc = ""]
5707 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5708 #[doc = "However, this function can provide more flexibility when required."]
5709 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5710 Box::pin({
5711 let this = self.clone();
5712 async move {
5713 let url = this.url()?;
5714 let mut req =
5715 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
5716 if let Some(auth_header) = this
5717 .client
5718 .token_credential()
5719 .http_authorization_header(&this.client.scopes())
5720 .await?
5721 {
5722 req.insert_header(
5723 azure_core::http::headers::AUTHORIZATION,
5724 auth_header,
5725 );
5726 }
5727 req.insert_header("content-type", "application/json");
5728 let req_body = azure_core::json::to_json(&this.body)?;
5729 req.set_body(req_body);
5730 Ok(Response(this.client.send(&mut req).await?))
5731 }
5732 })
5733 }
5734 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5735 let mut url = azure_core::http::Url::parse(&format!(
5736 "{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}",
5737 self.client.endpoint(),
5738 &self.organization,
5739 &self.project,
5740 &self.release_id,
5741 &self.manual_intervention_id
5742 ))?;
5743 let has_api_version_already = url
5744 .query_pairs()
5745 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5746 if !has_api_version_already {
5747 url.query_pairs_mut().append_pair(
5748 azure_core::http::headers::query_param::API_VERSION,
5749 "7.1-preview",
5750 );
5751 }
5752 Ok(url)
5753 }
5754 }
5755 impl std::future::IntoFuture for RequestBuilder {
5756 type Output = azure_core::Result<models::ManualIntervention>;
5757 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManualIntervention>>;
5758 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5759 #[doc = ""]
5760 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5761 #[doc = ""]
5762 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5763 fn into_future(self) -> Self::IntoFuture {
5764 Box::pin(async move { self.send().await?.into_raw_body().await })
5765 }
5766 }
5767 }
5768}