#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(clippy::redundant_clone)]
pub mod models;
#[derive(Clone)]
pub struct Client {
endpoint: String,
credential: crate::Credential,
scopes: Vec<String>,
pipeline: azure_core::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
credential: crate::Credential,
endpoint: Option<String>,
scopes: Option<Vec<String>>,
options: azure_core::ClientOptions,
}
pub const DEFAULT_ENDPOINT: &str = "https://vsrm.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::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 = "Set per-call policies."]
#[must_use]
pub fn per_call_policies(
mut self,
policies: impl Into<Vec<std::sync::Arc<dyn azure_core::Policy>>>,
) -> Self {
self.options = self.options.per_call_policies(policies);
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) -> &crate::Credential {
&self.credential
}
#[allow(dead_code)]
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: crate::Credential) -> ClientBuilder {
ClientBuilder::new(credential)
}
#[doc = "Create a new `Client`."]
#[must_use]
pub fn new(
endpoint: impl Into<String>,
credential: crate::Credential,
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 approvals_client(&self) -> approvals::Client {
approvals::Client(self.clone())
}
pub fn attachments_client(&self) -> attachments::Client {
attachments::Client(self.clone())
}
pub fn definitions_client(&self) -> definitions::Client {
definitions::Client(self.clone())
}
pub fn deployments_client(&self) -> deployments::Client {
deployments::Client(self.clone())
}
pub fn folders_client(&self) -> folders::Client {
folders::Client(self.clone())
}
pub fn gates_client(&self) -> gates::Client {
gates::Client(self.clone())
}
pub fn manual_interventions_client(&self) -> manual_interventions::Client {
manual_interventions::Client(self.clone())
}
pub fn releases_client(&self) -> releases::Client {
releases::Client(self.clone())
}
}
pub mod releases {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a Release"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
pub fn get_release(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
) -> get_release::RequestBuilder {
get_release::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
approval_filters: None,
property_filters: None,
expand: None,
top_gate_records: None,
}
}
#[doc = "Get a list of releases"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id: None,
definition_environment_id: None,
search_text: None,
created_by: None,
status_filter: None,
environment_status_filter: None,
min_created_time: None,
max_created_time: None,
query_order: None,
top: None,
continuation_token: None,
expand: None,
artifact_type_id: None,
source_id: None,
artifact_version_id: None,
source_branch_filter: None,
is_deleted: None,
tag_filter: None,
property_filters: None,
release_id_filter: None,
path: None,
}
}
#[doc = "Create a release."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Metadata to create a release."]
#[doc = "* `project`: Project ID or project name"]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseStartMetadata>,
project: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
}
}
#[doc = "Get release for a given revision number."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `definition_snapshot_revision`: Definition snapshot revision number."]
pub fn get_release_revision(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
definition_snapshot_revision: i32,
) -> get_release_revision::RequestBuilder {
get_release_revision::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
definition_snapshot_revision,
}
}
#[doc = "Update a complete release object."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Release object for update."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release to update."]
pub fn update_release(
&self,
organization: impl Into<String>,
body: impl Into<models::Release>,
project: impl Into<String>,
release_id: i32,
) -> update_release::RequestBuilder {
update_release::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
release_id,
}
}
#[doc = "Update few properties of a release."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Properties of release to update."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release to update."]
pub fn update_release_resource(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseUpdateMetadata>,
project: impl Into<String>,
release_id: i32,
) -> update_release_resource::RequestBuilder {
update_release_resource::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
release_id,
}
}
#[doc = "Get a release environment."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of the release environment."]
pub fn get_release_environment(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
) -> get_release_environment::RequestBuilder {
get_release_environment::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
expand: None,
}
}
#[doc = "Update the status of a release environment"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Environment update meta data."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of release environment."]
pub fn update_release_environment(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseEnvironmentUpdateMetadata>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
) -> update_release_environment::RequestBuilder {
update_release_environment::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
release_id,
environment_id,
}
}
#[doc = "Gets the task log of a release as a plain text file."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of release environment."]
#[doc = "* `release_deploy_phase_id`: Release deploy phase Id."]
#[doc = "* `task_id`: ReleaseTask Id for the log."]
pub fn get_task_log(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
release_deploy_phase_id: i32,
task_id: i32,
) -> get_task_log::RequestBuilder {
get_task_log::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
release_deploy_phase_id,
task_id,
start_line: None,
end_line: None,
}
}
#[doc = "Get logs for a release Id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
pub fn get_logs(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
) -> get_logs::RequestBuilder {
get_logs::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
}
}
}
pub mod get_release {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Release> {
let bytes = self.0.into_body().collect().await?;
let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) approval_filters: Option<String>,
pub(crate) property_filters: Option<String>,
pub(crate) expand: Option<String>,
pub(crate) top_gate_records: Option<i32>,
}
impl RequestBuilder {
#[doc = "A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default"]
pub fn approval_filters(mut self, approval_filters: impl Into<String>) -> Self {
self.approval_filters = Some(approval_filters.into());
self
}
#[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included."]
pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
self.property_filters = Some(property_filters.into());
self
}
#[doc = "A property that should be expanded in the release."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Number of release gate records to get. Default is 5."]
pub fn top_gate_records(mut self, top_gate_records: i32) -> Self {
self.top_gate_records = Some(top_gate_records);
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases/{}?",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(approval_filters) = &this.approval_filters {
req.url_mut()
.query_pairs_mut()
.append_pair("approvalFilters", approval_filters);
}
if let Some(property_filters) = &this.property_filters {
req.url_mut()
.query_pairs_mut()
.append_pair("propertyFilters", property_filters);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", expand);
}
if let Some(top_gate_records) = &this.top_gate_records {
req.url_mut()
.query_pairs_mut()
.append_pair("$topGateRecords", &top_gate_records.to_string());
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Release>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Release>>;
#[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().await })
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseList = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: Option<i32>,
pub(crate) definition_environment_id: Option<i32>,
pub(crate) search_text: Option<String>,
pub(crate) created_by: Option<String>,
pub(crate) status_filter: Option<String>,
pub(crate) environment_status_filter: Option<i32>,
pub(crate) min_created_time: Option<time::OffsetDateTime>,
pub(crate) max_created_time: Option<time::OffsetDateTime>,
pub(crate) query_order: Option<String>,
pub(crate) top: Option<i32>,
pub(crate) continuation_token: Option<i32>,
pub(crate) expand: Option<String>,
pub(crate) artifact_type_id: Option<String>,
pub(crate) source_id: Option<String>,
pub(crate) artifact_version_id: Option<String>,
pub(crate) source_branch_filter: Option<String>,
pub(crate) is_deleted: Option<bool>,
pub(crate) tag_filter: Option<String>,
pub(crate) property_filters: Option<String>,
pub(crate) release_id_filter: Option<String>,
pub(crate) path: Option<String>,
}
impl RequestBuilder {
#[doc = "Releases from this release definition Id."]
pub fn definition_id(mut self, definition_id: i32) -> Self {
self.definition_id = Some(definition_id);
self
}
pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self {
self.definition_environment_id = Some(definition_environment_id);
self
}
#[doc = "Releases with names containing searchText."]
pub fn search_text(mut self, search_text: impl Into<String>) -> Self {
self.search_text = Some(search_text.into());
self
}
#[doc = "Releases created by this user."]
pub fn created_by(mut self, created_by: impl Into<String>) -> Self {
self.created_by = Some(created_by.into());
self
}
#[doc = "Releases that have this status."]
pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self {
self.status_filter = Some(status_filter.into());
self
}
pub fn environment_status_filter(mut self, environment_status_filter: i32) -> Self {
self.environment_status_filter = Some(environment_status_filter);
self
}
#[doc = "Releases that were created after this time."]
pub fn min_created_time(
mut self,
min_created_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.min_created_time = Some(min_created_time.into());
self
}
#[doc = "Releases that were created before this time."]
pub fn max_created_time(
mut self,
max_created_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.max_created_time = Some(max_created_time.into());
self
}
#[doc = "Gets the results in the defined order of created date for releases. Default is descending."]
pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
self.query_order = Some(query_order.into());
self
}
#[doc = "Number of releases to get. Default is 50."]
pub fn top(mut self, top: i32) -> Self {
self.top = Some(top);
self
}
#[doc = "Gets the releases after the continuation token provided."]
pub fn continuation_token(mut self, continuation_token: i32) -> Self {
self.continuation_token = Some(continuation_token);
self
}
#[doc = "The property that should be expanded in the list of releases."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."]
pub fn artifact_type_id(mut self, artifact_type_id: impl Into<String>) -> Self {
self.artifact_type_id = Some(artifact_type_id.into());
self
}
#[doc = "Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."]
pub fn source_id(mut self, source_id: impl Into<String>) -> Self {
self.source_id = Some(source_id.into());
self
}
#[doc = "Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId."]
pub fn artifact_version_id(mut self, artifact_version_id: impl Into<String>) -> Self {
self.artifact_version_id = Some(artifact_version_id.into());
self
}
#[doc = "Releases with given sourceBranchFilter will be returned."]
pub fn source_branch_filter(mut self, source_branch_filter: impl Into<String>) -> Self {
self.source_branch_filter = Some(source_branch_filter.into());
self
}
#[doc = "Gets the soft deleted releases, if true."]
pub fn is_deleted(mut self, is_deleted: bool) -> Self {
self.is_deleted = Some(is_deleted);
self
}
#[doc = "A comma-delimited list of tags. Only releases with these tags will be returned."]
pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self {
self.tag_filter = Some(tag_filter.into());
self
}
#[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not."]
pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
self.property_filters = Some(property_filters.into());
self
}
#[doc = "A comma-delimited list of releases Ids. Only releases with these Ids will be returned."]
pub fn release_id_filter(mut self, release_id_filter: impl Into<String>) -> Self {
self.release_id_filter = Some(release_id_filter.into());
self
}
#[doc = "Releases under this folder path will be returned"]
pub fn path(mut self, path: impl Into<String>) -> Self {
self.path = Some(path.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(definition_id) = &this.definition_id {
req.url_mut()
.query_pairs_mut()
.append_pair("definitionId", &definition_id.to_string());
}
if let Some(definition_environment_id) = &this.definition_environment_id {
req.url_mut().query_pairs_mut().append_pair(
"definitionEnvironmentId",
&definition_environment_id.to_string(),
);
}
if let Some(search_text) = &this.search_text {
req.url_mut()
.query_pairs_mut()
.append_pair("searchText", search_text);
}
if let Some(created_by) = &this.created_by {
req.url_mut()
.query_pairs_mut()
.append_pair("createdBy", created_by);
}
if let Some(status_filter) = &this.status_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("statusFilter", status_filter);
}
if let Some(environment_status_filter) = &this.environment_status_filter {
req.url_mut().query_pairs_mut().append_pair(
"environmentStatusFilter",
&environment_status_filter.to_string(),
);
}
if let Some(min_created_time) = &this.min_created_time {
let formatted_date_time =
crate::date_time::format_date_time(min_created_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("minCreatedTime", &formatted_date_time);
}
if let Some(max_created_time) = &this.max_created_time {
let formatted_date_time =
crate::date_time::format_date_time(max_created_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("maxCreatedTime", &formatted_date_time);
}
if let Some(query_order) = &this.query_order {
req.url_mut()
.query_pairs_mut()
.append_pair("queryOrder", query_order);
}
if let Some(top) = &this.top {
req.url_mut()
.query_pairs_mut()
.append_pair("$top", &top.to_string());
}
if let Some(continuation_token) = &this.continuation_token {
req.url_mut()
.query_pairs_mut()
.append_pair("continuationToken", &continuation_token.to_string());
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", expand);
}
if let Some(artifact_type_id) = &this.artifact_type_id {
req.url_mut()
.query_pairs_mut()
.append_pair("artifactTypeId", artifact_type_id);
}
if let Some(source_id) = &this.source_id {
req.url_mut()
.query_pairs_mut()
.append_pair("sourceId", source_id);
}
if let Some(artifact_version_id) = &this.artifact_version_id {
req.url_mut()
.query_pairs_mut()
.append_pair("artifactVersionId", artifact_version_id);
}
if let Some(source_branch_filter) = &this.source_branch_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("sourceBranchFilter", source_branch_filter);
}
if let Some(is_deleted) = &this.is_deleted {
req.url_mut()
.query_pairs_mut()
.append_pair("isDeleted", &is_deleted.to_string());
}
if let Some(tag_filter) = &this.tag_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("tagFilter", tag_filter);
}
if let Some(property_filters) = &this.property_filters {
req.url_mut()
.query_pairs_mut()
.append_pair("propertyFilters", property_filters);
}
if let Some(release_id_filter) = &this.release_id_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("releaseIdFilter", release_id_filter);
}
if let Some(path) = &this.path {
req.url_mut().query_pairs_mut().append_pair("path", path);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseList>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseList>>;
#[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().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::Release> {
let bytes = self.0.into_body().collect().await?;
let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseStartMetadata,
pub(crate) project: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Release>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Release>>;
#[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().await })
}
}
}
pub mod get_release_revision {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) definition_snapshot_revision: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let definition_snapshot_revision = &this.definition_snapshot_revision;
req.url_mut().query_pairs_mut().append_pair(
"definitionSnapshotRevision",
&definition_snapshot_revision.to_string(),
);
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
pub mod update_release {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Release> {
let bytes = self.0.into_body().collect().await?;
let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Release,
pub(crate) project: String,
pub(crate) release_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Release>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Release>>;
#[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().await })
}
}
}
pub mod update_release_resource {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Release> {
let bytes = self.0.into_body().collect().await?;
let body: models::Release = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseUpdateMetadata,
pub(crate) project: String,
pub(crate) release_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Release>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Release>>;
#[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().await })
}
}
}
pub mod get_release_environment {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseEnvironment =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "A property that should be expanded in the environment."]
pub fn expand(mut self, expand: impl Into<String>) -> 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/releases/{}/environments/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id,
&this.environment_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseEnvironment>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>;
#[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().await })
}
}
}
pub mod update_release_environment {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseEnvironment> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseEnvironment =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseEnvironmentUpdateMetadata,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/releases/{}/environments/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id,
&this.environment_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseEnvironment>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseEnvironment>>;
#[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().await })
}
}
}
pub mod get_task_log {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) release_deploy_phase_id: i32,
pub(crate) task_id: i32,
pub(crate) start_line: Option<i64>,
pub(crate) end_line: Option<i64>,
}
impl RequestBuilder {
#[doc = "Starting line number for logs"]
pub fn start_line(mut self, start_line: i64) -> Self {
self.start_line = Some(start_line);
self
}
#[doc = "Ending line number for logs"]
pub fn end_line(mut self, end_line: i64) -> Self {
self.end_line = Some(end_line);
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/deployPhases/{}/tasks/{}/logs" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . release_deploy_phase_id , & this . task_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(start_line) = &this.start_line {
req.url_mut()
.query_pairs_mut()
.append_pair("startLine", &start_line.to_string());
}
if let Some(end_line) = &this.end_line {
req.url_mut()
.query_pairs_mut()
.append_pair("endLine", &end_line.to_string());
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
pub mod get_logs {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/releases/{}/logs",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
}
pub mod approvals {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a list of approvals"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
assigned_to_filter: None,
status_filter: None,
release_ids_filter: None,
type_filter: None,
top: None,
continuation_token: None,
query_order: None,
include_my_group_approvals: None,
}
}
#[doc = "Update status of an approval"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: ReleaseApproval object having status, approver and comments."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `approval_id`: Id of the approval."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseApproval>,
project: impl Into<String>,
approval_id: i32,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
approval_id,
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseApprovalList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseApprovalList =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) assigned_to_filter: Option<String>,
pub(crate) status_filter: Option<String>,
pub(crate) release_ids_filter: Option<String>,
pub(crate) type_filter: Option<String>,
pub(crate) top: Option<i32>,
pub(crate) continuation_token: Option<i32>,
pub(crate) query_order: Option<String>,
pub(crate) include_my_group_approvals: Option<bool>,
}
impl RequestBuilder {
#[doc = "Approvals assigned to this user."]
pub fn assigned_to_filter(mut self, assigned_to_filter: impl Into<String>) -> Self {
self.assigned_to_filter = Some(assigned_to_filter.into());
self
}
#[doc = "Approvals with this status. Default is 'pending'."]
pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self {
self.status_filter = Some(status_filter.into());
self
}
#[doc = "Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4."]
pub fn release_ids_filter(mut self, release_ids_filter: impl Into<String>) -> Self {
self.release_ids_filter = Some(release_ids_filter.into());
self
}
#[doc = "Approval with this type."]
pub fn type_filter(mut self, type_filter: impl Into<String>) -> Self {
self.type_filter = Some(type_filter.into());
self
}
#[doc = "Number of approvals to get. Default is 50."]
pub fn top(mut self, top: i32) -> Self {
self.top = Some(top);
self
}
#[doc = "Gets the approvals after the continuation token provided."]
pub fn continuation_token(mut self, continuation_token: i32) -> Self {
self.continuation_token = Some(continuation_token);
self
}
#[doc = "Gets the results in the defined order of created approvals. Default is 'descending'."]
pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
self.query_order = Some(query_order.into());
self
}
#[doc = "'true' to include my group approvals. Default is 'false'."]
pub fn include_my_group_approvals(mut self, include_my_group_approvals: bool) -> Self {
self.include_my_group_approvals = Some(include_my_group_approvals);
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/approvals",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(assigned_to_filter) = &this.assigned_to_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("assignedToFilter", assigned_to_filter);
}
if let Some(status_filter) = &this.status_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("statusFilter", status_filter);
}
if let Some(release_ids_filter) = &this.release_ids_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("releaseIdsFilter", release_ids_filter);
}
if let Some(type_filter) = &this.type_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("typeFilter", type_filter);
}
if let Some(top) = &this.top {
req.url_mut()
.query_pairs_mut()
.append_pair("top", &top.to_string());
}
if let Some(continuation_token) = &this.continuation_token {
req.url_mut()
.query_pairs_mut()
.append_pair("continuationToken", &continuation_token.to_string());
}
if let Some(query_order) = &this.query_order {
req.url_mut()
.query_pairs_mut()
.append_pair("queryOrder", query_order);
}
if let Some(include_my_group_approvals) = &this.include_my_group_approvals {
req.url_mut().query_pairs_mut().append_pair(
"includeMyGroupApprovals",
&include_my_group_approvals.to_string(),
);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseApprovalList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ReleaseApprovalList>,
>;
#[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().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::ReleaseApproval> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseApproval =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseApproval,
pub(crate) project: String,
pub(crate) approval_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/approvals/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.approval_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseApproval>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseApproval>>;
#[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().await })
}
}
}
}
pub mod definitions {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a list of release definitions."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
search_text: None,
expand: None,
artifact_type: None,
artifact_source_id: None,
top: None,
continuation_token: None,
query_order: None,
path: None,
is_exact_name_match: None,
tag_filter: None,
property_filters: None,
definition_id_filter: None,
is_deleted: None,
search_text_contains_folder_name: None,
}
}
#[doc = "Create a release definition"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: release definition object to create."]
#[doc = "* `project`: Project ID or project name"]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseDefinition>,
project: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
}
}
#[doc = "Update a release definition."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Release definition object to update."]
#[doc = "* `project`: Project ID or project name"]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::ReleaseDefinition>,
project: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
}
}
#[doc = "Get a release definition."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `definition_id`: Id of the release definition."]
pub fn get(
&self,
organization: impl Into<String>,
project: impl Into<String>,
definition_id: i32,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id,
property_filters: None,
}
}
#[doc = "Delete a release definition."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `definition_id`: Id of the release definition."]
pub fn delete(
&self,
organization: impl Into<String>,
project: impl Into<String>,
definition_id: i32,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id,
comment: None,
force_delete: None,
}
}
#[doc = "Get revision history for a release definition"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `definition_id`: Id of the definition."]
pub fn get_release_definition_history(
&self,
organization: impl Into<String>,
project: impl Into<String>,
definition_id: i32,
) -> get_release_definition_history::RequestBuilder {
get_release_definition_history::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id,
}
}
#[doc = "Get release definition for a given definition_id and revision"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `definition_id`: Id of the definition."]
#[doc = "* `revision`: Id of the revision."]
pub fn get_definition_revision(
&self,
organization: impl Into<String>,
project: impl Into<String>,
definition_id: i32,
revision: i32,
) -> get_definition_revision::RequestBuilder {
get_definition_revision::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id,
revision,
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseDefinitionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseDefinitionList =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) search_text: Option<String>,
pub(crate) expand: Option<String>,
pub(crate) artifact_type: Option<String>,
pub(crate) artifact_source_id: Option<String>,
pub(crate) top: Option<i32>,
pub(crate) continuation_token: Option<String>,
pub(crate) query_order: Option<String>,
pub(crate) path: Option<String>,
pub(crate) is_exact_name_match: Option<bool>,
pub(crate) tag_filter: Option<String>,
pub(crate) property_filters: Option<String>,
pub(crate) definition_id_filter: Option<String>,
pub(crate) is_deleted: Option<bool>,
pub(crate) search_text_contains_folder_name: Option<bool>,
}
impl RequestBuilder {
#[doc = "Get release definitions with names containing searchText."]
pub fn search_text(mut self, search_text: impl Into<String>) -> Self {
self.search_text = Some(search_text.into());
self
}
#[doc = "The properties that should be expanded in the list of Release definitions."]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.into());
self
}
#[doc = "Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild."]
pub fn artifact_type(mut self, artifact_type: impl Into<String>) -> Self {
self.artifact_type = Some(artifact_type.into());
self
}
#[doc = "Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at<https://github>.com/Microsoft/vsts-rm-extensions/blob/master/Extensions."]
pub fn artifact_source_id(mut self, artifact_source_id: impl Into<String>) -> Self {
self.artifact_source_id = Some(artifact_source_id.into());
self
}
#[doc = "Number of release definitions to get."]
pub fn top(mut self, top: i32) -> Self {
self.top = Some(top);
self
}
#[doc = "Gets the release definitions after the continuation token provided."]
pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
self.continuation_token = Some(continuation_token.into());
self
}
#[doc = "Gets the results in the defined order. Default is 'IdAscending'."]
pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
self.query_order = Some(query_order.into());
self
}
#[doc = "Gets the release definitions under the specified path."]
pub fn path(mut self, path: impl Into<String>) -> Self {
self.path = Some(path.into());
self
}
#[doc = "'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'."]
pub fn is_exact_name_match(mut self, is_exact_name_match: bool) -> Self {
self.is_exact_name_match = Some(is_exact_name_match);
self
}
#[doc = "A comma-delimited list of tags. Only release definitions with these tags will be returned."]
pub fn tag_filter(mut self, tag_filter: impl Into<String>) -> Self {
self.tag_filter = Some(tag_filter.into());
self
}
#[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not."]
pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
self.property_filters = Some(property_filters.into());
self
}
#[doc = "A comma-delimited list of release definitions to retrieve."]
pub fn definition_id_filter(mut self, definition_id_filter: impl Into<String>) -> Self {
self.definition_id_filter = Some(definition_id_filter.into());
self
}
#[doc = "'true' to get release definitions that has been deleted. Default is 'false'"]
pub fn is_deleted(mut self, is_deleted: bool) -> Self {
self.is_deleted = Some(is_deleted);
self
}
#[doc = "'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'."]
pub fn search_text_contains_folder_name(
mut self,
search_text_contains_folder_name: bool,
) -> Self {
self.search_text_contains_folder_name = Some(search_text_contains_folder_name);
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/definitions",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(search_text) = &this.search_text {
req.url_mut()
.query_pairs_mut()
.append_pair("searchText", search_text);
}
if let Some(expand) = &this.expand {
req.url_mut()
.query_pairs_mut()
.append_pair("$expand", expand);
}
if let Some(artifact_type) = &this.artifact_type {
req.url_mut()
.query_pairs_mut()
.append_pair("artifactType", artifact_type);
}
if let Some(artifact_source_id) = &this.artifact_source_id {
req.url_mut()
.query_pairs_mut()
.append_pair("artifactSourceId", artifact_source_id);
}
if let Some(top) = &this.top {
req.url_mut()
.query_pairs_mut()
.append_pair("$top", &top.to_string());
}
if let Some(continuation_token) = &this.continuation_token {
req.url_mut()
.query_pairs_mut()
.append_pair("continuationToken", continuation_token);
}
if let Some(query_order) = &this.query_order {
req.url_mut()
.query_pairs_mut()
.append_pair("queryOrder", query_order);
}
if let Some(path) = &this.path {
req.url_mut().query_pairs_mut().append_pair("path", path);
}
if let Some(is_exact_name_match) = &this.is_exact_name_match {
req.url_mut()
.query_pairs_mut()
.append_pair("isExactNameMatch", &is_exact_name_match.to_string());
}
if let Some(tag_filter) = &this.tag_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("tagFilter", tag_filter);
}
if let Some(property_filters) = &this.property_filters {
req.url_mut()
.query_pairs_mut()
.append_pair("propertyFilters", property_filters);
}
if let Some(definition_id_filter) = &this.definition_id_filter {
req.url_mut()
.query_pairs_mut()
.append_pair("definitionIdFilter", definition_id_filter);
}
if let Some(is_deleted) = &this.is_deleted {
req.url_mut()
.query_pairs_mut()
.append_pair("isDeleted", &is_deleted.to_string());
}
if let Some(search_text_contains_folder_name) =
&this.search_text_contains_folder_name
{
req.url_mut().query_pairs_mut().append_pair(
"searchTextContainsFolderName",
&search_text_contains_folder_name.to_string(),
);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseDefinitionList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ReleaseDefinitionList>,
>;
#[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().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::ReleaseDefinition> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseDefinition =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseDefinition,
pub(crate) project: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/definitions",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseDefinition>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
#[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().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::ReleaseDefinition> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseDefinition =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ReleaseDefinition,
pub(crate) project: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/definitions",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseDefinition>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
#[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().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::ReleaseDefinition> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseDefinition =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: i32,
pub(crate) property_filters: Option<String>,
}
impl RequestBuilder {
#[doc = "A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included."]
pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
self.property_filters = Some(property_filters.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/definitions/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.definition_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(property_filters) = &this.property_filters {
req.url_mut()
.query_pairs_mut()
.append_pair("propertyFilters", property_filters);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseDefinition>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseDefinition>>;
#[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().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: i32,
pub(crate) comment: Option<String>,
pub(crate) force_delete: Option<bool>,
}
impl RequestBuilder {
#[doc = "Comment for deleting a release definition."]
pub fn comment(mut self, comment: impl Into<String>) -> Self {
self.comment = Some(comment.into());
self
}
#[doc = "'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'."]
pub fn force_delete(mut self, force_delete: bool) -> Self {
self.force_delete = Some(force_delete);
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/definitions/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.definition_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(comment) = &this.comment {
req.url_mut()
.query_pairs_mut()
.append_pair("comment", comment);
}
if let Some(force_delete) = &this.force_delete {
req.url_mut()
.query_pairs_mut()
.append_pair("forceDelete", &force_delete.to_string());
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_release_definition_history {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(
self,
) -> azure_core::Result<models::ReleaseDefinitionRevisionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseDefinitionRevisionList = serde_json::from_slice(&bytes)
.map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/definitions/{}/revisions",
this.client.endpoint(),
&this.organization,
&this.project,
&this.definition_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseDefinitionRevisionList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ReleaseDefinitionRevisionList>,
>;
#[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().await })
}
}
}
pub mod get_definition_revision {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: i32,
pub(crate) revision: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/definitions/{}/revisions/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.definition_id,
&this.revision
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
}
pub mod deployments {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
definition_id: None,
definition_environment_id: None,
created_by: None,
min_modified_time: None,
max_modified_time: None,
deployment_status: None,
operation_status: None,
latest_attempts_only: None,
query_order: None,
top: None,
continuation_token: None,
created_for: None,
min_started_time: None,
max_started_time: None,
source_branch: None,
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DeploymentList> {
let bytes = self.0.into_body().collect().await?;
let body: models::DeploymentList = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) definition_id: Option<i32>,
pub(crate) definition_environment_id: Option<i32>,
pub(crate) created_by: Option<String>,
pub(crate) min_modified_time: Option<time::OffsetDateTime>,
pub(crate) max_modified_time: Option<time::OffsetDateTime>,
pub(crate) deployment_status: Option<String>,
pub(crate) operation_status: Option<String>,
pub(crate) latest_attempts_only: Option<bool>,
pub(crate) query_order: Option<String>,
pub(crate) top: Option<i32>,
pub(crate) continuation_token: Option<i32>,
pub(crate) created_for: Option<String>,
pub(crate) min_started_time: Option<time::OffsetDateTime>,
pub(crate) max_started_time: Option<time::OffsetDateTime>,
pub(crate) source_branch: Option<String>,
}
impl RequestBuilder {
pub fn definition_id(mut self, definition_id: i32) -> Self {
self.definition_id = Some(definition_id);
self
}
pub fn definition_environment_id(mut self, definition_environment_id: i32) -> Self {
self.definition_environment_id = Some(definition_environment_id);
self
}
pub fn created_by(mut self, created_by: impl Into<String>) -> Self {
self.created_by = Some(created_by.into());
self
}
pub fn min_modified_time(
mut self,
min_modified_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.min_modified_time = Some(min_modified_time.into());
self
}
pub fn max_modified_time(
mut self,
max_modified_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.max_modified_time = Some(max_modified_time.into());
self
}
pub fn deployment_status(mut self, deployment_status: impl Into<String>) -> Self {
self.deployment_status = Some(deployment_status.into());
self
}
pub fn operation_status(mut self, operation_status: impl Into<String>) -> Self {
self.operation_status = Some(operation_status.into());
self
}
pub fn latest_attempts_only(mut self, latest_attempts_only: bool) -> Self {
self.latest_attempts_only = Some(latest_attempts_only);
self
}
pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
self.query_order = Some(query_order.into());
self
}
pub fn top(mut self, top: i32) -> Self {
self.top = Some(top);
self
}
pub fn continuation_token(mut self, continuation_token: i32) -> Self {
self.continuation_token = Some(continuation_token);
self
}
pub fn created_for(mut self, created_for: impl Into<String>) -> Self {
self.created_for = Some(created_for.into());
self
}
pub fn min_started_time(
mut self,
min_started_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.min_started_time = Some(min_started_time.into());
self
}
pub fn max_started_time(
mut self,
max_started_time: impl Into<time::OffsetDateTime>,
) -> Self {
self.max_started_time = Some(max_started_time.into());
self
}
pub fn source_branch(mut self, source_branch: impl Into<String>) -> Self {
self.source_branch = Some(source_branch.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/deployments",
this.client.endpoint(),
&this.organization,
&this.project
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(definition_id) = &this.definition_id {
req.url_mut()
.query_pairs_mut()
.append_pair("definitionId", &definition_id.to_string());
}
if let Some(definition_environment_id) = &this.definition_environment_id {
req.url_mut().query_pairs_mut().append_pair(
"definitionEnvironmentId",
&definition_environment_id.to_string(),
);
}
if let Some(created_by) = &this.created_by {
req.url_mut()
.query_pairs_mut()
.append_pair("createdBy", created_by);
}
if let Some(min_modified_time) = &this.min_modified_time {
let formatted_date_time =
crate::date_time::format_date_time(min_modified_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("minModifiedTime", &formatted_date_time);
}
if let Some(max_modified_time) = &this.max_modified_time {
let formatted_date_time =
crate::date_time::format_date_time(max_modified_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("maxModifiedTime", &formatted_date_time);
}
if let Some(deployment_status) = &this.deployment_status {
req.url_mut()
.query_pairs_mut()
.append_pair("deploymentStatus", deployment_status);
}
if let Some(operation_status) = &this.operation_status {
req.url_mut()
.query_pairs_mut()
.append_pair("operationStatus", operation_status);
}
if let Some(latest_attempts_only) = &this.latest_attempts_only {
req.url_mut().query_pairs_mut().append_pair(
"latestAttemptsOnly",
&latest_attempts_only.to_string(),
);
}
if let Some(query_order) = &this.query_order {
req.url_mut()
.query_pairs_mut()
.append_pair("queryOrder", query_order);
}
if let Some(top) = &this.top {
req.url_mut()
.query_pairs_mut()
.append_pair("$top", &top.to_string());
}
if let Some(continuation_token) = &this.continuation_token {
req.url_mut()
.query_pairs_mut()
.append_pair("continuationToken", &continuation_token.to_string());
}
if let Some(created_for) = &this.created_for {
req.url_mut()
.query_pairs_mut()
.append_pair("createdFor", created_for);
}
if let Some(min_started_time) = &this.min_started_time {
let formatted_date_time =
crate::date_time::format_date_time(min_started_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("minStartedTime", &formatted_date_time);
}
if let Some(max_started_time) = &this.max_started_time {
let formatted_date_time =
crate::date_time::format_date_time(max_started_time)?;
req.url_mut()
.query_pairs_mut()
.append_pair("maxStartedTime", &formatted_date_time);
}
if let Some(source_branch) = &this.source_branch {
req.url_mut()
.query_pairs_mut()
.append_pair("sourceBranch", source_branch);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::DeploymentList>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::DeploymentList>>;
#[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().await })
}
}
}
}
pub mod folders {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets folders."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `path`: Path of the folder."]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
path: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
path: path.into(),
query_order: None,
}
}
#[doc = "This method is no longer supported. Use CreateFolder with folder parameter API."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: folder."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `path`: Path of the folder."]
pub fn create(
&self,
organization: impl Into<String>,
body: impl Into<models::Folder>,
project: impl Into<String>,
path: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
path: path.into(),
}
}
#[doc = "Updates an existing folder at given existing path."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: folder."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `path`: Path of the folder to update."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::Folder>,
project: impl Into<String>,
path: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
path: path.into(),
}
}
#[doc = "Deletes a definition folder for given folder name and path and all it's existing definitions."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `path`: Path of the folder to delete."]
pub fn delete(
&self,
organization: impl Into<String>,
project: impl Into<String>,
path: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
path: path.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FolderList> {
let bytes = self.0.into_body().collect().await?;
let body: models::FolderList = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) path: String,
pub(crate) query_order: Option<String>,
}
impl RequestBuilder {
#[doc = "Gets the results in the defined order. Default is 'None'."]
pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
self.query_order = Some(query_order.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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/folders/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.path
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
if let Some(query_order) = &this.query_order {
req.url_mut()
.query_pairs_mut()
.append_pair("queryOrder", query_order);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::FolderList>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::FolderList>>;
#[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().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::Folder> {
let bytes = self.0.into_body().collect().await?;
let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Folder,
pub(crate) project: String,
pub(crate) path: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/folders/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.path
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Folder>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>;
#[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().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::Folder> {
let bytes = self.0.into_body().collect().await?;
let body: models::Folder = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::Folder,
pub(crate) project: String,
pub(crate) path: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/folders/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.path
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::Folder>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::Folder>>;
#[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().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) path: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/folders/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.path
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod gates {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Updates the gate for a deployment."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Metadata to patch the Release Gates."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `gate_step_id`: Gate step Id."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::GateUpdateMetadata>,
project: impl Into<String>,
gate_step_id: i32,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
gate_step_id,
}
}
}
pub mod update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseGates> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseGates = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::GateUpdateMetadata,
pub(crate) project: String,
pub(crate) gate_step_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/release/gates/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.gate_step_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseGates>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ReleaseGates>>;
#[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().await })
}
}
}
}
pub mod attachments {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get the release task attachments."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of the release environment."]
#[doc = "* `attempt_id`: Attempt number of deployment."]
#[doc = "* `plan_id`: Plan Id of the deploy phase."]
#[doc = "* `type_`: Type of the attachment."]
pub fn get_release_task_attachments(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
attempt_id: i32,
plan_id: impl Into<String>,
type_: impl Into<String>,
) -> get_release_task_attachments::RequestBuilder {
get_release_task_attachments::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
attempt_id,
plan_id: plan_id.into(),
type_: type_.into(),
}
}
#[doc = "Get a release task attachment."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of the release environment."]
#[doc = "* `attempt_id`: Attempt number of deployment."]
#[doc = "* `plan_id`: Plan Id of the deploy phase."]
#[doc = "* `timeline_id`: Timeline Id of the task."]
#[doc = "* `record_id`: Record Id of attachment."]
#[doc = "* `type_`: Type of the attachment."]
#[doc = "* `name`: Name of the attachment."]
pub fn get_release_task_attachment_content(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
attempt_id: i32,
plan_id: impl Into<String>,
timeline_id: impl Into<String>,
record_id: impl Into<String>,
type_: impl Into<String>,
name: impl Into<String>,
) -> get_release_task_attachment_content::RequestBuilder {
get_release_task_attachment_content::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
attempt_id,
plan_id: plan_id.into(),
timeline_id: timeline_id.into(),
record_id: record_id.into(),
type_: type_.into(),
name: name.into(),
}
}
#[doc = "GetTaskAttachments API is deprecated. Use GetReleaseTaskAttachments API instead."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of the release environment."]
#[doc = "* `attempt_id`: Attempt number of deployment."]
#[doc = "* `timeline_id`: Timeline Id of the task."]
#[doc = "* `type_`: Type of the attachment."]
pub fn get_task_attachments(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
attempt_id: i32,
timeline_id: impl Into<String>,
type_: impl Into<String>,
) -> get_task_attachments::RequestBuilder {
get_task_attachments::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
attempt_id,
timeline_id: timeline_id.into(),
type_: type_.into(),
}
}
#[doc = "GetTaskAttachmentContent API is deprecated. Use GetReleaseTaskAttachmentContent API instead."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `environment_id`: Id of the release environment."]
#[doc = "* `attempt_id`: Attempt number of deployment."]
#[doc = "* `timeline_id`: Timeline Id of the task."]
#[doc = "* `record_id`: Record Id of attachment."]
#[doc = "* `type_`: Type of the attachment."]
#[doc = "* `name`: Name of the attachment."]
pub fn get_task_attachment_content(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
environment_id: i32,
attempt_id: i32,
timeline_id: impl Into<String>,
record_id: impl Into<String>,
type_: impl Into<String>,
name: impl Into<String>,
) -> get_task_attachment_content::RequestBuilder {
get_task_attachment_content::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
environment_id,
attempt_id,
timeline_id: timeline_id.into(),
record_id: record_id.into(),
type_: type_.into(),
name: name.into(),
}
}
}
pub mod get_release_task_attachments {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes)
.map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) attempt_id: i32,
pub(crate) plan_id: String,
pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . type_)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseTaskAttachmentList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ReleaseTaskAttachmentList>,
>;
#[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().await })
}
}
}
pub mod get_release_task_attachment_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) attempt_id: i32,
pub(crate) plan_id: String,
pub(crate) timeline_id: String,
pub(crate) record_id: String,
pub(crate) type_: String,
pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/plan/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . plan_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
pub mod get_task_attachments {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ReleaseTaskAttachmentList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ReleaseTaskAttachmentList = serde_json::from_slice(&bytes)
.map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) attempt_id: i32,
pub(crate) timeline_id: String,
pub(crate) type_: 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/attachments/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . type_)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ReleaseTaskAttachmentList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ReleaseTaskAttachmentList>,
>;
#[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().await })
}
}
}
pub mod get_task_attachment_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<String> {
let bytes = self.0.into_body().collect().await?;
let body: String = serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) environment_id: i32,
pub(crate) attempt_id: i32,
pub(crate) timeline_id: String,
pub(crate) record_id: String,
pub(crate) type_: String,
pub(crate) 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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/{}/{}/_apis/release/releases/{}/environments/{}/attempts/{}/timelines/{}/records/{}/attachments/{}/{}" , this . client . endpoint () , & this . organization , & this . project , & this . release_id , & this . environment_id , & this . attempt_id , & this . timeline_id , & this . record_id , & this . type_ , & this . name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<String>;
type IntoFuture = futures::future::BoxFuture<'static, azure_core::Result<String>>;
#[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().await })
}
}
}
}
pub mod manual_interventions {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List all manual interventions for a given release."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
pub fn list(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
}
}
#[doc = "Get manual intervention for a given release and manual intervention id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `manual_intervention_id`: Id of the manual intervention."]
pub fn get(
&self,
organization: impl Into<String>,
project: impl Into<String>,
release_id: i32,
manual_intervention_id: i32,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
project: project.into(),
release_id,
manual_intervention_id,
}
}
#[doc = "Update manual intervention."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `organization`: The name of the Azure DevOps organization."]
#[doc = "* `body`: Meta data to update manual intervention."]
#[doc = "* `project`: Project ID or project name"]
#[doc = "* `release_id`: Id of the release."]
#[doc = "* `manual_intervention_id`: Id of the manual intervention."]
pub fn update(
&self,
organization: impl Into<String>,
body: impl Into<models::ManualInterventionUpdateMetadata>,
project: impl Into<String>,
release_id: i32,
manual_intervention_id: i32,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
organization: organization.into(),
body: body.into(),
project: project.into(),
release_id,
manual_intervention_id,
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManualInterventionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManualInterventionList =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/releases/{}/manualinterventions",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ManualInterventionList>;
type IntoFuture = futures::future::BoxFuture<
'static,
azure_core::Result<models::ManualInterventionList>,
>;
#[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().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::ManualIntervention> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManualIntervention =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) manual_intervention_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id,
&this.manual_intervention_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ManualIntervention>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>;
#[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().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::ManualIntervention> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManualIntervention =
serde_json::from_slice(&bytes).map_err(|e| {
azure_core::error::Error::full(
azure_core::error::ErrorKind::DataConversion,
e,
format!(
"Failed to deserialize response:\n{}",
String::from_utf8_lossy(&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)]
#[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" The building of a request is typically finalized by invoking `.await` on"]
#[doc = r" `RequestBuilder`. This implicitly invokes the [`IntoFuture::into_future()`](#method.into_future)"]
#[doc = r" method, which converts `RequestBuilder` into a future that executes the request"]
#[doc = r" operation and returns a `Result` with the parsed response."]
#[doc = r""]
#[doc = r" If you need lower-level access to the raw response details (e.g. to inspect"]
#[doc = r" response headers or raw body data) then you can finalize the request using the"]
#[doc = r" [`RequestBuilder::send()`] method which returns a future that resolves to a lower-level"]
#[doc = r" [`Response`] value."]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) organization: String,
pub(crate) body: models::ManualInterventionUpdateMetadata,
pub(crate) project: String,
pub(crate) release_id: i32,
pub(crate) manual_intervention_id: i32,
}
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) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/{}/{}/_apis/Release/releases/{}/manualinterventions/{}",
this.client.endpoint(),
&this.organization,
&this.project,
&this.release_id,
&this.manual_intervention_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
if let Some(auth_header) = this
.client
.token_credential()
.http_authorization_header(&this.client.scopes)
.await?
{
req.insert_header(azure_core::headers::AUTHORIZATION, auth_header);
}
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "7.1-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?))
}
})
}
}
impl std::future::IntoFuture for RequestBuilder {
type Output = azure_core::Result<models::ManualIntervention>;
type IntoFuture =
futures::future::BoxFuture<'static, azure_core::Result<models::ManualIntervention>>;
#[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().await })
}
}
}
}