diff --git a/services/autorust/codegen/examples/gen_svc.rs b/services/autorust/codegen/examples/gen_svc.rs index ae459a955d..c7d53c4884 100644 --- a/services/autorust/codegen/examples/gen_svc.rs +++ b/services/autorust/codegen/examples/gen_svc.rs @@ -10,7 +10,7 @@ use std::{collections::HashSet, fs, path::PathBuf}; const OUTPUT_FOLDER: &str = "../svc"; -const ONLY_SERVICES: &[&str] = &["batch"]; +const ONLY_SERVICES: &[&str] = &[]; const SKIP_SERVICES: &[&str] = &[ "deviceupdate", // missing field `authorizationUrl` diff --git a/services/svc/appconfiguration/Cargo.toml b/services/svc/appconfiguration/Cargo.toml new file mode 100644 index 0000000000..6772bc693f --- /dev/null +++ b/services/svc/appconfiguration/Cargo.toml @@ -0,0 +1,23 @@ +# generated by AutoRust 0.1.0 +[package] +name = "azure_svc_appconfiguration" +version = "0.1.0" +edition = "2018" + +[dependencies] +azure_core = { path = "../../../sdk/core", version = "0.1.0" } +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +reqwest = { version = "0.11", features = ["json"] } +bytes = "1.0" +thiserror = "1.0" +http = "0.2" +url = "2.2" + +[dev-dependencies] +azure_identity = { path = "../../../sdk/identity", version = "0.1.0" } +tokio = { version = "1.0", features = ["macros"] } + +[features] +default = ["package-2019-07"] +"package-2019-07" = [] diff --git a/services/svc/appconfiguration/src/lib.rs b/services/svc/appconfiguration/src/lib.rs new file mode 100644 index 0000000000..6d548335c8 --- /dev/null +++ b/services/svc/appconfiguration/src/lib.rs @@ -0,0 +1,61 @@ +#![doc = "generated by AutoRust 0.1.0"] +#[cfg(feature = "package-2019-07")] +mod package_2019_07; +use azure_core::setters; +#[cfg(feature = "package-2019-07")] +pub use package_2019_07::{models, operations, API_VERSION}; +pub fn config( + http_client: std::sync::Arc, + token_credential: Box, +) -> OperationConfigBuilder { + OperationConfigBuilder { + api_version: None, + http_client, + base_path: None, + token_credential, + token_credential_resource: None, + } +} +pub struct OperationConfigBuilder { + api_version: Option, + http_client: std::sync::Arc, + base_path: Option, + token_credential: Box, + token_credential_resource: Option, +} +impl OperationConfigBuilder { + setters! { api_version : String => Some (api_version) , base_path : String => Some (base_path) , token_credential_resource : String => Some (token_credential_resource) , } + pub fn build(self) -> OperationConfig { + OperationConfig { + api_version: self.api_version.unwrap_or(API_VERSION.to_owned()), + http_client: self.http_client, + base_path: self.base_path.unwrap_or("https://management.azure.com".to_owned()), + token_credential: Some(self.token_credential), + token_credential_resource: self.token_credential_resource.unwrap_or("https://management.azure.com/".to_owned()), + } + } +} +pub struct OperationConfig { + api_version: String, + http_client: std::sync::Arc, + base_path: String, + token_credential: Option>, + token_credential_resource: String, +} +impl OperationConfig { + pub fn api_version(&self) -> &str { + self.api_version.as_str() + } + pub fn http_client(&self) -> &dyn azure_core::HttpClient { + self.http_client.as_ref() + } + pub fn base_path(&self) -> &str { + self.base_path.as_str() + } + pub fn token_credential(&self) -> Option<&dyn azure_core::TokenCredential> { + self.token_credential.as_deref() + } + pub fn token_credential_resource(&self) -> &str { + self.token_credential_resource.as_str() + } +} diff --git a/services/svc/appconfiguration/src/package_2019_07/mod.rs b/services/svc/appconfiguration/src/package_2019_07/mod.rs new file mode 100644 index 0000000000..cadfdca78f --- /dev/null +++ b/services/svc/appconfiguration/src/package_2019_07/mod.rs @@ -0,0 +1,3 @@ +pub mod models; +pub mod operations; +pub const API_VERSION: &str = "1.0"; diff --git a/services/svc/appconfiguration/src/package_2019_07/models.rs b/services/svc/appconfiguration/src/package_2019_07/models.rs new file mode 100644 index 0000000000..2b46aa2825 --- /dev/null +++ b/services/svc/appconfiguration/src/package_2019_07/models.rs @@ -0,0 +1,67 @@ +#![doc = "generated by AutoRust 0.1.0"] +#![allow(non_camel_case_types)] +#![allow(unused_imports)] +use serde::{Deserialize, Serialize}; +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Key { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KeyValue { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub key: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub content_type: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub value: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub last_modified: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub tags: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub locked: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub etag: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Label { + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Error { + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub type_: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub detail: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub status: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KeyListResult { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + #[serde(rename = "@nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct KeyValueListResult { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec, + #[serde(rename = "@nextLink", default, skip_serializing_if = "Option::is_none")] + pub next_link: Option, +} +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct LabelListResult { + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub items: Vec