#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(clippy::redundant_clone)]
pub mod models;
#[derive(Clone)]
pub struct Client {
endpoint: String,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
pipeline: azure_core::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
endpoint: Option<String>,
scopes: Option<Vec<String>>,
options: azure_core::ClientOptions,
}
pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD;
impl ClientBuilder {
#[doc = "Create a new instance of `ClientBuilder`."]
#[must_use]
pub fn new(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> Self {
Self {
credential,
endpoint: None,
scopes: None,
options: azure_core::ClientOptions::default(),
}
}
#[doc = "Set the endpoint."]
#[must_use]
pub fn endpoint(mut self, endpoint: impl Into<String>) -> 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::RetryOptions>) -> Self {
self.options = self.options.retry(retry);
self
}
#[doc = "Set the transport options."]
#[must_use]
pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self {
self.options = self.options.transport(transport);
self
}
#[doc = "Convert the builder into a `Client` instance."]
#[must_use]
pub fn build(self) -> Client {
let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
let scopes = self.scopes.unwrap_or_else(|| vec![format!("{}/", endpoint)]);
Client::new(endpoint, self.credential, scopes, self.options)
}
}
impl Client {
pub(crate) fn endpoint(&self) -> &str {
self.endpoint.as_str()
}
pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential {
self.credential.as_ref()
}
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::Request) -> azure_core::Result<azure_core::Response> {
let mut context = azure_core::Context::default();
self.pipeline.send(&mut context, request).await
}
#[doc = "Create a new `ClientBuilder`."]
#[must_use]
pub fn builder(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> ClientBuilder {
ClientBuilder::new(credential)
}
#[doc = "Create a new `Client`."]
#[must_use]
pub fn new(
endpoint: impl Into<String>,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
options: azure_core::ClientOptions,
) -> Self {
let endpoint = endpoint.into();
let pipeline = azure_core::Pipeline::new(
option_env!("CARGO_PKG_NAME"),
option_env!("CARGO_PKG_VERSION"),
options,
Vec::new(),
Vec::new(),
);
Self {
endpoint,
credential,
scopes,
pipeline,
}
}
pub fn accounts_client(&self) -> accounts::Client {
accounts::Client(self.clone())
}
pub fn extensions_client(&self) -> extensions::Client {
extensions::Client(self.clone())
}
pub fn operations_client(&self) -> operations::Client {
operations::Client(self.clone())
}
pub fn projects_client(&self) -> projects::Client {
projects::Client(self.clone())
}
}
pub mod operations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Operations_List"]
#[doc = "Gets the details of all operations possible on the Microsoft.VisualStudio resource provider."]
pub fn list(&self) -> list::RequestBuilder {
list::RequestBuilder { client: self.0.clone() }
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::OperationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::OperationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url =
azure_core::Url::parse(&format!("{}/providers/microsoft.visualstudio/operations", this.client.endpoint(),))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::OperationListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod accounts {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Accounts_CheckNameAvailability"]
#[doc = "Checks if the specified Visual Studio Team Services account name is available. Resource name can be either an account name or an account name and PUID."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: Parameters describing the name to check availability for."]
pub fn check_name_availability(
&self,
subscription_id: impl Into<String>,
body: impl Into<models::CheckNameAvailabilityParameter>,
) -> check_name_availability::RequestBuilder {
check_name_availability::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
body: body.into(),
}
}
#[doc = "Accounts_ListByResourceGroup"]
#[doc = "Gets all Visual Studio Team Services account resources under the resource group linked to the specified Azure subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Accounts_Get"]
#[doc = "Gets the Visual Studio Team Services account resource details."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `resource_name`: Name of the resource."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
resource_name: resource_name.into(),
}
}
#[doc = "Accounts_CreateOrUpdate"]
#[doc = "Creates or updates a Visual Studio Team Services account resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: The request data."]
#[doc = "* `resource_name`: Name of the resource."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
body: impl Into<models::AccountResourceRequest>,
resource_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
body: body.into(),
resource_name: resource_name.into(),
}
}
#[doc = "Accounts_Update"]
#[doc = "Updates tags for Visual Studio Team Services account resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: The request data."]
#[doc = "* `resource_name`: Name of the resource."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
body: impl Into<models::AccountTagRequest>,
resource_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
body: body.into(),
resource_name: resource_name.into(),
}
}
#[doc = "Accounts_Delete"]
#[doc = "Deletes a Visual Studio Team Services account resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `resource_name`: Name of the resource."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
resource_name: resource_name.into(),
}
}
}
pub mod check_name_availability {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CheckNameAvailabilityResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::CheckNameAvailabilityResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) body: models::CheckNameAvailabilityParameter,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/microsoft.visualstudio/checkNameAvailability",
this.client.endpoint(),
&this.subscription_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::CheckNameAvailabilityResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AccountResourceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccountResourceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AccountResourceListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AccountResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccountResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AccountResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AccountResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccountResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) body: models::AccountResourceRequest,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AccountResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AccountResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccountResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) body: models::AccountTagRequest,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AccountResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod extensions {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Extensions_ListByAccount"]
#[doc = "Gets the details of the extension resources created within the resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `account_resource_name`: The name of the Visual Studio Team Services account resource."]
pub fn list_by_account(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
account_resource_name: impl Into<String>,
) -> list_by_account::RequestBuilder {
list_by_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
account_resource_name: account_resource_name.into(),
}
}
#[doc = "Extensions_Get"]
#[doc = "Gets the details of an extension associated with a Visual Studio Team Services account resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `account_resource_name`: The name of the Visual Studio Team Services account resource."]
#[doc = "* `extension_resource_name`: The name of the extension."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
account_resource_name: impl Into<String>,
extension_resource_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
account_resource_name: account_resource_name.into(),
extension_resource_name: extension_resource_name.into(),
}
}
#[doc = "Extensions_Create"]
#[doc = "Registers the extension with a Visual Studio Team Services account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: An object containing additional information related to the extension request."]
#[doc = "* `account_resource_name`: The name of the Visual Studio Team Services account resource."]
#[doc = "* `extension_resource_name`: The name of the extension."]
pub fn create(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
body: impl Into<models::ExtensionResourceRequest>,
account_resource_name: impl Into<String>,
extension_resource_name: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
body: body.into(),
account_resource_name: account_resource_name.into(),
extension_resource_name: extension_resource_name.into(),
}
}
#[doc = "Extensions_Update"]
#[doc = "Updates an existing extension registration for the Visual Studio Team Services account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: An object containing additional information related to the extension request."]
#[doc = "* `account_resource_name`: The name of the Visual Studio Team Services account resource."]
#[doc = "* `extension_resource_name`: The name of the extension."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
body: impl Into<models::ExtensionResourceRequest>,
account_resource_name: impl Into<String>,
extension_resource_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
body: body.into(),
account_resource_name: account_resource_name.into(),
extension_resource_name: extension_resource_name.into(),
}
}
#[doc = "Extensions_Delete"]
#[doc = "Removes an extension resource registration for a Visual Studio Team Services account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `account_resource_name`: The name of the Visual Studio Team Services account resource."]
#[doc = "* `extension_resource_name`: The name of the extension."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
account_resource_name: impl Into<String>,
extension_resource_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
account_resource_name: account_resource_name.into(),
extension_resource_name: extension_resource_name.into(),
}
}
}
pub mod list_by_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExtensionResourceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExtensionResourceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) account_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}/extension",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.account_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExtensionResourceListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExtensionResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExtensionResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) account_resource_name: String,
pub(crate) extension_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}/extension/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.account_resource_name,
&this.extension_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExtensionResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExtensionResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExtensionResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) body: models::ExtensionResourceRequest,
pub(crate) account_resource_name: String,
pub(crate) extension_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}/extension/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.account_resource_name,
&this.extension_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExtensionResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ExtensionResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ExtensionResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) body: models::ExtensionResourceRequest,
pub(crate) account_resource_name: String,
pub(crate) extension_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}/extension/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.account_resource_name,
&this.extension_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ExtensionResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) account_resource_name: String,
pub(crate) extension_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourcegroups/{}/providers/microsoft.visualstudio/account/{}/extension/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.account_resource_name,
&this.extension_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod projects {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Projects_ListByResourceGroup"]
#[doc = "Gets all Visual Studio Team Services project resources created in the specified Team Services account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `root_resource_name`: Name of the Team Services account."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
root_resource_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
root_resource_name: root_resource_name.into(),
}
}
#[doc = "Projects_Get"]
#[doc = "Gets the details of a Team Services project resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `root_resource_name`: Name of the Team Services account."]
#[doc = "* `resource_name`: Name of the Team Services project."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
root_resource_name: impl Into<String>,
resource_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
root_resource_name: root_resource_name.into(),
resource_name: resource_name.into(),
}
}
#[doc = "Projects_Create"]
#[doc = "Creates a Team Services project in the collection with the specified name. 'VersionControlOption' and 'ProcessTemplateId' must be specified in the resource properties. Valid values for VersionControlOption: Git, Tfvc. Valid values for ProcessTemplateId: 6B724908-EF14-45CF-84F8-768B5384DA45, ADCC42AB-9882-485E-A3ED-7678F01F66BC, 27450541-8E31-4150-9947-DC59F998FC01 (these IDs correspond to Scrum, Agile, and CMMI process templates)."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `body`: The request data."]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `root_resource_name`: Name of the Team Services account."]
#[doc = "* `resource_name`: Name of the Team Services project."]
pub fn create(
&self,
body: impl Into<models::ProjectResource>,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
root_resource_name: impl Into<String>,
resource_name: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
body: body.into(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
root_resource_name: root_resource_name.into(),
resource_name: resource_name.into(),
validating: None,
}
}
#[doc = "Projects_Update"]
#[doc = "Updates the tags of the specified Team Services project."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `body`: The request data."]
#[doc = "* `root_resource_name`: Name of the Team Services account."]
#[doc = "* `resource_name`: Name of the Team Services project."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
body: impl Into<models::ProjectResource>,
root_resource_name: impl Into<String>,
resource_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
body: body.into(),
root_resource_name: root_resource_name.into(),
resource_name: resource_name.into(),
}
}
#[doc = "Projects_GetJobStatus"]
#[doc = "Gets the status of the project resource creation job."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of the resource group within the Azure subscription."]
#[doc = "* `subscription_id`: The Azure subscription identifier."]
#[doc = "* `root_resource_name`: Name of the Team Services account."]
#[doc = "* `resource_name`: Name of the Team Services project."]
#[doc = "* `sub_container_name`: This parameter should be set to the resourceName."]
#[doc = "* `operation`: The operation type. The only supported value is 'put'."]
pub fn get_job_status(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
root_resource_name: impl Into<String>,
resource_name: impl Into<String>,
sub_container_name: impl Into<String>,
operation: impl Into<String>,
) -> get_job_status::RequestBuilder {
get_job_status::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
root_resource_name: root_resource_name.into(),
resource_name: resource_name.into(),
sub_container_name: sub_container_name.into(),
operation: operation.into(),
job_id: None,
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ProjectResourceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ProjectResourceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) root_resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.visualstudio/account/{}/project",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.root_resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ProjectResourceListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ProjectResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ProjectResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) root_resource_name: String,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.visualstudio/account/{}/project/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.root_resource_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ProjectResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ProjectResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ProjectResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) body: models::ProjectResource,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) root_resource_name: String,
pub(crate) resource_name: String,
pub(crate) validating: Option<String>,
}
impl RequestBuilder {
#[doc = "This parameter is ignored and should be set to an empty string."]
pub fn validating(mut self, validating: impl Into<String>) -> Self {
self.validating = Some(validating.into());
self
}
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.visualstudio/account/{}/project/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.root_resource_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
if let Some(validating) = &this.validating {
req.url_mut().query_pairs_mut().append_pair("validating", validating);
}
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ProjectResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ProjectResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ProjectResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) body: models::ProjectResource,
pub(crate) root_resource_name: String,
pub(crate) resource_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.visualstudio/account/{}/project/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.root_resource_name,
&this.resource_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.body)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ProjectResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_job_status {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ProjectResource> {
let bytes = self.0.into_body().collect().await?;
let body: models::ProjectResource = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
pub(crate) root_resource_name: String,
pub(crate) resource_name: String,
pub(crate) sub_container_name: String,
pub(crate) operation: String,
pub(crate) job_id: Option<String>,
}
impl RequestBuilder {
#[doc = "The job identifier."]
pub fn job_id(mut self, job_id: impl Into<String>) -> Self {
self.job_id = Some(job_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/microsoft.visualstudio/account/{}/project/{}/subContainers/{}/status" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . root_resource_name , & this . resource_name , & this . sub_container_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2014-04-01-preview");
let operation = &this.operation;
req.url_mut().query_pairs_mut().append_pair("operation", operation);
if let Some(job_id) = &this.job_id {
req.url_mut().query_pairs_mut().append_pair("jobId", job_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ProjectResource>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}