#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
#![allow(clippy::redundant_clone)]
pub mod models;
#[derive(Clone)]
pub struct Client {
endpoint: String,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
pipeline: azure_core::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
endpoint: Option<String>,
scopes: Option<Vec<String>>,
options: azure_core::ClientOptions,
}
pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD;
impl ClientBuilder {
#[doc = "Create a new instance of `ClientBuilder`."]
#[must_use]
pub fn new(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> Self {
Self {
credential,
endpoint: None,
scopes: None,
options: azure_core::ClientOptions::default(),
}
}
#[doc = "Set the endpoint."]
#[must_use]
pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self {
self.endpoint = Some(endpoint.into());
self
}
#[doc = "Set the scopes."]
#[must_use]
pub fn scopes(mut self, scopes: &[&str]) -> Self {
self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
self
}
#[doc = "Set the retry options."]
#[must_use]
pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self {
self.options = self.options.retry(retry);
self
}
#[doc = "Set the transport options."]
#[must_use]
pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self {
self.options = self.options.transport(transport);
self
}
#[doc = "Convert the builder into a `Client` instance."]
#[must_use]
pub fn build(self) -> Client {
let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
let scopes = self.scopes.unwrap_or_else(|| vec![format!("{}/", endpoint)]);
Client::new(endpoint, self.credential, scopes, self.options)
}
}
impl Client {
pub(crate) fn endpoint(&self) -> &str {
self.endpoint.as_str()
}
pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential {
self.credential.as_ref()
}
pub(crate) fn scopes(&self) -> Vec<&str> {
self.scopes.iter().map(String::as_str).collect()
}
pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result<azure_core::Response> {
let mut context = azure_core::Context::default();
self.pipeline.send(&mut context, request).await
}
#[doc = "Create a new `ClientBuilder`."]
#[must_use]
pub fn builder(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> ClientBuilder {
ClientBuilder::new(credential)
}
#[doc = "Create a new `Client`."]
#[must_use]
pub fn new(
endpoint: impl Into<String>,
credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
scopes: Vec<String>,
options: azure_core::ClientOptions,
) -> Self {
let endpoint = endpoint.into();
let pipeline = azure_core::Pipeline::new(
option_env!("CARGO_PKG_NAME"),
option_env!("CARGO_PKG_VERSION"),
options,
Vec::new(),
Vec::new(),
);
Self {
endpoint,
credential,
scopes,
pipeline,
}
}
pub fn activity_client(&self) -> activity::Client {
activity::Client(self.clone())
}
pub fn agent_registration_information_client(&self) -> agent_registration_information::Client {
agent_registration_information::Client(self.clone())
}
pub fn automation_account_client(&self) -> automation_account::Client {
automation_account::Client(self.clone())
}
pub fn certificate_client(&self) -> certificate::Client {
certificate::Client(self.clone())
}
pub fn connection_client(&self) -> connection::Client {
connection::Client(self.clone())
}
pub fn connection_type_client(&self) -> connection_type::Client {
connection_type::Client(self.clone())
}
pub fn credential_client(&self) -> credential::Client {
credential::Client(self.clone())
}
pub fn dsc_compilation_job_client(&self) -> dsc_compilation_job::Client {
dsc_compilation_job::Client(self.clone())
}
pub fn dsc_compilation_job_stream_client(&self) -> dsc_compilation_job_stream::Client {
dsc_compilation_job_stream::Client(self.clone())
}
pub fn dsc_configuration_client(&self) -> dsc_configuration::Client {
dsc_configuration::Client(self.clone())
}
pub fn dsc_node_client(&self) -> dsc_node::Client {
dsc_node::Client(self.clone())
}
pub fn dsc_node_configuration_client(&self) -> dsc_node_configuration::Client {
dsc_node_configuration::Client(self.clone())
}
pub fn fields_client(&self) -> fields::Client {
fields::Client(self.clone())
}
pub fn hybrid_runbook_worker_group_client(&self) -> hybrid_runbook_worker_group::Client {
hybrid_runbook_worker_group::Client(self.clone())
}
pub fn job_client(&self) -> job::Client {
job::Client(self.clone())
}
pub fn job_schedule_client(&self) -> job_schedule::Client {
job_schedule::Client(self.clone())
}
pub fn job_stream_client(&self) -> job_stream::Client {
job_stream::Client(self.clone())
}
pub fn keys_client(&self) -> keys::Client {
keys::Client(self.clone())
}
pub fn linked_workspace_client(&self) -> linked_workspace::Client {
linked_workspace::Client(self.clone())
}
pub fn module_client(&self) -> module::Client {
module::Client(self.clone())
}
pub fn node_count_information_client(&self) -> node_count_information::Client {
node_count_information::Client(self.clone())
}
pub fn node_reports_client(&self) -> node_reports::Client {
node_reports::Client(self.clone())
}
pub fn object_data_types_client(&self) -> object_data_types::Client {
object_data_types::Client(self.clone())
}
pub fn operations_client(&self) -> operations::Client {
operations::Client(self.clone())
}
pub fn private_endpoint_connections_client(&self) -> private_endpoint_connections::Client {
private_endpoint_connections::Client(self.clone())
}
pub fn private_link_resources_client(&self) -> private_link_resources::Client {
private_link_resources::Client(self.clone())
}
pub fn python2_package_client(&self) -> python2_package::Client {
python2_package::Client(self.clone())
}
pub fn runbook_client(&self) -> runbook::Client {
runbook::Client(self.clone())
}
pub fn runbook_draft_client(&self) -> runbook_draft::Client {
runbook_draft::Client(self.clone())
}
pub fn schedule_client(&self) -> schedule::Client {
schedule::Client(self.clone())
}
pub fn software_update_configuration_machine_runs_client(&self) -> software_update_configuration_machine_runs::Client {
software_update_configuration_machine_runs::Client(self.clone())
}
pub fn software_update_configuration_runs_client(&self) -> software_update_configuration_runs::Client {
software_update_configuration_runs::Client(self.clone())
}
pub fn software_update_configurations_client(&self) -> software_update_configurations::Client {
software_update_configurations::Client(self.clone())
}
pub fn source_control_client(&self) -> source_control::Client {
source_control::Client(self.clone())
}
pub fn source_control_sync_job_client(&self) -> source_control_sync_job::Client {
source_control_sync_job::Client(self.clone())
}
pub fn source_control_sync_job_streams_client(&self) -> source_control_sync_job_streams::Client {
source_control_sync_job_streams::Client(self.clone())
}
pub fn statistics_client(&self) -> statistics::Client {
statistics::Client(self.clone())
}
pub fn test_job_client(&self) -> test_job::Client {
test_job::Client(self.clone())
}
pub fn test_job_streams_client(&self) -> test_job_streams::Client {
test_job_streams::Client(self.clone())
}
pub fn usages_client(&self) -> usages::Client {
usages::Client(self.clone())
}
pub fn variable_client(&self) -> variable::Client {
variable::Client(self.clone())
}
pub fn watcher_client(&self) -> watcher::Client {
watcher::Client(self.clone())
}
pub fn webhook_client(&self) -> webhook::Client {
webhook::Client(self.clone())
}
}
pub mod private_endpoint_connections {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "List all private endpoint connections on a Automation account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn list_by_automation_account(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
}
}
#[doc = "Gets a private endpoint connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
private_endpoint_connection_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
private_endpoint_connection_name: private_endpoint_connection_name.into(),
}
}
#[doc = "Approve or reject a private endpoint connection with a given name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
private_endpoint_connection_name: impl Into<String>,
parameters: impl Into<models::PrivateEndpointConnection>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
private_endpoint_connection_name: private_endpoint_connection_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Deletes a private endpoint connection with a given name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `private_endpoint_connection_name`: The name of the private endpoint connection."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
private_endpoint_connection_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
private_endpoint_connection_name: private_endpoint_connection_name.into(),
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/privateEndpointConnections" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpointConnectionListResult>> {
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::PrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) private_endpoint_connection_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . private_endpoint_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateEndpointConnection> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateEndpointConnection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) private_endpoint_connection_name: String,
pub(crate) parameters: models::PrivateEndpointConnection,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . private_endpoint_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateEndpointConnection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) private_endpoint_connection_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/privateEndpointConnections/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . private_endpoint_connection_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod private_link_resources {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the private link resources that need to be created for Automation account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn automation(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> automation::RequestBuilder {
automation::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
}
}
}
pub mod automation {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PrivateLinkResourceListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::PrivateLinkResourceListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/privateLinkResources" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::PrivateLinkResourceListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod python2_package {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the python 2 package identified by package name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `package_name`: The python package name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
package_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
package_name: package_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or Update the python 2 package identified by package name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `package_name`: The name of python package."]
#[doc = "* `parameters`: The create or update parameters for python package."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
package_name: impl Into<String>,
parameters: impl Into<models::PythonPackageCreateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
package_name: package_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the python 2 package identified by package name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `package_name`: The name of python package."]
#[doc = "* `parameters`: The update parameters for python package."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
package_name: impl Into<String>,
parameters: impl Into<models::PythonPackageUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
package_name: package_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the python 2 package by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `package_name`: The python package name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
package_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
package_name: package_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of python 2 packages."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) package_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/python2Packages/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.package_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) package_name: String,
pub(crate) parameters: models::PythonPackageCreateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/python2Packages/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.package_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
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::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) package_name: String,
pub(crate) parameters: models::PythonPackageUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/python2Packages/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.package_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) package_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/python2Packages/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.package_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ModuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ModuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ModuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/python2Packages",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod agent_registration_information {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the automation agent registration information."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
}
}
#[doc = "Regenerate a primary or secondary agent registration key"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `parameters`: The name of the agent registration key to be regenerated"]
pub fn regenerate_key(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
parameters: impl Into<models::AgentRegistrationRegenerateKeyParameter>,
) -> regenerate_key::RequestBuilder {
regenerate_key::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
parameters: parameters.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AgentRegistration> {
let bytes = self.0.into_body().collect().await?;
let body: models::AgentRegistration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/agentRegistrationInformation" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AgentRegistration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod regenerate_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AgentRegistration> {
let bytes = self.0.into_body().collect().await?;
let body: models::AgentRegistration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) parameters: models::AgentRegistrationRegenerateKeyParameter,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/agentRegistrationInformation/regenerateKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AgentRegistration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod dsc_node {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the dsc node identified by node id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: The node id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the dsc node."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: Parameters supplied to the update dsc node."]
#[doc = "* `dsc_node_update_parameters`: Parameters supplied to the update dsc node."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
dsc_node_update_parameters: impl Into<models::DscNodeUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
dsc_node_update_parameters: dsc_node_update_parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the dsc node identified by node id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: The node id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of dsc nodes."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
skip: None,
top: None,
inlinecount: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNode> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNode = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.node_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscNode>> {
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::DscNode> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNode = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) dsc_node_update_parameters: models::DscNodeUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.node_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.dsc_node_update_parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscNode>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.node_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNodeListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNodeListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
pub(crate) skip: Option<i64>,
pub(crate) top: Option<i64>,
pub(crate) inlinecount: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "The number of rows to skip."]
pub fn skip(mut self, skip: i64) -> Self {
self.skip = Some(skip);
self
}
#[doc = "The number of rows to take."]
pub fn top(mut self, top: i64) -> Self {
self.top = Some(top);
self
}
#[doc = "Return total rows."]
pub fn inlinecount(mut self, inlinecount: impl Into<String>) -> Self {
self.inlinecount = Some(inlinecount.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::DscNodeListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(skip) = &this.skip {
req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string());
}
if let Some(top) = &this.top {
req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string());
}
if let Some(inlinecount) = &this.inlinecount {
req.url_mut().query_pairs_mut().append_pair("$inlinecount", inlinecount);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod node_reports {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the Dsc node report list by node id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: The parameters supplied to the list operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_node(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_node::RequestBuilder {
list_by_node::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
#[doc = "Retrieve the Dsc node report data by node id and report id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: The Dsc node id."]
#[doc = "* `report_id`: The report id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
report_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
report_id: report_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve the Dsc node reports by node id and report id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_id`: The Dsc node id."]
#[doc = "* `report_id`: The report id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_content(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_id: impl Into<String>,
report_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_content::RequestBuilder {
get_content::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_id: node_id.into(),
report_id: report_id.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_node {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNodeReportListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNodeReportListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::DscNodeReportListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}/reports",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.node_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNodeReport> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNodeReport = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) report_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}/reports/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . node_id , & this . report_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscNodeReport>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<serde_json::Value> {
let bytes = self.0.into_body().collect().await?;
let body: serde_json::Value = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_id: String,
pub(crate) report_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodes/{}/reports/{}/content" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . node_id , & this . report_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<serde_json::Value>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod dsc_node_configuration {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the Dsc node configurations by node configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_configuration_name`: The Dsc node configuration name."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_configuration_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_configuration_name: node_configuration_name.into(),
}
}
#[doc = "Create the node configuration identified by node configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_configuration_name`: The Dsc node configuration name."]
#[doc = "* `parameters`: The create or update parameters for configuration."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_configuration_name: impl Into<String>,
parameters: impl Into<models::DscNodeConfigurationCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_configuration_name: node_configuration_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the Dsc node configurations by node configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `node_configuration_name`: The Dsc node configuration name."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
node_configuration_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
node_configuration_name: node_configuration_name.into(),
}
}
#[doc = "Retrieve a list of dsc node configurations."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
skip: None,
top: None,
inlinecount: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNodeConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNodeConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_configuration_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodeConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . node_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscNodeConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_configuration_name: String,
pub(crate) parameters: models::DscNodeConfigurationCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodeConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . node_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) node_configuration_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodeConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . node_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscNodeConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscNodeConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
pub(crate) skip: Option<i64>,
pub(crate) top: Option<i64>,
pub(crate) inlinecount: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "The number of rows to skip."]
pub fn skip(mut self, skip: i64) -> Self {
self.skip = Some(skip);
self
}
#[doc = "The number of rows to take."]
pub fn top(mut self, top: i64) -> Self {
self.top = Some(top);
self
}
#[doc = "Return total rows."]
pub fn inlinecount(mut self, inlinecount: impl Into<String>) -> Self {
self.inlinecount = Some(inlinecount.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::DscNodeConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodeConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(skip) = &this.skip {
req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string());
}
if let Some(top) = &this.top {
req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string());
}
if let Some(inlinecount) = &this.inlinecount {
req.url_mut().query_pairs_mut().append_pair("$inlinecount", inlinecount);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod dsc_compilation_job {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the Dsc configuration compilation job identified by job id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `compilation_job_name`: The DSC configuration Id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
compilation_job_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
compilation_job_name: compilation_job_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates the Dsc compilation job of the configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `compilation_job_name`: The DSC configuration Id."]
#[doc = "* `parameters`: The parameters supplied to the create compilation job operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
compilation_job_name: impl Into<String>,
parameters: impl Into<models::DscCompilationJobCreateParameters>,
subscription_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
compilation_job_name: compilation_job_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of dsc compilation jobs."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
#[doc = "Retrieve the job stream identified by job stream id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_id`: The job id."]
#[doc = "* `job_stream_id`: The job stream id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_stream(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_id: impl Into<String>,
job_stream_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_stream::RequestBuilder {
get_stream::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_id: job_id.into(),
job_stream_id: job_stream_id.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscCompilationJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscCompilationJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) compilation_job_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/compilationjobs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.compilation_job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscCompilationJob>> {
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::DscCompilationJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscCompilationJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) compilation_job_name: String,
pub(crate) parameters: models::DscCompilationJobCreateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/compilationjobs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.compilation_job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscCompilationJob>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscCompilationJobListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscCompilationJobListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::DscCompilationJobListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/compilationjobs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get_stream {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStream> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStream = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_id: String,
pub(crate) job_stream_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/compilationjobs/{}/streams/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . job_id , & this . job_stream_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobStream>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod dsc_compilation_job_stream {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve all the job streams for the compilation Job."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_id`: The job id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_job(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_job::RequestBuilder {
list_by_job::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_id: job_id.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_job {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStreamListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStreamListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/compilationjobs/{}/streams" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . job_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobStreamListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod node_count_information {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve counts for Dsc Nodes."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `count_type`: The type of counts to retrieve"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
count_type: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
count_type: count_type.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NodeCounts> {
let bytes = self.0.into_body().collect().await?;
let body: models::NodeCounts = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) count_type: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/nodecounts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.count_type
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::NodeCounts>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod source_control {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the source control identified by source control name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The name of source control."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a source control."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `parameters`: The parameters supplied to the create or update source control operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
parameters: impl Into<models::SourceControlCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a source control."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `parameters`: The parameters supplied to the update source control operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
parameters: impl Into<models::SourceControlUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the source control."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The name of source control."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of source controls."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControl> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControl = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.source_control_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControl>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControl> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControl = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) parameters: models::SourceControlCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.source_control_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControl>> {
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::SourceControl> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControl = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) parameters: models::SourceControlUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.source_control_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControl>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.source_control_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControlListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::SourceControlListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod source_control_sync_job {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the source control sync job identified by job id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `source_control_sync_job_id`: The source control sync job id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
source_control_sync_job_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
source_control_sync_job_id: source_control_sync_job_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Creates the sync job for a source control."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `source_control_sync_job_id`: The source control sync job id."]
#[doc = "* `parameters`: The parameters supplied to the create source control sync job operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
source_control_sync_job_id: impl Into<String>,
parameters: impl Into<models::SourceControlSyncJobCreateParameters>,
subscription_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
source_control_sync_job_id: source_control_sync_job_id.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of source control sync jobs."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControlSyncJobById> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlSyncJobById = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) source_control_sync_job_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}/sourceControlSyncJobs/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . source_control_name , & this . source_control_sync_job_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControlSyncJobById>> {
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::SourceControlSyncJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlSyncJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) source_control_sync_job_id: String,
pub(crate) parameters: models::SourceControlSyncJobCreateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}/sourceControlSyncJobs/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . source_control_name , & this . source_control_sync_job_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControlSyncJob>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControlSyncJobListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlSyncJobListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::SourceControlSyncJobListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}/sourceControlSyncJobs" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . source_control_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod source_control_sync_job_streams {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve a list of sync job streams identified by sync job id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `source_control_sync_job_id`: The source control sync job id."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_sync_job(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
source_control_sync_job_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_sync_job::RequestBuilder {
list_by_sync_job::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
source_control_sync_job_id: source_control_sync_job_id.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
#[doc = "Retrieve a sync job stream identified by stream id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `source_control_name`: The source control name."]
#[doc = "* `source_control_sync_job_id`: The source control sync job id."]
#[doc = "* `stream_id`: The id of the sync job stream."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
source_control_name: impl Into<String>,
source_control_sync_job_id: impl Into<String>,
stream_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
source_control_name: source_control_name.into(),
source_control_sync_job_id: source_control_sync_job_id.into(),
stream_id: stream_id.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_sync_job {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControlSyncJobStreamsListBySyncJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlSyncJobStreamsListBySyncJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) source_control_sync_job_id: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::SourceControlSyncJobStreamsListBySyncJob, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}/sourceControlSyncJobs/{}/streams" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . source_control_name , & this . source_control_sync_job_id)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SourceControlSyncJobStreamById> {
let bytes = self.0.into_body().collect().await?;
let body: models::SourceControlSyncJobStreamById = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) source_control_name: String,
pub(crate) source_control_sync_job_id: String,
pub(crate) stream_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/sourceControls/{}/sourceControlSyncJobs/{}/streams/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . source_control_name , & this . source_control_sync_job_id , & this . stream_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SourceControlSyncJobStreamById>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod automation_account {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get information about an Automation Account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or update automation account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `parameters`: Parameters supplied to the create or update automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
parameters: impl Into<models::AutomationAccountCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update an automation account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `parameters`: Parameters supplied to the update automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
parameters: impl Into<models::AutomationAccountUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete an automation account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of accounts within a given resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_resource_group(
&self,
resource_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Lists the Automation Accounts within an Azure subscription."]
#[doc = "Retrieve a list of accounts within a given subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutomationAccount> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutomationAccount = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AutomationAccount>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutomationAccount> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutomationAccount = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) parameters: models::AutomationAccountCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AutomationAccount>> {
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::AutomationAccount> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutomationAccount = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) parameters: models::AutomationAccountUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::AutomationAccount>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutomationAccountListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutomationAccountListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AutomationAccountListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AutomationAccountListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::AutomationAccountListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::AutomationAccountListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/providers/Microsoft.Automation/automationAccounts",
this.client.endpoint(),
&this.subscription_id
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod statistics {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the statistics for the account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::StatisticsListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::StatisticsListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/statistics",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::StatisticsListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod usages {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the usage for the account id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::UsageListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::UsageListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/usages",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::UsageListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod keys {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the automation keys for an account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::KeyListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::KeyListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/listKeys",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::KeyListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod certificate {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the certificate identified by certificate name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `certificate_name`: The name of certificate."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
certificate_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
certificate_name: certificate_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a certificate."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `certificate_name`: The parameters supplied to the create or update certificate operation."]
#[doc = "* `parameters`: The parameters supplied to the create or update certificate operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
certificate_name: impl Into<String>,
parameters: impl Into<models::CertificateCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
certificate_name: certificate_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a certificate."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `certificate_name`: The parameters supplied to the update certificate operation."]
#[doc = "* `parameters`: The parameters supplied to the update certificate operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
certificate_name: impl Into<String>,
parameters: impl Into<models::CertificateUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
certificate_name: certificate_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the certificate."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `certificate_name`: The name of certificate."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
certificate_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
certificate_name: certificate_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of certificates."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
let bytes = self.0.into_body().collect().await?;
let body: models::Certificate = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) certificate_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/certificates/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.certificate_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Certificate>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
let bytes = self.0.into_body().collect().await?;
let body: models::Certificate = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) certificate_name: String,
pub(crate) parameters: models::CertificateCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/certificates/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.certificate_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Certificate>> {
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::Certificate> {
let bytes = self.0.into_body().collect().await?;
let body: models::Certificate = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) certificate_name: String,
pub(crate) parameters: models::CertificateUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/certificates/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.certificate_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Certificate>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) certificate_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/certificates/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.certificate_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CertificateListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::CertificateListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::CertificateListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/certificates",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod connection {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the connection identified by connection name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_name`: The name of connection."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or update a connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_name`: The parameters supplied to the create or update connection operation."]
#[doc = "* `parameters`: The parameters supplied to the create or update connection operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_name: impl Into<String>,
parameters: impl Into<models::ConnectionCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_name: connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_name`: The parameters supplied to the update a connection operation."]
#[doc = "* `parameters`: The parameters supplied to the update a connection operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_name: impl Into<String>,
parameters: impl Into<models::ConnectionUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_name: connection_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the connection."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_name`: The name of connection."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_name: connection_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of connections."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Connection> {
let bytes = self.0.into_body().collect().await?;
let body: models::Connection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Connection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Connection> {
let bytes = self.0.into_body().collect().await?;
let body: models::Connection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_name: String,
pub(crate) parameters: models::ConnectionCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Connection>> {
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::Connection> {
let bytes = self.0.into_body().collect().await?;
let body: models::Connection = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_name: String,
pub(crate) parameters: models::ConnectionUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Connection>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connections/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ConnectionListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connections",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod connection_type {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the connection type identified by connection type name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_type_name`: The name of connection type."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_type_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_type_name: connection_type_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a connection type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_type_name`: The parameters supplied to the create or update connection type operation."]
#[doc = "* `parameters`: The parameters supplied to the create or update connection type operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_type_name: impl Into<String>,
parameters: impl Into<models::ConnectionTypeCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_type_name: connection_type_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the connection type."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `connection_type_name`: The name of connection type."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
connection_type_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
connection_type_name: connection_type_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of connection types."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionType> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionType = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_type_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connectionTypes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_type_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionType>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionType> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionType = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_type_name: String,
pub(crate) parameters: models::ConnectionTypeCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connectionTypes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_type_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::ConnectionType>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) connection_type_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connectionTypes/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.connection_type_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ConnectionTypeListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ConnectionTypeListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ConnectionTypeListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/connectionTypes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod credential {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the credential identified by credential name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `credential_name`: The name of credential."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
credential_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
credential_name: credential_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a credential."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `credential_name`: The parameters supplied to the create or update credential operation."]
#[doc = "* `parameters`: The parameters supplied to the create or update credential operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
credential_name: impl Into<String>,
parameters: impl Into<models::CredentialCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
credential_name: credential_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a credential."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `credential_name`: The parameters supplied to the Update credential operation."]
#[doc = "* `parameters`: The parameters supplied to the Update credential operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
credential_name: impl Into<String>,
parameters: impl Into<models::CredentialUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
credential_name: credential_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the credential."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `credential_name`: The name of credential."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
credential_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
credential_name: credential_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of credentials."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Credential> {
let bytes = self.0.into_body().collect().await?;
let body: models::Credential = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) credential_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/credentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.credential_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Credential>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Credential> {
let bytes = self.0.into_body().collect().await?;
let body: models::Credential = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) credential_name: String,
pub(crate) parameters: models::CredentialCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/credentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.credential_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Credential>> {
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::Credential> {
let bytes = self.0.into_body().collect().await?;
let body: models::Credential = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) credential_name: String,
pub(crate) parameters: models::CredentialUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/credentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.credential_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Credential>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) credential_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/credentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.credential_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CredentialListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::CredentialListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::CredentialListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/credentials",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod hybrid_runbook_worker_group {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve a hybrid runbook worker group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `hybrid_runbook_worker_group_name`: The hybrid runbook worker group name"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
hybrid_runbook_worker_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
hybrid_runbook_worker_group_name: hybrid_runbook_worker_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a hybrid runbook worker group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `hybrid_runbook_worker_group_name`: The hybrid runbook worker group name"]
#[doc = "* `parameters`: The hybrid runbook worker group"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
hybrid_runbook_worker_group_name: impl Into<String>,
parameters: impl Into<models::HybridRunbookWorkerGroupUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
hybrid_runbook_worker_group_name: hybrid_runbook_worker_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete a hybrid runbook worker group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `hybrid_runbook_worker_group_name`: The hybrid runbook worker group name"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
hybrid_runbook_worker_group_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
hybrid_runbook_worker_group_name: hybrid_runbook_worker_group_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of hybrid runbook worker groups."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HybridRunbookWorkerGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::HybridRunbookWorkerGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) hybrid_runbook_worker_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/hybridRunbookWorkerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . hybrid_runbook_worker_group_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HybridRunbookWorkerGroup>> {
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::HybridRunbookWorkerGroup> {
let bytes = self.0.into_body().collect().await?;
let body: models::HybridRunbookWorkerGroup = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) hybrid_runbook_worker_group_name: String,
pub(crate) parameters: models::HybridRunbookWorkerGroupUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/hybridRunbookWorkerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . hybrid_runbook_worker_group_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::HybridRunbookWorkerGroup>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) hybrid_runbook_worker_group_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/hybridRunbookWorkerGroups/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . hybrid_runbook_worker_group_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HybridRunbookWorkerGroupsListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::HybridRunbookWorkerGroupsListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::HybridRunbookWorkerGroupsListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/hybridRunbookWorkerGroups" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod job_schedule {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the job schedule identified by job schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_schedule_id`: The job schedule name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_schedule_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_schedule_id: job_schedule_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a job schedule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_schedule_id`: The job schedule name."]
#[doc = "* `parameters`: The parameters supplied to the create job schedule operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_schedule_id: impl Into<String>,
parameters: impl Into<models::JobScheduleCreateParameters>,
subscription_id: impl Into<String>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_schedule_id: job_schedule_id.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the job schedule identified by job schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_schedule_id`: The job schedule name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_schedule_id: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_schedule_id: job_schedule_id.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of job schedules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobSchedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobSchedule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_schedule_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobSchedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_schedule_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobSchedule>> {
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::JobSchedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobSchedule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_schedule_id: String,
pub(crate) parameters: models::JobScheduleCreateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobSchedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_schedule_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobSchedule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_schedule_id: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobSchedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_schedule_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobScheduleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobScheduleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::JobScheduleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobSchedules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod linked_workspace {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the linked workspace for the account id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::LinkedWorkspace> {
let bytes = self.0.into_body().collect().await?;
let body: models::LinkedWorkspace = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/linkedWorkspace",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::LinkedWorkspace>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod activity {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the activity in the module identified by module name and activity name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `activity_name`: The name of activity."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
activity_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
activity_name: activity_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of activities in the module identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_module(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_module::RequestBuilder {
list_by_module::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Activity> {
let bytes = self.0.into_body().collect().await?;
let body: models::Activity = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) activity_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}/activities/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . module_name , & this . activity_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Activity>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_module {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ActivityListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ActivityListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ActivityListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}/activities" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . module_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod module {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the module identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The module name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create or Update the module identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `parameters`: The create or update parameters for module."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
parameters: impl Into<models::ModuleCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the module identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `parameters`: The update parameters for module."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
parameters: impl Into<models::ModuleUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the module by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The module name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of modules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.module_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) parameters: models::ModuleCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.module_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
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::Module> {
let bytes = self.0.into_body().collect().await?;
let body: models::Module = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) parameters: models::ModuleUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.module_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Module>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.module_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ModuleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ModuleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ModuleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod object_data_types {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve a list of fields of a given type identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `type_name`: The name of type."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_fields_by_module_and_type(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
type_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_fields_by_module_and_type::RequestBuilder {
list_fields_by_module_and_type::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
type_name: type_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of fields of a given type across all accessible modules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `type_name`: The name of type."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_fields_by_type(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
type_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_fields_by_type::RequestBuilder {
list_fields_by_type::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
type_name: type_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_fields_by_module_and_type {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TypeFieldListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::TypeFieldListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) type_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}/objectDataTypes/{}/fields" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . module_name , & this . type_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TypeFieldListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_fields_by_type {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TypeFieldListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::TypeFieldListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) type_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/objectDataTypes/{}/fields" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . type_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TypeFieldListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod fields {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve a list of fields of a given type identified by module name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `module_name`: The name of module."]
#[doc = "* `type_name`: The name of type."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_type(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
module_name: impl Into<String>,
type_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_type::RequestBuilder {
list_by_type::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
module_name: module_name.into(),
type_name: type_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod list_by_type {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TypeFieldListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::TypeFieldListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) module_name: String,
pub(crate) type_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/modules/{}/types/{}/fields" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . module_name , & this . type_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TypeFieldListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod schedule {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the schedule identified by schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `schedule_name`: The schedule name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
schedule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
schedule_name: schedule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a schedule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `schedule_name`: The schedule name."]
#[doc = "* `parameters`: The parameters supplied to the create or update schedule operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
schedule_name: impl Into<String>,
parameters: impl Into<models::ScheduleCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
schedule_name: schedule_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the schedule identified by schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `schedule_name`: The schedule name."]
#[doc = "* `parameters`: The parameters supplied to the update schedule operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
schedule_name: impl Into<String>,
parameters: impl Into<models::ScheduleUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
schedule_name: schedule_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the schedule identified by schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `schedule_name`: The schedule name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
schedule_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
schedule_name: schedule_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of schedules."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Schedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::Schedule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) schedule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/schedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.schedule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Schedule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Schedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::Schedule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) schedule_name: String,
pub(crate) parameters: models::ScheduleCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/schedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.schedule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Schedule>> {
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::Schedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::Schedule = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) schedule_name: String,
pub(crate) parameters: models::ScheduleUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/schedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.schedule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Schedule>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) schedule_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/schedules/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.schedule_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ScheduleListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::ScheduleListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::ScheduleListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/schedules",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod variable {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the variable identified by variable name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `variable_name`: The name of variable."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
variable_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
variable_name: variable_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create a variable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `variable_name`: The variable name."]
#[doc = "* `parameters`: The parameters supplied to the create or update variable operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
variable_name: impl Into<String>,
parameters: impl Into<models::VariableCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
variable_name: variable_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update a variable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `variable_name`: The variable name."]
#[doc = "* `parameters`: The parameters supplied to the update variable operation."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
variable_name: impl Into<String>,
parameters: impl Into<models::VariableUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
variable_name: variable_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the variable."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `variable_name`: The name of variable."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
variable_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
variable_name: variable_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of variables."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Variable> {
let bytes = self.0.into_body().collect().await?;
let body: models::Variable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) variable_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/variables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.variable_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Variable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Variable> {
let bytes = self.0.into_body().collect().await?;
let body: models::Variable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) variable_name: String,
pub(crate) parameters: models::VariableCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/variables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.variable_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Variable>> {
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::Variable> {
let bytes = self.0.into_body().collect().await?;
let body: models::Variable = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) variable_name: String,
pub(crate) parameters: models::VariableUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/variables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.variable_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Variable>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) variable_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/variables/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.variable_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VariableListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::VariableListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::VariableListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/variables",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod watcher {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the watcher identified by watcher name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create the watcher identified by watcher name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `parameters`: The create or update parameters for watcher."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
parameters: impl Into<models::Watcher>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the watcher identified by watcher name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `parameters`: The update parameters for watcher."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
parameters: impl Into<models::WatcherUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the watcher by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Resume the watcher identified by watcher name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn start(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> start::RequestBuilder {
start::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Resume the watcher identified by watcher name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `watcher_name`: The watcher name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
watcher_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
watcher_name: watcher_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of watchers."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Watcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::Watcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Watcher>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Watcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::Watcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) parameters: models::Watcher,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Watcher>> {
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::Watcher> {
let bytes = self.0.into_body().collect().await?;
let body: models::Watcher = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) parameters: models::WatcherUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Watcher>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod start {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}/start",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) watcher_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers/{}/stop",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.watcher_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WatcherListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::WatcherListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::WatcherListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/watchers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2020-01-13-preview");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod dsc_configuration {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the configuration identified by configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `configuration_name`: The configuration name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
configuration_name: configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create the configuration identified by configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `configuration_name`: The create or update parameters for configuration."]
#[doc = "* `parameters`: The create or update parameters for configuration."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
configuration_name: impl Into<String>,
parameters: impl Into<models::DscConfigurationCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
configuration_name: configuration_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create the configuration identified by configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `configuration_name`: The create or update parameters for configuration."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
configuration_name: configuration_name.into(),
subscription_id: subscription_id.into(),
parameters: None,
}
}
#[doc = "Delete the dsc configuration identified by configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `configuration_name`: The configuration name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
configuration_name: configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve the configuration script identified by configuration name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `configuration_name`: The configuration name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get_content(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
configuration_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get_content::RequestBuilder {
get_content::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
configuration_name: configuration_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of configurations."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
skip: None,
top: None,
inlinecount: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) configuration_name: String,
pub(crate) parameters: models::DscConfigurationCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscConfiguration>> {
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::DscConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) configuration_name: String,
pub(crate) subscription_id: String,
pub(crate) parameters: Option<models::DscConfigurationUpdateParameters>,
}
impl RequestBuilder {
#[doc = "The create or update parameters for configuration."]
pub fn parameters(mut self, parameters: impl Into<models::DscConfigurationUpdateParameters>) -> Self {
self.parameters = Some(parameters.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
let req_body = if let Some(parameters) = &this.parameters {
req.insert_header("content-type", "application/json");
azure_core::to_json(parameters)?
} else {
azure_core::EMPTY_BODY
};
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DscConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.configuration_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_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)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) configuration_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations/{}/content" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DscConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::DscConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
pub(crate) skip: Option<i64>,
pub(crate) top: Option<i64>,
pub(crate) inlinecount: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "The number of rows to skip."]
pub fn skip(mut self, skip: i64) -> Self {
self.skip = Some(skip);
self
}
#[doc = "The number of rows to take."]
pub fn top(mut self, top: i64) -> Self {
self.top = Some(top);
self
}
#[doc = "Return total rows."]
pub fn inlinecount(mut self, inlinecount: impl Into<String>) -> Self {
self.inlinecount = Some(inlinecount.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::DscConfigurationListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/configurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(skip) = &this.skip {
req.url_mut().query_pairs_mut().append_pair("$skip", &skip.to_string());
}
if let Some(top) = &this.top {
req.url_mut().query_pairs_mut().append_pair("$top", &top.to_string());
}
if let Some(inlinecount) = &this.inlinecount {
req.url_mut().query_pairs_mut().append_pair("$inlinecount", inlinecount);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod job {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the job output identified by job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The name of the job to be created."]
pub fn get_output(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
) -> get_output::RequestBuilder {
get_output::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
client_request_id: None,
}
}
#[doc = "Retrieve the runbook content of the job identified by job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
pub fn get_runbook_content(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
) -> get_runbook_content::RequestBuilder {
get_runbook_content::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
client_request_id: None,
}
}
#[doc = "Suspend the job identified by job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
pub fn suspend(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
) -> suspend::RequestBuilder {
suspend::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
client_request_id: None,
}
}
#[doc = "Stop the job identified by jobName."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn stop(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
subscription_id: subscription_id.into(),
client_request_id: None,
}
}
#[doc = "Retrieve the job identified by job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
client_request_id: None,
}
}
#[doc = "Create a job of the runbook."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
#[doc = "* `parameters`: The parameters supplied to the create job operation."]
pub fn create(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
parameters: impl Into<models::JobCreateParameters>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
parameters: parameters.into(),
client_request_id: None,
}
}
#[doc = "Retrieve a list of jobs."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
client_request_id: None,
}
}
#[doc = "Resume the job identified by jobName."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn resume(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> resume::RequestBuilder {
resume::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
subscription_id: subscription_id.into(),
client_request_id: None,
}
}
}
pub mod get_output {
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)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/output",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_runbook_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)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/runbookContent" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . job_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod suspend {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/suspend",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) subscription_id: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/stop",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).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::Job> {
let bytes = self.0.into_body().collect().await?;
let body: models::Job = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Job>> {
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::Job> {
let bytes = self.0.into_body().collect().await?;
let body: models::Job = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) parameters: models::JobCreateParameters,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Job>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobListResultV2> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobListResultV2 = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::JobListResultV2, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
pub mod resume {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) subscription_id: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/resume",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod job_stream {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the job stream identified by job stream id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
#[doc = "* `job_stream_id`: The job stream id."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
job_stream_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
job_stream_id: job_stream_id.into(),
client_request_id: None,
}
}
#[doc = "Retrieve a list of jobs streams identified by job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `job_name`: The job name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_job(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
job_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_job::RequestBuilder {
list_by_job::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
job_name: job_name.into(),
subscription_id: subscription_id.into(),
filter: None,
client_request_id: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStream> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStream = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) job_stream_id: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/streams/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name,
&this.job_stream_id
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobStream>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_job {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStreamListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStreamListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) job_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::JobStreamListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/jobs/{}/streams",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.job_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod operations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists all of the available Automation REST API operations."]
pub fn list(&self) -> list::RequestBuilder {
list::RequestBuilder { client: self.0.clone() }
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::OperationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::OperationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as the continuation token is not part of the response schema"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url =
azure_core::Url::parse(&format!("{}/providers/Microsoft.Automation/operations", this.client.endpoint(),))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::OperationListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod software_update_configurations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a single software update configuration by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `software_update_configuration_name`: The name of the software update configuration to be created."]
pub fn get_by_name(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
software_update_configuration_name: impl Into<String>,
) -> get_by_name::RequestBuilder {
get_by_name::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
software_update_configuration_name: software_update_configuration_name.into(),
client_request_id: None,
}
}
#[doc = "Create a new software update configuration with the name given in the URI."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `software_update_configuration_name`: The name of the software update configuration to be created."]
#[doc = "* `parameters`: Request body."]
pub fn create(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
software_update_configuration_name: impl Into<String>,
parameters: impl Into<models::SoftwareUpdateConfiguration>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
software_update_configuration_name: software_update_configuration_name.into(),
parameters: parameters.into(),
client_request_id: None,
}
}
#[doc = "delete a specific software update configuration."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `software_update_configuration_name`: The name of the software update configuration to be created."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
software_update_configuration_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
software_update_configuration_name: software_update_configuration_name.into(),
client_request_id: None,
}
}
#[doc = "Get all software update configurations for the account."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
client_request_id: None,
filter: None,
}
}
}
pub mod get_by_name {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SoftwareUpdateConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) software_update_configuration_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . software_update_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfiguration>> {
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::SoftwareUpdateConfiguration> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfiguration = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) software_update_configuration_name: String,
pub(crate) parameters: models::SoftwareUpdateConfiguration,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . software_update_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfiguration>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) software_update_configuration_name: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurations/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . software_update_configuration_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).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::SoftwareUpdateConfigurationListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfigurationListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) client_request_id: Option<String>,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurations" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfigurationListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod software_update_configuration_runs {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a single software update configuration Run by Id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `software_update_configuration_run_id`: The Id of the software update configuration run."]
pub fn get_by_id(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
software_update_configuration_run_id: impl Into<String>,
) -> get_by_id::RequestBuilder {
get_by_id::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
software_update_configuration_run_id: software_update_configuration_run_id.into(),
client_request_id: None,
}
}
#[doc = "Return list of software update configuration runs"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
client_request_id: None,
filter: None,
skip: None,
top: None,
}
}
}
pub mod get_by_id {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SoftwareUpdateConfigurationRun> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfigurationRun = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) software_update_configuration_run_id: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurationRuns/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . software_update_configuration_run_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfigurationRun>> {
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::SoftwareUpdateConfigurationRunListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfigurationRunListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) client_request_id: Option<String>,
pub(crate) filter: Option<String>,
pub(crate) skip: Option<String>,
pub(crate) top: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'"]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "Number of entries you skip before returning results"]
pub fn skip(mut self, skip: impl Into<String>) -> Self {
self.skip = Some(skip.into());
self
}
#[doc = "Maximum number of entries returned in the results collection"]
pub fn top(mut self, top: impl Into<String>) -> Self {
self.top = Some(top.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurationRuns" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(skip) = &this.skip {
req.url_mut().query_pairs_mut().append_pair("$skip", skip);
}
if let Some(top) = &this.top {
req.url_mut().query_pairs_mut().append_pair("$top", top);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfigurationRunListResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod software_update_configuration_machine_runs {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Get a single software update configuration machine run by Id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `software_update_configuration_machine_run_id`: The Id of the software update configuration machine run."]
pub fn get_by_id(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
software_update_configuration_machine_run_id: impl Into<String>,
) -> get_by_id::RequestBuilder {
get_by_id::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
software_update_configuration_machine_run_id: software_update_configuration_machine_run_id.into(),
client_request_id: None,
}
}
#[doc = "Return list of software update configuration machine runs"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn list(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
client_request_id: None,
filter: None,
skip: None,
top: None,
}
}
}
pub mod get_by_id {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SoftwareUpdateConfigurationMachineRun> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfigurationMachineRun = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) software_update_configuration_machine_run_id: String,
pub(crate) client_request_id: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurationMachineRuns/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . software_update_configuration_machine_run_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfigurationMachineRun>> {
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::SoftwareUpdateConfigurationMachineRunListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::SoftwareUpdateConfigurationMachineRunListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) client_request_id: Option<String>,
pub(crate) filter: Option<String>,
pub(crate) skip: Option<String>,
pub(crate) top: Option<String>,
}
impl RequestBuilder {
#[doc = "Identifies this specific client request."]
pub fn client_request_id(mut self, client_request_id: impl Into<String>) -> Self {
self.client_request_id = Some(client_request_id.into());
self
}
#[doc = "The filter to apply on the operation. You can use the following filters: 'properties/osType', 'properties/status', 'properties/startTime', and 'properties/softwareUpdateConfiguration/name'"]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
#[doc = "number of entries you skip before returning results"]
pub fn skip(mut self, skip: impl Into<String>) -> Self {
self.skip = Some(skip.into());
self
}
#[doc = "Maximum number of entries returned in the results collection"]
pub fn top(mut self, top: impl Into<String>) -> Self {
self.top = Some(top.into());
self
}
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/softwareUpdateConfigurationMachineRuns" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2019-06-01");
if let Some(client_request_id) = &this.client_request_id {
req.insert_header("clientrequestid", client_request_id);
}
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
if let Some(skip) = &this.skip {
req.url_mut().query_pairs_mut().append_pair("$skip", skip);
}
if let Some(top) = &this.top {
req.url_mut().query_pairs_mut().append_pair("$top", top);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(
self,
) -> futures::future::BoxFuture<'static, azure_core::Result<models::SoftwareUpdateConfigurationMachineRunListResult>>
{
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod runbook_draft {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the content of runbook draft identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn get_content(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> get_content::RequestBuilder {
get_content::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Replaces the runbook draft content."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
#[doc = "* `runbook_content`: The\u{a0}runbook\u{a0}draft\u{a0}content."]
pub fn replace_content(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
runbook_content: impl Into<serde_json::Value>,
) -> replace_content::RequestBuilder {
replace_content::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
runbook_content: runbook_content.into(),
}
}
#[doc = "Retrieve the runbook draft identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Undo draft edit to last known published state identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn undo_edit(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> undo_edit::RequestBuilder {
undo_edit::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
}
pub mod get_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<bytes::Bytes> {
let bytes = self.0.into_body().collect().await?;
let body = bytes;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/content" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<bytes::Bytes>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod replace_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<bytes::Bytes> {
let bytes = self.0.into_body().collect().await?;
let body = 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
}
pub fn headers(&self) -> Headers {
Headers(self.0.headers())
}
}
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()
}
}
pub struct Headers<'a>(&'a azure_core::headers::Headers);
impl<'a> Headers<'a> {
#[doc = "URL to query for status of the operation."]
pub fn location(&self) -> azure_core::Result<&str> {
self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) runbook_content: serde_json::Value,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/content" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
req.insert_header("content-type", "text/powershell");
let req_body = azure_core::to_json(&this.runbook_content)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<bytes::Bytes>> {
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::RunbookDraft> {
let bytes = self.0.into_body().collect().await?;
let body: models::RunbookDraft = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.runbook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RunbookDraft>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod undo_edit {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RunbookDraftUndoEditResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RunbookDraftUndoEditResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/undoEdit" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::RunbookDraftUndoEditResult>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod runbook {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Publish runbook draft."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The parameters supplied to the publish runbook operation."]
pub fn publish(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> publish::RequestBuilder {
publish::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Retrieve the content of runbook identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn get_content(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> get_content::RequestBuilder {
get_content::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Retrieve the runbook identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Create the runbook identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
#[doc = "* `parameters`: The create or update parameters for runbook. Provide either content link for a published runbook or draft, not both."]
pub fn create_or_update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
parameters: impl Into<models::RunbookCreateOrUpdateParameters>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Update the runbook identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
#[doc = "* `parameters`: The update parameters for runbook."]
pub fn update(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
parameters: impl Into<models::RunbookUpdateParameters>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Delete the runbook by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Retrieve a list of runbooks."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
pub fn list_by_automation_account(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
}
}
}
pub mod publish {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "only the first response will be fetched as long running operations are not supported yet"]
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/publish" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod get_content {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<bytes::Bytes> {
let bytes = self.0.into_body().collect().await?;
let body = bytes;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/content" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<bytes::Bytes>> {
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::Runbook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Runbook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.runbook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Runbook>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Runbook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Runbook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) parameters: models::RunbookCreateOrUpdateParameters,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.runbook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Runbook>> {
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::Runbook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Runbook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) parameters: models::RunbookUpdateParameters,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.runbook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Runbook>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.runbook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::RunbookListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::RunbookListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
}
impl RequestBuilder {
pub fn into_stream(self) -> azure_core::Pageable<models::RunbookListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod test_job_streams {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve a test job stream of the test job identified by runbook name and stream id."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
#[doc = "* `job_stream_id`: The job stream id."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
job_stream_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
job_stream_id: job_stream_id.into(),
}
}
#[doc = "Retrieve a list of test job streams identified by runbook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn list_by_test_job(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> list_by_test_job::RequestBuilder {
list_by_test_job::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
filter: None,
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStream> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStream = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) job_stream_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob/streams/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name , & this . job_stream_id)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::JobStream>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_test_job {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobStreamListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobStreamListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::JobStreamListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob/streams" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}
pub mod test_job {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieve the test job for the specified runbook."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Create a test job of the runbook."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The parameters supplied to the create test job operation."]
#[doc = "* `parameters`: The parameters supplied to the create test job operation."]
pub fn create(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
parameters: impl Into<models::TestJobCreateParameters>,
) -> create::RequestBuilder {
create::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
parameters: parameters.into(),
}
}
#[doc = "Resume the test job."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn resume(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> resume::RequestBuilder {
resume::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Stop the test job."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn stop(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> stop::RequestBuilder {
stop::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
#[doc = "Suspend the test job."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `runbook_name`: The runbook name."]
pub fn suspend(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
runbook_name: impl Into<String>,
) -> suspend::RequestBuilder {
suspend::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
runbook_name: runbook_name.into(),
}
}
}
pub mod get {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TestJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::TestJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TestJob>> {
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::TestJob> {
let bytes = self.0.into_body().collect().await?;
let body: models::TestJob = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
pub(crate) parameters: models::TestJobCreateParameters,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::TestJob>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod resume {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob/resume" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod stop {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob/stop" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod suspend {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) runbook_name: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/runbooks/{}/draft/testJob/suspend" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name , & this . runbook_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2018-06-30");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod webhook {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Generates a Uri for use in creating a webhook."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn generate_uri(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> generate_uri::RequestBuilder {
generate_uri::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve the webhook identified by webhook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `webhook_name`: The webhook name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn get(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
webhook_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
webhook_name: webhook_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Create the webhook identified by webhook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `webhook_name`: The webhook name."]
#[doc = "* `parameters`: The create or update parameters for webhook."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn create_or_update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
webhook_name: impl Into<String>,
parameters: impl Into<models::WebhookCreateOrUpdateParameters>,
subscription_id: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
webhook_name: webhook_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Update the webhook identified by webhook name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `webhook_name`: The webhook name."]
#[doc = "* `parameters`: The update parameters for webhook."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn update(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
webhook_name: impl Into<String>,
parameters: impl Into<models::WebhookUpdateParameters>,
subscription_id: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
webhook_name: webhook_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Delete the webhook by name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `webhook_name`: The webhook name."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn delete(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
webhook_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
webhook_name: webhook_name.into(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieve a list of webhooks."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `resource_group_name`: Name of an Azure Resource group."]
#[doc = "* `automation_account_name`: The name of the automation account."]
#[doc = "* `subscription_id`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call."]
pub fn list_by_automation_account(
&self,
resource_group_name: impl Into<String>,
automation_account_name: impl Into<String>,
subscription_id: impl Into<String>,
) -> list_by_automation_account::RequestBuilder {
list_by_automation_account::RequestBuilder {
client: self.0.clone(),
resource_group_name: resource_group_name.into(),
automation_account_name: automation_account_name.into(),
subscription_id: subscription_id.into(),
filter: None,
}
}
}
pub mod generate_uri {
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)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core :: Url :: parse (& format ! ("{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks/generateUri" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . automation_account_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Post);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
let req_body = azure_core::EMPTY_BODY;
req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<String>> {
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::Webhook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Webhook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) webhook_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.webhook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Webhook>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Webhook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Webhook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) webhook_name: String,
pub(crate) parameters: models::WebhookCreateOrUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.webhook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Put);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Webhook>> {
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::Webhook> {
let bytes = self.0.into_body().collect().await?;
let body: models::Webhook = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) webhook_name: String,
pub(crate) parameters: models::WebhookUpdateParameters,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.webhook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Webhook>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) webhook_name: String,
pub(crate) subscription_id: String,
}
impl RequestBuilder {
#[doc = "Send the request and returns the response."]
pub fn send(self) -> futures::future::BoxFuture<'static, azure_core::Result<Response>> {
Box::pin({
let this = self.clone();
async move {
let url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name,
&this.webhook_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_by_automation_account {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::WebhookListResult> {
let bytes = self.0.into_body().collect().await?;
let body: models::WebhookListResult = serde_json::from_slice(&bytes)?;
Ok(body)
}
pub fn into_raw_response(self) -> azure_core::Response {
self.0
}
pub fn as_raw_response(&self) -> &azure_core::Response {
&self.0
}
}
impl From<Response> for azure_core::Response {
fn from(rsp: Response) -> Self {
rsp.into_raw_response()
}
}
impl AsRef<azure_core::Response> for Response {
fn as_ref(&self) -> &azure_core::Response {
self.as_raw_response()
}
}
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) resource_group_name: String,
pub(crate) automation_account_name: String,
pub(crate) subscription_id: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "The filter to apply on the operation."]
pub fn filter(mut self, filter: impl Into<String>) -> Self {
self.filter = Some(filter.into());
self
}
pub fn into_stream(self) -> azure_core::Pageable<models::WebhookListResult, azure_core::error::Error> {
let make_request = move |continuation: Option<String>| {
let this = self.clone();
async move {
let mut url = azure_core::Url::parse(&format!(
"{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.Automation/automationAccounts/{}/webhooks",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.automation_account_name
))?;
let rsp = match continuation {
Some(value) => {
url.set_path("");
url = url.join(&value)?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
let has_api_version_already =
req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
if !has_api_version_already {
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
None => {
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2015-10-31");
if let Some(filter) = &this.filter {
req.url_mut().query_pairs_mut().append_pair("$filter", filter);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
this.client.send(&mut req).await?
}
};
let rsp = match rsp.status() {
azure_core::StatusCode::Ok => Ok(Response(rsp)),
status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
status: status_code,
error_code: None,
})),
};
rsp?.into_body().await
}
};
azure_core::Pageable::new(make_request)
}
}
}
}