#![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 access_control_records_client(&self) -> access_control_records::Client {
access_control_records::Client(self.clone())
}
pub fn alerts_client(&self) -> alerts::Client {
alerts::Client(self.clone())
}
pub fn backup_policies_client(&self) -> backup_policies::Client {
backup_policies::Client(self.clone())
}
pub fn backup_schedules_client(&self) -> backup_schedules::Client {
backup_schedules::Client(self.clone())
}
pub fn backups_client(&self) -> backups::Client {
backups::Client(self.clone())
}
pub fn bandwidth_settings_client(&self) -> bandwidth_settings::Client {
bandwidth_settings::Client(self.clone())
}
pub fn cloud_appliances_client(&self) -> cloud_appliances::Client {
cloud_appliances::Client(self.clone())
}
pub fn device_settings_client(&self) -> device_settings::Client {
device_settings::Client(self.clone())
}
pub fn devices_client(&self) -> devices::Client {
devices::Client(self.clone())
}
pub fn hardware_component_groups_client(&self) -> hardware_component_groups::Client {
hardware_component_groups::Client(self.clone())
}
pub fn jobs_client(&self) -> jobs::Client {
jobs::Client(self.clone())
}
pub fn managers_client(&self) -> managers::Client {
managers::Client(self.clone())
}
pub fn operations_client(&self) -> operations::Client {
operations::Client(self.clone())
}
pub fn storage_account_credentials_client(&self) -> storage_account_credentials::Client {
storage_account_credentials::Client(self.clone())
}
pub fn volume_containers_client(&self) -> volume_containers::Client {
volume_containers::Client(self.clone())
}
pub fn volumes_client(&self) -> volumes::Client {
volumes::Client(self.clone())
}
}
pub mod operations {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists all of the available REST API operations of the Microsoft.StorSimple provider"]
pub fn list(&self) -> list::RequestBuilder {
list::RequestBuilder { client: self.0.clone() }
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AvailableProviderOperationList> {
let bytes = self.0.into_body().collect().await?;
let body: models::AvailableProviderOperationList = 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 {
pub fn into_stream(self) -> azure_core::Pageable<models::AvailableProviderOperationList, 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!("{}/providers/Microsoft.StorSimple/operations", this.client.endpoint(),))?;
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, "2017-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, "2017-06-01");
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 managers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the managers in a subscription."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
pub fn list(&self, subscription_id: impl Into<String>) -> list::RequestBuilder {
list::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
}
}
#[doc = "Retrieves all the managers in a resource group."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
pub fn list_by_resource_group(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
) -> list_by_resource_group::RequestBuilder {
list_by_resource_group::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
}
}
#[doc = "Returns the properties of the specified manager name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The manager."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
parameters: impl Into<models::Manager>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Updates the StorSimple Manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The manager update parameters."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn update(
&self,
parameters: impl Into<models::ManagerPatch>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the public encryption key of the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_device_public_encryption_key(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_device_public_encryption_key::RequestBuilder {
get_device_public_encryption_key::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the encryption settings of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_encryption_settings(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_encryption_settings::RequestBuilder {
get_encryption_settings::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the extended information of the specified manager name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_extended_info(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_extended_info::RequestBuilder {
get_extended_info::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates the extended info of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The manager extended information."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_extended_info(
&self,
parameters: impl Into<models::ManagerExtendedInfo>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_extended_info::RequestBuilder {
create_extended_info::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Updates the extended info of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The manager extended information."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
#[doc = "* `if_match`: Pass the ETag of ExtendedInfo fetched from GET call"]
pub fn update_extended_info(
&self,
parameters: impl Into<models::ManagerExtendedInfo>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
if_match: impl Into<String>,
) -> update_extended_info::RequestBuilder {
update_extended_info::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
if_match: if_match.into(),
}
}
#[doc = "Deletes the extended info of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete_extended_info(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete_extended_info::RequestBuilder {
delete_extended_info::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Lists the features and their support status"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_feature_support_status(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_feature_support_status::RequestBuilder {
list_feature_support_status::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: None,
}
}
#[doc = "Returns the activation key of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_activation_key(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_activation_key::RequestBuilder {
get_activation_key::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the symmetric encrypted public encryption key of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_public_encryption_key(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_public_encryption_key::RequestBuilder {
get_public_encryption_key::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the metrics for the specified manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
#[doc = "* `filter`: OData Filter options"]
pub fn list_metrics(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
filter: impl Into<String>,
) -> list_metrics::RequestBuilder {
list_metrics::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: filter.into(),
}
}
#[doc = "Gets the metric definitions for the specified manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_metric_definition(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_metric_definition::RequestBuilder {
list_metric_definition::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Re-generates and returns the activation key of the manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn regenerate_activation_key(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> regenerate_activation_key::RequestBuilder {
regenerate_activation_key::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManagerList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManagerList = 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 {
#[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/{}/providers/Microsoft.StorSimple/managers",
this.client.endpoint(),
&this.subscription_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, "2017-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::ManagerList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_resource_group {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManagerList> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManagerList = 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,
}
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.StorSimple/managers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name
))?;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2017-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::ManagerList>> {
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::Manager> {
let bytes = self.0.into_body().collect().await?;
let body: models::Manager = 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) manager_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.StorSimple/managers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::Manager>> {
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::Manager> {
let bytes = self.0.into_body().collect().await?;
let body: models::Manager = 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) parameters: models::Manager,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::Manager>> {
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::Manager> {
let bytes = self.0.into_body().collect().await?;
let body: models::Manager = 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) parameters: models::ManagerPatch,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::Manager>> {
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) manager_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.StorSimple/managers/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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_device_public_encryption_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::PublicKey> {
let bytes = self.0.into_body().collect().await?;
let body: models::PublicKey = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/publicEncryptionKey" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-06-01");
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::PublicKey>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_encryption_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::EncryptionSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::EncryptionSettings = 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) manager_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.StorSimple/managers/{}/encryptionSettings/default",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::EncryptionSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_extended_info {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManagerExtendedInfo> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManagerExtendedInfo = 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) manager_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.StorSimple/managers/{}/extendedInformation/vaultExtendedInfo" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_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, "2017-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::ManagerExtendedInfo>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_extended_info {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManagerExtendedInfo> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManagerExtendedInfo = 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) parameters: models::ManagerExtendedInfo,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/extendedInformation/vaultExtendedInfo" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_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, "2017-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::ManagerExtendedInfo>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_extended_info {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::ManagerExtendedInfo> {
let bytes = self.0.into_body().collect().await?;
let body: models::ManagerExtendedInfo = 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) parameters: models::ManagerExtendedInfo,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) if_match: 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.StorSimple/managers/{}/extendedInformation/vaultExtendedInfo" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_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, "2017-06-01");
req.insert_header("content-type", "application/json");
let req_body = azure_core::to_json(&this.parameters)?;
req.insert_header("if-match", &this.if_match);
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::ManagerExtendedInfo>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod delete_extended_info {
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) manager_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.StorSimple/managers/{}/extendedInformation/vaultExtendedInfo" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_feature_support_status {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FeatureList> {
let bytes = self.0.into_body().collect().await?;
let body: models::FeatureList = 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) manager_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "OData Filter options"]
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.StorSimple/managers/{}/features",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
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::FeatureList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_activation_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Key> {
let bytes = self.0.into_body().collect().await?;
let body: models::Key = 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) manager_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.StorSimple/managers/{}/listActivationKey",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
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::Key>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_public_encryption_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SymmetricEncryptedSecret> {
let bytes = self.0.into_body().collect().await?;
let body: models::SymmetricEncryptedSecret = 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) manager_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.StorSimple/managers/{}/listPublicEncryptionKey",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
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::SymmetricEncryptedSecret>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metrics {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricList = 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) manager_name: String,
pub(crate) filter: 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.StorSimple/managers/{}/metrics",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
let 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::MetricList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metric_definition {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricDefinitionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricDefinitionList = 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) manager_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.StorSimple/managers/{}/metricsDefinitions",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::MetricDefinitionList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod regenerate_activation_key {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Key> {
let bytes = self.0.into_body().collect().await?;
let body: models::Key = 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) manager_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.StorSimple/managers/{}/regenerateActivationKey",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
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::Key>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod access_control_records {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the access control records in a manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the properties of the specified access control record name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `access_control_record_name`: Name of access control record to be fetched."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
access_control_record_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
access_control_record_name: access_control_record_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or Updates an access control record."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `access_control_record_name`: The name of the access control record."]
#[doc = "* `parameters`: The access control record to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
access_control_record_name: impl Into<String>,
parameters: impl Into<models::AccessControlRecord>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
access_control_record_name: access_control_record_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the access control record."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `access_control_record_name`: The name of the access control record to delete."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
access_control_record_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
access_control_record_name: access_control_record_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AccessControlRecordList> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccessControlRecordList = 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) manager_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.StorSimple/managers/{}/accessControlRecords",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::AccessControlRecordList>> {
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::AccessControlRecord> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccessControlRecord = 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) access_control_record_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/accessControlRecords/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.access_control_record_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, "2017-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::AccessControlRecord>> {
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::AccessControlRecord> {
let bytes = self.0.into_body().collect().await?;
let body: models::AccessControlRecord = 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) access_control_record_name: String,
pub(crate) parameters: models::AccessControlRecord,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/accessControlRecords/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.access_control_record_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, "2017-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::AccessControlRecord>> {
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) access_control_record_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/accessControlRecords/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.access_control_record_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod alerts {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the alerts in a manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: None,
}
}
#[doc = "Clear the alerts."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The clear alert request."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn clear(
&self,
parameters: impl Into<models::ClearAlertRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> clear::RequestBuilder {
clear::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Sends a test alert email."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: The send test alert email request."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn send_test_email(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::SendTestAlertEmailRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> send_test_email::RequestBuilder {
send_test_email::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AlertList> {
let bytes = self.0.into_body().collect().await?;
let body: models::AlertList = 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) manager_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "OData Filter options"]
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::AlertList, 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.StorSimple/managers/{}/alerts",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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, "2017-06-01");
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 clear {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::ClearAlertRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/clearAlerts",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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?))
}
})
}
}
}
pub mod send_test_email {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) parameters: models::SendTestAlertEmailRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/sendTestAlertEmail" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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?))
}
})
}
}
}
}
pub mod bandwidth_settings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the bandwidth setting in a manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the properties of the specified bandwidth setting name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `bandwidth_setting_name`: The name of bandwidth setting to be fetched."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
bandwidth_setting_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
bandwidth_setting_name: bandwidth_setting_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the bandwidth setting"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `bandwidth_setting_name`: The bandwidth setting name."]
#[doc = "* `parameters`: The bandwidth setting to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
bandwidth_setting_name: impl Into<String>,
parameters: impl Into<models::BandwidthSetting>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
bandwidth_setting_name: bandwidth_setting_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the bandwidth setting"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `bandwidth_setting_name`: The name of the bandwidth setting."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
bandwidth_setting_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
bandwidth_setting_name: bandwidth_setting_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BandwidthSettingList> {
let bytes = self.0.into_body().collect().await?;
let body: models::BandwidthSettingList = 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) manager_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.StorSimple/managers/{}/bandwidthSettings",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::BandwidthSettingList>> {
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::BandwidthSetting> {
let bytes = self.0.into_body().collect().await?;
let body: models::BandwidthSetting = 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) bandwidth_setting_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/bandwidthSettings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.bandwidth_setting_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, "2017-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::BandwidthSetting>> {
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::BandwidthSetting> {
let bytes = self.0.into_body().collect().await?;
let body: models::BandwidthSetting = 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) bandwidth_setting_name: String,
pub(crate) parameters: models::BandwidthSetting,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/bandwidthSettings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.bandwidth_setting_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, "2017-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::BandwidthSetting>> {
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) bandwidth_setting_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/bandwidthSettings/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.bandwidth_setting_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod cloud_appliances {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists supported cloud appliance models and supported configurations."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_supported_configurations(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_supported_configurations::RequestBuilder {
list_supported_configurations::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Provisions cloud appliance."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The cloud appliance"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn provision(
&self,
parameters: impl Into<models::CloudAppliance>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> provision::RequestBuilder {
provision::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_supported_configurations {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::CloudApplianceConfigurationList> {
let bytes = self.0.into_body().collect().await?;
let body: models::CloudApplianceConfigurationList = 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) manager_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.StorSimple/managers/{}/cloudApplianceConfigurations",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::CloudApplianceConfigurationList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod provision {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::CloudAppliance,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/provisionCloudAppliance",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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?))
}
})
}
}
}
}
pub mod devices {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Complete minimal setup before using the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `parameters`: The minimal properties to configure a device."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn configure(
&self,
parameters: impl Into<models::ConfigureDeviceRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> configure::RequestBuilder {
configure::RequestBuilder {
client: self.0.clone(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the list of devices for the specified manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
expand: None,
}
}
#[doc = "Returns the properties of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
expand: None,
}
}
#[doc = "Patches the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: Patch representation of the device."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn update(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::DevicePatch>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> update::RequestBuilder {
update::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Authorizes the specified device for service data encryption key rollover."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn authorize_for_service_encryption_key_rollover(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> authorize_for_service_encryption_key_rollover::RequestBuilder {
authorize_for_service_encryption_key_rollover::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deactivates the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn deactivate(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> deactivate::RequestBuilder {
deactivate::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Downloads and installs the updates on the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn install_updates(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> install_updates::RequestBuilder {
install_updates::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_failover_sets(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_failover_sets::RequestBuilder {
list_failover_sets::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the metrics for the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
#[doc = "* `filter`: OData Filter options"]
pub fn list_metrics(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
filter: impl Into<String>,
) -> list_metrics::RequestBuilder {
list_metrics::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: filter.into(),
}
}
#[doc = "Gets the metric definitions for the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_metric_definition(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_metric_definition::RequestBuilder {
list_metric_definition::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Scans for updates on the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn scan_for_updates(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> scan_for_updates::RequestBuilder {
scan_for_updates::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the update summary of the specified device name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_update_summary(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_update_summary::RequestBuilder {
get_update_summary::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Failovers a set of volume containers from a specified source device to a target device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `source_device_name`: The source device name on which failover is performed."]
#[doc = "* `parameters`: FailoverRequest containing the source device and the list of volume containers to be failed over."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn failover(
&self,
source_device_name: impl Into<String>,
parameters: impl Into<models::FailoverRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> failover::RequestBuilder {
failover::RequestBuilder {
client: self.0.clone(),
source_device_name: source_device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Given a list of volume containers to be failed over from a source device, this method returns the eligibility result, as a failover target, for all devices under that resource."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `source_device_name`: The source device name on which failover is performed."]
#[doc = "* `parameters`: ListFailoverTargetsRequest containing the list of volume containers to be failed over."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_failover_targets(
&self,
source_device_name: impl Into<String>,
parameters: impl Into<models::ListFailoverTargetsRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_failover_targets::RequestBuilder {
list_failover_targets::RequestBuilder {
client: self.0.clone(),
source_device_name: source_device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod configure {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) parameters: models::ConfigureDeviceRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/configureDevice",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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?))
}
})
}
}
}
pub mod list_by_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::DeviceList> {
let bytes = self.0.into_body().collect().await?;
let body: models::DeviceList = 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) manager_name: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Specify $expand=details to populate additional fields related to the device or $expand=rolloverdetails to populate additional fields related to the service data encryption key rollover on device"]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.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.StorSimple/managers/{}/devices",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-06-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::DeviceList>> {
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::Device> {
let bytes = self.0.into_body().collect().await?;
let body: models::Device = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) expand: Option<String>,
}
impl RequestBuilder {
#[doc = "Specify $expand=details to populate additional fields related to the device or $expand=rolloverdetails to populate additional fields related to the service data encryption key rollover on device"]
pub fn expand(mut self, expand: impl Into<String>) -> Self {
self.expand = Some(expand.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.StorSimple/managers/{}/devices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
if let Some(expand) = &this.expand {
req.url_mut().query_pairs_mut().append_pair("$expand", expand);
}
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
#[doc = "Send the request and return the response body."]
pub fn into_future(self) -> futures::future::BoxFuture<'static, azure_core::Result<models::Device>> {
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::Device> {
let bytes = self.0.into_body().collect().await?;
let body: models::Device = 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) device_name: String,
pub(crate) parameters: models::DevicePatch,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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::Device>> {
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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod authorize_for_service_encryption_key_rollover {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/authorizeForServiceEncryptionKeyRollover" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-06-01");
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 deactivate {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/deactivate",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
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 install_updates {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/installUpdates",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
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_failover_sets {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FailoverSetsList> {
let bytes = self.0.into_body().collect().await?;
let body: models::FailoverSetsList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/listFailoverSets",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
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::FailoverSetsList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metrics {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) filter: 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.StorSimple/managers/{}/devices/{}/metrics",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
let 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::MetricList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metric_definition {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricDefinitionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricDefinitionList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/metricsDefinitions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::MetricDefinitionList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod scan_for_updates {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/scanForUpdates",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
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_update_summary {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::Updates> {
let bytes = self.0.into_body().collect().await?;
let body: models::Updates = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/updateSummary/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::Updates>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod failover {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) source_device_name: String,
pub(crate) parameters: models::FailoverRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/failover",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.source_device_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, "2017-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?))
}
})
}
}
}
pub mod list_failover_targets {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::FailoverTargetsList> {
let bytes = self.0.into_body().collect().await?;
let body: models::FailoverTargetsList = 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) source_device_name: String,
pub(crate) parameters: models::ListFailoverTargetsRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/listFailoverTargets" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . source_device_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, "2017-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::FailoverTargetsList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod device_settings {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets the alert settings of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_alert_settings(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_alert_settings::RequestBuilder {
get_alert_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the alert settings of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: The alert settings to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update_alert_settings(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::AlertSettings>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update_alert_settings::RequestBuilder {
create_or_update_alert_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the network settings of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_network_settings(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_network_settings::RequestBuilder {
get_network_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Updates the network settings on the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: The network settings to be updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn update_network_settings(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::NetworkSettingsPatch>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> update_network_settings::RequestBuilder {
update_network_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the Security properties of the specified device name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_security_settings(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_security_settings::RequestBuilder {
get_security_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Patch Security properties of the specified device name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: The security settings properties to be patched."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn update_security_settings(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::SecuritySettingsPatch>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> update_security_settings::RequestBuilder {
update_security_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "sync Remote management Certificate between appliance and Service"]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn sync_remotemanagement_certificate(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> sync_remotemanagement_certificate::RequestBuilder {
sync_remotemanagement_certificate::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the time settings of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get_time_settings(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get_time_settings::RequestBuilder {
get_time_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the time settings of the specified device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `parameters`: The time settings to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update_time_settings(
&self,
device_name: impl Into<String>,
parameters: impl Into<models::TimeSettings>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update_time_settings::RequestBuilder {
create_or_update_time_settings::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod get_alert_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AlertSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::AlertSettings = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/alertSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::AlertSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update_alert_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::AlertSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::AlertSettings = 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) device_name: String,
pub(crate) parameters: models::AlertSettings,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/alertSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::AlertSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_network_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSettings = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/networkSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::NetworkSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_network_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::NetworkSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::NetworkSettings = 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) device_name: String,
pub(crate) parameters: models::NetworkSettingsPatch,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/networkSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::NetworkSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod get_security_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecuritySettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecuritySettings = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/securitySettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::SecuritySettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod update_security_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::SecuritySettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::SecuritySettings = 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) device_name: String,
pub(crate) parameters: models::SecuritySettingsPatch,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/securitySettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::SecuritySettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod sync_remotemanagement_certificate {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/securitySettings/default/syncRemoteManagementCertificate" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-06-01");
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_time_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TimeSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::TimeSettings = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/timeSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::TimeSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod create_or_update_time_settings {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::TimeSettings> {
let bytes = self.0.into_body().collect().await?;
let body: models::TimeSettings = 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) device_name: String,
pub(crate) parameters: models::TimeSettings,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/timeSettings/default" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::TimeSettings>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod backup_policies {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the backup policies in a device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the properties of the specified backup policy name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The name of backup policy to be fetched."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the backup policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The name of the backup policy to be created/updated."]
#[doc = "* `parameters`: The backup policy."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
parameters: impl Into<models::BackupPolicy>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the backup policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The name of the backup policy."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Backup the backup policy now."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The backup policy name."]
#[doc = "* `backup_type`: The backup Type. This can be cloudSnapshot or localSnapshot."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn backup_now(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
backup_type: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> backup_now::RequestBuilder {
backup_now::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
backup_type: backup_type.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackupPolicyList> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupPolicyList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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::BackupPolicyList>> {
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::BackupPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupPolicy = 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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_name,
&this.backup_policy_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, "2017-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::BackupPolicy>> {
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::BackupPolicy> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupPolicy = 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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) parameters: models::BackupPolicy,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_name,
&this.backup_policy_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, "2017-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::BackupPolicy>> {
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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_name,
&this.backup_policy_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod backup_now {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) backup_type: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}/backup" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_policy_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, "2017-06-01");
let backup_type = &this.backup_type;
req.url_mut().query_pairs_mut().append_pair("backupType", backup_type);
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 backup_schedules {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the backup schedules in a backup policy."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The backup policy name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_backup_policy(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_backup_policy::RequestBuilder {
list_by_backup_policy::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the properties of the specified backup schedule name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The backup policy name."]
#[doc = "* `backup_schedule_name`: The name of the backup schedule to be fetched"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
backup_schedule_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
backup_schedule_name: backup_schedule_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the backup schedule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The backup policy name."]
#[doc = "* `backup_schedule_name`: The backup schedule name."]
#[doc = "* `parameters`: The backup schedule."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
backup_schedule_name: impl Into<String>,
parameters: impl Into<models::BackupSchedule>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
backup_schedule_name: backup_schedule_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the backup schedule."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_policy_name`: The backup policy name."]
#[doc = "* `backup_schedule_name`: The name the backup schedule."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
backup_policy_name: impl Into<String>,
backup_schedule_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_policy_name: backup_policy_name.into(),
backup_schedule_name: backup_schedule_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_backup_policy {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackupScheduleList> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupScheduleList = 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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}/schedules" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_policy_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, "2017-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::BackupScheduleList>> {
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::BackupSchedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupSchedule = 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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) backup_schedule_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}/schedules/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_policy_name , & this . backup_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, "2017-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::BackupSchedule>> {
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::BackupSchedule> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupSchedule = 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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) backup_schedule_name: String,
pub(crate) parameters: models::BackupSchedule,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}/schedules/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_policy_name , & this . backup_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, "2017-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::BackupSchedule>> {
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) device_name: String,
pub(crate) backup_policy_name: String,
pub(crate) backup_schedule_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backupPolicies/{}/schedules/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_policy_name , & this . backup_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}
pub mod backups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the backups in a device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: None,
}
}
#[doc = "Deletes the backup."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_name`: The backup name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
backup_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_name: backup_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Clones the backup element as a new volume."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_name`: The backup name."]
#[doc = "* `backup_element_name`: The backup element name."]
#[doc = "* `parameters`: The clone request object."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn clone(
&self,
device_name: impl Into<String>,
backup_name: impl Into<String>,
backup_element_name: impl Into<String>,
parameters: impl Into<models::CloneRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> clone::RequestBuilder {
clone::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_name: backup_name.into(),
backup_element_name: backup_element_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Restores the backup on the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `backup_name`: The backupSet name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn restore(
&self,
device_name: impl Into<String>,
backup_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> restore::RequestBuilder {
restore::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
backup_name: backup_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::BackupList> {
let bytes = self.0.into_body().collect().await?;
let body: models::BackupList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "OData Filter options"]
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::BackupList, 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.StorSimple/managers/{}/devices/{}/backups",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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, "2017-06-01");
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 delete {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) backup_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backups/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_name,
&this.backup_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod clone {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) backup_name: String,
pub(crate) backup_element_name: String,
pub(crate) parameters: models::CloneRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backups/{}/elements/{}/clone" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_name , & this . backup_element_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, "2017-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?))
}
})
}
}
}
pub mod restore {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) backup_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/backups/{}/restore" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . backup_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, "2017-06-01");
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 hardware_component_groups {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Lists the hardware component groups at device-level."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Changes the power state of the controller."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `hardware_component_group_name`: The hardware component group name."]
#[doc = "* `parameters`: The controller power state change request."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn change_controller_power_state(
&self,
device_name: impl Into<String>,
hardware_component_group_name: impl Into<String>,
parameters: impl Into<models::ControllerPowerStateChangeRequest>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> change_controller_power_state::RequestBuilder {
change_controller_power_state::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
hardware_component_group_name: hardware_component_group_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::HardwareComponentGroupList> {
let bytes = self.0.into_body().collect().await?;
let body: models::HardwareComponentGroupList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/hardwareComponentGroups" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_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, "2017-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::HardwareComponentGroupList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod change_controller_power_state {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) hardware_component_group_name: String,
pub(crate) parameters: models::ControllerPowerStateChangeRequest,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/hardwareComponentGroups/{}/changeControllerPowerState" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . hardware_component_group_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, "2017-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?))
}
})
}
}
}
}
pub mod jobs {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the jobs for specified device. With optional OData query parameters, a filtered set of jobs is returned."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: None,
}
}
#[doc = "Gets the details of the specified job name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `job_name`: The job Name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
job_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
job_name: job_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Cancels a job on the device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `job_name`: The jobName."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn cancel(
&self,
device_name: impl Into<String>,
job_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> cancel::RequestBuilder {
cancel::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
job_name: job_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets all the jobs for the specified manager. With optional OData query parameters, a filtered set of jobs is returned."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: None,
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobList> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "OData Filter options"]
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::JobList, 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.StorSimple/managers/{}/devices/{}/jobs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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, "2017-06-01");
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::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) device_name: String,
pub(crate) job_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/jobs/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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::Job>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod cancel {
use super::models;
pub struct Response(azure_core::Response);
#[derive(Clone)]
pub struct RequestBuilder {
pub(crate) client: super::super::Client,
pub(crate) device_name: String,
pub(crate) job_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/jobs/{}/cancel",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-06-01");
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_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::JobList> {
let bytes = self.0.into_body().collect().await?;
let body: models::JobList = 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) manager_name: String,
pub(crate) filter: Option<String>,
}
impl RequestBuilder {
#[doc = "OData Filter options"]
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::JobList, 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.StorSimple/managers/{}/jobs",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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, "2017-06-01");
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 volume_containers {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the volume containers in a device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the properties of the specified volume container name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The name of the volume container."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the volume container."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The name of the volume container."]
#[doc = "* `parameters`: The volume container to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
parameters: impl Into<models::VolumeContainer>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the volume container."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The name of the volume container."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the metrics for the specified volume container."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
#[doc = "* `filter`: OData Filter options"]
pub fn list_metrics(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
filter: impl Into<String>,
) -> list_metrics::RequestBuilder {
list_metrics::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: filter.into(),
}
}
#[doc = "Gets the metric definitions for the specified volume container."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_metric_definition(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_metric_definition::RequestBuilder {
list_metric_definition::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VolumeContainerList> {
let bytes = self.0.into_body().collect().await?;
let body: models::VolumeContainerList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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::VolumeContainerList>> {
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::VolumeContainer> {
let bytes = self.0.into_body().collect().await?;
let body: models::VolumeContainer = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2017-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::VolumeContainer>> {
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::VolumeContainer> {
let bytes = self.0.into_body().collect().await?;
let body: models::VolumeContainer = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) parameters: models::VolumeContainer,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_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, "2017-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::VolumeContainer>> {
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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_metrics {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricList = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) filter: 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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/metrics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2017-06-01");
let 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::MetricList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metric_definition {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricDefinitionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricDefinitionList = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/metricsDefinitions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2017-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::MetricDefinitionList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod volumes {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Retrieves all the volumes in a volume container."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_volume_container(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_volume_container::RequestBuilder {
list_by_volume_container::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Returns the properties of the specified volume name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `volume_name`: The volume name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
volume_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
volume_name: volume_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the volume."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `volume_name`: The volume name."]
#[doc = "* `parameters`: Volume to be created or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
volume_name: impl Into<String>,
parameters: impl Into<models::Volume>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
volume_name: volume_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the volume."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `volume_name`: The volume name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
volume_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
volume_name: volume_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the metrics for the specified volume."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `volume_name`: The volume name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
#[doc = "* `filter`: OData Filter options"]
pub fn list_metrics(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
volume_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
filter: impl Into<String>,
) -> list_metrics::RequestBuilder {
list_metrics::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
volume_name: volume_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
filter: filter.into(),
}
}
#[doc = "Gets the metric definitions for the specified volume."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `volume_container_name`: The volume container name."]
#[doc = "* `volume_name`: The volume name."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_metric_definition(
&self,
device_name: impl Into<String>,
volume_container_name: impl Into<String>,
volume_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_metric_definition::RequestBuilder {
list_metric_definition::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
volume_container_name: volume_container_name.into(),
volume_name: volume_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Retrieves all the volumes in a device."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `device_name`: The device name"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_device(
&self,
device_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_device::RequestBuilder {
list_by_device::RequestBuilder {
client: self.0.clone(),
device_name: device_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_volume_container {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VolumeList> {
let bytes = self.0.into_body().collect().await?;
let body: models::VolumeList = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name)) ? ;
let mut req = azure_core::Request::new(url, azure_core::Method::Get);
let credential = this.client.token_credential();
let token_response = credential.get_token(&this.client.scopes().join(" ")).await?;
req.insert_header(
azure_core::headers::AUTHORIZATION,
format!("Bearer {}", token_response.token.secret()),
);
req.url_mut()
.query_pairs_mut()
.append_pair(azure_core::query_param::API_VERSION, "2017-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::VolumeList>> {
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::Volume> {
let bytes = self.0.into_body().collect().await?;
let body: models::Volume = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) volume_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name , & this . volume_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, "2017-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::Volume>> {
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::Volume> {
let bytes = self.0.into_body().collect().await?;
let body: models::Volume = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) volume_name: String,
pub(crate) parameters: models::Volume,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name , & this . volume_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, "2017-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::Volume>> {
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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) volume_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes/{}" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name , & this . volume_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
pub mod list_metrics {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricList = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) volume_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_name: String,
pub(crate) filter: 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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes/{}/metrics" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name , & this . volume_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, "2017-06-01");
let 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::MetricList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_metric_definition {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::MetricDefinitionList> {
let bytes = self.0.into_body().collect().await?;
let body: models::MetricDefinitionList = 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) device_name: String,
pub(crate) volume_container_name: String,
pub(crate) volume_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumeContainers/{}/volumes/{}/metricsDefinitions" , this . client . endpoint () , & this . subscription_id , & this . resource_group_name , & this . manager_name , & this . device_name , & this . volume_container_name , & this . volume_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, "2017-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::MetricDefinitionList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
pub mod list_by_device {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::VolumeList> {
let bytes = self.0.into_body().collect().await?;
let body: models::VolumeList = 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) device_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/devices/{}/volumes",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.device_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, "2017-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::VolumeList>> {
Box::pin(async move { self.send().await?.into_body().await })
}
}
}
}
pub mod storage_account_credentials {
use super::models;
pub struct Client(pub(crate) super::Client);
impl Client {
#[doc = "Gets all the storage account credentials in a manager."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn list_by_manager(
&self,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> list_by_manager::RequestBuilder {
list_by_manager::RequestBuilder {
client: self.0.clone(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Gets the properties of the specified storage account credential name."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `storage_account_credential_name`: The name of storage account credential to be fetched."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn get(
&self,
storage_account_credential_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> get::RequestBuilder {
get::RequestBuilder {
client: self.0.clone(),
storage_account_credential_name: storage_account_credential_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Creates or updates the storage account credential."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `storage_account_credential_name`: The storage account credential name."]
#[doc = "* `parameters`: The storage account credential to be added or updated."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn create_or_update(
&self,
storage_account_credential_name: impl Into<String>,
parameters: impl Into<models::StorageAccountCredential>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> create_or_update::RequestBuilder {
create_or_update::RequestBuilder {
client: self.0.clone(),
storage_account_credential_name: storage_account_credential_name.into(),
parameters: parameters.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
#[doc = "Deletes the storage account credential."]
#[doc = ""]
#[doc = "Arguments:"]
#[doc = "* `storage_account_credential_name`: The name of the storage account credential."]
#[doc = "* `subscription_id`: The subscription id"]
#[doc = "* `resource_group_name`: The resource group name"]
#[doc = "* `manager_name`: The manager name"]
pub fn delete(
&self,
storage_account_credential_name: impl Into<String>,
subscription_id: impl Into<String>,
resource_group_name: impl Into<String>,
manager_name: impl Into<String>,
) -> delete::RequestBuilder {
delete::RequestBuilder {
client: self.0.clone(),
storage_account_credential_name: storage_account_credential_name.into(),
subscription_id: subscription_id.into(),
resource_group_name: resource_group_name.into(),
manager_name: manager_name.into(),
}
}
}
pub mod list_by_manager {
use super::models;
pub struct Response(azure_core::Response);
impl Response {
pub async fn into_body(self) -> azure_core::Result<models::StorageAccountCredentialList> {
let bytes = self.0.into_body().collect().await?;
let body: models::StorageAccountCredentialList = 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) manager_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.StorSimple/managers/{}/storageAccountCredentials",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_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, "2017-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::StorageAccountCredentialList>> {
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::StorageAccountCredential> {
let bytes = self.0.into_body().collect().await?;
let body: models::StorageAccountCredential = 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) storage_account_credential_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/storageAccountCredentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.storage_account_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, "2017-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::StorageAccountCredential>> {
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::StorageAccountCredential> {
let bytes = self.0.into_body().collect().await?;
let body: models::StorageAccountCredential = 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) storage_account_credential_name: String,
pub(crate) parameters: models::StorageAccountCredential,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/storageAccountCredentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.storage_account_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, "2017-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::StorageAccountCredential>> {
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) storage_account_credential_name: String,
pub(crate) subscription_id: String,
pub(crate) resource_group_name: String,
pub(crate) manager_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.StorSimple/managers/{}/storageAccountCredentials/{}",
this.client.endpoint(),
&this.subscription_id,
&this.resource_group_name,
&this.manager_name,
&this.storage_account_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, "2017-06-01");
let req_body = azure_core::EMPTY_BODY;
req.set_body(req_body);
Ok(Response(this.client.send(&mut req).await?))
}
})
}
}
}
}