Skip to content

Commit

Permalink
generate the rest of the data-plane SDK (#390)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Caswell <[email protected]>
  • Loading branch information
bmc-msft and Brian Caswell authored Oct 14, 2021
1 parent b2ffbba commit 8cb361b
Show file tree
Hide file tree
Showing 258 changed files with 135,736 additions and 1 deletion.
2 changes: 1 addition & 1 deletion services/autorust/codegen/examples/gen_svc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
23 changes: 23 additions & 0 deletions services/svc/appconfiguration/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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" = []
61 changes: 61 additions & 0 deletions services/svc/appconfiguration/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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<dyn azure_core::HttpClient>,
token_credential: Box<dyn azure_core::TokenCredential>,
) -> OperationConfigBuilder {
OperationConfigBuilder {
api_version: None,
http_client,
base_path: None,
token_credential,
token_credential_resource: None,
}
}
pub struct OperationConfigBuilder {
api_version: Option<String>,
http_client: std::sync::Arc<dyn azure_core::HttpClient>,
base_path: Option<String>,
token_credential: Box<dyn azure_core::TokenCredential>,
token_credential_resource: Option<String>,
}
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<dyn azure_core::HttpClient>,
base_path: String,
token_credential: Option<Box<dyn azure_core::TokenCredential>>,
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()
}
}
3 changes: 3 additions & 0 deletions services/svc/appconfiguration/src/package_2019_07/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod models;
pub mod operations;
pub const API_VERSION: &str = "1.0";
67 changes: 67 additions & 0 deletions services/svc/appconfiguration/src/package_2019_07/models.rs
Original file line number Diff line number Diff line change
@@ -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<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct KeyValue {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub label: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_modified: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub tags: Option<serde_json::Value>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub locked: Option<bool>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub etag: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Label {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Error {
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub detail: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<i64>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct KeyListResult {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub items: Vec<Key>,
#[serde(rename = "@nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct KeyValueListResult {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub items: Vec<KeyValue>,
#[serde(rename = "@nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct LabelListResult {
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub items: Vec<Label>,
#[serde(rename = "@nextLink", default, skip_serializing_if = "Option::is_none")]
pub next_link: Option<String>,
}
Loading

0 comments on commit 8cb361b

Please sign in to comment.