Skip to content

Commit

Permalink
rename operation configuration to OperationConfig (#55)
Browse files Browse the repository at this point in the history
* rename operation configuration to OperationConfig

* remove use crate::*; from models.rs
  • Loading branch information
ctaggart authored Oct 21, 2020
1 parent 97800d6 commit 590213c
Show file tree
Hide file tree
Showing 1,035 changed files with 148,043 additions and 70,732 deletions.
6 changes: 3 additions & 3 deletions services/mgmt/addons/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ pub use package_2018_03::{models, operations, API_VERSION};
mod package_2017_05;
#[cfg(feature = "package-2017-05")]
pub use package_2017_05::{models, operations, API_VERSION};
pub struct Configuration {
pub struct OperationConfig {
pub api_version: String,
pub client: reqwest::Client,
pub base_path: String,
pub bearer_access_token: Option<String>,
}
impl Configuration {
impl OperationConfig {
pub fn new(bearer_access_token: &str) -> Self {
Self {
bearer_access_token: Some(bearer_access_token.to_owned()),
..Default::default()
}
}
}
impl Default for Configuration {
impl Default for OperationConfig {
fn default() -> Self {
Self {
api_version: API_VERSION.to_owned(),
Expand Down
1 change: 0 additions & 1 deletion services/mgmt/addons/src/package_2017_05/models.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![doc = "generated by AutoRust 0.1.0"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use crate::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CanonicalSupportPlanProperties {
Expand Down
50 changes: 25 additions & 25 deletions services/mgmt/addons/src/package_2017_05/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ pub mod operations {
use crate::models::*;
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async fn list(configuration: &crate::Configuration) -> std::result::Result<OperationList, list::Error> {
let client = &configuration.client;
let uri_str = &format!("{}/providers/Microsoft.Addons/operations", &configuration.base_path,);
pub async fn list(operation_config: &crate::OperationConfig) -> std::result::Result<OperationList, list::Error> {
let client = &operation_config.client;
let uri_str = &format!("{}/providers/Microsoft.Addons/operations", &operation_config.base_path,);
let mut req_builder = client.get(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(list::BuildRequestError)?;
let rsp = client.execute(req).await.context(list::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -68,21 +68,21 @@ pub mod support_plan_types {
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async fn get(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<CanonicalSupportPlanResponseEnvelope, get::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.get(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(get::BuildRequestError)?;
let rsp = client.execute(req).await.context(get::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -132,21 +132,21 @@ pub mod support_plan_types {
}
}
pub async fn create_or_update(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<create_or_update::Response, create_or_update::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.put(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(create_or_update::BuildRequestError)?;
let rsp = client.execute(req).await.context(create_or_update::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -207,21 +207,21 @@ pub mod support_plan_types {
}
}
pub async fn delete(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<delete::Response, delete::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.delete(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(delete::BuildRequestError)?;
let rsp = client.execute(req).await.context(delete::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -280,20 +280,20 @@ pub mod canonical_support_plan_types {
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async fn get(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
) -> std::result::Result<CanonicalSupportPlanStatus, get::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes",
&configuration.base_path, subscription_id, provider_name
&operation_config.base_path, subscription_id, provider_name
);
let mut req_builder = client.get(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(get::BuildRequestError)?;
let rsp = client.execute(req).await.context(get::ExecuteRequestError)?;
match rsp.status() {
Expand Down
1 change: 0 additions & 1 deletion services/mgmt/addons/src/package_2018_03/models.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![doc = "generated by AutoRust 0.1.0"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use crate::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CanonicalSupportPlanProperties {
Expand Down
50 changes: 25 additions & 25 deletions services/mgmt/addons/src/package_2018_03/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ pub mod operations {
use crate::models::*;
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async fn list(configuration: &crate::Configuration) -> std::result::Result<OperationList, list::Error> {
let client = &configuration.client;
let uri_str = &format!("{}/providers/Microsoft.Addons/operations", &configuration.base_path,);
pub async fn list(operation_config: &crate::OperationConfig) -> std::result::Result<OperationList, list::Error> {
let client = &operation_config.client;
let uri_str = &format!("{}/providers/Microsoft.Addons/operations", &operation_config.base_path,);
let mut req_builder = client.get(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(list::BuildRequestError)?;
let rsp = client.execute(req).await.context(list::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -68,21 +68,21 @@ pub mod support_plan_types {
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async fn get(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<CanonicalSupportPlanResponseEnvelope, get::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.get(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(get::BuildRequestError)?;
let rsp = client.execute(req).await.context(get::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -132,21 +132,21 @@ pub mod support_plan_types {
}
}
pub async fn create_or_update(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<create_or_update::Response, create_or_update::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.put(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(create_or_update::BuildRequestError)?;
let rsp = client.execute(req).await.context(create_or_update::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -207,21 +207,21 @@ pub mod support_plan_types {
}
}
pub async fn delete(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
provider_name: &str,
plan_type_name: &str,
) -> std::result::Result<delete::Response, delete::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/{}/supportPlanTypes/{}",
&configuration.base_path, subscription_id, provider_name, plan_type_name
&operation_config.base_path, subscription_id, provider_name, plan_type_name
);
let mut req_builder = client.delete(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(delete::BuildRequestError)?;
let rsp = client.execute(req).await.context(delete::ExecuteRequestError)?;
match rsp.status() {
Expand Down Expand Up @@ -275,19 +275,19 @@ pub mod support_plan_types {
}
}
pub async fn list_info(
configuration: &crate::Configuration,
operation_config: &crate::OperationConfig,
subscription_id: &str,
) -> std::result::Result<CanonicalSupportPlanInfo, list_info::Error> {
let client = &configuration.client;
let client = &operation_config.client;
let uri_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Addons/supportProviders/canonical/listSupportPlanInfo",
&configuration.base_path, subscription_id
&operation_config.base_path, subscription_id
);
let mut req_builder = client.post(uri_str);
if let Some(token) = &configuration.bearer_access_token {
if let Some(token) = &operation_config.bearer_access_token {
req_builder = req_builder.bearer_auth(token);
}
req_builder = req_builder.query(&[("api-version", &configuration.api_version)]);
req_builder = req_builder.query(&[("api-version", &operation_config.api_version)]);
let req = req_builder.build().context(list_info::BuildRequestError)?;
let rsp = client.execute(req).await.context(list_info::ExecuteRequestError)?;
match rsp.status() {
Expand Down
6 changes: 3 additions & 3 deletions services/mgmt/adp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
mod package_2020_07_01_preview;
#[cfg(feature = "package-2020-07-01-preview")]
pub use package_2020_07_01_preview::{models, operations, API_VERSION};
pub struct Configuration {
pub struct OperationConfig {
pub api_version: String,
pub client: reqwest::Client,
pub base_path: String,
pub bearer_access_token: Option<String>,
}
impl Configuration {
impl OperationConfig {
pub fn new(bearer_access_token: &str) -> Self {
Self {
bearer_access_token: Some(bearer_access_token.to_owned()),
..Default::default()
}
}
}
impl Default for Configuration {
impl Default for OperationConfig {
fn default() -> Self {
Self {
api_version: API_VERSION.to_owned(),
Expand Down
1 change: 0 additions & 1 deletion services/mgmt/adp/src/package_2020_07_01_preview/models.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![doc = "generated by AutoRust 0.1.0"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use crate::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Tags {
Expand Down
Loading

0 comments on commit 590213c

Please sign in to comment.