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://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 = 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::Transport>) -> 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::RawResponse> {
101 let context = azure_core::http::Context::default();
102 self.pipeline.send(&context, request, None).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 None,
125 );
126 Self {
127 endpoint,
128 credential,
129 scopes,
130 pipeline,
131 }
132 }
133 pub fn attachments_client(&self) -> attachments::Client {
134 attachments::Client(self.clone())
135 }
136 pub fn page_moves_client(&self) -> page_moves::Client {
137 page_moves::Client(self.clone())
138 }
139 pub fn page_stats_client(&self) -> page_stats::Client {
140 page_stats::Client(self.clone())
141 }
142 pub fn pages_client(&self) -> pages::Client {
143 pages::Client(self.clone())
144 }
145 pub fn pages_batch_client(&self) -> pages_batch::Client {
146 pages_batch::Client(self.clone())
147 }
148 pub fn wikis_client(&self) -> wikis::Client {
149 wikis::Client(self.clone())
150 }
151}
152pub mod wikis {
153 use super::models;
154 #[cfg(not(target_arch = "wasm32"))]
155 use futures::future::BoxFuture;
156 #[cfg(target_arch = "wasm32")]
157 use futures::future::LocalBoxFuture as BoxFuture;
158 pub struct Client(pub(crate) super::Client);
159 impl Client {
160 #[doc = "Gets all wikis in a project or collection."]
161 #[doc = ""]
162 #[doc = "Arguments:"]
163 #[doc = "* `organization`: The name of the Azure DevOps organization."]
164 #[doc = "* `project`: Project ID or project name"]
165 pub fn list(
166 &self,
167 organization: impl Into<String>,
168 project: impl Into<String>,
169 ) -> list::RequestBuilder {
170 list::RequestBuilder {
171 client: self.0.clone(),
172 organization: organization.into(),
173 project: project.into(),
174 }
175 }
176 #[doc = "Creates the wiki resource."]
177 #[doc = ""]
178 #[doc = "Arguments:"]
179 #[doc = "* `organization`: The name of the Azure DevOps organization."]
180 #[doc = "* `body`: Parameters for the wiki creation."]
181 #[doc = "* `project`: Project ID or project name"]
182 pub fn create(
183 &self,
184 organization: impl Into<String>,
185 body: impl Into<models::WikiCreateParametersV2>,
186 project: impl Into<String>,
187 ) -> create::RequestBuilder {
188 create::RequestBuilder {
189 client: self.0.clone(),
190 organization: organization.into(),
191 body: body.into(),
192 project: project.into(),
193 }
194 }
195 #[doc = "Gets the wiki corresponding to the wiki ID or wiki name provided."]
196 #[doc = ""]
197 #[doc = "Arguments:"]
198 #[doc = "* `organization`: The name of the Azure DevOps organization."]
199 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
200 #[doc = "* `project`: Project ID or project name"]
201 pub fn get(
202 &self,
203 organization: impl Into<String>,
204 wiki_identifier: impl Into<String>,
205 project: impl Into<String>,
206 ) -> get::RequestBuilder {
207 get::RequestBuilder {
208 client: self.0.clone(),
209 organization: organization.into(),
210 wiki_identifier: wiki_identifier.into(),
211 project: project.into(),
212 }
213 }
214 #[doc = "Updates the wiki corresponding to the wiki ID or wiki name provided using the update parameters."]
215 #[doc = ""]
216 #[doc = "Arguments:"]
217 #[doc = "* `organization`: The name of the Azure DevOps organization."]
218 #[doc = "* `body`: Update parameters."]
219 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
220 #[doc = "* `project`: Project ID or project name"]
221 pub fn update(
222 &self,
223 organization: impl Into<String>,
224 body: impl Into<models::WikiUpdateParameters>,
225 wiki_identifier: impl Into<String>,
226 project: impl Into<String>,
227 ) -> update::RequestBuilder {
228 update::RequestBuilder {
229 client: self.0.clone(),
230 organization: organization.into(),
231 body: body.into(),
232 wiki_identifier: wiki_identifier.into(),
233 project: project.into(),
234 }
235 }
236 #[doc = "Deletes the wiki corresponding to the wiki ID or wiki name provided."]
237 #[doc = ""]
238 #[doc = "Arguments:"]
239 #[doc = "* `organization`: The name of the Azure DevOps organization."]
240 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
241 #[doc = "* `project`: Project ID or project name"]
242 pub fn delete(
243 &self,
244 organization: impl Into<String>,
245 wiki_identifier: impl Into<String>,
246 project: impl Into<String>,
247 ) -> delete::RequestBuilder {
248 delete::RequestBuilder {
249 client: self.0.clone(),
250 organization: organization.into(),
251 wiki_identifier: wiki_identifier.into(),
252 project: project.into(),
253 }
254 }
255 }
256 pub mod list {
257 use super::models;
258 #[cfg(not(target_arch = "wasm32"))]
259 use futures::future::BoxFuture;
260 #[cfg(target_arch = "wasm32")]
261 use futures::future::LocalBoxFuture as BoxFuture;
262 #[derive(Debug)]
263 pub struct Response(
264 azure_core::http::Response<models::WikiV2List, azure_core::http::JsonFormat>,
265 );
266 impl Response {
267 pub fn into_body(self) -> azure_core::Result<models::WikiV2List> {
268 self.0.into_model()
269 }
270 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
271 self.0.into()
272 }
273 }
274 #[derive(Clone)]
275 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
276 #[doc = r""]
277 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
278 #[doc = r" parameters can be chained."]
279 #[doc = r""]
280 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
281 #[doc = r" converts the [`RequestBuilder`] into a future,"]
282 #[doc = r" executes the request and returns a `Result` with the parsed"]
283 #[doc = r" response."]
284 #[doc = r""]
285 #[doc = r" If you need lower-level access to the raw response details"]
286 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
287 #[doc = r" can finalize the request using the"]
288 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
289 #[doc = r" that resolves to a lower-level [`Response`] value."]
290 pub struct RequestBuilder {
291 pub(crate) client: super::super::Client,
292 pub(crate) organization: String,
293 pub(crate) project: String,
294 }
295 impl RequestBuilder {
296 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
297 #[doc = ""]
298 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
299 #[doc = "However, this function can provide more flexibility when required."]
300 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
301 Box::pin({
302 let this = self.clone();
303 async move {
304 let url = this.url()?;
305 let mut req =
306 azure_core::http::Request::new(url, azure_core::http::Method::Get);
307 if let Some(auth_header) = this
308 .client
309 .token_credential()
310 .http_authorization_header(&this.client.scopes())
311 .await?
312 {
313 req.insert_header(
314 azure_core::http::headers::AUTHORIZATION,
315 auth_header,
316 );
317 }
318 let req_body = azure_core::Bytes::new();
319 req.set_body(req_body);
320 Ok(Response(this.client.send(&mut req).await?.into()))
321 }
322 })
323 }
324 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
325 let mut url = azure_core::http::Url::parse(&format!(
326 "{}/{}/{}/_apis/wiki/wikis",
327 self.client.endpoint(),
328 &self.organization,
329 &self.project
330 ))?;
331 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
332 if !has_api_version_already {
333 url.query_pairs_mut()
334 .append_pair("api-version", "7.1-preview");
335 }
336 Ok(url)
337 }
338 }
339 impl std::future::IntoFuture for RequestBuilder {
340 type Output = azure_core::Result<models::WikiV2List>;
341 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiV2List>>;
342 #[doc = "Returns a future that sends the request and returns the parsed response body."]
343 #[doc = ""]
344 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
345 #[doc = ""]
346 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
347 fn into_future(self) -> Self::IntoFuture {
348 Box::pin(async move { self.send().await?.into_body() })
349 }
350 }
351 }
352 pub mod create {
353 use super::models;
354 #[cfg(not(target_arch = "wasm32"))]
355 use futures::future::BoxFuture;
356 #[cfg(target_arch = "wasm32")]
357 use futures::future::LocalBoxFuture as BoxFuture;
358 #[derive(Debug)]
359 pub struct Response(
360 azure_core::http::Response<models::WikiV2, azure_core::http::JsonFormat>,
361 );
362 impl Response {
363 pub fn into_body(self) -> azure_core::Result<models::WikiV2> {
364 self.0.into_model()
365 }
366 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
367 self.0.into()
368 }
369 }
370 #[derive(Clone)]
371 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
372 #[doc = r""]
373 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
374 #[doc = r" parameters can be chained."]
375 #[doc = r""]
376 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
377 #[doc = r" converts the [`RequestBuilder`] into a future,"]
378 #[doc = r" executes the request and returns a `Result` with the parsed"]
379 #[doc = r" response."]
380 #[doc = r""]
381 #[doc = r" If you need lower-level access to the raw response details"]
382 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
383 #[doc = r" can finalize the request using the"]
384 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
385 #[doc = r" that resolves to a lower-level [`Response`] value."]
386 pub struct RequestBuilder {
387 pub(crate) client: super::super::Client,
388 pub(crate) organization: String,
389 pub(crate) body: models::WikiCreateParametersV2,
390 pub(crate) project: String,
391 }
392 impl RequestBuilder {
393 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
394 #[doc = ""]
395 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
396 #[doc = "However, this function can provide more flexibility when required."]
397 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
398 Box::pin({
399 let this = self.clone();
400 async move {
401 let url = this.url()?;
402 let mut req =
403 azure_core::http::Request::new(url, azure_core::http::Method::Post);
404 if let Some(auth_header) = this
405 .client
406 .token_credential()
407 .http_authorization_header(&this.client.scopes())
408 .await?
409 {
410 req.insert_header(
411 azure_core::http::headers::AUTHORIZATION,
412 auth_header,
413 );
414 }
415 req.insert_header("content-type", "application/json");
416 let req_body = azure_core::json::to_json(&this.body)?;
417 req.set_body(req_body);
418 Ok(Response(this.client.send(&mut req).await?.into()))
419 }
420 })
421 }
422 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
423 let mut url = azure_core::http::Url::parse(&format!(
424 "{}/{}/{}/_apis/wiki/wikis",
425 self.client.endpoint(),
426 &self.organization,
427 &self.project
428 ))?;
429 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
430 if !has_api_version_already {
431 url.query_pairs_mut()
432 .append_pair("api-version", "7.1-preview");
433 }
434 Ok(url)
435 }
436 }
437 impl std::future::IntoFuture for RequestBuilder {
438 type Output = azure_core::Result<models::WikiV2>;
439 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiV2>>;
440 #[doc = "Returns a future that sends the request and returns the parsed response body."]
441 #[doc = ""]
442 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
443 #[doc = ""]
444 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
445 fn into_future(self) -> Self::IntoFuture {
446 Box::pin(async move { self.send().await?.into_body() })
447 }
448 }
449 }
450 pub mod get {
451 use super::models;
452 #[cfg(not(target_arch = "wasm32"))]
453 use futures::future::BoxFuture;
454 #[cfg(target_arch = "wasm32")]
455 use futures::future::LocalBoxFuture as BoxFuture;
456 #[derive(Debug)]
457 pub struct Response(
458 azure_core::http::Response<models::WikiV2, azure_core::http::JsonFormat>,
459 );
460 impl Response {
461 pub fn into_body(self) -> azure_core::Result<models::WikiV2> {
462 self.0.into_model()
463 }
464 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
465 self.0.into()
466 }
467 }
468 #[derive(Clone)]
469 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
470 #[doc = r""]
471 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
472 #[doc = r" parameters can be chained."]
473 #[doc = r""]
474 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
475 #[doc = r" converts the [`RequestBuilder`] into a future,"]
476 #[doc = r" executes the request and returns a `Result` with the parsed"]
477 #[doc = r" response."]
478 #[doc = r""]
479 #[doc = r" If you need lower-level access to the raw response details"]
480 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
481 #[doc = r" can finalize the request using the"]
482 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
483 #[doc = r" that resolves to a lower-level [`Response`] value."]
484 pub struct RequestBuilder {
485 pub(crate) client: super::super::Client,
486 pub(crate) organization: String,
487 pub(crate) wiki_identifier: String,
488 pub(crate) project: String,
489 }
490 impl RequestBuilder {
491 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
492 #[doc = ""]
493 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
494 #[doc = "However, this function can provide more flexibility when required."]
495 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
496 Box::pin({
497 let this = self.clone();
498 async move {
499 let url = this.url()?;
500 let mut req =
501 azure_core::http::Request::new(url, azure_core::http::Method::Get);
502 if let Some(auth_header) = this
503 .client
504 .token_credential()
505 .http_authorization_header(&this.client.scopes())
506 .await?
507 {
508 req.insert_header(
509 azure_core::http::headers::AUTHORIZATION,
510 auth_header,
511 );
512 }
513 let req_body = azure_core::Bytes::new();
514 req.set_body(req_body);
515 Ok(Response(this.client.send(&mut req).await?.into()))
516 }
517 })
518 }
519 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
520 let mut url = azure_core::http::Url::parse(&format!(
521 "{}/{}/{}/_apis/wiki/wikis/{}",
522 self.client.endpoint(),
523 &self.organization,
524 &self.project,
525 &self.wiki_identifier
526 ))?;
527 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
528 if !has_api_version_already {
529 url.query_pairs_mut()
530 .append_pair("api-version", "7.1-preview");
531 }
532 Ok(url)
533 }
534 }
535 impl std::future::IntoFuture for RequestBuilder {
536 type Output = azure_core::Result<models::WikiV2>;
537 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiV2>>;
538 #[doc = "Returns a future that sends the request and returns the parsed response body."]
539 #[doc = ""]
540 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
541 #[doc = ""]
542 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
543 fn into_future(self) -> Self::IntoFuture {
544 Box::pin(async move { self.send().await?.into_body() })
545 }
546 }
547 }
548 pub mod update {
549 use super::models;
550 #[cfg(not(target_arch = "wasm32"))]
551 use futures::future::BoxFuture;
552 #[cfg(target_arch = "wasm32")]
553 use futures::future::LocalBoxFuture as BoxFuture;
554 #[derive(Debug)]
555 pub struct Response(
556 azure_core::http::Response<models::WikiV2, azure_core::http::JsonFormat>,
557 );
558 impl Response {
559 pub fn into_body(self) -> azure_core::Result<models::WikiV2> {
560 self.0.into_model()
561 }
562 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
563 self.0.into()
564 }
565 }
566 #[derive(Clone)]
567 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
568 #[doc = r""]
569 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
570 #[doc = r" parameters can be chained."]
571 #[doc = r""]
572 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
573 #[doc = r" converts the [`RequestBuilder`] into a future,"]
574 #[doc = r" executes the request and returns a `Result` with the parsed"]
575 #[doc = r" response."]
576 #[doc = r""]
577 #[doc = r" If you need lower-level access to the raw response details"]
578 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
579 #[doc = r" can finalize the request using the"]
580 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
581 #[doc = r" that resolves to a lower-level [`Response`] value."]
582 pub struct RequestBuilder {
583 pub(crate) client: super::super::Client,
584 pub(crate) organization: String,
585 pub(crate) body: models::WikiUpdateParameters,
586 pub(crate) wiki_identifier: String,
587 pub(crate) project: String,
588 }
589 impl RequestBuilder {
590 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
591 #[doc = ""]
592 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
593 #[doc = "However, this function can provide more flexibility when required."]
594 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
595 Box::pin({
596 let this = self.clone();
597 async move {
598 let url = this.url()?;
599 let mut req =
600 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
601 if let Some(auth_header) = this
602 .client
603 .token_credential()
604 .http_authorization_header(&this.client.scopes())
605 .await?
606 {
607 req.insert_header(
608 azure_core::http::headers::AUTHORIZATION,
609 auth_header,
610 );
611 }
612 req.insert_header("content-type", "application/json");
613 let req_body = azure_core::json::to_json(&this.body)?;
614 req.set_body(req_body);
615 Ok(Response(this.client.send(&mut req).await?.into()))
616 }
617 })
618 }
619 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
620 let mut url = azure_core::http::Url::parse(&format!(
621 "{}/{}/{}/_apis/wiki/wikis/{}",
622 self.client.endpoint(),
623 &self.organization,
624 &self.project,
625 &self.wiki_identifier
626 ))?;
627 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
628 if !has_api_version_already {
629 url.query_pairs_mut()
630 .append_pair("api-version", "7.1-preview");
631 }
632 Ok(url)
633 }
634 }
635 impl std::future::IntoFuture for RequestBuilder {
636 type Output = azure_core::Result<models::WikiV2>;
637 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiV2>>;
638 #[doc = "Returns a future that sends the request and returns the parsed response body."]
639 #[doc = ""]
640 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
641 #[doc = ""]
642 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
643 fn into_future(self) -> Self::IntoFuture {
644 Box::pin(async move { self.send().await?.into_body() })
645 }
646 }
647 }
648 pub mod delete {
649 use super::models;
650 #[cfg(not(target_arch = "wasm32"))]
651 use futures::future::BoxFuture;
652 #[cfg(target_arch = "wasm32")]
653 use futures::future::LocalBoxFuture as BoxFuture;
654 #[derive(Debug)]
655 pub struct Response(
656 azure_core::http::Response<models::WikiV2, azure_core::http::JsonFormat>,
657 );
658 impl Response {
659 pub fn into_body(self) -> azure_core::Result<models::WikiV2> {
660 self.0.into_model()
661 }
662 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
663 self.0.into()
664 }
665 }
666 #[derive(Clone)]
667 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
668 #[doc = r""]
669 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
670 #[doc = r" parameters can be chained."]
671 #[doc = r""]
672 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
673 #[doc = r" converts the [`RequestBuilder`] into a future,"]
674 #[doc = r" executes the request and returns a `Result` with the parsed"]
675 #[doc = r" response."]
676 #[doc = r""]
677 #[doc = r" If you need lower-level access to the raw response details"]
678 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
679 #[doc = r" can finalize the request using the"]
680 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
681 #[doc = r" that resolves to a lower-level [`Response`] value."]
682 pub struct RequestBuilder {
683 pub(crate) client: super::super::Client,
684 pub(crate) organization: String,
685 pub(crate) wiki_identifier: String,
686 pub(crate) project: String,
687 }
688 impl RequestBuilder {
689 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
690 #[doc = ""]
691 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
692 #[doc = "However, this function can provide more flexibility when required."]
693 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
694 Box::pin({
695 let this = self.clone();
696 async move {
697 let url = this.url()?;
698 let mut req =
699 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
700 if let Some(auth_header) = this
701 .client
702 .token_credential()
703 .http_authorization_header(&this.client.scopes())
704 .await?
705 {
706 req.insert_header(
707 azure_core::http::headers::AUTHORIZATION,
708 auth_header,
709 );
710 }
711 let req_body = azure_core::Bytes::new();
712 req.set_body(req_body);
713 Ok(Response(this.client.send(&mut req).await?.into()))
714 }
715 })
716 }
717 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
718 let mut url = azure_core::http::Url::parse(&format!(
719 "{}/{}/{}/_apis/wiki/wikis/{}",
720 self.client.endpoint(),
721 &self.organization,
722 &self.project,
723 &self.wiki_identifier
724 ))?;
725 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
726 if !has_api_version_already {
727 url.query_pairs_mut()
728 .append_pair("api-version", "7.1-preview");
729 }
730 Ok(url)
731 }
732 }
733 impl std::future::IntoFuture for RequestBuilder {
734 type Output = azure_core::Result<models::WikiV2>;
735 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiV2>>;
736 #[doc = "Returns a future that sends the request and returns the parsed response body."]
737 #[doc = ""]
738 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
739 #[doc = ""]
740 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
741 fn into_future(self) -> Self::IntoFuture {
742 Box::pin(async move { self.send().await?.into_body() })
743 }
744 }
745 }
746}
747pub mod attachments {
748 use super::models;
749 #[cfg(not(target_arch = "wasm32"))]
750 use futures::future::BoxFuture;
751 #[cfg(target_arch = "wasm32")]
752 use futures::future::LocalBoxFuture as BoxFuture;
753 pub struct Client(pub(crate) super::Client);
754 impl Client {
755 #[doc = "Creates an attachment in the wiki."]
756 #[doc = ""]
757 #[doc = "Arguments:"]
758 #[doc = "* `organization`: The name of the Azure DevOps organization."]
759 #[doc = "* `body`: Stream to upload"]
760 #[doc = "* `project`: Project ID or project name"]
761 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
762 #[doc = "* `name`: Wiki attachment name."]
763 pub fn create(
764 &self,
765 organization: impl Into<String>,
766 body: impl Into<String>,
767 project: impl Into<String>,
768 wiki_identifier: impl Into<String>,
769 name: impl Into<String>,
770 ) -> create::RequestBuilder {
771 create::RequestBuilder {
772 client: self.0.clone(),
773 organization: organization.into(),
774 body: body.into(),
775 project: project.into(),
776 wiki_identifier: wiki_identifier.into(),
777 name: name.into(),
778 version_descriptor_version: None,
779 version_descriptor_version_options: None,
780 version_descriptor_version_type: None,
781 }
782 }
783 }
784 pub mod create {
785 use super::models;
786 #[cfg(not(target_arch = "wasm32"))]
787 use futures::future::BoxFuture;
788 #[cfg(target_arch = "wasm32")]
789 use futures::future::LocalBoxFuture as BoxFuture;
790 #[derive(Debug)]
791 pub struct Response(
792 azure_core::http::Response<models::WikiAttachment, azure_core::http::JsonFormat>,
793 );
794 impl Response {
795 pub fn into_body(self) -> azure_core::Result<models::WikiAttachment> {
796 self.0.into_model()
797 }
798 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
799 self.0.into()
800 }
801 pub fn headers(&self) -> Headers<'_> {
802 Headers(self.0.headers())
803 }
804 }
805 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
806 impl Headers<'_> {
807 pub fn e_tag(&self) -> azure_core::Result<&str> {
808 self.0
809 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
810 }
811 }
812 #[derive(Clone)]
813 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
814 #[doc = r""]
815 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
816 #[doc = r" parameters can be chained."]
817 #[doc = r""]
818 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
819 #[doc = r" converts the [`RequestBuilder`] into a future,"]
820 #[doc = r" executes the request and returns a `Result` with the parsed"]
821 #[doc = r" response."]
822 #[doc = r""]
823 #[doc = r" If you need lower-level access to the raw response details"]
824 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
825 #[doc = r" can finalize the request using the"]
826 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
827 #[doc = r" that resolves to a lower-level [`Response`] value."]
828 pub struct RequestBuilder {
829 pub(crate) client: super::super::Client,
830 pub(crate) organization: String,
831 pub(crate) body: String,
832 pub(crate) project: String,
833 pub(crate) wiki_identifier: String,
834 pub(crate) name: String,
835 pub(crate) version_descriptor_version: Option<String>,
836 pub(crate) version_descriptor_version_options: Option<String>,
837 pub(crate) version_descriptor_version_type: Option<String>,
838 }
839 impl RequestBuilder {
840 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
841 pub fn version_descriptor_version(
842 mut self,
843 version_descriptor_version: impl Into<String>,
844 ) -> Self {
845 self.version_descriptor_version = Some(version_descriptor_version.into());
846 self
847 }
848 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
849 pub fn version_descriptor_version_options(
850 mut self,
851 version_descriptor_version_options: impl Into<String>,
852 ) -> Self {
853 self.version_descriptor_version_options =
854 Some(version_descriptor_version_options.into());
855 self
856 }
857 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
858 pub fn version_descriptor_version_type(
859 mut self,
860 version_descriptor_version_type: impl Into<String>,
861 ) -> Self {
862 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
863 self
864 }
865 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
866 #[doc = ""]
867 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
868 #[doc = "However, this function can provide more flexibility when required."]
869 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
870 Box::pin({
871 let this = self.clone();
872 async move {
873 let url = this.url()?;
874 let mut req =
875 azure_core::http::Request::new(url, azure_core::http::Method::Put);
876 if let Some(auth_header) = this
877 .client
878 .token_credential()
879 .http_authorization_header(&this.client.scopes())
880 .await?
881 {
882 req.insert_header(
883 azure_core::http::headers::AUTHORIZATION,
884 auth_header,
885 );
886 }
887 req.insert_header("content-type", "application/octet-stream");
888 let req_body = azure_core::json::to_json(&this.body)?;
889 let name = &this.name;
890 req.url_mut().query_pairs_mut().append_pair("name", name);
891 if let Some(version_descriptor_version) = &this.version_descriptor_version {
892 req.url_mut().query_pairs_mut().append_pair(
893 "versionDescriptor.version",
894 version_descriptor_version,
895 );
896 }
897 if let Some(version_descriptor_version_options) =
898 &this.version_descriptor_version_options
899 {
900 req.url_mut().query_pairs_mut().append_pair(
901 "versionDescriptor.versionOptions",
902 version_descriptor_version_options,
903 );
904 }
905 if let Some(version_descriptor_version_type) =
906 &this.version_descriptor_version_type
907 {
908 req.url_mut().query_pairs_mut().append_pair(
909 "versionDescriptor.versionType",
910 version_descriptor_version_type,
911 );
912 }
913 req.set_body(req_body);
914 Ok(Response(this.client.send(&mut req).await?.into()))
915 }
916 })
917 }
918 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
919 let mut url = azure_core::http::Url::parse(&format!(
920 "{}/{}/{}/_apis/wiki/wikis/{}/attachments",
921 self.client.endpoint(),
922 &self.organization,
923 &self.project,
924 &self.wiki_identifier
925 ))?;
926 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
927 if !has_api_version_already {
928 url.query_pairs_mut()
929 .append_pair("api-version", "7.1-preview");
930 }
931 Ok(url)
932 }
933 }
934 impl std::future::IntoFuture for RequestBuilder {
935 type Output = azure_core::Result<models::WikiAttachment>;
936 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiAttachment>>;
937 #[doc = "Returns a future that sends the request and returns the parsed response body."]
938 #[doc = ""]
939 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
940 #[doc = ""]
941 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
942 fn into_future(self) -> Self::IntoFuture {
943 Box::pin(async move { self.send().await?.into_body() })
944 }
945 }
946 }
947}
948pub mod page_moves {
949 use super::models;
950 #[cfg(not(target_arch = "wasm32"))]
951 use futures::future::BoxFuture;
952 #[cfg(target_arch = "wasm32")]
953 use futures::future::LocalBoxFuture as BoxFuture;
954 pub struct Client(pub(crate) super::Client);
955 impl Client {
956 #[doc = "Creates a page move operation that updates the path and order of the page as provided in the parameters."]
957 #[doc = ""]
958 #[doc = "Arguments:"]
959 #[doc = "* `organization`: The name of the Azure DevOps organization."]
960 #[doc = "* `body`: Page more operation parameters."]
961 #[doc = "* `project`: Project ID or project name"]
962 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
963 pub fn create(
964 &self,
965 organization: impl Into<String>,
966 body: impl Into<models::WikiPageMoveParameters>,
967 project: impl Into<String>,
968 wiki_identifier: impl Into<String>,
969 ) -> create::RequestBuilder {
970 create::RequestBuilder {
971 client: self.0.clone(),
972 organization: organization.into(),
973 body: body.into(),
974 project: project.into(),
975 wiki_identifier: wiki_identifier.into(),
976 comment: None,
977 version_descriptor_version: None,
978 version_descriptor_version_options: None,
979 version_descriptor_version_type: None,
980 }
981 }
982 }
983 pub mod create {
984 use super::models;
985 #[cfg(not(target_arch = "wasm32"))]
986 use futures::future::BoxFuture;
987 #[cfg(target_arch = "wasm32")]
988 use futures::future::LocalBoxFuture as BoxFuture;
989 #[derive(Debug)]
990 pub struct Response(
991 azure_core::http::Response<models::WikiPageMove, azure_core::http::JsonFormat>,
992 );
993 impl Response {
994 pub fn into_body(self) -> azure_core::Result<models::WikiPageMove> {
995 self.0.into_model()
996 }
997 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
998 self.0.into()
999 }
1000 pub fn headers(&self) -> Headers<'_> {
1001 Headers(self.0.headers())
1002 }
1003 }
1004 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
1005 impl Headers<'_> {
1006 pub fn e_tag(&self) -> azure_core::Result<&str> {
1007 self.0
1008 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
1009 }
1010 }
1011 #[derive(Clone)]
1012 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1013 #[doc = r""]
1014 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1015 #[doc = r" parameters can be chained."]
1016 #[doc = r""]
1017 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1018 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1019 #[doc = r" executes the request and returns a `Result` with the parsed"]
1020 #[doc = r" response."]
1021 #[doc = r""]
1022 #[doc = r" If you need lower-level access to the raw response details"]
1023 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1024 #[doc = r" can finalize the request using the"]
1025 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1026 #[doc = r" that resolves to a lower-level [`Response`] value."]
1027 pub struct RequestBuilder {
1028 pub(crate) client: super::super::Client,
1029 pub(crate) organization: String,
1030 pub(crate) body: models::WikiPageMoveParameters,
1031 pub(crate) project: String,
1032 pub(crate) wiki_identifier: String,
1033 pub(crate) comment: Option<String>,
1034 pub(crate) version_descriptor_version: Option<String>,
1035 pub(crate) version_descriptor_version_options: Option<String>,
1036 pub(crate) version_descriptor_version_type: Option<String>,
1037 }
1038 impl RequestBuilder {
1039 #[doc = "Comment that is to be associated with this page move."]
1040 pub fn comment(mut self, comment: impl Into<String>) -> Self {
1041 self.comment = Some(comment.into());
1042 self
1043 }
1044 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
1045 pub fn version_descriptor_version(
1046 mut self,
1047 version_descriptor_version: impl Into<String>,
1048 ) -> Self {
1049 self.version_descriptor_version = Some(version_descriptor_version.into());
1050 self
1051 }
1052 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
1053 pub fn version_descriptor_version_options(
1054 mut self,
1055 version_descriptor_version_options: impl Into<String>,
1056 ) -> Self {
1057 self.version_descriptor_version_options =
1058 Some(version_descriptor_version_options.into());
1059 self
1060 }
1061 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
1062 pub fn version_descriptor_version_type(
1063 mut self,
1064 version_descriptor_version_type: impl Into<String>,
1065 ) -> Self {
1066 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
1067 self
1068 }
1069 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1070 #[doc = ""]
1071 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1072 #[doc = "However, this function can provide more flexibility when required."]
1073 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1074 Box::pin({
1075 let this = self.clone();
1076 async move {
1077 let url = this.url()?;
1078 let mut req =
1079 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1080 if let Some(auth_header) = this
1081 .client
1082 .token_credential()
1083 .http_authorization_header(&this.client.scopes())
1084 .await?
1085 {
1086 req.insert_header(
1087 azure_core::http::headers::AUTHORIZATION,
1088 auth_header,
1089 );
1090 }
1091 req.insert_header("content-type", "application/json");
1092 let req_body = azure_core::json::to_json(&this.body)?;
1093 if let Some(comment) = &this.comment {
1094 req.url_mut()
1095 .query_pairs_mut()
1096 .append_pair("comment", comment);
1097 }
1098 if let Some(version_descriptor_version) = &this.version_descriptor_version {
1099 req.url_mut().query_pairs_mut().append_pair(
1100 "versionDescriptor.version",
1101 version_descriptor_version,
1102 );
1103 }
1104 if let Some(version_descriptor_version_options) =
1105 &this.version_descriptor_version_options
1106 {
1107 req.url_mut().query_pairs_mut().append_pair(
1108 "versionDescriptor.versionOptions",
1109 version_descriptor_version_options,
1110 );
1111 }
1112 if let Some(version_descriptor_version_type) =
1113 &this.version_descriptor_version_type
1114 {
1115 req.url_mut().query_pairs_mut().append_pair(
1116 "versionDescriptor.versionType",
1117 version_descriptor_version_type,
1118 );
1119 }
1120 req.set_body(req_body);
1121 Ok(Response(this.client.send(&mut req).await?.into()))
1122 }
1123 })
1124 }
1125 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1126 let mut url = azure_core::http::Url::parse(&format!(
1127 "{}/{}/{}/_apis/wiki/wikis/{}/pagemoves",
1128 self.client.endpoint(),
1129 &self.organization,
1130 &self.project,
1131 &self.wiki_identifier
1132 ))?;
1133 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1134 if !has_api_version_already {
1135 url.query_pairs_mut()
1136 .append_pair("api-version", "7.1-preview");
1137 }
1138 Ok(url)
1139 }
1140 }
1141 impl std::future::IntoFuture for RequestBuilder {
1142 type Output = azure_core::Result<models::WikiPageMove>;
1143 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPageMove>>;
1144 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1145 #[doc = ""]
1146 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1147 #[doc = ""]
1148 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1149 fn into_future(self) -> Self::IntoFuture {
1150 Box::pin(async move { self.send().await?.into_body() })
1151 }
1152 }
1153 }
1154}
1155pub mod pages {
1156 use super::models;
1157 #[cfg(not(target_arch = "wasm32"))]
1158 use futures::future::BoxFuture;
1159 #[cfg(target_arch = "wasm32")]
1160 use futures::future::LocalBoxFuture as BoxFuture;
1161 pub struct Client(pub(crate) super::Client);
1162 impl Client {
1163 #[doc = "Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request."]
1164 #[doc = ""]
1165 #[doc = "Arguments:"]
1166 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1167 #[doc = "* `project`: Project ID or project name"]
1168 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
1169 pub fn get_page(
1170 &self,
1171 organization: impl Into<String>,
1172 project: impl Into<String>,
1173 wiki_identifier: impl Into<String>,
1174 ) -> get_page::RequestBuilder {
1175 get_page::RequestBuilder {
1176 client: self.0.clone(),
1177 organization: organization.into(),
1178 project: project.into(),
1179 wiki_identifier: wiki_identifier.into(),
1180 path: None,
1181 recursion_level: None,
1182 version_descriptor_version: None,
1183 version_descriptor_version_options: None,
1184 version_descriptor_version_type: None,
1185 include_content: None,
1186 }
1187 }
1188 #[doc = "Creates or edits a wiki page."]
1189 #[doc = ""]
1190 #[doc = "Arguments:"]
1191 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1192 #[doc = "* `body`: Wiki create or update operation parameters."]
1193 #[doc = "* `project`: Project ID or project name"]
1194 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
1195 #[doc = "* `path`: Wiki page path."]
1196 #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."]
1197 pub fn create_or_update(
1198 &self,
1199 organization: impl Into<String>,
1200 body: impl Into<models::WikiPageCreateOrUpdateParameters>,
1201 project: impl Into<String>,
1202 wiki_identifier: impl Into<String>,
1203 path: impl Into<String>,
1204 if_match: impl Into<String>,
1205 ) -> create_or_update::RequestBuilder {
1206 create_or_update::RequestBuilder {
1207 client: self.0.clone(),
1208 organization: organization.into(),
1209 body: body.into(),
1210 project: project.into(),
1211 wiki_identifier: wiki_identifier.into(),
1212 path: path.into(),
1213 if_match: if_match.into(),
1214 comment: None,
1215 version_descriptor_version: None,
1216 version_descriptor_version_options: None,
1217 version_descriptor_version_type: None,
1218 }
1219 }
1220 #[doc = "Deletes a wiki page."]
1221 #[doc = ""]
1222 #[doc = "Arguments:"]
1223 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1224 #[doc = "* `project`: Project ID or project name"]
1225 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
1226 #[doc = "* `path`: Wiki page path."]
1227 pub fn delete_page(
1228 &self,
1229 organization: impl Into<String>,
1230 project: impl Into<String>,
1231 wiki_identifier: impl Into<String>,
1232 path: impl Into<String>,
1233 ) -> delete_page::RequestBuilder {
1234 delete_page::RequestBuilder {
1235 client: self.0.clone(),
1236 organization: organization.into(),
1237 project: project.into(),
1238 wiki_identifier: wiki_identifier.into(),
1239 path: path.into(),
1240 comment: None,
1241 version_descriptor_version: None,
1242 version_descriptor_version_options: None,
1243 version_descriptor_version_type: None,
1244 }
1245 }
1246 #[doc = "Gets metadata or content of the wiki page for the provided page id. Content negotiation is done based on the `Accept` header sent in the request."]
1247 #[doc = ""]
1248 #[doc = "Arguments:"]
1249 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1250 #[doc = "* `project`: Project ID or project name"]
1251 #[doc = "* `wiki_identifier`: Wiki ID or wiki name.."]
1252 #[doc = "* `id`: Wiki page ID."]
1253 pub fn get_page_by_id(
1254 &self,
1255 organization: impl Into<String>,
1256 project: impl Into<String>,
1257 wiki_identifier: impl Into<String>,
1258 id: i32,
1259 ) -> get_page_by_id::RequestBuilder {
1260 get_page_by_id::RequestBuilder {
1261 client: self.0.clone(),
1262 organization: organization.into(),
1263 project: project.into(),
1264 wiki_identifier: wiki_identifier.into(),
1265 id,
1266 recursion_level: None,
1267 include_content: None,
1268 }
1269 }
1270 #[doc = "Edits a wiki page."]
1271 #[doc = ""]
1272 #[doc = "Arguments:"]
1273 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1274 #[doc = "* `body`: Wiki update operation parameters."]
1275 #[doc = "* `project`: Project ID or project name"]
1276 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
1277 #[doc = "* `id`: Wiki page ID."]
1278 #[doc = "* `if_match`: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request."]
1279 pub fn update(
1280 &self,
1281 organization: impl Into<String>,
1282 body: impl Into<models::WikiPageCreateOrUpdateParameters>,
1283 project: impl Into<String>,
1284 wiki_identifier: impl Into<String>,
1285 id: i32,
1286 if_match: impl Into<String>,
1287 ) -> update::RequestBuilder {
1288 update::RequestBuilder {
1289 client: self.0.clone(),
1290 organization: organization.into(),
1291 body: body.into(),
1292 project: project.into(),
1293 wiki_identifier: wiki_identifier.into(),
1294 id,
1295 if_match: if_match.into(),
1296 comment: None,
1297 }
1298 }
1299 #[doc = "Deletes a wiki page."]
1300 #[doc = ""]
1301 #[doc = "Arguments:"]
1302 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1303 #[doc = "* `project`: Project ID or project name"]
1304 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
1305 #[doc = "* `id`: Wiki page ID."]
1306 pub fn delete_page_by_id(
1307 &self,
1308 organization: impl Into<String>,
1309 project: impl Into<String>,
1310 wiki_identifier: impl Into<String>,
1311 id: i32,
1312 ) -> delete_page_by_id::RequestBuilder {
1313 delete_page_by_id::RequestBuilder {
1314 client: self.0.clone(),
1315 organization: organization.into(),
1316 project: project.into(),
1317 wiki_identifier: wiki_identifier.into(),
1318 id,
1319 comment: None,
1320 }
1321 }
1322 }
1323 pub mod get_page {
1324 use super::models;
1325 #[cfg(not(target_arch = "wasm32"))]
1326 use futures::future::BoxFuture;
1327 #[cfg(target_arch = "wasm32")]
1328 use futures::future::LocalBoxFuture as BoxFuture;
1329 #[derive(Debug)]
1330 pub struct Response(
1331 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
1332 );
1333 impl Response {
1334 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
1335 self.0.into_model()
1336 }
1337 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1338 self.0.into()
1339 }
1340 pub fn headers(&self) -> Headers<'_> {
1341 Headers(self.0.headers())
1342 }
1343 }
1344 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
1345 impl Headers<'_> {
1346 pub fn e_tag(&self) -> azure_core::Result<&str> {
1347 self.0
1348 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
1349 }
1350 }
1351 #[derive(Clone)]
1352 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1353 #[doc = r""]
1354 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1355 #[doc = r" parameters can be chained."]
1356 #[doc = r""]
1357 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1358 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1359 #[doc = r" executes the request and returns a `Result` with the parsed"]
1360 #[doc = r" response."]
1361 #[doc = r""]
1362 #[doc = r" If you need lower-level access to the raw response details"]
1363 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1364 #[doc = r" can finalize the request using the"]
1365 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1366 #[doc = r" that resolves to a lower-level [`Response`] value."]
1367 pub struct RequestBuilder {
1368 pub(crate) client: super::super::Client,
1369 pub(crate) organization: String,
1370 pub(crate) project: String,
1371 pub(crate) wiki_identifier: String,
1372 pub(crate) path: Option<String>,
1373 pub(crate) recursion_level: Option<String>,
1374 pub(crate) version_descriptor_version: Option<String>,
1375 pub(crate) version_descriptor_version_options: Option<String>,
1376 pub(crate) version_descriptor_version_type: Option<String>,
1377 pub(crate) include_content: Option<bool>,
1378 }
1379 impl RequestBuilder {
1380 #[doc = "Wiki page path."]
1381 pub fn path(mut self, path: impl Into<String>) -> Self {
1382 self.path = Some(path.into());
1383 self
1384 }
1385 #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."]
1386 pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self {
1387 self.recursion_level = Some(recursion_level.into());
1388 self
1389 }
1390 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
1391 pub fn version_descriptor_version(
1392 mut self,
1393 version_descriptor_version: impl Into<String>,
1394 ) -> Self {
1395 self.version_descriptor_version = Some(version_descriptor_version.into());
1396 self
1397 }
1398 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
1399 pub fn version_descriptor_version_options(
1400 mut self,
1401 version_descriptor_version_options: impl Into<String>,
1402 ) -> Self {
1403 self.version_descriptor_version_options =
1404 Some(version_descriptor_version_options.into());
1405 self
1406 }
1407 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
1408 pub fn version_descriptor_version_type(
1409 mut self,
1410 version_descriptor_version_type: impl Into<String>,
1411 ) -> Self {
1412 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
1413 self
1414 }
1415 #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"]
1416 pub fn include_content(mut self, include_content: bool) -> Self {
1417 self.include_content = Some(include_content);
1418 self
1419 }
1420 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1421 #[doc = ""]
1422 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1423 #[doc = "However, this function can provide more flexibility when required."]
1424 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1425 Box::pin({
1426 let this = self.clone();
1427 async move {
1428 let url = this.url()?;
1429 let mut req =
1430 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1431 if let Some(auth_header) = this
1432 .client
1433 .token_credential()
1434 .http_authorization_header(&this.client.scopes())
1435 .await?
1436 {
1437 req.insert_header(
1438 azure_core::http::headers::AUTHORIZATION,
1439 auth_header,
1440 );
1441 }
1442 if let Some(path) = &this.path {
1443 req.url_mut().query_pairs_mut().append_pair("path", path);
1444 }
1445 if let Some(recursion_level) = &this.recursion_level {
1446 req.url_mut()
1447 .query_pairs_mut()
1448 .append_pair("recursionLevel", recursion_level);
1449 }
1450 if let Some(version_descriptor_version) = &this.version_descriptor_version {
1451 req.url_mut().query_pairs_mut().append_pair(
1452 "versionDescriptor.version",
1453 version_descriptor_version,
1454 );
1455 }
1456 if let Some(version_descriptor_version_options) =
1457 &this.version_descriptor_version_options
1458 {
1459 req.url_mut().query_pairs_mut().append_pair(
1460 "versionDescriptor.versionOptions",
1461 version_descriptor_version_options,
1462 );
1463 }
1464 if let Some(version_descriptor_version_type) =
1465 &this.version_descriptor_version_type
1466 {
1467 req.url_mut().query_pairs_mut().append_pair(
1468 "versionDescriptor.versionType",
1469 version_descriptor_version_type,
1470 );
1471 }
1472 if let Some(include_content) = &this.include_content {
1473 req.url_mut()
1474 .query_pairs_mut()
1475 .append_pair("includeContent", &include_content.to_string());
1476 }
1477 let req_body = azure_core::Bytes::new();
1478 req.set_body(req_body);
1479 Ok(Response(this.client.send(&mut req).await?.into()))
1480 }
1481 })
1482 }
1483 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1484 let mut url = azure_core::http::Url::parse(&format!(
1485 "{}/{}/{}/_apis/wiki/wikis/{}/pages",
1486 self.client.endpoint(),
1487 &self.organization,
1488 &self.project,
1489 &self.wiki_identifier
1490 ))?;
1491 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1492 if !has_api_version_already {
1493 url.query_pairs_mut()
1494 .append_pair("api-version", "7.1-preview");
1495 }
1496 Ok(url)
1497 }
1498 }
1499 impl std::future::IntoFuture for RequestBuilder {
1500 type Output = azure_core::Result<models::WikiPage>;
1501 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
1502 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1503 #[doc = ""]
1504 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1505 #[doc = ""]
1506 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1507 fn into_future(self) -> Self::IntoFuture {
1508 Box::pin(async move { self.send().await?.into_body() })
1509 }
1510 }
1511 }
1512 pub mod create_or_update {
1513 use super::models;
1514 #[cfg(not(target_arch = "wasm32"))]
1515 use futures::future::BoxFuture;
1516 #[cfg(target_arch = "wasm32")]
1517 use futures::future::LocalBoxFuture as BoxFuture;
1518 #[derive(Debug)]
1519 pub struct Response(
1520 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
1521 );
1522 impl Response {
1523 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
1524 self.0.into_model()
1525 }
1526 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1527 self.0.into()
1528 }
1529 pub fn headers(&self) -> Headers<'_> {
1530 Headers(self.0.headers())
1531 }
1532 }
1533 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
1534 impl Headers<'_> {
1535 pub fn e_tag(&self) -> azure_core::Result<&str> {
1536 self.0
1537 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
1538 }
1539 }
1540 #[derive(Clone)]
1541 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1542 #[doc = r""]
1543 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1544 #[doc = r" parameters can be chained."]
1545 #[doc = r""]
1546 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1547 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1548 #[doc = r" executes the request and returns a `Result` with the parsed"]
1549 #[doc = r" response."]
1550 #[doc = r""]
1551 #[doc = r" If you need lower-level access to the raw response details"]
1552 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1553 #[doc = r" can finalize the request using the"]
1554 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1555 #[doc = r" that resolves to a lower-level [`Response`] value."]
1556 pub struct RequestBuilder {
1557 pub(crate) client: super::super::Client,
1558 pub(crate) organization: String,
1559 pub(crate) body: models::WikiPageCreateOrUpdateParameters,
1560 pub(crate) project: String,
1561 pub(crate) wiki_identifier: String,
1562 pub(crate) path: String,
1563 pub(crate) if_match: String,
1564 pub(crate) comment: Option<String>,
1565 pub(crate) version_descriptor_version: Option<String>,
1566 pub(crate) version_descriptor_version_options: Option<String>,
1567 pub(crate) version_descriptor_version_type: Option<String>,
1568 }
1569 impl RequestBuilder {
1570 #[doc = "Comment to be associated with the page operation."]
1571 pub fn comment(mut self, comment: impl Into<String>) -> Self {
1572 self.comment = Some(comment.into());
1573 self
1574 }
1575 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
1576 pub fn version_descriptor_version(
1577 mut self,
1578 version_descriptor_version: impl Into<String>,
1579 ) -> Self {
1580 self.version_descriptor_version = Some(version_descriptor_version.into());
1581 self
1582 }
1583 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
1584 pub fn version_descriptor_version_options(
1585 mut self,
1586 version_descriptor_version_options: impl Into<String>,
1587 ) -> Self {
1588 self.version_descriptor_version_options =
1589 Some(version_descriptor_version_options.into());
1590 self
1591 }
1592 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
1593 pub fn version_descriptor_version_type(
1594 mut self,
1595 version_descriptor_version_type: impl Into<String>,
1596 ) -> Self {
1597 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
1598 self
1599 }
1600 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1601 #[doc = ""]
1602 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1603 #[doc = "However, this function can provide more flexibility when required."]
1604 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1605 Box::pin({
1606 let this = self.clone();
1607 async move {
1608 let url = this.url()?;
1609 let mut req =
1610 azure_core::http::Request::new(url, azure_core::http::Method::Put);
1611 if let Some(auth_header) = this
1612 .client
1613 .token_credential()
1614 .http_authorization_header(&this.client.scopes())
1615 .await?
1616 {
1617 req.insert_header(
1618 azure_core::http::headers::AUTHORIZATION,
1619 auth_header,
1620 );
1621 }
1622 req.insert_header("content-type", "application/json");
1623 let req_body = azure_core::json::to_json(&this.body)?;
1624 let path = &this.path;
1625 req.url_mut().query_pairs_mut().append_pair("path", path);
1626 req.insert_header("if-match", &this.if_match);
1627 if let Some(comment) = &this.comment {
1628 req.url_mut()
1629 .query_pairs_mut()
1630 .append_pair("comment", comment);
1631 }
1632 if let Some(version_descriptor_version) = &this.version_descriptor_version {
1633 req.url_mut().query_pairs_mut().append_pair(
1634 "versionDescriptor.version",
1635 version_descriptor_version,
1636 );
1637 }
1638 if let Some(version_descriptor_version_options) =
1639 &this.version_descriptor_version_options
1640 {
1641 req.url_mut().query_pairs_mut().append_pair(
1642 "versionDescriptor.versionOptions",
1643 version_descriptor_version_options,
1644 );
1645 }
1646 if let Some(version_descriptor_version_type) =
1647 &this.version_descriptor_version_type
1648 {
1649 req.url_mut().query_pairs_mut().append_pair(
1650 "versionDescriptor.versionType",
1651 version_descriptor_version_type,
1652 );
1653 }
1654 req.set_body(req_body);
1655 Ok(Response(this.client.send(&mut req).await?.into()))
1656 }
1657 })
1658 }
1659 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1660 let mut url = azure_core::http::Url::parse(&format!(
1661 "{}/{}/{}/_apis/wiki/wikis/{}/pages",
1662 self.client.endpoint(),
1663 &self.organization,
1664 &self.project,
1665 &self.wiki_identifier
1666 ))?;
1667 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1668 if !has_api_version_already {
1669 url.query_pairs_mut()
1670 .append_pair("api-version", "7.1-preview");
1671 }
1672 Ok(url)
1673 }
1674 }
1675 impl std::future::IntoFuture for RequestBuilder {
1676 type Output = azure_core::Result<models::WikiPage>;
1677 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
1678 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1679 #[doc = ""]
1680 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1681 #[doc = ""]
1682 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1683 fn into_future(self) -> Self::IntoFuture {
1684 Box::pin(async move { self.send().await?.into_body() })
1685 }
1686 }
1687 }
1688 pub mod delete_page {
1689 use super::models;
1690 #[cfg(not(target_arch = "wasm32"))]
1691 use futures::future::BoxFuture;
1692 #[cfg(target_arch = "wasm32")]
1693 use futures::future::LocalBoxFuture as BoxFuture;
1694 #[derive(Debug)]
1695 pub struct Response(
1696 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
1697 );
1698 impl Response {
1699 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
1700 self.0.into_model()
1701 }
1702 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1703 self.0.into()
1704 }
1705 pub fn headers(&self) -> Headers<'_> {
1706 Headers(self.0.headers())
1707 }
1708 }
1709 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
1710 impl Headers<'_> {
1711 pub fn e_tag(&self) -> azure_core::Result<&str> {
1712 self.0
1713 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
1714 }
1715 }
1716 #[derive(Clone)]
1717 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1718 #[doc = r""]
1719 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1720 #[doc = r" parameters can be chained."]
1721 #[doc = r""]
1722 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1723 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1724 #[doc = r" executes the request and returns a `Result` with the parsed"]
1725 #[doc = r" response."]
1726 #[doc = r""]
1727 #[doc = r" If you need lower-level access to the raw response details"]
1728 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1729 #[doc = r" can finalize the request using the"]
1730 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1731 #[doc = r" that resolves to a lower-level [`Response`] value."]
1732 pub struct RequestBuilder {
1733 pub(crate) client: super::super::Client,
1734 pub(crate) organization: String,
1735 pub(crate) project: String,
1736 pub(crate) wiki_identifier: String,
1737 pub(crate) path: String,
1738 pub(crate) comment: Option<String>,
1739 pub(crate) version_descriptor_version: Option<String>,
1740 pub(crate) version_descriptor_version_options: Option<String>,
1741 pub(crate) version_descriptor_version_type: Option<String>,
1742 }
1743 impl RequestBuilder {
1744 #[doc = "Comment to be associated with this page delete."]
1745 pub fn comment(mut self, comment: impl Into<String>) -> Self {
1746 self.comment = Some(comment.into());
1747 self
1748 }
1749 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
1750 pub fn version_descriptor_version(
1751 mut self,
1752 version_descriptor_version: impl Into<String>,
1753 ) -> Self {
1754 self.version_descriptor_version = Some(version_descriptor_version.into());
1755 self
1756 }
1757 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
1758 pub fn version_descriptor_version_options(
1759 mut self,
1760 version_descriptor_version_options: impl Into<String>,
1761 ) -> Self {
1762 self.version_descriptor_version_options =
1763 Some(version_descriptor_version_options.into());
1764 self
1765 }
1766 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
1767 pub fn version_descriptor_version_type(
1768 mut self,
1769 version_descriptor_version_type: impl Into<String>,
1770 ) -> Self {
1771 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
1772 self
1773 }
1774 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1775 #[doc = ""]
1776 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1777 #[doc = "However, this function can provide more flexibility when required."]
1778 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1779 Box::pin({
1780 let this = self.clone();
1781 async move {
1782 let url = this.url()?;
1783 let mut req =
1784 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
1785 if let Some(auth_header) = this
1786 .client
1787 .token_credential()
1788 .http_authorization_header(&this.client.scopes())
1789 .await?
1790 {
1791 req.insert_header(
1792 azure_core::http::headers::AUTHORIZATION,
1793 auth_header,
1794 );
1795 }
1796 let path = &this.path;
1797 req.url_mut().query_pairs_mut().append_pair("path", path);
1798 if let Some(comment) = &this.comment {
1799 req.url_mut()
1800 .query_pairs_mut()
1801 .append_pair("comment", comment);
1802 }
1803 if let Some(version_descriptor_version) = &this.version_descriptor_version {
1804 req.url_mut().query_pairs_mut().append_pair(
1805 "versionDescriptor.version",
1806 version_descriptor_version,
1807 );
1808 }
1809 if let Some(version_descriptor_version_options) =
1810 &this.version_descriptor_version_options
1811 {
1812 req.url_mut().query_pairs_mut().append_pair(
1813 "versionDescriptor.versionOptions",
1814 version_descriptor_version_options,
1815 );
1816 }
1817 if let Some(version_descriptor_version_type) =
1818 &this.version_descriptor_version_type
1819 {
1820 req.url_mut().query_pairs_mut().append_pair(
1821 "versionDescriptor.versionType",
1822 version_descriptor_version_type,
1823 );
1824 }
1825 let req_body = azure_core::Bytes::new();
1826 req.set_body(req_body);
1827 Ok(Response(this.client.send(&mut req).await?.into()))
1828 }
1829 })
1830 }
1831 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1832 let mut url = azure_core::http::Url::parse(&format!(
1833 "{}/{}/{}/_apis/wiki/wikis/{}/pages",
1834 self.client.endpoint(),
1835 &self.organization,
1836 &self.project,
1837 &self.wiki_identifier
1838 ))?;
1839 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1840 if !has_api_version_already {
1841 url.query_pairs_mut()
1842 .append_pair("api-version", "7.1-preview");
1843 }
1844 Ok(url)
1845 }
1846 }
1847 impl std::future::IntoFuture for RequestBuilder {
1848 type Output = azure_core::Result<models::WikiPage>;
1849 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
1850 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1851 #[doc = ""]
1852 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1853 #[doc = ""]
1854 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1855 fn into_future(self) -> Self::IntoFuture {
1856 Box::pin(async move { self.send().await?.into_body() })
1857 }
1858 }
1859 }
1860 pub mod get_page_by_id {
1861 use super::models;
1862 #[cfg(not(target_arch = "wasm32"))]
1863 use futures::future::BoxFuture;
1864 #[cfg(target_arch = "wasm32")]
1865 use futures::future::LocalBoxFuture as BoxFuture;
1866 #[derive(Debug)]
1867 pub struct Response(
1868 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
1869 );
1870 impl Response {
1871 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
1872 self.0.into_model()
1873 }
1874 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1875 self.0.into()
1876 }
1877 pub fn headers(&self) -> Headers<'_> {
1878 Headers(self.0.headers())
1879 }
1880 }
1881 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
1882 impl Headers<'_> {
1883 pub fn e_tag(&self) -> azure_core::Result<&str> {
1884 self.0
1885 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
1886 }
1887 }
1888 #[derive(Clone)]
1889 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1890 #[doc = r""]
1891 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1892 #[doc = r" parameters can be chained."]
1893 #[doc = r""]
1894 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1895 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1896 #[doc = r" executes the request and returns a `Result` with the parsed"]
1897 #[doc = r" response."]
1898 #[doc = r""]
1899 #[doc = r" If you need lower-level access to the raw response details"]
1900 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1901 #[doc = r" can finalize the request using the"]
1902 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1903 #[doc = r" that resolves to a lower-level [`Response`] value."]
1904 pub struct RequestBuilder {
1905 pub(crate) client: super::super::Client,
1906 pub(crate) organization: String,
1907 pub(crate) project: String,
1908 pub(crate) wiki_identifier: String,
1909 pub(crate) id: i32,
1910 pub(crate) recursion_level: Option<String>,
1911 pub(crate) include_content: Option<bool>,
1912 }
1913 impl RequestBuilder {
1914 #[doc = "Recursion level for subpages retrieval. Defaults to `None` (Optional)."]
1915 pub fn recursion_level(mut self, recursion_level: impl Into<String>) -> Self {
1916 self.recursion_level = Some(recursion_level.into());
1917 self
1918 }
1919 #[doc = "Set to true to include the content of the page in the response for Json content type. Defaults to false (Optional)"]
1920 pub fn include_content(mut self, include_content: bool) -> Self {
1921 self.include_content = Some(include_content);
1922 self
1923 }
1924 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1925 #[doc = ""]
1926 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1927 #[doc = "However, this function can provide more flexibility when required."]
1928 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1929 Box::pin({
1930 let this = self.clone();
1931 async move {
1932 let url = this.url()?;
1933 let mut req =
1934 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1935 if let Some(auth_header) = this
1936 .client
1937 .token_credential()
1938 .http_authorization_header(&this.client.scopes())
1939 .await?
1940 {
1941 req.insert_header(
1942 azure_core::http::headers::AUTHORIZATION,
1943 auth_header,
1944 );
1945 }
1946 if let Some(recursion_level) = &this.recursion_level {
1947 req.url_mut()
1948 .query_pairs_mut()
1949 .append_pair("recursionLevel", recursion_level);
1950 }
1951 if let Some(include_content) = &this.include_content {
1952 req.url_mut()
1953 .query_pairs_mut()
1954 .append_pair("includeContent", &include_content.to_string());
1955 }
1956 let req_body = azure_core::Bytes::new();
1957 req.set_body(req_body);
1958 Ok(Response(this.client.send(&mut req).await?.into()))
1959 }
1960 })
1961 }
1962 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1963 let mut url = azure_core::http::Url::parse(&format!(
1964 "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}",
1965 self.client.endpoint(),
1966 &self.organization,
1967 &self.project,
1968 &self.wiki_identifier,
1969 &self.id
1970 ))?;
1971 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1972 if !has_api_version_already {
1973 url.query_pairs_mut()
1974 .append_pair("api-version", "7.1-preview");
1975 }
1976 Ok(url)
1977 }
1978 }
1979 impl std::future::IntoFuture for RequestBuilder {
1980 type Output = azure_core::Result<models::WikiPage>;
1981 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
1982 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1983 #[doc = ""]
1984 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1985 #[doc = ""]
1986 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1987 fn into_future(self) -> Self::IntoFuture {
1988 Box::pin(async move { self.send().await?.into_body() })
1989 }
1990 }
1991 }
1992 pub mod update {
1993 use super::models;
1994 #[cfg(not(target_arch = "wasm32"))]
1995 use futures::future::BoxFuture;
1996 #[cfg(target_arch = "wasm32")]
1997 use futures::future::LocalBoxFuture as BoxFuture;
1998 #[derive(Debug)]
1999 pub struct Response(
2000 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
2001 );
2002 impl Response {
2003 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
2004 self.0.into_model()
2005 }
2006 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2007 self.0.into()
2008 }
2009 pub fn headers(&self) -> Headers<'_> {
2010 Headers(self.0.headers())
2011 }
2012 }
2013 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
2014 impl Headers<'_> {
2015 pub fn e_tag(&self) -> azure_core::Result<&str> {
2016 self.0
2017 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
2018 }
2019 }
2020 #[derive(Clone)]
2021 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2022 #[doc = r""]
2023 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2024 #[doc = r" parameters can be chained."]
2025 #[doc = r""]
2026 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2027 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2028 #[doc = r" executes the request and returns a `Result` with the parsed"]
2029 #[doc = r" response."]
2030 #[doc = r""]
2031 #[doc = r" If you need lower-level access to the raw response details"]
2032 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2033 #[doc = r" can finalize the request using the"]
2034 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2035 #[doc = r" that resolves to a lower-level [`Response`] value."]
2036 pub struct RequestBuilder {
2037 pub(crate) client: super::super::Client,
2038 pub(crate) organization: String,
2039 pub(crate) body: models::WikiPageCreateOrUpdateParameters,
2040 pub(crate) project: String,
2041 pub(crate) wiki_identifier: String,
2042 pub(crate) id: i32,
2043 pub(crate) if_match: String,
2044 pub(crate) comment: Option<String>,
2045 }
2046 impl RequestBuilder {
2047 #[doc = "Comment to be associated with the page operation."]
2048 pub fn comment(mut self, comment: impl Into<String>) -> Self {
2049 self.comment = Some(comment.into());
2050 self
2051 }
2052 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2053 #[doc = ""]
2054 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2055 #[doc = "However, this function can provide more flexibility when required."]
2056 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2057 Box::pin({
2058 let this = self.clone();
2059 async move {
2060 let url = this.url()?;
2061 let mut req =
2062 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
2063 if let Some(auth_header) = this
2064 .client
2065 .token_credential()
2066 .http_authorization_header(&this.client.scopes())
2067 .await?
2068 {
2069 req.insert_header(
2070 azure_core::http::headers::AUTHORIZATION,
2071 auth_header,
2072 );
2073 }
2074 req.insert_header("content-type", "application/json");
2075 let req_body = azure_core::json::to_json(&this.body)?;
2076 req.insert_header("if-match", &this.if_match);
2077 if let Some(comment) = &this.comment {
2078 req.url_mut()
2079 .query_pairs_mut()
2080 .append_pair("comment", comment);
2081 }
2082 req.set_body(req_body);
2083 Ok(Response(this.client.send(&mut req).await?.into()))
2084 }
2085 })
2086 }
2087 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2088 let mut url = azure_core::http::Url::parse(&format!(
2089 "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}",
2090 self.client.endpoint(),
2091 &self.organization,
2092 &self.project,
2093 &self.wiki_identifier,
2094 &self.id
2095 ))?;
2096 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2097 if !has_api_version_already {
2098 url.query_pairs_mut()
2099 .append_pair("api-version", "7.1-preview");
2100 }
2101 Ok(url)
2102 }
2103 }
2104 impl std::future::IntoFuture for RequestBuilder {
2105 type Output = azure_core::Result<models::WikiPage>;
2106 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
2107 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2108 #[doc = ""]
2109 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2110 #[doc = ""]
2111 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2112 fn into_future(self) -> Self::IntoFuture {
2113 Box::pin(async move { self.send().await?.into_body() })
2114 }
2115 }
2116 }
2117 pub mod delete_page_by_id {
2118 use super::models;
2119 #[cfg(not(target_arch = "wasm32"))]
2120 use futures::future::BoxFuture;
2121 #[cfg(target_arch = "wasm32")]
2122 use futures::future::LocalBoxFuture as BoxFuture;
2123 #[derive(Debug)]
2124 pub struct Response(
2125 azure_core::http::Response<models::WikiPage, azure_core::http::JsonFormat>,
2126 );
2127 impl Response {
2128 pub fn into_body(self) -> azure_core::Result<models::WikiPage> {
2129 self.0.into_model()
2130 }
2131 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2132 self.0.into()
2133 }
2134 pub fn headers(&self) -> Headers<'_> {
2135 Headers(self.0.headers())
2136 }
2137 }
2138 pub struct Headers<'a>(&'a azure_core::http::headers::Headers);
2139 impl Headers<'_> {
2140 pub fn e_tag(&self) -> azure_core::Result<&str> {
2141 self.0
2142 .get_str(&azure_core::http::headers::HeaderName::from_static("etag"))
2143 }
2144 }
2145 #[derive(Clone)]
2146 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2147 #[doc = r""]
2148 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2149 #[doc = r" parameters can be chained."]
2150 #[doc = r""]
2151 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2152 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2153 #[doc = r" executes the request and returns a `Result` with the parsed"]
2154 #[doc = r" response."]
2155 #[doc = r""]
2156 #[doc = r" If you need lower-level access to the raw response details"]
2157 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2158 #[doc = r" can finalize the request using the"]
2159 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2160 #[doc = r" that resolves to a lower-level [`Response`] value."]
2161 pub struct RequestBuilder {
2162 pub(crate) client: super::super::Client,
2163 pub(crate) organization: String,
2164 pub(crate) project: String,
2165 pub(crate) wiki_identifier: String,
2166 pub(crate) id: i32,
2167 pub(crate) comment: Option<String>,
2168 }
2169 impl RequestBuilder {
2170 #[doc = "Comment to be associated with this page delete."]
2171 pub fn comment(mut self, comment: impl Into<String>) -> Self {
2172 self.comment = Some(comment.into());
2173 self
2174 }
2175 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2176 #[doc = ""]
2177 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2178 #[doc = "However, this function can provide more flexibility when required."]
2179 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2180 Box::pin({
2181 let this = self.clone();
2182 async move {
2183 let url = this.url()?;
2184 let mut req =
2185 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
2186 if let Some(auth_header) = this
2187 .client
2188 .token_credential()
2189 .http_authorization_header(&this.client.scopes())
2190 .await?
2191 {
2192 req.insert_header(
2193 azure_core::http::headers::AUTHORIZATION,
2194 auth_header,
2195 );
2196 }
2197 if let Some(comment) = &this.comment {
2198 req.url_mut()
2199 .query_pairs_mut()
2200 .append_pair("comment", comment);
2201 }
2202 let req_body = azure_core::Bytes::new();
2203 req.set_body(req_body);
2204 Ok(Response(this.client.send(&mut req).await?.into()))
2205 }
2206 })
2207 }
2208 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2209 let mut url = azure_core::http::Url::parse(&format!(
2210 "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}",
2211 self.client.endpoint(),
2212 &self.organization,
2213 &self.project,
2214 &self.wiki_identifier,
2215 &self.id
2216 ))?;
2217 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2218 if !has_api_version_already {
2219 url.query_pairs_mut()
2220 .append_pair("api-version", "7.1-preview");
2221 }
2222 Ok(url)
2223 }
2224 }
2225 impl std::future::IntoFuture for RequestBuilder {
2226 type Output = azure_core::Result<models::WikiPage>;
2227 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPage>>;
2228 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2229 #[doc = ""]
2230 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2231 #[doc = ""]
2232 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2233 fn into_future(self) -> Self::IntoFuture {
2234 Box::pin(async move { self.send().await?.into_body() })
2235 }
2236 }
2237 }
2238}
2239pub mod page_stats {
2240 use super::models;
2241 #[cfg(not(target_arch = "wasm32"))]
2242 use futures::future::BoxFuture;
2243 #[cfg(target_arch = "wasm32")]
2244 use futures::future::LocalBoxFuture as BoxFuture;
2245 pub struct Client(pub(crate) super::Client);
2246 impl Client {
2247 #[doc = "Returns page detail corresponding to Page ID."]
2248 #[doc = ""]
2249 #[doc = "Arguments:"]
2250 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2251 #[doc = "* `project`: Project ID or project name"]
2252 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
2253 #[doc = "* `page_id`: Wiki page ID."]
2254 pub fn get(
2255 &self,
2256 organization: impl Into<String>,
2257 project: impl Into<String>,
2258 wiki_identifier: impl Into<String>,
2259 page_id: i32,
2260 ) -> get::RequestBuilder {
2261 get::RequestBuilder {
2262 client: self.0.clone(),
2263 organization: organization.into(),
2264 project: project.into(),
2265 wiki_identifier: wiki_identifier.into(),
2266 page_id,
2267 page_views_for_days: None,
2268 }
2269 }
2270 }
2271 pub mod get {
2272 use super::models;
2273 #[cfg(not(target_arch = "wasm32"))]
2274 use futures::future::BoxFuture;
2275 #[cfg(target_arch = "wasm32")]
2276 use futures::future::LocalBoxFuture as BoxFuture;
2277 #[derive(Debug)]
2278 pub struct Response(
2279 azure_core::http::Response<models::WikiPageDetail, azure_core::http::JsonFormat>,
2280 );
2281 impl Response {
2282 pub fn into_body(self) -> azure_core::Result<models::WikiPageDetail> {
2283 self.0.into_model()
2284 }
2285 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2286 self.0.into()
2287 }
2288 }
2289 #[derive(Clone)]
2290 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2291 #[doc = r""]
2292 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2293 #[doc = r" parameters can be chained."]
2294 #[doc = r""]
2295 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2296 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2297 #[doc = r" executes the request and returns a `Result` with the parsed"]
2298 #[doc = r" response."]
2299 #[doc = r""]
2300 #[doc = r" If you need lower-level access to the raw response details"]
2301 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2302 #[doc = r" can finalize the request using the"]
2303 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2304 #[doc = r" that resolves to a lower-level [`Response`] value."]
2305 pub struct RequestBuilder {
2306 pub(crate) client: super::super::Client,
2307 pub(crate) organization: String,
2308 pub(crate) project: String,
2309 pub(crate) wiki_identifier: String,
2310 pub(crate) page_id: i32,
2311 pub(crate) page_views_for_days: Option<i32>,
2312 }
2313 impl RequestBuilder {
2314 #[doc = "last N days from the current day for which page views is to be returned. It's inclusive of current day."]
2315 pub fn page_views_for_days(mut self, page_views_for_days: i32) -> Self {
2316 self.page_views_for_days = Some(page_views_for_days);
2317 self
2318 }
2319 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2320 #[doc = ""]
2321 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2322 #[doc = "However, this function can provide more flexibility when required."]
2323 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2324 Box::pin({
2325 let this = self.clone();
2326 async move {
2327 let url = this.url()?;
2328 let mut req =
2329 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2330 if let Some(auth_header) = this
2331 .client
2332 .token_credential()
2333 .http_authorization_header(&this.client.scopes())
2334 .await?
2335 {
2336 req.insert_header(
2337 azure_core::http::headers::AUTHORIZATION,
2338 auth_header,
2339 );
2340 }
2341 if let Some(page_views_for_days) = &this.page_views_for_days {
2342 req.url_mut()
2343 .query_pairs_mut()
2344 .append_pair("pageViewsForDays", &page_views_for_days.to_string());
2345 }
2346 let req_body = azure_core::Bytes::new();
2347 req.set_body(req_body);
2348 Ok(Response(this.client.send(&mut req).await?.into()))
2349 }
2350 })
2351 }
2352 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2353 let mut url = azure_core::http::Url::parse(&format!(
2354 "{}/{}/{}/_apis/wiki/wikis/{}/pages/{}/stats",
2355 self.client.endpoint(),
2356 &self.organization,
2357 &self.project,
2358 &self.wiki_identifier,
2359 &self.page_id
2360 ))?;
2361 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2362 if !has_api_version_already {
2363 url.query_pairs_mut()
2364 .append_pair("api-version", "7.1-preview");
2365 }
2366 Ok(url)
2367 }
2368 }
2369 impl std::future::IntoFuture for RequestBuilder {
2370 type Output = azure_core::Result<models::WikiPageDetail>;
2371 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPageDetail>>;
2372 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2373 #[doc = ""]
2374 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2375 #[doc = ""]
2376 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2377 fn into_future(self) -> Self::IntoFuture {
2378 Box::pin(async move { self.send().await?.into_body() })
2379 }
2380 }
2381 }
2382}
2383pub mod pages_batch {
2384 use super::models;
2385 #[cfg(not(target_arch = "wasm32"))]
2386 use futures::future::BoxFuture;
2387 #[cfg(target_arch = "wasm32")]
2388 use futures::future::LocalBoxFuture as BoxFuture;
2389 pub struct Client(pub(crate) super::Client);
2390 impl Client {
2391 #[doc = "Returns pageable list of Wiki Pages"]
2392 #[doc = ""]
2393 #[doc = "Arguments:"]
2394 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2395 #[doc = "* `body`: Wiki batch page request."]
2396 #[doc = "* `project`: Project ID or project name"]
2397 #[doc = "* `wiki_identifier`: Wiki ID or wiki name."]
2398 pub fn get(
2399 &self,
2400 organization: impl Into<String>,
2401 body: impl Into<models::WikiPagesBatchRequest>,
2402 project: impl Into<String>,
2403 wiki_identifier: impl Into<String>,
2404 ) -> get::RequestBuilder {
2405 get::RequestBuilder {
2406 client: self.0.clone(),
2407 organization: organization.into(),
2408 body: body.into(),
2409 project: project.into(),
2410 wiki_identifier: wiki_identifier.into(),
2411 version_descriptor_version: None,
2412 version_descriptor_version_options: None,
2413 version_descriptor_version_type: None,
2414 }
2415 }
2416 }
2417 pub mod get {
2418 use super::models;
2419 #[cfg(not(target_arch = "wasm32"))]
2420 use futures::future::BoxFuture;
2421 #[cfg(target_arch = "wasm32")]
2422 use futures::future::LocalBoxFuture as BoxFuture;
2423 #[derive(Debug)]
2424 pub struct Response(
2425 azure_core::http::Response<models::WikiPageDetailList, azure_core::http::JsonFormat>,
2426 );
2427 impl Response {
2428 pub fn into_body(self) -> azure_core::Result<models::WikiPageDetailList> {
2429 self.0.into_model()
2430 }
2431 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2432 self.0.into()
2433 }
2434 }
2435 #[derive(Clone)]
2436 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2437 #[doc = r""]
2438 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2439 #[doc = r" parameters can be chained."]
2440 #[doc = r""]
2441 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2442 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2443 #[doc = r" executes the request and returns a `Result` with the parsed"]
2444 #[doc = r" response."]
2445 #[doc = r""]
2446 #[doc = r" If you need lower-level access to the raw response details"]
2447 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2448 #[doc = r" can finalize the request using the"]
2449 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2450 #[doc = r" that resolves to a lower-level [`Response`] value."]
2451 pub struct RequestBuilder {
2452 pub(crate) client: super::super::Client,
2453 pub(crate) organization: String,
2454 pub(crate) body: models::WikiPagesBatchRequest,
2455 pub(crate) project: String,
2456 pub(crate) wiki_identifier: String,
2457 pub(crate) version_descriptor_version: Option<String>,
2458 pub(crate) version_descriptor_version_options: Option<String>,
2459 pub(crate) version_descriptor_version_type: Option<String>,
2460 }
2461 impl RequestBuilder {
2462 #[doc = "Version string identifier (name of tag/branch, SHA1 of commit)"]
2463 pub fn version_descriptor_version(
2464 mut self,
2465 version_descriptor_version: impl Into<String>,
2466 ) -> Self {
2467 self.version_descriptor_version = Some(version_descriptor_version.into());
2468 self
2469 }
2470 #[doc = "Version options - Specify additional modifiers to version (e.g Previous)"]
2471 pub fn version_descriptor_version_options(
2472 mut self,
2473 version_descriptor_version_options: impl Into<String>,
2474 ) -> Self {
2475 self.version_descriptor_version_options =
2476 Some(version_descriptor_version_options.into());
2477 self
2478 }
2479 #[doc = "Version type (branch, tag, or commit). Determines how Id is interpreted"]
2480 pub fn version_descriptor_version_type(
2481 mut self,
2482 version_descriptor_version_type: impl Into<String>,
2483 ) -> Self {
2484 self.version_descriptor_version_type = Some(version_descriptor_version_type.into());
2485 self
2486 }
2487 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2488 #[doc = ""]
2489 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2490 #[doc = "However, this function can provide more flexibility when required."]
2491 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2492 Box::pin({
2493 let this = self.clone();
2494 async move {
2495 let url = this.url()?;
2496 let mut req =
2497 azure_core::http::Request::new(url, azure_core::http::Method::Post);
2498 if let Some(auth_header) = this
2499 .client
2500 .token_credential()
2501 .http_authorization_header(&this.client.scopes())
2502 .await?
2503 {
2504 req.insert_header(
2505 azure_core::http::headers::AUTHORIZATION,
2506 auth_header,
2507 );
2508 }
2509 req.insert_header("content-type", "application/json");
2510 let req_body = azure_core::json::to_json(&this.body)?;
2511 if let Some(version_descriptor_version) = &this.version_descriptor_version {
2512 req.url_mut().query_pairs_mut().append_pair(
2513 "versionDescriptor.version",
2514 version_descriptor_version,
2515 );
2516 }
2517 if let Some(version_descriptor_version_options) =
2518 &this.version_descriptor_version_options
2519 {
2520 req.url_mut().query_pairs_mut().append_pair(
2521 "versionDescriptor.versionOptions",
2522 version_descriptor_version_options,
2523 );
2524 }
2525 if let Some(version_descriptor_version_type) =
2526 &this.version_descriptor_version_type
2527 {
2528 req.url_mut().query_pairs_mut().append_pair(
2529 "versionDescriptor.versionType",
2530 version_descriptor_version_type,
2531 );
2532 }
2533 req.set_body(req_body);
2534 Ok(Response(this.client.send(&mut req).await?.into()))
2535 }
2536 })
2537 }
2538 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2539 let mut url = azure_core::http::Url::parse(&format!(
2540 "{}/{}/{}/_apis/wiki/wikis/{}/pagesbatch",
2541 self.client.endpoint(),
2542 &self.organization,
2543 &self.project,
2544 &self.wiki_identifier
2545 ))?;
2546 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2547 if !has_api_version_already {
2548 url.query_pairs_mut()
2549 .append_pair("api-version", "7.1-preview");
2550 }
2551 Ok(url)
2552 }
2553 }
2554 impl std::future::IntoFuture for RequestBuilder {
2555 type Output = azure_core::Result<models::WikiPageDetailList>;
2556 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WikiPageDetailList>>;
2557 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2558 #[doc = ""]
2559 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2560 #[doc = ""]
2561 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2562 fn into_future(self) -> Self::IntoFuture {
2563 Box::pin(async move { self.send().await?.into_body() })
2564 }
2565 }
2566 }
2567}