#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(clippy::redundant_clone)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::module_inception)]
pub mod models;
#[derive(Clone)]
pub struct Client {
endpoint: azure_core::http::Url,
credential: crate::Credential,
scopes: Vec<String>,
pipeline: azure_core::http::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
credential: crate::Credential,
endpoint: Option<azure_core::http::Url>,
scopes: Option<Vec<String>>,
options: azure_core::http::ClientOptions,
}
azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com");
impl ClientBuilder {
#[doc = "Create a new instance of `ClientBuilder`."]
#[must_use]
pub fn new(credential: crate::Credential) -> Self {
Self {
credential,
endpoint: None,
scopes: None,
options: azure_core::http::ClientOptions::default(),
}
}
#[doc = "Set the endpoint."]
#[must_use]
pub fn endpoint(mut self, endpoint: impl Into<azure_core::http::Url>) -> Self {
self.endpoint = Some(endpoint.into());
self
}
#[doc = "Set the scopes."]
#[must_use]
pub fn scopes(mut self, scopes: &[&str]) -> Self {
self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
self
}
#[doc = "Set the retry options."]
#[must_use]
pub fn retry(mut self, retry: impl Into<azure_core::http::RetryOptions>) -> Self {
self.options.retry = retry.into();
self
}
#[doc = "Set the transport options."]
#[must_use]
pub fn transport(mut self, transport: impl Into<azure_core::http::Transport>) -> Self {
self.options.transport = Some(transport.into());
self
}
#[doc = "Set per-call policies."]
#[must_use]
pub fn per_call_policies(
mut self,
policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
) -> Self {
self.options.per_call_policies = policies.into();
self
}
#[doc = "Set per-try policies."]
#[must_use]
pub fn per_try_policies(
mut self,
policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
) -> Self {
self.options.per_try_policies = policies.into();
self
}
#[doc = "Convert the builder into a `Client` instance."]
pub fn build(self) -> Client {
let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
let scopes = self
.scopes
.unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]);
Client::new(endpoint, self.credential, scopes, self.options)
}
}
impl Client {
pub(crate) fn endpoint(&self) -> &azure_core::http::Url {
&self.endpoint
}
pub(crate) fn token_credential(&self) -> &crate::Credential {
&self.credential
}
pub(crate) fn scopes(&self) -> Vec<&str> {
self.scopes.iter().map(String::as_str).collect()
}
pub(crate) async fn send(
&self,
request: &mut azure_core::http::Request,
) -> azure_core::Result<azure_core::http::RawResponse> {
let context = azure_core::http::Context::default();
self.pipeline.send(&context, request, None).await
}
#[doc = "Create a new `ClientBuilder`."]
#[must_use]
pub fn builder(credential: crate::Credential) -> ClientBuilder {
ClientBuilder::new(credential)
}
#[doc = "Create a new `Client`."]
#[must_use]
pub fn new(
endpoint: impl Into<azure_core::http::Url>,
credential: crate::Credential,
scopes: Vec<String>,
options: azure_core::http::ClientOptions,
) -> Self {
let endpoint = endpoint.into();
let pipeline = azure_core::http::Pipeline::new(
option_env!("CARGO_PKG_NAME"),
option_env!("CARGO_PKG_VERSION"),
options,
Vec::new(),
Vec::new(),
None,
);
Self {
endpoint,
credential,
scopes,
pipeline,
}
}
pub fn behaviors_client(&self) -> behaviors::Client {
behaviors::Client(self.clone())
}
pub fn controls_client(&self) -> controls::Client {
controls::Client(self.clone())
}
pub fn fields_client(&self) -> fields::Client {
fields::Client(self.clone())
}
pub fn groups_client(&self) -> groups::Client {
groups::Client(self.clone())
}
pub fn layout_client(&self) -> layout::Client {
layout::Client(self.clone())
}
pub fn lists_client(&self) -> lists::Client {
lists::Client(self.clone())
}
pub fn pages_client(&self) -> pages::Client {
pages::Client(self.clone())
}
pub fn processes_client(&self) -> processes::Client {
processes::Client(self.clone())
}
pub fn rules_client(&self) -> rules::Client {
rules::Client(self.clone())
}
pub fn states_client(&self) -> states::Client {
states::Client(self.clone())
}
pub fn system_controls_client(&self) -> system_controls::Client {
system_controls::Client(self.clone())
}
pub fn work_item_types_client(&self) -> work_item_types::Client {
work_item_types::Client(self.clone())
}
pub fn work_item_types_behaviors_client(&self) -> work_item_types_behaviors::Client {
work_item_types_behaviors::Client(self.clone())
}
}
pub mod groups {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Moves a group to a different page and section."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The updated group."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `page_id`: The ID of the page the group is in."]
#[doc = "* `section_id`: The ID of the section the group is i.n"]
#[doc = "* `group_id`: The ID of the group."]
#[doc = "* `remove_from_page_id`: ID of the page to remove the group from."]
#[doc = "* `remove_from_section_id`: ID of the section to remove the group from."]
pub fn move_group_to_page(
&self,
organization: impl Into<String>,
body: impl Into<models::Group>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
section_id: impl Into<String>,
group_id: impl Into<String>,
remove_from_page_id: impl Into<String>,
remove_from_section_id: impl Into<String>,
) -> move_group_to_page::RequestBuilder {
move_group_to_page::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
section_id: section_id.into(),
group_id: group_id.into(),
remove_from_page_id: remove_from_page_id.into(),
remove_from_section_id: remove_from_section_id.into(),
}
}
#[doc = "Adds a group to the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The group."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `page_id`: The ID of the page to add the group to."]
#[doc = "* `section_id`: The ID of the section to add the group to."]
pub fn add(
&self,
organization: impl Into<String>,
body: impl Into<models::Group>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
section_id: impl Into<String>,
) -> add::RequestBuilder {
add::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
section_id: section_id.into(),
}
}
#[doc = "Moves a group to a different section."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The updated group."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `page_id`: The ID of the page the group is in."]
#[doc = "* `section_id`: The ID of the section the group is in."]
#[doc = "* `group_id`: The ID of the group."]
#[doc = "* `remove_from_section_id`: ID of the section to remove the group from."]
pub fn move_group_to_section(
&self,
organization: impl Into<String>,
body: impl Into<models::Group>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
section_id: impl Into<String>,
group_id: impl Into<String>,
remove_from_section_id: impl Into<String>,
) -> move_group_to_section::RequestBuilder {
move_group_to_section::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
section_id: section_id.into(),
group_id: group_id.into(),
remove_from_section_id: remove_from_section_id.into(),
}
}
#[doc = "Updates a group in the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The updated group."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `page_id`: The ID of the page the group is in."]
#[doc = "* `section_id`: The ID of the section the group is in."]
#[doc = "* `group_id`: The ID of the group."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::Group>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
section_id: impl Into<String>,
group_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
section_id: section_id.into(),
group_id: group_id.into(),
}
}
#[doc = "Removes a group from the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `page_id`: The ID of the page the group is in"]
#[doc = "* `section_id`: The ID of the section to the group is in"]
#[doc = "* `group_id`: The ID of the group"]
pub fn remove_group(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
section_id: impl Into<String>,
group_id: impl Into<String>,
) -> remove_group::RequestBuilder {
remove_group::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
section_id: section_id.into(),
group_id: group_id.into(),
}
}
}
pub mod move_group_to_page {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Group, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Group> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Group,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
pub(crate) section_id: String,
pub(crate) group_id: String,
pub(crate) remove_from_page_id: String,
pub(crate) remove_from_section_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
let remove_from_page_id = &this.remove_from_page_id;
req.url_mut()
.query_pairs_mut()
.append_pair("removeFromPageId", remove_from_page_id);
let remove_from_section_id = &this.remove_from_section_id;
req.url_mut()
.query_pairs_mut()
.append_pair("removeFromSectionId", remove_from_section_id);
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}?removeFromPageId={}&removeFromSectionId={}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id , & self . remove_from_page_id , & self . remove_from_section_id)) ? ;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Group>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Group>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod add {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Group, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Group> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Group,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
pub(crate) section_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id)) ? ;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Group>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Group>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod move_group_to_section {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Group, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Group> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Group,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
pub(crate) section_id: String,
pub(crate) group_id: String,
pub(crate) remove_from_section_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
let remove_from_section_id = &this.remove_from_section_id;
req.url_mut()
.query_pairs_mut()
.append_pair("removeFromSectionId", remove_from_section_id);
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Group>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Group>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Group, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Group> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Group,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
pub(crate) section_id: String,
pub(crate) group_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Group>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Group>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod remove_group {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
pub(crate) section_id: String,
pub(crate) group_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}/sections/{}/groups/{}" , self . client . endpoint () , & self . organization , & self . process_id , & self . wit_ref_name , & self . page_id , & self . section_id , & self . group_id)) ? ;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod processes {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get list of all processes including system and inherited."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
expand: None,
}
}
#[doc = "Creates a process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: CreateProcessModel."]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::CreateProcessModel>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
}
}
#[doc = "Get a single process of a specified ID."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
pub fn get(
&self,
organization: impl Into<String>,
process_type_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_type_id: process_type_id.into(),
expand: None,
}
}
#[doc = "Edit a process of a specific ID."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
pub fn edit_process(
&self,
organization: impl Into<String>,
body: impl Into<models::UpdateProcessModel>,
process_type_id: impl Into<String>,
) -> edit_process::RequestBuilder {
edit_process::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_type_id: process_type_id.into(),
}
}
#[doc = "Removes a process of a specific ID."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
pub fn delete(
&self,
organization: impl Into<String>,
process_type_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_type_id: process_type_id.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessInfoList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessInfoList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) expand: Option<models::GetProcessExpandLevel>,
}
impl RequestBuilder {
pub fn expand(mut self, expand: impl Into<models::GetProcessExpandLevel>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes",
self.client.endpoint(),
&self.organization
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessInfoList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessInfoList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessInfo, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessInfo> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::CreateProcessModel,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes",
self.client.endpoint(),
&self.organization
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessInfo>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessInfo>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessInfo, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessInfo> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_type_id: String,
pub(crate) expand: Option<models::GetProcessExpandLevel>,
}
impl RequestBuilder {
pub fn expand(mut self, expand: impl Into<models::GetProcessExpandLevel>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}",
self.client.endpoint(),
&self.organization,
&self.process_type_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessInfo>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessInfo>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod edit_process {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessInfo, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessInfo> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::UpdateProcessModel,
pub(crate) process_type_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}",
self.client.endpoint(),
&self.organization,
&self.process_type_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessInfo>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessInfo>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_type_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}",
self.client.endpoint(),
&self.organization,
&self.process_type_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod behaviors {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all behaviors in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
expand: None,
}
}
#[doc = "Creates a single behavior in the given process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::ProcessBehaviorCreateRequest>,
process_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
}
}
#[doc = "Returns a behavior of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `behavior_ref_name`: The reference name of the behavior"]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
behavior_ref_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
behavior_ref_name: behavior_ref_name.into(),
expand: None,
}
}
#[doc = "Replaces a behavior in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `behavior_ref_name`: The reference name of the behavior"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::ProcessBehaviorUpdateRequest>,
process_id: impl Into<String>,
behavior_ref_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
behavior_ref_name: behavior_ref_name.into(),
}
}
#[doc = "Removes a behavior in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `behavior_ref_name`: The reference name of the behavior"]
pub fn delete(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
behavior_ref_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
behavior_ref_name: behavior_ref_name.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessBehaviorList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessBehaviorList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) expand: Option<models::GetBehaviorsExpand>,
}
impl RequestBuilder {
pub fn expand(mut self, expand: impl Into<models::GetBehaviorsExpand>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/behaviors",
self.client.endpoint(),
&self.organization,
&self.process_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessBehaviorList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessBehaviorList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ProcessBehaviorCreateRequest,
pub(crate) process_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/behaviors",
self.client.endpoint(),
&self.organization,
&self.process_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) behavior_ref_name: String,
pub(crate) expand: Option<models::GetBehaviorsExpand>,
}
impl RequestBuilder {
pub fn expand(mut self, expand: impl Into<models::GetBehaviorsExpand>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/behaviors/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.behavior_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ProcessBehaviorUpdateRequest,
pub(crate) process_id: String,
pub(crate) behavior_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/behaviors/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.behavior_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) behavior_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/behaviors/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.behavior_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod work_item_types {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all work item types in a process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
expand: None,
}
}
#[doc = "Creates a work item type in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process on which to create work item type."]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::CreateProcessWorkItemTypeRequest>,
process_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
}
}
#[doc = "Returns a single work item type in a process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
expand: None,
}
}
#[doc = "Updates a work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::UpdateProcessWorkItemTypeRequest>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Removes a work item type in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn delete(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::ProcessWorkItemTypeList,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) expand: Option<models::GetWorkItemTypeExpand>,
}
impl RequestBuilder {
#[doc = "Flag to determine what properties of work item type to return"]
pub fn expand(mut self, expand: impl Into<models::GetWorkItemTypeExpand>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypes",
self.client.endpoint(),
&self.organization,
&self.process_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemTypeList>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessWorkItemType, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::CreateProcessWorkItemTypeRequest,
pub(crate) process_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypes",
self.client.endpoint(),
&self.organization,
&self.process_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemType>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessWorkItemType, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) expand: Option<models::GetWorkItemTypeExpand>,
}
impl RequestBuilder {
#[doc = "Flag to determine what properties of work item type to return"]
pub fn expand(mut self, expand: impl Into<models::GetWorkItemTypeExpand>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypes/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemType>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessWorkItemType, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemType> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::UpdateProcessWorkItemTypeRequest,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypes/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemType>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessWorkItemType>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypes/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod fields {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all fields in a work item type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Adds a field to a work item type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn add(
&self,
organization: impl Into<String>,
body: impl Into<models::AddProcessWorkItemTypeFieldRequest>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> add::RequestBuilder {
add::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Returns a field in a work item type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `field_ref_name`: The reference name of the field."]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
field_ref_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
field_ref_name: field_ref_name.into(),
expand: None,
}
}
#[doc = "Updates a field in a work item type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `field_ref_name`: The reference name of the field."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::UpdateProcessWorkItemTypeFieldRequest>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
field_ref_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
field_ref_name: field_ref_name.into(),
}
}
#[doc = "Removes a field from a work item type. Does not permanently delete the field."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `field_ref_name`: The reference name of the field."]
pub fn remove_work_item_type_field(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
field_ref_name: impl Into<String>,
) -> remove_work_item_type_field::RequestBuilder {
remove_work_item_type_field::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
field_ref_name: field_ref_name.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::ProcessWorkItemTypeFieldList,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeFieldList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemTypeFieldList>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeFieldList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod add {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::ProcessWorkItemTypeField,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::AddProcessWorkItemTypeFieldRequest,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemTypeField>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::ProcessWorkItemTypeField,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) field_ref_name: String,
pub(crate) expand: Option<models::ProcessWorkItemTypeFieldsExpandLevel>,
}
impl RequestBuilder {
pub fn expand(
mut self,
expand: impl Into<models::ProcessWorkItemTypeFieldsExpandLevel>,
) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", &expand.to_string());
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.field_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemTypeField>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::ProcessWorkItemTypeField,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessWorkItemTypeField> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::UpdateProcessWorkItemTypeFieldRequest,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) field_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.field_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessWorkItemTypeField>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::ProcessWorkItemTypeField>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod remove_work_item_type_field {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) field_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/fields/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.field_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod layout {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the form layout."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::FormLayout, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::FormLayout> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::FormLayout>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::FormLayout>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
}
pub mod controls {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Creates a control in a group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The control."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `group_id`: The ID of the group to add the control to."]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::Control>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
group_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
group_id: group_id.into(),
}
}
#[doc = "Moves a control to a specified group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The control."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `group_id`: The ID of the group to move the control to."]
#[doc = "* `control_id`: The ID of the control."]
pub fn move_control_to_group(
&self,
organization: impl Into<String>,
body: impl Into<models::Control>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
group_id: impl Into<String>,
control_id: impl Into<String>,
) -> move_control_to_group::RequestBuilder {
move_control_to_group::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
group_id: group_id.into(),
control_id: control_id.into(),
remove_from_group_id: None,
}
}
#[doc = "Updates a control on the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The updated control."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `group_id`: The ID of the group."]
#[doc = "* `control_id`: The ID of the control."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::Control>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
group_id: impl Into<String>,
control_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
group_id: group_id.into(),
control_id: control_id.into(),
}
}
#[doc = "Removes a control from the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `group_id`: The ID of the group."]
#[doc = "* `control_id`: The ID of the control to remove."]
pub fn remove_control_from_group(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
group_id: impl Into<String>,
control_id: impl Into<String>,
) -> remove_control_from_group::RequestBuilder {
remove_control_from_group::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
group_id: group_id.into(),
control_id: control_id.into(),
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Control, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Control> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Control,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) group_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.group_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Control>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Control>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod move_control_to_group {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Control, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Control> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Control,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) group_id: String,
pub(crate) control_id: String,
pub(crate) remove_from_group_id: Option<String>,
}
impl RequestBuilder {
#[doc = "The group ID to remove the control from."]
pub fn remove_from_group_id(mut self, remove_from_group_id: impl Into<String>) -> Self {
self.remove_from_group_id = Some(remove_from_group_id.into());
self
}
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
if let Some(remove_from_group_id) = &this.remove_from_group_id {
req.url_mut()
.query_pairs_mut()
.append_pair("removeFromGroupId", remove_from_group_id);
}
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.group_id,
&self.control_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Control>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Control>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Control, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Control> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Control,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) group_id: String,
pub(crate) control_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.group_id,
&self.control_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Control>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Control>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod remove_control_from_group {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) group_id: String,
pub(crate) control_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/groups/{}/controls/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.group_id,
&self.control_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod pages {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Adds a page to the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The page."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn add(
&self,
organization: impl Into<String>,
body: impl Into<models::Page>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> add::RequestBuilder {
add::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Updates a page on the work item form"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: The page"]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::Page>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Removes a page from the work item form"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `page_id`: The ID of the page"]
pub fn remove_page(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
page_id: impl Into<String>,
) -> remove_page::RequestBuilder {
remove_page::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
page_id: page_id.into(),
}
}
}
pub mod add {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<models::Page, azure_core::http::JsonFormat>);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Page> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Page,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Page>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Page>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<models::Page, azure_core::http::JsonFormat>);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Page> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Page,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Page>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Page>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod remove_page {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) page_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/pages/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.page_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod system_controls {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets edited system controls for a work item type in a process. To get all system controls (base + edited) use layout API(s)"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Updates/adds a system control on the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `control_id`: The ID of the control."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::Control>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
control_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
control_id: control_id.into(),
}
}
#[doc = "Deletes a system control modification on the work item form."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process."]
#[doc = "* `wit_ref_name`: The reference name of the work item type."]
#[doc = "* `control_id`: The ID of the control."]
pub fn delete(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
control_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
control_id: control_id.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ControlList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ControlList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ControlList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ControlList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::Control, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::Control> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Control,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) control_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.control_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Control>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::Control>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ControlList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ControlList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) control_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/layout/systemcontrols/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.control_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ControlList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ControlList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
}
pub mod rules {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all rules in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Adds a rule to work item type in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn add(
&self,
organization: impl Into<String>,
body: impl Into<models::CreateProcessRuleRequest>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> add::RequestBuilder {
add::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Returns a single rule in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `rule_id`: The ID of the rule"]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
rule_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
rule_id: rule_id.into(),
}
}
#[doc = "Updates a rule in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `rule_id`: The ID of the rule"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::UpdateProcessRuleRequest>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
rule_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
rule_id: rule_id.into(),
}
}
#[doc = "Removes a rule from the work item type in the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `rule_id`: The ID of the rule"]
pub fn delete(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
rule_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
rule_id: rule_id.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessRuleList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessRuleList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessRuleList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessRuleList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod add {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessRule, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessRule> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::CreateProcessRuleRequest,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessRule>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessRule>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessRule, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessRule> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) rule_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.rule_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessRule>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessRule>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::ProcessRule, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::ProcessRule> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::UpdateProcessRuleRequest,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) rule_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.rule_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ProcessRule>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::ProcessRule>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) rule_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/rules/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.rule_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod states {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all state definitions in a work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Creates a state definition in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::WorkItemStateInputModel>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
}
}
#[doc = "Returns a single state definition in a work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `state_id`: The ID of the state"]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
state_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
state_id: state_id.into(),
}
}
#[doc = "Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `state_id`: The ID of the state"]
pub fn hide_state_definition(
&self,
organization: impl Into<String>,
body: impl Into<models::HideStateModel>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
state_id: impl Into<String>,
) -> hide_state_definition::RequestBuilder {
hide_state_definition::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
state_id: state_id.into(),
}
}
#[doc = "Updates a given state definition in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `state_id`: ID of the state"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::WorkItemStateInputModel>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
state_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
state_id: state_id.into(),
}
}
#[doc = "Removes a state definition in the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: ID of the process"]
#[doc = "* `wit_ref_name`: The reference name of the work item type"]
#[doc = "* `state_id`: ID of the state"]
pub fn delete(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name: impl Into<String>,
state_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name: wit_ref_name.into(),
state_id: state_id.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemStateResultModelList,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModelList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemStateResultModelList>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModelList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemStateResultModel,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::WorkItemStateInputModel,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemStateResultModel>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemStateResultModel,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) state_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.state_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemStateResultModel>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod hide_state_definition {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemStateResultModel,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::HideStateModel,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) state_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.state_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemStateResultModel>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemStateResultModel,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemStateResultModel> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::WorkItemStateInputModel,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) state_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.state_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemStateResultModel>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemStateResultModel>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name: String,
pub(crate) state_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workItemTypes/{}/states/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name,
&self.state_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod work_item_types_behaviors {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns a list of all behaviors for the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"]
pub fn list(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name_for_behaviors: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(),
}
}
#[doc = "Adds a behavior to the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"]
pub fn add(
&self,
organization: impl Into<String>,
body: impl Into<models::WorkItemTypeBehavior>,
process_id: impl Into<String>,
wit_ref_name_for_behaviors: impl Into<String>,
) -> add::RequestBuilder {
add::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(),
}
}
#[doc = "Updates a behavior for the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::WorkItemTypeBehavior>,
process_id: impl Into<String>,
wit_ref_name_for_behaviors: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
process_id: process_id.into(),
wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(),
}
}
#[doc = "Returns a behavior for the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"]
#[doc = "* `behavior_ref_name`: The reference name of the behavior"]
pub fn get(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name_for_behaviors: impl Into<String>,
behavior_ref_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(),
behavior_ref_name: behavior_ref_name.into(),
}
}
#[doc = "Removes a behavior for the work item type of the process."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `process_id`: The ID of the process"]
#[doc = "* `wit_ref_name_for_behaviors`: Work item type reference name for the behavior"]
#[doc = "* `behavior_ref_name`: The reference name of the behavior"]
pub fn remove_behavior_from_work_item_type(
&self,
organization: impl Into<String>,
process_id: impl Into<String>,
wit_ref_name_for_behaviors: impl Into<String>,
behavior_ref_name: impl Into<String>,
) -> remove_behavior_from_work_item_type::RequestBuilder {
remove_behavior_from_work_item_type::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
process_id: process_id.into(),
wit_ref_name_for_behaviors: wit_ref_name_for_behaviors.into(),
behavior_ref_name: behavior_ref_name.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<
models::WorkItemTypeBehaviorList,
azure_core::http::JsonFormat,
>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehaviorList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name_for_behaviors: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name_for_behaviors
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemTypeBehaviorList>;
type IntoFuture =
BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehaviorList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod add {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::WorkItemTypeBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::WorkItemTypeBehavior,
pub(crate) process_id: String,
pub(crate) wit_ref_name_for_behaviors: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name_for_behaviors
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemTypeBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::WorkItemTypeBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::WorkItemTypeBehavior,
pub(crate) process_id: String,
pub(crate) wit_ref_name_for_behaviors: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name_for_behaviors
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemTypeBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::WorkItemTypeBehavior, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::WorkItemTypeBehavior> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name_for_behaviors: String,
pub(crate) behavior_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name_for_behaviors,
&self.behavior_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::WorkItemTypeBehavior>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTypeBehavior>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod remove_behavior_from_work_item_type {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) process_id: String,
pub(crate) wit_ref_name_for_behaviors: String,
pub(crate) behavior_ref_name: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/{}/workitemtypesbehaviors/{}/behaviors/{}",
self.client.endpoint(),
&self.organization,
&self.process_id,
&self.wit_ref_name_for_behaviors,
&self.behavior_ref_name
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}
pub mod lists {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Returns meta data of the picklist."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
}
}
#[doc = "Creates a picklist."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Picklist"]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::PickList>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
}
}
#[doc = "Returns a picklist."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `list_id`: The ID of the list"]
pub fn get(
&self,
organization: impl Into<String>,
list_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
list_id: list_id.into(),
}
}
#[doc = "Updates a list."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `list_id`: The ID of the list"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::PickList>,
list_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
list_id: list_id.into(),
}
}
#[doc = "Removes a picklist."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `list_id`: The ID of the list"]
pub fn delete(
&self,
organization: impl Into<String>,
list_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
list_id: list_id.into(),
}
}
}
pub mod list {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::PickListMetadataList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::PickListMetadataList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/lists",
self.client.endpoint(),
&self.organization
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::PickListMetadataList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::PickListMetadataList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod create {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::PickList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::PickList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::PickList,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/lists",
self.client.endpoint(),
&self.organization
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::PickList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::PickList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod get {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::PickList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::PickList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) list_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/lists/{}",
self.client.endpoint(),
&self.organization,
&self.list_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::PickList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::PickList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod update {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(
azure_core::http::Response<models::PickList, azure_core::http::JsonFormat>,
);
impl Response {
pub fn into_body(self) -> azure_core::Result<models::PickList> {
self.0.into_model()
}
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::PickList,
pub(crate) list_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::json::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/lists/{}",
self.client.endpoint(),
&self.organization,
&self.list_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::PickList>;
type IntoFuture = BoxFuture<'static, azure_core::Result<models::PickList>>;
#[doc = "Returns a future that sends the request and returns the parsed response body."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move { self.send().await?.into_body() })
}
}
}
pub mod delete {
use super::models;
#[cfg(not(target_arch = "wasm32"))]
use futures::future::BoxFuture;
#[cfg(target_arch = "wasm32")]
use futures::future::LocalBoxFuture as BoxFuture;
#[derive(Debug)]
pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
impl Response {
pub fn into_raw_response(self) -> azure_core::http::RawResponse {
self.0.into()
}
}
#[derive(Clone)]
#[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
#[doc = r""]
#[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
#[doc = r" parameters can be chained."]
#[doc = r""]
#[doc = r" To finalize and submit the request, invoke `.await`, which"]
#[doc = r" converts the [`RequestBuilder`] into a future,"]
#[doc = r" executes the request and returns a `Result` with the parsed"]
#[doc = r" response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details"]
#[doc = r" (e.g. to inspect response headers or raw body data) then you"]
#[doc = r" can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future"]
#[doc = r" that resolves to a lower-level [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) list_id: String,
}
impl RequestBuilder {
#[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
#[doc = ""]
#[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
#[doc = "However, this function can provide more flexibility when required."]
pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = this.url()?;
let mut req =
azure_core::http::Request::new(url, azure_core::http::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes())
.await?
{
req.insert_header(
azure_core::http::headers::AUTHORIZATION,
auth_header,
);
}
let req_body = azure_core::Bytes::new();
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?.into()))
}
})
}
fn url(&self) -> azure_core::Result<azure_core::http::Url> {
let mut url = azure_core::http::Url::parse(&format!(
"{}/{}/_apis/work/processes/lists/{}",
self.client.endpoint(),
&self.organization,
&self.list_id
))?;
let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
if !has_api_version_already {
url.query_pairs_mut()
.append_pair("api-version", "7.1-preview");
}
Ok(url)
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<()>;
type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
#[doc = "Returns a future that sends the request and waits for the response."]
#[doc = ""]
#[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
#[doc = ""]
#[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
fn into_future(self) -> Self::IntoFuture {
Box::pin(async move {
let _rsp = self.send().await?;
Ok(())
})
}
}
}
}