|
| 1 | +#![doc = "generated by AutoRust 0.1.0"] |
| 2 | +#[cfg(feature = "package-preview-7.3-preview")] |
| 3 | +pub mod package_preview_7_3_preview; |
| 4 | +#[cfg(all(feature = "package-preview-7.3-preview", not(feature = "no-default-version")))] |
| 5 | +pub use package_preview_7_3_preview::{models, operations}; |
| 6 | +#[cfg(feature = "package-7.2")] |
| 7 | +pub mod package_7_2; |
| 8 | +#[cfg(all(feature = "package-7.2", not(feature = "no-default-version")))] |
| 9 | +pub use package_7_2::{models, operations}; |
| 10 | +#[cfg(feature = "package-7.2-preview")] |
| 11 | +pub mod package_7_2_preview; |
| 12 | +#[cfg(all(feature = "package-7.2-preview", not(feature = "no-default-version")))] |
| 13 | +pub use package_7_2_preview::{models, operations}; |
| 14 | +#[cfg(feature = "package-7.1")] |
| 15 | +pub mod package_7_1; |
| 16 | +#[cfg(all(feature = "package-7.1", not(feature = "no-default-version")))] |
| 17 | +pub use package_7_1::{models, operations}; |
| 18 | +#[cfg(feature = "package-7.1-preview")] |
| 19 | +pub mod package_7_1_preview; |
| 20 | +#[cfg(all(feature = "package-7.1-preview", not(feature = "no-default-version")))] |
| 21 | +pub use package_7_1_preview::{models, operations}; |
| 22 | +#[cfg(feature = "package-7.0")] |
| 23 | +pub mod package_7_0; |
| 24 | +#[cfg(all(feature = "package-7.0", not(feature = "no-default-version")))] |
| 25 | +pub use package_7_0::{models, operations}; |
| 26 | +#[cfg(feature = "package-7.0-preview")] |
| 27 | +pub mod package_7_0_preview; |
| 28 | +#[cfg(all(feature = "package-7.0-preview", not(feature = "no-default-version")))] |
| 29 | +pub use package_7_0_preview::{models, operations}; |
| 30 | +#[cfg(feature = "package-2016-10")] |
| 31 | +pub mod package_2016_10; |
| 32 | +#[cfg(all(feature = "package-2016-10", not(feature = "no-default-version")))] |
| 33 | +pub use package_2016_10::{models, operations}; |
| 34 | +#[cfg(feature = "package-2015-06")] |
| 35 | +pub mod package_2015_06; |
| 36 | +use azure_core::setters; |
| 37 | +#[cfg(all(feature = "package-2015-06", not(feature = "no-default-version")))] |
| 38 | +pub use package_2015_06::{models, operations}; |
| 39 | +pub fn config( |
| 40 | + http_client: std::sync::Arc<dyn azure_core::HttpClient>, |
| 41 | + token_credential: Box<dyn azure_core::TokenCredential>, |
| 42 | +) -> OperationConfigBuilder { |
| 43 | + OperationConfigBuilder { |
| 44 | + http_client, |
| 45 | + base_path: None, |
| 46 | + token_credential, |
| 47 | + token_credential_resource: None, |
| 48 | + } |
| 49 | +} |
| 50 | +pub struct OperationConfigBuilder { |
| 51 | + http_client: std::sync::Arc<dyn azure_core::HttpClient>, |
| 52 | + base_path: Option<String>, |
| 53 | + token_credential: Box<dyn azure_core::TokenCredential>, |
| 54 | + token_credential_resource: Option<String>, |
| 55 | +} |
| 56 | +impl OperationConfigBuilder { |
| 57 | + setters! { base_path : String => Some (base_path) , token_credential_resource : String => Some (token_credential_resource) , } |
| 58 | + pub fn build(self) -> OperationConfig { |
| 59 | + OperationConfig { |
| 60 | + http_client: self.http_client, |
| 61 | + base_path: self.base_path.unwrap_or("https://management.azure.com".to_owned()), |
| 62 | + token_credential: Some(self.token_credential), |
| 63 | + token_credential_resource: self.token_credential_resource.unwrap_or("https://management.azure.com/".to_owned()), |
| 64 | + } |
| 65 | + } |
| 66 | +} |
| 67 | +pub struct OperationConfig { |
| 68 | + http_client: std::sync::Arc<dyn azure_core::HttpClient>, |
| 69 | + base_path: String, |
| 70 | + token_credential: Option<Box<dyn azure_core::TokenCredential>>, |
| 71 | + token_credential_resource: String, |
| 72 | +} |
| 73 | +impl OperationConfig { |
| 74 | + pub fn http_client(&self) -> &dyn azure_core::HttpClient { |
| 75 | + self.http_client.as_ref() |
| 76 | + } |
| 77 | + pub fn base_path(&self) -> &str { |
| 78 | + self.base_path.as_str() |
| 79 | + } |
| 80 | + pub fn token_credential(&self) -> Option<&dyn azure_core::TokenCredential> { |
| 81 | + self.token_credential.as_deref() |
| 82 | + } |
| 83 | + pub fn token_credential_resource(&self) -> &str { |
| 84 | + self.token_credential_resource.as_str() |
| 85 | + } |
| 86 | +} |
0 commit comments